Exponential functions

Floating point special functions about a point.

boring_math.special_functions.exponential.exp.exp0(x: float, /, n: int = mindepth) float

Partially factored Taylor expansion of exp about x = 0.

Note

Best if -1 <= x <= 1 for n >= 22.

Parameters:
  • x – Independent variable.

  • n – Terms in expansion, must have n >= 2.

Returns:

Taylor series expansion of centered at x = 0.

boring_math.special_functions.exponential.exp.exp(x: float, /, n: int = mindepth) float

Exponential function good for all floating point x.

Parameters:
  • x – Independent variable.

  • n – Terms in expansion, must have n >= 2.

Returns:

Value of otherwise nan if x = nan.

boring_math.special_functions.exponential.exp.cexp0(z: complex, /, n: int = mindepth) complex

Partially factored Taylor expansion of exp about z = 0.

Note

Best if |z| <= 1 and n >= 22.

Parameters:
  • z – independent variable

  • n – terms in expansion, must have n >= 2

Returns:

Taylor series expansion of eᶻ centered at z = 0

boring_math.special_functions.exponential.exp.cexp(z: complex, /, n: int = mindepth) complex

Exponential function good for all complex z.

Note

Complex exp(z) has an essential singularity at infinity. If given an infinite argument, phase information is given in the returned possibly infinite value consistent the Python stdlib cmath.exp function.

Parameters:
  • z – independent variable

  • n – terms in expansion, must have n >= 2

Returns:

Value of eᶻ where inf is returned when re(z) = inf.

Raises:

ValueError – When z is infinite but re(z) is not.