2 gd - gudermannian function
8 z number (real or complex)
9 eps nonzero real, defaults to epsilon()
11 return number or "Log of zero or infinity" error value
14 Calculate the gudermannian of z to a nultiple of eps with errors in
15 real and imaginary parts less in absolute value than .75 * eps,
16 or return an error value if z is close to one of the branch points
17 at odd multiples of (pi/2) * i.
19 gd(z) is usually defined initially for real z by one of the formulae
21 gd(z) = 2 * atan(exp(z)) - pi/2
27 or as the integral from 0 to z of (1/cosh(t))dt. For complex z, the
28 principal branch, approximated by gd(z, eps), has the cut:
29 re(z) = 0, abs(im(z)) >= pi/2; on the cut calc takes gd(z) to be
30 the limit as z is approached from the right or left according as
33 If z = x + y*i and abs(y) < pi/2, gd(z) is given by
35 gd(z) = atan(sinh(x)/cos(y)) + i * atanh(sin(y)/cosh(x)).
38 > print gd(1, 1e-5), gd(1, 1e-10), gd(1, 1e-15)
39 .86577 .8657694832 .865769483239659
41 > print gd(2+1i, 1e-5), gd(2+1i, 1e-10)
42 1.42291+.22751i 1.4229114625+.2275106584i
48 COMPLEX *cgd(COMPLEX *x, NUMBER *eps)
51 agd, exp, ln, sin, sinh, etc.