math

Double-precision math operations backed by HUGR’s arithmetic.math extension.

Trigonometric functions support floats in radians and Guppy angles. Inverse trigonometric functions return floats unless an angle result is required by the surrounding type context. Domain and non-finite results follow the underlying HUGR operations rather than raising Python math exceptions.

Functions

acos(x)

Return the inverse cosine of x as a float in radians or an angle.

asin(x)

Return the inverse sine of x as a float in radians or an angle.

atan(x)

Return the inverse tangent of x as a float in radians or an angle.

atan2(y, x)

Return the four-quadrant inverse tangent of (y, x).

cos(x)

Return the cosine of a float in radians or a Guppy angle.

exp(x)

Return e raised to the power x.

exp2(x)

Return 2 raised to the power x.

fmod(x, y)

Return x - trunc(x / y) * y, with the sign of x.

log(x)

Return the natural logarithm of x.

log2(x)

Return the base-two logarithm of x.

log10(x)

Return the base-ten logarithm of x.

pow(x, y)

Return x raised to the power y.

sin(x)

Return the sine of a float in radians or a Guppy angle.

tan(x)

Return the tangent of a float in radians or a Guppy angle.