Skip to content

numojo.routines.math.exponents

Exponential routines for NuMojo (numojo.routines.math.exponents).

Provides element-wise exponential and logarithmic transformations for NDArrays.

Aliases

ln

comptime ln

Value: log

Functions

exp

exp[dtype: DType, backend: Backend = Vectorized](array: NDArray[dtype]) -> NDArray[dtype]

Calculate element-wise euler's constant(e) to the power of NDArray[i].

Parameters:

  • dtype (DType): The element type.
  • backend (Backend): Sets utility function origin, defaults to Vectorized.

Args:

  • array (NDArray): A NDArray.

Returns:

  • NDArray

Raises

exp2

exp2[dtype: DType, backend: Backend = Vectorized](array: NDArray[dtype]) -> NDArray[dtype]

Calculate element-wise two to the power of NDArray[i].

Parameters:

  • dtype (DType): The element type.
  • backend (Backend): Sets utility function origin, defaults to Vectorized.

Args:

  • array (NDArray): A NDArray.

Returns:

  • NDArray

Raises

expm1

expm1[dtype: DType, backend: Backend = Vectorized](array: NDArray[dtype]) -> NDArray[dtype]

Calculate element-wise euler's constant(e) to the power of NDArray[i] minus1.

Parameters:

  • dtype (DType): The element type.
  • backend (Backend): Sets utility function origin, defaults to Vectorized.

Args:

  • array (NDArray): A NDArray.

Returns:

  • NDArray

Raises

log

log[dtype: DType, backend: Backend = Vectorized](array: NDArray[dtype]) -> NDArray[dtype]

Element-wise natural logarithm of NDArray.

Parameters:

  • dtype (DType): The element type.
  • backend (Backend): Sets utility function origin, defaults to Vectorized.

Args:

  • array (NDArray): A NDArray.

Returns:

  • NDArray

Raises

log2

log2[dtype: DType, backend: Backend = Vectorized](array: NDArray[dtype]) -> NDArray[dtype]

Element-wise logarithm base two of NDArray.

Parameters:

  • dtype (DType): The element type.
  • backend (Backend): Sets utility function origin, defaults to Vectorized.

Args:

  • array (NDArray): A NDArray.

Returns:

  • NDArray

Raises

log10

log10[dtype: DType, backend: Backend = Vectorized](array: NDArray[dtype]) -> NDArray[dtype]

Element-wise logarithm base ten of NDArray.

Parameters:

  • dtype (DType): The element type.
  • backend (Backend): Sets utility function origin, defaults to Vectorized.

Args:

  • array (NDArray): A NDArray.

Returns:

  • NDArray

Raises

log1p

log1p[dtype: DType, backend: Backend = Vectorized](array: NDArray[dtype]) -> NDArray[dtype]

Element-wise natural logarithm of 1 plus NDArray.

Parameters:

  • dtype (DType): The element type.
  • backend (Backend): Sets utility function origin, defaults to Vectorized.

Args:

  • array (NDArray): A NDArray.

Returns:

  • NDArray

Raises