openlibm icon indicating copy to clipboard operation
openlibm copied to clipboard

accuracy of long double functions

Open zimmermann6 opened this issue 3 years ago • 8 comments

with Openlibm 0.7.5 I still see the following issues for long double functions:

  • a somewhat large maximal known error for atanhl (85.4 ulps)
  • huge error for lgammal (9.08e19 ulps)
  • huge error for tgammal (#223)
  • large error for powl (533 ulps) and powl does not work properly in multi-thread mode (#222)

For all other functions, the maximal known error is 5.67 ulps (see https://members.loria.fr/PZimmermann/papers/accuracy.pdf).

zimmermann6 avatar Aug 03 '21 08:08 zimmermann6

I think it may be time to pull new versions from msun. Are those known to work well?

ViralBShah avatar Sep 07 '21 03:09 ViralBShah

@zimmermann6 Is it possible for you to also test Julia in your comparisons? Julia increasingly does not rely on openlibm, but has native implementations. I would expect your test harness is C based, and so if Julia's libm exposed a C interface, you may be able to test Julia as well - and otherwise it would be difficult.

ViralBShah avatar Sep 12 '21 14:09 ViralBShah

if you tell me how to build a libm.a file for Julia (for x86_64 Linux) I can try

zimmermann6 avatar Sep 14 '21 12:09 zimmermann6

Thanks. I'll need to put something together and send you instructions. May take me a few days to get there.

ViralBShah avatar Sep 14 '21 13:09 ViralBShah

Thanks. I'll need to put something together and send you instructions. May take me a few days to get there.

any progress on that?

zimmermann6 avatar Jan 06 '22 15:01 zimmermann6

Sorry - I haven't had the time to work on this.

ViralBShah avatar Jan 06 '22 15:01 ViralBShah

@zimmermann6 Are there open source implementations (MIT/BSD) that you are aware of that we can pull in to improve these functions?

ViralBShah avatar Feb 26 '22 23:02 ViralBShah

yes, on https://core-math.gitlabpages.inria.fr/ you will find such implementations (under a MIT license). Currently we have all C99 single precision functions implemented (correctly rounded) except the powf function (work in progress). Other formats will follow. Performance is comparable (if not better) to the GNU libc and the Intel Math library (which are not correctly rounded).

zimmermann6 avatar Feb 27 '22 06:02 zimmermann6