lustrec / include / mpfr_lustre.c @ d948c0bd
History  View  Annotate  Download (5.23 KB)
1 
#include <mpfr.h> 

2 
#include "mpfr_lustre.h" 
3  
4 
void MPFR_LUSTRE_INIT () {

5 
return;

6 
} 
7  
8 
void MPFR_LUSTRE_CLEAR () {

9 
return;

10 
} 
11  
12 
void MPFRNeq_step (mpfr_t i1, mpfr_t i2,

13 
_Bool (*out) 
14 
) 
15 
{ 
16 
*out = mpfr_lessgreater_p(i1, i2); 
17 
} 
18  
19 
void MPFREq_step (mpfr_t i1, mpfr_t i2,

20 
_Bool (*out) 
21 
) 
22 
{ 
23 
*out = mpfr_equal_p(i1, i2); 
24 
} 
25  
26 
void MPFRGt_step (mpfr_t i1, mpfr_t i2,

27 
_Bool (*out) 
28 
) 
29 
{ 
30 
*out = mpfr_greater_p(i1, i2); 
31 
} 
32  
33 
void MPFRGe_step (mpfr_t i1, mpfr_t i2,

34 
_Bool (*out) 
35 
) 
36 
{ 
37 
*out = mpfr_greaterequal_p(i1, i2); 
38 
} 
39  
40 
extern void MPFRLt_step (mpfr_t i1, mpfr_t i2, 
41 
_Bool (*out) 
42 
) 
43 
{ 
44 
*out = mpfr_less_p(i1, i2); 
45 
} 
46 
void MPFRLe_step (mpfr_t i1, mpfr_t i2,

47 
_Bool (*out) 
48 
) 
49 
{ 
50 
*out = mpfr_lessequal_p(i1, i2); 
51 
} 
52  
53 
void MPFRDiv_step (mpfr_t i1, mpfr_t i2,

54 
mpfr_t out 
55 
) 
56 
{ 
57 
mpfr_div(out, i1, i2, MPFR_RNDN); 
58 
} 
59  
60 
void MPFRTimes_step (mpfr_t i1, mpfr_t i2,

61 
mpfr_t out 
62 
) 
63 
{ 
64 
mpfr_mul(out, i1, i2, MPFR_RNDN); 
65 
} 
66  
67 
void MPFRMinus_step (mpfr_t i1, mpfr_t i2,

68 
mpfr_t out 
69 
) 
70 
{ 
71 
mpfr_sub(out, i1, i2, MPFR_RNDN); 
72 
} 
73  
74 
void MPFRPlus_step (mpfr_t i1, mpfr_t i2,

75 
mpfr_t out 
76 
) 
77 
{ 
78 
mpfr_add(out, i1, i2, MPFR_RNDN); 
79 
} 
80  
81 
void MPFRUminus_step (mpfr_t i,

82 
mpfr_t out 
83 
) 
84 
{ 
85 
mpfr_neg(out, i, MPFR_RNDN); 
86 
} 
87  
88 
void MPFRInit(mpfr_t i, mpfr_prec_t prec)

89 
{ 
90 
mpfr_init2(i, prec); 
91 
} 
92  
93 
void MPFRClear(mpfr_t i)

94 
{ 
95 
mpfr_clear(i); 
96 
} 
97  
98 
// functions of lustrec_math

