Infinite recursioin while computing theta functions
Brought to you by:
alberto_ramos
While computing Jacobi theta functions, function Theta3 in specialfunc.f90 may fall into infinite recursion following IF in line 150. It occures when when amiag(tau) is close to 1. Example of listing of tau in this cycle is attached in theta-err.txt.
Possible solution is to change line 150 of specialfunc.f90 from
If (Aimag(tau) >= 1.D0 ) Then
to
If (Aimag(tau) >= 1.D0 .OR. (.NOT. Aimag((-1.D0, 0.D0)/tau)>=1.D0 ) ) Then
. It does not affects convergence of the series.
Modified specialfunc.f90 is also attached.
One more attachment