x + y \cdot \frac{z - t}{z - a}\begin{array}{l}
\mathbf{if}\;x \le -9.3956560300111874 \cdot 10^{105}:\\
\;\;\;\;x + \frac{y}{z - a} \cdot \left(z - t\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{z - a} - \frac{t}{z - a}, y, x\right) + y \cdot \mathsf{fma}\left(-\frac{t}{z - a}, 1, \frac{t}{z - a} \cdot 1\right)\\
\end{array}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 temp;
if ((x <= -9.395656030011187e+105)) {
temp = (x + ((y / (z - a)) * (z - t)));
} else {
temp = (fma(((z / (z - a)) - (t / (z - a))), y, x) + (y * fma(-(t / (z - a)), 1.0, ((t / (z - a)) * 1.0))));
}
return temp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a
Results
| Original | 1.5 |
|---|---|
| Target | 1.4 |
| Herbie | 1.5 |
if x < -9.395656030011187e+105Initial program 1.1
rmApplied div-sub1.1
rmApplied div-inv1.1
Applied div-inv1.1
Applied distribute-rgt-out--1.1
Applied associate-*r*0.8
Simplified0.8
if -9.395656030011187e+105 < x Initial program 1.6
rmApplied div-sub1.6
rmApplied *-un-lft-identity1.6
Applied *-un-lft-identity1.6
Applied times-frac1.6
Applied add-sqr-sqrt13.6
Applied prod-diff13.6
Applied distribute-lft-in13.6
Applied associate-+r+13.6
Simplified1.6
Final simplification1.5
herbie shell --seed 2020057 +o rules:numerics
(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)))))