return 0;
}
+static double sinpi(double x) { return sin(3.141592653589793238*x); }
+int mpsinpi(struct t *t) { return mpd1(t, sinpi); }
+
+
+#define OP(n,op,t) static t n(t x, t y) { t z = x op y; return z; }
+OP(add,+,double)
+OP(addf,+,float)
+OP(addl,+,long double)
+OP(mul,*,double)
+OP(mulf,*,float)
+OP(mull,*,long double)
+OP(div,/,double)
+OP(divf,/,float)
+OP(divl,/,long double)
+int mpadd(struct t *t) { return mpd2(t, add); }
+int mpaddf(struct t *t) { return mpf2(t, addf); }
+int mpaddl(struct t *t) { return mpl2(t, addl); }
+int mpmul(struct t *t) { return mpd2(t, mul); }
+int mpmulf(struct t *t) { return mpf2(t, mulf); }
+int mpmull(struct t *t) { return mpl2(t, mull); }
+int mpdiv(struct t *t) { return mpd2(t, div); }
+int mpdivf(struct t *t) { return mpf2(t, divf); }
+int mpdivl(struct t *t) { return mpl2(t, divl); }
int mpacos(struct t *t) { return mpd1(t, acos); }
int mpacosf(struct t *t) { return mpf1(t, acosf); }
int mppow10f(struct t *t) { return mpf1(t, pow10f); }
int mppow10l(struct t *t) { return mpl1(t, pow10l); }
-#define mp_f_fi(n) \
+#define mp_fi_f(n) \
int mp##n(struct t *t) \
{ \
t->dy = 0; \
return 0; \
}
-mp_f_fi(ldexp)
-mp_f_fi(ldexpf)
-mp_f_fi(ldexpl)
-mp_f_fi(scalbn)
-mp_f_fi(scalbnf)
-mp_f_fi(scalbnl)
-mp_f_fi(scalbln)
-mp_f_fi(scalblnf)
-mp_f_fi(scalblnl)
+mp_fi_f(ldexp)
+mp_fi_f(ldexpf)
+mp_fi_f(ldexpl)
+mp_fi_f(scalbn)
+mp_fi_f(scalbnf)
+mp_fi_f(scalbnl)
+mp_fi_f(scalbln)
+mp_fi_f(scalblnf)
+mp_fi_f(scalblnl)
-#define mp_fi_f(n) \
+#define mp_f_fi(n) \
int mp##n(struct t *t) \
{ \
int i; \
return 0; \
}
-mp_fi_f(frexp)
-mp_fi_f(frexpf)
-mp_fi_f(frexpl)
-mp_fi_f(lgamma_r)
-mp_fi_f(lgammaf_r)
-mp_fi_f(lgammal_r)
+mp_f_fi(frexp)
+mp_f_fi(frexpf)
+mp_f_fi(frexpl)
+mp_f_fi(lgamma_r)
+mp_f_fi(lgammaf_r)
+mp_f_fi(lgammal_r)
int mplgamma(struct t *t)
{
mp_f_i(lroundf)
mp_f_i(lroundl)
+int mpmodf(struct t *t)
+{
+ double y2;
+
+ t->dy = t->dy2 = 0;
+ setupfenv(t->r);
+ t->y = modf(t->x, &y2);
+ t->y2 = y2;
+ t->e = getexcept();
+ return 0;
+}
+
+int mpmodff(struct t *t)
+{
+ float y2;
+
+ t->dy = t->dy2 = 0;
+ setupfenv(t->r);
+ t->y = modff(t->x, &y2);
+ t->y2 = y2;
+ t->e = getexcept();
+ return 0;
+}
+
+int mpmodfl(struct t *t)
+{
+ t->dy = t->dy2 = 0;
+ setupfenv(t->r);
+ t->y = modfl(t->x, &t->y2);
+ t->e = getexcept();
+ return 0;
+}
+
+int mpsincos(struct t *t)
+{
+ double y, y2;
+
+ t->dy = t->dy2 = 0;
+ setupfenv(t->r);
+ sincos(t->x, &y, &y2);
+ t->y = y;
+ t->y2 = y2;
+ t->e = getexcept();
+ return 0;
+}
+
+int mpsincosf(struct t *t)
+{
+ float y, y2;
+
+ t->dy = t->dy2 = 0;
+ setupfenv(t->r);
+ sincosf(t->x, &y, &y2);
+ t->y = y;
+ t->y2 = y2;
+ t->e = getexcept();
+ return 0;
+}
+
+int mpsincosl(struct t *t)
+{
+ t->dy = t->dy2 = 0;
+ setupfenv(t->r);
+ sincosl(t->x, &t->y, &t->y2);
+ t->e = getexcept();
+ return 0;
+}
+
+#define mp_ff_fi(n) \
+int mp##n(struct t *t) \
+{ \
+ int i; \
+ t->dy = 0; \
+ setupfenv(t->r); \
+ t->y = n(t->x, t->x2, &i); \
+ t->e = getexcept(); \
+ t->i = i; \
+ return 0; \
+}
+
+mp_ff_fi(remquo)
+mp_ff_fi(remquof)
+mp_ff_fi(remquol)
+
+#define mp_fff_f(n) \
+int mp##n(struct t *t) \
+{ \
+ t->dy = 0; \
+ setupfenv(t->r); \
+ t->y = n(t->x, t->x2, t->x3); \
+ t->e = getexcept(); \
+ return 0; \
+}
+
+mp_fff_f(fma)
+mp_fff_f(fmaf)
+mp_fff_f(fmal)
+
+#define mp_if_f(n) \
+int mp##n(struct t *t) \
+{ \
+ t->dy = 0; \
+ setupfenv(t->r); \
+ t->y = n(t->i, t->x); \
+ t->e = getexcept(); \
+ return 0; \
+}
+
+mp_if_f(jn)
+mp_if_f(jnf)
+//mp_if_f(jnl)
+mp_if_f(yn)
+mp_if_f(ynf)
+//mp_if_f(ynl)
+