Fix bug in catand (complex arc tangent)

Function catand returned an incorrect value for its real part. To be
possibly replaced with the intrinsic function atan.
This commit is contained in:
FIGINI LORENZO 2022-10-04 19:05:43 +02:00
parent 8c3e246f25
commit 3eab989d7b

View File

@ -74,7 +74,7 @@ contains
print*,'catand, answer lt half precision, z**2 close to -1' print*,'catand, answer lt half precision, z**2 close to -1'
! !
end if end if
xans = 0.5_wp_*atan2(2.0_wp_*x, one) xans = 0.5_wp_*atan2(2.0_wp_*x, one-r2)
yans = 0.25_wp_*log((r2+2.0_wp_*y+one)/(r2-2.0_wp_*y+one)) yans = 0.25_wp_*log((r2+2.0_wp_*y+one)/(r2-2.0_wp_*y+one))
catand = cmplx(xans, yans, wp_) catand = cmplx(xans, yans, wp_)
! !