diff options
author | Francois-Xavier Coudert <fxcoudert@gcc.gnu.org> | 2013-11-20 22:18:55 +0000 |
---|---|---|
committer | François-Xavier Coudert <fxcoudert@gcc.gnu.org> | 2013-11-20 22:18:55 +0000 |
commit | 41fd66597107279af9794ef7570c0fcca80e8348 (patch) | |
tree | 9e450558efefb68f1ce323672b0891b1418ada2e /gcc | |
parent | 27b097f8d7c060abbbc76596725d96a069fca575 (diff) | |
download | gcc-41fd66597107279af9794ef7570c0fcca80e8348.zip gcc-41fd66597107279af9794ef7570c0fcca80e8348.tar.gz gcc-41fd66597107279af9794ef7570c0fcca80e8348.tar.bz2 |
re PR libfortran/49024 (REAL*16 ERFC_SCALED inaccuracy)
PR libfortran/49024
* intrinsics/erfc_scaled.c (erfc_scaled_r16): New function.
* intrinsics/erfc_scaled_inc.c: Do not provide quadruple
precision variant.
* gfortran.dg/erf_3.F90: New file.
From-SVN: r205151
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/erf_3.F90 | 44 |
2 files changed, 49 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index d47ec92..694fb83 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2013-11-20 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org> + + PR libfortran/49024 + * gfortran.dg/erf_3.F90: New file. + 2013-11-20 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.target/powerpc/pr48258-1.c: Skip for little endian. diff --git a/gcc/testsuite/gfortran.dg/erf_3.F90 b/gcc/testsuite/gfortran.dg/erf_3.F90 new file mode 100644 index 0000000..fcff41f --- /dev/null +++ b/gcc/testsuite/gfortran.dg/erf_3.F90 @@ -0,0 +1,44 @@ +! { dg-do run } +! { dg-options "-fno-range-check -ffree-line-length-none -O0" } +! { dg-add-options ieee } +! +! Check that simplification functions and runtime library agree on ERF, +! ERFC and ERFC_SCALED, for quadruple-precision. + +program test + implicit none + + real(kind=16) :: x16 + +#define CHECK(a) \ + x16 = a ; \ + call check(erf(real(a,kind=16)), erf(x16)) ; \ + call check(erfc(real(a,kind=16)), erfc(x16)) ; \ + call check(erfc_scaled(real(a,kind=16)), erfc_scaled(x16)) + + CHECK(0.0) + CHECK(0.9) + CHECK(1.9) + CHECK(10.) + CHECK(11.) + CHECK(12.) + CHECK(13.) + CHECK(14.) + CHECK(49.) + CHECK(190.) + + CHECK(-0.0) + CHECK(-0.9) + CHECK(-1.9) + CHECK(-19.) + CHECK(-190.) + +contains + + subroutine check (a, b) + real(kind=16), intent(in) :: a, b + print *, abs(a-b) / spacing(a) + if (abs(a - b) > 10 * spacing(a)) call abort + end subroutine + +end program test |