\frac{x - y}{z - y}\mathsf{fma}\left(x, \frac{1}{z - y}, -\frac{y}{z - y}\right)double f(double x, double y, double z) {
double r555049 = x;
double r555050 = y;
double r555051 = r555049 - r555050;
double r555052 = z;
double r555053 = r555052 - r555050;
double r555054 = r555051 / r555053;
return r555054;
}
double f(double x, double y, double z) {
double r555055 = x;
double r555056 = 1.0;
double r555057 = z;
double r555058 = y;
double r555059 = r555057 - r555058;
double r555060 = r555056 / r555059;
double r555061 = r555058 / r555059;
double r555062 = -r555061;
double r555063 = fma(r555055, r555060, r555062);
return r555063;
}




Bits error versus x




Bits error versus y




Bits error versus z
| Original | 0.0 |
|---|---|
| Target | 0.0 |
| Herbie | 0.1 |
Initial program 0.0
rmApplied div-sub0.0
rmApplied div-inv0.1
Applied fma-neg0.1
Final simplification0.1
herbie shell --seed 2020062 +o rules:numerics
(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)))