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 *c_gd(COMPLEX *x, NUMBER *eps)
51 agd, exp, ln, sin, sinh, etc.
53 ## Copyright (C) 1999 Landon Curt Noll
55 ## Calc is open software; you can redistribute it and/or modify it under
56 ## the terms of the version 2.1 of the GNU Lesser General Public License
57 ## as published by the Free Software Foundation.
59 ## Calc is distributed in the hope that it will be useful, but WITHOUT
60 ## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
61 ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
62 ## Public License for more details.
64 ## A copy of version 2.1 of the GNU Lesser General Public License is
65 ## distributed with calc under the filename COPYING-LGPL. You should have
66 ## received a copy with calc; if not, write to Free Software Foundation, Inc.
67 ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
69 ## @(#) $Revision: 30.1 $
70 ## @(#) $Id: gd,v 30.1 2007/03/16 11:10:42 chongo Exp $
71 ## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/gd,v $
73 ## Under source code control: 1997/09/06 20:03:35
74 ## File existed as early as: 1997
76 ## chongo <was here> /\oo/\ http://www.isthe.com/chongo/
77 ## Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/