x + y \cdot \frac{z - t}{z - a}
\begin{array}{l}
\mathbf{if}\;z \leq -1.6518303730418872 \cdot 10^{-206} \lor \neg \left(z \leq 1.9393432326971347 \cdot 10^{-171}\right):\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{z - a}, z, x\right) - \frac{1}{\frac{z - a}{y \cdot 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 (or (<= z -1.6518303730418872e-206) (not (<= z 1.9393432326971347e-171))) (fma y (/ (- z t) (- z a)) x) (- (fma (/ y (- z a)) z x) (/ 1.0 (/ (- z a) (* y t))))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.6518303730418872e-206) || !(z <= 1.9393432326971347e-171)) {
tmp = fma(y, ((z - t) / (z - a)), x);
} else {
tmp = fma((y / (z - a)), z, x) - (1.0 / ((z - a) / (y * t)));
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a
| Original | 1.1 |
|---|---|
| Target | 1.1 |
| Herbie | 1.9 |
if z < -1.65183037304188715e-206 or 1.9393432326971347e-171 < z Initial program 0.7
Simplified0.7
if -1.65183037304188715e-206 < z < 1.9393432326971347e-171Initial program 3.1
Simplified3.1
Taylor expanded in y around 0 3.0
Simplified7.2
Applied clear-num_binary647.3
Final simplification1.9
herbie shell --seed 2022068
(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)))))