x + \frac{\left(y - x\right) \cdot z}{t}\begin{array}{l}
\mathbf{if}\;x + \frac{\left(y - x\right) \cdot z}{t} = -\infty:\\
\;\;\;\;x + \frac{y - x}{\frac{t}{z}}\\
\mathbf{elif}\;x + \frac{\left(y - x\right) \cdot z}{t} \le 2.334828876963019126638500573266416450503 \cdot 10^{262}:\\
\;\;\;\;x + \frac{\left(y - x\right) \cdot z}{t}\\
\mathbf{else}:\\
\;\;\;\;x + \left(y - x\right) \cdot \frac{z}{t}\\
\end{array}double f(double x, double y, double z, double t) {
double r491656 = x;
double r491657 = y;
double r491658 = r491657 - r491656;
double r491659 = z;
double r491660 = r491658 * r491659;
double r491661 = t;
double r491662 = r491660 / r491661;
double r491663 = r491656 + r491662;
return r491663;
}
double f(double x, double y, double z, double t) {
double r491664 = x;
double r491665 = y;
double r491666 = r491665 - r491664;
double r491667 = z;
double r491668 = r491666 * r491667;
double r491669 = t;
double r491670 = r491668 / r491669;
double r491671 = r491664 + r491670;
double r491672 = -inf.0;
bool r491673 = r491671 <= r491672;
double r491674 = r491669 / r491667;
double r491675 = r491666 / r491674;
double r491676 = r491664 + r491675;
double r491677 = 2.334828876963019e+262;
bool r491678 = r491671 <= r491677;
double r491679 = r491667 / r491669;
double r491680 = r491666 * r491679;
double r491681 = r491664 + r491680;
double r491682 = r491678 ? r491671 : r491681;
double r491683 = r491673 ? r491676 : r491682;
return r491683;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 6.5 |
|---|---|
| Target | 2.2 |
| Herbie | 1.0 |
if (+ x (/ (* (- y x) z) t)) < -inf.0Initial program 64.0
rmApplied associate-/l*0.2
if -inf.0 < (+ x (/ (* (- y x) z) t)) < 2.334828876963019e+262Initial program 0.7
rmApplied *-un-lft-identity0.7
Applied times-frac2.2
Simplified2.2
rmApplied associate-*r/0.7
if 2.334828876963019e+262 < (+ x (/ (* (- y x) z) t)) Initial program 32.4
rmApplied *-un-lft-identity32.4
Applied times-frac4.0
Simplified4.0
Final simplification1.0
herbie shell --seed 2019353 +o rules:numerics
(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)))