x \cdot \left(1 - \left(1 - y\right) \cdot z\right)
\begin{array}{l}
\mathbf{if}\;z \le -9.72485590525483529 \cdot 10^{90} \lor \neg \left(z \le 9.54165339358683283 \cdot 10^{57}\right):\\
\;\;\;\;x \cdot 1 + \left(x \cdot z\right) \cdot \left(y - 1\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 1 + \left(x \cdot \left(z \cdot y\right) + \left(x \cdot z\right) \cdot \left(-1\right)\right)\\
\end{array}double code(double x, double y, double z) {
return ((double) (x * ((double) (1.0 - ((double) (((double) (1.0 - y)) * z))))));
}
double code(double x, double y, double z) {
double VAR;
if (((z <= -9.724855905254835e+90) || !(z <= 9.541653393586833e+57))) {
VAR = ((double) (((double) (x * 1.0)) + ((double) (((double) (x * z)) * ((double) (y - 1.0))))));
} else {
VAR = ((double) (((double) (x * 1.0)) + ((double) (((double) (x * ((double) (z * y)))) + ((double) (((double) (x * z)) * ((double) -(1.0))))))));
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 3.4 |
|---|---|
| Target | 0.2 |
| Herbie | 0.4 |
if z < -9.724855905254835e+90 or 9.541653393586833e+57 < z Initial program 11.4
rmApplied sub-neg11.4
Applied distribute-lft-in11.4
Simplified0.1
if -9.724855905254835e+90 < z < 9.541653393586833e+57Initial program 0.5
rmApplied sub-neg0.5
Applied distribute-lft-in0.5
Simplified2.2
rmApplied sub-neg2.2
Applied distribute-lft-in2.2
Simplified0.5
Final simplification0.4
herbie shell --seed 2020123
(FPCore (x y z)
:name "Data.Colour.RGBSpace.HSV:hsv from colour-2.3.3, J"
:precision binary64
:herbie-target
(if (< (* x (- 1 (* (- 1 y) z))) -1.618195973607049e+50) (+ x (* (- 1 y) (* (- z) x))) (if (< (* x (- 1 (* (- 1 y) z))) 3.892237649663903e+134) (- (* (* x y) z) (- (* x z) x)) (+ x (* (- 1 y) (* (- z) x)))))
(* x (- 1 (* (- 1 y) z))))