2 agd - inverse gudermannian function
8 z number (real or complex)
9 eps nonzero real, defaults to epsilon()
11 return number or infinite error value
14 Calculate the inverse gudermannian of z to a nultiple of eps with
15 errors in real and imaginary parts less in absolute value than .75 * eps,
16 or an error value if z is very close to one of the one of the branch
19 agd(z) is usually defined initially for real z with abs(z) < pi/2 by
22 agd(z) = ln(sec(z) + tan(z))
28 or as the integral from 0 to z of (1/cos(t))dt. For complex z, the
29 principal branch, approximated by gd(z, eps), has cuts along the real
30 axis outside -pi/2 < z < pi/2.
32 If z = x + i * y and abs(x) < pi/2, agd(z) is given by
34 agd(z) = atanh(sin(x)/cosh(y)) + i * atan(sinh(y)/cos(x)>
38 ; print agd(1, 1e-5), agd(1, 1e-10), agd(1, 1e-15)
39 1.22619 1.2261911709 1.226191170883517
41 ; print agd(2, 1e-5), agd(2, 1e-10)
42 1.52345-3.14159i 1.5234524436-3.1415926536i
44 ; print agd(5, 1e-5), agd(5, 1e-10), agd(5, 1e-15)
45 -1.93237 -1.9323667197 -1.932366719745925
47 ; print agd(1+2i, 1e-5), agd(1+2i, 1e-10)
48 .22751+1.42291i .2275106584+1.4229114625i
54 COMPLEX *c_agd(COMPLEX *x, NUMBER *eps)
57 gd, exp, ln, sin, sinh, etc.
59 ## Copyright (C) 1999 Landon Curt Noll
61 ## Calc is open software; you can redistribute it and/or modify it under
62 ## the terms of the version 2.1 of the GNU Lesser General Public License
63 ## as published by the Free Software Foundation.
65 ## Calc is distributed in the hope that it will be useful, but WITHOUT
66 ## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
67 ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
68 ## Public License for more details.
70 ## A copy of version 2.1 of the GNU Lesser General Public License is
71 ## distributed with calc under the filename COPYING-LGPL. You should have
72 ## received a copy with calc; if not, write to Free Software Foundation, Inc.
73 ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
75 ## @(#) $Revision: 30.1 $
76 ## @(#) $Id: agd,v 30.1 2007/03/16 11:10:42 chongo Exp $
77 ## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/agd,v $
79 ## Under source code control: 1997/09/06 20:03:34
80 ## File existed as early as: 1997
82 ## chongo <was here> /\oo/\ http://www.isthe.com/chongo/
83 ## Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/