\[\begin{array}{l}
t_1 := \frac{x \cdot y - z \cdot t}{a}\\
\mathbf{if}\;t_1 \leq -\infty:\\
\;\;\;\;\frac{x}{\frac{a}{y}} - \frac{z}{\frac{a}{t}}\\
\mathbf{elif}\;t_1 \leq 5 \cdot 10^{+305}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, y, z \cdot \left(-t\right)\right)}{a}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-1, \frac{t}{\frac{a}{z}}, \frac{y}{\frac{a}{x}}\right)\\
\end{array}
\]
(FPCore (x y z t a) :precision binary64 (/ (- (* x y) (* z t)) a))
↓
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- (* x y) (* z t)) a)))
(if (<= t_1 (- INFINITY))
(- (/ x (/ a y)) (/ z (/ a t)))
(if (<= t_1 5e+305)
(/ (fma x y (* z (- t))) a)
(fma -1.0 (/ t (/ a z)) (/ y (/ a x)))))))
double code(double x, double y, double z, double t, double a) {
return ((x * y) - (z * t)) / a;
}
↓
double code(double x, double y, double z, double t, double a) {
double t_1 = ((x * y) - (z * t)) / a;
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = (x / (a / y)) - (z / (a / t));
} else if (t_1 <= 5e+305) {
tmp = fma(x, y, (z * -t)) / a;
} else {
tmp = fma(-1.0, (t / (a / z)), (y / (a / x)));
}
return tmp;
}
function code(x, y, z, t, a)
return Float64(Float64(Float64(x * y) - Float64(z * t)) / a)
end
↓
function code(x, y, z, t, a)
t_1 = Float64(Float64(Float64(x * y) - Float64(z * t)) / a)
tmp = 0.0
if (t_1 <= Float64(-Inf))
tmp = Float64(Float64(x / Float64(a / y)) - Float64(z / Float64(a / t)));
elseif (t_1 <= 5e+305)
tmp = Float64(fma(x, y, Float64(z * Float64(-t))) / a);
else
tmp = fma(-1.0, Float64(t / Float64(a / z)), Float64(y / Float64(a / x)));
end
return tmp
end
herbie shell --seed 2023054
(FPCore (x y z t a)
:name "Data.Colour.Matrix:inverse from colour-2.3.3, B"
:precision binary64
:herbie-target
(if (< z -2.468684968699548e+170) (- (* (/ y a) x) (* (/ t a) z)) (if (< z 6.309831121978371e-71) (/ (- (* x y) (* z t)) a) (- (* (/ y a) x) (* (/ t a) z))))
(/ (- (* x y) (* z t)) a))