x + \frac{y \cdot \left(z - t\right)}{a - t}\begin{array}{l}
\mathbf{if}\;y \le -4.637379201468953986949485320636358182223 \cdot 10^{-36} \lor \neg \left(y \le 3.205739178188263417782161531329637455788 \cdot 10^{-56}\right):\\
\;\;\;\;y \cdot \frac{z - t}{a - t} + x\\
\mathbf{else}:\\
\;\;\;\;\left(y \cdot \left(z - t\right)\right) \cdot \frac{1}{a - t} + x\\
\end{array}double f(double x, double y, double z, double t, double a) {
double r316607 = x;
double r316608 = y;
double r316609 = z;
double r316610 = t;
double r316611 = r316609 - r316610;
double r316612 = r316608 * r316611;
double r316613 = a;
double r316614 = r316613 - r316610;
double r316615 = r316612 / r316614;
double r316616 = r316607 + r316615;
return r316616;
}
double f(double x, double y, double z, double t, double a) {
double r316617 = y;
double r316618 = -4.637379201468954e-36;
bool r316619 = r316617 <= r316618;
double r316620 = 3.2057391781882634e-56;
bool r316621 = r316617 <= r316620;
double r316622 = !r316621;
bool r316623 = r316619 || r316622;
double r316624 = z;
double r316625 = t;
double r316626 = r316624 - r316625;
double r316627 = a;
double r316628 = r316627 - r316625;
double r316629 = r316626 / r316628;
double r316630 = r316617 * r316629;
double r316631 = x;
double r316632 = r316630 + r316631;
double r316633 = r316617 * r316626;
double r316634 = 1.0;
double r316635 = r316634 / r316628;
double r316636 = r316633 * r316635;
double r316637 = r316636 + r316631;
double r316638 = r316623 ? r316632 : r316637;
return r316638;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a
Results
| Original | 10.4 |
|---|---|
| Target | 1.2 |
| Herbie | 0.3 |
if y < -4.637379201468954e-36 or 3.2057391781882634e-56 < y Initial program 18.9
Simplified2.2
rmApplied fma-udef2.2
rmApplied div-inv2.2
Applied associate-*l*0.5
Simplified0.4
if -4.637379201468954e-36 < y < 3.2057391781882634e-56Initial program 0.2
Simplified3.7
rmApplied fma-udef3.7
rmApplied div-inv3.7
Applied associate-*l*2.3
Simplified2.3
rmApplied div-inv2.3
Applied associate-*r*0.3
Final simplification0.3
herbie shell --seed 2019326 +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))))