\frac{x + y \cdot \left(z - x\right)}{z}
\left(y + \frac{x}{z}\right) - \frac{1}{\frac{\frac{z}{x}}{y}}
(FPCore (x y z) :precision binary64 (/ (+ x (* y (- z x))) z))
(FPCore (x y z) :precision binary64 (- (+ y (/ x z)) (/ 1.0 (/ (/ z x) y))))
double code(double x, double y, double z) {
return (x + (y * (z - x))) / z;
}
double code(double x, double y, double z) {
return (y + (x / z)) - (1.0 / ((z / x) / y));
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 10.3 |
|---|---|
| Target | 0.0 |
| Herbie | 0.1 |
Initial program 10.3
Simplified10.3
Taylor expanded in y around 0 3.5
Applied associate-/l*_binary640.0
Applied clear-num_binary640.1
Final simplification0.1
herbie shell --seed 2021313
(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))