x + \frac{y \cdot \left(z - t\right)}{a - t}\begin{array}{l}
\mathbf{if}\;y \le -6.052162249708099241513091933774390871208 \cdot 10^{-108} \lor \neg \left(y \le 1.426243921064187849725682052555273082691 \cdot 10^{-32}\right):\\
\;\;\;\;\frac{\frac{z - t}{a - t}}{\frac{1}{y}} + x\\
\mathbf{else}:\\
\;\;\;\;x + \frac{\left(z - t\right) \cdot y}{a - t}\\
\end{array}double f(double x, double y, double z, double t, double a) {
double r355625 = x;
double r355626 = y;
double r355627 = z;
double r355628 = t;
double r355629 = r355627 - r355628;
double r355630 = r355626 * r355629;
double r355631 = a;
double r355632 = r355631 - r355628;
double r355633 = r355630 / r355632;
double r355634 = r355625 + r355633;
return r355634;
}
double f(double x, double y, double z, double t, double a) {
double r355635 = y;
double r355636 = -6.052162249708099e-108;
bool r355637 = r355635 <= r355636;
double r355638 = 1.4262439210641878e-32;
bool r355639 = r355635 <= r355638;
double r355640 = !r355639;
bool r355641 = r355637 || r355640;
double r355642 = z;
double r355643 = t;
double r355644 = r355642 - r355643;
double r355645 = a;
double r355646 = r355645 - r355643;
double r355647 = r355644 / r355646;
double r355648 = 1.0;
double r355649 = r355648 / r355635;
double r355650 = r355647 / r355649;
double r355651 = x;
double r355652 = r355650 + r355651;
double r355653 = r355644 * r355635;
double r355654 = r355653 / r355646;
double r355655 = r355651 + r355654;
double r355656 = r355641 ? r355652 : r355655;
return r355656;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a
Results
| Original | 10.8 |
|---|---|
| Target | 1.2 |
| Herbie | 0.5 |
if y < -6.052162249708099e-108 or 1.4262439210641878e-32 < y Initial program 18.4
Simplified2.2
rmApplied clear-num2.4
rmApplied fma-udef2.4
Simplified2.1
rmApplied div-inv2.2
Applied associate-/r*0.6
if -6.052162249708099e-108 < y < 1.4262439210641878e-32Initial program 0.4
Simplified3.8
rmApplied clear-num4.1
rmApplied fma-udef4.1
Simplified4.1
rmApplied *-un-lft-identity4.1
Applied *-un-lft-identity4.1
Applied times-frac4.1
Applied *-un-lft-identity4.1
Applied times-frac4.1
Simplified4.1
Simplified0.4
Final simplification0.5
herbie shell --seed 2019347 +o rules:numerics
(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))))