Optimizations to the `exponent_max` function used in d-marg
Made two optimizations to the exponent_max
function used in distance marginalization:
-
Saved unnecessary data copying when creating the clipped version of
x0
by switching to NumPy/Cupy'sclip
function. -
Distributed the factor of
0.5
in the return value. This turns twoconst * array
operations (0.5*b
and2.*x0
) into one (0.5*x0_expmax
).