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 (((((double) (((double) (1.0 - y)) * z)) <= -3.2249253961681566e+196) || !(((double) (((double) (1.0 - y)) * z)) <= 7.300248578649677e+174))) {
VAR = ((double) (((double) (1.0 * x)) + ((double) (((double) (z * x)) * ((double) (y - 1.0))))));
} else {
VAR = ((double) (((double) (1.0 * x)) + ((double) (x * ((double) (((double) (y * z)) - ((double) (1.0 * z))))))));
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 3.4 |
|---|---|
| Target | 0.3 |
| Herbie | 0.1 |
if (* (- 1.0 y) z) < -3.22492539616815657e196 or 7.300248578649677e174 < (* (- 1.0 y) z) Initial program 16.3
rmApplied sub-neg16.3
Applied distribute-lft-in16.3
Simplified16.3
rmApplied associate-*r*0.5
if -3.22492539616815657e196 < (* (- 1.0 y) z) < 7.300248578649677e174Initial program 0.1
rmApplied sub-neg0.1
Applied distribute-lft-in0.1
Simplified0.1
rmApplied sub-neg0.1
Applied distribute-lft-in0.1
Final simplification0.1
herbie shell --seed 2020192
(FPCore (x y z)
:name "Data.Colour.RGBSpace.HSV:hsv from colour-2.3.3, J"
:precision binary64
:herbie-target
(if (< (* x (- 1.0 (* (- 1.0 y) z))) -1.618195973607049e+50) (+ x (* (- 1.0 y) (* (neg z) x))) (if (< (* x (- 1.0 (* (- 1.0 y) z))) 3.892237649663903e+134) (- (* (* x y) z) (- (* x z) x)) (+ x (* (- 1.0 y) (* (neg z) x)))))
(* x (- 1.0 (* (- 1.0 y) z))))