Exponential functions

Exponential function

Complex and real valued implementations of the exponential function.

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

Real exponential function about x = 0

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

Real exponential function about x = 0.

Valid for extended value floating point arguments.

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

Complex exponential function about z = 0.

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.

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.