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

1104 lines
15 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_fminf_intel_data[] = {
{ // Entry 0
0x1.p-148,
0x1.p-148,
0x1.p-148
},
{ // Entry 1
0x1.fff2e2p-1,
0x1.fffffep-1,
0x1.fff2e2p-1
},
{ // Entry 2
-0x1.40p3,
-0x1.40p3,
-0x1.40p3
},
{ // Entry 3
-0x1.40p3,
-0x1.40p3,
0x1.40p3
},
{ // Entry 4
-0x1.40p3,
0x1.40p3,
-0x1.40p3
},
{ // Entry 5
0x1.40p3,
0x1.40p3,
0x1.40p3
},
{ // Entry 6
-0x1.p-148,
-0x1.p-148,
-0x1.p-148
},
{ // Entry 7
-0x1.p-148,
-0x1.p-148,
-0x1.p-149
},
{ // Entry 8
-0x1.p-148,
-0x1.p-148,
0.0
},
{ // Entry 9
-0x1.p-148,
-0x1.p-148,
0x1.p-149
},
{ // Entry 10
-0x1.p-148,
-0x1.p-148,
0x1.p-148
},
{ // Entry 11
-0x1.p-148,
-0x1.p-149,
-0x1.p-148
},
{ // Entry 12
-0x1.p-149,
-0x1.p-149,
-0x1.p-149
},
{ // Entry 13
-0x1.p-149,
-0x1.p-149,
0.0
},
{ // Entry 14
-0x1.p-149,
-0x1.p-149,
0x1.p-149
},
{ // Entry 15
-0x1.p-149,
-0x1.p-149,
0x1.p-148
},
{ // Entry 16
-0x1.p-148,
0.0,
-0x1.p-148
},
{ // Entry 17
-0x1.p-149,
0.0,
-0x1.p-149
},
{ // Entry 18
0.0,
0.0,
0.0
},
{ // Entry 19
0.0,
0.0,
0x1.p-149
},
{ // Entry 20
0.0,
0.0,
0x1.p-148
},
{ // Entry 21
-0x1.p-148,
0x1.p-149,
-0x1.p-148
},
{ // Entry 22
-0x1.p-149,
0x1.p-149,
-0x1.p-149
},
{ // Entry 23
0.0,
0x1.p-149,
0.0
},
{ // Entry 24
0x1.p-149,
0x1.p-149,
0x1.p-149
},
{ // Entry 25
0x1.p-149,
0x1.p-149,
0x1.p-148
},
{ // Entry 26
-0x1.p-148,
0x1.p-148,
-0x1.p-148
},
{ // Entry 27
-0x1.p-149,
0x1.p-148,
-0x1.p-149
},
{ // Entry 28
0.0,
0x1.p-148,
0.0
},
{ // Entry 29
0x1.p-149,
0x1.p-148,
0x1.p-149
},
{ // Entry 30
0x1.p-148,
0x1.p-148,
0x1.p-148
},
{ // Entry 31
-0x1.fffffep127,
-0x1.fffffep127,
-0x1.fffffep127
},
{ // Entry 32
0x1.fffffep127,
0x1.fffffep127,
0x1.fffffep127
},
{ // Entry 33
-0x1.fffffep127,
-0x1.fffffep127,
0x1.fffffep127
},
{ // Entry 34
-0x1.p-149,
-0x1.p-149,
-0x1.p-149
},
{ // Entry 35
0x1.p-149,
0x1.p-149,
0x1.p-149
},
{ // Entry 36
-0x1.p-149,
0x1.p-149,
-0x1.p-149
},
{ // Entry 37
0x1.fffff8p-128,
0x1.fffff8p-128,
0x1.fffff8p-128
},
{ // Entry 38
0x1.fffff8p-128,
0x1.fffff8p-128,
0x1.p-127
},
{ // Entry 39
0x1.fffff8p-128,
0x1.fffff8p-128,
0x1.000004p-127
},
{ // Entry 40
0x1.fffff8p-128,
0x1.p-127,
0x1.fffff8p-128
},
{ // Entry 41
0x1.p-127,
0x1.p-127,
0x1.p-127
},
{ // Entry 42
0x1.p-127,
0x1.p-127,
0x1.000004p-127
},
{ // Entry 43
0x1.fffff8p-128,
0x1.000004p-127,
0x1.fffff8p-128
},
{ // Entry 44
0x1.p-127,
0x1.000004p-127,
0x1.p-127
},
{ // Entry 45
0x1.000004p-127,
0x1.000004p-127,
0x1.000004p-127
},
{ // Entry 46
0x1.fffffep-51,
0x1.fffffep-51,
0x1.fffffep-51
},
{ // Entry 47
0x1.fffffep-51,
0x1.fffffep-51,
0x1.p-50
},
{ // Entry 48
0x1.fffffep-51,
0x1.fffffep-51,
0x1.000002p-50
},
{ // Entry 49
0x1.fffffep-51,
0x1.p-50,
0x1.fffffep-51
},
{ // Entry 50
0x1.p-50,
0x1.p-50,
0x1.p-50
},
{ // Entry 51
0x1.p-50,
0x1.p-50,
0x1.000002p-50
},
{ // Entry 52
0x1.fffffep-51,
0x1.000002p-50,
0x1.fffffep-51
},
{ // Entry 53
0x1.p-50,
0x1.000002p-50,
0x1.p-50
},
{ // Entry 54
0x1.000002p-50,
0x1.000002p-50,
0x1.000002p-50
},
{ // Entry 55
0x1.fffffep-11,
0x1.fffffep-11,
0x1.fffffep-11
},
{ // Entry 56
0x1.fffffep-11,
0x1.fffffep-11,
0x1.p-10
},
{ // Entry 57
0x1.fffffep-11,
0x1.fffffep-11,
0x1.000002p-10
},
{ // Entry 58
0x1.fffffep-11,
0x1.p-10,
0x1.fffffep-11
},
{ // Entry 59
0x1.p-10,
0x1.p-10,
0x1.p-10
},
{ // Entry 60
0x1.p-10,
0x1.p-10,
0x1.000002p-10
},
{ // Entry 61
0x1.fffffep-11,
0x1.000002p-10,
0x1.fffffep-11
},
{ // Entry 62
0x1.p-10,
0x1.000002p-10,
0x1.p-10
},
{ // Entry 63
0x1.000002p-10,
0x1.000002p-10,
0x1.000002p-10
},
{ // Entry 64
0x1.fffffep-2,
0x1.fffffep-2,
0x1.fffffep-2
},
{ // Entry 65
0x1.fffffep-2,
0x1.fffffep-2,
0x1.p-1
},
{ // Entry 66
0x1.fffffep-2,
0x1.fffffep-2,
0x1.000002p-1
},
{ // Entry 67
0x1.fffffep-2,
0x1.p-1,
0x1.fffffep-2
},
{ // Entry 68
0x1.p-1,
0x1.p-1,
0x1.p-1
},
{ // Entry 69
0x1.p-1,
0x1.p-1,
0x1.000002p-1
},
{ // Entry 70
0x1.fffffep-2,
0x1.000002p-1,
0x1.fffffep-2
},
{ // Entry 71
0x1.p-1,
0x1.000002p-1,
0x1.p-1
},
{ // Entry 72
0x1.000002p-1,
0x1.000002p-1,
0x1.000002p-1
},
{ // Entry 73
0x1.fffffep0,
0x1.fffffep0,
0x1.fffffep0
},
{ // Entry 74
0x1.fffffep0,
0x1.fffffep0,
0x1.p1
},
{ // Entry 75
0x1.fffffep0,
0x1.fffffep0,
0x1.000002p1
},
{ // Entry 76
0x1.fffffep0,
0x1.p1,
0x1.fffffep0
},
{ // Entry 77
0x1.p1,
0x1.p1,
0x1.p1
},
{ // Entry 78
0x1.p1,
0x1.p1,
0x1.000002p1
},
{ // Entry 79
0x1.fffffep0,
0x1.000002p1,
0x1.fffffep0
},
{ // Entry 80
0x1.p1,
0x1.000002p1,
0x1.p1
},
{ // Entry 81
0x1.000002p1,
0x1.000002p1,
0x1.000002p1
},
{ // Entry 82
0x1.fffffep9,
0x1.fffffep9,
0x1.fffffep9
},
{ // Entry 83
0x1.fffffep9,
0x1.fffffep9,
0x1.p10
},
{ // Entry 84
0x1.fffffep9,
0x1.fffffep9,
0x1.000002p10
},
{ // Entry 85
0x1.fffffep9,
0x1.p10,
0x1.fffffep9
},
{ // Entry 86
0x1.p10,
0x1.p10,
0x1.p10
},
{ // Entry 87
0x1.p10,
0x1.p10,
0x1.000002p10
},
{ // Entry 88
0x1.fffffep9,
0x1.000002p10,
0x1.fffffep9
},
{ // Entry 89
0x1.p10,
0x1.000002p10,
0x1.p10
},
{ // Entry 90
0x1.000002p10,
0x1.000002p10,
0x1.000002p10
},
{ // Entry 91
0x1.fffffep49,
0x1.fffffep49,
0x1.fffffep49
},
{ // Entry 92
0x1.fffffep49,
0x1.fffffep49,
0x1.p50
},
{ // Entry 93
0x1.fffffep49,
0x1.fffffep49,
0x1.000002p50
},
{ // Entry 94
0x1.fffffep49,
0x1.p50,
0x1.fffffep49
},
{ // Entry 95
0x1.p50,
0x1.p50,
0x1.p50
},
{ // Entry 96
0x1.p50,
0x1.p50,
0x1.000002p50
},
{ // Entry 97
0x1.fffffep49,
0x1.000002p50,
0x1.fffffep49
},
{ // Entry 98
0x1.p50,
0x1.000002p50,
0x1.p50
},
{ // Entry 99
0x1.000002p50,
0x1.000002p50,
0x1.000002p50
},
{ // Entry 100
0x1.fffffep126,
0x1.fffffep126,
0x1.fffffep126
},
{ // Entry 101
0x1.fffffep126,
0x1.fffffep126,
0x1.p127
},
{ // Entry 102
0x1.fffffep126,
0x1.fffffep126,
0x1.000002p127
},
{ // Entry 103
0x1.fffffep126,
0x1.p127,
0x1.fffffep126
},
{ // Entry 104
0x1.p127,
0x1.p127,
0x1.p127
},
{ // Entry 105
0x1.p127,
0x1.p127,
0x1.000002p127
},
{ // Entry 106
0x1.fffffep126,
0x1.000002p127,
0x1.fffffep126
},
{ // Entry 107
0x1.p127,
0x1.000002p127,
0x1.p127
},
{ // Entry 108
0x1.000002p127,
0x1.000002p127,
0x1.000002p127
},
{ // Entry 109
HUGE_VALF,
HUGE_VALF,
HUGE_VALF
},
{ // Entry 110
0x1.fffffep127,
HUGE_VALF,
0x1.fffffep127
},
{ // Entry 111
0x1.p-126,
HUGE_VALF,
0x1.p-126
},
{ // Entry 112
0x1.p-149,
HUGE_VALF,
0x1.p-149
},
{ // Entry 113
0.0,
HUGE_VALF,
0.0f
},
{ // Entry 114
-0.0,
HUGE_VALF,
-0.0f
},
{ // Entry 115
-0x1.p-149,
HUGE_VALF,
-0x1.p-149
},
{ // Entry 116
-0x1.p-126,
HUGE_VALF,
-0x1.p-126
},
{ // Entry 117
-0x1.fffffep127,
HUGE_VALF,
-0x1.fffffep127
},
{ // Entry 118
-HUGE_VALF,
HUGE_VALF,
-HUGE_VALF
},
{ // Entry 119
0x1.fffffep127,
0x1.fffffep127,
HUGE_VALF
},
{ // Entry 120
0x1.p-126,
0x1.p-126,
HUGE_VALF
},
{ // Entry 121
0x1.p-149,
0x1.p-149,
HUGE_VALF
},
{ // Entry 122
0.0,
0.0f,
HUGE_VALF
},
{ // Entry 123
-0.0,
-0.0f,
HUGE_VALF
},
{ // Entry 124
-0x1.p-149,
-0x1.p-149,
HUGE_VALF
},
{ // Entry 125
-0x1.p-126,
-0x1.p-126,
HUGE_VALF
},
{ // Entry 126
-0x1.fffffep127,
-0x1.fffffep127,
HUGE_VALF
},
{ // Entry 127
-HUGE_VALF,
-HUGE_VALF,
HUGE_VALF
},
{ // Entry 128
0x1.fffffep127,
0x1.fffffep127,
0x1.fffffep127
},
{ // Entry 129
0x1.p-126,
0x1.fffffep127,
0x1.p-126
},
{ // Entry 130
0x1.p-149,
0x1.fffffep127,
0x1.p-149
},
{ // Entry 131
0.0,
0x1.fffffep127,
0.0f
},
{ // Entry 132
-0.0,
0x1.fffffep127,
-0.0f
},
{ // Entry 133
-0x1.p-149,
0x1.fffffep127,
-0x1.p-149
},
{ // Entry 134
-0x1.p-126,
0x1.fffffep127,
-0x1.p-126
},
{ // Entry 135
-0x1.fffffep127,
0x1.fffffep127,
-0x1.fffffep127
},
{ // Entry 136
-HUGE_VALF,
0x1.fffffep127,
-HUGE_VALF
},
{ // Entry 137
0x1.p-126,
0x1.p-126,
0x1.fffffep127
},
{ // Entry 138
0x1.p-149,
0x1.p-149,
0x1.fffffep127
},
{ // Entry 139
0.0,
0.0f,
0x1.fffffep127
},
{ // Entry 140
-0.0,
-0.0f,
0x1.fffffep127
},
{ // Entry 141
-0x1.p-149,
-0x1.p-149,
0x1.fffffep127
},
{ // Entry 142
-0x1.p-126,
-0x1.p-126,
0x1.fffffep127
},
{ // Entry 143
-0x1.fffffep127,
-0x1.fffffep127,
0x1.fffffep127
},
{ // Entry 144
-HUGE_VALF,
-HUGE_VALF,
0x1.fffffep127
},
{ // Entry 145
0x1.p-126,
0x1.p-126,
0x1.p-126
},
{ // Entry 146
0x1.p-149,
0x1.p-126,
0x1.p-149
},
{ // Entry 147
0.0,
0x1.p-126,
0.0f
},
{ // Entry 148
-0.0,
0x1.p-126,
-0.0f
},
{ // Entry 149
-0x1.p-149,
0x1.p-126,
-0x1.p-149
},
{ // Entry 150
-0x1.p-126,
0x1.p-126,
-0x1.p-126
},
{ // Entry 151
-0x1.fffffep127,
0x1.p-126,
-0x1.fffffep127
},
{ // Entry 152
-HUGE_VALF,
0x1.p-126,
-HUGE_VALF
},
{ // Entry 153
0x1.p-149,
0x1.p-149,
0x1.p-126
},
{ // Entry 154
0.0,
0.0f,
0x1.p-126
},
{ // Entry 155
-0.0,
-0.0f,
0x1.p-126
},
{ // Entry 156
-0x1.p-149,
-0x1.p-149,
0x1.p-126
},
{ // Entry 157
-0x1.p-126,
-0x1.p-126,
0x1.p-126
},
{ // Entry 158
-0x1.fffffep127,
-0x1.fffffep127,
0x1.p-126
},
{ // Entry 159
-HUGE_VALF,
-HUGE_VALF,
0x1.p-126
},
{ // Entry 160
0x1.p-149,
0x1.p-149,
0x1.p-149
},
{ // Entry 161
0.0,
0x1.p-149,
0.0f
},
{ // Entry 162
-0.0,
0x1.p-149,
-0.0f
},
{ // Entry 163
-0x1.p-149,
0x1.p-149,
-0x1.p-149
},
{ // Entry 164
-0x1.p-126,
0x1.p-149,
-0x1.p-126
},
{ // Entry 165
-0x1.fffffep127,
0x1.p-149,
-0x1.fffffep127
},
{ // Entry 166
-HUGE_VALF,
0x1.p-149,
-HUGE_VALF
},
{ // Entry 167
0.0,
0.0f,
0x1.p-149
},
{ // Entry 168
-0.0,
-0.0f,
0x1.p-149
},
{ // Entry 169
-0x1.p-149,
-0x1.p-149,
0x1.p-149
},
{ // Entry 170
-0x1.p-126,
-0x1.p-126,
0x1.p-149
},
{ // Entry 171
-0x1.fffffep127,
-0x1.fffffep127,
0x1.p-149
},
{ // Entry 172
-HUGE_VALF,
-HUGE_VALF,
0x1.p-149
},
{ // Entry 173
0.0,
0.0f,
0.0f
},
{ // Entry 174
0.0,
0.0f,
-0.0f
},
{ // Entry 175
-0x1.p-149,
0.0f,
-0x1.p-149
},
{ // Entry 176
-0x1.p-126,
0.0f,
-0x1.p-126
},
{ // Entry 177
-0x1.fffffep127,
0.0f,
-0x1.fffffep127
},
{ // Entry 178
-HUGE_VALF,
0.0f,
-HUGE_VALF
},
{ // Entry 179
-0.0,
-0.0f,
0.0f
},
{ // Entry 180
-0x1.p-149,
-0x1.p-149,
0.0f
},
{ // Entry 181
-0x1.p-126,
-0x1.p-126,
0.0f
},
{ // Entry 182
-0x1.fffffep127,
-0x1.fffffep127,
0.0f
},
{ // Entry 183
-HUGE_VALF,
-HUGE_VALF,
0.0f
},
{ // Entry 184
-0.0,
-0.0f,
-0.0f
},
{ // Entry 185
-0x1.p-149,
-0.0f,
-0x1.p-149
},
{ // Entry 186
-0x1.p-126,
-0.0f,
-0x1.p-126
},
{ // Entry 187
-0x1.fffffep127,
-0.0f,
-0x1.fffffep127
},
{ // Entry 188
-HUGE_VALF,
-0.0f,
-HUGE_VALF
},
{ // Entry 189
-0x1.p-149,
-0x1.p-149,
-0.0f
},
{ // Entry 190
-0x1.p-126,
-0x1.p-126,
-0.0f
},
{ // Entry 191
-0x1.fffffep127,
-0x1.fffffep127,
-0.0f
},
{ // Entry 192
-HUGE_VALF,
-HUGE_VALF,
-0.0f
},
{ // Entry 193
-0x1.p-149,
-0x1.p-149,
-0x1.p-149
},
{ // Entry 194
-0x1.p-126,
-0x1.p-149,
-0x1.p-126
},
{ // Entry 195
-0x1.fffffep127,
-0x1.p-149,
-0x1.fffffep127
},
{ // Entry 196
-HUGE_VALF,
-0x1.p-149,
-HUGE_VALF
},
{ // Entry 197
-0x1.p-126,
-0x1.p-126,
-0x1.p-149
},
{ // Entry 198
-0x1.fffffep127,
-0x1.fffffep127,
-0x1.p-149
},
{ // Entry 199
-HUGE_VALF,
-HUGE_VALF,
-0x1.p-149
},
{ // Entry 200
-0x1.p-126,
-0x1.p-126,
-0x1.p-126
},
{ // Entry 201
-0x1.fffffep127,
-0x1.p-126,
-0x1.fffffep127
},
{ // Entry 202
-HUGE_VALF,
-0x1.p-126,
-HUGE_VALF
},
{ // Entry 203
-0x1.fffffep127,
-0x1.fffffep127,
-0x1.p-126
},
{ // Entry 204
-HUGE_VALF,
-HUGE_VALF,
-0x1.p-126
},
{ // Entry 205
-0x1.fffffep127,
-0x1.fffffep127,
-0x1.fffffep127
},
{ // Entry 206
-HUGE_VALF,
-0x1.fffffep127,
-HUGE_VALF
},
{ // Entry 207
-HUGE_VALF,
-HUGE_VALF,
-0x1.fffffep127
},
{ // Entry 208
-HUGE_VALF,
-HUGE_VALF,
-HUGE_VALF
},
{ // Entry 209
0x1.p-149,
0x1.p-149,
0x1.fffffcp-127
},
{ // Entry 210
0x1.p-149,
0x1.fffffcp-127,
0x1.p-149
},
{ // Entry 211
-0x1.p-149,
-0x1.p-149,
0x1.fffffcp-127
},
{ // Entry 212
-0x1.fffffcp-127,
-0x1.fffffcp-127,
0x1.p-149
},
{ // Entry 213
-0x1.fffffcp-127,
0x1.p-149,
-0x1.fffffcp-127
},
{ // Entry 214
-0x1.p-149,
0x1.fffffcp-127,
-0x1.p-149
},
{ // Entry 215
-0x1.fffffcp-127,
-0x1.p-149,
-0x1.fffffcp-127
},
{ // Entry 216
-0x1.fffffcp-127,
-0x1.fffffcp-127,
-0x1.p-149
}
};