Main Page | Alphabetical List | Class List | File List | Class Members | File Members

complex.h File Reference

apeNEXT complex functions for nlcc More...

#include <nlibc.h>
#include <math.h>

Include dependency graph for complex.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Defines

#define _math_setdouble(U, D)
#define _Complex_I   {0., 1.}
#define I   _Complex_I
#define M_PI   3.14159265358979323846
#define M_PI_2   1.57079632679489661923
#define M_PI_4   0.78539816339744830962
#define conj(x)   (~(x))
#define creal(x)   ((x).re)
#define cimag(x)   ((x).im)
#define NAN   (cnan())
#define HUGE_VALD   (cinfty())

Functions

math_inline double cnan (void)
math_inline double cinfty (void)
math_inline complex sincos (double x)
math_inline complex sinhcosh (double x)
math_inline double cabs (complex z)
math_inline double carg (complex z)
math_inline complex cproj (complex z)
math_inline complex cexp (complex z)
math_inline complex clog (complex z)
math_inline complex cpow (complex x, complex y)
math_inline complex csqrt (complex z)
math_inline complex cacosh (complex z)
math_inline complex casinh (complex z)
math_inline complex catanh (complex z)
math_inline complex cacos (complex z)
math_inline complex casin (complex z)
math_inline complex catan (complex z)
math_inline complex ccosh (complex z)
math_inline complex csinh (complex z)
math_inline complex ctanh (complex z)
math_inline complex ccos (complex z)
math_inline complex csin (complex z)
math_inline complex ctan (complex z)


Detailed Description

apeNEXT complex functions for nlcc

NAME
complex.h

SYNOPSIS
#include <complex.h>

DESCRIPTION
The complex.h header file contains the complex functions.
The used data types are defined as double / complex

RETURN VALUE

NOTES

IMPLEMENTATION for APEnext: possible (complex.h)

VERSION

Id
complex.h,v 1.31 2005/11/10 19:28:30 morinl Exp


ISO/IEC 9899:1999 (E) Standard

Author:
K. Huebner, M. Prevot

Definition in file complex.h.


Define Documentation

#define _Complex_I   {0., 1.}
 

Definition at line 120 of file complex.h.

#define _math_setdouble U,
 ) 
 

Value:

{ \
  register union { double d; unsigned i; } u; \
  asm("\tatr0h %0 <"#U">" : "=r" (u.i)); D=u.d; \
}
uses: fpclassify(), signbit(), copysign(), fabs() FP_ZERO, FP_NORMAL, FP_INFINITE, FP_NAN,

math_inline double cnan(void) math_inline double cinfty(void)

math_inline complex sincos(double x) (sin_1oct,cos_1oct) math_inline complex sinhcosh(double x) (expm1)

function: uses: double cabs(complex z); (hypot) double carg(complex z); (atan2)

complex cproj(complex z); complex cexp(complex z); (sincos,exp) complex clog(complex z); (log,hypot,atan2) complex cpow(complex x, y); (cexp,clog) complex csqrt(complex z); (sqrt,hypot)

complex cacosh(complex z); (csqrt,clog) complex casinh(complex z); (csqrt,clog) complex catanh(complex z); (log,atan2)

complex cacos(complex z); (cacosh) complex casin(complex z); (casinh) complex catan(complex z); (log,atan2)

complex ccosh(complex z); (sincos,sinhcosh) complex csinh(complex z); (sincos,sinhcosh) complex ctanh(complex z); (sincos,sinhcosh)

complex ccos(complex z); (sincos,sinhcosh) complex csin(complex z); (sincos,sinhcosh) complex ctan(complex z); (sincos,sinhcosh)

Definition at line 115 of file complex.h.

Referenced by acos(), asin(), asin_k(), atan(), atan2(), atan_k(), cbrt(), ceil(), cos(), cos_1oct(), exp(), exp1m(), expm1(), floor(), isqrt(), isqrt2(), log(), log1p(), log2(), sin(), sin_1oct(), sqrt(), sqrt2(), and tan().

#define cimag  )     ((x).im)
 

Definition at line 129 of file complex.h.

#define conj  )     (~(x))
 

Definition at line 127 of file complex.h.

#define creal  )     ((x).re)
 

Definition at line 128 of file complex.h.

#define HUGE_VALD   (cinfty())
 

Definition at line 165 of file complex.h.

#define I   _Complex_I
 

Definition at line 121 of file complex.h.

#define M_PI   3.14159265358979323846
 

Definition at line 123 of file complex.h.

#define M_PI_2   1.57079632679489661923
 

Definition at line 124 of file complex.h.

#define M_PI_4   0.78539816339744830962
 

Definition at line 125 of file complex.h.

#define NAN   (cnan())
 

Definition at line 149 of file complex.h.


Function Documentation

math_inline double cabs complex  z  ) 
 

