[Bug libfortran/49024] New: REAL*16 ERFC_SCALED inaccuracy
thenlich at users dot sourceforge.net
gcc-bugzilla@gcc.gnu.org
Tue May 17 14:28:00 GMT 2011
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49024
Summary: REAL*16 ERFC_SCALED inaccuracy
Product: gcc
Version: 4.7.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libfortran
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: thenlich@users.sourceforge.net
The libfortran implementation of the ERFC_SCALED intrinsic function is not
accurate enough to be useful for REAL*16 arithmetics.
program test_erfc_scaled
real(16), parameter :: p16 = 1.0_16
real(16) :: v16 = p16
print *, erfc_scaled(v16)
print *, erfc_scaled(p16)
print *, erfc(v16) * exp(v16 * v16)
end program test_erfc_scaled
==>
0.427583576155807003967191251980322016
0.427583576155807004410750344490515188
0.427583576155807004410750344490515140
This should be easy to fix by adding an erfc_scaled() function to libquadmath.
In fact, the error function code in libquadmath is based on the same code as
http://www.netlib.org/cephes/128bdoc.html and the latter already contains a
separate function for a scaled error function. In libquadmath it has been
merged into one (or maybe the other was split later).
More information about the Gcc-bugs
mailing list