|
nsz |
f9d179 |
#include "gen.h"
|
|
nsz |
f9d179 |
|
|
nsz |
f9d179 |
static int mpf1(struct t *s, float (*f)(float))
|
|
nsz |
f9d179 |
{
|
|
nsz |
f9d179 |
s->dy = 0;
|
|
nsz |
f9d179 |
setupfenv(s->r);
|
|
nsz |
f9d179 |
s->y = f(s->x);
|
|
nsz |
f9d179 |
s->e = getexcept();
|
|
nsz |
f9d179 |
return 0;
|
|
nsz |
f9d179 |
}
|
|
nsz |
f9d179 |
|
|
nsz |
f9d179 |
static int mpf2(struct t *s, float (*f)(float,float))
|
|
nsz |
f9d179 |
{
|
|
nsz |
f9d179 |
s->dy = 0;
|
|
nsz |
f9d179 |
setupfenv(s->r);
|
|
nsz |
f9d179 |
s->y = f(s->x, s->x2);
|
|
nsz |
f9d179 |
s->e = getexcept();
|
|
nsz |
f9d179 |
return 0;
|
|
nsz |
f9d179 |
}
|
|
nsz |
f9d179 |
|
|
nsz |
f9d179 |
static int mpd1(struct t *s, double (*f)(double))
|
|
nsz |
f9d179 |
{
|
|
nsz |
f9d179 |
s->dy = 0;
|
|
nsz |
f9d179 |
setupfenv(s->r);
|
|
nsz |
f9d179 |
s->y = f(s->x);
|
|
nsz |
f9d179 |
s->e = getexcept();
|
|
nsz |
f9d179 |
return 0;
|
|
nsz |
f9d179 |
}
|
|
nsz |
f9d179 |
|
|
nsz |
f9d179 |
static int mpd2(struct t *s, double (*f)(double, double))
|
|
nsz |
f9d179 |
{
|
|
nsz |
f9d179 |
s->dy = 0;
|
|
nsz |
f9d179 |
setupfenv(s->r);
|
|
nsz |
f9d179 |
s->y = f(s->x, s->x2);
|
|
nsz |
f9d179 |
s->e = getexcept();
|
|
nsz |
f9d179 |
return 0;
|
|
nsz |
f9d179 |
}
|
|
nsz |
f9d179 |
|
|
nsz |
f9d179 |
static int mpl1(struct t *s, long double (*f)(long double))
|
|
nsz |
f9d179 |
{
|
|
nsz |
f9d179 |
s->dy = 0;
|
|
nsz |
f9d179 |
setupfenv(s->r);
|
|
nsz |
f9d179 |
s->y = f(s->x);
|
|
nsz |
f9d179 |
s->e = getexcept();
|
|
nsz |
f9d179 |
return 0;
|
|
nsz |
f9d179 |
}
|
|
nsz |
f9d179 |
|
|
nsz |
f9d179 |
static int mpl2(struct t *s, long double (*f)(long double, long double))
|
|
nsz |
f9d179 |
{
|
|
nsz |
f9d179 |
setupfenv(s->r);
|
|
nsz |
f9d179 |
s->y = f(s->x, s->x2);
|
|
nsz |
f9d179 |
s->dy = 0;
|
|
nsz |
f9d179 |
s->e = getexcept();
|
|
nsz |
f9d179 |
return 0;
|
|
nsz |
f9d179 |
}
|
|
nsz |
f9d179 |
|
|
Szabolcs Nagy |
c58b8e |
static double sinpi(double x) { return sin(3.141592653589793238*x); }
|
|
Szabolcs Nagy |
c58b8e |
int mpsinpi(struct t *t) { return mpd1(t, sinpi); }
|
|
Szabolcs Nagy |
c58b8e |
|
|
Szabolcs Nagy |
7fd3b8 |
|
|
Szabolcs Nagy |
7fd3b8 |
#define OP(n,op,t) static t n(t x, t y) { t z = x op y; return z; }
|
|
Szabolcs Nagy |
7fd3b8 |
OP(add,+,double)
|
|
Szabolcs Nagy |
7fd3b8 |
OP(addf,+,float)
|
|
Szabolcs Nagy |
7fd3b8 |
OP(addl,+,long double)
|
|
Szabolcs Nagy |
7fd3b8 |
OP(mul,*,double)
|
|
Szabolcs Nagy |
7fd3b8 |
OP(mulf,*,float)
|
|
Szabolcs Nagy |
7fd3b8 |
OP(mull,*,long double)
|
|
Szabolcs Nagy |
7fd3b8 |
OP(div,/,double)
|
|
Szabolcs Nagy |
7fd3b8 |
OP(divf,/,float)
|
|
Szabolcs Nagy |
7fd3b8 |
OP(divl,/,long double)
|
|
Szabolcs Nagy |
ae0f0f |
int mpadd(struct t *t) { return mpd2(t, add); }
|
|
Szabolcs Nagy |
7fd3b8 |
int mpaddf(struct t *t) { return mpf2(t, addf); }
|
|
Szabolcs Nagy |
7fd3b8 |
int mpaddl(struct t *t) { return mpl2(t, addl); }
|
|
Szabolcs Nagy |
c58b8e |
int mpmul(struct t *t) { return mpd2(t, mul); }
|
|
Szabolcs Nagy |
7fd3b8 |
int mpmulf(struct t *t) { return mpf2(t, mulf); }
|
|
Szabolcs Nagy |
7fd3b8 |
int mpmull(struct t *t) { return mpl2(t, mull); }
|
|
Szabolcs Nagy |
c58b8e |
int mpdiv(struct t *t) { return mpd2(t, div); }
|
|
Szabolcs Nagy |
7fd3b8 |
int mpdivf(struct t *t) { return mpf2(t, divf); }
|
|
Szabolcs Nagy |
7fd3b8 |
int mpdivl(struct t *t) { return mpl2(t, divl); }
|
|
nsz |
f9d179 |
|
|
nsz |
f9d179 |
int mpacos(struct t *t) { return mpd1(t, acos); }
|
|
nsz |
f9d179 |
int mpacosf(struct t *t) { return mpf1(t, acosf); }
|
|
nsz |
f9d179 |
int mpacosl(struct t *t) { return mpl1(t, acosl); }
|
|
nsz |
f9d179 |
int mpacosh(struct t *t) { return mpd1(t, acosh); }
|
|
nsz |
f9d179 |
int mpacoshf(struct t *t) { return mpf1(t, acoshf); }
|
|
nsz |
f9d179 |
int mpacoshl(struct t *t) { return mpl1(t, acoshl); }
|
|
nsz |
f9d179 |
int mpasin(struct t *t) { return mpd1(t, asin); }
|
|
nsz |
f9d179 |
int mpasinf(struct t *t) { return mpf1(t, asinf); }
|
|
nsz |
f9d179 |
int mpasinl(struct t *t) { return mpl1(t, asinl); }
|
|
nsz |
f9d179 |
int mpasinh(struct t *t) { return mpd1(t, asinh); }
|
|
nsz |
f9d179 |
int mpasinhf(struct t *t) { return mpf1(t, asinhf); }
|
|
nsz |
f9d179 |
int mpasinhl(struct t *t) { return mpl1(t, asinhl); }
|
|
nsz |
f9d179 |
int mpatan(struct t *t) { return mpd1(t, atan); }
|
|
nsz |
f9d179 |
int mpatanf(struct t *t) { return mpf1(t, atanf); }
|
|
nsz |
f9d179 |
int mpatanl(struct t *t) { return mpl1(t, atanl); }
|
|
nsz |
f9d179 |
int mpatan2(struct t *t) { return mpd2(t, atan2); }
|
|
nsz |
f9d179 |
int mpatan2f(struct t *t) { return mpf2(t, atan2f); }
|
|
nsz |
f9d179 |
int mpatan2l(struct t *t) { return mpl2(t, atan2l); }
|
|
nsz |
f9d179 |
int mpatanh(struct t *t) { return mpd1(t, atanh); }
|
|
nsz |
f9d179 |
int mpatanhf(struct t *t) { return mpf1(t, atanhf); }
|
|
nsz |
f9d179 |
int mpatanhl(struct t *t) { return mpl1(t, atanhl); }
|
|
nsz |
f9d179 |
int mpcbrt(struct t *t) { return mpd1(t, cbrt); }
|
|
nsz |
f9d179 |
int mpcbrtf(struct t *t) { return mpf1(t, cbrtf); }
|
|
nsz |
f9d179 |
int mpcbrtl(struct t *t) { return mpl1(t, cbrtl); }
|
|
nsz |
f9d179 |
int mpceil(struct t *t) { return mpd1(t, ceil); }
|
|
nsz |
f9d179 |
int mpceilf(struct t *t) { return mpf1(t, ceilf); }
|
|
nsz |
f9d179 |
int mpceill(struct t *t) { return mpl1(t, ceill); }
|
|
nsz |
f9d179 |
int mpcopysign(struct t *t) { return mpd2(t, copysign); }
|
|
nsz |
f9d179 |
int mpcopysignf(struct t *t) { return mpf2(t, copysignf); }
|
|
nsz |
f9d179 |
int mpcopysignl(struct t *t) { return mpl2(t, copysignl); }
|
|
nsz |
f9d179 |
int mpcos(struct t *t) { return mpd1(t, cos); }
|
|
nsz |
f9d179 |
int mpcosf(struct t *t) { return mpf1(t, cosf); }
|
|
nsz |
f9d179 |
int mpcosl(struct t *t) { return mpl1(t, cosl); }
|
|
nsz |
f9d179 |
int mpcosh(struct t *t) { return mpd1(t, cosh); }
|
|
nsz |
f9d179 |
int mpcoshf(struct t *t) { return mpf1(t, coshf); }
|
|
nsz |
f9d179 |
int mpcoshl(struct t *t) { return mpl1(t, coshl); }
|
|
nsz |
f9d179 |
int mperf(struct t *t) { return mpd1(t, erf); }
|
|
nsz |
f9d179 |
int mperff(struct t *t) { return mpf1(t, erff); }
|
|
nsz |
f9d179 |
int mperfl(struct t *t) { return mpl1(t, erfl); }
|
|
nsz |
f9d179 |
int mperfc(struct t *t) { return mpd1(t, erfc); }
|
|
nsz |
f9d179 |
int mperfcf(struct t *t) { return mpf1(t, erfcf); }
|
|
nsz |
f9d179 |
int mperfcl(struct t *t) { return mpl1(t, erfcl); }
|
|
nsz |
f9d179 |
int mpexp(struct t *t) { return mpd1(t, exp); }
|
|
nsz |
f9d179 |
int mpexpf(struct t *t) { return mpf1(t, expf); }
|
|
nsz |
f9d179 |
int mpexpl(struct t *t) { return mpl1(t, expl); }
|
|
nsz |
f9d179 |
int mpexp2(struct t *t) { return mpd1(t, exp2); }
|
|
nsz |
f9d179 |
int mpexp2f(struct t *t) { return mpf1(t, exp2f); }
|
|
nsz |
f9d179 |
int mpexp2l(struct t *t) { return mpl1(t, exp2l); }
|
|
nsz |
f9d179 |
int mpexpm1(struct t *t) { return mpd1(t, expm1); }
|
|
nsz |
f9d179 |
int mpexpm1f(struct t *t) { return mpf1(t, expm1f); }
|
|
nsz |
f9d179 |
int mpexpm1l(struct t *t) { return mpl1(t, expm1l); }
|
|
nsz |
f9d179 |
int mpfabs(struct t *t) { return mpd1(t, fabs); }
|
|
nsz |
f9d179 |
int mpfabsf(struct t *t) { return mpf1(t, fabsf); }
|
|
nsz |
f9d179 |
int mpfabsl(struct t *t) { return mpl1(t, fabsl); }
|
|
nsz |
f9d179 |
int mpfdim(struct t *t) { return mpd2(t, fdim); }
|
|
nsz |
f9d179 |
int mpfdimf(struct t *t) { return mpf2(t, fdimf); }
|
|
nsz |
f9d179 |
int mpfdiml(struct t *t) { return mpl2(t, fdiml); }
|
|
nsz |
f9d179 |
int mpfloor(struct t *t) { return mpd1(t, floor); }
|
|
nsz |
f9d179 |
int mpfloorf(struct t *t) { return mpf1(t, floorf); }
|
|
nsz |
f9d179 |
int mpfloorl(struct t *t) { return mpl1(t, floorl); }
|
|
nsz |
f9d179 |
int mpfmax(struct t *t) { return mpd2(t, fmax); }
|
|
nsz |
f9d179 |
int mpfmaxf(struct t *t) { return mpf2(t, fmaxf); }
|
|
nsz |
f9d179 |
int mpfmaxl(struct t *t) { return mpl2(t, fmaxl); }
|
|
nsz |
f9d179 |
int mpfmin(struct t *t) { return mpd2(t, fmin); }
|
|
nsz |
f9d179 |
int mpfminf(struct t *t) { return mpf2(t, fminf); }
|
|
nsz |
f9d179 |
int mpfminl(struct t *t) { return mpl2(t, fminl); }
|
|
nsz |
f9d179 |
int mpfmod(struct t *t) { return mpd2(t, fmod); }
|
|
nsz |
f9d179 |
int mpfmodf(struct t *t) { return mpf2(t, fmodf); }
|
|
nsz |
f9d179 |
int mpfmodl(struct t *t) { return mpl2(t, fmodl); }
|
|
nsz |
f9d179 |
int mphypot(struct t *t) { return mpd2(t, hypot); }
|
|
nsz |
f9d179 |
int mphypotf(struct t *t) { return mpf2(t, hypotf); }
|
|
nsz |
f9d179 |
int mphypotl(struct t *t) { return mpl2(t, hypotl); }
|
|
nsz |
f9d179 |
int mplog(struct t *t) { return mpd1(t, log); }
|
|
nsz |
f9d179 |
int mplogf(struct t *t) { return mpf1(t, logf); }
|
|
nsz |
f9d179 |
int mplogl(struct t *t) { return mpl1(t, logl); }
|
|
nsz |
f9d179 |
int mplog10(struct t *t) { return mpd1(t, log10); }
|
|
nsz |
f9d179 |
int mplog10f(struct t *t) { return mpf1(t, log10f); }
|
|
nsz |
f9d179 |
int mplog10l(struct t *t) { return mpl1(t, log10l); }
|
|
nsz |
f9d179 |
int mplog1p(struct t *t) { return mpd1(t, log1p); }
|
|
nsz |
f9d179 |
int mplog1pf(struct t *t) { return mpf1(t, log1pf); }
|
|
nsz |
f9d179 |
int mplog1pl(struct t *t) { return mpl1(t, log1pl); }
|
|
nsz |
f9d179 |
int mplog2(struct t *t) { return mpd1(t, log2); }
|
|
nsz |
f9d179 |
int mplog2f(struct t *t) { return mpf1(t, log2f); }
|
|
nsz |
f9d179 |
int mplog2l(struct t *t) { return mpl1(t, log2l); }
|
|
nsz |
f9d179 |
int mplogb(struct t *t) { return mpd1(t, logb); }
|
|
nsz |
f9d179 |
int mplogbf(struct t *t) { return mpf1(t, logbf); }
|
|
nsz |
f9d179 |
int mplogbl(struct t *t) { return mpl1(t, logbl); }
|
|
nsz |
f9d179 |
int mpnearbyint(struct t *t) { return mpd1(t, nearbyint); }
|
|
nsz |
f9d179 |
int mpnearbyintf(struct t *t) { return mpf1(t, nearbyintf); }
|
|
nsz |
f9d179 |
int mpnearbyintl(struct t *t) { return mpl1(t, nearbyintl); }
|
|
nsz |
f9d179 |
int mpnextafter(struct t *t) { return mpd2(t, nextafter); }
|
|
nsz |
f9d179 |
int mpnextafterf(struct t *t) { return mpf2(t, nextafterf); }
|
|
nsz |
f9d179 |
int mpnextafterl(struct t *t) { return mpl2(t, nextafterl); }
|
|
nsz |
ddfb9f |
int mpnexttoward(struct t *t)
|
|
nsz |
ddfb9f |
{
|
|
nsz |
ddfb9f |
feclearexcept(FE_ALL_EXCEPT);
|
|
nsz |
ddfb9f |
t->y = nexttoward(t->x, t->x2);
|
|
nsz |
ddfb9f |
t->e = getexcept();
|
|
nsz |
ddfb9f |
t->dy = 0;
|
|
nsz |
ddfb9f |
return 0;
|
|
nsz |
ddfb9f |
}
|
|
nsz |
ddfb9f |
int mpnexttowardf(struct t *t)
|
|
nsz |
ddfb9f |
{
|
|
nsz |
ddfb9f |
feclearexcept(FE_ALL_EXCEPT);
|
|
nsz |
ddfb9f |
t->y = nexttowardf(t->x, t->x2);
|
|
nsz |
ddfb9f |
t->e = getexcept();
|
|
nsz |
ddfb9f |
t->dy = 0;
|
|
nsz |
ddfb9f |
return 0;
|
|
nsz |
ddfb9f |
}
|
|
nsz |
f9d179 |
int mpnexttowardl(struct t *t) { return mpl2(t, nexttowardl); }
|
|
nsz |
f9d179 |
int mppow(struct t *t) { return mpd2(t, pow); }
|
|
nsz |
f9d179 |
int mppowf(struct t *t) { return mpf2(t, powf); }
|
|
nsz |
f9d179 |
int mppowl(struct t *t) { return mpl2(t, powl); }
|
|
nsz |
f9d179 |
int mpremainder(struct t *t) { return mpd2(t, remainder); }
|
|
nsz |
f9d179 |
int mpremainderf(struct t *t) { return mpf2(t, remainderf); }
|
|
nsz |
f9d179 |
int mpremainderl(struct t *t) { return mpl2(t, remainderl); }
|
|
nsz |
f9d179 |
int mprint(struct t *t) { return mpd1(t, rint); }
|
|
nsz |
f9d179 |
int mprintf(struct t *t) { return mpf1(t, rintf); }
|
|
nsz |
f9d179 |
int mprintl(struct t *t) { return mpl1(t, rintl); }
|
|
nsz |
f9d179 |
int mpround(struct t *t) { return mpd1(t, round); }
|
|
nsz |
f9d179 |
int mproundf(struct t *t) { return mpf1(t, roundf); }
|
|
nsz |
f9d179 |
int mproundl(struct t *t) { return mpl1(t, roundl); }
|
|
nsz |
f9d179 |
int mpsin(struct t *t) { return mpd1(t, sin); }
|
|
nsz |
f9d179 |
int mpsinf(struct t *t) { return mpf1(t, sinf); }
|
|
nsz |
f9d179 |
int mpsinl(struct t *t) { return mpl1(t, sinl); }
|
|
nsz |
f9d179 |
int mpsinh(struct t *t) { return mpd1(t, sinh); }
|
|
nsz |
f9d179 |
int mpsinhf(struct t *t) { return mpf1(t, sinhf); }
|
|
nsz |
f9d179 |
int mpsinhl(struct t *t) { return mpl1(t, sinhl); }
|
|
nsz |
f9d179 |
int mpsqrt(struct t *t) { return mpd1(t, sqrt); }
|
|
nsz |
f9d179 |
int mpsqrtf(struct t *t) { return mpf1(t, sqrtf); }
|
|
nsz |
f9d179 |
int mpsqrtl(struct t *t) { return mpl1(t, sqrtl); }
|
|
nsz |
f9d179 |
int mptan(struct t *t) { return mpd1(t, tan); }
|
|
nsz |
f9d179 |
int mptanf(struct t *t) { return mpf1(t, tanf); }
|
|
nsz |
f9d179 |
int mptanl(struct t *t) { return mpl1(t, tanl); }
|
|
nsz |
f9d179 |
int mptanh(struct t *t) { return mpd1(t, tanh); }
|
|
nsz |
f9d179 |
int mptanhf(struct t *t) { return mpf1(t, tanhf); }
|
|
nsz |
f9d179 |
int mptanhl(struct t *t) { return mpl1(t, tanhl); }
|
|
nsz |
f9d179 |
int mptgamma(struct t *t) { return mpd1(t, tgamma); }
|
|
nsz |
f9d179 |
int mptgammaf(struct t *t) { return mpf1(t, tgammaf); }
|
|
nsz |
f9d179 |
int mptgammal(struct t *t) { return mpl1(t, tgammal); }
|
|
nsz |
f9d179 |
int mptrunc(struct t *t) { return mpd1(t, trunc); }
|
|
nsz |
f9d179 |
int mptruncf(struct t *t) { return mpf1(t, truncf); }
|
|
nsz |
f9d179 |
int mptruncl(struct t *t) { return mpl1(t, truncl); }
|
|
nsz |
f9d179 |
int mpj0(struct t *t) { return mpd1(t, j0); }
|
|
nsz |
f9d179 |
int mpj1(struct t *t) { return mpd1(t, j1); }
|
|
nsz |
f9d179 |
int mpy0(struct t *t) { return mpd1(t, y0); }
|
|
nsz |
f9d179 |
int mpy1(struct t *t) { return mpd1(t, y1); }
|
|
nsz |
f9d179 |
int mpscalb(struct t *t) { return mpd2(t, scalb); }
|
|
nsz |
f9d179 |
int mpscalbf(struct t *t) { return mpf2(t, scalbf); }
|
|
nsz |
f9d179 |
int mpj0f(struct t *t) { return mpf1(t, j0f); }
|
|
nsz |
f9d179 |
int mpj0l(struct t *t) { return -1;}//mpl1(t, j0l); }
|
|
nsz |
f9d179 |
int mpj1f(struct t *t) { return mpf1(t, j1f); }
|
|
nsz |
f9d179 |
int mpj1l(struct t *t) { return -1;}//mpl1(t, j1l); }
|
|
nsz |
f9d179 |
int mpy0f(struct t *t) { return mpf1(t, y0f); }
|
|
nsz |
f9d179 |
int mpy0l(struct t *t) { return -1;}//mpl1(t, y0l); }
|
|
nsz |
f9d179 |
int mpy1f(struct t *t) { return mpf1(t, y1f); }
|
|
nsz |
f9d179 |
int mpy1l(struct t *t) { return -1;}//mpl1(t, y1l); }
|
|
nsz |
f9d179 |
int mpexp10(struct t *t) { return mpd1(t, exp10); }
|
|
nsz |
f9d179 |
int mpexp10f(struct t *t) { return mpf1(t, exp10f); }
|
|
nsz |
f9d179 |
int mpexp10l(struct t *t) { return mpl1(t, exp10l); }
|
|
nsz |
f9d179 |
int mppow10(struct t *t) { return mpd1(t, pow10); }
|
|
nsz |
f9d179 |
int mppow10f(struct t *t) { return mpf1(t, pow10f); }
|
|
nsz |
f9d179 |
int mppow10l(struct t *t) { return mpl1(t, pow10l); }
|
|
nsz |
f9d179 |
|
|
nsz |
588927 |
#define mp_fi_f(n) \
|
|
nsz |
b5bbc6 |
int mp##n(struct t *t) \
|
|
nsz |
b5bbc6 |
{ \
|
|
nsz |
b5bbc6 |
t->dy = 0; \
|
|
nsz |
b5bbc6 |
setupfenv(t->r); \
|
|
nsz |
b5bbc6 |
t->y = n(t->x, t->i); \
|
|
nsz |
b5bbc6 |
t->e = getexcept(); \
|
|
nsz |
b5bbc6 |
return 0; \
|
|
nsz |
f9d179 |
}
|
|
nsz |
f9d179 |
|
|
nsz |
588927 |
mp_fi_f(ldexp)
|
|
nsz |
588927 |
mp_fi_f(ldexpf)
|
|
nsz |
588927 |
mp_fi_f(ldexpl)
|
|
nsz |
588927 |
mp_fi_f(scalbn)
|
|
nsz |
588927 |
mp_fi_f(scalbnf)
|
|
nsz |
588927 |
mp_fi_f(scalbnl)
|
|
nsz |
588927 |
mp_fi_f(scalbln)
|
|
nsz |
588927 |
mp_fi_f(scalblnf)
|
|
nsz |
588927 |
mp_fi_f(scalblnl)
|
|
nsz |
b5bbc6 |
|
|
nsz |
588927 |
#define mp_f_fi(n) \
|
|
nsz |
b5bbc6 |
int mp##n(struct t *t) \
|
|
nsz |
b5bbc6 |
{ \
|
|
nsz |
b5bbc6 |
int i; \
|
|
nsz |
b5bbc6 |
t->dy = 0; \
|
|
nsz |
b5bbc6 |
setupfenv(t->r); \
|
|
nsz |
b5bbc6 |
t->y = n(t->x, &i); \
|
|
nsz |
b5bbc6 |
t->e = getexcept(); \
|
|
nsz |
b5bbc6 |
t->i = i; \
|
|
nsz |
b5bbc6 |
return 0; \
|
|
nsz |
f9d179 |
}
|
|
nsz |
f9d179 |
|
|
nsz |
588927 |
mp_f_fi(frexp)
|
|
nsz |
588927 |
mp_f_fi(frexpf)
|
|
nsz |
588927 |
mp_f_fi(frexpl)
|
|
nsz |
588927 |
mp_f_fi(lgamma_r)
|
|
nsz |
588927 |
mp_f_fi(lgammaf_r)
|
|
nsz |
588927 |
mp_f_fi(lgammal_r)
|
|
nsz |
f9d179 |
|
|
nsz |
f9d179 |
int mplgamma(struct t *t)
|
|
nsz |
f9d179 |
{
|
|
nsz |
f9d179 |
t->dy = 0;
|
|
nsz |
f9d179 |
setupfenv(t->r);
|
|
nsz |
f9d179 |
t->y = lgamma(t->x);
|
|
nsz |
f9d179 |
t->e = getexcept();
|
|
nsz |
f9d179 |
t->i = signgam;
|
|
nsz |
f9d179 |
return 0;
|
|
nsz |
f9d179 |
}
|
|
nsz |
f9d179 |
|
|
nsz |
f9d179 |
int mplgammaf(struct t *t)
|
|
nsz |
f9d179 |
{
|
|
nsz |
f9d179 |
t->dy = 0;
|
|
nsz |
f9d179 |
setupfenv(t->r);
|
|
nsz |
f9d179 |
t->y = lgammaf(t->x);
|
|
nsz |
f9d179 |
t->e = getexcept();
|
|
nsz |
f9d179 |
t->i = signgam;
|
|
nsz |
f9d179 |
return 0;
|
|
nsz |
f9d179 |
}
|
|
nsz |
f9d179 |
|
|
nsz |
f9d179 |
int mplgammal(struct t *t)
|
|
nsz |
f9d179 |
{
|
|
nsz |
f9d179 |
t->dy = 0;
|
|
nsz |
f9d179 |
setupfenv(t->r);
|
|
nsz |
f9d179 |
t->y = lgammal(t->x);
|
|
nsz |
f9d179 |
t->e = getexcept();
|
|
nsz |
f9d179 |
t->i = signgam;
|
|
nsz |
f9d179 |
return 0;
|
|
nsz |
f9d179 |
}
|
|
nsz |
f9d179 |
|
|
nsz |
b5bbc6 |
#define mp_f_i(n) \
|
|
nsz |
b5bbc6 |
int mp##n(struct t *t) \
|
|
nsz |
b5bbc6 |
{ \
|
|
nsz |
b5bbc6 |
setupfenv(t->r); \
|
|
nsz |
b5bbc6 |
t->i = n(t->x); \
|
|
nsz |
b5bbc6 |
t->e = getexcept(); \
|
|
nsz |
b5bbc6 |
return 0; \
|
|
nsz |
f9d179 |
}
|
|
nsz |
f9d179 |
|
|
nsz |
b5bbc6 |
mp_f_i(ilogb)
|
|
nsz |
b5bbc6 |
mp_f_i(ilogbf)
|
|
nsz |
b5bbc6 |
mp_f_i(ilogbl)
|
|
nsz |
b5bbc6 |
mp_f_i(llrint)
|
|
nsz |
b5bbc6 |
mp_f_i(llrintf)
|
|
nsz |
b5bbc6 |
mp_f_i(llrintl)
|
|
nsz |
b5bbc6 |
mp_f_i(lrint)
|
|
nsz |
b5bbc6 |
mp_f_i(lrintf)
|
|
nsz |
b5bbc6 |
mp_f_i(lrintl)
|
|
nsz |
b5bbc6 |
mp_f_i(llround)
|
|
nsz |
b5bbc6 |
mp_f_i(llroundf)
|
|
nsz |
b5bbc6 |
mp_f_i(llroundl)
|
|
nsz |
b5bbc6 |
mp_f_i(lround)
|
|
nsz |
b5bbc6 |
mp_f_i(lroundf)
|
|
nsz |
b5bbc6 |
mp_f_i(lroundl)
|
|
nsz |
2146d5 |
|
|
nsz |
cb9f87 |
int mpmodf(struct t *t)
|
|
nsz |
cb9f87 |
{
|
|
nsz |
cb9f87 |
double y2;
|
|
nsz |
cb9f87 |
|
|
nsz |
cb9f87 |
t->dy = t->dy2 = 0;
|
|
nsz |
cb9f87 |
setupfenv(t->r);
|
|
nsz |
cb9f87 |
t->y = modf(t->x, &y2;;
|
|
nsz |
cb9f87 |
t->y2 = y2;
|
|
nsz |
cb9f87 |
t->e = getexcept();
|
|
nsz |
cb9f87 |
return 0;
|
|
nsz |
cb9f87 |
}
|
|
nsz |
cb9f87 |
|
|
nsz |
cb9f87 |
int mpmodff(struct t *t)
|
|
nsz |
cb9f87 |
{
|
|
nsz |
cb9f87 |
float y2;
|
|
nsz |
cb9f87 |
|
|
nsz |
cb9f87 |
t->dy = t->dy2 = 0;
|
|
nsz |
cb9f87 |
setupfenv(t->r);
|
|
nsz |
cb9f87 |
t->y = modff(t->x, &y2;;
|
|
nsz |
cb9f87 |
t->y2 = y2;
|
|
nsz |
cb9f87 |
t->e = getexcept();
|
|
nsz |
cb9f87 |
return 0;
|
|
nsz |
cb9f87 |
}
|
|
nsz |
cb9f87 |
|
|
nsz |
cb9f87 |
int mpmodfl(struct t *t)
|
|
nsz |
cb9f87 |
{
|
|
nsz |
cb9f87 |
t->dy = t->dy2 = 0;
|
|
nsz |
cb9f87 |
setupfenv(t->r);
|
|
nsz |
cb9f87 |
t->y = modfl(t->x, &t->y2);
|
|
nsz |
cb9f87 |
t->e = getexcept();
|
|
nsz |
cb9f87 |
return 0;
|
|
nsz |
cb9f87 |
}
|
|
nsz |
cb9f87 |
|
|
nsz |
cb9f87 |
int mpsincos(struct t *t)
|
|
nsz |
cb9f87 |
{
|
|
nsz |
cb9f87 |
double y, y2;
|
|
nsz |
cb9f87 |
|
|
nsz |
cb9f87 |
t->dy = t->dy2 = 0;
|
|
nsz |
cb9f87 |
setupfenv(t->r);
|
|
nsz |
cb9f87 |
sincos(t->x, &y, &y2;;
|
|
nsz |
cb9f87 |
t->y = y;
|
|
nsz |
cb9f87 |
t->y2 = y2;
|
|
nsz |
cb9f87 |
t->e = getexcept();
|
|
nsz |
cb9f87 |
return 0;
|
|
nsz |
cb9f87 |
}
|
|
nsz |
cb9f87 |
|
|
nsz |
cb9f87 |
int mpsincosf(struct t *t)
|
|
nsz |
cb9f87 |
{
|
|
nsz |
cb9f87 |
float y, y2;
|
|
nsz |
cb9f87 |
|
|
nsz |
cb9f87 |
t->dy = t->dy2 = 0;
|
|
nsz |
cb9f87 |
setupfenv(t->r);
|
|
nsz |
cb9f87 |
sincosf(t->x, &y, &y2;;
|
|
nsz |
cb9f87 |
t->y = y;
|
|
nsz |
cb9f87 |
t->y2 = y2;
|
|
nsz |
cb9f87 |
t->e = getexcept();
|
|
nsz |
cb9f87 |
return 0;
|
|
nsz |
cb9f87 |
}
|
|
nsz |
cb9f87 |
|
|
nsz |
cb9f87 |
int mpsincosl(struct t *t)
|
|
nsz |
cb9f87 |
{
|
|
nsz |
cb9f87 |
t->dy = t->dy2 = 0;
|
|
nsz |
cb9f87 |
setupfenv(t->r);
|
|
nsz |
cb9f87 |
sincosl(t->x, &t->y, &t->y2);
|
|
nsz |
cb9f87 |
t->e = getexcept();
|
|
nsz |
cb9f87 |
return 0;
|
|
nsz |
cb9f87 |
}
|
|
nsz |
588927 |
|
|
nsz |
588927 |
#define mp_ff_fi(n) \
|
|
nsz |
588927 |
int mp##n(struct t *t) \
|
|
nsz |
588927 |
{ \
|
|
nsz |
588927 |
int i; \
|
|
nsz |
588927 |
t->dy = 0; \
|
|
nsz |
588927 |
setupfenv(t->r); \
|
|
nsz |
588927 |
t->y = n(t->x, t->x2, &i); \
|
|
nsz |
588927 |
t->e = getexcept(); \
|
|
nsz |
588927 |
t->i = i; \
|
|
nsz |
588927 |
return 0; \
|
|
nsz |
588927 |
}
|
|
nsz |
588927 |
|
|
nsz |
588927 |
mp_ff_fi(remquo)
|
|
nsz |
588927 |
mp_ff_fi(remquof)
|
|
nsz |
588927 |
mp_ff_fi(remquol)
|
|
nsz |
588927 |
|
|
nsz |
588927 |
#define mp_fff_f(n) \
|
|
nsz |
588927 |
int mp##n(struct t *t) \
|
|
nsz |
588927 |
{ \
|
|
nsz |
588927 |
t->dy = 0; \
|
|
nsz |
588927 |
setupfenv(t->r); \
|
|
nsz |
588927 |
t->y = n(t->x, t->x2, t->x3); \
|
|
nsz |
588927 |
t->e = getexcept(); \
|
|
nsz |
588927 |
return 0; \
|
|
nsz |
588927 |
}
|
|
nsz |
588927 |
|
|
nsz |
588927 |
mp_fff_f(fma)
|
|
nsz |
588927 |
mp_fff_f(fmaf)
|
|
nsz |
588927 |
mp_fff_f(fmal)
|
|
nsz |
588927 |
|
|
nsz |
21dd45 |
#define mp_if_f(n) \
|
|
nsz |
21dd45 |
int mp##n(struct t *t) \
|
|
nsz |
21dd45 |
{ \
|
|
nsz |
21dd45 |
t->dy = 0; \
|
|
nsz |
21dd45 |
setupfenv(t->r); \
|
|
nsz |
21dd45 |
t->y = n(t->i, t->x); \
|
|
nsz |
21dd45 |
t->e = getexcept(); \
|
|
nsz |
21dd45 |
return 0; \
|
|
nsz |
21dd45 |
}
|
|
nsz |
21dd45 |
|
|
nsz |
21dd45 |
mp_if_f(jn)
|
|
nsz |
21dd45 |
mp_if_f(jnf)
|
|
nsz |
21dd45 |
//mp_if_f(jnl)
|
|
nsz |
21dd45 |
mp_if_f(yn)
|
|
nsz |
21dd45 |
mp_if_f(ynf)
|
|
nsz |
21dd45 |
//mp_if_f(ynl)
|
|
nsz |
21dd45 |
|