bionic/tests/math_data/significandf_intel_data.h
Jingwei Zhang 56b2b2916b Accuracy tests for libm
This patch adds more tests for math functions to address coverage
issue of math functions discussed in:
https://android-review.googlesource.com/#/c/49653/
https://android-review.googlesource.com/#/c/94780/

These are data sets used in regression tests for the Intel the math library (libm). They were collected over a long period of testing various libm implementations.
The data sets contain function specific data (special and corner cases such as +/-0, maximum/minimum normalized numbers, +/-infinity, QNaN/SNaN, maximum/minimum denormal numbers, arguments that would produce close to overflow/underflow results, known hard-to-round cases, etc), implementation specific data (arguments close to table look-up values for different polynomial approximations, worst cases for range reduction algorithms) and other data with interesting bit patterns.
The reference values are computed with Maple and were converted into hexadecimal format.

Change-Id: I7177c282937369eae98f25d02134e4fc3beadde8
Signed-off-by: Jingwei Zhang <jingwei.zhang@intel.com>
Signed-off-by: Mingwei Shi <mingwei.shi@intel.com>
2015-02-14 00:56:46 +08:00

527 lines
7.4 KiB
C

/*
* Copyright (C) 2014 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
static data_1_1_t<float, float> g_significandf_intel_data[] = {
{ // Entry 0
0x1.p0,
0x1.p100
},
{ // Entry 1
0x1.2aaaaap0,
0x1.2aaaaap100
},
{ // Entry 2
0x1.555554p0,
0x1.555554p100
},
{ // Entry 3
0x1.7ffffep0,
0x1.7ffffep100
},
{ // Entry 4
0x1.aaaaa8p0,
0x1.aaaaa8p100
},
{ // Entry 5
0x1.d55552p0,
0x1.d55552p100
},
{ // Entry 6
0x1.fffffcp0,
0x1.fffffcp100
},
{ // Entry 7
-0x1.p0,
-0x1.p101
},
{ // Entry 8
-0x1.d55556p0,
-0x1.d55556p100
},
{ // Entry 9
-0x1.aaaaacp0,
-0x1.aaaaacp100
},
{ // Entry 10
-0x1.800002p0,
-0x1.800002p100
},
{ // Entry 11
-0x1.555558p0,
-0x1.555558p100
},
{ // Entry 12
-0x1.2aaaaep0,
-0x1.2aaaaep100
},
{ // Entry 13
-0x1.000004p0,
-0x1.000004p100
},
{ // Entry 14
0x1.p0,
0x1.p21
},
{ // Entry 15
0x1.p0,
0x1.p22
},
{ // Entry 16
0x1.p0,
0x1.p23
},
{ // Entry 17
0x1.p0,
0x1.p24
},
{ // Entry 18
0x1.p0,
0x1.p-130
},
{ // Entry 19
0x1.ae8ba0p0,
0x1.ae8ba0p-128
},
{ // Entry 20
0x1.8e8ba0p0,
0x1.8e8ba0p-127
},
{ // Entry 21
0x1.22e8b8p0,
0x1.22e8b8p-126
},
{ // Entry 22
0x1.7e8ba0p0,
0x1.7e8ba0p-126
},
{ // Entry 23
0x1.da2e88p0,
0x1.da2e88p-126
},
{ // Entry 24
0x1.1ae8b8p0,
0x1.1ae8b8p-125
},
{ // Entry 25
0x1.48ba2cp0,
0x1.48ba2cp-125
},
{ // Entry 26
0x1.768ba0p0,
0x1.768ba0p-125
},
{ // Entry 27
0x1.a45d14p0,
0x1.a45d14p-125
},
{ // Entry 28
0x1.d22e88p0,
0x1.d22e88p-125
},
{ // Entry 29
0x1.fffffcp0,
0x1.fffffcp-125
},
{ // Entry 30
0x1.fffffep0,
0x1.fffffep21
},
{ // Entry 31
0x1.p0,
0x1.p22
},
{ // Entry 32
0x1.000002p0,
0x1.000002p22
},
{ // Entry 33
0x1.fffffep0,
0x1.fffffep22
},
{ // Entry 34
0x1.p0,
0x1.p23
},
{ // Entry 35
0x1.000002p0,
0x1.000002p23
},
{ // Entry 36
0x1.fffffep0,
0x1.fffffep23
},
{ // Entry 37
0x1.p0,
0x1.p24
},
{ // Entry 38
0x1.000002p0,
0x1.000002p24
},
{ // Entry 39
-0x1.000002p0,
-0x1.000002p22
},
{ // Entry 40
-0x1.p0,
-0x1.p22
},
{ // Entry 41
-0x1.fffffep0,
-0x1.fffffep21
},
{ // Entry 42
-0x1.000002p0,
-0x1.000002p23
},
{ // Entry 43
-0x1.p0,
-0x1.p23
},
{ // Entry 44
-0x1.fffffep0,
-0x1.fffffep22
},
{ // Entry 45
-0x1.000002p0,
-0x1.000002p24
},
{ // Entry 46
-0x1.p0,
-0x1.p24
},
{ // Entry 47
-0x1.fffffep0,
-0x1.fffffep23
},
{ // Entry 48
0x1.fffffep0,
0x1.fffffep127
},
{ // Entry 49
-0x1.fffffep0,
-0x1.fffffep127
},
{ // Entry 50
0x1.fffffep0,
0x1.fffffep-7
},
{ // Entry 51
0x1.p0,
0x1.p-6
},
{ // Entry 52
0x1.000002p0,
0x1.000002p-6
},
{ // Entry 53
0x1.fffffep0,
0x1.fffffep-6
},
{ // Entry 54
0x1.p0,
0x1.p-5
},
{ // Entry 55
0x1.000002p0,
0x1.000002p-5
},
{ // Entry 56
0x1.fffffep0,
0x1.fffffep-5
},
{ // Entry 57
0x1.p0,
0x1.p-4
},
{ // Entry 58
0x1.000002p0,
0x1.000002p-4
},
{ // Entry 59
0x1.fffffep0,
0x1.fffffep-4
},
{ // Entry 60
0x1.p0,
0x1.p-3
},
{ // Entry 61
0x1.000002p0,
0x1.000002p-3
},
{ // Entry 62
0x1.fffffep0,
0x1.fffffep-3
},
{ // Entry 63
0x1.p0,
0x1.p-2
},
{ // Entry 64
0x1.000002p0,
0x1.000002p-2
},
{ // Entry 65
0x1.fffffep0,
0x1.fffffep-2
},
{ // Entry 66
0x1.p0,
0x1.p-1
},
{ // Entry 67
0x1.000002p0,
0x1.000002p-1
},
{ // Entry 68
-0x1.p0,
-0x1.p-149
},
{ // Entry 69
0.0,
0.0
},
{ // Entry 70
0x1.p0,
0x1.p-149
},
{ // Entry 71
0x1.fffffep0,
0x1.fffffep-1
},
{ // Entry 72
0x1.p0,
0x1.p0
},
{ // Entry 73
0x1.000002p0,
0x1.000002p0
},
{ // Entry 74
0x1.fffffep0,
0x1.fffffep0
},
{ // Entry 75
0x1.p0,
0x1.p1
},
{ // Entry 76
0x1.000002p0,
0x1.000002p1
},
{ // Entry 77
0x1.fffffep0,
0x1.fffffep1
},
{ // Entry 78
0x1.p0,
0x1.p2
},
{ // Entry 79
0x1.000002p0,
0x1.000002p2
},
{ // Entry 80
0x1.fffffep0,
0x1.fffffep2
},
{ // Entry 81
0x1.p0,
0x1.p3
},
{ // Entry 82
0x1.000002p0,
0x1.000002p3
},
{ // Entry 83
0x1.fffffep0,
0x1.fffffep3
},
{ // Entry 84
0x1.p0,
0x1.p4
},
{ // Entry 85
0x1.000002p0,
0x1.000002p4
},
{ // Entry 86
0x1.fffffep0,
0x1.fffffep4
},
{ // Entry 87
0x1.p0,
0x1.p5
},
{ // Entry 88
0x1.000002p0,
0x1.000002p5
},
{ // Entry 89
0x1.fffffep0,
0x1.fffffep5
},
{ // Entry 90
0x1.p0,
0x1.p6
},
{ // Entry 91
0x1.000002p0,
0x1.000002p6
},
{ // Entry 92
0x1.fffffep0,
0x1.fffffep6
},
{ // Entry 93
0x1.p0,
0x1.p7
},
{ // Entry 94
0x1.000002p0,
0x1.000002p7
},
{ // Entry 95
HUGE_VALF,
HUGE_VALF
},
{ // Entry 96
-HUGE_VALF,
-HUGE_VALF
},
{ // Entry 97
0x1.fffffep0,
0x1.fffffep127
},
{ // Entry 98
-0x1.fffffep0,
-0x1.fffffep127
},
{ // Entry 99
0x1.fffffcp0,
0x1.fffffcp127
},
{ // Entry 100
-0x1.fffffcp0,
-0x1.fffffcp127
},
{ // Entry 101
0x1.921fb6p0,
0x1.921fb6p1
},
{ // Entry 102
-0x1.921fb6p0,
-0x1.921fb6p1
},
{ // Entry 103
0x1.921fb6p0,
0x1.921fb6p0
},
{ // Entry 104
-0x1.921fb6p0,
-0x1.921fb6p0
},
{ // Entry 105
0x1.000002p0,
0x1.000002p0
},
{ // Entry 106
-0x1.000002p0,
-0x1.000002p0
},
{ // Entry 107
0x1.p0,
0x1.p0
},
{ // Entry 108
-0x1.p0,
-0x1.p0
},
{ // Entry 109
0x1.fffffep0,
0x1.fffffep-1
},
{ // Entry 110
-0x1.fffffep0,
-0x1.fffffep-1
},
{ // Entry 111
0x1.921fb6p0,
0x1.921fb6p-1
},
{ // Entry 112
-0x1.921fb6p0,
-0x1.921fb6p-1
},
{ // Entry 113
0x1.000002p0,
0x1.000002p-126
},
{ // Entry 114
-0x1.000002p0,
-0x1.000002p-126
},
{ // Entry 115
0x1.p0,
0x1.p-126
},
{ // Entry 116
-0x1.p0,
-0x1.p-126
},
{ // Entry 117
0x1.fffffcp0,
0x1.fffffcp-127
},
{ // Entry 118
-0x1.fffffcp0,
-0x1.fffffcp-127
},
{ // Entry 119
0x1.fffff8p0,
0x1.fffff8p-127
},
{ // Entry 120
-0x1.fffff8p0,
-0x1.fffff8p-127
},
{ // Entry 121
0x1.p0,
0x1.p-148
},
{ // Entry 122
-0x1.p0,
-0x1.p-148
},
{ // Entry 123
0x1.p0,
0x1.p-149
},
{ // Entry 124
-0x1.p0,
-0x1.p-149
},
{ // Entry 125
0.0,
0.0f
},
{ // Entry 126
-0.0,
-0.0f
}
};