struct di_d {POS int r; double x; long long i; double y; float dy; int e; };
struct fi_f {POS int r; float x; long long i; float y; float dy; int e; };
struct li_l {POS int r; long double x; long long i; long double y; float dy; int e; };
+struct d_i {POS int r; double x; long long i; int e; };
+struct f_i {POS int r; float x; long long i; int e; };
+struct l_i {POS int r; long double x; long long i; int e; };
+struct d_dd {POS int r; double x; double y; float dy; double y2; float dy2; int e; };
+struct f_ff {POS int r; float x; float y; float dy; float y2; float dy2; int e; };
+struct l_ll {POS int r; long double x; long double y; float dy; long double y2; float dy2; int e; };
#undef POS
char *estr(int);
char *rstr(int);
-int rconv(int *, char *);
-int econv(int *, char *);
-
-int eulp(double);
-int eulpf(float);
-int eulpl(long double);
float ulperr(double got, double want, float dwant);
float ulperrf(float got, float want, float dwant);
float ulperrl(long double got, long double want, float dwant);
-void setupfenv(int);
-int getexcept(void);
-
static int checkexcept(int got, int want, int r)
{
+ // TODO: we dont checkunderflow and inexact for now
if (r == RN)
- return got == want || got == (want|INEXACT);
- return 1; //(got|INEXACT|UNDERFLOW) == (want|INEXACT|UNDERFLOW);
+ return (got|INEXACT|UNDERFLOW) == (want|INEXACT|UNDERFLOW);
+// return got == want || got == (want|INEXACT);
+ return 1;
}
static int checkulp(float d, int r)
{
+ // TODO: we only care about >=1.5 ulp errors for now, should be 1.0
if (r == RN)
- return fabsf(d) <= 1.0;
- return 1; //fabsf(d) <= 2.0;
+ return fabsf(d) < 1.5;
+ return 1;
}