public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libfortran/49024] New: REAL*16 ERFC_SCALED inaccuracy
@ 2011-05-17 14:28 thenlich at users dot sourceforge.net
  2011-05-23 11:01 ` [Bug libfortran/49024] " fxcoudert at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: thenlich at users dot sourceforge.net @ 2011-05-17 14:28 UTC (permalink / raw)
  To: gcc-bugs

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).


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2013-11-21  9:21 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-17 14:28 [Bug libfortran/49024] New: REAL*16 ERFC_SCALED inaccuracy thenlich at users dot sourceforge.net
2011-05-23 11:01 ` [Bug libfortran/49024] " fxcoudert at gcc dot gnu.org
2011-05-23 20:54 ` fxcoudert at gcc dot gnu.org
2011-05-23 21:45 ` burnus at gcc dot gnu.org
2011-05-23 22:12 ` fxcoudert at gcc dot gnu.org
2013-11-20 22:19 ` fxcoudert at gcc dot gnu.org
2013-11-21  8:46 ` fxcoudert at gcc dot gnu.org
2013-11-21  8:46 ` fxcoudert at gcc dot gnu.org
2013-11-21  9:21 ` schwab@linux-m68k.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).