99 
void MPFRacos_step (mpfr_t i,

100 
mpfr_t out 
101 
) 
102 
{ 
103 
mpfr_acos(out, i, MPFR_RNDN); 
104 
} 
105  
106 
void MPFRacosh_step (mpfr_t i,

107 
mpfr_t out 
108 
) 
109 
{ 
110 
mpfr_acosh(out, i, MPFR_RNDN); 
111 
} 
112 
void MPFRasin_step (mpfr_t i,

113 
mpfr_t out 
114 
) 
115 
{ 
116 
mpfr_asin(out, i, MPFR_RNDN); 
117 
} 
118 
void MPFRasinh_step (mpfr_t i,

119 
mpfr_t out 
120 
) 
121 
{ 
122 
mpfr_asinh(out, i, MPFR_RNDN); 
123 
} 
124 
void MPFRatan_step (mpfr_t i,

125 
mpfr_t out 
126 
) 
127 
{ 
128 
mpfr_atan(out, i, MPFR_RNDN); 
129 
} 
130  
131 
void MPFRatan2_step (mpfr_t y, mpfr_t x,

132 
mpfr_t out 
133 
) 
134 
{ 
135 
mpfr_atan2(out, y, x, MPFR_RNDN); 
136 
} 
137  
138 
void MPFRatanh_step (mpfr_t i,

139 
mpfr_t out 
140 
) 
141 
{ 
142 
mpfr_atanh(out, i, MPFR_RNDN); 
143 
} 
144 
void MPFRcbrt_step (mpfr_t i,

145 
mpfr_t out 
146 
) 
147 
{ 
148 
mpfr_cbrt(out, i, MPFR_RNDN); 
149 
} 
150  
151 
void MPFRcos_step (mpfr_t i,

152 
mpfr_t out 
153 
) 
154 
{ 
155 
mpfr_cos(out, i, MPFR_RNDN); 
156 
} 
157  
158 
void MPFRcosh_step (mpfr_t i,

159 
mpfr_t out 
160 
) 
161 
{ 
162 
mpfr_cosh(out, i, MPFR_RNDN); 
163 
} 
164  
165 
void MPFRceil_step (mpfr_t i,

166 
mpfr_t out 
167 
) 
168 
{ 
169 
mpfr_ceil(out, i); 
170 
} 
171  
172 
void MPFRerf_step (mpfr_t i,

173 
mpfr_t out 
174 
) 
175 
{ 
176 
mpfr_erf(out, i, MPFR_RNDN); 
177 
} 
178  
179 
void MPFRexp_step (mpfr_t i,

180 
mpfr_t out 
181 
) 
182 
{ 
183 
mpfr_exp(out, i, MPFR_RNDN); 
184 
} 
185  
186 
void MPFRfabs_step (mpfr_t i,

187 
mpfr_t out 
188 
) 
189 
{ 
190 
mpfr_abs(out, i, MPFR_RNDN); 
191 
} 
192  
193 
void MPFRfloor_step (mpfr_t i,

194 
mpfr_t out 
195 
) 
196 
{ 
197 
mpfr_floor(out, i); 
198 
} 
199  
200 
void MPFRfmod_step (mpfr_t i1, mpfr_t i2,

201 
mpfr_t out 
202 
) 
203 
{ 
204 
mpfr_fmod(out, i1, i2, MPFR_RNDN); 
205 
} 
206  
207 
void MPFRlog_step (mpfr_t i,

208 
mpfr_t out 
209 
) 
210 
{ 
211 
mpfr_log(out, i, MPFR_RNDN); 
212 
} 
213  
214 
void MPFRlog10_step (mpfr_t i,

215 
mpfr_t out 
216 
) 
217 
{ 
218 
mpfr_log10(out, i, MPFR_RNDN); 
219 
} 
220  
221 
void MPFRpow_step (mpfr_t i1, mpfr_t i2,

222 
mpfr_t out 
223 
) 
224 
{ 
225 
mpfr_pow(out, i1, i2, MPFR_RNDN); 
226 
} 
227  
228 
void MPFRround_step (mpfr_t i,

229 
mpfr_t out 
230 
) 
231 
{ 
232 
mpfr_round(out, i); 
233 
} 
234  
235 
void MPFRsin_step (mpfr_t i,

236 
mpfr_t out 
237 
) 
238 
{ 
239 
mpfr_sin(out, i, MPFR_RNDN); 
240 
} 
241  
242 
void MPFRsinh_step (mpfr_t i,

243 
mpfr_t out 
244 
) 
245 
{ 
246 
mpfr_sinh(out, i, MPFR_RNDN); 
247 
} 
248  
249 
void MPFRsqrt_step (mpfr_t i,

250 
mpfr_t out 
251 
) 
252 
{ 
253 
mpfr_sqrt(out, i, MPFR_RNDN); 
254 
} 
255  
256 
void MPFRtrunc_step (mpfr_t i,

257 
mpfr_t out 
258 
) 
259 
{ 
260 
mpfr_trunc(out, i); 
261 
} 
262  
263 
void MPFRtan_step (mpfr_t i,

264 
mpfr_t out 
265 
) 
266 
{ 
267 
mpfr_tan(out, i, MPFR_RNDN); 
268 
} 