x - \frac{y - z}{\frac{\left(t - z\right) + 1}{a}}\begin{array}{l}
\mathbf{if}\;\frac{y - z}{\frac{\left(t - z\right) + 1}{a}} \leq -3.974157082765867 \cdot 10^{-28}:\\
\;\;\;\;x - \left(y - z\right) \cdot \frac{a}{\left(t - z\right) + 1}\\
\mathbf{elif}\;\frac{y - z}{\frac{\left(t - z\right) + 1}{a}} \leq 1.2519181265166545 \cdot 10^{-136}:\\
\;\;\;\;x - \frac{\left(y - z\right) \cdot a}{\left(t - z\right) + 1}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y - z}{\frac{\left(t - z\right) + 1}{a}}\\
\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
(if (<= (/ (- y z) (/ (+ (- t z) 1.0) a)) -3.974157082765867e-28)
(- x (* (- y z) (/ a (+ (- t z) 1.0))))
(if (<= (/ (- y z) (/ (+ (- t z) 1.0) a)) 1.2519181265166545e-136)
(- x (/ (* (- y z) a) (+ (- t z) 1.0)))
(- x (/ (- y 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) {
double tmp;
if (((y - z) / (((t - z) + 1.0) / a)) <= -3.974157082765867e-28) {
tmp = x - ((y - z) * (a / ((t - z) + 1.0)));
} else if (((y - z) / (((t - z) + 1.0) / a)) <= 1.2519181265166545e-136) {
tmp = x - (((y - z) * a) / ((t - z) + 1.0));
} else {
tmp = x - ((y - z) / (((t - z) + 1.0) / a));
}
return tmp;
}

















Bits error versus x

















Bits error versus y

















Bits error versus z

















Bits error versus t

















Bits error versus a
Results
| Original | 2.0 |
|---|---|
| Target | 0.3 |
| Herbie | 0.1 |
| Alternative 1 | |
|---|---|
| Error | 0.3 |
| Cost | 832 |
| Alternative 2 | |
|---|---|
| Error | 0.1 |
| Cost | 1160 |
| Alternative 3 | |
|---|---|
| Error | 1.8 |
| Cost | 832 |
| Alternative 4 | |
|---|---|
| Error | 6.5 |
| Cost | 1032 |
| Alternative 5 | |
|---|---|
| Error | 4.6 |
| Cost | 1032 |
| Alternative 6 | |
|---|---|
| Error | 6.6 |
| Cost | 1032 |
| Alternative 7 | |
|---|---|
| Error | 8.2 |
| Cost | 1032 |
| Alternative 8 | |
|---|---|
| Error | 8.4 |
| Cost | 968 |
| Alternative 9 | |
|---|---|
| Error | 8.3 |
| Cost | 904 |
| Alternative 10 | |
|---|---|
| Error | 9.5 |
| Cost | 904 |
| Alternative 11 | |
|---|---|
| Error | 23.3 |
| Cost | 192 |
| Alternative 12 | |
|---|---|
| Error | 61.8 |
| Cost | 64 |
| Alternative 13 | |
|---|---|
| Error | 61.8 |
| Cost | 64 |

if (/.f64 (-.f64 y z) (/.f64 (+.f64 (-.f64 t z) 1) a)) < -3.9741570827658671e-28Initial program 0.2
rmApplied associate-/r/_binary64_167330.1
rmApplied div-inv_binary64_167840.2
Applied associate-*l*_binary64_167280.2
Simplified0.1
Simplified0.1
if -3.9741570827658671e-28 < (/.f64 (-.f64 y z) (/.f64 (+.f64 (-.f64 t z) 1) a)) < 1.25191812651665447e-136Initial program 4.2
rmApplied associate-/r/_binary64_167330.3
rmApplied associate-*l/_binary64_167300.0
Simplified0.0
if 1.25191812651665447e-136 < (/.f64 (-.f64 y z) (/.f64 (+.f64 (-.f64 t z) 1) a)) Initial program 0.1
Simplified0.1
Final simplification0.1
herbie shell --seed 2021044
(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))))