PandA-2024.02
Main Page
Related Pages
Modules
+
Namespaces
Namespace List
+
Namespace Members
+
All
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
y
z
Functions
+
Variables
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
r
s
t
v
w
x
y
z
+
Data Structures
Data Structures
Data Structure Index
Class Hierarchy
+
Data Fields
+
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
+
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
+
Variables
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Typedefs
a
b
c
d
e
f
g
i
k
l
m
n
o
p
r
s
t
u
v
+
Enumerations
a
b
c
d
f
g
i
m
n
o
p
r
s
t
v
+
Enumerator
a
b
c
d
e
f
g
i
l
m
n
o
p
r
s
t
u
v
+
Related Functions
a
b
c
e
f
h
i
l
o
p
r
s
t
u
v
w
+
Files
File List
+
Globals
+
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
+
Variables
_
a
b
c
d
e
f
h
i
j
k
l
m
n
o
p
q
r
s
t
w
x
y
z
+
Typedefs
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
x
+
Enumerations
a
b
c
d
e
f
h
i
k
l
m
o
p
r
s
t
u
v
+
Enumerator
a
b
c
d
e
f
g
i
k
l
n
o
p
r
s
t
u
v
+
Macros
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
•
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Modules
Pages
documentation
tutorial_fpl_2022
03-optimizations
Exercise5
solution
module.c
Go to the documentation of this file.
1
#include <math.h>
2
3
#ifdef FP_SINGLE
4
#define FP_TYPE float
5
#define ACOS(a) acosf(a)
6
#else
7
#define FP_TYPE double
8
#define ACOS(a) acos(a)
9
#endif
10
11
#ifdef MULT_SQUARE
12
#define SQUARE(a) (a*a)
13
#else
14
#ifdef FP_SINGLE
15
#define SQUARE(a) powf(a,2)
16
#else
17
#define SQUARE(a) pow(a,2)
18
#endif
19
#endif
20
21
FP_TYPE
awesome_math
(
FP_TYPE
a,
FP_TYPE
b,
FP_TYPE
c)
22
{
23
return
ACOS
((
SQUARE
(a) +
SQUARE
(b) -
SQUARE
(c))/(2*a*b));
24
}
awesome_math
FP_TYPE awesome_math(FP_TYPE a, FP_TYPE b, FP_TYPE c)
Definition:
module.c:21
ACOS
#define ACOS(a)
Definition:
module.c:8
SQUARE
#define SQUARE(a)
Definition:
module.c:17
FP_TYPE
#define FP_TYPE
Definition:
module.c:7
Generated on Mon Feb 12 2024 13:02:48 for PandA-2024.02 by
1.8.13