ddfb9f math: add nextafter*, nextoward* and scalb to gen

Authored and Committed by nsz 12 years ago
    math: add nextafter*, nextoward* and scalb to gen
    
        
file modified
+2 -0
src/math/gen/functions.h CHANGED
@@ -91,6 +91,8 @@ T(nearbyintl, l_l)
91
91
T(nextafter, dd_d)
92
92
T(nextafterf, ff_f)
93
93
T(nextafterl, ll_l)
94
+ T(nexttoward, ll_d)
95
+ T(nexttowardf, ll_f)
94
96
T(nexttowardl, ll_l)
95
97
T(pow, dd_d)
96
98
T(powf, ff_f)
src/math/gen/gensanity.sh ADDED
@@ -0,0 +1,51 @@
1
+ #!/bin/sh
2
+
3
+ D=../sanity
4
+
5
+ sed 's/^T(//;s/,//;s/)//' functions.h | while read N T
6
+ do
7
+ case $T in
8
+ d_*|f_*|l_*) ./gen $N >$D/$N.h <<EOF
9
+ -8.06684839057968126823036836721962107
10
+ +4.34523984933830528860918339265097582
11
+ -8.38143342755524846875570469976848365
12
+ -6.53167358191348375502677177380274565
13
+ +9.26705696697258528046907106996633473
14
+ +0.66198589809950443806520229507072615
15
+ -0.40660392238535529519351490505650392
16
+ +0.56175974622072409170769641066459813
17
+ +0.77415229659130372834006997382367211
18
+ -0.67876370263940246316802166606111153
19
+ EOF
20
+ ;;
21
+ di_*|fi_*|li_*) ./gen $N >$D/$N.h <<EOF
22
+ -8.06684839057968126823036836721962107 -2
23
+ +4.34523984933830528860918339265097582 -1
24
+ -8.38143342755524846875570469976848365 0
25
+ -6.53167358191348375502677177380274565 1
26
+ +9.26705696697258528046907106996633473 2
27
+ +0.66198589809950443806520229507072615 3
28
+ -0.40660392238535529519351490505650392 4
29
+ +0.56175974622072409170769641066459813 5
30
+ +0.77415229659130372834006997382367211 6
31
+ -0.67876370263940246316802166606111153 7
32
+ EOF
33
+ ;;
34
+ dd_*|ff_*|ll_*) ./gen $N >$D/$N.h <<EOF
35
+ -8.06684839057968126823036836721962107 +4.53566256067686864057537788388811764
36
+ +4.34523984933830528860918339265097582 -8.88799136300345123622768770110757083
37
+ -8.38143342755524846875570469976848365 -2.76360733737958805493258686740202557
38
+ -6.53167358191348375502677177380274565 +4.56753527684274348416184388263831508
39
+ +9.26705696697258528046907106996633473 +4.81139208435979589730560859417420750
40
+ -6.45004555606023597579444426311945845 +0.66207179233767389593411946503559251
41
+ +7.85889025304169636815211127446301636 +0.05215452675006224789817853073306709
42
+ -0.79205451198489594412029014134600873 +7.67640268511754002832536318951411755
43
+ +0.61570267319792408792325107549103713 +2.01190257903248027376896111888376742
44
+ -0.55875868236091523814033056701077708 +0.03223983060263803856752696457418850
45
+ EOF
46
+ ;;
47
+ *) echo "bad type: $T"
48
+ ;;
49
+ esac
50
+ done
51
+
file modified
+59 -6
src/math/gen/mp.c CHANGED
@@ -497,10 +497,48 @@ int mplogbl(struct t *t)
497
497
int mpnearbyint(struct t *t) { return mpd1(t, wrap_nearbyint) || (t->e&=~INEXACT, 0); }
498
498
int mpnearbyintf(struct t *t) { return mpf1(t, wrap_nearbyint) || (t->e&=~INEXACT, 0); }
499
499
int mpnearbyintl(struct t *t) { return mpl1(t, wrap_nearbyint) || (t->e&=~INEXACT, 0); }
500
- int mpnextafter(struct t *t) { return -1; }
501
- int mpnextafterf(struct t *t) { return -1; }
502
- int mpnextafterl(struct t *t) { return -1; }
503
- int mpnexttowardl(struct t *t) { return -1; }
500
+ // TODO: hard to implement with mpfr
501
+ int mpnextafter(struct t *t)
502
+ {
503
+ feclearexcept(FE_ALL_EXCEPT);
504
+ t->y = nextafter(t->x, t->x2);
505
+ t->e = getexcept();
506
+ t->dy = 0;
507
+ return 0;
508
+ }
509
+ int mpnextafterf(struct t *t)
510
+ {
511
+ feclearexcept(FE_ALL_EXCEPT);
512
+ t->y = nextafterf(t->x, t->x2);
513
+ t->e = getexcept();
514
+ t->dy = 0;
515
+ return 0;
516
+ }
517
+ int mpnextafterl(struct t *t)
518
+ {
519
+ feclearexcept(FE_ALL_EXCEPT);
520
+ t->y = nextafterl(t->x, t->x2);
521
+ t->e = getexcept();
522
+ t->dy = 0;
523
+ return 0;
524
+ }
525
+ int mpnexttoward(struct t *t)
526
+ {
527
+ feclearexcept(FE_ALL_EXCEPT);
528
+ t->y = nexttoward(t->x, t->x2);
529
+ t->e = getexcept();
530
+ t->dy = 0;
531
+ return 0;
532
+ }
533
+ int mpnexttowardf(struct t *t)
534
+ {
535
+ feclearexcept(FE_ALL_EXCEPT);
536
+ t->y = nexttowardf(t->x, t->x2);
537
+ t->e = getexcept();
538
+ t->dy = 0;
539
+ return 0;
540
+ }
541
+ int mpnexttowardl(struct t *t) { return mpnextafterl(t); }
504
542
int mppow(struct t *t) { return mpd2(t, mpfr_pow); }
505
543
int mppowf(struct t *t) { return mpf2(t, mpfr_pow); }
506
544
int mppowl(struct t *t) { return mpl2(t, mpfr_pow); }
@@ -538,8 +576,23 @@ int mpj0(struct t *t) { return mpd1(t, mpfr_j0); }
538
576
int mpj1(struct t *t) { return mpd1(t, mpfr_j1); }
539
577
int mpy0(struct t *t) { return mpd1(t, mpfr_y0); }
540
578
int mpy1(struct t *t) { return mpd1(t, mpfr_y1); }
541
- int mpscalb(struct t *t) { return -1; }
542
- int mpscalbf(struct t *t) { return -1; }
579
+ // TODO: non standard functions
580
+ int mpscalb(struct t *t)
581
+ {
582
+ setupfenv(t->r);
583
+ t->y = scalb(t->x, t->x2);
584
+ t->e = getexcept();
585
+ t->dy = 0; // wrong
586
+ return 0;
587
+ }
588
+ int mpscalbf(struct t *t)
589
+ {
590
+ setupfenv(t->r);
591
+ t->y = scalbf(t->x, t->x2);
592
+ t->e = getexcept();
593
+ t->dy = 0; // wrong
594
+ return 0;
595
+ }
543
596
int mpj0f(struct t *t) { return mpf1(t, mpfr_j0); }
544
597
int mpj0l(struct t *t) { return mpl1(t, mpfr_j0); }
545
598
int mpj1f(struct t *t) { return mpf1(t, mpfr_j1); }
file modified
+16 -0
src/math/gen/mplibm.c CHANGED
@@ -150,6 +150,22 @@ int mpnearbyintl(struct t *t) { return mpl1(t, nearbyintl); }
150
150
int mpnextafter(struct t *t) { return mpd2(t, nextafter); }
151
151
int mpnextafterf(struct t *t) { return mpf2(t, nextafterf); }
152
152
int mpnextafterl(struct t *t) { return mpl2(t, nextafterl); }
153
+ int mpnexttoward(struct t *t)
154
+ {
155
+ feclearexcept(FE_ALL_EXCEPT);
156
+ t->y = nexttoward(t->x, t->x2);
157
+ t->e = getexcept();
158
+ t->dy = 0;
159
+ return 0;
160
+ }
161
+ int mpnexttowardf(struct t *t)
162
+ {
163
+ feclearexcept(FE_ALL_EXCEPT);
164
+ t->y = nexttowardf(t->x, t->x2);
165
+ t->e = getexcept();
166
+ t->dy = 0;
167
+ return 0;
168
+ }
153
169
int mpnexttowardl(struct t *t) { return mpl2(t, nexttowardl); }
154
170
int mppow(struct t *t) { return mpd2(t, pow); }
155
171
int mppowf(struct t *t) { return mpf2(t, powf); }
src/math/gen/template/ll_d.c ADDED
@@ -0,0 +1,45 @@
1
+ #include <stdint.h>
2
+ #include <stdio.h>
3
+ #include "util.h"
4
+
5
+ static struct ll_l t[] = {
6
+ #if LDBL_MANT_DIG == 53
7
+ DHEADERS
8
+ #elif LDBL_MANT_DIG == 64
9
+ HEADERS
10
+ #endif
11
+ };
12
+
13
+ int main(void)
14
+ {
15
+ #pragma STDC FENV_ACCESS ON
16
+ long double y;
17
+ float d;
18
+ int e, i, err = 0;
19
+ struct ll_l *p;
20
+
21
+ for (i = 0; i < sizeof t/sizeof *t; i++) {
22
+ p = t + i;
23
+
24
+ if (p->r < 0)
25
+ continue;
26
+ fesetround(p->r);
27
+ feclearexcept(FE_ALL_EXCEPT);
28
+ y = ___(p->x, p->x2);
29
+ e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW);
30
+
31
+ if (!checkexcept(e, p->e, p->r)) {
32
+ printf("%s:%d: bad fp exception: %s ___(%La,%La)=%La, want %s",
33
+ p->file, p->line, rstr(p->r), p->x, p->x2, p->y, estr(p->e));
34
+ printf(" got %s\n", estr(e));
35
+ err++;
36
+ }
37
+ d = ulperrl(y, p->y, p->dy);
38
+ if (!checkulp(d, p->r)) {
39
+ printf("%s:%d: %s ___(%La,%La) want %La got %La ulperr %.3f = %a + %a\n",
40
+ p->file, p->line, rstr(p->r), p->x, p->x2, p->y, y, d, d-p->dy, p->dy);
41
+ err++;
42
+ }
43
+ }
44
+ return !!err;
45
+ }
src/math/gen/template/ll_f.c ADDED
@@ -0,0 +1,45 @@
1
+ #include <stdint.h>
2
+ #include <stdio.h>
3
+ #include "util.h"
4
+
5
+ static struct ll_l t[] = {
6
+ #if LDBL_MANT_DIG == 53
7
+ DHEADERS
8
+ #elif LDBL_MANT_DIG == 64
9
+ HEADERS
10
+ #endif
11
+ };
12
+
13
+ int main(void)
14
+ {
15
+ #pragma STDC FENV_ACCESS ON
16
+ long double y;
17
+ float d;
18
+ int e, i, err = 0;
19
+ struct ll_l *p;
20
+
21
+ for (i = 0; i < sizeof t/sizeof *t; i++) {
22
+ p = t + i;
23
+
24
+ if (p->r < 0)
25
+ continue;
26
+ fesetround(p->r);
27
+ feclearexcept(FE_ALL_EXCEPT);
28
+ y = ___(p->x, p->x2);
29
+ e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW);
30
+
31
+ if (!checkexcept(e, p->e, p->r)) {
32
+ printf("%s:%d: bad fp exception: %s ___(%La,%La)=%La, want %s",
33
+ p->file, p->line, rstr(p->r), p->x, p->x2, p->y, estr(p->e));
34
+ printf(" got %s\n", estr(e));
35
+ err++;
36
+ }
37
+ d = ulperrl(y, p->y, p->dy);
38
+ if (!checkulp(d, p->r)) {
39
+ printf("%s:%d: %s ___(%La,%La) want %La got %La ulperr %.3f = %a + %a\n",
40
+ p->file, p->line, rstr(p->r), p->x, p->x2, p->y, y, d, d-p->dy, p->dy);
41
+ err++;
42
+ }
43
+ }
44
+ return !!err;
45
+ }
file modified
+1 -0
src/math/nextafter.c CHANGED
@@ -3,6 +3,7 @@
3
3
#include "util.h"
4
4
5
5
static struct dd_d t[] = {
6
+ #include "sanity/nextafter.h"
6
7
7
8
};
8
9
file modified
+1 -0
src/math/nextafterf.c CHANGED
@@ -3,6 +3,7 @@
3
3
#include "util.h"
4
4
5
5
static struct ff_f t[] = {
6
+ #include "sanity/nextafterf.h"
6
7
7
8
};
8
9
file modified
+2 -0
src/math/nextafterl.c CHANGED
@@ -4,8 +4,10 @@
4
4
5
5
static struct ll_l t[] = {
6
6
#if LDBL_MANT_DIG == 53
7
+ #include "sanity/nextafter.h"
7
8
8
9
#elif LDBL_MANT_DIG == 64
10
+ #include "sanity/nextafterl.h"
9
11
10
12
#endif
11
13
};
src/math/nexttoward.c ADDED
@@ -0,0 +1,47 @@
1
+ #include <stdint.h>
2
+ #include <stdio.h>
3
+ #include "util.h"
4
+
5
+ static struct ll_l t[] = {
6
+ #if LDBL_MANT_DIG == 53
7
+ #include "sanity/nexttoward.h"
8
+
9
+ #elif LDBL_MANT_DIG == 64
10
+ #include "sanity/nexttoward.h"
11
+
12
+ #endif
13
+ };
14
+
15
+ int main(void)
16
+ {
17
+ #pragma STDC FENV_ACCESS ON
18
+ long double y;
19
+ float d;
20
+ int e, i, err = 0;
21
+ struct ll_l *p;
22
+
23
+ for (i = 0; i < sizeof t/sizeof *t; i++) {
24
+ p = t + i;
25
+
26
+ if (p->r < 0)
27
+ continue;
28
+ fesetround(p->r);
29
+ feclearexcept(FE_ALL_EXCEPT);
30
+ y = nexttoward(p->x, p->x2);
31
+ e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW);
32
+
33
+ if (!checkexcept(e, p->e, p->r)) {
34
+ printf("%s:%d: bad fp exception: %s nexttoward(%La,%La)=%La, want %s",
35
+ p->file, p->line, rstr(p->r), p->x, p->x2, p->y, estr(p->e));
36
+ printf(" got %s\n", estr(e));
37
+ err++;
38
+ }
39
+ d = ulperrl(y, p->y, p->dy);
40
+ if (!checkulp(d, p->r)) {
41
+ printf("%s:%d: %s nexttoward(%La,%La) want %La got %La ulperr %.3f = %a + %a\n",
42
+ p->file, p->line, rstr(p->r), p->x, p->x2, p->y, y, d, d-p->dy, p->dy);
43
+ err++;
44
+ }
45
+ }
46
+ return !!err;
47
+ }
src/math/nexttowardf.c ADDED
@@ -0,0 +1,47 @@
1
+ #include <stdint.h>
2
+ #include <stdio.h>
3
+ #include "util.h"
4
+
5
+ static struct ll_l t[] = {
6
+ #if LDBL_MANT_DIG == 53
7
+ #include "sanity/nexttowardf.h"
8
+
9
+ #elif LDBL_MANT_DIG == 64
10
+ #include "sanity/nexttowardf.h"
11
+
12
+ #endif
13
+ };
14
+
15
+ int main(void)
16
+ {
17
+ #pragma STDC FENV_ACCESS ON
18
+ long double y;
19
+ float d;
20
+ int e, i, err = 0;
21
+ struct ll_l *p;
22
+
23
+ for (i = 0; i < sizeof t/sizeof *t; i++) {
24
+ p = t + i;
25
+
26
+ if (p->r < 0)
27
+ continue;
28
+ fesetround(p->r);
29
+ feclearexcept(FE_ALL_EXCEPT);
30
+ y = nexttowardf(p->x, p->x2);
31
+ e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW);
32
+
33
+ if (!checkexcept(e, p->e, p->r)) {
34
+ printf("%s:%d: bad fp exception: %s nexttowardf(%La,%La)=%La, want %s",
35
+ p->file, p->line, rstr(p->r), p->x, p->x2, p->y, estr(p->e));
36
+ printf(" got %s\n", estr(e));
37
+ err++;
38
+ }
39
+ d = ulperrl(y, p->y, p->dy);
40
+ if (!checkulp(d, p->r)) {
41
+ printf("%s:%d: %s nexttowardf(%La,%La) want %La got %La ulperr %.3f = %a + %a\n",
42
+ p->file, p->line, rstr(p->r), p->x, p->x2, p->y, y, d, d-p->dy, p->dy);
43
+ err++;
44
+ }
45
+ }
46
+ return !!err;
47
+ }
file modified
+2 -0
src/math/nexttowardl.c CHANGED
@@ -4,8 +4,10 @@
4
4
5
5
static struct ll_l t[] = {
6
6
#if LDBL_MANT_DIG == 53
7
+ #include "sanity/nexttoward.h"
7
8
8
9
#elif LDBL_MANT_DIG == 64
10
+ #include "sanity/nexttowardl.h"
9
11
10
12
#endif
11
13
};
src/math/sanity/nextafter.h ADDED
@@ -0,0 +1,10 @@
1
+ T(RN, -0x1.02239f3c6a8f1p+3, 0x1.22484b9ef31fp+2, -0x1.02239f3c6a8fp+3, 0x0p+0, 0)
2
+ T(RN, 0x1.161868e18bc67p+2, -0x1.1c6a6cdce75e8p+3, 0x1.161868e18bc66p+2, 0x0p+0, 0)
3
+ T(RN, -0x1.0c34b3e01e6e7p+3, -0x1.61bde29e83f6dp+1, -0x1.0c34b3e01e6e6p+3, 0x0p+0, 0)
4
+ T(RN, -0x1.a206f0a19dcc4p+2, 0x1.24527f7b576acp+2, -0x1.a206f0a19dcc3p+2, 0x0p+0, 0)
5
+ T(RN, 0x1.288bbb0d6a1e6p+3, 0x1.33edd910a3c01p+2, 0x1.288bbb0d6a1e5p+3, 0x0p+0, 0)
6
+ T(RN, -0x1.9ccd8be03f495p+2, 0x1.52fb12ef638a1p-1, -0x1.9ccd8be03f494p+2, 0x0p+0, 0)
7
+ T(RN, 0x1.f6f80ed2eab44p+2, 0x1.ab3ff8575b21dp-5, 0x1.f6f80ed2eab43p+2, 0x0p+0, 0)
8
+ T(RN, -0x1.95882b433fad3p-1, 0x1.eb4a2e7ce0693p+2, -0x1.95882b433fad2p-1, 0x0p+0, 0)
9
+ T(RN, 0x1.3b3d617ae3c4ap-1, 0x1.01860611d75e1p+1, 0x1.3b3d617ae3c4bp-1, 0x0p+0, 0)
10
+ T(RN, -0x1.1e159e36313eep-1, 0x1.081bd34224213p-5, -0x1.1e159e36313edp-1, 0x0p+0, 0)
src/math/sanity/nextafterf.h ADDED
@@ -0,0 +1,10 @@
1
+ T(RN, -0x1.0223ap+3, 0x1.22484cp+2, -0x1.02239ep+3, 0x0p+0, 0)
2
+ T(RN, 0x1.161868p+2, -0x1.1c6a6cp+3, 0x1.161866p+2, 0x0p+0, 0)
3
+ T(RN, -0x1.0c34b4p+3, -0x1.61bde2p+1, -0x1.0c34b2p+3, 0x0p+0, 0)
4
+ T(RN, -0x1.a206fp+2, 0x1.24528p+2, -0x1.a206eep+2, 0x0p+0, 0)
5
+ T(RN, 0x1.288bbcp+3, 0x1.33eddap+2, 0x1.288bbap+3, 0x0p+0, 0)
6
+ T(RN, -0x1.9ccd8cp+2, 0x1.52fb12p-1, -0x1.9ccd8ap+2, 0x0p+0, 0)
7
+ T(RN, 0x1.f6f80ep+2, 0x1.ab3ff8p-5, 0x1.f6f80cp+2, 0x0p+0, 0)
8
+ T(RN, -0x1.95882cp-1, 0x1.eb4a2ep+2, -0x1.95882ap-1, 0x0p+0, 0)
9
+ T(RN, 0x1.3b3d62p-1, 0x1.018606p+1, 0x1.3b3d64p-1, 0x0p+0, 0)
10
+ T(RN, -0x1.1e159ep-1, 0x1.081bd4p-5, -0x1.1e159cp-1, 0x0p+0, 0)
src/math/sanity/nextafterl.h ADDED
@@ -0,0 +1,10 @@
1
+ T(RN, -0x1.02239f3c6a8f13dep+3L, 0x1.22484b9ef31efd4p+2L, -0x1.02239f3c6a8f13dcp+3L, 0x0p+0, 0)
2
+ T(RN, 0x1.161868e18bc67782p+2L, -0x1.1c6a6cdce75e83acp+3L, 0x1.161868e18bc6778p+2L, 0x0p+0, 0)
3
+ T(RN, -0x1.0c34b3e01e6e682cp+3L, -0x1.61bde29e83f6cb16p+1L, -0x1.0c34b3e01e6e682ap+3L, 0x0p+0, 0)
4
+ T(RN, -0x1.a206f0a19dcc3948p+2L, 0x1.24527f7b576abb6p+2L, -0x1.a206f0a19dcc3946p+2L, 0x0p+0, 0)
5
+ T(RN, 0x1.288bbb0d6a1e5bdap+3L, 0x1.33edd910a3c00b7p+2L, 0x1.288bbb0d6a1e5bd8p+3L, 0x0p+0, 0)
6
+ T(RN, -0x1.9ccd8be03f4949a2p+2L, 0x1.52fb12ef638a1222p-1L, -0x1.9ccd8be03f4949ap+2L, 0x0p+0, 0)
7
+ T(RN, 0x1.f6f80ed2eab43b22p+2L, 0x1.ab3ff8575b21cf92p-5L, 0x1.f6f80ed2eab43b2p+2L, 0x0p+0, 0)
8
+ T(RN, -0x1.95882b433fad2dd4p-1L, 0x1.eb4a2e7ce06930dap+2L, -0x1.95882b433fad2dd2p-1L, 0x0p+0, 0)
9
+ T(RN, 0x1.3b3d617ae3c4a65p-1L, 0x1.01860611d75e1052p+1L, 0x1.3b3d617ae3c4a652p-1L, 0x0p+0, 0)
10
+ T(RN, -0x1.1e159e36313ee67cp-1L, 0x1.081bd34224212bp-5L, -0x1.1e159e36313ee67ap-1L, 0x0p+0, 0)
src/math/sanity/nexttoward.h ADDED
@@ -0,0 +1,10 @@
1
+ T(RN, -0x1.02239f3c6a8f13dep+3L, 0x1.22484b9ef31efd4p+2L, -0x1.02239f3c6a8fp+3, 0x0p+0, INEXACT)
2
+ T(RN, 0x1.161868e18bc67782p+2L, -0x1.1c6a6cdce75e83acp+3L, 0x1.161868e18bc66p+2, 0x0p+0, INEXACT)
3
+ T(RN, -0x1.0c34b3e01e6e682cp+3L, -0x1.61bde29e83f6cb16p+1L, -0x1.0c34b3e01e6e6p+3, 0x0p+0, INEXACT)
4
+ T(RN, -0x1.a206f0a19dcc3948p+2L, 0x1.24527f7b576abb6p+2L, -0x1.a206f0a19dcc3p+2, 0x0p+0, INEXACT)
5
+ T(RN, 0x1.288bbb0d6a1e5bdap+3L, 0x1.33edd910a3c00b7p+2L, 0x1.288bbb0d6a1e5p+3, 0x0p+0, INEXACT)
6
+ T(RN, -0x1.9ccd8be03f4949a2p+2L, 0x1.52fb12ef638a1222p-1L, -0x1.9ccd8be03f494p+2, 0x0p+0, INEXACT)
7
+ T(RN, 0x1.f6f80ed2eab43b22p+2L, 0x1.ab3ff8575b21cf92p-5L, 0x1.f6f80ed2eab43p+2, 0x0p+0, INEXACT)
8
+ T(RN, -0x1.95882b433fad2dd4p-1L, 0x1.eb4a2e7ce06930dap+2L, -0x1.95882b433fad2p-1, 0x0p+0, INEXACT)
9
+ T(RN, 0x1.3b3d617ae3c4a65p-1L, 0x1.01860611d75e1052p+1L, 0x1.3b3d617ae3c4bp-1, 0x0p+0, INEXACT)
10
+ T(RN, -0x1.1e159e36313ee67cp-1L, 0x1.081bd34224212bp-5L, -0x1.1e159e36313edp-1, 0x0p+0, INEXACT)
src/math/sanity/nexttowardf.h ADDED
@@ -0,0 +1,10 @@
1
+ T(RN, -0x1.02239f3c6a8f13dep+3L, 0x1.22484b9ef31efd4p+2L, -0x1.02239ep+3, 0x0p+0, INEXACT)
2
+ T(RN, 0x1.161868e18bc67782p+2L, -0x1.1c6a6cdce75e83acp+3L, 0x1.161866p+2, 0x0p+0, INEXACT)
3
+ T(RN, -0x1.0c34b3e01e6e682cp+3L, -0x1.61bde29e83f6cb16p+1L, -0x1.0c34b2p+3, 0x0p+0, INEXACT)
4
+ T(RN, -0x1.a206f0a19dcc3948p+2L, 0x1.24527f7b576abb6p+2L, -0x1.a206eep+2, 0x0p+0, INEXACT)
5
+ T(RN, 0x1.288bbb0d6a1e5bdap+3L, 0x1.33edd910a3c00b7p+2L, 0x1.288bbap+3, 0x0p+0, INEXACT)
6
+ T(RN, -0x1.9ccd8be03f4949a2p+2L, 0x1.52fb12ef638a1222p-1L, -0x1.9ccd8ap+2, 0x0p+0, INEXACT)
7
+ T(RN, 0x1.f6f80ed2eab43b22p+2L, 0x1.ab3ff8575b21cf92p-5L, 0x1.f6f80cp+2, 0x0p+0, INEXACT)
8
+ T(RN, -0x1.95882b433fad2dd4p-1L, 0x1.eb4a2e7ce06930dap+2L, -0x1.95882ap-1, 0x0p+0, INEXACT)
9
+ T(RN, 0x1.3b3d617ae3c4a65p-1L, 0x1.01860611d75e1052p+1L, 0x1.3b3d64p-1, 0x0p+0, INEXACT)
10
+ T(RN, -0x1.1e159e36313ee67cp-1L, 0x1.081bd34224212bp-5L, -0x1.1e159cp-1, 0x0p+0, INEXACT)
src/math/sanity/nexttowardl.h ADDED
@@ -0,0 +1,10 @@
1
+ T(RN, -0x1.02239f3c6a8f13dep+3L, 0x1.22484b9ef31efd4p+2L, -0x1.02239f3c6a8f13dcp+3L, 0x0p+0, 0)
2
+ T(RN, 0x1.161868e18bc67782p+2L, -0x1.1c6a6cdce75e83acp+3L, 0x1.161868e18bc6778p+2L, 0x0p+0, 0)
3
+ T(RN, -0x1.0c34b3e01e6e682cp+3L, -0x1.61bde29e83f6cb16p+1L, -0x1.0c34b3e01e6e682ap+3L, 0x0p+0, 0)
4
+ T(RN, -0x1.a206f0a19dcc3948p+2L, 0x1.24527f7b576abb6p+2L, -0x1.a206f0a19dcc3946p+2L, 0x0p+0, 0)
5
+ T(RN, 0x1.288bbb0d6a1e5bdap+3L, 0x1.33edd910a3c00b7p+2L, 0x1.288bbb0d6a1e5bd8p+3L, 0x0p+0, 0)
6
+ T(RN, -0x1.9ccd8be03f4949a2p+2L, 0x1.52fb12ef638a1222p-1L, -0x1.9ccd8be03f4949ap+2L, 0x0p+0, 0)
7
+ T(RN, 0x1.f6f80ed2eab43b22p+2L, 0x1.ab3ff8575b21cf92p-5L, 0x1.f6f80ed2eab43b2p+2L, 0x0p+0, 0)
8
+ T(RN, -0x1.95882b433fad2dd4p-1L, 0x1.eb4a2e7ce06930dap+2L, -0x1.95882b433fad2dd2p-1L, 0x0p+0, 0)
9
+ T(RN, 0x1.3b3d617ae3c4a65p-1L, 0x1.01860611d75e1052p+1L, 0x1.3b3d617ae3c4a652p-1L, 0x0p+0, 0)
10
+ T(RN, -0x1.1e159e36313ee67cp-1L, 0x1.081bd34224212bp-5L, -0x1.1e159e36313ee67ap-1L, 0x0p+0, 0)
src/math/sanity/scalb.h ADDED
@@ -0,0 +1,10 @@
1
+ T(RN, -0x1.02239f3c6a8f1p+3, 0x1.22484b9ef31fp+2, nan, 0x0p+0, INEXACT|INVALID)
2
+ T(RN, 0x1.161868e18bc67p+2, -0x1.1c6a6cdce75e8p+3, nan, 0x0p+0, INEXACT|INVALID)
3
+ T(RN, -0x1.0c34b3e01e6e7p+3, -0x1.61bde29e83f6dp+1, nan, 0x0p+0, INEXACT|INVALID)
4
+ T(RN, -0x1.a206f0a19dcc4p+2, 0x1.24527f7b576acp+2, nan, 0x0p+0, INEXACT|INVALID)
5
+ T(RN, 0x1.288bbb0d6a1e6p+3, 0x1.33edd910a3c01p+2, nan, 0x0p+0, INEXACT|INVALID)
6
+ T(RN, -0x1.9ccd8be03f495p+2, 0x1.52fb12ef638a1p-1, nan, 0x0p+0, INEXACT|INVALID)
7
+ T(RN, 0x1.f6f80ed2eab44p+2, 0x1.ab3ff8575b21dp-5, nan, 0x0p+0, INEXACT|INVALID)
8
+ T(RN, -0x1.95882b433fad3p-1, 0x1.eb4a2e7ce0693p+2, nan, 0x0p+0, INEXACT|INVALID)
9
+ T(RN, 0x1.3b3d617ae3c4ap-1, 0x1.01860611d75e1p+1, nan, 0x0p+0, INEXACT|INVALID)
10
+ T(RN, -0x1.1e159e36313eep-1, 0x1.081bd34224213p-5, nan, 0x0p+0, INEXACT|INVALID)
src/math/sanity/scalbf.h ADDED
@@ -0,0 +1,10 @@
1
+ T(RN, -0x1.0223ap+3, 0x1.22484cp+2, nan, 0x0p+0, INEXACT|INVALID)
2
+ T(RN, 0x1.161868p+2, -0x1.1c6a6cp+3, nan, 0x0p+0, INEXACT|INVALID)
3
+ T(RN, -0x1.0c34b4p+3, -0x1.61bde2p+1, nan, 0x0p+0, INEXACT|INVALID)
4
+ T(RN, -0x1.a206fp+2, 0x1.24528p+2, nan, 0x0p+0, INEXACT|INVALID)
5
+ T(RN, 0x1.288bbcp+3, 0x1.33eddap+2, nan, 0x0p+0, INEXACT|INVALID)
6
+ T(RN, -0x1.9ccd8cp+2, 0x1.52fb12p-1, nan, 0x0p+0, INEXACT|INVALID)
7
+ T(RN, 0x1.f6f80ep+2, 0x1.ab3ff8p-5, nan, 0x0p+0, INEXACT|INVALID)
8
+ T(RN, -0x1.95882cp-1, 0x1.eb4a2ep+2, nan, 0x0p+0, INEXACT|INVALID)
9
+ T(RN, 0x1.3b3d62p-1, 0x1.018606p+1, nan, 0x0p+0, INEXACT|INVALID)
10
+ T(RN, -0x1.1e159ep-1, 0x1.081bd4p-5, nan, 0x0p+0, INEXACT|INVALID)
file modified
+1 -0
src/math/scalb.c CHANGED
@@ -3,6 +3,7 @@
3
3
#include "util.h"
4
4
5
5
static struct dd_d t[] = {
6
+ #include "sanity/scalb.h"
6
7
7
8
};
8
9
file modified
+1 -0
src/math/scalbf.c CHANGED
@@ -3,6 +3,7 @@
3
3
#include "util.h"
4
4
5
5
static struct ff_f t[] = {
6
+ #include "sanity/scalbf.h"
6
7
7
8
};
8
9