double code(double x, double y, double z) {
return ((double) (((double) (x + ((double) (y * ((double) (z - x)))))) / z));
}
double code(double x, double y, double z) {
return ((double) (y + ((double) (((double) (1.0 - y)) * ((double) (x / z))))));
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 10.5 |
|---|---|
| Target | 0.0 |
| Herbie | 0.0 |
Initial program 10.5
Simplified3.6
rmApplied add-sqr-sqrt33.9
Applied associate-*l*33.9
Simplified32.8
rmApplied pow132.8
Applied pow132.8
Applied pow-prod-down32.8
Applied pow132.8
Applied pow-prod-down32.8
Simplified0.0
Final simplification0.0
herbie shell --seed 2020190
(FPCore (x y z)
:name "Diagrams.Backend.Rasterific:rasterificRadialGradient from diagrams-rasterific-1.3.1.3"
:precision binary64
:herbie-target
(- (+ y (/ x z)) (/ y (/ z x)))
(/ (+ x (* y (- z x))) z))