NAME
cabs() - complex absolute value
SYNOPSIS
#include <complex.h>
double cabs(complex)

DESCRIPTION
The cabs() function computes the absolute value of argument (also called norm, modulus, or magnitude).
RETURN VALUE
The cabs() functio returns the absolute value
NOTES
z = (x) + j(y) cabs(z) = hypot(x,y)
IMPLEMENTATION for APEnext: implem (cabs)

VERSION

Id
complex.h,v 1.31 2005/11/10 19:28:30 morinl Exp


ISO/IEC 9899:1999 (E) Standard

Author:
K. Huebner, M. Prevot

math_inline complex cacos complex  z  ) 
 

NAME
cacos - arc cosine
SYNOPSIS
#include <complex.h>
complex cacos(complex)

DESCRIPTION
The cacos() function computes complex double precision arc cosine of complex, with branch cuts outside the interval [-1, +1] along the real axis.
RETURN VALUE
The cacos() function returns 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.
NOTES
z = (x) + j(y) cacos(z) = (PI/2, 0) - casin(z) (old version) cacos(z) = (+/-) j*cacosh(z)
IMPLEMENTATION for APEnext: implem (cacos)

VERSION

Id
complex.h,v 1.31 2005/11/10 19:28:30 morinl Exp


ISO/IEC 9899:1999 (E) Standard

Author:
K. Huebner, M. Prevot

math_inline complex cacosh complex  z  ) 
 

NAME
cacosh - complex arc hyperbolic cosine
SYNOPSIS
#include <complex.h>
complex cacosh(complex)

DESCRIPTION
The cacosh() function computes the complex arc hyperbolic cosine, with a branch cut at values less than 1 along the real axis.
RETURN VALUE
The cacosh() function returns 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.
NOTES
z = (x) + j(y) cacosh(z) = clog(z+csqrt(~z*z-1.0))
IMPLEMENTATION for APEnext: implem (cacosh)

VERSION

Id
complex.h,v 1.31 2005/11/10 19:28:30 morinl Exp


ISO/IEC 9899:1999 (E) Standard

Author:
K. Huebner, M. Prevot

math_inline double carg complex  z  ) 
 

NAME
carg() - double argument
SYNOPSIS
#include <complex.h>
double carg(complex)

DESCRIPTION
The carg() function computes the argument (also called phase angle), with a branch cut along the negative real axis
RETURN VALUE
The carg() function returns the value of the argument in the interval [-pi, +pi].
NOTES
z = (x) + j(y) carg(z) = atan2(y,x)
IMPLEMENTATION for APEnext: implem (carg)

VERSION

Id
complex.h,v 1.31 2005/11/10 19:28:30 morinl Exp


ISO/IEC 9899:1999 (E) Standard

Author:
K. Huebner, M. Prevot

math_inline complex casin complex  z  ) 
 

NAME
casin - arc sine
SYNOPSIS
#include <complex.h>
complex casin(complex)

