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
erfc_scaled.ChangeLog
Description: Binary data
erfc_scaled.diff
Description: Binary data