| 1 |
! { dg-do run } |
| 2 |
! { dg-require-effective-target fortran_large_real } |
| 3 |
|
| 4 |
! Testing erf and erfc library calls on large real kinds (larger than kind=8) |
| 5 |
implicit none |
| 6 |
|
| 7 |
integer,parameter :: k = selected_real_kind (precision (0.0_8) + 1) |
| 8 |
real(8),parameter :: eps = 1e-8 |
| 9 |
|
| 10 |
real(kind=k) :: x |
| 11 |
real(8) :: y |
| 12 |
|
| 13 |
#define TEST_FUNCTION(func,val) \ |
| 14 |
x = val ;\ |
| 15 |
y = x ;\ |
| 16 |
x = func (x) ;\ |
| 17 |
y = func (y) ;\ |
| 18 |
if (abs((y - x) / y) > eps) STOP 1 |
| 19 |
|
| 20 |
TEST_FUNCTION(erf,1.45123231) |
| 21 |
TEST_FUNCTION(erfc,-0.123789) |
| 22 |
|
| 23 |
end |