x + y \cdot \frac{z - t}{z - a}\begin{array}{l}
\mathbf{if}\;y \leq -3.273526225016458 \cdot 10^{-300}:\\
\;\;\;\;x + y \cdot \left(\left(z - t\right) \cdot \frac{1}{z - a}\right)\\
\mathbf{elif}\;y \leq 5.14749771507477 \cdot 10^{+22}:\\
\;\;\;\;x + \frac{1}{z - a} \cdot \left(y \cdot \left(z - t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{1}{\frac{z - a}{z - t}}\\
\end{array}(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- z a)))))
(FPCore (x y z t a)
:precision binary64
(if (<= y -3.273526225016458e-300)
(+ x (* y (* (- z t) (/ 1.0 (- z a)))))
(if (<= y 5.14749771507477e+22)
(+ x (* (/ 1.0 (- z a)) (* y (- z t))))
(+ x (* y (/ 1.0 (/ (- z a) (- z t))))))))double code(double x, double y, double z, double t, double a) {
return ((double) (x + ((double) (y * (((double) (z - t)) / ((double) (z - a)))))));
}
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -3.273526225016458e-300)) {
tmp = ((double) (x + ((double) (y * ((double) (((double) (z - t)) * (1.0 / ((double) (z - a)))))))));
} else {
double tmp_1;
if ((y <= 5.14749771507477e+22)) {
tmp_1 = ((double) (x + ((double) ((1.0 / ((double) (z - a))) * ((double) (y * ((double) (z - t))))))));
} else {
tmp_1 = ((double) (x + ((double) (y * (1.0 / (((double) (z - a)) / ((double) (z - t))))))));
}
tmp = tmp_1;
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a
Results
| Original | 1.4 |
|---|---|
| Target | 1.3 |
| Herbie | 0.9 |
if y < -3.2735262250164581e-300Initial program Error: 1.5 bits
rmApplied div-invError: 1.6 bits
if -3.2735262250164581e-300 < y < 5.14749771507476967e22Initial program Error: 2.0 bits
rmApplied div-invError: 2.0 bits
Applied associate-*r*Error: 0.3 bits
if 5.14749771507476967e22 < y Initial program Error: 0.4 bits
rmApplied clear-numError: 0.4 bits
Final simplificationError: 0.9 bits
herbie shell --seed 2020204
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisLine from plot-0.2.3.4, A"
:precision binary64
:herbie-target
(+ x (/ y (/ (- z a) (- z t))))
(+ x (* y (/ (- z t) (- z a)))))