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: unassig...@gcc.gnu.org ReportedBy: thenl...@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).