\frac{x + y \cdot \left(z - x\right)}{z}y + \left(\frac{x}{z} - y \cdot \frac{x}{z}\right)double code(double x, double y, double z) {
return (((double) (x + ((double) (y * ((double) (z - x)))))) / z);
}
double code(double x, double y, double z) {
return ((double) (y + ((double) ((x / z) - ((double) (y * (x / z)))))));
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 10.6 |
|---|---|
| Target | 0.0 |
| Herbie | 0.0 |
Initial program 10.6
Simplified3.7
rmApplied add-cube-cbrt4.3
Applied *-un-lft-identity4.3
Applied times-frac4.3
Applied associate-*r*1.5
Simplified1.5
Taylor expanded around 0 3.6
Simplified0.0
Final simplification0.0
herbie shell --seed 2020182
(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))