x - \frac{y - z}{\frac{\left(t - z\right) + 1}{a}}
\begin{array}{l}
t_1 := \left(1 + t\right) - z\\
x - a \cdot \left(\frac{y}{t_1} - \frac{z}{t_1}\right)
\end{array}
(FPCore (x y z t a) :precision binary64 (- x (/ (- y z) (/ (+ (- t z) 1.0) a))))
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (- (+ 1.0 t) z))) (- x (* a (- (/ y t_1) (/ z t_1))))))
double code(double x, double y, double z, double t, double a) {
return x - ((y - z) / (((t - z) + 1.0) / a));
}
double code(double x, double y, double z, double t, double a) {
double t_1 = (1.0 + t) - z;
return x - (a * ((y / t_1) - (z / t_1)));
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a
Results
| Original | 1.8 |
|---|---|
| Target | 0.2 |
| Herbie | 0.2 |
Initial program 1.8
Applied egg-rr0.2
Taylor expanded in y around 0 0.2
Final simplification0.2
herbie shell --seed 2022130
(FPCore (x y z t a)
:name "Graphics.Rendering.Chart.SparkLine:renderSparkLine from Chart-1.5.3"
:precision binary64
:herbie-target
(- x (* (/ (- y z) (+ (- t z) 1.0)) a))
(- x (/ (- y z) (/ (+ (- t z) 1.0) a))))