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




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 10.1 |
|---|---|
| Target | 0.0 |
| Herbie | 3.5 |
Initial program 10.1
rmApplied clear-num_binary6410.3
Taylor expanded around 0 3.5
Simplified3.5
Final simplification3.5
herbie shell --seed 2020224
(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))