DESCRIPTION
The casin() function computes complex double precision arc sine of the complex, with branch cuts outside the interval [-1, +1] along the real axis.
RETURN VALUE
The casin() function returns 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.
NOTES
z = (x) + j(y) casin(z) = -j*casinh(j*z)
IMPLEMENTATION for APEnext: implem (casin)

VERSION

Id
complex.h,v 1.31 2005/11/10 19:28:30 morinl Exp


ISO/IEC 9899:1999 (E) Standard

Author:
K. Huebner, M. Prevot

math_inline complex casinh complex  z  ) 
 

NAME
casinh - complex arc hyperbolic sine
SYNOPSIS
#include <complex.h>
complex casinh(complex)

DESCRIPTION
The casinh() function computes the complex arc hyperbolic sine, with a branch cut at values less than 1 along the real axis.
RETURN VALUE
The casinh() function returns 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.
NOTES
z = (x) + j(y) casinh(z) = clog(z+csqrt(~z*z+1))
IMPLEMENTATION for APEnext: implem (casinh)

VERSION

Id
complex.h,v 1.31 2005/11/10 19:28:30 morinl Exp


ISO/IEC 9899:1999 (E) Standard

Author:
K. Huebner, M. Prevot

math_inline complex catan complex  z  ) 
 

NAME
catan - arc tangent
SYNOPSIS
#include <complex.h>
complex catan(complex)

DESCRIPTION
The catan() function computes complex double precision arc tangent of the complex, with branch cuts outside the interval [-i, +i] along the imaginary axis.
RETURN VALUE
The catan() function returns 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.
NOTES
z = (x) + j(y) catan(z) = -j/2 * log( (j+z) / (j-z) ) catan(z) = 0.5 * atan(2*x,1-(x^2)-(y^2)) + j*0.25*(log((x^2)+(y+1)^2) - log((x^2)+(y-1)^2))
IMPLEMENTATION for APEnext: implem (catan)

VERSION

Id
complex.h,v 1.31 2005/11/10 19:28:30 morinl Exp


ISO/IEC 9899:1999 (E) Standard

Author:
K. Huebner, M. Prevot

math_inline complex catanh complex  z  ) 
 

NAME
catanh - complex arc hyperbolic tangent
SYNOPSIS
#include <complex.h>
complex catanh(complex)

DESCRIPTION
The catanh() function computes the complex arc hyperbolic tangent, with a branch cuts outside the interval [-1, +1] along the real axis.
RETURN VALUE
catanh() function returns 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.
NOTES
z = (x) + j(y) catanh(z) = 0.5 * clog((1+z)/(1-z)) catanh(z) = 0.25 * (log( (y^2)+(1+x)^2 ) - log( (y^2)+(1-x)^2 )) + j * 0.5 * atan(2*y,(1-(x^2)-(y^2))
IMPLEMENTATION for APEnext: implem (catanh)

VERSION

Id
complex.h,v 1.31 2005/11/10 19:28:30 morinl Exp


ISO/IEC 9899:1999 (E) Standard

Author:
K. Huebner, M. Prevot

math_inline complex ccos complex  z  ) 
 

NAME
ccos - complex cosine
SYNOPSIS
#include <complex.h>
complex ccos(complex)

DESCRIPTION
The ccos() function computes complex double precision cosine complex argument
RETURN VALUE
The ccos() function returns the complex cosine value.
NOTES
z =(x) + j(y) ccos(z) = ccosh(j*z)
IMPLEMENTATION for APEnext: implem (ccos)

VERSION

ISO/IEC 9899:1999 (E) Standard

Author:
K. Huebner, M. Prevot

math_inline complex ccosh complex  z  ) 
 

NAME
ccosh - complex hyperbolic cosine
SYNOPSIS
#include <complex.h>
complex ccosh(complex)

