diff mbox series

[07/12] benchtests: Add coshf function to bench-math

Message ID 20211029171941.4161172-8-skpgkp2@gmail.com
State New
Headers show
Series benchtests: Add float version of math functions to bench-math | expand

Commit Message

Sunil Pandey Oct. 29, 2021, 5:19 p.m. UTC
Add coshf function to bench-math and copy coshf-inputs to benchtests.
Motivation for this patch is to prepare for upcoming libmvec new
functions.  Float and double version of libmvec functions stays
together.

coshf-inputs file generated from cosh-inputs file using following
scaling formula:

f = d * (FLT_MAX/DBL_MAX)

Where d is input(double) and f is output(float).  If scaled float value
is duplicate in new input file, nextafterf() function used to find next
float value, ensuring no duplicates.
---
 benchtests/Makefile     |   1 +
 benchtests/coshf-inputs | 403 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 404 insertions(+)
 create mode 100644 benchtests/coshf-inputs

Comments

Paul Zimmermann Nov. 3, 2021, 4:43 p.m. UTC | #1
Dear Sunil,

many entries (for example 0x1.631844p+9) yield a cosh value larger than 2^128
thus an overflow, and are not very representative of real applications.

Except maybe a few values such that cosh(x) is near 2^128, it would be better
to have cosh(x) < 2^128.

Paul
diff mbox series

Patch

diff --git a/benchtests/Makefile b/benchtests/Makefile
index 75bd3bff28..31c8adc942 100644
--- a/benchtests/Makefile
+++ b/benchtests/Makefile
@@ -41,6 +41,7 @@  bench-math := \
   cos \
   cosf \
   cosh \
+  coshf \
   erf \
   erfc \
   exp \
