Lines Matching refs:RT
10 RT(x) should add a return type specific suffix to x. */
16 static int RT(ulpscale_mpfr) (mpfr_t x, int t)
21 mpfr_exp_t e = mpfr_get_exp (x) - RT(prec);
22 if (e < RT(emin))
23 e = RT(emin) - 1;
24 if (e > RT(emax) - RT(prec))
25 e = RT(emax) - RT(prec);
29 return RT(emin) - 1;
31 return RT(emax) - RT(prec);
40 static double RT(ulperr) (RT(float) got, const struct RT(ret) * p, int r)
42 RT(float) want = p->y;
43 RT(float) d;
46 if (RT(asuint) (got) == RT(asuint) (want))
60 got = RT(copysign) (RT(halfinf), got);
65 want = RT(copysign) (RT(halfinf), want);
82 got = RT(nextafter) (got, want);
86 return RT(scalbn) (d, -p->ulpexp) + e;
89 static int RT(isok) (RT(float) ygot, int exgot, RT(float) ywant, int exwant,
92 return RT(asuint) (ygot) == RT(asuint) (ywant)
96 static int RT(isok_nofenv) (RT(float) ygot, RT(float) ywant)
98 return RT(asuint) (ygot) == RT(asuint) (ywant);
103 RT(float) * y, int *ex)
115 int r, RT(float) * y, int *ex)
122 int r, struct RT(ret) * p,
123 RT(float) ygot, int exgot)
130 RT(double) yl = T(call_long) (f, a);
131 p->y = (RT(float)) yl;
132 volatile RT(float) vy = p->y; // TODO: barrier
138 if (RT(isok) (ygot, exgot, p->y, p->ex, p->ex_may))
140 p->ulpexp = RT(ulpscale) (p->y);
142 p->tail = RT(lscalbn) (yl - (RT(double)) 2 * RT(halfinf), -p->ulpexp);
144 p->tail = RT(lscalbn) (yl - p->y, -p->ulpexp);
145 if (RT(fabs) (p->y) < RT(min_normal))
155 int r, struct RT(ret) * p,
156 RT(float) ygot, int exgot)
158 RT(double) yl = T(call_long) (f, a);
159 p->y = (RT(float)) yl;
160 if (RT(isok_nofenv) (ygot, p->y))
162 p->ulpexp = RT(ulpscale) (p->y);
164 p->tail = RT(lscalbn) (yl - (RT(double)) 2 * RT(halfinf), -p->ulpexp);
166 p->tail = RT(lscalbn) (yl - p->y, -p->ulpexp);
173 return T(reduce) (a, isnan, ||) && !T(reduce) (a, RT(issignaling), ||);
175 static inline RT(float) T(sum) (struct T(args) a)
182 int r_fenv, struct RT(ret) * p,
183 RT(float) ygot, int exgot)
188 MPFR_DECL_INIT(my, RT(prec_mpfr));
189 MPFR_DECL_INIT(mr, RT(prec));
190 MPFR_DECL_INIT(me, RT(prec_mpfr));
197 mpfr_set_emin (RT(emin));
198 mpfr_set_emax (RT(emax));
215 if (!mpfr_nanflag_p () && RT(isok) (ygot, exgot, p->y, p->ex, p->ex_may))
219 p->ulpexp = RT(ulpscale_mpfr) (my, t);
229 return RT(isok) (ygot, exgot, p->y, p->ex, p->ex_may);
233 return RT(isok) (ygot, exgot, p->y, p->ex, p->ex_may);
257 struct RT(ret) want;
261 RT(float) ygot;
262 RT(float) ygot2;
275 if (RT(asuint) (ygot) != RT(asuint) (ygot2))
291 double err = RT(ulperr) (ygot, &want, r);