1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
|
digraph TrigonometricsFunctions {
size="6,6";
node [shape=circle];
//
// -*- Basic Call -*-
//
F77_Call [label="Fortan Call", shape=doublecircle, color=green];
C_Call [label="C Call", shape=doublecircle, color=blue];
LAPACK_Call [label="LAPACK Call", shape=doublecircle, color=red];
//
// -*- Specific LAPACK Call -*-
//
Dlamch_E_Call [label="dlamch('E')", comment="Précision Machine - LAPACK", shape=doublecircle, color=red];
Dlamch_U_Call [label="dlamch('U')", comment="Borne Inférieure - LAPACK", shape=doublecircle, color=red];
Dlamch_O_Call [label="dlamch('O')", comment="Borne Supérieure - LAPACK", shape=doublecircle, color=red];
//
// -*- Functions definition -*-
//
// Cosinus
Cos_Real [label="cos(R)"];
Cos_Complex [label="cos(C)"];
Cos_Hyperbolic_Real [label="ch(R)"];
Cos_Hyperbolic_Complex [label="ch(C)"];
// Sinus
Sin_Real [label="sin(R)"];
Sin_Complex [label="sin(C)"];
Sin_Hyperbolic_Real [label="sh(R)"];
Sin_Hyperbolic_Complex [label="sh(C)"];
// Tangeante
Tan_Real [label="tan(R)"];
Tan_Complex [label="tan(C)", comment="wtan"];
Tan_Hyperbolic_Real [label="tanh(R)"];
Tan_Hyperbolic_Complex [label="tanh(C)"];
// ArcTaneante2
ATan2_Real [label="atan2(R)"];
// Exponentielle
Exp_Real [label="exp(R)"];
Exp_Complex [label="exp(C)"];
// Log
Log_Real [label="log(R)"];
Log_Positive_Real [label="log(R+)"];
Log_Negative_Real [label="log(R-)"];
Log_Complex [label="log(C)"];
// Log1p
Log1p_Real [label="log1p(R)"];
// Racine Carrée
Sqrt_Real [label="sqrt(R)"];
Sqrt_Positive_Real [label="sqrt(R+)"];
Sqrt_Negative_Real [label="sqrt(R-)"];
Sqrt_Complex [label="sqrt(C)", comment="wsqrt"];
// Valeur Absolue
Abs_Real [label="abs(R)", comment="|R|"];
// Signe
Sign_Real [label="sign(R)"];
// Pythagore
Pythag_Real [label="pythag(R)"];
//
// -*- Functions call links -*-
//
subgraph clusterLAPACK {
style=filled;
color=lightsteelblue1;
label="LAPACK";
// -*- DLAMCH -*-
Dlamch_E_Call -> LAPACK_Call;
Dlamch_U_Call -> LAPACK_Call;
Dlamch_O_Call -> LAPACK_Call;
}
// -*- COS -*-
//
// cos(a+ib) = cos(a).ch(b) - i.sin(a).sh(b)
Cos_Complex -> {
Cos_Real
Sin_Real
Cos_Hyperbolic_Real
Sin_Hyperbolic_Real
};
// Call a cosinus function in F77 math lib
Cos_Real -> F77_Call;
// -*- SIN -*-
//
// sin(a+ib) = sin(a).ch(b) + i.cos(a).sh(b)
Sin_Complex -> {
Cos_Real
Sin_Real
Cos_Hyperbolic_Real
Sin_Hyperbolic_Real
};
// Call a sinus function in F77 math lib
Sin_Real -> F77_Call;
// -*- TAN -*-
//
// tan(a+ib) = x_r + i.x_i
//
// x_r= 1/2 sin(2.a) / d
//
// x_i = | sh(2.b) / 2.d si |b| <= L
// | sign(a)
//
// d = cos(a)^2 + sh(b)^2
//
// L = 1 + log(2 / sqrt(dlamch('e')))
Tan_Complex -> {
Cos_Real
Sin_Hyperbolic_Real
Log_Real
Sqrt_Real
Dlamch_E_Call
Abs_Real
Sign_Real
};
// Call a tangeante function in F77 math lib
Tan_Real -> F77_Call;
// -*- LOG -*-
//
// log(a+ib) = x_r + i.x_i
//
// Constantes :
// L_inf = sqrt(dlamch('U'))
// L_sup = sqrt(R_max / 2)
// R_max = dlamch('O')
// t = pythag(|a|,|b|)
// r = |b|/|a|
//
// x_i = atan2(b, a)
//
// x_r = | 1/2 logp1((|a|-1)(|a|+1) + |b|^2) si 1/2 <= |a| <= sqrt(2)
// | 1/2 log(|a|^2 + |b|^2) si L_inf < |b| && |a| < L_sup
// | |a| si |a| > R_max
// | log(t) si t <= R_max
// | log(|a|) + 1/2 logp1(r^2) sinon
Log_Complex -> {
Sqrt_Real
Dlamch_U_Call
Dlamch_O_Call
Pythag_Real
Log1p_Real
Log_Real
Abs_Real
Pythag_Real
ATan2_Real
};
// Separate positive and negative case
Log_Real -> {
Log_Positive_Real
Log_Negative_Real
};
// Call another log function, treat it as complex
Log_Negative_Real -> Log_Complex;
// Call a log function in F77 math lib
Log_Positive_Real -> F77_Call;
// Call a log1p function in F77 math lib
Log1p_Real -> F77_Call;
// -*- SQRT -*-
//
// sqrt(a+ib) = x_r + i.x_i
//
// Constantes :
// Rmax = dlamch('O')
// BRmin = 2.dlamch('U')
// t = sqrt(2.|a| + pythag(a,b))
//
// (1) a = 0
//~~~~~~~~~~~~
// x_r = | sqrt(|b| / 2) si |b| <= BRmin
// | sqrt(|b|).sqrt(1/2)
//
// x_i = sign(b).x_r
//
// (2) |a| >= BRmax && |b| >= BRmax
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// - Si t > Rmax
// a = a / 16
// b = b / 16
// t = sqrt(2.|a| + pythag(a,b))
// x_r = | 2.t si a >= 0
// | 4.|b| / t
// x_i = | 4.b / t si a >= 0
// | 2.sign(b).t
//
// - Sinon
//
// x_r = | t / 2 si a >= 0
// | |b| / t
//
// x_i = | b / t si a >= 0
// | sign(b) / 2.t
//
// (3) Tous les cas pourris
//~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// x_r = | a + b si a is NaN && b is NaN
// | |b| si |b| > Rmax
// | 0 si a < -Rmax
// | a
//
// x_i = | a + b si a is NaN && b is NaN
// | b si |b| > Rmax
// | sign(b).|a| si a < -Rmax
// | 0
//
Sqrt_Complex -> {
Abs_Real
Sqrt_Real
Sign_Real
Pythag_Real
Dlamch_U_Call
Dlamch_O_Call
};
// Separate positive and negative case
Sqrt_Real -> {
Sqrt_Positive_Real
Sqrt_Negative_Real
};
// Call another sqrt function, treat it as complex
Sqrt_Negative_Real -> Sqrt_Complex;
// Call a sqrt function in F77 math lib
Sqrt_Positive_Real -> F77_Call;
// -*- PYTHAG -*-
//
// pythag(a,b) = sqrt(a^2 + b^2)
//
//
Pythag_Real -> {
Sqrt_Real
Dlamch_O_Call
};
// -*- SIGN -*-
//
// Call a sign function in F77 math lib
Sign_Real -> F77_Call;
// -*- ABS -*-
//
// Call a abs function in F77 math lib
Abs_Real -> F77_Call;
// -*- EXP -*-
//
// exp(a+i.b) = exp(a).cos(b) + i.exp(a)sin(b)
Exp_Complex -> {
Exp_Real
Cos_Real
Sin_Real
};
// Call a exp function in F77 math lib
Exp_Real -> F77_Call;
// -*- ATAN2 -*-
//
// Call atan2 function in C math lib
ATan2_Real -> C_Call;
}
|