56b2b2916b
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>
714 lines
9.5 KiB
C
714 lines
9.5 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_logbf_intel_data[] = {
|
|
{ // Entry 0
|
|
0x1.90p6,
|
|
0x1.p100
|
|
},
|
|
{ // Entry 1
|
|
0x1.90p6,
|
|
0x1.19999ap100
|
|
},
|
|
{ // Entry 2
|
|
0x1.90p6,
|
|
0x1.333334p100
|
|
},
|
|
{ // Entry 3
|
|
0x1.90p6,
|
|
0x1.4ccccep100
|
|
},
|
|
{ // Entry 4
|
|
0x1.90p6,
|
|
0x1.666668p100
|
|
},
|
|
{ // Entry 5
|
|
0x1.90p6,
|
|
0x1.800002p100
|
|
},
|
|
{ // Entry 6
|
|
0x1.90p6,
|
|
0x1.99999cp100
|
|
},
|
|
{ // Entry 7
|
|
0x1.90p6,
|
|
0x1.b33336p100
|
|
},
|
|
{ // Entry 8
|
|
0x1.90p6,
|
|
0x1.ccccd0p100
|
|
},
|
|
{ // Entry 9
|
|
0x1.90p6,
|
|
0x1.e6666ap100
|
|
},
|
|
{ // Entry 10
|
|
0x1.94p6,
|
|
0x1.p101
|
|
},
|
|
{ // Entry 11
|
|
0x1.94p6,
|
|
-0x1.p101
|
|
},
|
|
{ // Entry 12
|
|
0x1.90p6,
|
|
-0x1.e66666p100
|
|
},
|
|
{ // Entry 13
|
|
0x1.90p6,
|
|
-0x1.ccccccp100
|
|
},
|
|
{ // Entry 14
|
|
0x1.90p6,
|
|
-0x1.b33332p100
|
|
},
|
|
{ // Entry 15
|
|
0x1.90p6,
|
|
-0x1.999998p100
|
|
},
|
|
{ // Entry 16
|
|
0x1.90p6,
|
|
-0x1.7ffffep100
|
|
},
|
|
{ // Entry 17
|
|
0x1.90p6,
|
|
-0x1.666664p100
|
|
},
|
|
{ // Entry 18
|
|
0x1.90p6,
|
|
-0x1.4ccccap100
|
|
},
|
|
{ // Entry 19
|
|
0x1.90p6,
|
|
-0x1.333330p100
|
|
},
|
|
{ // Entry 20
|
|
0x1.90p6,
|
|
-0x1.199996p100
|
|
},
|
|
{ // Entry 21
|
|
0x1.90p6,
|
|
-0x1.p100
|
|
},
|
|
{ // Entry 22
|
|
0x1.50p4,
|
|
0x1.p21
|
|
},
|
|
{ // Entry 23
|
|
0x1.50p4,
|
|
0x1.19999ap21
|
|
},
|
|
{ // Entry 24
|
|
0x1.50p4,
|
|
0x1.333334p21
|
|
},
|
|
{ // Entry 25
|
|
0x1.50p4,
|
|
0x1.4ccccep21
|
|
},
|
|
{ // Entry 26
|
|
0x1.50p4,
|
|
0x1.666668p21
|
|
},
|
|
{ // Entry 27
|
|
0x1.50p4,
|
|
0x1.800002p21
|
|
},
|
|
{ // Entry 28
|
|
0x1.50p4,
|
|
0x1.99999cp21
|
|
},
|
|
{ // Entry 29
|
|
0x1.50p4,
|
|
0x1.b33336p21
|
|
},
|
|
{ // Entry 30
|
|
0x1.50p4,
|
|
0x1.ccccd0p21
|
|
},
|
|
{ // Entry 31
|
|
0x1.50p4,
|
|
0x1.e6666ap21
|
|
},
|
|
{ // Entry 32
|
|
0x1.60p4,
|
|
0x1.p22
|
|
},
|
|
{ // Entry 33
|
|
0x1.60p4,
|
|
0x1.p22
|
|
},
|
|
{ // Entry 34
|
|
0x1.60p4,
|
|
0x1.19999ap22
|
|
},
|
|
{ // Entry 35
|
|
0x1.60p4,
|
|
0x1.333334p22
|
|
},
|
|
{ // Entry 36
|
|
0x1.60p4,
|
|
0x1.4ccccep22
|
|
},
|
|
{ // Entry 37
|
|
0x1.60p4,
|
|
0x1.666668p22
|
|
},
|
|
{ // Entry 38
|
|
0x1.60p4,
|
|
0x1.800002p22
|
|
},
|
|
{ // Entry 39
|
|
0x1.60p4,
|
|
0x1.99999cp22
|
|
},
|
|
{ // Entry 40
|
|
0x1.60p4,
|
|
0x1.b33336p22
|
|
},
|
|
{ // Entry 41
|
|
0x1.60p4,
|
|
0x1.ccccd0p22
|
|
},
|
|
{ // Entry 42
|
|
0x1.60p4,
|
|
0x1.e6666ap22
|
|
},
|
|
{ // Entry 43
|
|
0x1.70p4,
|
|
0x1.p23
|
|
},
|
|
{ // Entry 44
|
|
0x1.70p4,
|
|
0x1.p23
|
|
},
|
|
{ // Entry 45
|
|
0x1.70p4,
|
|
0x1.19999ap23
|
|
},
|
|
{ // Entry 46
|
|
0x1.70p4,
|
|
0x1.333334p23
|
|
},
|
|
{ // Entry 47
|
|
0x1.70p4,
|
|
0x1.4ccccep23
|
|
},
|
|
{ // Entry 48
|
|
0x1.70p4,
|
|
0x1.666668p23
|
|
},
|
|
{ // Entry 49
|
|
0x1.70p4,
|
|
0x1.800002p23
|
|
},
|
|
{ // Entry 50
|
|
0x1.70p4,
|
|
0x1.99999cp23
|
|
},
|
|
{ // Entry 51
|
|
0x1.70p4,
|
|
0x1.b33336p23
|
|
},
|
|
{ // Entry 52
|
|
0x1.70p4,
|
|
0x1.ccccd0p23
|
|
},
|
|
{ // Entry 53
|
|
0x1.70p4,
|
|
0x1.e6666ap23
|
|
},
|
|
{ // Entry 54
|
|
0x1.80p4,
|
|
0x1.p24
|
|
},
|
|
{ // Entry 55
|
|
0x1.80p4,
|
|
0x1.p24
|
|
},
|
|
{ // Entry 56
|
|
0x1.80p4,
|
|
0x1.19999ap24
|
|
},
|
|
{ // Entry 57
|
|
0x1.80p4,
|
|
0x1.333334p24
|
|
},
|
|
{ // Entry 58
|
|
0x1.80p4,
|
|
0x1.4ccccep24
|
|
},
|
|
{ // Entry 59
|
|
0x1.80p4,
|
|
0x1.666668p24
|
|
},
|
|
{ // Entry 60
|
|
0x1.80p4,
|
|
0x1.800002p24
|
|
},
|
|
{ // Entry 61
|
|
0x1.80p4,
|
|
0x1.99999cp24
|
|
},
|
|
{ // Entry 62
|
|
0x1.80p4,
|
|
0x1.b33336p24
|
|
},
|
|
{ // Entry 63
|
|
0x1.80p4,
|
|
0x1.ccccd0p24
|
|
},
|
|
{ // Entry 64
|
|
0x1.80p4,
|
|
0x1.e6666ap24
|
|
},
|
|
{ // Entry 65
|
|
0x1.90p4,
|
|
0x1.p25
|
|
},
|
|
{ // Entry 66
|
|
-0x1.04p7,
|
|
0x1.p-130
|
|
},
|
|
{ // Entry 67
|
|
-0x1.p7,
|
|
0x1.d33330p-128
|
|
},
|
|
{ // Entry 68
|
|
-0x1.fcp6,
|
|
0x1.b33330p-127
|
|
},
|
|
{ // Entry 69
|
|
-0x1.f8p6,
|
|
0x1.3e6664p-126
|
|
},
|
|
{ // Entry 70
|
|
-0x1.f8p6,
|
|
0x1.a33330p-126
|
|
},
|
|
{ // Entry 71
|
|
-0x1.f4p6,
|
|
0x1.03fffep-125
|
|
},
|
|
{ // Entry 72
|
|
-0x1.f4p6,
|
|
0x1.366664p-125
|
|
},
|
|
{ // Entry 73
|
|
-0x1.f4p6,
|
|
0x1.68cccap-125
|
|
},
|
|
{ // Entry 74
|
|
-0x1.f4p6,
|
|
0x1.9b3330p-125
|
|
},
|
|
{ // Entry 75
|
|
-0x1.f4p6,
|
|
0x1.cd9996p-125
|
|
},
|
|
{ // Entry 76
|
|
-0x1.f4p6,
|
|
0x1.fffffcp-125
|
|
},
|
|
{ // Entry 77
|
|
0x1.50p4,
|
|
0x1.fffffep21
|
|
},
|
|
{ // Entry 78
|
|
0x1.60p4,
|
|
0x1.p22
|
|
},
|
|
{ // Entry 79
|
|
0x1.60p4,
|
|
0x1.000002p22
|
|
},
|
|
{ // Entry 80
|
|
0x1.60p4,
|
|
0x1.fffffep22
|
|
},
|
|
{ // Entry 81
|
|
0x1.70p4,
|
|
0x1.p23
|
|
},
|
|
{ // Entry 82
|
|
0x1.70p4,
|
|
0x1.000002p23
|
|
},
|
|
{ // Entry 83
|
|
0x1.70p4,
|
|
0x1.fffffep23
|
|
},
|
|
{ // Entry 84
|
|
0x1.80p4,
|
|
0x1.p24
|
|
},
|
|
{ // Entry 85
|
|
0x1.80p4,
|
|
0x1.000002p24
|
|
},
|
|
{ // Entry 86
|
|
0x1.60p4,
|
|
-0x1.000002p22
|
|
},
|
|
{ // Entry 87
|
|
0x1.60p4,
|
|
-0x1.p22
|
|
},
|
|
{ // Entry 88
|
|
0x1.50p4,
|
|
-0x1.fffffep21
|
|
},
|
|
{ // Entry 89
|
|
0x1.70p4,
|
|
-0x1.000002p23
|
|
},
|
|
{ // Entry 90
|
|
0x1.70p4,
|
|
-0x1.p23
|
|
},
|
|
{ // Entry 91
|
|
0x1.60p4,
|
|
-0x1.fffffep22
|
|
},
|
|
{ // Entry 92
|
|
0x1.80p4,
|
|
-0x1.000002p24
|
|
},
|
|
{ // Entry 93
|
|
0x1.80p4,
|
|
-0x1.p24
|
|
},
|
|
{ // Entry 94
|
|
0x1.70p4,
|
|
-0x1.fffffep23
|
|
},
|
|
{ // Entry 95
|
|
0x1.fcp6,
|
|
0x1.fffffep127
|
|
},
|
|
{ // Entry 96
|
|
0x1.fcp6,
|
|
-0x1.fffffep127
|
|
},
|
|
{ // Entry 97
|
|
-0x1.c0p2,
|
|
0x1.fffffep-7
|
|
},
|
|
{ // Entry 98
|
|
-0x1.80p2,
|
|
0x1.p-6
|
|
},
|
|
{ // Entry 99
|
|
-0x1.80p2,
|
|
0x1.000002p-6
|
|
},
|
|
{ // Entry 100
|
|
-0x1.80p2,
|
|
0x1.fffffep-6
|
|
},
|
|
{ // Entry 101
|
|
-0x1.40p2,
|
|
0x1.p-5
|
|
},
|
|
{ // Entry 102
|
|
-0x1.40p2,
|
|
0x1.000002p-5
|
|
},
|
|
{ // Entry 103
|
|
-0x1.40p2,
|
|
0x1.fffffep-5
|
|
},
|
|
{ // Entry 104
|
|
-0x1.p2,
|
|
0x1.p-4
|
|
},
|
|
{ // Entry 105
|
|
-0x1.p2,
|
|
0x1.000002p-4
|
|
},
|
|
{ // Entry 106
|
|
-0x1.p2,
|
|
0x1.fffffep-4
|
|
},
|
|
{ // Entry 107
|
|
-0x1.80p1,
|
|
0x1.p-3
|
|
},
|
|
{ // Entry 108
|
|
-0x1.80p1,
|
|
0x1.000002p-3
|
|
},
|
|
{ // Entry 109
|
|
-0x1.80p1,
|
|
0x1.fffffep-3
|
|
},
|
|
{ // Entry 110
|
|
-0x1.p1,
|
|
0x1.p-2
|
|
},
|
|
{ // Entry 111
|
|
-0x1.p1,
|
|
0x1.000002p-2
|
|
},
|
|
{ // Entry 112
|
|
-0x1.p1,
|
|
0x1.fffffep-2
|
|
},
|
|
{ // Entry 113
|
|
-0x1.p0,
|
|
0x1.p-1
|
|
},
|
|
{ // Entry 114
|
|
-0x1.p0,
|
|
0x1.000002p-1
|
|
},
|
|
{ // Entry 115
|
|
-0x1.2ap7,
|
|
-0x1.p-149
|
|
},
|
|
{ // Entry 116
|
|
-HUGE_VALF,
|
|
0.0
|
|
},
|
|
{ // Entry 117
|
|
-0x1.2ap7,
|
|
0x1.p-149
|
|
},
|
|
{ // Entry 118
|
|
-0x1.p0,
|
|
0x1.fffffep-1
|
|
},
|
|
{ // Entry 119
|
|
0.0,
|
|
0x1.p0
|
|
},
|
|
{ // Entry 120
|
|
0.0,
|
|
0x1.000002p0
|
|
},
|
|
{ // Entry 121
|
|
0.0,
|
|
0x1.fffffep0
|
|
},
|
|
{ // Entry 122
|
|
0x1.p0,
|
|
0x1.p1
|
|
},
|
|
{ // Entry 123
|
|
0x1.p0,
|
|
0x1.000002p1
|
|
},
|
|
{ // Entry 124
|
|
0x1.p0,
|
|
0x1.fffffep1
|
|
},
|
|
{ // Entry 125
|
|
0x1.p1,
|
|
0x1.p2
|
|
},
|
|
{ // Entry 126
|
|
0x1.p1,
|
|
0x1.000002p2
|
|
},
|
|
{ // Entry 127
|
|
0x1.p1,
|
|
0x1.fffffep2
|
|
},
|
|
{ // Entry 128
|
|
0x1.80p1,
|
|
0x1.p3
|
|
},
|
|
{ // Entry 129
|
|
0x1.80p1,
|
|
0x1.000002p3
|
|
},
|
|
{ // Entry 130
|
|
0x1.80p1,
|
|
0x1.fffffep3
|
|
},
|
|
{ // Entry 131
|
|
0x1.p2,
|
|
0x1.p4
|
|
},
|
|
{ // Entry 132
|
|
0x1.p2,
|
|
0x1.000002p4
|
|
},
|
|
{ // Entry 133
|
|
0x1.p2,
|
|
0x1.fffffep4
|
|
},
|
|
{ // Entry 134
|
|
0x1.40p2,
|
|
0x1.p5
|
|
},
|
|
{ // Entry 135
|
|
0x1.40p2,
|
|
0x1.000002p5
|
|
},
|
|
{ // Entry 136
|
|
0x1.40p2,
|
|
0x1.fffffep5
|
|
},
|
|
{ // Entry 137
|
|
0x1.80p2,
|
|
0x1.p6
|
|
},
|
|
{ // Entry 138
|
|
0x1.80p2,
|
|
0x1.000002p6
|
|
},
|
|
{ // Entry 139
|
|
0x1.80p2,
|
|
0x1.fffffep6
|
|
},
|
|
{ // Entry 140
|
|
0x1.c0p2,
|
|
0x1.p7
|
|
},
|
|
{ // Entry 141
|
|
0x1.c0p2,
|
|
0x1.000002p7
|
|
},
|
|
{ // Entry 142
|
|
HUGE_VALF,
|
|
HUGE_VALF
|
|
},
|
|
{ // Entry 143
|
|
HUGE_VALF,
|
|
-HUGE_VALF
|
|
},
|
|
{ // Entry 144
|
|
0x1.fcp6,
|
|
0x1.fffffep127
|
|
},
|
|
{ // Entry 145
|
|
0x1.fcp6,
|
|
-0x1.fffffep127
|
|
},
|
|
{ // Entry 146
|
|
0x1.fcp6,
|
|
0x1.fffffcp127
|
|
},
|
|
{ // Entry 147
|
|
0x1.fcp6,
|
|
-0x1.fffffcp127
|
|
},
|
|
{ // Entry 148
|
|
0x1.p0,
|
|
0x1.921fb6p1
|
|
},
|
|
{ // Entry 149
|
|
0x1.p0,
|
|
-0x1.921fb6p1
|
|
},
|
|
{ // Entry 150
|
|
0.0,
|
|
0x1.921fb6p0
|
|
},
|
|
{ // Entry 151
|
|
0.0,
|
|
-0x1.921fb6p0
|
|
},
|
|
{ // Entry 152
|
|
0.0,
|
|
0x1.000002p0
|
|
},
|
|
{ // Entry 153
|
|
0.0,
|
|
-0x1.000002p0
|
|
},
|
|
{ // Entry 154
|
|
0.0,
|
|
0x1.p0
|
|
},
|
|
{ // Entry 155
|
|
0.0,
|
|
-0x1.p0
|
|
},
|
|
{ // Entry 156
|
|
-0x1.p0,
|
|
0x1.fffffep-1
|
|
},
|
|
{ // Entry 157
|
|
-0x1.p0,
|
|
-0x1.fffffep-1
|
|
},
|
|
{ // Entry 158
|
|
-0x1.p0,
|
|
0x1.921fb6p-1
|
|
},
|
|
{ // Entry 159
|
|
-0x1.p0,
|
|
-0x1.921fb6p-1
|
|
},
|
|
{ // Entry 160
|
|
-0x1.f8p6,
|
|
0x1.000002p-126
|
|
},
|
|
{ // Entry 161
|
|
-0x1.f8p6,
|
|
-0x1.000002p-126
|
|
},
|
|
{ // Entry 162
|
|
-0x1.f8p6,
|
|
0x1.p-126
|
|
},
|
|
{ // Entry 163
|
|
-0x1.f8p6,
|
|
-0x1.p-126
|
|
},
|
|
{ // Entry 164
|
|
-0x1.fcp6,
|
|
0x1.fffffcp-127
|
|
},
|
|
{ // Entry 165
|
|
-0x1.fcp6,
|
|
-0x1.fffffcp-127
|
|
},
|
|
{ // Entry 166
|
|
-0x1.fcp6,
|
|
0x1.fffff8p-127
|
|
},
|
|
{ // Entry 167
|
|
-0x1.fcp6,
|
|
-0x1.fffff8p-127
|
|
},
|
|
{ // Entry 168
|
|
-0x1.28p7,
|
|
0x1.p-148
|
|
},
|
|
{ // Entry 169
|
|
-0x1.28p7,
|
|
-0x1.p-148
|
|
},
|
|
{ // Entry 170
|
|
-0x1.2ap7,
|
|
0x1.p-149
|
|
},
|
|
{ // Entry 171
|
|
-0x1.2ap7,
|
|
-0x1.p-149
|
|
},
|
|
{ // Entry 172
|
|
-HUGE_VALF,
|
|
0.0f
|
|
},
|
|
{ // Entry 173
|
|
-HUGE_VALF,
|
|
-0.0f
|
|
}
|
|
};
|