x + \frac{\left(y - x\right) \cdot z}{t}\begin{array}{l}
\mathbf{if}\;x + \frac{\left(y - x\right) \cdot z}{t} = -\infty:\\
\;\;\;\;\frac{z}{\frac{t}{y - x}} + x\\
\mathbf{elif}\;x + \frac{\left(y - x\right) \cdot z}{t} \le 4.21688783645265377 \cdot 10^{-84}:\\
\;\;\;\;x + \frac{\left(y - x\right) \cdot z}{t}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y - x}{\frac{t}{z}}\\
\end{array}double f(double x, double y, double z, double t) {
double r501811 = x;
double r501812 = y;
double r501813 = r501812 - r501811;
double r501814 = z;
double r501815 = r501813 * r501814;
double r501816 = t;
double r501817 = r501815 / r501816;
double r501818 = r501811 + r501817;
return r501818;
}
double f(double x, double y, double z, double t) {
double r501819 = x;
double r501820 = y;
double r501821 = r501820 - r501819;
double r501822 = z;
double r501823 = r501821 * r501822;
double r501824 = t;
double r501825 = r501823 / r501824;
double r501826 = r501819 + r501825;
double r501827 = -inf.0;
bool r501828 = r501826 <= r501827;
double r501829 = r501824 / r501821;
double r501830 = r501822 / r501829;
double r501831 = r501830 + r501819;
double r501832 = 4.216887836452654e-84;
bool r501833 = r501826 <= r501832;
double r501834 = r501824 / r501822;
double r501835 = r501821 / r501834;
double r501836 = r501819 + r501835;
double r501837 = r501833 ? r501826 : r501836;
double r501838 = r501828 ? r501831 : r501837;
return r501838;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 6.2 |
|---|---|
| Target | 2.0 |
| Herbie | 1.0 |
if (+ x (/ (* (- y x) z) t)) < -inf.0Initial program 64.0
rmApplied *-un-lft-identity64.0
Applied times-frac0.2
Simplified0.2
rmApplied *-un-lft-identity0.2
Applied associate-*l*0.2
Simplified0.2
if -inf.0 < (+ x (/ (* (- y x) z) t)) < 4.216887836452654e-84Initial program 0.7
if 4.216887836452654e-84 < (+ x (/ (* (- y x) z) t)) Initial program 7.3
rmApplied *-un-lft-identity7.3
Applied *-un-lft-identity7.3
Applied distribute-lft-out7.3
Simplified1.5
Final simplification1.0
herbie shell --seed 2020046
(FPCore (x y z t)
:name "Numeric.Histogram:binBounds from Chart-1.5.3"
:precision binary64
:herbie-target
(if (< x -9.025511195533005e-135) (- x (* (/ z t) (- x y))) (if (< x 4.275032163700715e-250) (+ x (* (/ (- y x) t) z)) (+ x (/ (- y x) (/ t z)))))
(+ x (/ (* (- y x) z) t)))