[PATCH v2 2/2] Simplify powl computation for small integral y [BZ #33411]

Paul Zimmermann Paul.Zimmermann@inria.fr
Tue Oct 21 15:11:21 GMT 2025


       Hi Joseph,

thanks. I managed to reproduce the spurious overflow by adding the line
"pow 0x1p+8192 1.0" in math/auto-libm-test-in with (in math):

$ gcc gen-auto-libm-tests.c -lmpc -lmpfr -lgmp -o gen-auto-libm-tests
$ f=pow
$ ./gen-auto-libm-tests auto-libm-test-in $f auto-libm-test-out-$f

testing long double (without inline functions)
Failure: pow (0x1p+8192, 0x1p+0): Exception "Overflow" set
Failure: pow_downward (0x1p+8192, 0x1p+0): Exception "Overflow" set
Failure: pow_towardzero (0x1p+8192, 0x1p+0): Exception "Overflow" set
Failure: pow_upward (0x1p+8192, 0x1p+0): Exception "Overflow" set

but while doing this we also get a new failure in the binary64 pow:

testing float (without inline functions)
Failure: pow_upward (0xf.fffffp+124, 0x1p+0): Exception "Overflow" set
Failure: pow_upward (0xf.fffffp+124, 0x1p+0): errno set to 34, expected 0 (unchanged)
Failure: Test: pow_upward (0xf.fffffp+124, 0x1p+0)
Result:
 is:          inf   inf
 should be:   3.40282347e+38   0x1.fffffep+127

thus if Siddhesh uses the auto-libm-test-in way, he will have to fix also
the pow issue, unless you know how to fix it?

Paul

> Date: Tue, 21 Oct 2025 14:26:38 +0000 (UTC)
> From: Joseph Myers <josmyers@redhat.com>
> cc: Siddhesh Poyarekar <siddhesh@sourceware.org>, libc-alpha@sourceware.org
> 
> On Tue, 21 Oct 2025, Paul Zimmermann wrote:
> 
> >        Hi Joseph,
> > 
> > > > It's odd to use what's essentially a legacy test here rather than putting
> > > > the new test input into auto-libm-test-in, given that testing for spurious
> > > > overflow is fully handled in the auto-libm-test machinery without needing
> > > > special-case C code for a particular test.
> > 
> > I tried the following change on top of 87e850f and make check subdirs=math
> > passes all tests. Are you sure spurious overflow is really handled?
> 
> You also need to regenerate auto-libm-test-out-pow.  See the instructions 
> at the top of gen-auto-libm-tests.c.
> 
> -- 
> Joseph S. Myers
> josmyers@redhat.com
> 
> 


More information about the Libc-alpha mailing list