def exponential_scale
import stelliferous@0.0.2.0/math_fp32.bend as MathFp32import Base
119# Split 2^n at +64 for nonnegative inputs and -64 for negative inputs.
120# The first product is always normal and exact; only the last product can
121# underflow. The exponent words come directly from the biased integer n.
122def exponential_scale(biased: F32,x: F32,p: F32) -> F32:
123 +sign = U32.shrn(U32.and(F32.bits(x),2147483648),1n)
124 ((p * from_bits((1602224128 - sign : U32)) : F32) *
125 from_bits((528482304 + U32.shln(F32.bits(biased),23n) + sign : U32)) : F32)