mirror of https://github.com/mkerrisk/man-pages
cacos.3, cacosh.3, catan.3, catanh.3: Fix formula describing function
The man pages for cacos(), cacosh(), catan(), catanh() contain incorrect formulae describing the functions. As reported by Richard B. Kreckel: cacos, cacosf, cacosl: The formula given in the man page cacos(z) = -i clog(z + csqrt(z * z - 1)) gives wrong results in second and fourth quadrant of complex plain. The formula cacos(z) = -i clog(z + I*csqrt(1 - z * z)) gives correct results. catan, catanf, catanl: The formula given in the man page catan(z) = 1 / 2i clog((1 + iz) / (1 - iz)) gives wrong results on the negative imaginary axis beginning at -I (along one of the two branch cuts). Besides, the formula is written in an ambiguous way. The formula catan(z) = (clog(1 + iz) - clog(1 - iz)) / 2i gives correct results. cacosh, cacoshf, cacoshl: The formula given in the man page cacosh(z) = (0.5) * clog((1 + z) / (1 - z)) gives wrong results everywhere in the complex plain. (The formula seems to be copied from the one for catanh, where it is sometimes correct.) The formula cacosh(z) = 2 * clog(csqrt((z + 1)/2) + csqrt((z - 1)/2)) gives correct results. catanh, catanhf, catanhl: The formula given in the man page catanh(z) = 0.5 * clog((1 + z) / (1 - z)) gives wrong results on the positive real axis beginning at 1 (along one of the two branch cuts). The formula catanh(z) = 0.5 * (clog(1 + z) - clog(1 - z)) gives correct results. I've also checked casin, casinf, casinl, casinh, casinhf, and casinhl and the formulae given there casin(z) = -i clog(iz + csqrt(1 - z * z)) casinh(z) = clog(z + csqrt(z * z + 1)) are actually correct. Reported-by: Richard B. Kreckel <kreckel@ginac.de> Reviewed-by: Andries Brouwer <Andries.Brouwer@cwi.nl> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
parent
3d5be2aa85
commit
4c3fa19d23
|
@ -1,7 +1,7 @@
|
|||
.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de)
|
||||
.\" Distributed under GPL
|
||||
.\"
|
||||
.TH CACOS 3 2008-08-11 "" "Linux Programmer's Manual"
|
||||
.TH CACOS 3 2011-09-15 "" "Linux Programmer's Manual"
|
||||
.SH NAME
|
||||
cacos, cacosf, cacosl \- complex arc cosine
|
||||
.SH SYNOPSIS
|
||||
|
@ -27,7 +27,7 @@ is chosen in the interval [0,pi].
|
|||
One has:
|
||||
.nf
|
||||
|
||||
cacos(z) = \-i clog(z + csqrt(z * z \- 1))
|
||||
cacos(z) = \-i * clog(z + i * csqrt(1 \- z * z))
|
||||
.fi
|
||||
.SH VERSIONS
|
||||
These functions first appeared in glibc in version 2.1.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
.\" Copyright 2002 Walter Harms(walter.harms@informatik.uni-oldenburg.de)
|
||||
.\" Distributed under GPL
|
||||
.\"
|
||||
.TH CACOSH 3 2008-08-11 "" "Linux Programmer's Manual"
|
||||
.TH CACOSH 3 2011-09-15 "" "Linux Programmer's Manual"
|
||||
.SH NAME
|
||||
cacosh, cacoshf, cacoshl \- complex arc hyperbolic cosine
|
||||
.SH SYNOPSIS
|
||||
|
@ -30,7 +30,7 @@ is chosen nonnegative.
|
|||
One has:
|
||||
.nf
|
||||
|
||||
cacosh(z) = (0.5) * clog((1 + z) / (1 \- z))
|
||||
cacosh(z) = 2 * clog(csqrt((z + 1) / 2) + csqrt((z \- 1) / 2))
|
||||
.fi
|
||||
.SH VERSIONS
|
||||
These functions first appeared in glibc in version 2.1.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de)
|
||||
.\" Distributed under GPL
|
||||
.\"
|
||||
.TH CATAN 3 2008-08-11 "" "Linux Programmer's Manual"
|
||||
.TH CATAN 3 2011-09-15 "" "Linux Programmer's Manual"
|
||||
.SH NAME
|
||||
catan, catanf, catanl \- complex arc tangents
|
||||
.SH SYNOPSIS
|
||||
|
@ -25,7 +25,7 @@ The real part of y is chosen in the interval [\-pi/2,pi/2].
|
|||
One has:
|
||||
.nf
|
||||
|
||||
catan(z) = 1 / 2i clog((1 + iz) / (1 \- iz))
|
||||
catan(z) = (clog(1 + i * z) \- clog(1 \- i * z)) / (2 * i)
|
||||
.fi
|
||||
.SH VERSIONS
|
||||
These functions first appeared in glibc in version 2.1.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de)
|
||||
.\" Distributed under GPL
|
||||
.\"
|
||||
.TH CATANH 3 2008-08-11 "" "Linux Programmer's Manual"
|
||||
.TH CATANH 3 2011-09-15 "" "Linux Programmer's Manual"
|
||||
.SH NAME
|
||||
catanh, catanhf, catanhl \- complex arc tangents hyperbolic
|
||||
.SH SYNOPSIS
|
||||
|
@ -27,7 +27,7 @@ is chosen in the interval [\-pi/2,pi/2].
|
|||
One has:
|
||||
.nf
|
||||
|
||||
catanh(z) = 0.5 * clog((1 + z) / (1 \- z))
|
||||
catanh(z) = 0.5 * (clog(1 + z) \- clog(1 \- z))
|
||||
.fi
|
||||
.SH VERSIONS
|
||||
These functions first appeared in glibc in version 2.1.
|
||||
|
|
Loading…
Reference in New Issue