1 |
694 |
jeremybenn |
! { dg-do link }
|
2 |
|
|
!
|
3 |
|
|
! PR fortran/33197
|
4 |
|
|
!
|
5 |
|
|
! Fortran complex trigonometric functions: acos, asin, atan, acosh, asinh, atanh
|
6 |
|
|
!
|
7 |
|
|
! Compile-time simplifications
|
8 |
|
|
!
|
9 |
|
|
implicit none
|
10 |
|
|
real(4), parameter :: pi = 2*acos(0.0_4)
|
11 |
|
|
real(8), parameter :: pi8 = 2*acos(0.0_8)
|
12 |
|
|
real(4), parameter :: eps = 10*epsilon(0.0_4)
|
13 |
|
|
real(8), parameter :: eps8 = 10*epsilon(0.0_8)
|
14 |
|
|
complex(4), parameter :: z0_0 = cmplx(0.0_4, 0.0_4, kind=4)
|
15 |
|
|
complex(4), parameter :: z1_1 = cmplx(1.0_4, 1.0_4, kind=4)
|
16 |
|
|
complex(8), parameter :: z80_0 = cmplx(0.0_8, 0.0_8, kind=8)
|
17 |
|
|
complex(8), parameter :: z81_1 = cmplx(1.0_8, 1.0_8, kind=8)
|
18 |
|
|
|
19 |
|
|
if (abs(acos(z0_0) - cmplx(pi/2,-0.0,4)) > eps) call link_error()
|
20 |
|
|
if (abs(acos(z1_1) - cmplx(0.904556894, -1.06127506,4)) > eps) call link_error()
|
21 |
|
|
if (abs(acos(z80_0) - cmplx(pi8/2,-0.0_8,8)) > eps8) call link_error()
|
22 |
|
|
if (abs(acos(z81_1) - cmplx(0.90455689430238140_8, -1.0612750619050357_8,8)) > eps8) call link_error()
|
23 |
|
|
|
24 |
|
|
if (abs(asin(z0_0) - cmplx(0.0,0.0,4)) > eps) call link_error()
|
25 |
|
|
if (abs(asin(z1_1) - cmplx(0.66623943, 1.06127506,4)) > eps) call link_error()
|
26 |
|
|
if (abs(asin(z80_0) - cmplx(0.0_8,0.0_8,8)) > eps8) call link_error()
|
27 |
|
|
if (abs(asin(z81_1) - cmplx(0.66623943249251527_8, 1.0612750619050357_8,8)) > eps8) call link_error()
|
28 |
|
|
|
29 |
|
|
if (abs(atan(z0_0) - cmplx(0.0,0.0,4)) > eps) call link_error()
|
30 |
|
|
if (abs(atan(z1_1) - cmplx(1.01722196, 0.40235947,4)) > eps) call link_error()
|
31 |
|
|
if (abs(atan(z80_0) - cmplx(0.0_8,0.0_8,8)) > eps8) call link_error()
|
32 |
|
|
if (abs(atan(z81_1) - cmplx(1.0172219678978514_8, 0.40235947810852507_8,8)) > eps8) call link_error()
|
33 |
|
|
|
34 |
|
|
if (abs(acosh(z0_0) - cmplx(0.0,pi/2,4)) > eps) call link_error()
|
35 |
|
|
if (abs(acosh(z1_1) - cmplx(1.06127506, 0.90455689,4)) > eps) call link_error()
|
36 |
|
|
if (abs(acosh(z80_0) - cmplx(0.0_8,pi8/2,8)) > eps8) call link_error()
|
37 |
|
|
if (abs(acosh(z81_1) - cmplx(1.0612750619050357_8, 0.90455689430238140_8,8)) > eps8) call link_error()
|
38 |
|
|
|
39 |
|
|
if (abs(asinh(z0_0) - cmplx(0.0,0.0,4)) > eps) call link_error()
|
40 |
|
|
if (abs(asinh(z1_1) - cmplx(1.06127506, 0.66623943,4)) > eps) call link_error()
|
41 |
|
|
if (abs(asinh(z80_0) - cmplx(0.0_8,0.0_8,8)) > eps8) call link_error()
|
42 |
|
|
if (abs(asinh(z81_1) - cmplx(1.0612750619050357_8, 0.66623943249251527_8,8)) > eps8) call link_error()
|
43 |
|
|
|
44 |
|
|
if (abs(atanh(z0_0) - cmplx(0.0,0.0,4)) > eps) call link_error()
|
45 |
|
|
if (abs(atanh(z1_1) - cmplx(0.40235947, 1.01722196,4)) > eps) call link_error()
|
46 |
|
|
if (abs(atanh(z80_0) - cmplx(0.0_8,0.0_8,8)) > eps8) call link_error()
|
47 |
|
|
if (abs(atanh(z81_1) - cmplx(0.40235947810852507_8, 1.0172219678978514_8,8)) > eps8) call link_error()
|
48 |
|
|
|
49 |
|
|
end
|