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




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a
Results
| Original | 2.2 |
|---|---|
| Target | 0.3 |
| Herbie | 0.3 |
Initial program 2.2
rmApplied associate-/r/_binary64_155270.3
rmApplied div-sub_binary64_155840.3
Final simplification0.3
herbie shell --seed 2020281
(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))))