This is the mail archive of the
`libc-alpha@sourceware.org`
mailing list for the glibc project.

# RFC: What inputs to use for sqrt perf testing

*From*: "Steve Ellcey " <sellcey at mips dot com>
*To*: <libc-alpha at sourceware dot org>
*Date*: Thu, 3 Oct 2013 14:25:08 -0700
*Subject*: RFC: What inputs to use for sqrt perf testing
*Authentication-results*: sourceware.org; auth=none

While making a sqrt performance improvement for MIPS I noticed that there
was no sqrt performance test in the 'make bench' tests and Joseph suggested
that we should have one. It looks like adding it is trivial (see patch),
but the real question is what input to use. I just threw in 1.9 and 10000.0
to test this patch, but I don't think those are necessarily good choices.
Are there any math experts out there could suggest a better selection of
inputs for sqrt to use in the performance tests?
Here is my strawman patch, I don't expect this to get checked in as it
is, I am just including it for reference purposes.
Steve Ellcey
sellcey@mips.com
2013-10-03 Steve Ellcey <sellcey@mips.com>
* benchtests/Makefile (bench): Add sqrt.
(sqrt-ARGLIST): New.
(sqrt-RET): New.
(LDLIBS-bench-sqrt): New.
* benchtests/sqrt-input: New.
diff --git a/benchtests/Makefile b/benchtests/Makefile
index 4f4bd54..bc36374 100644
--- a/benchtests/Makefile
+++ b/benchtests/Makefile
@@ -21,7 +21,7 @@
subdir := benchtests
bench := acos acosh asin asinh atan atanh cos cosh exp log modf pow rint sin \
- sincos sinh tan tanh
+ sincos sinh tan tanh sqrt
# String function benchmarks.
string-bench := bcopy bzero memccpy memchr memcmp memcpy memmem memmove \
@@ -90,6 +90,10 @@ sinh-ARGLIST = double
sinh-RET = double
LDLIBS-bench-sinh = -lm
+sqrt-ARGLIST = double
+sqrt-RET = double
+LDLIBS-bench-sqrt = -lm
+
tan-ARGLIST = double
tan-RET = double
LDLIBS-bench-tan = -lm
diff --git a/benchtests/sqrt-inputs b/benchtests/sqrt-inputs
index e69de29..5ee9960 100644
--- a/benchtests/sqrt-inputs
+++ b/benchtests/sqrt-inputs
@@ -0,0 +1,2 @@
+1.9
+10000.0