JuliaMath / openlibm

High quality system independent, portable, open source libm implementation
https://openlibm.org
Other
501 stars 138 forks source link

Integrate CORE-MATH implementations into openlibm #260

Open ViralBShah opened 2 years ago

ViralBShah commented 2 years ago

Discussed in: https://github.com/JuliaMath/openlibm/issues/212#issuecomment-1077587522

CORE-MATH: https://gitlab.inria.fr/core-math/core-math Comparison with OpenLibm: https://sympa.inria.fr/sympa/arc/core-math/2022-03/msg00011.html

zimmermann6 commented 1 year ago

The following reference might be relevant : https://hal.inria.fr/hal-03721525. The CORE-MATH developers are ready to help with any issue found during this integration.

ViralBShah commented 1 year ago

Does CORE-MATH provide a testsuite? My concern is that this requires a fair bit of surgery (since CORE-MATH is not a full libm replacement) and needs incorporation. A complete libm testsuite would give a lot more confidence.

The other major thing is that we need someone to lead this effort as well with contributions. I haven't got my mind around how to get this done.

JeffreySarnoff commented 1 year ago

lean on me

zimmermann6 commented 1 year ago

yes CORE-MATH provides a testsuite. For each function, say cbrt, you can do ./check.sh cbrt which will check all worst cases for all four rounding modes. For a few functions, you can also do ./check.sh --special cbrt, which will check special cases (for cbrt exact and midpoint cases).

zimmermann6 commented 1 year ago
   Hi Viral,

yes CORE-MATH does provide a testsuite.

For univariate single precision functions, all possible inputs (about 2^32) are checked for correct rounding against MPFR, for all 4 rounding modes:

$ ./check.sh --exhaustive exp10f Running exhaustive check in --rndn mode... ...

For larger precision or bivariate functions, some tests are done for hard-to-round cases, still against MPFR and for all 4 rounding modes:

$ ./check.sh exp Running worst cases check in --rndn mode... 68059 tests passed, 0 failure(s) Running worst cases check in --rndz mode... 68059 tests passed, 0 failure(s) Running worst cases check in --rndu mode... 68059 tests passed, 0 failure(s) Running worst cases check in --rndd mode... 68059 tests passed, 0 failure(s)

Best regards, Paul

Date: Fri, 02 Sep 2022 05:58:38 -0700 From: "Viral B. Shah" @.> Cc: zimmermann6 @.>, Comment @.***>

[1:text/plain Show]

[2:text/html Hide Save:noname (2kB)]

Does CORE-MATH provide a testsuite? My concern is that this requires a fair bit of surgery (since CORE-MATH is not a full libm replacement) and needs incorporation. A complete libm testsuite would give a lot more confidence.

The other major thing is that we need someone to lead this effort as well with contributions. I haven't got my mind around how to get this done.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.

ViralBShah commented 1 year ago

I would love to see this happen, but the core-math codebase is not something I am able to easily build or understand for integrating (in the little time I spent looking at it). Would be great if someone more familiar wants to start off with a couple of functions and see how this goes.