[patch,libgfortran] Fix binary128 ERFC_SCALED

FX fxcoudert@gmail.com
Sun Nov 17 10:30:00 GMT 2013


This patch fixes libgfortran’s binary128 [aka real(kind=16)] variant of ERFC_SCALED. The original code, which I had lifted from netlib, gives only 18 significant decimal digits, which is not enough for binary128 (33 decimal digits).

I thus implemented a new variant for binary128. For arguments < 12, it simply calls erfcq() then multiplies by expq(x*x). For larger arguments, it uses a power expansion in 1/x. The new implementation provides answers within to 2 ulp of the correct value.

Regtested on x86_64-apple-darwin13, comes with a testcase. OK to commit?
FX

-------------- next part --------------
A non-text attachment was scrubbed...
Name: erfc_scaled.ChangeLog
Type: application/octet-stream
Size: 344 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20131117/4a0be33b/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: erfc_scaled.diff
Type: application/octet-stream
Size: 3174 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20131117/4a0be33b/attachment-0001.obj>


More information about the Fortran mailing list