Skip to content

Latest commit

 

History

History
63 lines (41 loc) · 1.08 KB

exp.md

File metadata and controls

63 lines (41 loc) · 1.08 KB

exp

Compute the exponential of every element using a selectable variant.

API

Numeric.math.exp(value, method)

Applies an exponential variant across nested inputs.

  • Parameters:
    • value: Scalar, vector, or matrix input values
    • method: Exponential variant to apply to each element
  • Returns: Exponentials matching the input nesting shape
  • NumPy: Covers np.exp, np.exp2, np.expm1 through a single Numerix method.

Examples

Exponential of a scalar

import Numeric from '@neabyte/numerix'

const value = Numeric.math.exp(1)

console.log(value)
// 2.718281828459045

Exponentials of a vector

import Numeric from '@neabyte/numerix'

const values = Numeric.math.exp([0, 1])

console.log(values)
// [1,2.718281828459045]

Base two exponential variant

import Numeric from '@neabyte/numerix'

const values = Numeric.math.exp([0, 1, 2], '2')

console.log(values)
// [1,2,4]

Exponent minus one variant

import Numeric from '@neabyte/numerix'

const value = Numeric.math.exp(1, 'm1')

console.log(value)
// 1.7182818284590453