From 3eab989d7b1904b9b58f8ec1feee4f9b28b8f4fb Mon Sep 17 00:00:00 2001 From: FIGINI LORENZO Date: Tue, 4 Oct 2022 19:05:43 +0200 Subject: [PATCH] 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. --- src/math.f90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/math.f90 b/src/math.f90 index a1bc01a..4075194 100644 --- a/src/math.f90 +++ b/src/math.f90 @@ -74,7 +74,7 @@ contains print*,'catand, answer lt half precision, z**2 close to -1' ! 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)) catand = cmplx(xans, yans, wp_) !