summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Johnston <jjohnstn@redhat.com>2010-10-18 22:40:24 +0000
committerJeff Johnston <jjohnstn@redhat.com>2010-10-18 22:40:24 +0000
commitbf5300eaee04b5e143dea58e922bc6ae260197dd (patch)
tree2d9aa73897ac0abb39e90a468babdf937e2ba513
parentcf9e79ca7a5adbc3d6d868ce2334ddd518cda418 (diff)
downloadcygnal-bf5300eaee04b5e143dea58e922bc6ae260197dd.tar.gz
cygnal-bf5300eaee04b5e143dea58e922bc6ae260197dd.tar.bz2
cygnal-bf5300eaee04b5e143dea58e922bc6ae260197dd.zip
2010-10-18 Marco Atzeri <marco_atzeri@yahoo.it>
* libm/Makefile.am: added complex functions documentation * libm/libm.texinfo: ditto * libm/complex/Makefile.am: Ditto * libm/complex/complex.tex: Ditto * libm/complex/(cabs.c, cacos.c, cacosh.c, carg.c, casin.c, casinh.c, catan.c, catanh.c, ccos.c, ccosh.c, cexp.c, cimag.c, clog.c, conj.c, cpow.c, cproj.c, creal.c, csin.c, csinh.c, csqrt.c, ctan.c, ctanh.c): Ditto * libm/Makefile.in: Regenerate * libm/complex/Makefile.in: Ditto
-rw-r--r--newlib/ChangeLog13
-rw-r--r--newlib/libm/Makefile.am4
-rw-r--r--newlib/libm/Makefile.in4
-rw-r--r--newlib/libm/complex/Makefile.am7
-rw-r--r--newlib/libm/complex/Makefile.in7
-rw-r--r--newlib/libm/complex/cabs.c34
-rw-r--r--newlib/libm/complex/cacos.c42
-rw-r--r--newlib/libm/complex/cacosh.c45
-rw-r--r--newlib/libm/complex/carg.c40
-rw-r--r--newlib/libm/complex/casin.c43
-rw-r--r--newlib/libm/complex/casinh.c53
-rw-r--r--newlib/libm/complex/catan.c51
-rw-r--r--newlib/libm/complex/catanh.c46
-rw-r--r--newlib/libm/complex/ccos.c33
-rw-r--r--newlib/libm/complex/ccosh.c33
-rw-r--r--newlib/libm/complex/cexp.c33
-rw-r--r--newlib/libm/complex/cimag.c33
-rw-r--r--newlib/libm/complex/clog.c42
-rw-r--r--newlib/libm/complex/complex.tex56
-rw-r--r--newlib/libm/complex/conj.c33
-rw-r--r--newlib/libm/complex/cpow.c42
-rw-r--r--newlib/libm/complex/cproj.c39
-rw-r--r--newlib/libm/complex/creal.c33
-rw-r--r--newlib/libm/complex/csin.c33
-rw-r--r--newlib/libm/complex/csinh.c32
-rw-r--r--newlib/libm/complex/csqrt.c35
-rw-r--r--newlib/libm/complex/ctan.c33
-rw-r--r--newlib/libm/complex/ctanh.c33
-rw-r--r--newlib/libm/libm.texinfo1
29 files changed, 928 insertions, 5 deletions
diff --git a/newlib/ChangeLog b/newlib/ChangeLog
index 990a12f8f..839c41572 100644
--- a/newlib/ChangeLog
+++ b/newlib/ChangeLog
@@ -1,3 +1,16 @@
+2010-10-18 Marco Atzeri <marco_atzeri@yahoo.it>
+
+ * libm/Makefile.am: added complex functions documentation
+ * libm/libm.texinfo: ditto
+ * libm/complex/Makefile.am: Ditto
+ * libm/complex/complex.tex: Ditto
+ * libm/complex/(cabs.c, cacos.c, cacosh.c, carg.c,
+ casin.c, casinh.c, catan.c, catanh.c, ccos.c, ccosh.c,
+ cexp.c, cimag.c, clog.c, conj.c, cpow.c, cproj.c, creal.c,
+ csin.c, csinh.c, csqrt.c, ctan.c, ctanh.c): Ditto
+ * libm/Makefile.in: Regenerate
+ * libm/complex/Makefile.in: Ditto
+
2010-10-14 Craig Howland <howland@LGSInnovations.com>
* libc/include/math.h: Delete cabs() and cabs() prototypes
diff --git a/newlib/libm/Makefile.am b/newlib/libm/Makefile.am
index 55202552b..bc458165f 100644
--- a/newlib/libm/Makefile.am
+++ b/newlib/libm/Makefile.am
@@ -39,7 +39,7 @@ info_TEXINFOS = libm.texinfo
libm_TEXINFOS = targetdep.tex
-libm.dvi: targetdep.tex math/stmp-def
+libm.dvi: targetdep.tex math/stmp-def complex/stmp-def
stmp-targetdep: force
rm -f tmp.texi
@@ -56,6 +56,8 @@ targetdep.tex: stmp-targetdep ; @true
math/stmp-def: stmp-targetdep ; @true
+complex/stmp-def: stmp-targetdep ; @true
+
.PHONY: force
force:
diff --git a/newlib/libm/Makefile.in b/newlib/libm/Makefile.in
index d044a74ab..b67d308f3 100644
--- a/newlib/libm/Makefile.in
+++ b/newlib/libm/Makefile.in
@@ -861,7 +861,7 @@ uninstall-am: uninstall-dvi-am uninstall-html-am uninstall-info-am \
$(SUBLIBS):
-libm.dvi: targetdep.tex math/stmp-def
+libm.dvi: targetdep.tex math/stmp-def complex/stmp-def
stmp-targetdep: force
rm -f tmp.texi
@@ -878,6 +878,8 @@ targetdep.tex: stmp-targetdep ; @true
math/stmp-def: stmp-targetdep ; @true
+complex/stmp-def: stmp-targetdep ; @true
+
.PHONY: force
force:
diff --git a/newlib/libm/complex/Makefile.am b/newlib/libm/complex/Makefile.am
index 569a0a130..dbbe759be 100644
--- a/newlib/libm/complex/Makefile.am
+++ b/newlib/libm/complex/Makefile.am
@@ -32,7 +32,12 @@ endif # USE_LIBTOOL
include $(srcdir)/../../Makefile.shared
-chobj =
+chobj = cabs.def cacos.def cacosh.def carg.def \
+ casin.def casinh.def catan.def catanh.def \
+ ccos.def ccosh.def cexp.def cimag.def clog.def \
+ conj.def cpow.def cproj.def creal.def \
+ csin.def csinh.def csqrt.def ctan.def ctanh.def
+
SUFFIXES = .def
diff --git a/newlib/libm/complex/Makefile.in b/newlib/libm/complex/Makefile.in
index fe7ad1908..36828d017 100644
--- a/newlib/libm/complex/Makefile.in
+++ b/newlib/libm/complex/Makefile.in
@@ -264,7 +264,12 @@ libcomplex_la_LDFLAGS = -Xcompiler -nostdlib
@USE_LIBTOOL_FALSE@noinst_LIBRARIES = lib.a
@USE_LIBTOOL_FALSE@lib_a_SOURCES = $(src) $(fsrc)
@USE_LIBTOOL_FALSE@lib_a_CFLAGS = $(AM_CFLAGS)
-chobj =
+chobj = cabs.def cacos.def cacosh.def carg.def \
+ casin.def casinh.def catan.def catanh.def \
+ ccos.def ccosh.def cexp.def cimag.def clog.def \
+ conj.def cpow.def cproj.def creal.def \
+ csin.def csinh.def csqrt.def ctan.def ctanh.def
+
SUFFIXES = .def
CHEW = ../../doc/makedoc -f $(srcdir)/../../doc/doc.str
TARGETDOC = ../tmp.texi
diff --git a/newlib/libm/complex/cabs.c b/newlib/libm/complex/cabs.c
index eb6366935..2750fab9a 100644
--- a/newlib/libm/complex/cabs.c
+++ b/newlib/libm/complex/cabs.c
@@ -8,6 +8,40 @@
* Marco Atzeri <marco_atzeri@yahoo.it>
*/
+/*
+FUNCTION
+ <<cabs>>, <<cabsf>>---complex absolute-value
+
+INDEX
+ cabs
+INDEX
+ cabsf
+
+ANSI_SYNOPSIS
+ #include <complex.h>
+ double cabs(double complex <[z]>);
+ float cabsf(float complex <[z]>);
+
+
+DESCRIPTION
+ These functions compute compute the complex absolute value
+ (also called norm, modulus, or magnitude) of <[z]>.
+
+ <<cabsf>> is identical to <<cabs>>, except that it performs
+ its calculations on <<floats complex>>.
+
+RETURNS
+ The cabs functions return the complex absolute value.
+
+PORTABILITY
+ <<cabs>> and <<cabsf>> are ISO C99
+
+QUICKREF
+ <<cabs>> and <<cabsf>> are ISO C99
+
+*/
+
+
#include <complex.h>
#include <math.h>
diff --git a/newlib/libm/complex/cacos.c b/newlib/libm/complex/cacos.c
index 744b4ad8f..d871617e3 100644
--- a/newlib/libm/complex/cacos.c
+++ b/newlib/libm/complex/cacos.c
@@ -32,6 +32,48 @@
* Marco Atzeri <marco_atzeri@yahoo.it>
*/
+/*
+FUNCTION
+ <<cacos>>, <<cacosf>>---complex arc cosine
+
+INDEX
+ cacos
+INDEX
+ cacosf
+
+ANSI_SYNOPSIS
+ #include <complex.h>
+ double complex cacos(double complex <[z]>);
+ float complex cacosf(float complex <[z]>);
+
+
+DESCRIPTION
+ These functions compute the complex arc cosine of <[z]>,
+ with branch cuts outside the interval [-1, +1] along the real axis.
+
+ <<cacosf>> is identical to <<cacos>>, except that it performs
+ its calculations on <<floats complex>>.
+
+RETURNS
+ @ifnottex
+ These functions return the complex arc cosine value, in the range
+ of a strip mathematically unbounded along the imaginary axis
+ and in the interval [0, pi] along the real axis.
+ @end ifnottex
+ @tex
+ These functions return the complex arc cosine value, in the range
+ of a strip mathematically unbounded along the imaginary axis
+ and in the interval [<<0>>, $\pi$] along the real axis.
+ @end tex
+
+PORTABILITY
+ <<cacos>> and <<cacosf>> are ISO C99
+
+QUICKREF
+ <<cacos>> and <<cacosf>> are ISO C99
+
+*/
+
#include <complex.h>
#include <math.h>
diff --git a/newlib/libm/complex/cacosh.c b/newlib/libm/complex/cacosh.c
index 8f4f48ad3..3d42c407d 100644
--- a/newlib/libm/complex/cacosh.c
+++ b/newlib/libm/complex/cacosh.c
@@ -32,6 +32,51 @@
* Marco Atzeri <marco_atzeri@yahoo.it>
*/
+/*
+FUNCTION
+ <<cacosh>>, <<cacoshf>>---complex arc hyperbolic cosine
+
+INDEX
+ cacosh
+INDEX
+ cacoshf
+
+ANSI_SYNOPSIS
+ #include <complex.h>
+ double complex cacosh(double complex <[z]>);
+ float complex cacoshf(float complex <[z]>);
+
+
+DESCRIPTION
+ These functions compute the complex arc hyperbolic cosine of <[z]>,
+ with a branch cut at values less than 1 along the real axis.
+
+ <<cacoshf>> is identical to <<cacosh>>, except that it performs
+ its calculations on <<floats complex>>.
+
+RETURNS
+ @ifnottex
+ These functions return the complex arc hyperbolic cosine value,
+ in the range of a half-strip of non-negative values along the
+ real axis and in the interval [-i * pi, +i * pi] along the
+ imaginary axis.
+ @end ifnottex
+ @tex
+ These functions return the complex arc hyperbolic cosine value,
+ in the range of a half-strip of non-negative values along the
+ real axis and in the interval [$-i\pi$, $+i\pi$] along the
+ imaginary axis.
+ @end tex
+
+PORTABILITY
+ <<cacosh>> and <<cacoshf>> are ISO C99
+
+QUICKREF
+ <<cacosh>> and <<cacoshf>> are ISO C99
+
+*/
+
+
#include <complex.h>
double complex
diff --git a/newlib/libm/complex/carg.c b/newlib/libm/complex/carg.c
index 502084096..044742034 100644
--- a/newlib/libm/complex/carg.c
+++ b/newlib/libm/complex/carg.c
@@ -8,6 +8,46 @@
* Marco Atzeri <marco_atzeri@yahoo.it>
*/
+/*
+FUNCTION
+ <<carg>>, <<cargf>>---argument (phase angle)
+
+INDEX
+ carg
+INDEX
+ cargf
+
+ANSI_SYNOPSIS
+ #include <complex.h>
+ double carg(double complex <[z]>);
+ float cargf(float complex <[z]>);
+
+
+DESCRIPTION
+ These functions compute the argument (also called phase angle)
+ of <[z]>, with a branch cut along the negative real axis.
+
+ <<cargf>> is identical to <<carg>>, except that it performs
+ its calculations on <<floats complex>>.
+
+RETURNS
+ @ifnottex
+ The carg functions return the value of the argument in the
+ interval [-pi, +pi]
+ @end ifnottex
+ @tex
+ The carg functions return the value of the argument in the
+ interval [$-\pi$, $+\pi$]
+ @end tex
+
+PORTABILITY
+ <<carg>> and <<cargf>> are ISO C99
+
+QUICKREF
+ <<carg>> and <<cargf>> are ISO C99
+
+*/
+
#include <complex.h>
#include <math.h>
diff --git a/newlib/libm/complex/casin.c b/newlib/libm/complex/casin.c
index 7e392944f..5019fd8cb 100644
--- a/newlib/libm/complex/casin.c
+++ b/newlib/libm/complex/casin.c
@@ -32,6 +32,49 @@
* Marco Atzeri <marco_atzeri@yahoo.it>
*/
+/*
+FUNCTION
+ <<casin>>, <<casinf>>---complex arc sine
+
+INDEX
+ casin
+INDEX
+ casinf
+
+ANSI_SYNOPSIS
+ #include <complex.h>
+ double complex casin(double complex <[z]>);
+ float complex casinf(float complex <[z]>);
+
+
+DESCRIPTION
+ These functions compute the complex arc sine of <[z]>,
+ with branch cuts outside the interval [-1, +1] along the real axis.
+
+ <<casinf>> is identical to <<casin>>, except that it performs
+ its calculations on <<floats complex>>.
+
+RETURNS
+ @ifnottex
+ These functions return the complex arc sine value, in the range
+ of a strip mathematically unbounded along the imaginary axis
+ and in the interval [-pi/2, +pi/2] along the real axis.
+ @end ifnottex
+ @tex
+ These functions return the complex arc sine value, in the range
+ of a strip mathematically unbounded along the imaginary axis
+ and in the interval [$-\pi/2$, $+\pi/2$] along the real axis.
+ @end tex
+
+PORTABILITY
+ <<casin>> and <<casinf>> are ISO C99
+
+QUICKREF
+ <<casin>> and <<casinf>> are ISO C99
+
+*/
+
+
#include <complex.h>
#include <math.h>
diff --git a/newlib/libm/complex/casinh.c b/newlib/libm/complex/casinh.c
index 693b5b68d..16238a6e4 100644
--- a/newlib/libm/complex/casinh.c
+++ b/newlib/libm/complex/casinh.c
@@ -32,6 +32,59 @@
* Marco Atzeri <marco_atzeri@yahoo.it>
*/
+/*
+FUNCTION
+ <<casinh>>, <<casinhf>>---complex arc hyperbolic sine
+
+INDEX
+ casinh
+INDEX
+ casinhf
+
+ANSI_SYNOPSIS
+ #include <complex.h>
+ double complex casinh(double complex <[z]>);
+ float complex casinhf(float complex <[z]>);
+
+
+DESCRIPTION
+ @ifnottex
+ These functions compute the complex arc hyperbolic sine of <[z]>,
+ with branch cuts outside the interval [-i, +i] along the
+ imaginary axis.
+ @end ifnottex
+ @tex
+ These functions compute the complex arc hyperbolic sine of <[z]>,
+ with branch cuts outside the interval [$-i$, $+i$] along the
+ imaginary axis.
+ @end tex
+
+ <<casinhf>> is identical to <<casinh>>, except that it performs
+ its calculations on <<floats complex>>.
+
+RETURNS
+ @ifnottex
+ These functions return the complex arc hyperbolic sine value,
+ in the range of a strip mathematically unbounded along the
+ real axis and in the interval [-i*p/2, +i*p/2] along the
+ imaginary axis.
+ @end ifnottex
+ @tex
+ These functions return the complex arc hyperbolic sine value,
+ in the range of a strip mathematically unbounded along the
+ real axis and in the interval [$-i\pi/2$, $+i\pi/2$] along the
+ imaginary axis.
+ @end tex
+
+PORTABILITY
+ <<casinh>> and <<casinhf>> are ISO C99
+
+QUICKREF
+ <<casinh>> and <<casinhf>> are ISO C99
+
+*/
+
+
#include <complex.h>
double complex
diff --git a/newlib/libm/complex/catan.c b/newlib/libm/complex/catan.c
index 9e29b128e..2cb91bb08 100644
--- a/newlib/libm/complex/catan.c
+++ b/newlib/libm/complex/catan.c
@@ -32,6 +32,57 @@
* Marco Atzeri <marco_atzeri@yahoo.it>
*/
+/*
+FUNCTION
+ <<catan>>, <<catanf>>---complex arc tangent
+
+INDEX
+ catan
+INDEX
+ catanf
+
+ANSI_SYNOPSIS
+ #include <complex.h>
+ double complex catan(double complex <[z]>);
+ float complex catanf(float complex <[z]>);
+
+
+DESCRIPTION
+ @ifnottex
+ These functions compute the complex arc tangent of <[z]>,
+ with branch cuts outside the interval [-i, +i] along the
+ imaginary axis.
+ @end ifnottex
+ @tex
+ These functions compute the complex arc tangent of <[z]>,
+ with branch cuts outside the interval [$-i$, $+i$] along the
+ imaginary axis.
+ @end tex
+
+ <<catanf>> is identical to <<catan>>, except that it performs
+ its calculations on <<floats complex>>.
+
+RETURNS
+ @ifnottex
+ These functions return the complex arc tangent value, in the range
+ of a strip mathematically unbounded along the imaginary axis
+ and in the interval [-pi/2, +pi/2] along the real axis.
+ @end ifnottex
+ @tex
+ These functions return the complex arc tangent, in the range
+ of a strip mathematically unbounded along the imaginary axis
+ and in the interval [$-\pi/2$, $+\pi/2$] along the real axis.
+ @end tex
+
+PORTABILITY
+ <<catan>> and <<catanf>> are ISO C99
+
+QUICKREF
+ <<catan>> and <<catanf>> are ISO C99
+
+*/
+
+
#include <complex.h>
#include <math.h>
#include "cephes_subr.h"
diff --git a/newlib/libm/complex/catanh.c b/newlib/libm/complex/catanh.c
index a06747037..2b9ef9e47 100644
--- a/newlib/libm/complex/catanh.c
+++ b/newlib/libm/complex/catanh.c
@@ -32,6 +32,52 @@
* Marco Atzeri <marco_atzeri@yahoo.it>
*/
+/*
+FUNCTION
+ <<catanh>>, <<catanhf>>---complex arc hyperbolic tangent
+
+INDEX
+ catanh
+INDEX
+ catanhf
+
+ANSI_SYNOPSIS
+ #include <complex.h>
+ double complex catanh(double complex <[z]>);
+ float complex catanhf(float complex <[z]>);
+
+
+DESCRIPTION
+ These functions compute the complex arc hyperbolic tan of <[z]>,
+ with branch cuts outside the interval [-1, +1] along the
+ real axis.
+
+ <<catanhf>> is identical to <<catanh>>, except that it performs
+ its calculations on <<floats complex>>.
+
+RETURNS
+ @ifnottex
+ These functions return the complex arc hyperbolic tangent value,
+ in the range of a strip mathematically unbounded along the
+ real axis and in the interval [-i*p/2, +i*p/2] along the
+ imaginary axis.
+ @end ifnottex
+ @tex
+ These functions return the complex arc hyperbolic tangent value,
+ in the range of a strip mathematically unbounded along the
+ real axis and in the interval [$-i\pi/2$, $+i\pi/2$] along the
+ imaginary axis.
+ @end tex
+
+PORTABILITY
+ <<catanh>> and <<catanhf>> are ISO C99
+
+QUICKREF
+ <<catanh>> and <<catanhf>> are ISO C99
+
+*/
+
+
#include <complex.h>
double complex
diff --git a/newlib/libm/complex/ccos.c b/newlib/libm/complex/ccos.c
index 2e01c7666..1062c079a 100644
--- a/newlib/libm/complex/ccos.c
+++ b/newlib/libm/complex/ccos.c
@@ -32,6 +32,39 @@
* Marco Atzeri <marco_atzeri@yahoo.it>
*/
+/*
+FUNCTION
+ <<ccos>>, <<ccosf>>---complex cosine
+
+INDEX
+ ccos
+INDEX
+ ccosf
+
+ANSI_SYNOPSIS
+ #include <complex.h>
+ double complex ccos(double complex <[z]>);
+ float complex ccosf(float complex <[z]>);
+
+
+DESCRIPTION
+ These functions compute the complex cosine of <[z]>.
+
+ <<ccosf>> is identical to <<ccos>>, except that it performs
+ its calculations on <<floats complex>>.
+
+RETURNS
+ These functions return the complex cosine value.
+
+PORTABILITY
+ <<ccos>> and <<ccosf>> are ISO C99
+
+QUICKREF
+ <<ccos>> and <<ccosf>> are ISO C99
+
+*/
+
+
#include <complex.h>
#include <math.h>
#include "cephes_subr.h"
diff --git a/newlib/libm/complex/ccosh.c b/newlib/libm/complex/ccosh.c
index e489600e3..223a5ed3a 100644
--- a/newlib/libm/complex/ccosh.c
+++ b/newlib/libm/complex/ccosh.c
@@ -32,6 +32,39 @@
* Marco Atzeri <marco_atzeri@yahoo.it>
*/
+/*
+FUNCTION
+ <<ccosh>>, <<ccoshf>>---complex hyperbolic cosine
+
+INDEX
+ ccosh
+INDEX
+ ccoshf
+
+ANSI_SYNOPSIS
+ #include <complex.h>
+ double complex ccosh(double complex <[z]>);
+ float complex ccoshf(float complex <[z]>);
+
+
+DESCRIPTION
+ These functions compute the complex hyperbolic cosine of <[z]>.
+
+ <<ccoshf>> is identical to <<ccosh>>, except that it performs
+ its calculations on <<floats complex>>.
+
+RETURNS
+ These functions return the complex hyperbolic cosine value.
+
+PORTABILITY
+ <<ccosh>> and <<ccoshf>> are ISO C99
+
+QUICKREF
+ <<ccosh>> and <<ccoshf>> are ISO C99
+
+*/
+
+
#include <complex.h>
#include <math.h>
diff --git a/newlib/libm/complex/cexp.c b/newlib/libm/complex/cexp.c
index f894cd138..b9a3fd087 100644
--- a/newlib/libm/complex/cexp.c
+++ b/newlib/libm/complex/cexp.c
@@ -32,6 +32,39 @@
* Marco Atzeri <marco_atzeri@yahoo.it>
*/
+/*
+FUNCTION
+ <<cexp>>, <<cexpf>>---complex base-e exponential
+
+INDEX
+ cexp
+INDEX
+ cexpf
+
+ANSI_SYNOPSIS
+ #include <complex.h>
+ double complex cexp(double complex <[z]>);
+ float complex cexpf(float complex <[z]>);
+
+
+DESCRIPTION
+ These functions compute the complex base-<[e]> exponential of <[z]>.
+
+ <<cexpf>> is identical to <<cexp>>, except that it performs
+ its calculations on <<floats complex>>.
+
+RETURNS
+ The cexp functions return the complex base-<[e]> exponential value.
+
+PORTABILITY
+ <<cexp>> and <<cexpf>> are ISO C99
+
+QUICKREF
+ <<cexp>> and <<cexpf>> are ISO C99
+
+*/
+
+
#include <complex.h>
#include <math.h>
diff --git a/newlib/libm/complex/cimag.c b/newlib/libm/complex/cimag.c
index 86068ba4e..1d2d77414 100644
--- a/newlib/libm/complex/cimag.c
+++ b/newlib/libm/complex/cimag.c
@@ -8,6 +8,39 @@
* Marco Atzeri <marco_atzeri@yahoo.it>
*/
+/*
+FUNCTION
+ <<cimag>>, <<cimagf>>---imaginary part
+
+INDEX
+ cimag
+INDEX
+ cimagf
+
+ANSI_SYNOPSIS
+ #include <complex.h>
+ double cimag(double complex <[z]>);
+ float cimagf(float complex <[z]>);
+
+
+DESCRIPTION
+ These functions compute the imaginary part of <[z]>.
+
+ <<cimagf>> is identical to <<cimag>>, except that it performs
+ its calculations on <<floats complex>>.
+
+RETURNS
+ The cimag functions return the imaginary part value (as a real).
+
+PORTABILITY
+ <<cimag>> and <<cimagf>> are ISO C99
+
+QUICKREF
+ <<cimag>> and <<cimagf>> are ISO C99
+
+*/
+
+
#include <complex.h>
#include "../common/fdlibm.h"
diff --git a/newlib/libm/complex/clog.c b/newlib/libm/complex/clog.c
index 838f92dc6..f7ad3d2f7 100644
--- a/newlib/libm/complex/clog.c
+++ b/newlib/libm/complex/clog.c
@@ -32,6 +32,48 @@
* Marco Atzeri <marco_atzeri@yahoo.it>
*/
+/*
+FUNCTION
+ <<clog>>, <<clogf>>---complex base-e logarithm
+
+INDEX
+ clog
+INDEX
+ clogf
+
+ANSI_SYNOPSIS
+ #include <complex.h>
+ double complex clog(double complex <[z]>);
+ float complex clogf(float complex <[z]>);
+
+
+DESCRIPTION
+ These functions compute the complex natural (base-<[e]>) logarithm
+ of <[z]>, with a branch cut along the negative real axis.
+
+ <<clogf>> is identical to <<clog>>, except that it performs
+ its calculations on <<floats complex>>.
+
+RETURNS
+ @ifnottex
+ The clog functions return the complex natural logarithm value, in
+ the range of a strip mathematically unbounded along the real axis
+ and in the interval [-i*pi , +i*pi] along the imaginary axis.
+ @end ifnottex
+ @tex
+ The clog functions return the complex natural logarithm value, in
+ the range of a strip mathematically unbounded along the real axis
+ and in the interval [$-i\pi$, $+i\pi$] along the imaginary axis.
+ @end tex
+
+PORTABILITY
+ <<clog>> and <<clogf>> are ISO C99
+
+QUICKREF
+ <<clog>> and <<clogf>> are ISO C99
+
+*/
+
#include <complex.h>
#include <math.h>
diff --git a/newlib/libm/complex/complex.tex b/newlib/libm/complex/complex.tex
index 3f1063c3d..4ac14c3a9 100644
--- a/newlib/libm/complex/complex.tex
+++ b/newlib/libm/complex/complex.tex
@@ -1 +1,55 @@
-@c empty stub
+@node Complex
+@chapter Mathematical Complex Functions (@file{complex.h})
+
+This chapter groups the complex mathematical functions. The
+corresponding definitions and declarations are in @file{complex.h}.
+Functions and documentations are taken from NetBSD.
+
+@menu
+* cabs:: Complex absolute value
+* cacos:: Complex arc cosine
+* cacosh:: Complex arc hyperbolic cosine
+* carg:: Argument (also called phase angle)
+* casin:: Complex arc sine
+* casinh:: Complex arc hyperbolic sine
+* catan:: Complex arc tangent
+* catanh:: Complex arc hyperbolic tangent
+* ccos:: Complex cosine
+* ccosh:: Complex hyperbolic cosine
+* cexp:: Complex exponent
+* cimag:: Imaginary part
+* clog:: Complex natural (base e) logarithm
+* conj:: Complex conjugate
+* cpow:: Complex power function
+* cproj:: Compute a projection on the Riemann sphere
+* creal:: Real part
+* csin:: Complex sine
+* csinh:: Complex hyperbolic sine
+* csqrt:: Complex square root
+* ctan:: Complex tangent
+* ctanh:: Complex hyperbolic tangent
+@end menu
+
+
+@page @include complex/cabs.def
+@page @include complex/cacos.def
+@page @include complex/cacosh.def
+@page @include complex/carg.def
+@page @include complex/casin.def
+@page @include complex/casinh.def
+@page @include complex/catan.def
+@page @include complex/catanh.def
+@page @include complex/ccos.def
+@page @include complex/ccosh.def
+@page @include complex/cexp.def
+@page @include complex/cimag.def
+@page @include complex/clog.def
+@page @include complex/conj.def
+@page @include complex/cpow.def
+@page @include complex/cproj.def
+@page @include complex/creal.def
+@page @include complex/csin.def
+@page @include complex/csinh.def
+@page @include complex/csqrt.def
+@page @include complex/ctan.def
+@page @include complex/ctanh.def
diff --git a/newlib/libm/complex/conj.c b/newlib/libm/complex/conj.c
index 9d9fb7776..dc50f085c 100644
--- a/newlib/libm/complex/conj.c
+++ b/newlib/libm/complex/conj.c
@@ -8,6 +8,39 @@
* Marco Atzeri <marco_atzeri@yahoo.it>
*/
+/*
+FUNCTION
+ <<conj>>, <<conjf>>---complex conjugate
+
+INDEX
+ conj
+INDEX
+ conjf
+
+ANSI_SYNOPSIS
+ #include <complex.h>
+ double complex conj(double complex <[z]>);
+ float complex conjf(float complex <[z]>);
+
+
+DESCRIPTION
+ These functions compute the complex conjugate of <[z]>,
+ by reversing the sign of its imaginary part.
+
+ <<conjf>> is identical to <<conj>>, except that it performs
+ its calculations on <<floats complex>>.
+
+RETURNS
+ The conj functions return the complex conjugate value.
+
+PORTABILITY
+ <<conj>> and <<conjf>> are ISO C99
+
+QUICKREF
+ <<conj>> and <<conjf>> are ISO C99
+
+*/
+
#include <complex.h>
#include "../common/fdlibm.h"
diff --git a/newlib/libm/complex/cpow.c b/newlib/libm/complex/cpow.c
index 0ea5df784..b60f7bea3 100644
--- a/newlib/libm/complex/cpow.c
+++ b/newlib/libm/complex/cpow.c
@@ -32,6 +32,48 @@
* Marco Atzeri <marco_atzeri@yahoo.it>
*/
+/*
+FUNCTION
+ <<cpow>>, <<cpowf>>---complex power
+
+INDEX
+ cpow
+INDEX
+ cpowf
+
+ANSI_SYNOPSIS
+ #include <complex.h>
+ double complex cpow(double complex <[x]>, double complex <[y]>);
+ float complex cpowf(float complex <[x]>, float complex <[y]>);
+
+
+DESCRIPTION
+ @ifnottex
+ The cpow functions compute the complex power function x^y
+ power, with a branch cut for the first parameter along the
+ negative real axis.
+ @end ifnottex
+ @tex
+ The cpow functions compute the complex power function $x^y$
+ power, with a branch cut for the first parameter along the
+ negative real axis.
+ @end tex
+
+ <<cpowf>> is identical to <<cpow>>, except that it performs
+ its calculations on <<floats complex>>.
+
+RETURNS
+ The cpow functions return the complex power function value.
+
+PORTABILITY
+ <<cpow>> and <<cpowf>> are ISO C99
+
+QUICKREF
+ <<cpow>> and <<cpowf>> are ISO C99
+
+*/
+
+
#include <complex.h>
#include <math.h>
diff --git a/newlib/libm/complex/cproj.c b/newlib/libm/complex/cproj.c
index e46742e9e..42fc0f1e8 100644
--- a/newlib/libm/complex/cproj.c
+++ b/newlib/libm/complex/cproj.c
@@ -29,6 +29,45 @@
* Marco Atzeri <marco_atzeri@yahoo.it>
*/
+/*
+FUNCTION
+ <<cproj>>, <<cprojf>>--- Riemann sphere projection
+
+INDEX
+ cproj
+INDEX
+ cprojf
+
+ANSI_SYNOPSIS
+ #include <complex.h>
+ double complex cproj(double complex <[z]>);
+ float complex cprojf(float complex <[z]>);
+
+
+DESCRIPTION
+ These functions compute a projection of <[z]> onto the Riemann
+ sphere: <[z]> projects to <[z]> except that all complex infinities
+ (even those with one infinite part and one NaN part) project
+ to positive infinity on the real axis. If <[z]> has an infinite part,
+ then <<cproj>>(<[z]>) is equivalent to
+
+ INFINITY + I * copysign(0.0, cimag(z))
+
+ <<cprojf>> is identical to <<cproj>>, except that it performs
+ its calculations on <<floats complex>>.
+
+RETURNS
+ The cproj functions return the value of the projection onto
+ the Riemann sphere.
+
+PORTABILITY
+ <<cproj>> and <<cprojf>> are ISO C99
+
+QUICKREF
+ <<cproj>> and <<cprojf>> are ISO C99
+
+*/
+
#include <sys/cdefs.h>
/*__RCSID("$NetBSD: cproj.c,v 1.3 2010/09/20 17:51:38 christos Exp $"); */
diff --git a/newlib/libm/complex/creal.c b/newlib/libm/complex/creal.c
index 6ec04408f..c621561ae 100644
--- a/newlib/libm/complex/creal.c
+++ b/newlib/libm/complex/creal.c
@@ -8,6 +8,39 @@
* Marco Atzeri <marco_atzeri@yahoo.it>
*/
+/*
+FUNCTION
+ <<creal>>, <<crealf>>---real part
+
+INDEX
+ creal
+INDEX
+ crealf
+
+ANSI_SYNOPSIS
+ #include <complex.h>
+ double creal(double complex <[z]>);
+ float crealf(float complex <[z]>);
+
+
+DESCRIPTION
+ These functions compute the real part of <[z]>.
+
+ <<crealf>> is identical to <<creal>>, except that it performs
+ its calculations on <<floats complex>>.
+
+RETURNS
+ The creal functions return the real part value.
+
+PORTABILITY
+ <<creal>> and <<crealf>> are ISO C99
+
+QUICKREF
+ <<creal>> and <<crealf>> are ISO C99
+
+*/
+
+
#include <complex.h>
#include "../common/fdlibm.h"
diff --git a/newlib/libm/complex/csin.c b/newlib/libm/complex/csin.c
index ac66b384a..cf6dae068 100644
--- a/newlib/libm/complex/csin.c
+++ b/newlib/libm/complex/csin.c
@@ -32,6 +32,39 @@
* Marco Atzeri <marco_atzeri@yahoo.it>
*/
+/*
+FUNCTION
+ <<csin>>, <<csinf>>---complex sine
+
+INDEX
+ csin
+INDEX
+ csinf
+
+ANSI_SYNOPSIS
+ #include <complex.h>
+ double complex csin(double complex <[z]>);
+ float complex csinf(float complex <[z]>);
+
+
+DESCRIPTION
+ These functions compute the complex sine of <[z]>.
+
+ <<csinf>> is identical to <<csin>>, except that it performs
+ its calculations on <<floats complex>>.
+
+RETURNS
+ These functions return the complex sine value.
+
+PORTABILITY
+ <<csin>> and <<csinf>> are ISO C99
+
+QUICKREF
+ <<csin>> and <<csinf>> are ISO C99
+
+*/
+
+
#include <complex.h>
#include <math.h>
#include "cephes_subr.h"
diff --git a/newlib/libm/complex/csinh.c b/newlib/libm/complex/csinh.c
index ee9231a2d..f11716262 100644
--- a/newlib/libm/complex/csinh.c
+++ b/newlib/libm/complex/csinh.c
@@ -32,6 +32,38 @@
* Marco Atzeri <marco_atzeri@yahoo.it>
*/
+/*
+FUNCTION
+ <<csinh>>, <<csinhf>>---complex hyperbolic sine
+
+INDEX
+ csinh
+INDEX
+ csinhf
+
+ANSI_SYNOPSIS
+ #include <complex.h>
+ double complex csinh(double complex <[z]>);
+ float complex csinhf(float complex <[z]>);
+
+
+DESCRIPTION
+ These functions compute the complex hyperbolic sine of <[z]>.
+
+ <<ccoshf>> is identical to <<ccosh>>, except that it performs
+ its calculations on <<floats complex>>.
+
+RETURNS
+ These functions return the complex hyperbolic sine value.
+
+PORTABILITY
+ <<csinh>> and <<csinhf>> are ISO C99
+
+QUICKREF
+ <<csinh>> and <<csinhf>> are ISO C99
+
+*/
+
#include <complex.h>
#include <math.h>
diff --git a/newlib/libm/complex/csqrt.c b/newlib/libm/complex/csqrt.c
index 23bd0b046..b144b7c3a 100644
--- a/newlib/libm/complex/csqrt.c
+++ b/newlib/libm/complex/csqrt.c
@@ -32,6 +32,41 @@
* Marco Atzeri <marco_atzeri@yahoo.it>
*/
+/*
+FUNCTION
+ <<csqrt>>, <<csqrtf>>---complex square root
+
+INDEX
+ csqrt
+INDEX
+ csqrtf
+
+ANSI_SYNOPSIS
+ #include <complex.h>
+ double complex csqrt(double complex <[z]>);
+ float complex csqrtf(float complex <[z]>);
+
+
+DESCRIPTION
+ These functions compute the complex square root of <[z]>, with
+ a branch cut along the negative real axis.
+
+ <<csqrtf>> is identical to <<csqrt>>, except that it performs
+ its calculations on <<floats complex>>.
+
+RETURNS
+ The csqrt functions return the complex square root value, in
+ the range of the right halfplane (including the imaginary axis).
+
+PORTABILITY
+ <<csqrt>> and <<csqrtf>> are ISO C99
+
+QUICKREF
+ <<csqrt>> and <<csqrtf>> are ISO C99
+
+*/
+
+
#include <complex.h>
#include <math.h>
diff --git a/newlib/libm/complex/ctan.c b/newlib/libm/complex/ctan.c
index 33b39b497..8a566b66b 100644
--- a/newlib/libm/complex/ctan.c
+++ b/newlib/libm/complex/ctan.c
@@ -32,6 +32,39 @@
* Marco Atzeri <marco_atzeri@yahoo.it>
*/
+/*
+FUNCTION
+ <<ctan>>, <<ctanf>>---complex tangent
+
+INDEX
+ ctan
+INDEX
+ ctanf
+
+ANSI_SYNOPSIS
+ #include <complex.h>
+ double complex ctan(double complex <[z]>);
+ float complex ctanf(float complex <[z]>);
+
+
+DESCRIPTION
+ These functions compute the complex tangent of <[z]>.
+
+ <<ctanf>> is identical to <<ctan>>, except that it performs
+ its calculations on <<floats complex>>.
+
+RETURNS
+ These functions return the complex tangent value.
+
+PORTABILITY
+ <<ctan>> and <<ctanf>> are ISO C99
+
+QUICKREF
+ <<ctan>> and <<ctanf>> are ISO C99
+
+*/
+
+
#include <complex.h>
#include <math.h>
#include "cephes_subr.h"
diff --git a/newlib/libm/complex/ctanh.c b/newlib/libm/complex/ctanh.c
index 875899aff..db27e5b47 100644
--- a/newlib/libm/complex/ctanh.c
+++ b/newlib/libm/complex/ctanh.c
@@ -32,6 +32,39 @@
* Marco Atzeri <marco_atzeri@yahoo.it>
*/
+/*
+FUNCTION
+ <<ctanh>>, <<ctanf>>---complex hyperbolic tangent
+
+INDEX
+ ctanh
+INDEX
+ ctanhf
+
+ANSI_SYNOPSIS
+ #include <complex.h>
+ double complex ctanh(double complex <[z]>);
+ float complex ctanhf(float complex <[z]>);
+
+
+DESCRIPTION
+ These functions compute the complex hyperbolic tangent of <[z]>.
+
+ <<ctanhf>> is identical to <<ctanh>>, except that it performs
+ its calculations on <<floats complex>>.
+
+RETURNS
+ These functions return the complex hyperbolic tangent value.
+
+PORTABILITY
+ <<ctanh>> and <<ctanhf>> are ISO C99
+
+QUICKREF
+ <<ctanh>> and <<ctanhf>> are ISO C99
+
+*/
+
+
#include <complex.h>
#include <math.h>
diff --git a/newlib/libm/libm.texinfo b/newlib/libm/libm.texinfo
index 28c1c6257..1ca84bc1d 100644
--- a/newlib/libm/libm.texinfo
+++ b/newlib/libm/libm.texinfo
@@ -93,6 +93,7 @@ into another language, under the above conditions for modified versions.
@menu
* Math:: The mathematical functions (`math.h').
+* Complex:: The mathematical complex functions (`complex.h').
* Reentrancy:: The functions in libm are not reentrant by default.
* Long Double Functions:: The long double function support of libm.
* Index::