<div dir="ltr">A message from Paul Zimmermann about the CORE-MATH project to LLVM-libc developers.<br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">---------- Forwarded message ---------<br>From: <strong class="gmail_sendername" dir="auto">Paul Zimmermann</strong> <span dir="auto"><<a href="mailto:Paul.Zimmermann@inria.fr">Paul.Zimmermann@inria.fr</a>></span><br>Date: Mon, Jan 3, 2022 at 9:35 AM<br>Subject: correctly rounded mathematical functions<br>To: <<a href="mailto:lntue@google.com">lntue@google.com</a>><br>Cc: <<a href="mailto:sibid@uvic.ca">sibid@uvic.ca</a>>, <<a href="mailto:christoph.lauter@christoph-lauter.org">christoph.lauter@christoph-lauter.org</a>>, <<a href="mailto:Jean-Michel.Muller@ens-lyon.fr">Jean-Michel.Muller@ens-lyon.fr</a>><br></div><br><br> Dear Tue,<br>
<br>
you are already aware of the CORE-MATH project, but please forward to anyone<br>
interested within LLVM.<br>
<br>
Best regards,<br>
Paul<br>
<br>
PS: new functions sinf and cosf are available on the CORE-MATH page,<br>
tanf will soon follow.<br>
<br>
##############################################################################<br>
<br>
Dear llvm-libc developers,<br>
<br>
the current C working draft [1, p392] has reserved names for correctly<br>
rounded functions (cr_exp, cr_log, cr_sin, ...).<br>
<br>
We propose to provide such correctly rounded implementations<br>
for the three IEEE formats (binary32, binary64, binary128) and the<br>
"extended double" format (long double on x86_64).<br>
<br>
These implementations will be correctly rounded for all rounding modes,<br>
for example one could do the following to emulate interval arithmetic:<br>
<br>
fesetround (FE_DOWNWARD);<br>
y_lo = cr_exp (x_lo);<br>
fesetround (FE_UPWARD);<br>
y_hi = cr_exp (x_hi);<br>
<br>
Users who want a fast implementation will call the exp/log/sin/... functions,<br>
users who want a correctly rounded function and thus reproducible results<br>
(whatever the hardware, compiler or operating system) will use the<br>
cr_exp/cr_log/cr_sin/... functions. Our goal is nevertheless to get the<br>
best performance possible.<br>
<br>
Our objective is to provide open-source implementations that can be integrated<br>
in the major mathematical libraries (GNU libc, Intel Math Library, AMD Libm,<br>
Redhat Newlib, OpenLibm, Musl, llvm-libc, CUDA, ROCm).<br>
<br>
Are developers of llvm-libc interested by such functions?<br>
If so, we could discuss what would be the requirements for integration in<br>
llvm-libc in terms of license, table size, allowed operations.<br>
<br>
We have started to work on two functions (cbrt and acos), for which we<br>
provide presumably correctly rounded implementations (up to the knowledge<br>
of hard-to-round cases) [2].<br>
<br>
Christoph Lauter<br>
Jean-Michel Muller<br>
Alexei Sibidanov<br>
Paul Zimmermann<br>
<br>
[1] <a href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2596.pdf" rel="noreferrer" target="_blank">http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2596.pdf</a><br>
[2] <a href="https://homepages.loria.fr/PZimmermann/CORE-MATH/" rel="noreferrer" target="_blank">https://homepages.loria.fr/PZimmermann/CORE-MATH/</a><br>
</div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><br><table cellspacing="0" cellpadding="0" style="font-family:"Times New Roman""><tbody><tr style="color:rgb(85,85,85);font-family:sans-serif"><td nowrap style="border-top:2px solid rgb(213,15,37)">Tue Ly |</td><td nowrap style="border-top:2px solid rgb(51,105,232)"> Software Engineer |</td><td nowrap style="border-top:2px solid rgb(0,153,57)"> <a href="mailto:lntue@google.com" target="_blank">lntue@google.com</a> |</td><td nowrap style="border-top:2px solid rgb(238,178,17)"> +16176850921</td></tr></tbody></table><span style="color:rgb(0,0,0);font-family:"Times New Roman";font-size:medium"> </span><br></div></div></div>