(FPCore (x y z) :precision binary64 (/ (- x y) (- z y)))
(FPCore (x y z) :precision binary64 (let* ((t_0 (/ y (- z y)))) (+ (- (/ x (- z y)) t_0) (fma (- t_0) 1.0 t_0))))
double code(double x, double y, double z) {
return (x - y) / (z - y);
}
double code(double x, double y, double z) {
double t_0 = y / (z - y);
return ((x / (z - y)) - t_0) + fma(-t_0, 1.0, t_0);
}
function code(x, y, z) return Float64(Float64(x - y) / Float64(z - y)) end
function code(x, y, z) t_0 = Float64(y / Float64(z - y)) return Float64(Float64(Float64(x / Float64(z - y)) - t_0) + fma(Float64(-t_0), 1.0, t_0)) end
code[x_, y_, z_] := N[(N[(x - y), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]
code[x_, y_, z_] := Block[{t$95$0 = N[(y / N[(z - y), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[(x / N[(z - y), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision] + N[((-t$95$0) * 1.0 + t$95$0), $MachinePrecision]), $MachinePrecision]]
\frac{x - y}{z - y}
\begin{array}{l}
t_0 := \frac{y}{z - y}\\
\left(\frac{x}{z - y} - t_0\right) + \mathsf{fma}\left(-t_0, 1, t_0\right)
\end{array}




Bits error versus x




Bits error versus y




Bits error versus z
| Original | 0.0 |
|---|---|
| Target | 0.0 |
| Herbie | 0.0 |
Initial program 0.0
Applied egg-rr0.0
Final simplification0.0
herbie shell --seed 2022133
(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)))