x + \frac{\left(y - z\right) \cdot t}{a - z}\begin{array}{l}
\mathbf{if}\;z \leq -2.0367736854431388 \cdot 10^{+80} \lor \neg \left(z \leq 2.8021645666856244 \cdot 10^{-103}\right):\\
\;\;\;\;x + t \cdot \frac{y - z}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x + \left(t \cdot y - z \cdot t\right) \cdot \frac{1}{a - z}\\
\end{array}(FPCore (x y z t a) :precision binary64 (+ x (/ (* (- y z) t) (- a z))))
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.0367736854431388e+80) (not (<= z 2.8021645666856244e-103))) (+ x (* t (/ (- y z) (- a z)))) (+ x (* (- (* t y) (* z t)) (/ 1.0 (- a z))))))
double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * t) / (a - z));
}
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.0367736854431388e+80) || !(z <= 2.8021645666856244e-103)) {
tmp = x + (t * ((y - z) / (a - z)));
} else {
tmp = x + (((t * y) - (z * t)) * (1.0 / (a - z)));
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a
Results
| Original | 10.6 |
|---|---|
| Target | 0.6 |
| Herbie | 1.9 |
if z < -2.03677368544313876e80 or 2.8021645666856244e-103 < z Initial program 16.3
Taylor expanded around 0 16.3
Simplified0.3
if -2.03677368544313876e80 < z < 2.8021645666856244e-103Initial program 3.9
rmApplied *-un-lft-identity_binary64_178103.9
Applied times-frac_binary64_178162.8
Simplified2.8
rmApplied div-inv_binary64_178072.8
Applied associate-*r*_binary64_177503.9
Simplified3.9
rmApplied sub-neg_binary64_178033.9
Applied distribute-rgt-in_binary64_177603.9
Simplified3.9
Simplified3.9
Final simplification1.9
herbie shell --seed 2021096
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTick from plot-0.2.3.4, A"
:precision binary64
:herbie-target
(if (< t -1.0682974490174067e-39) (+ x (* (/ (- y z) (- a z)) t)) (if (< t 3.9110949887586375e-141) (+ x (/ (* (- y z) t) (- a z))) (+ x (* (/ (- y z) (- a z)) t))))
(+ x (/ (* (- y z) t) (- a z))))