x + \left(y - x\right) \cdot \frac{z}{t}\begin{array}{l}
\mathbf{if}\;t \le -3.298192410539117391724374705141303330513 \cdot 10^{-118} \lor \neg \left(t \le 562147869411399761019776733806592\right):\\
\;\;\;\;\frac{\frac{y - x}{t}}{\frac{1}{z}} + x\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(y - x\right) \cdot z}{t} + x\\
\end{array}double f(double x, double y, double z, double t) {
double r324359 = x;
double r324360 = y;
double r324361 = r324360 - r324359;
double r324362 = z;
double r324363 = t;
double r324364 = r324362 / r324363;
double r324365 = r324361 * r324364;
double r324366 = r324359 + r324365;
return r324366;
}
double f(double x, double y, double z, double t) {
double r324367 = t;
double r324368 = -3.2981924105391174e-118;
bool r324369 = r324367 <= r324368;
double r324370 = 5.6214786941139976e+32;
bool r324371 = r324367 <= r324370;
double r324372 = !r324371;
bool r324373 = r324369 || r324372;
double r324374 = y;
double r324375 = x;
double r324376 = r324374 - r324375;
double r324377 = r324376 / r324367;
double r324378 = 1.0;
double r324379 = z;
double r324380 = r324378 / r324379;
double r324381 = r324377 / r324380;
double r324382 = r324381 + r324375;
double r324383 = r324376 * r324379;
double r324384 = r324383 / r324367;
double r324385 = r324384 + r324375;
double r324386 = r324373 ? r324382 : r324385;
return r324386;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 2.1 |
|---|---|
| Target | 2.2 |
| Herbie | 2.0 |
if t < -3.2981924105391174e-118 or 5.6214786941139976e+32 < t Initial program 1.2
Simplified1.2
rmApplied fma-udef1.2
Simplified1.2
rmApplied div-inv1.3
Applied associate-/r*2.1
if -3.2981924105391174e-118 < t < 5.6214786941139976e+32Initial program 3.9
Simplified3.8
rmApplied fma-udef3.9
Simplified3.5
rmApplied *-un-lft-identity3.5
Applied *-un-lft-identity3.5
Applied times-frac3.5
Applied *-un-lft-identity3.5
Applied times-frac3.5
Simplified3.5
Simplified1.8
Final simplification2.0
herbie shell --seed 2019306 +o rules:numerics
(FPCore (x y z t)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:tickPosition from plot-0.2.3.4"
:precision binary64
:herbie-target
(if (< (* (- y x) (/ z t)) -1013646692435.887) (+ x (/ (- y x) (/ t z))) (if (< (* (- y x) (/ z t)) -0.0) (+ x (/ (* (- y x) z) t)) (+ x (/ (- y x) (/ t z)))))
(+ x (* (- y x) (/ z t))))