(FPCore (x y z) :precision binary64 (* x (- 1.0 (* y z))))
(FPCore (x y z) :precision binary64 (if (<= (* y z) -5e+230) (- x (* y (* z x))) (fma (* (* y z) x) -1.0 x)))
double code(double x, double y, double z) {
return x * (1.0 - (y * z));
}
double code(double x, double y, double z) {
double tmp;
if ((y * z) <= -5e+230) {
tmp = x - (y * (z * x));
} else {
tmp = fma(((y * z) * x), -1.0, x);
}
return tmp;
}
function code(x, y, z) return Float64(x * Float64(1.0 - Float64(y * z))) end
function code(x, y, z) tmp = 0.0 if (Float64(y * z) <= -5e+230) tmp = Float64(x - Float64(y * Float64(z * x))); else tmp = fma(Float64(Float64(y * z) * x), -1.0, x); end return tmp end
code[x_, y_, z_] := N[(x * N[(1.0 - N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
code[x_, y_, z_] := If[LessEqual[N[(y * z), $MachinePrecision], -5e+230], N[(x - N[(y * N[(z * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y * z), $MachinePrecision] * x), $MachinePrecision] * -1.0 + x), $MachinePrecision]]
x \cdot \left(1 - y \cdot z\right)
\begin{array}{l}
\mathbf{if}\;y \cdot z \leq -5 \cdot 10^{+230}:\\
\;\;\;\;x - y \cdot \left(z \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\left(y \cdot z\right) \cdot x, -1, x\right)\\
\end{array}



Bits error versus x



Bits error versus y



Bits error versus z
if (*.f64 y z) < -5.0000000000000003e230Initial program 33.4
Taylor expanded in x around 0 33.4
Simplified0.6
Taylor expanded in z around 0 1.0
if -5.0000000000000003e230 < (*.f64 y z) Initial program 2.0
Taylor expanded in y around 0 5.2
Applied egg-rr2.0
Final simplification1.9
herbie shell --seed 2022170
(FPCore (x y z)
:name "Data.Colour.RGBSpace.HSV:hsv from colour-2.3.3, I"
:precision binary64
(* x (- 1.0 (* y z))))