IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /max/get-started.md). For the complete documentation index, see llms.txt.
Skip to main content
For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /max/get-started.md).

Mojo function

exp2_emulation

def exp2_emulation[use_exp2_emulation: Bool = True](x: SIMD[DType.float32, SIMDLength(2)]) -> SIMD[DType.float32, SIMDLength(2)]

Computes 2^x for an f32x2 vector via a degree-3 polynomial approximation.

When use_exp2_emulation is False, falls back to the standard exp2 intrinsic.

Returns:

SIMD[DType.float32, SIMDLength(2)]

Was this page helpful?