Page MenuHomeFreeBSD

Fix powf().
ClosedPublic

Authored by markm on Sep 6 2021, 5:34 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Mar 7, 6:17 PM
Unknown Object (File)
Feb 16 2024, 2:57 PM
Unknown Object (File)
Feb 16 2024, 1:56 PM
Unknown Object (File)
Jan 30 2024, 11:02 PM
Unknown Object (File)
Jan 22 2024, 4:42 AM
Unknown Object (File)
Jan 14 2024, 5:13 PM
Unknown Object (File)
Dec 20 2023, 2:48 AM
Unknown Object (File)
Dec 7 2023, 11:10 PM

Details

Summary

From Steve Kargl:

Paul Zimmermann has identified a bug in Openlibm's powf(),
which is identical to FreeBSD's libm. Both derived from
fdlibm. https://github.com/JuliaMath/openlibm/issues/212.

Consider

% cat h.c

int
main(void)
{
  float x, y, z;
  x =  0x1.ffffecp-1F;
  y = -0x1.000002p+27F;
  z =  0x1.557a86p115F;
  printf("%e %e %e <-- should be %e\n", x, y, powf(x,y), z);
  return 0;
}

% cc -o h -fno-builtin h.c -lm && ./h

9.999994e-01 -1.342177e+08 inf <-- should be 5.540807e+34

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 41411
Build 38300: arc lint + arc unit

Event Timeline

markm requested review of this revision.Sep 6 2021, 5:34 PM

Clean off file added in error.

This revision is now accepted and ready to land.Sep 6 2021, 5:43 PM

It might be nice if there were a test added to our test suite, if we have one for libm...

This revision was automatically updated to reflect the committed changes.

I agree, it would be very nice to add the values from the commit message to a test in lib/msun/tests. There's isn't a pow test yet, but one of the others could be used as a copy-paste starting point.