This source file includes following definitions.
- test_function
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 static void
18 test_function (void)
19 {
20 int i;
21 int j;
22 const DOUBLE TWO_MANT_DIG =
23
24
25
26 (DOUBLE) (1U << ((MANT_DIG - 1) / 5))
27 * (DOUBLE) (1U << ((MANT_DIG - 1 + 1) / 5))
28 * (DOUBLE) (1U << ((MANT_DIG - 1 + 2) / 5))
29 * (DOUBLE) (1U << ((MANT_DIG - 1 + 3) / 5))
30 * (DOUBLE) (1U << ((MANT_DIG - 1 + 4) / 5));
31
32
33 for (i = 0; i < SIZEOF (RANDOM); i++)
34 {
35 DOUBLE x = L_(32.0) * RANDOM[i] - L_(16.0);
36 DOUBLE y = CBRT (x);
37 DOUBLE err = y * y * y - x;
38 ASSERT (err > - L_(4.0) * L_(16.0) / TWO_MANT_DIG
39 && err < L_(4.0) * L_(16.0) / TWO_MANT_DIG);
40 }
41
42 for (i = 0; i < SIZEOF (RANDOM) / 5; i++)
43 for (j = 0; j < SIZEOF (RANDOM) / 5; j++)
44 {
45 DOUBLE x = L_(32.0) * RANDOM[i] - L_(16.0);
46 DOUBLE y = L_(32.0) * RANDOM[j] - L_(16.0);
47 if (x != L_(0.0) && y != L_(0.0))
48 {
49 DOUBLE z = L_(1.0) / (x * y);
50
51 DOUBLE p = CBRT (x) * CBRT (y) * CBRT (z);
52 ASSERT (p > L_(1.0) - L_(8.0) / TWO_MANT_DIG
53 && p < L_(1.0) + L_(8.0) / TWO_MANT_DIG);
54 }
55 }
56 }
57
58 volatile DOUBLE x;
59 DOUBLE y;