DESCRIPTION
The ccosh() function computes the complex hyperbolic cosine
RETURN VALUE
The ccosh() function returnes complex hyperbolic cosine value
NOTES
z = (x) + j(y) ccosh(z) = cosh(x) * cos(y) + j * sinh(x) * sin(y)
IMPLEMENTATION for APEnext: implem (ccosh)

VERSION

Id
complex.h,v 1.31 2005/11/10 19:28:30 morinl Exp


ISO/IEC 9899:1999 (E) Standard

Author:
K. Huebner, M. Prevot

math_inline complex cexp complex  z  ) 
 

NAME
cexp() - exponential function
SYNOPSIS
#include <complex.h>
complex cexp(complex)

DESCRIPTION
cexp() computes the complex exponent, defined as e^(argument).
RETURN VALUE
The cexp() function returnes complex exponential of argument
NOTES
z = (x) + j(y) cexp(z) = exp(x) * (cos(y) + j*sin(y))
IMPLEMENTATION for APEnext: implem (cexp)

VERSION

Id
complex.h,v 1.31 2005/11/10 19:28:30 morinl Exp


ISO/IEC 9899:1999 (E) Standard

Author:
K. Huebner, M. Prevot

math_inline double cinfty void   ) 
 

math_inline complex clog complex  z  ) 
 

NAME
clog() - complex natural logarithm
SYNOPSIS
#include <complex.h>
complex clog(complex)

DESCRIPTION
clog() computes the complex natural (base e) logarithm of argument, with a branch cut along the negative real axis.
RETURN VALUE
The clog() function returns 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.
NOTES
z = (x) + j(y) clog(z) = log(hypot(x,y)) + j*atan2(y,x)
IMPLEMENTATION for APEnext: implem (clog)

VERSION

Id
complex.h,v 1.31 2005/11/10 19:28:30 morinl Exp


ISO/IEC 9899:1999 (E) Standard

Author:
K. Huebner, M. Prevot

math_inline double cnan void   ) 
 

math_inline complex cpow complex  x,
complex  y
 

NAME
cpow() - complex power
SYNOPSIS
#include <complex.h>
complex cpow(complex x, complex y)

DESCRIPTION
cpow() computes the complex power function x to the power of y, with a branch cut for the first parameter along the negative real axis.
RETURN VALUE
The cpow() function return complex power function value
NOTES
z = (x) + j(y) cpow(x,y) = cexp(y*clog(x))
IMPLEMENTATION for APEnext: implem (cpow)

VERSION

Id
complex.h,v 1.31 2005/11/10 19:28:30 morinl Exp


ISO/IEC 9899:1999 (E) Standard

Author:
K. Huebner, M. Prevot

math_inline complex cproj complex  z  ) 
 

NAME
cproj() - complex projection function
SYNOPSIS
#include <complex.h>
complex cproj(complex)

DESCRIPTION
Double precision complex of the projection of the double complex argument
RETURN VALUE
The cproj() function computes a projection of z onto the Riemann sphere: Argument projects to argument, except that all complex infinities (even those with one infinite part and one NaN part) project to positive infinity on the real axis. If argument has an infinite part, then cproj(argument) shall be equivalent to: INFINITY + I * copysign(0.0, cimag(argument))
NOTES
z = (x) + j(y) cproj(z) = (2.0 * z) / (~z*z + 1.0)
IMPLEMENTATION for APEnext: implem (cproj)

VERSION

Id
complex.h,v 1.31 2005/11/10 19:28:30 morinl Exp


ISO/IEC 9899:1999 (E) Standard

Author:
K. Huebner, M. Prevot

math_inline complex csin complex  z  ) 
 

NAME
csin - complex sine
SYNOPSIS
#include <complex.h>
complex csin(complex)

DESCRIPTION
The csin() function computes complex double precision sine complex argument
RETURN VALUE
The csin() function returns the complex sine value.
NOTES
z = (x) + j(y) csin(z) = cosh(y) * sin(x) + j * sinh(y) * cos(x)
IMPLEMENTATION for APEnext: implem (csin)

