x + \left(y - x\right) \cdot \frac{z}{t}\begin{array}{l}
\mathbf{if}\;\frac{z}{t} \le -5.920177049123856979402727352381656804933 \cdot 10^{-176} \lor \neg \left(\frac{z}{t} \le 1.102754521517662286602101545681870103119 \cdot 10^{-319}\right) \land \frac{z}{t} \le 1288766001837314844471066624:\\
\;\;\;\;x + \frac{y - x}{\frac{t}{z}}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y - x}{t}, z, x\right)\\
\end{array}double f(double x, double y, double z, double t) {
double r343124 = x;
double r343125 = y;
double r343126 = r343125 - r343124;
double r343127 = z;
double r343128 = t;
double r343129 = r343127 / r343128;
double r343130 = r343126 * r343129;
double r343131 = r343124 + r343130;
return r343131;
}
double f(double x, double y, double z, double t) {
double r343132 = z;
double r343133 = t;
double r343134 = r343132 / r343133;
double r343135 = -5.920177049123857e-176;
bool r343136 = r343134 <= r343135;
double r343137 = 1.1027545215177e-319;
bool r343138 = r343134 <= r343137;
double r343139 = !r343138;
double r343140 = 1.2887660018373148e+27;
bool r343141 = r343134 <= r343140;
bool r343142 = r343139 && r343141;
bool r343143 = r343136 || r343142;
double r343144 = x;
double r343145 = y;
double r343146 = r343145 - r343144;
double r343147 = r343133 / r343132;
double r343148 = r343146 / r343147;
double r343149 = r343144 + r343148;
double r343150 = r343146 / r343133;
double r343151 = fma(r343150, r343132, r343144);
double r343152 = r343143 ? r343149 : r343151;
return r343152;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
| Original | 2.2 |
|---|---|
| Target | 2.4 |
| Herbie | 2.0 |
if (/ z t) < -5.920177049123857e-176 or 1.1027545215177e-319 < (/ z t) < 1.2887660018373148e+27Initial program 1.2
Simplified1.2
rmApplied fma-udef1.2
Simplified1.1
rmApplied +-commutative1.1
if -5.920177049123857e-176 < (/ z t) < 1.1027545215177e-319 or 1.2887660018373148e+27 < (/ z t) Initial program 3.8
Simplified3.8
rmApplied fma-udef3.8
Simplified3.8
rmApplied *-un-lft-identity3.8
Applied *-un-lft-identity3.8
Applied distribute-lft-out3.8
Simplified3.3
Final simplification2.0
herbie shell --seed 2019347 +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))))