diff --git a/benchtests/coshf-inputs b/benchtests/coshf-inputs
new file mode 100644
index 0000000000..79fb9c4d7a
--- /dev/null
+++ b/benchtests/coshf-inputs
@@ -0,0 +1,403 @@ 
+## args: float
+## ret: float
+## includes: math.h
+-0x1.630fb4p+9
+0x1.631844p+9
+-0x1.f56fa8p+5
+-0x1.631676p+9
+0x1.1946fp-121
+-0x1.62fac6p+9
+0x1.c2f1e6p-1
+0x1.38d5f6p-47
+0x1.652cb6p+6
+0x1.bab604p+4
+-0x1.d6cc66p-99
+0x1.2a4a36p-1
+0x1.7acdf4p-2
+0x1.62ea12p+9
+-0x1.ab3a92p+5
+-0x1.7581c8p+3
+0x1.633508p+9
+-0x1.562ea2p+7
+-0x1.5ad318p+2
+-0x1.a28482p+6
+-0x1.07f194p-30
+0x1.714f12p-20
+-0x1.e3b4e6p-101
+0x1.62ecb6p+9
+0x1.f5ef7p-72
+0x1.07c7d6p+2
+0x1.230e2p+5
+0x1.62edf6p+9
+0x1.633c66p+9
+-0x1.ca7406p+1
+-0x1.4517c6p-1
+-0x1.3d48p+7
+0x1.6307c4p+9
+0x1.dac294p+5
+0x1.ddc3c4p+6
+0x1.df8044p+4
+-0x1.a729d2p+8
+0x1.62e6b6p+9
+0x1.630252p+9
+-0x1.d9e292p-62
+-0x1.da7d06p-110
+0x1.632b74p+9
+-0x1.62fdf2p+9
+0x1.632854p+9
+0x1.626da4p-65
+0x1.632cc2p+9
+0x1.993206p-49
+-0x1.3a7904p-83
+-0x1.8952p-119
+-0x1.c26a38p+2
+-0x1.9fa0e4p-2
+0x1.62e638p+9
+-0x1.5a5f38p-110
+0x1.108092p-13
+0x1.6304f4p+9
+0x1.633714p+9
+0x1.62ec22p+9
+-0x1.239ff6p+6
+0x1.dec232p-2
+-0x1.6655b4p-76
+0x1.6322f2p+9
+0x1.62e676p+9
+-0x1.3bd6d2p-2
+-0x1.4d214p+8
+0x1.631684p+9
+-0x1.150952p+0
+-0x1.8c4344p-2
+-0x1.633196p+9
+0x1.af57d6p-122
+-0x1.7f4192p-2
+-0x1.887034p+3
+0x1.24aa78p+2
+-0x1.62faa8p+9
+-0x1.9a47f2p+3
+-0x1.6315b4p+9
+-0x1.141d54p+7
+0x1.23ffc4p-108
+-0x1.57b266p+2
+-0x1.1929f6p+8
+-0x1.59071p-67
+0x1.94c774p-82
+-0x1.87d64p-51
+-0x1.81cfd6p-123
+-0x1.69fadp-75
+0x1.793p+0
+-0x1.ba2396p+8
+-0x1.630574p+9
+-0x1.728176p-24
+-0x1.c69e92p+6
+-0x1.e07082p-73
+0x1.632b32p+9
+-0x1.633698p+9
+0x1.b6cf08p-15
+-0x1.633c12p+9
+-0x1.1284f2p+1
+-0x1.6c8b74p+0
+0x1.6d20f4p+7
+0x1.cc4afp+8
+-0x1.8a2a26p-57
+0x1.f02ac6p-87
+-0x1.a75422p-2
+0x1.2825d2p+6
+0x1.3c1dd4p+6
+0x1.5486c2p-109
+-0x1.6c62d6p+6
+0x1.5947c6p+1
+-0x1.d1ecfp+8
+0x1.d6c6f6p+7
+-0x1.d3c652p+0
+0x1.248074p+1
+0x1.630c72p+9
+0x1.22379p-99
+0x1.6387b4p+8
+-0x1.632dc4p+9
+-0x1.216292p-61
+0x1.0223bp-84
+0x1.4512d4p+1
+0x1.27623p+0
+-0x1.8982dp-52
+0x1.8713c2p-6
+0x1.f690a6p-3
+0x1.afe4e2p-64
+0x1.62ff74p+9
+-0x1.66b998p+3
+0x1.aa6496p-1
+-0x1.05cbb4p+7
+0x1.df98b2p+8
+-0x1.84acb4p+1
+-0x1.75d6f4p+2
+0x1.6302c4p+9
+0x1.54c5f6p+0
+-0x1.5329b4p+8
+0x1.62f1d8p+9
+0x1.5e2af8p+9
+0x1.46b0f4p-26
+0x1.6302b8p+9
+0x1.6acba2p-2
+0x1.214126p+0
+-0x1.c6abd4p+3
+0x1.62ee44p+9
+-0x1.019e02p-43
+0x1.67c174p-69
+-0x1.a61b94p-72
+0x1.632668p+9
+0x1.62fb54p+9
+-0x1.630398p+9
+-0x1.487514p+5
+-0x1.026fa6p-1
+0x1.a585d6p-61
+0x1.f9dfc2p-2
+-0x1.68c8d4p+0
+0x1.0de7bp-49
+0x1.9bceb2p-1
+-0x1.b47a68p-113
+0x1.31a646p+7
+-0x1.0baf36p-93
+0x1.5d078p+1
+0x1.eb7556p+5
+0x1.6300e4p+9
+0x1.56bd22p-88
+-0x1.62fc34p+9
+0x1.6329f4p+9
+0x1.3b63d6p+4
+0x1.86195p-1
+0x1.a37ad4p-96
+-0x1.632b62p+9
+-0x1.525944p+1
+-0x1.632336p+9
+-0x1.cbeb66p+3
+-0x1.35d974p+1
+-0x1.dd4d8p-34
+0x1.1610c4p-124
+0x1.d69ba4p+3
+-0x1.21c708p+4
+-0x1.060886p-64
+0x1.633cd2p+9
+-0x1.fb2f32p+6
+0x1.b7ed46p-2
+-0x1.23f9c6p+6
+-0x1.9629f2p-105
+-0x1.6303cp+9
+0x1.0738a2p+6
+0x1.694924p+0
+0x1.935688p+4
+0x1.631852p+9
+-0x1.915ff6p+5
+-0x1.3c0e14p+8
+0x1.21c664p-87
+0x1.63151p+9
+-0x1.8a9232p-60
+-0x1.62e932p+9
+-0x1.160a44p-1
+-0x1.504204p-40
+0x1.3db012p+5
+0x1.07fe34p+2
+0x1.e7b8c4p-103
+0x1.6e9e4p-2
+0x1.99e534p+1
+-0x1.ac4ea4p-1
+0x1.26d654p-1
+0x1.630a64p+9
+0x1.630182p+9
+0x1.62f446p+9
+-0x1.62fa74p+9
+0x1.62f6f6p+9
+-0x1.db3ff2p-26
+0x1.182092p-27
+-0x1.63351p+9
+0x1.07f566p-1
+-0x1.62f382p+9
+-0x1.de739p+7
+-0x1.f6a974p+6
+-0x1.92e538p-2
+0x1.630184p+9
+-0x1.baead8p+4
+0x1.632968p+9
+0x1.631ca2p+9
+0x1.12e5e6p+0
+0x1.5c1404p-28
+-0x1.6327e2p+9
+-0x1.8b5c64p-1
+0x1.f017e4p+3
+-0x1.320c54p+8
+0x1.323226p+1
+-0x1.9fb734p-28
+0x1.65f6b6p+2
+0x1.f608f2p-7
+-0x1.670174p-101
+0x1.62f874p+9
+-0x1.10ab76p-9
+-0x1.71aa42p+3
+0x1.aa3c54p+6
+0x1.330af2p-84
+0x1.467a94p+8
+0x1.402cap+8
+0x1.819596p+7
+0x1.e422cp-2
+-0x1.9725c2p+5
+-0x1.0a6696p+1
+0x1.da5486p-25
+-0x1.2bf936p+4
+0x1.c7b736p+5
+0x1.fbafe4p+0
+0x1.32a202p+7
+0x1.8507b4p+3
+-0x1.b04982p-40
+-0x1.34b9e2p+5
+-0x1.631608p+9
+-0x1.d96f3p-21
+0x1.64ec8p+1
+-0x1.6330bp+9
+0x1.875274p+2
+-0x1.b276e6p+8
+0x1.3fcdd8p-103
+-0x1.097746p+7
+-0x1.6319f8p+9
+-0x1.7019f6p+7
+-0x1.6317b8p+9
+0x1.903ff6p-2
+0x1.fcd756p+2
+0x1.a552c2p+4
+0x1.92c186p-43
+-0x1.c91a74p-1
+-0x1.596c62p-55
+-0x1.cc5644p-42
+-0x1.bc96e2p+0
+0x1.6337b6p+9
+-0x1.ca3844p+8
+0x1.465d82p+7
+0x1.632396p+9
+-0x1.5695b6p+6
+-0x1.f9a446p+3
+0x1.f0ad84p-46
+-0x1.ce3bf2p+8
+0x1.0b7222p+3
+0x1.2f7512p+8
+0x1.3877fp+5
+0x1.632046p+9
+0x1.62f188p+9
+0x1.6310e8p+9
+0x1.630e02p+9
+0x1.62f236p+9
+0x1.83f8e6p+6
+0x1.7e0aa4p-2
+0x1.00e732p+7
+0x1.e333e6p-1
+0x1.62f922p+9
+-0x1.1043c4p-23
+-0x1.231e52p+2
+0x1.493644p+9
+0x1.630374p+9
+0x1.6336a4p+9
+0x1.9d2f88p+5
+-0x1.633a82p+9
+-0x1.62f556p+9
+-0x1.1262a6p-41
+0x1.ee36b2p+7
+-0x1.761bp-95
+-0x1.62eff2p+9
+0x1.aeceb4p+5
+0x1.1f006p-38
+0x1.691f42p+1
+0x1.3e57e6p+3
+-0x1.d897ap+3
+-0x1.2cd5b8p-48
+0x1.dde518p+5
+-0x1.9a5ff6p+6
+0x1.434c62p-16
+-0x1.ebd044p-31
+-0x1.a7a0d2p+0
+-0x1.7cd576p+7
+-0x1.632432p+9
+-0x1.62e862p+9
+0x1.fe8924p-1
+-0x1.daa236p-35
+-0x1.a69a66p+8
+0x1.91b5b4p+3
+-0x1.0d2824p+3
+-0x1.630ef6p+9
+-0x1.2a2bb2p+6
+0x1.cfd2c4p+6
+-0x1.e6ef08p-2
+-0x1.d3e824p+8
+-0x1.79d546p-5
+-0x1.632752p+9
+-0x1.98df08p+8
+0x1.6312d4p+9
+0x1.600ef6p+4
+-0x1.62e936p+9
+0x1.d03788p+3
+-0x1.a3c9c6p-69
+0x1.9150c4p-59
+-0x1.631538p+9
+0x1.4eb504p+6
+-0x1.c27606p-108
+-0x1.f9d414p+1
+0x1.d0d368p+1
+0x1.2b2582p+6
+-0x1.8c1a42p+4
+-0x1.633754p+9
+-0x1.62f596p+9
+0x1.d63fe6p+7
+-0x1.6300b6p+9
+-0x1.630544p+9
+-0x1.2a94d8p+3
+0x1.33e954p-41
+0x1.25e338p-90
+-0x1.062776p-85
+0x1.883ee6p-31
+0x1.bb0de6p-2
+0x1.62f668p+9
+-0x1.496ec4p+5
+-0x1.9d6b08p-105
+0x1.666da6p+1
+-0x1.f7cdd2p+1
+-0x1.2cdd06p+7
+-0x1.0d6878p-96
+-0x1.cf43b2p-1
+0x1.0078e8p+6
+0x1.62ef22p+9
+0x1.b6e1c6p-53
+0x1.90eb02p-2
+0x1.ea80c2p+4
+0x1.e39284p+7
+-0x1.5fc8a8p-67
+-0x1.1de032p+9
+-0x1.b07148p+4
+0x1.62fa16p+9
+0x1.213554p+9
+-0x1.66e894p+6
+-0x1.7b67d6p+7
+-0x1.1b0058p+7
+0x1.62e9f2p+9
+0x1.d181a4p-103
+-0x1.fe14d2p-118
+-0x1.663274p-70
+0x1.d038a4p+8
+0x1.632a66p+9
+0x1.631f84p+9
+0x1.e111c6p-14
+-0x1.631ec4p+9
+0x1.6311f8p+9
+-0x1.c6d344p+5
+0x1.ad4268p+0
+-0x1.f4d3fp+7
+0x1.d35412p+7
+-0x1.8e94d2p+2
+0x1.04c9fp+2
+-0x1.b0bb58p+5
+0x1.73d4f8p+5
+0x1.bcb612p+8
+-0x1.c8239p-82
+-0x1.bed262p+3
+-0x1.62fbd8p+9
+0x1.262d58p-31
+-0x1.1ebe28p+6
+0x1.7ab2a6p+1
+0x1.57987p+2
+0x1.baaef8p-22
+-0x1.6321d8p+9