bionic/tests/math_data/remainderf_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

1294 lines
17 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_2_t<float, float, float> g_remainderf_intel_data[] = {
{ // Entry 0
-0.0,
-0x1.p-117,
-0x1.p-117
},
{ // Entry 1
-0.0,
-0x1.p-117,
0x1.p-117
},
{ // Entry 2
0.0,
0x1.p-117,
-0x1.p-117
},
{ // Entry 3
0.0,
0x1.p-117,
0x1.p-117
},
{ // Entry 4
-0x1.p-117,
-0x1.p-117,
0x1.p15
},
{ // Entry 5
-0x1.p-117,
-0x1.p-117,
0x1.p16
},
{ // Entry 6
0x1.p-117,
0x1.p-117,
0x1.p15
},
{ // Entry 7
0x1.p-117,
0x1.p-117,
0x1.p16
},
{ // Entry 8
-0x1.p-117,
-0x1.p-117,
0x1.p117
},
{ // Entry 9
-0x1.p-117,
-0x1.p-117,
0x1.p118
},
{ // Entry 10
0x1.p-117,
0x1.p-117,
0x1.p117
},
{ // Entry 11
0x1.p-117,
0x1.p-117,
0x1.p118
},
{ // Entry 12
0.0,
0x1.p15,
-0x1.p-117
},
{ // Entry 13
0.0,
0x1.p15,
0x1.p-117
},
{ // Entry 14
0.0,
0x1.p16,
-0x1.p-117
},
{ // Entry 15
0.0,
0x1.p16,
0x1.p-117
},
{ // Entry 16
0.0,
0x1.p15,
0x1.p15
},
{ // Entry 17
0x1.p15,
0x1.p15,
0x1.p16
},
{ // Entry 18
0.0,
0x1.p16,
0x1.p15
},
{ // Entry 19
0.0,
0x1.p16,
0x1.p16
},
{ // Entry 20
0x1.p15,
0x1.p15,
0x1.p117
},
{ // Entry 21
0x1.p15,
0x1.p15,
0x1.p118
},
{ // Entry 22
0x1.p16,
0x1.p16,
0x1.p117
},
{ // Entry 23
0x1.p16,
0x1.p16,
0x1.p118
},
{ // Entry 24
0.0,
0x1.p117,
-0x1.p-117
},
{ // Entry 25
0.0,
0x1.p117,
0x1.p-117
},
{ // Entry 26
0.0,
0x1.p118,
-0x1.p-117
},
{ // Entry 27
0.0,
0x1.p118,
0x1.p-117
},
{ // Entry 28
0.0,
0x1.p117,
0x1.p15
},
{ // Entry 29
0.0,
0x1.p117,
0x1.p16
},
{ // Entry 30
0.0,
0x1.p118,
0x1.p15
},
{ // Entry 31
0.0,
0x1.p118,
0x1.p16
},
{ // Entry 32
0.0,
0x1.p117,
0x1.p117
},
{ // Entry 33
0x1.p117,
0x1.p117,
0x1.p118
},
{ // Entry 34
0.0,
0x1.p118,
0x1.p117
},
{ // Entry 35
0.0,
0x1.p118,
0x1.p118
},
{ // Entry 36
0.0,
0x1.90p6,
0x1.40p3
},
{ // Entry 37
0x1.p0,
0x1.90p6,
0x1.60p3
},
{ // Entry 38
0x1.p2,
0x1.90p6,
0x1.80p3
},
{ // Entry 39
0x1.p0,
0x1.94p6,
0x1.40p3
},
{ // Entry 40
0x1.p1,
0x1.94p6,
0x1.60p3
},
{ // Entry 41
0x1.40p2,
0x1.94p6,
0x1.80p3
},
{ // Entry 42
0x1.p1,
0x1.98p6,
0x1.40p3
},
{ // Entry 43
0x1.80p1,
0x1.98p6,
0x1.60p3
},
{ // Entry 44
0x1.80p2,
0x1.98p6,
0x1.80p3
},
{ // Entry 45
0x1.80p1,
0x1.9cp6,
0x1.40p3
},
{ // Entry 46
0x1.p2,
0x1.9cp6,
0x1.60p3
},
{ // Entry 47
-0x1.40p2,
0x1.9cp6,
0x1.80p3
},
{ // Entry 48
0x1.p2,
0x1.a0p6,
0x1.40p3
},
{ // Entry 49
0x1.40p2,
0x1.a0p6,
0x1.60p3
},
{ // Entry 50
-0x1.p2,
0x1.a0p6,
0x1.80p3
},
{ // Entry 51
0x1.40p2,
0x1.a4p6,
0x1.40p3
},
{ // Entry 52
-0x1.40p2,
0x1.a4p6,
0x1.60p3
},
{ // Entry 53
-0x1.80p1,
0x1.a4p6,
0x1.80p3
},
{ // Entry 54
-0x1.p2,
0x1.a8p6,
0x1.40p3
},
{ // Entry 55
-0x1.p2,
0x1.a8p6,
0x1.60p3
},
{ // Entry 56
-0x1.p1,
0x1.a8p6,
0x1.80p3
},
{ // Entry 57
-0x1.80p1,
0x1.acp6,
0x1.40p3
},
{ // Entry 58
-0x1.80p1,
0x1.acp6,
0x1.60p3
},
{ // Entry 59
-0x1.p0,
0x1.acp6,
0x1.80p3
},
{ // Entry 60
-0x1.p1,
0x1.b0p6,
0x1.40p3
},
{ // Entry 61
-0x1.p1,
0x1.b0p6,
0x1.60p3
},
{ // Entry 62
0.0,
0x1.b0p6,
0x1.80p3
},
{ // Entry 63
-0x1.p0,
0x1.b4p6,
0x1.40p3
},
{ // Entry 64
-0x1.p0,
0x1.b4p6,
0x1.60p3
},
{ // Entry 65
0x1.p0,
0x1.b4p6,
0x1.80p3
},
{ // Entry 66
0.0,
0x1.b8p6,
0x1.40p3
},
{ // Entry 67
0.0,
0x1.b8p6,
0x1.60p3
},
{ // Entry 68
0x1.p1,
0x1.b8p6,
0x1.80p3
},
{ // Entry 69
-0.0,
-0x1.000002p0,
-0x1.000002p0
},
{ // Entry 70
-0x1.p-23,
-0x1.000002p0,
-0x1.p0
},
{ // Entry 71
-0x1.80p-23,
-0x1.000002p0,
-0x1.fffffep-1
},
{ // Entry 72
0x1.p-23,
-0x1.p0,
-0x1.000002p0
},
{ // Entry 73
-0.0,
-0x1.p0,
-0x1.p0
},
{ // Entry 74
-0x1.p-24,
-0x1.p0,
-0x1.fffffep-1
},
{ // Entry 75
0x1.80p-23,
-0x1.fffffep-1,
-0x1.000002p0
},
{ // Entry 76
0x1.p-24,
-0x1.fffffep-1,
-0x1.p0
},
{ // Entry 77
-0.0,
-0x1.fffffep-1,
-0x1.fffffep-1
},
{ // Entry 78
-0x1.80p-23,
-0x1.000002p0,
0x1.fffffep-1
},
{ // Entry 79
-0x1.p-23,
-0x1.000002p0,
0x1.p0
},
{ // Entry 80
-0.0,
-0x1.000002p0,
0x1.000002p0
},
{ // Entry 81
-0x1.p-24,
-0x1.p0,
0x1.fffffep-1
},
{ // Entry 82
-0.0,
-0x1.p0,
0x1.p0
},
{ // Entry 83
0x1.p-23,
-0x1.p0,
0x1.000002p0
},
{ // Entry 84
-0.0,
-0x1.fffffep-1,
0x1.fffffep-1
},
{ // Entry 85
0x1.p-24,
-0x1.fffffep-1,
0x1.p0
},
{ // Entry 86
0x1.80p-23,
-0x1.fffffep-1,
0x1.000002p0
},
{ // Entry 87
-0x1.80p-23,
0x1.fffffep-1,
-0x1.000002p0
},
{ // Entry 88
-0x1.p-24,
0x1.fffffep-1,
-0x1.p0
},
{ // Entry 89
0.0,
0x1.fffffep-1,
-0x1.fffffep-1
},
{ // Entry 90
-0x1.p-23,
0x1.p0,
-0x1.000002p0
},
{ // Entry 91
0.0,
0x1.p0,
-0x1.p0
},
{ // Entry 92
0x1.p-24,
0x1.p0,
-0x1.fffffep-1
},
{ // Entry 93
0.0,
0x1.000002p0,
-0x1.000002p0
},
{ // Entry 94
0x1.p-23,
0x1.000002p0,
-0x1.p0
},
{ // Entry 95
0x1.80p-23,
0x1.000002p0,
-0x1.fffffep-1
},
{ // Entry 96
0.0,
0x1.fffffep-1,
0x1.fffffep-1
},
{ // Entry 97
-0x1.p-24,
0x1.fffffep-1,
0x1.p0
},
{ // Entry 98
-0x1.80p-23,
0x1.fffffep-1,
0x1.000002p0
},
{ // Entry 99
0x1.p-24,
0x1.p0,
0x1.fffffep-1
},
{ // Entry 100
0.0,
0x1.p0,
0x1.p0
},
{ // Entry 101
-0x1.p-23,
0x1.p0,
0x1.000002p0
},
{ // Entry 102
0x1.80p-23,
0x1.000002p0,
0x1.fffffep-1
},
{ // Entry 103
0x1.p-23,
0x1.000002p0,
0x1.p0
},
{ // Entry 104
0.0,
0x1.000002p0,
0x1.000002p0
},
{ // Entry 105
-0.0,
-0x1.p-149,
0x1.p-149
},
{ // Entry 106
0.0,
0.0,
0x1.p-149
},
{ // Entry 107
0.0,
0x1.p-149,
0x1.p-149
},
{ // Entry 108
-0.0,
-0x1.p-149,
-0x1.p-149
},
{ // Entry 109
0.0,
0.0,
-0x1.p-149
},
{ // Entry 110
0.0,
0x1.p-149,
-0x1.p-149
},
{ // Entry 111
-0x1.p-149,
-0x1.p-149,
0x1.fffffep127
},
{ // Entry 112
0.0,
0.0,
0x1.fffffep127
},
{ // Entry 113
0x1.p-149,
0x1.p-149,
0x1.fffffep127
},
{ // Entry 114
-0x1.p-149,
-0x1.p-149,
-0x1.fffffep127
},
{ // Entry 115
0.0,
0.0,
-0x1.fffffep127
},
{ // Entry 116
0x1.p-149,
0x1.p-149,
-0x1.fffffep127
},
{ // Entry 117
0x1.p-149,
0x1.p-149,
0x1.fffffep127
},
{ // Entry 118
-0x1.p-149,
-0x1.p-149,
-0x1.fffffep127
},
{ // Entry 119
-0x1.p-149,
-0x1.p-149,
0x1.fffffep127
},
{ // Entry 120
0x1.p-149,
0x1.p-149,
-0x1.fffffep127
},
{ // Entry 121
0.0,
0x1.fffffep127,
0x1.p-149
},
{ // Entry 122
-0.0,
-0x1.fffffep127,
-0x1.p-149
},
{ // Entry 123
-0.0,
-0x1.fffffep127,
0x1.p-149
},
{ // Entry 124
0.0,
0x1.fffffep127,
-0x1.p-149
},
{ // Entry 125
0.0,
0x1.fffffep127,
0x1.fffffep127
},
{ // Entry 126
0.0,
0x1.fffffep127,
-0x1.fffffep127
},
{ // Entry 127
-0.0,
-0x1.fffffep127,
0x1.fffffep127
},
{ // Entry 128
-0.0,
-0x1.fffffep127,
-0x1.fffffep127
},
{ // Entry 129
0x1.fffff8p-3,
-0x1.000002p22,
0x1.fffffep-1
},
{ // Entry 130
-0x1.p-1,
-0x1.000002p22,
0x1.p0
},
{ // Entry 131
-0.0,
-0x1.000002p22,
0x1.000002p0
},
{ // Entry 132
-0x1.p-2,
-0x1.p22,
0x1.fffffep-1
},
{ // Entry 133
-0.0,
-0x1.p22,
0x1.p0
},
{ // Entry 134
0x1.p-1,
-0x1.p22,
0x1.000002p0
},
{ // Entry 135
-0.0,
-0x1.fffffep21,
0x1.fffffep-1
},
{ // Entry 136
0x1.p-2,
-0x1.fffffep21,
0x1.p0
},
{ // Entry 137
-0x1.000008p-2,
-0x1.fffffep21,
0x1.000002p0
},
{ // Entry 138
0.0,
0x1.fffffep22,
0x1.fffffep-1
},
{ // Entry 139
-0x1.p-1,
0x1.fffffep22,
0x1.p0
},
{ // Entry 140
-0x1.fffff8p-2,
0x1.fffffep22,
0x1.000002p0
},
{ // Entry 141
-0x1.fffffcp-2,
0x1.p23,
0x1.fffffep-1
},
{ // Entry 142
0.0,
0x1.p23,
0x1.p0
},
{ // Entry 143
0x1.p-23,
0x1.p23,
0x1.000002p0
},
{ // Entry 144
-0x1.fffff8p-2,
0x1.000002p23,
0x1.fffffep-1
},
{ // Entry 145
0.0,
0x1.000002p23,
0x1.p0
},
{ // Entry 146
0.0,
0x1.000002p23,
0x1.000002p0
},
{ // Entry 147
-0x1.80p-23,
-0x1.000002p24,
0x1.fffffep-1
},
{ // Entry 148
-0.0,
-0x1.000002p24,
0x1.p0
},
{ // Entry 149
-0.0,
-0x1.000002p24,
0x1.000002p0
},
{ // Entry 150
-0x1.p-24,
-0x1.p24,
0x1.fffffep-1
},
{ // Entry 151
-0.0,
-0x1.p24,
0x1.p0
},
{ // Entry 152
-0x1.p-22,
-0x1.p24,
0x1.000002p0
},
{ // Entry 153
-0.0,
-0x1.fffffep23,
0x1.fffffep-1
},
{ // Entry 154
-0.0,
-0x1.fffffep23,
0x1.p0
},
{ // Entry 155
-0x1.80p-22,
-0x1.fffffep23,
0x1.000002p0
},
{ // Entry 156
0.0,
0x1.fffffep21,
0x1.fffffep-1
},
{ // Entry 157
-0x1.p-2,
0x1.fffffep21,
0x1.p0
},
{ // Entry 158
0x1.000008p-2,
0x1.fffffep21,
0x1.000002p0
},
{ // Entry 159
0x1.p-2,
0x1.p22,
0x1.fffffep-1
},
{ // Entry 160
0.0,
0x1.p22,
0x1.p0
},
{ // Entry 161
-0x1.p-1,
0x1.p22,
0x1.000002p0
},
{ // Entry 162
-0x1.fffff8p-3,
0x1.000002p22,
0x1.fffffep-1
},
{ // Entry 163
0x1.p-1,
0x1.000002p22,
0x1.p0
},
{ // Entry 164
0.0,
0x1.000002p22,
0x1.000002p0
},
{ // Entry 165
0.0,
0x1.fffffep22,
0x1.fffffep-1
},
{ // Entry 166
-0x1.p-1,
0x1.fffffep22,
0x1.p0
},
{ // Entry 167
-0x1.fffff8p-2,
0x1.fffffep22,
0x1.000002p0
},
{ // Entry 168
-0x1.fffffcp-2,
0x1.p23,
0x1.fffffep-1
},
{ // Entry 169
0.0,
0x1.p23,
0x1.p0
},
{ // Entry 170
0x1.p-23,
0x1.p23,
0x1.000002p0
},
{ // Entry 171
-0x1.fffff8p-2,
0x1.000002p23,
0x1.fffffep-1
},
{ // Entry 172
0.0,
0x1.000002p23,
0x1.p0
},
{ // Entry 173
0.0,
0x1.000002p23,
0x1.000002p0
},
{ // Entry 174
-0.0,
-0x1.000002p24,
-0x1.000002p0
},
{ // Entry 175
-0.0,
-0x1.000002p24,
-0x1.p0
},
{ // Entry 176
-0x1.80p-23,
-0x1.000002p24,
-0x1.fffffep-1
},
{ // Entry 177
-0x1.p-22,
-0x1.p24,
-0x1.000002p0
},
{ // Entry 178
-0.0,
-0x1.p24,
-0x1.p0
},
{ // Entry 179
-0x1.p-24,
-0x1.p24,
-0x1.fffffep-1
},
{ // Entry 180
-0x1.80p-22,
-0x1.fffffep23,
-0x1.000002p0
},
{ // Entry 181
-0.0,
-0x1.fffffep23,
-0x1.p0
},
{ // Entry 182
-0.0,
-0x1.fffffep23,
-0x1.fffffep-1
},
{ // Entry 183
0x1.fffffep127,
0x1.fffffep127,
HUGE_VALF
},
{ // Entry 184
-0x1.fffffep127,
-0x1.fffffep127,
HUGE_VALF
},
{ // Entry 185
0x1.fffffep127,
0x1.fffffep127,
-HUGE_VALF
},
{ // Entry 186
-0x1.fffffep127,
-0x1.fffffep127,
-HUGE_VALF
},
{ // Entry 187
0x1.p-126,
0x1.p-126,
HUGE_VALF
},
{ // Entry 188
-0x1.p-126,
-0x1.p-126,
HUGE_VALF
},
{ // Entry 189
0x1.p-126,
0x1.p-126,
-HUGE_VALF
},
{ // Entry 190
-0x1.p-126,
-0x1.p-126,
-HUGE_VALF
},
{ // Entry 191
0x1.p-149,
0x1.p-149,
HUGE_VALF
},
{ // Entry 192
-0x1.p-149,
-0x1.p-149,
HUGE_VALF
},
{ // Entry 193
0x1.p-149,
0x1.p-149,
-HUGE_VALF
},
{ // Entry 194
-0x1.p-149,
-0x1.p-149,
-HUGE_VALF
},
{ // Entry 195
0.0,
0.0f,
HUGE_VALF
},
{ // Entry 196
-0.0,
-0.0f,
HUGE_VALF
},
{ // Entry 197
0.0,
0.0f,
-HUGE_VALF
},
{ // Entry 198
-0.0,
-0.0f,
-HUGE_VALF
},
{ // Entry 199
0.0,
0x1.fffffep127,
0x1.fffffep127
},
{ // Entry 200
0.0,
0x1.fffffep127,
-0x1.fffffep127
},
{ // Entry 201
-0.0,
-0x1.fffffep127,
0x1.fffffep127
},
{ // Entry 202
-0.0,
-0x1.fffffep127,
-0x1.fffffep127
},
{ // Entry 203
0.0,
0x1.fffffep127,
0x1.p-126
},
{ // Entry 204
0.0,
0x1.fffffep127,
-0x1.p-126
},
{ // Entry 205
-0.0,
-0x1.fffffep127,
0x1.p-126
},
{ // Entry 206
-0.0,
-0x1.fffffep127,
-0x1.p-126
},
{ // Entry 207
0.0,
0x1.fffffep127,
0x1.p-149
},
{ // Entry 208
0.0,
0x1.fffffep127,
-0x1.p-149
},
{ // Entry 209
-0.0,
-0x1.fffffep127,
0x1.p-149
},
{ // Entry 210
-0.0,
-0x1.fffffep127,
-0x1.p-149
},
{ // Entry 211
0x1.p-126,
0x1.p-126,
0x1.fffffep127
},
{ // Entry 212
-0x1.p-126,
-0x1.p-126,
0x1.fffffep127
},
{ // Entry 213
0x1.p-126,
0x1.p-126,
-0x1.fffffep127
},
{ // Entry 214
-0x1.p-126,
-0x1.p-126,
-0x1.fffffep127
},
{ // Entry 215
0x1.p-149,
0x1.p-149,
0x1.fffffep127
},
{ // Entry 216
-0x1.p-149,
-0x1.p-149,
0x1.fffffep127
},
{ // Entry 217
0x1.p-149,
0x1.p-149,
-0x1.fffffep127
},
{ // Entry 218
-0x1.p-149,
-0x1.p-149,
-0x1.fffffep127
},
{ // Entry 219
0.0,
0.0f,
0x1.fffffep127
},
{ // Entry 220
-0.0,
-0.0f,
0x1.fffffep127
},
{ // Entry 221
0.0,
0.0f,
-0x1.fffffep127
},
{ // Entry 222
-0.0,
-0.0f,
-0x1.fffffep127
},
{ // Entry 223
0.0,
0x1.p-126,
0x1.p-126
},
{ // Entry 224
0.0,
0x1.p-126,
-0x1.p-126
},
{ // Entry 225
-0.0,
-0x1.p-126,
0x1.p-126
},
{ // Entry 226
-0.0,
-0x1.p-126,
-0x1.p-126
},
{ // Entry 227
0.0,
0x1.p-126,
0x1.p-149
},
{ // Entry 228
0.0,
0x1.p-126,
-0x1.p-149
},
{ // Entry 229
-0.0,
-0x1.p-126,
0x1.p-149
},
{ // Entry 230
-0.0,
-0x1.p-126,
-0x1.p-149
},
{ // Entry 231
0x1.p-149,
0x1.p-149,
0x1.p-126
},
{ // Entry 232
-0x1.p-149,
-0x1.p-149,
0x1.p-126
},
{ // Entry 233
0x1.p-149,
0x1.p-149,
-0x1.p-126
},
{ // Entry 234
-0x1.p-149,
-0x1.p-149,
-0x1.p-126
},
{ // Entry 235
0.0,
0.0f,
0x1.p-126
},
{ // Entry 236
-0.0,
-0.0f,
0x1.p-126
},
{ // Entry 237
0.0,
0.0f,
-0x1.p-126
},
{ // Entry 238
-0.0,
-0.0f,
-0x1.p-126
},
{ // Entry 239
0.0,
0x1.p-149,
0x1.p-149
},
{ // Entry 240
-0.0,
-0x1.p-149,
0x1.p-149
},
{ // Entry 241
0.0,
0x1.p-149,
-0x1.p-149
},
{ // Entry 242
-0.0,
-0x1.p-149,
-0x1.p-149
},
{ // Entry 243
0.0,
0.0f,
0x1.p-149
},
{ // Entry 244
-0.0,
-0.0f,
0x1.p-149
},
{ // Entry 245
0.0,
0.0f,
-0x1.p-149
},
{ // Entry 246
-0.0,
-0.0f,
-0x1.p-149
},
{ // Entry 247
-0x1.p0,
0x1.80p1,
0x1.p1
},
{ // Entry 248
0x1.p0,
-0x1.80p1,
0x1.p1
},
{ // Entry 249
-0x1.p0,
0x1.80p1,
-0x1.p1
},
{ // Entry 250
0x1.p0,
-0x1.80p1,
-0x1.p1
},
{ // Entry 251
0x1.p0,
0x1.40p2,
0x1.p1
},
{ // Entry 252
-0x1.p0,
-0x1.40p2,
0x1.p1
},
{ // Entry 253
0x1.p0,
0x1.40p2,
-0x1.p1
},
{ // Entry 254
-0x1.p0,
-0x1.40p2,
-0x1.p1
}
};