lustrec / include / mpfr_lustre.c @ e5d77428
History  View  Annotate  Download (5.34 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 conv

99  
100 
void MPFRint_to_real_step (int i, mpfr_t out) 
101 
{ 
102 
mpfr_set_si(out, i, MPFR_RNDN); 
103 
} 
104 
// functions of lustrec_math

105 
void MPFRacos_step (mpfr_t i,

106 
mpfr_t out 
107 
) 
108 
{ 
109 
mpfr_acos(out, i, MPFR_RNDN); 
110 
} 
111  
112 
void MPFRacosh_step (mpfr_t i,

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

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

125 
mpfr_t out 
126 
) 
127 
{ 
128 
mpfr_asinh(out, i, MPFR_RNDN); 
129 
} 
130 
void MPFRatan_step (mpfr_t i,

131 
mpfr_t out 
132 
) 
133 
{ 
134 
mpfr_atan(out, i, MPFR_RNDN); 
135 
} 
136  
137 
void MPFRatan2_step (mpfr_t y, mpfr_t x,

138 
mpfr_t out 
139 
) 
140 
{ 
141 
mpfr_atan2(out, y, x, MPFR_RNDN); 
142 
} 
143  
144 
void MPFRatanh_step (mpfr_t i,

145 
mpfr_t out 
146 
) 
147 
{ 
148 
mpfr_atanh(out, i, MPFR_RNDN); 
149 
} 
150 
void MPFRcbrt_step (mpfr_t i,

151 
mpfr_t out 
152 
) 
153 
{ 
154 
mpfr_cbrt(out, i, MPFR_RNDN); 
155 
} 
156  
157 
void MPFRcos_step (mpfr_t i,

158 
mpfr_t out 
159 
) 
160 
{ 
161 
mpfr_cos(out, i, MPFR_RNDN); 
162 
} 
163  
164 
void MPFRcosh_step (mpfr_t i,

165 
mpfr_t out 
166 
) 
167 
{ 
168 
mpfr_cosh(out, i, MPFR_RNDN); 
169 
} 
170  
171 
void MPFRceil_step (mpfr_t i,

172 
mpfr_t out 
173 
) 
174 
{ 
175 
mpfr_ceil(out, i); 
176 
} 
177  
178 
void MPFRerf_step (mpfr_t i,

179 
mpfr_t out 
180 
) 
181 
{ 
182 
mpfr_erf(out, i, MPFR_RNDN); 
183 
} 
184  
185 
void MPFRexp_step (mpfr_t i,

186 
mpfr_t out 
187 
) 
188 
{ 
189 
mpfr_exp(out, i, MPFR_RNDN); 
190 
} 
191  
192 
void MPFRfabs_step (mpfr_t i,

193 
mpfr_t out 
194 
) 
195 
{ 
196 
mpfr_abs(out, i, MPFR_RNDN); 
197 
} 
198  
199 
void MPFRfloor_step (mpfr_t i,

200 
mpfr_t out 
201 
) 
202 
{ 
203 
mpfr_floor(out, i); 
204 
} 
205  
206 
void MPFRfmod_step (mpfr_t i1, mpfr_t i2,

207 
mpfr_t out 
208 
) 
209 
{ 
210 
mpfr_fmod(out, i1, i2, MPFR_RNDN); 
211 
} 
212  
213 
void MPFRlog_step (mpfr_t i,

214 
mpfr_t out 
215 
) 
216 
{ 
217 
mpfr_log(out, i, MPFR_RNDN); 
218 
} 
219  
220 
void MPFRlog10_step (mpfr_t i,

221 
mpfr_t out 
222 
) 
223 
{ 
224 
mpfr_log10(out, i, MPFR_RNDN); 
225 
} 
226  
227 
void MPFRpow_step (mpfr_t i1, mpfr_t i2,

228 
mpfr_t out 
229 
) 
230 
{ 
231 
mpfr_pow(out, i1, i2, MPFR_RNDN); 
232 
} 
233  
234 
void MPFRround_step (mpfr_t i,

235 
mpfr_t out 
236 
) 
237 
{ 
238 
mpfr_round(out, i); 
239 
} 
240  
241 
void MPFRsin_step (mpfr_t i,

242 
mpfr_t out 
243 
) 
244 
{ 
245 
mpfr_sin(out, i, MPFR_RNDN); 
246 
} 
247  
248 
void MPFRsinh_step (mpfr_t i,

249 
mpfr_t out 
250 
) 
251 
{ 
252 
mpfr_sinh(out, i, MPFR_RNDN); 
253 
} 
254  
255 
void MPFRsqrt_step (mpfr_t i,

256 
mpfr_t out 
257 
) 
258 
{ 
259 
mpfr_sqrt(out, i, MPFR_RNDN); 
260 
} 
261  
262 
void MPFRtrunc_step (mpfr_t i,

263 
mpfr_t out 
264 
) 
265 
{ 
266 
mpfr_trunc(out, i); 
267 
} 
268  
269 
void MPFRtan_step (mpfr_t i,

270 
mpfr_t out 
271 
) 
272 
{ 
273 
mpfr_tan(out, i, MPFR_RNDN); 
274 
} 