VERSION

ISO/IEC 9899:1999 (E) Standard

Author:
K. Huebner, M. Prevot

math_inline complex csinh complex  z  ) 
 

NAME
csinh - complex hyperbolic sine
SYNOPSIS
#include <complex.h>
complex csinh(complex)

DESCRIPTION
The csinh() function computes the complex hyperbolic sine
RETURN VALUE
The csinh() function returnes complex hyperbolic sine value
NOTES
z = (x) + j(y) csinh(z) = sinh(x) * cos(y) + j * cosh(x) * sin(y)
IMPLEMENTATION for APEnext: impelm (csinh)

VERSION

Id
complex.h,v 1.31 2005/11/10 19:28:30 morinl Exp


ISO/IEC 9899:1999 (E) Standard

Author:
K. Huebner, M. Prevot

math_inline complex csqrt complex  z  ) 
 

NAME
csqrt() - square root
SYNOPSIS
#include <complex.h>
complex csqrt(complex)

DESCRIPTION
csqrt() computes complex double precision square root of argument, with a branch cut along the negative real axis.
RETURN VALUE
The sqrt() function returns the complex square root value, in the range of the right half-plane (including the imaginary axis)
NOTES
z = (x) + j(y) csqrt(z) = sqrt(0.5*(cabs(z)+x)) + j*(y/abs(y))*sqrt(0.5*(cabs(z)-x))
r = sqrt(0.5 * (abs(x) + cabs(z)) q = (0.5 * y) / r where(x >= 0) csqrt(z) = r + j*q where(x < 0 && y >= 0) csqrt(z) = q + j*r where(x < 0 && y < 0) csqrt(z) = -q + j*r

IMPLEMENTATION for APEnext: implem (csqrt)

VERSION

Id
complex.h,v 1.31 2005/11/10 19:28:30 morinl Exp


ISO/IEC 9899:1999 (E) Standard

Author:
K. Huebner, M. Prevot

math_inline complex ctan complex  z  ) 
 

NAME
ctan - complex tangent
SYNOPSIS
#include <complex.h>
complex ctan(complex)

DESCRIPTION
The ctan() function computes complex double precision tangent of complex argument
RETURN VALUE
The ctan() function returns the complex tangent value.
NOTES
z = (x) + j(y) ctan(z) = (sin(2*x) + j*sinh(2*y)) / (cos(2*x) + cosh(2*y)) when (CCOS(z) = 0 + j0) ctan(z)= MAX_POS_DBLF + j0 else ctan (z) = CSIN(z) / CCOS(z)
IMPLEMENTATION for APEnext: implem (ctan)

VERSION

Id
complex.h,v 1.31 2005/11/10 19:28:30 morinl Exp


ISO/IEC 9899:1999 (E) Standard

Author:
K. Huebner, M. Prevot

math_inline complex ctanh complex  z  ) 
 

NAME
ctanh - complex hyperbolic tangent
SYNOPSIS
#include <complex.h>
complex ctanh(complex)

DESCRIPTION
The ctanh() function computes the complex hyperbolic tangent
RETURN VALUE
The ctanh() function returnes complex hyperbolic tangent value
NOTES
z = (x) + j(y) ctanh(z) = (sinh(2*x) + j * sin(2*y)) / (cosh(2*x) + cos(2*y))
IMPLEMENTATION for APEnext: implem (ctanh)

VERSION

Id
complex.h,v 1.31 2005/11/10 19:28:30 morinl Exp


ISO/IEC 9899:1999 (E) Standard

Author:
K. Huebner, M. Prevot

math_inline complex sincos double  x  ) 
 

math_inline complex sinhcosh double  x  ) 
 


Generated on Fri Jul 14 10:51:37 2006 for nlibc by doxygen 1.3.5