x \cdot \left(1 - y \cdot z\right)
\begin{array}{l}
\mathbf{if}\;y \cdot z \leq -3.942509401165715 \cdot 10^{+165}:\\
\;\;\;\;\left(-z\right) \cdot \left(y \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 - y \cdot z\right)\\
\end{array}(FPCore (x y z) :precision binary64 (* x (- 1.0 (* y z))))
(FPCore (x y z) :precision binary64 (if (<= (* y z) -3.942509401165715e+165) (* (- z) (* y x)) (* x (- 1.0 (* y z)))))
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) <= -3.942509401165715e+165) {
tmp = -z * (y * x);
} else {
tmp = x * (1.0 - (y * z));
}
return tmp;
}






Bits error versus x






Bits error versus y






Bits error versus z
Results
| Alternative 1 | |
|---|---|
| Error | 20.0 |
| Cost | 977 |
| Alternative 2 | |
|---|---|
| Error | 21.6 |
| Cost | 977 |
| Alternative 3 | |
|---|---|
| Error | 25.4 |
| Cost | 64 |


if (*.f64 y z) < -3.94250940116571467e165Initial program 19.2
Taylor expanded around inf 19.2
Simplified19.2
rmApplied distribute-rgt-neg-in_binary64_992519.2
Applied associate-*r*_binary64_99072.0
rmApplied *-commutative_binary64_98982.0
Simplified2.0
if -3.94250940116571467e165 < (*.f64 y z) Initial program 1.8
rmApplied *-commutative_binary64_98981.8
Simplified1.8
Final simplification1.8
herbie shell --seed 2021040
(FPCore (x y z)
:name "Data.Colour.RGBSpace.HSV:hsv from colour-2.3.3, I"
:precision binary64
(* x (- 1.0 (* y z))))