\frac{x - y}{z - y}\frac{x}{z - y} - y \cdot \frac{1}{z - y}double code(double x, double y, double z) {
return ((x - y) / (z - y));
}
double code(double x, double y, double z) {
return ((x / (z - y)) - (y * (1.0 / (z - y))));
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 0.0 |
|---|---|
| Target | 0.0 |
| Herbie | 0.1 |
Initial program 0.0
rmApplied div-sub0.0
rmApplied div-inv0.1
Final simplification0.1
herbie shell --seed 2020053
(FPCore (x y z)
:name "Graphics.Rasterific.Shading:$sgradientColorAt from Rasterific-0.6.1"
:precision binary64
:herbie-target
(- (/ x (- z y)) (/ y (- z y)))
(/ (- x y) (- z y)))