x + \frac{\left(y - z\right) \cdot t}{a - z}
\begin{array}{l}
\mathbf{if}\;a \leq -4.362131686997494 \cdot 10^{-102} \lor \neg \left(a \leq -1.726985926064031 \cdot 10^{-268}\right):\\
\;\;\;\;t \cdot \frac{y - z}{a - z} + x\\
\mathbf{else}:\\
\;\;\;\;t + \left(x + \frac{t \cdot y}{a - z}\right)\\
\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 (<= a -4.362131686997494e-102) (not (<= a -1.726985926064031e-268))) (+ (* t (/ (- y z) (- a z))) x) (+ t (+ x (/ (* t y) (- 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 ((a <= -4.362131686997494e-102) || !(a <= -1.726985926064031e-268)) {
tmp = (t * ((y - z) / (a - z))) + x;
} else {
tmp = t + (x + ((t * y) / (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.7 |
|---|---|
| Target | 0.6 |
| Herbie | 1.7 |
if a < -4.36213168699749418e-102 or -1.7269859260640311e-268 < a Initial program 10.7
Simplified3.1
Applied fma-udef_binary643.1
Simplified1.1
Applied sub-div_binary641.1
if -4.36213168699749418e-102 < a < -1.7269859260640311e-268Initial program 10.5
Simplified4.9
Taylor expanded in y around 0 10.5
Taylor expanded in z around inf 5.5
Simplified5.5
Final simplification1.7
herbie shell --seed 2021340
(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))))