math: regenerate all math tests
[libc-test] / src / math / gen / mplibm.c
index cf17d6d..2151259 100644 (file)
@@ -54,6 +54,15 @@ static int mpl2(struct t *s, long double (*f)(long double, long double))
        return 0;
 }
 
+static double sinpi(double x) { return sin(3.141592653589793238*x); }
+int mpsinpi(struct t *t) { return mpd1(t, sinpi); }
+
+static double add(double x, double y) { double z = x + y; return z; }
+int mpadd(struct t *t) { return mpd2(t, add); }
+static double mul(double x, double y) { double z = x * y; return z; }
+int mpmul(struct t *t) { return mpd2(t, mul); }
+static double div(double x, double y) { double z = x / y; return z; }
+int mpdiv(struct t *t) { return mpd2(t, div); }
 
 int mpacos(struct t *t) { return mpd1(t, acos); }
 int mpacosf(struct t *t) { return mpf1(t, acosf); }
@@ -411,3 +420,20 @@ 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)
+