x - \frac{y - z}{\frac{\left(t - z\right) + 1}{a}}x - \frac{1}{\frac{\left(t - z\right) + 1}{y - z}} \cdot adouble 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) {
return (x - ((1.0 / (((t - z) + 1.0) / (y - z))) * a));
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a
Results
| Original | 1.9 |
|---|---|
| Target | 0.2 |
| Herbie | 0.3 |
Initial program 1.9
rmApplied associate-/r/0.2
rmApplied clear-num0.3
Final simplification0.3
herbie shell --seed 2020057 +o rules:numerics
(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)) a))
(- x (/ (- y z) (/ (+ (- t z) 1) a))))