This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug math/13932] dbl-64 pow unexpectedly slow for some inputs
- From: "vincent-srcware at vinc17 dot net" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Thu, 16 Apr 2015 14:00:18 +0000
- Subject: [Bug math/13932] dbl-64 pow unexpectedly slow for some inputs
- Auto-submitted: auto-generated
- References: <bug-13932-131 at http dot sourceware dot org/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=13932
--- Comment #10 from Vincent LefÃvre <vincent-srcware at vinc17 dot net> ---
(In reply to Paul Pluzhnikov from comment #2)
> # x86_64:
> ./elf/ld.so --library-path .:math:dlfcn /tmp/test_pow64
> pow(0.562500, 1.5): 0.000990 calls/usec
> pow(0.563250, 1.5): 12.753271 calls/usec
> ratio: 12887
Note that mathematically x^1.5 = sqrt(x)^3.
Now, 0.562500 is a perfect square:
? sqrt(0.562500)
%1 = 0.75000000000000000000000000000000000000
This is probably related to the slowness. Unless the implementation tries to
provide the correct inexact flag (which I doubt), I don't see a theoretical
reason for which it would be slow in rounding to nearest. It would be very
different in a directed rounding mode since this is an exact case. Still, this
could be a corner case for an algorithm that doesn't expect exact results or
something like that.
--
You are receiving this mail because:
You are on the CC list for the bug.