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 + + * 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 * 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 */ +/* +FUNCTION + <>, <>---complex absolute-value + +INDEX + cabs +INDEX + cabsf + +ANSI_SYNOPSIS + #include + 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]>. + + <> is identical to <>, except that it performs + its calculations on <>. + +RETURNS + The cabs functions return the complex absolute value. + +PORTABILITY + <> and <> are ISO C99 + +QUICKREF + <> and <> are ISO C99 + +*/ + + #include #include 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 */ +/* +FUNCTION + <>, <>---complex arc cosine + +INDEX + cacos +INDEX + cacosf + +ANSI_SYNOPSIS + #include + 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. + + <> is identical to <>, except that it performs + its calculations on <>. + +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 + <> and <> are ISO C99 + +QUICKREF + <> and <> are ISO C99 + +*/ + #include #include 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 */ +/* +FUNCTION + <>, <>---complex arc hyperbolic cosine + +INDEX + cacosh +INDEX + cacoshf + +ANSI_SYNOPSIS + #include + 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. + + <> is identical to <>, except that it performs + its calculations on <>. + +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 + <> and <> are ISO C99 + +QUICKREF + <> and <> are ISO C99 + +*/ + + #include 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 */ +/* +FUNCTION + <>, <>---argument (phase angle) + +INDEX + carg +INDEX + cargf + +ANSI_SYNOPSIS + #include + 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. + + <> is identical to <>, except that it performs + its calculations on <>. + +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 + <> and <> are ISO C99 + +QUICKREF + <> and <> are ISO C99 + +*/ + #include #include 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 */ +/* +FUNCTION + <>, <>---complex arc sine + +INDEX + casin +INDEX + casinf + +ANSI_SYNOPSIS + #include + 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. + + <> is identical to <>, except that it performs + its calculations on <>. + +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 + <> and <> are ISO C99 + +QUICKREF + <> and <> are ISO C99 + +*/ + + #include #include 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 */ +/* +FUNCTION + <>, <>---complex arc hyperbolic sine + +INDEX + casinh +INDEX + casinhf + +ANSI_SYNOPSIS + #include + 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 + + <> is identical to <>, except that it performs + its calculations on <>. + +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 + <> and <> are ISO C99 + +QUICKREF + <> and <> are ISO C99 + +*/ + + #include 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 */ +/* +FUNCTION + <>, <>---complex arc tangent + +INDEX + catan +INDEX + catanf + +ANSI_SYNOPSIS + #include + 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 + + <> is identical to <>, except that it performs + its calculations on <>. + +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 + <> and <> are ISO C99 + +QUICKREF + <> and <> are ISO C99 + +*/ + + #include #include #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 */ +/* +FUNCTION + <>, <>---complex arc hyperbolic tangent + +INDEX + catanh +INDEX + catanhf + +ANSI_SYNOPSIS + #include + 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. + + <> is identical to <>, except that it performs + its calculations on <>. + +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 + <> and <> are ISO C99 + +QUICKREF + <> and <> are ISO C99 + +*/ + + #include 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 */ +/* +FUNCTION + <>, <>---complex cosine + +INDEX + ccos +INDEX + ccosf + +ANSI_SYNOPSIS + #include + double complex ccos(double complex <[z]>); + float complex ccosf(float complex <[z]>); + + +DESCRIPTION + These functions compute the complex cosine of <[z]>. + + <> is identical to <>, except that it performs + its calculations on <>. + +RETURNS + These functions return the complex cosine value. + +PORTABILITY + <> and <> are ISO C99 + +QUICKREF + <> and <> are ISO C99 + +*/ + + #include #include #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 */ +/* +FUNCTION + <>, <>---complex hyperbolic cosine + +INDEX + ccosh +INDEX + ccoshf + +ANSI_SYNOPSIS + #include + double complex ccosh(double complex <[z]>); + float complex ccoshf(float complex <[z]>); + + +DESCRIPTION + These functions compute the complex hyperbolic cosine of <[z]>. + + <> is identical to <>, except that it performs + its calculations on <>. + +RETURNS + These functions return the complex hyperbolic cosine value. + +PORTABILITY + <> and <> are ISO C99 + +QUICKREF + <> and <> are ISO C99 + +*/ + + #include #include 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 */ +/* +FUNCTION + <>, <>---complex base-e exponential + +INDEX + cexp +INDEX + cexpf + +ANSI_SYNOPSIS + #include + double complex cexp(double complex <[z]>); + float complex cexpf(float complex <[z]>); + + +DESCRIPTION + These functions compute the complex base-<[e]> exponential of <[z]>. + + <> is identical to <>, except that it performs + its calculations on <>. + +RETURNS + The cexp functions return the complex base-<[e]> exponential value. + +PORTABILITY + <> and <> are ISO C99 + +QUICKREF + <> and <> are ISO C99 + +*/ + + #include #include 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 */ +/* +FUNCTION + <>, <>---imaginary part + +INDEX + cimag +INDEX + cimagf + +ANSI_SYNOPSIS + #include + double cimag(double complex <[z]>); + float cimagf(float complex <[z]>); + + +DESCRIPTION + These functions compute the imaginary part of <[z]>. + + <> is identical to <>, except that it performs + its calculations on <>. + +RETURNS + The cimag functions return the imaginary part value (as a real). + +PORTABILITY + <> and <> are ISO C99 + +QUICKREF + <> and <> are ISO C99 + +*/ + + #include #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 */ +/* +FUNCTION + <>, <>---complex base-e logarithm + +INDEX + clog +INDEX + clogf + +ANSI_SYNOPSIS + #include + 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. + + <> is identical to <>, except that it performs + its calculations on <>. + +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 + <> and <> are ISO C99 + +QUICKREF + <> and <> are ISO C99 + +*/ + #include #include 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 */ +/* +FUNCTION + <>, <>---complex conjugate + +INDEX + conj +INDEX + conjf + +ANSI_SYNOPSIS + #include + 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. + + <> is identical to <>, except that it performs + its calculations on <>. + +RETURNS + The conj functions return the complex conjugate value. + +PORTABILITY + <> and <> are ISO C99 + +QUICKREF + <> and <> are ISO C99 + +*/ + #include #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 */ +/* +FUNCTION + <>, <>---complex power + +INDEX + cpow +INDEX + cpowf + +ANSI_SYNOPSIS + #include + 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 + + <> is identical to <>, except that it performs + its calculations on <>. + +RETURNS + The cpow functions return the complex power function value. + +PORTABILITY + <> and <> are ISO C99 + +QUICKREF + <> and <> are ISO C99 + +*/ + + #include #include 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 */ +/* +FUNCTION + <>, <>--- Riemann sphere projection + +INDEX + cproj +INDEX + cprojf + +ANSI_SYNOPSIS + #include + 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 <>(<[z]>) is equivalent to + + INFINITY + I * copysign(0.0, cimag(z)) + + <> is identical to <>, except that it performs + its calculations on <>. + +RETURNS + The cproj functions return the value of the projection onto + the Riemann sphere. + +PORTABILITY + <> and <> are ISO C99 + +QUICKREF + <> and <> are ISO C99 + +*/ + #include /*__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 */ +/* +FUNCTION + <>, <>---real part + +INDEX + creal +INDEX + crealf + +ANSI_SYNOPSIS + #include + double creal(double complex <[z]>); + float crealf(float complex <[z]>); + + +DESCRIPTION + These functions compute the real part of <[z]>. + + <> is identical to <>, except that it performs + its calculations on <>. + +RETURNS + The creal functions return the real part value. + +PORTABILITY + <> and <> are ISO C99 + +QUICKREF + <> and <> are ISO C99 + +*/ + + #include #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 */ +/* +FUNCTION + <>, <>---complex sine + +INDEX + csin +INDEX + csinf + +ANSI_SYNOPSIS + #include + double complex csin(double complex <[z]>); + float complex csinf(float complex <[z]>); + + +DESCRIPTION + These functions compute the complex sine of <[z]>. + + <> is identical to <>, except that it performs + its calculations on <>. + +RETURNS + These functions return the complex sine value. + +PORTABILITY + <> and <> are ISO C99 + +QUICKREF + <> and <> are ISO C99 + +*/ + + #include #include #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 */ +/* +FUNCTION + <>, <>---complex hyperbolic sine + +INDEX + csinh +INDEX + csinhf + +ANSI_SYNOPSIS + #include + double complex csinh(double complex <[z]>); + float complex csinhf(float complex <[z]>); + + +DESCRIPTION + These functions compute the complex hyperbolic sine of <[z]>. + + <> is identical to <>, except that it performs + its calculations on <>. + +RETURNS + These functions return the complex hyperbolic sine value. + +PORTABILITY + <> and <> are ISO C99 + +QUICKREF + <> and <> are ISO C99 + +*/ + #include #include 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 */ +/* +FUNCTION + <>, <>---complex square root + +INDEX + csqrt +INDEX + csqrtf + +ANSI_SYNOPSIS + #include + 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. + + <> is identical to <>, except that it performs + its calculations on <>. + +RETURNS + The csqrt functions return the complex square root value, in + the range of the right halfplane (including the imaginary axis). + +PORTABILITY + <> and <> are ISO C99 + +QUICKREF + <> and <> are ISO C99 + +*/ + + #include #include 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 */ +/* +FUNCTION + <>, <>---complex tangent + +INDEX + ctan +INDEX + ctanf + +ANSI_SYNOPSIS + #include + double complex ctan(double complex <[z]>); + float complex ctanf(float complex <[z]>); + + +DESCRIPTION + These functions compute the complex tangent of <[z]>. + + <> is identical to <>, except that it performs + its calculations on <>. + +RETURNS + These functions return the complex tangent value. + +PORTABILITY + <> and <> are ISO C99 + +QUICKREF + <> and <> are ISO C99 + +*/ + + #include #include #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 */ +/* +FUNCTION + <>, <>---complex hyperbolic tangent + +INDEX + ctanh +INDEX + ctanhf + +ANSI_SYNOPSIS + #include + double complex ctanh(double complex <[z]>); + float complex ctanhf(float complex <[z]>); + + +DESCRIPTION + These functions compute the complex hyperbolic tangent of <[z]>. + + <> is identical to <>, except that it performs + its calculations on <>. + +RETURNS + These functions return the complex hyperbolic tangent value. + +PORTABILITY + <> and <> are ISO C99 + +QUICKREF + <> and <> are ISO C99 + +*/ + + #include #include 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::