* [PATCH v2] Add powf bench tests
@ 2017-06-12 20:19 Paul Clarke
2017-06-12 20:28 ` Joseph Myers
0 siblings, 1 reply; 2+ messages in thread
From: Paul Clarke @ 2017-06-12 20:19 UTC (permalink / raw)
To: libc-alpha
2017-06-12 Paul A. Clarke <pc@us.ibm.com>
Add powf() bench test with input which covers these cases:
- positive base to positive exponent
- exponent 0
- exponent 1
- exponent -1
- squared
- squareroot
- negative base to even exponent
- negative base to odd exponent
- negative base to non-integer exponent
- base 0
- 1 to negative exponent
- -1 to negative exponent
- -1 to non-integer exponent
- -1 to odd exponent
- -1 to even exponent
- small base
- small exponent
* benchtests/Makefile (bench-math): Add powf.
* benchtests/powf-inputs: New file.
---
Changes in v2:
Joseph caught me being lazy by using the input for pow tests, which often results in bad/uninteresting input data. (Good catch!) I've now created a new input file which covers a lot of the special cases and the fairly generic case as well.
benchtests/Makefile | 2 +-
benchtests/powf-inputs | 410 +++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 411 insertions(+), 1 deletion(-)
create mode 100644 benchtests/powf-inputs
diff --git a/benchtests/Makefile b/benchtests/Makefile
index 7f5fda5..f49e9a0 100644
--- a/benchtests/Makefile
+++ b/benchtests/Makefile
@@ -23,7 +23,7 @@ subdir := benchtests
include ../Makeconfig
bench-math := acos acosh asin asinh atan atanh cos cosh exp exp2 log log2 \
modf pow rint sin sincos sinh sqrt tan tanh fmin fmax fminf \
- fmaxf
+ fmaxf powf
bench-pthread := pthread_once
diff --git a/benchtests/powf-inputs b/benchtests/powf-inputs
new file mode 100644
index 0000000..6cdb05b
--- /dev/null
+++ b/benchtests/powf-inputs
@@ -0,0 +1,410 @@
+## args: float:float
+## ret: float
+## includes: math.h
+## name: positive base to positive exponent
+0x0p+0, 0x0p+0
+0x0p+0, 0x1.22e8bap+2
+0x0p+0, 0x1.22e8bap+3
+0x0p+0, 0x1.b45d18p+3
+0x0p+0, 0x1.22e8bap+4
+0x0p+0, 0x1.6ba2eap+4
+0x0p+0, 0x1.b45d18p+4
+0x0p+0, 0x1.fd1746p+4
+0x0p+0, 0x1.22e8bap+5
+0x0p+0, 0x1.4745d2p+5
+0x0p+0, 0x1.6ba2eap+5
+0x0p+0, 0x1.9p+5
+0x1.22e8bap+2, 0x0p+0
+0x1.22e8bap+2, 0x1.22e8bap+2
+0x1.22e8bap+2, 0x1.22e8bap+3
+0x1.22e8bap+2, 0x1.b45d18p+3
+0x1.22e8bap+2, 0x1.22e8bap+4
+0x1.22e8bap+2, 0x1.6ba2eap+4
+0x1.22e8bap+2, 0x1.b45d18p+4
+0x1.22e8bap+2, 0x1.fd1746p+4
+0x1.22e8bap+2, 0x1.22e8bap+5
+0x1.22e8bap+2, 0x1.4745d2p+5
+0x1.22e8bap+2, 0x1.6ba2eap+5
+0x1.22e8bap+2, 0x1.9p+5
+0x1.22e8bap+3, 0x0p+0
+0x1.22e8bap+3, 0x1.22e8bap+2
+0x1.22e8bap+3, 0x1.22e8bap+3
+0x1.22e8bap+3, 0x1.b45d18p+3
+0x1.22e8bap+3, 0x1.22e8bap+4
+0x1.22e8bap+3, 0x1.6ba2eap+4
+0x1.22e8bap+3, 0x1.b45d18p+4
+0x1.22e8bap+3, 0x1.fd1746p+4
+0x1.22e8bap+3, 0x1.22e8bap+5
+0x1.22e8bap+3, 0x1.4745d2p+5
+0x1.22e8bap+3, 0x1.6ba2eap+5
+0x1.22e8bap+3, 0x1.9p+5
+0x1.b45d18p+3, 0x0p+0
+0x1.b45d18p+3, 0x1.22e8bap+2
+0x1.b45d18p+3, 0x1.22e8bap+3
+0x1.b45d18p+3, 0x1.b45d18p+3
+0x1.b45d18p+3, 0x1.22e8bap+4
+0x1.b45d18p+3, 0x1.6ba2eap+4
+0x1.b45d18p+3, 0x1.b45d18p+4
+0x1.b45d18p+3, 0x1.fd1746p+4
+0x1.b45d18p+3, 0x1.22e8bap+5
+0x1.b45d18p+3, 0x1.4745d2p+5
+0x1.b45d18p+3, 0x1.6ba2eap+5
+0x1.b45d18p+3, 0x1.9p+5
+0x1.22e8bap+4, 0x0p+0
+0x1.22e8bap+4, 0x1.22e8bap+2
+0x1.22e8bap+4, 0x1.22e8bap+3
+0x1.22e8bap+4, 0x1.b45d18p+3
+0x1.22e8bap+4, 0x1.22e8bap+4
+0x1.22e8bap+4, 0x1.6ba2eap+4
+0x1.22e8bap+4, 0x1.b45d18p+4
+0x1.22e8bap+4, 0x1.fd1746p+4
+0x1.22e8bap+4, 0x1.22e8bap+5
+0x1.22e8bap+4, 0x1.4745d2p+5
+0x1.22e8bap+4, 0x1.6ba2eap+5
+0x1.22e8bap+4, 0x1.9p+5
+0x1.6ba2eap+4, 0x0p+0
+0x1.6ba2eap+4, 0x1.22e8bap+2
+0x1.6ba2eap+4, 0x1.22e8bap+3
+0x1.6ba2eap+4, 0x1.b45d18p+3
+0x1.6ba2eap+4, 0x1.22e8bap+4
+0x1.6ba2eap+4, 0x1.6ba2eap+4
+0x1.6ba2eap+4, 0x1.b45d18p+4
+0x1.6ba2eap+4, 0x1.fd1746p+4
+0x1.6ba2eap+4, 0x1.22e8bap+5
+0x1.6ba2eap+4, 0x1.4745d2p+5
+0x1.6ba2eap+4, 0x1.6ba2eap+5
+0x1.6ba2eap+4, 0x1.9p+5
+0x1.b45d18p+4, 0x0p+0
+0x1.b45d18p+4, 0x1.22e8bap+2
+0x1.b45d18p+4, 0x1.22e8bap+3
+0x1.b45d18p+4, 0x1.b45d18p+3
+0x1.b45d18p+4, 0x1.22e8bap+4
+0x1.b45d18p+4, 0x1.6ba2eap+4
+0x1.b45d18p+4, 0x1.b45d18p+4
+0x1.b45d18p+4, 0x1.fd1746p+4
+0x1.b45d18p+4, 0x1.22e8bap+5
+0x1.b45d18p+4, 0x1.4745d2p+5
+0x1.b45d18p+4, 0x1.6ba2eap+5
+0x1.b45d18p+4, 0x1.9p+5
+0x1.fd1746p+4, 0x0p+0
+0x1.fd1746p+4, 0x1.22e8bap+2
+0x1.fd1746p+4, 0x1.22e8bap+3
+0x1.fd1746p+4, 0x1.b45d18p+3
+0x1.fd1746p+4, 0x1.22e8bap+4
+0x1.fd1746p+4, 0x1.6ba2eap+4
+0x1.fd1746p+4, 0x1.b45d18p+4
+0x1.fd1746p+4, 0x1.fd1746p+4
+0x1.fd1746p+4, 0x1.22e8bap+5
+0x1.fd1746p+4, 0x1.4745d2p+5
+0x1.fd1746p+4, 0x1.6ba2eap+5
+0x1.fd1746p+4, 0x1.9p+5
+0x1.22e8bap+5, 0x0p+0
+0x1.22e8bap+5, 0x1.22e8bap+2
+0x1.22e8bap+5, 0x1.22e8bap+3
+0x1.22e8bap+5, 0x1.b45d18p+3
+0x1.22e8bap+5, 0x1.22e8bap+4
+0x1.22e8bap+5, 0x1.6ba2eap+4
+0x1.22e8bap+5, 0x1.b45d18p+4
+0x1.22e8bap+5, 0x1.fd1746p+4
+0x1.22e8bap+5, 0x1.22e8bap+5
+0x1.22e8bap+5, 0x1.4745d2p+5
+0x1.22e8bap+5, 0x1.6ba2eap+5
+0x1.22e8bap+5, 0x1.9p+5
+0x1.4745d2p+5, 0x0p+0
+0x1.4745d2p+5, 0x1.22e8bap+2
+0x1.4745d2p+5, 0x1.22e8bap+3
+0x1.4745d2p+5, 0x1.b45d18p+3
+0x1.4745d2p+5, 0x1.22e8bap+4
+0x1.4745d2p+5, 0x1.6ba2eap+4
+0x1.4745d2p+5, 0x1.b45d18p+4
+0x1.4745d2p+5, 0x1.fd1746p+4
+0x1.4745d2p+5, 0x1.22e8bap+5
+0x1.4745d2p+5, 0x1.4745d2p+5
+0x1.4745d2p+5, 0x1.6ba2eap+5
+0x1.4745d2p+5, 0x1.9p+5
+0x1.6ba2eap+5, 0x0p+0
+0x1.6ba2eap+5, 0x1.22e8bap+2
+0x1.6ba2eap+5, 0x1.22e8bap+3
+0x1.6ba2eap+5, 0x1.b45d18p+3
+0x1.6ba2eap+5, 0x1.22e8bap+4
+0x1.6ba2eap+5, 0x1.6ba2eap+4
+0x1.6ba2eap+5, 0x1.b45d18p+4
+0x1.6ba2eap+5, 0x1.fd1746p+4
+0x1.6ba2eap+5, 0x1.22e8bap+5
+0x1.6ba2eap+5, 0x1.4745d2p+5
+0x1.6ba2eap+5, 0x1.6ba2eap+5
+0x1.6ba2eap+5, 0x1.9p+5
+0x1.9p+5, 0x0p+0
+0x1.9p+5, 0x1.22e8bap+2
+0x1.9p+5, 0x1.22e8bap+3
+0x1.9p+5, 0x1.b45d18p+3
+0x1.9p+5, 0x1.22e8bap+4
+0x1.9p+5, 0x1.6ba2eap+4
+0x1.9p+5, 0x1.b45d18p+4
+0x1.9p+5, 0x1.fd1746p+4
+0x1.9p+5, 0x1.22e8bap+5
+0x1.9p+5, 0x1.4745d2p+5
+0x1.9p+5, 0x1.6ba2eap+5
+0x1.9p+5, 0x1.9p+5
+## name: exponent 0
+-0x1.fffffep+127, 0x0p+0
+-0x1.333332p+127, 0x0p+0
+-0x1.999998p+125, 0x0p+0
+0x1.999998p+125, 0x0p+0
+0x1.333332p+127, 0x0p+0
+0x1.fffffep+127, 0x0p+0
+## name: negative base to even exponent
+-0x1.fffffep+127, -0x1.8p+3
+-0x1.fffffep+127, -0x1.cccccep+2
+-0x1.fffffep+127, -0x1.33333p+1
+-0x1.fffffep+127, 0x1.333338p+1
+-0x1.fffffep+127, 0x1.ccccdp+2
+-0x1.fffffep+127, 0x1.8p+3
+-0x1.999998p+127, -0x1.8p+3
+-0x1.999998p+127, -0x1.cccccep+2
+-0x1.999998p+127, -0x1.33333p+1
+-0x1.999998p+127, 0x1.333338p+1
+-0x1.999998p+127, 0x1.ccccdp+2
+-0x1.999998p+127, 0x1.8p+3
+-0x1.333332p+127, -0x1.8p+3
+-0x1.333332p+127, -0x1.cccccep+2
+-0x1.333332p+127, -0x1.33333p+1
+-0x1.333332p+127, 0x1.333338p+1
+-0x1.333332p+127, 0x1.ccccdp+2
+-0x1.333332p+127, 0x1.8p+3
+-0x1.999998p+126, -0x1.8p+3
+-0x1.999998p+126, -0x1.cccccep+2
+-0x1.999998p+126, -0x1.33333p+1
+-0x1.999998p+126, 0x1.333338p+1
+-0x1.999998p+126, 0x1.ccccdp+2
+-0x1.999998p+126, 0x1.8p+3
+-0x1.999998p+125, -0x1.8p+3
+-0x1.999998p+125, -0x1.cccccep+2
+-0x1.999998p+125, -0x1.33333p+1
+-0x1.999998p+125, 0x1.333338p+1
+-0x1.999998p+125, 0x1.ccccdp+2
+-0x1.999998p+125, 0x1.8p+3
+0x0p+0, -0x1.8p+3
+0x0p+0, -0x1.cccccep+2
+0x0p+0, -0x1.33333p+1
+0x0p+0, 0x1.333338p+1
+0x0p+0, 0x1.ccccdp+2
+0x0p+0, 0x1.8p+3
+## name: negative base to odd exponent
+-0x1.fffffep+127, -0x1.6p+3
+-0x1.fffffep+127, -0x1.8cccccp+2
+-0x1.fffffep+127, -0x1.66666p+0
+-0x1.fffffep+127, 0x1.b33338p+1
+-0x1.fffffep+127, 0x1.066668p+3
+-0x1.fffffep+127, 0x1.ap+3
+-0x1.999998p+127, -0x1.6p+3
+-0x1.999998p+127, -0x1.8cccccp+2
+-0x1.999998p+127, -0x1.66666p+0
+-0x1.999998p+127, 0x1.b33338p+1
+-0x1.999998p+127, 0x1.066668p+3
+-0x1.999998p+127, 0x1.ap+3
+-0x1.333332p+127, -0x1.6p+3
+-0x1.333332p+127, -0x1.8cccccp+2
+-0x1.333332p+127, -0x1.66666p+0
+-0x1.333332p+127, 0x1.b33338p+1
+-0x1.333332p+127, 0x1.066668p+3
+-0x1.333332p+127, 0x1.ap+3
+-0x1.999998p+126, -0x1.6p+3
+-0x1.999998p+126, -0x1.8cccccp+2
+-0x1.999998p+126, -0x1.66666p+0
+-0x1.999998p+126, 0x1.b33338p+1
+-0x1.999998p+126, 0x1.066668p+3
+-0x1.999998p+126, 0x1.ap+3
+-0x1.999998p+125, -0x1.6p+3
+-0x1.999998p+125, -0x1.8cccccp+2
+-0x1.999998p+125, -0x1.66666p+0
+-0x1.999998p+125, 0x1.b33338p+1
+-0x1.999998p+125, 0x1.066668p+3
+-0x1.999998p+125, 0x1.ap+3
+0x0p+0, -0x1.6p+3
+0x0p+0, -0x1.8cccccp+2
+0x0p+0, -0x1.66666p+0
+0x0p+0, 0x1.b33338p+1
+0x0p+0, 0x1.066668p+3
+0x0p+0, 0x1.ap+3
+## name: negative base to non-integer exponent
+-0x1.fffffep+127, -0x1.7p+3
+-0x1.fffffep+127, -0x1.acccccp+2
+-0x1.fffffep+127, -0x1.e66668p+0
+-0x1.fffffep+127, 0x1.733338p+1
+-0x1.fffffep+127, 0x1.ecccccp+2
+-0x1.fffffep+127, 0x1.9p+3
+-0x1.999998p+127, -0x1.7p+3
+-0x1.999998p+127, -0x1.acccccp+2
+-0x1.999998p+127, -0x1.e66668p+0
+-0x1.999998p+127, 0x1.733338p+1
+-0x1.999998p+127, 0x1.ecccccp+2
+-0x1.999998p+127, 0x1.9p+3
+-0x1.333332p+127, -0x1.7p+3
+-0x1.333332p+127, -0x1.acccccp+2
+-0x1.333332p+127, -0x1.e66668p+0
+-0x1.333332p+127, 0x1.733338p+1
+-0x1.333332p+127, 0x1.ecccccp+2
+-0x1.333332p+127, 0x1.9p+3
+-0x1.999998p+126, -0x1.7p+3
+-0x1.999998p+126, -0x1.acccccp+2
+-0x1.999998p+126, -0x1.e66668p+0
+-0x1.999998p+126, 0x1.733338p+1
+-0x1.999998p+126, 0x1.ecccccp+2
+-0x1.999998p+126, 0x1.9p+3
+-0x1.999998p+125, -0x1.7p+3
+-0x1.999998p+125, -0x1.acccccp+2
+-0x1.999998p+125, -0x1.e66668p+0
+-0x1.999998p+125, 0x1.733338p+1
+-0x1.999998p+125, 0x1.ecccccp+2
+-0x1.999998p+125, 0x1.9p+3
+0x0p+0, -0x1.7p+3
+0x0p+0, -0x1.acccccp+2
+0x0p+0, -0x1.e66668p+0
+0x0p+0, 0x1.733338p+1
+0x0p+0, 0x1.ecccccp+2
+0x0p+0, 0x1.9p+3
+## name: exponent 1
+-0x1.fffffep+127, 0x1p+0
+-0x1.333332p+127, 0x1p+0
+-0x1.999998p+125, 0x1p+0
+0x1.999998p+125, 0x1p+0
+0x1.333332p+127, 0x1p+0
+0x1.fffffep+127, 0x1p+0
+## name: exponent -1
+-0x1.fffffep+127, -0x1p+0
+-0x1.333332p+127, -0x1p+0
+-0x1.999998p+125, -0x1p+0
+0x1.999998p+125, -0x1p+0
+0x1.333332p+127, -0x1p+0
+0x1.fffffep+127, -0x1p+0
+## name: squared
+-0x1.fffffep+127, 0x1p+1
+-0x1.333332p+127, 0x1p+1
+-0x1.999998p+125, 0x1p+1
+0x1.999998p+125, 0x1p+1
+0x1.333332p+127, 0x1p+1
+0x1.fffffep+127, 0x1p+1
+## name: squareroot
+-0x1.fffffep+127, 0x1p-1
+-0x1.333332p+127, 0x1p-1
+-0x1.999998p+125, 0x1p-1
+0x1.999998p+125, 0x1p-1
+0x1.333332p+127, 0x1p-1
+0x1.fffffep+127, 0x1p-1
+## name: 1 to negative exponent
+0x1p+0, -0x1.fffffep+127
+0x1p+0, -0x1.999998p+127
+0x1p+0, -0x1.333332p+127
+0x1p+0, -0x1.999998p+126
+0x1p+0, -0x1.999998p+125
+0x1p+0, 0x0p+0
+## name: -1 to negative exponent
+-0x1p+0, -0x1.fffffep+127
+-0x1p+0, -0x1.999998p+127
+-0x1p+0, -0x1.333332p+127
+-0x1p+0, -0x1.999998p+126
+-0x1p+0, -0x1.999998p+125
+-0x1p+0, 0x0p+0
+## name: -1 to non-integer exponent
+-0x1p+0, -0x1.7p+3
+-0x1p+0, -0x1.acccccp+2
+-0x1p+0, -0x1.e66668p+0
+-0x1p+0, 0x1.733338p+1
+-0x1p+0, 0x1.ecccccp+2
+-0x1p+0, 0x1.9p+3
+## name: -1 to odd exponent
+-0x1p+0, -0x1.6p+3
+-0x1p+0, -0x1.8cccccp+2
+-0x1p+0, -0x1.66666p+0
+-0x1p+0, 0x1.b33338p+1
+-0x1p+0, 0x1.066668p+3
+-0x1p+0, 0x1.ap+3
+## name: base 0
+0x0p+0, -0x1.fffffep+127
+0x0p+0, -0x1.333332p+127
+0x0p+0, -0x1.999998p+125
+0x0p+0, 0x1.999998p+125
+0x0p+0, 0x1.333332p+127
+0x0p+0, 0x1.fffffep+127
+## name: -1 to even exponent
+-0x1p+0, -0x1.8p+3
+-0x1p+0, -0x1.cccccep+2
+-0x1p+0, -0x1.33333p+1
+-0x1p+0, 0x1.333338p+1
+-0x1p+0, 0x1.ccccdp+2
+-0x1p+0, 0x1.8p+3
+## name: small base
+0x1.fffffp-1, -0x1.fffffep+127
+0x1.fffffp-1, -0x1.333332p+127
+0x1.fffffp-1, -0x1.999998p+125
+0x1.fffffp-1, 0x1.999998p+125
+0x1.fffffp-1, 0x1.333332p+127
+0x1.fffffp-1, 0x1.fffffep+127
+0x1.fffff8p-1, -0x1.fffffep+127
+0x1.fffff8p-1, -0x1.333332p+127
+0x1.fffff8p-1, -0x1.999998p+125
+0x1.fffff8p-1, 0x1.999998p+125
+0x1.fffff8p-1, 0x1.333332p+127
+0x1.fffff8p-1, 0x1.fffffep+127
+0x1p+0, -0x1.fffffep+127
+0x1p+0, -0x1.333332p+127
+0x1p+0, -0x1.999998p+125
+0x1p+0, 0x1.999998p+125
+0x1p+0, 0x1.333332p+127
+0x1p+0, 0x1.fffffep+127
+0x1.000004p+0, -0x1.fffffep+127
+0x1.000004p+0, -0x1.333332p+127
+0x1.000004p+0, -0x1.999998p+125
+0x1.000004p+0, 0x1.999998p+125
+0x1.000004p+0, 0x1.333332p+127
+0x1.000004p+0, 0x1.fffffep+127
+0x1.000008p+0, -0x1.fffffep+127
+0x1.000008p+0, -0x1.333332p+127
+0x1.000008p+0, -0x1.999998p+125
+0x1.000008p+0, 0x1.999998p+125
+0x1.000008p+0, 0x1.333332p+127
+0x1.000008p+0, 0x1.fffffep+127
+0x1.00001p+0, -0x1.fffffep+127
+0x1.00001p+0, -0x1.333332p+127
+0x1.00001p+0, -0x1.999998p+125
+0x1.00001p+0, 0x1.999998p+125
+0x1.00001p+0, 0x1.333332p+127
+0x1.00001p+0, 0x1.fffffep+127
+## name: small exponent
+-0x1.fffffep+127, -0x1p-32
+-0x1.fffffep+127, -0x1.333334p-33
+-0x1.fffffep+127, -0x1.99999cp-35
+-0x1.fffffep+127, 0x1.9999ap-35
+-0x1.fffffep+127, 0x1.333334p-33
+-0x1.fffffep+127, 0x1p-32
+-0x1.333332p+127, -0x1p-32
+-0x1.333332p+127, -0x1.333334p-33
+-0x1.333332p+127, -0x1.99999cp-35
+-0x1.333332p+127, 0x1.9999ap-35
+-0x1.333332p+127, 0x1.333334p-33
+-0x1.333332p+127, 0x1p-32
+-0x1.999998p+125, -0x1p-32
+-0x1.999998p+125, -0x1.333334p-33
+-0x1.999998p+125, -0x1.99999cp-35
+-0x1.999998p+125, 0x1.9999ap-35
+-0x1.999998p+125, 0x1.333334p-33
+-0x1.999998p+125, 0x1p-32
+0x1.999998p+125, -0x1p-32
+0x1.999998p+125, -0x1.333334p-33
+0x1.999998p+125, -0x1.99999cp-35
+0x1.999998p+125, 0x1.9999ap-35
+0x1.999998p+125, 0x1.333334p-33
+0x1.999998p+125, 0x1p-32
+0x1.333332p+127, -0x1p-32
+0x1.333332p+127, -0x1.333334p-33
+0x1.333332p+127, -0x1.99999cp-35
+0x1.333332p+127, 0x1.9999ap-35
+0x1.333332p+127, 0x1.333334p-33
+0x1.333332p+127, 0x1p-32
+0x1.fffffep+127, -0x1p-32
+0x1.fffffep+127, -0x1.333334p-33
+0x1.fffffep+127, -0x1.99999cp-35
+0x1.fffffep+127, 0x1.9999ap-35
+0x1.fffffep+127, 0x1.333334p-33
+0x1.fffffep+127, 0x1p-32
--
1.8.3.1
Regards,
PC
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH v2] Add powf bench tests
2017-06-12 20:19 [PATCH v2] Add powf bench tests Paul Clarke
@ 2017-06-12 20:28 ` Joseph Myers
0 siblings, 0 replies; 2+ messages in thread
From: Joseph Myers @ 2017-06-12 20:28 UTC (permalink / raw)
To: Paul Clarke; +Cc: libc-alpha
On Mon, 12 Jun 2017, Paul Clarke wrote:
> +## name: negative base to even exponent
> +-0x1.fffffep+127, -0x1.8p+3
> +-0x1.fffffep+127, -0x1.cccccep+2
> +-0x1.fffffep+127, -0x1.33333p+1
> +-0x1.fffffep+127, 0x1.333338p+1
> +-0x1.fffffep+127, 0x1.ccccdp+2
Many of these are obviously not integer exponents.
> +## name: negative base to odd exponent
> +-0x1.fffffep+127, -0x1.6p+3
> +-0x1.fffffep+127, -0x1.8cccccp+2
> +-0x1.fffffep+127, -0x1.66666p+0
> +-0x1.fffffep+127, 0x1.b33338p+1
> +-0x1.fffffep+127, 0x1.066668p+3
Likewise.
I don't actually think the cases with NaN results (and other special
cases) are particularly interesting for benchmarking; they're thoroughly
covered in the tests of correctness, but if NaN results are common enough
in your application that it's worth optimizing for that case, there's
something wrong with your application. That is, there should be a lot
more of the ordinary cases (ones where powf actually has to compute a log
and do exponentiation) in the benchmark than of the special cases.
--
Joseph S. Myers
joseph@codesourcery.com
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-06-12 20:28 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-12 20:19 [PATCH v2] Add powf bench tests Paul Clarke
2017-06-12 20:28 ` Joseph Myers
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).