x + y \cdot \frac{z - t}{z - a}\begin{array}{l}
\mathbf{if}\;\frac{z - t}{z - a} \leq -2.119372169535663 \cdot 10^{+192}:\\
\;\;\;\;x + \left(z - t\right) \cdot \frac{y}{z - a}\\
\mathbf{elif}\;\frac{z - t}{z - a} \leq 1.9335633529579097 \cdot 10^{+172}:\\
\;\;\;\;x + \frac{z - t}{z - a} \cdot y\\
\mathbf{else}:\\
\;\;\;\;x + \left(\left(z - t\right) \cdot y\right) \cdot \frac{1}{z - a}\\
\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 (<= (/ (- z t) (- z a)) -2.119372169535663e+192)
(+ x (* (- z t) (/ y (- z a))))
(if (<= (/ (- z t) (- z a)) 1.9335633529579097e+172)
(+ x (* (/ (- z t) (- z a)) y))
(+ x (* (* (- z t) y) (/ 1.0 (- z a)))))))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 (((((double) (z - t)) / ((double) (z - a))) <= -2.119372169535663e+192)) {
tmp = ((double) (x + ((double) (((double) (z - t)) * (y / ((double) (z - a)))))));
} else {
double tmp_1;
if (((((double) (z - t)) / ((double) (z - a))) <= 1.9335633529579097e+172)) {
tmp_1 = ((double) (x + ((double) ((((double) (z - t)) / ((double) (z - a))) * y))));
} else {
tmp_1 = ((double) (x + ((double) (((double) (((double) (z - t)) * y)) * (1.0 / ((double) (z - a)))))));
}
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.2 |
|---|---|
| Target | 1.1 |
| Herbie | 0.4 |
if (/ (- z t) (- z a)) < -2.1193721695356629e192Initial program Error: 14.4 bits
rmApplied clear-numError: 14.4 bits
rmApplied associate-/r/Error: 14.4 bits
Applied associate-*r*Error: 0.5 bits
SimplifiedError: 0.5 bits
if -2.1193721695356629e192 < (/ (- z t) (- z a)) < 1.9335633529579097e172Initial program Error: 0.3 bits
if 1.9335633529579097e172 < (/ (- z t) (- z a)) Initial program Error: 14.6 bits
rmApplied div-invError: 14.7 bits
Applied associate-*r*Error: 2.6 bits
Final simplificationError: 0.4 bits
herbie shell --seed 2020203
(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)))))