x + \frac{y \cdot \left(z - t\right)}{a - t}
\begin{array}{l}
\mathbf{if}\;z \leq -1.2069852408039634 \cdot 10^{+146} \lor \neg \left(z \leq 1.9758692242271444 \cdot 10^{+183}\right):\\
\;\;\;\;\mathsf{fma}\left(z - t, \frac{y}{a - t}, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z - t}{a - t}, x\right)\\
\end{array}
(FPCore (x y z t a) :precision binary64 (+ x (/ (* y (- z t)) (- a t))))
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.2069852408039634e+146) (not (<= z 1.9758692242271444e+183))) (fma (- z t) (/ y (- a t)) x) (fma y (/ (- z t) (- a t)) x)))
double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (a - t));
}
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.2069852408039634e+146) || !(z <= 1.9758692242271444e+183)) {
tmp = fma((z - t), (y / (a - t)), x);
} else {
tmp = fma(y, ((z - t) / (a - t)), x);
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a
| Original | 11.3 |
|---|---|
| Target | 1.3 |
| Herbie | 1.1 |
if z < -1.20698524080396343e146 or 1.9758692242271444e183 < z Initial program 17.0
Simplified4.9
Taylor expanded in y around 0 17.0
Simplified3.5
Taylor expanded in x around 0 17.0
Simplified3.5
if -1.20698524080396343e146 < z < 1.9758692242271444e183Initial program 10.0
Simplified0.5
Final simplification1.1
herbie shell --seed 2021313
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, B"
:precision binary64
:herbie-target
(+ x (/ y (/ (- a t) (- z t))))
(+ x (/ (* y (- z t)) (- a t))))