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 r316274 = x;
double r316275 = y;
double r316276 = z;
double r316277 = t;
double r316278 = r316276 - r316277;
double r316279 = r316275 * r316278;
double r316280 = a;
double r316281 = r316280 - r316277;
double r316282 = r316279 / r316281;
double r316283 = r316274 + r316282;
return r316283;
}
double f(double x, double y, double z, double t, double a) {
double r316284 = y;
double r316285 = -4.637379201468954e-36;
bool r316286 = r316284 <= r316285;
double r316287 = 3.2057391781882634e-56;
bool r316288 = r316284 <= r316287;
double r316289 = !r316288;
bool r316290 = r316286 || r316289;
double r316291 = z;
double r316292 = t;
double r316293 = r316291 - r316292;
double r316294 = a;
double r316295 = r316294 - r316292;
double r316296 = r316293 / r316295;
double r316297 = r316284 * r316296;
double r316298 = x;
double r316299 = r316297 + r316298;
double r316300 = r316284 * r316293;
double r316301 = 1.0;
double r316302 = r316301 / r316295;
double r316303 = r316300 * r316302;
double r316304 = r316303 + r316298;
double r316305 = r316290 ? r316299 : r316304;
return r316305;
}




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))))