Commit Graph

16 Commits

Author SHA1 Message Date
Michael Kerrisk 8fa05874cc cacos.3: Add example program
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2011-09-16 07:00:49 +02:00
Michael Kerrisk 4c3fa19d23 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>
2011-09-16 07:00:49 +02:00
Michael Kerrisk f0d7ce1d71 Added VERSIONS section pointing out that these functions first appeared
in glibc in version 2.1.
2008-08-11 17:13:47 +00:00
Michael Kerrisk 44a2c3286c Even when the CONFORMING TO section is just a list of standards,
they should be terminated by a period.
2008-07-15 13:39:17 +00:00
Michael Kerrisk daac0b393a Various reformattings 2007-12-24 11:27:43 +00:00
Michael Kerrisk d80882c7e0 Added section number to page xref. 2007-11-16 06:41:19 +00:00
Michael Kerrisk 20c58d7028 ffix 2007-07-21 05:25:03 +00:00
Michael Kerrisk e9329f6ddc Where there is an instruction in the SYNOPIS about linking
or compiling with a certain option, the option is now
marked up in itlacs (e.g., "\fI-lm\fP").
2007-05-21 09:56:00 +00:00
Michael Kerrisk 0ed55ece49 Make "manual" in .TH line "Linux Programmers Manual" 2007-05-18 08:43:42 +00:00
Michael Kerrisk f262c00464 hyphen --> minus 2007-05-01 08:15:41 +00:00
Michael Kerrisk c13182efa3 Wrapped long lines, wrapped at sentence boundaries; stripped trailing
white space.
2007-04-12 22:42:49 +00:00
Michael Kerrisk a8bda63671 complex.5 --> complex.7 2006-04-21 01:24:06 +00:00
Michael Kerrisk b5cc2ffbaa Formatting fixes 2005-10-19 14:48:35 +00:00
Michael Kerrisk 4d9b698450 Hyphenation/dash fixes 2005-07-06 07:41:37 +00:00
Michael Kerrisk d39541ec41 Compressed synopsis as per Fabian Kreutz's suggestion 2004-11-11 17:28:42 +00:00
Michael Kerrisk fea681dafb Import of man-pages 1.70 2004-11-03 13:51:07 +00:00