\left(x \cdot y - z \cdot y\right) \cdot t
\begin{array}{l}
\mathbf{if}\;x \cdot y - z \cdot y \le -1.362271808713519878384378054571655207942 \cdot 10^{176} \lor \neg \left(x \cdot y - z \cdot y \le 5.572543277205989556635045266117023551446 \cdot 10^{294}\right):\\
\;\;\;\;\left(t \cdot y\right) \cdot x + \left(t \cdot y\right) \cdot \left(-z\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot y - z \cdot y\right) \cdot t\\
\end{array}double f(double x, double y, double z, double t) {
double r540701 = x;
double r540702 = y;
double r540703 = r540701 * r540702;
double r540704 = z;
double r540705 = r540704 * r540702;
double r540706 = r540703 - r540705;
double r540707 = t;
double r540708 = r540706 * r540707;
return r540708;
}
double f(double x, double y, double z, double t) {
double r540709 = x;
double r540710 = y;
double r540711 = r540709 * r540710;
double r540712 = z;
double r540713 = r540712 * r540710;
double r540714 = r540711 - r540713;
double r540715 = -1.36227180871352e+176;
bool r540716 = r540714 <= r540715;
double r540717 = 5.57254327720599e+294;
bool r540718 = r540714 <= r540717;
double r540719 = !r540718;
bool r540720 = r540716 || r540719;
double r540721 = t;
double r540722 = r540721 * r540710;
double r540723 = r540722 * r540709;
double r540724 = -r540712;
double r540725 = r540722 * r540724;
double r540726 = r540723 + r540725;
double r540727 = r540714 * r540721;
double r540728 = r540720 ? r540726 : r540727;
return r540728;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 6.8 |
|---|---|
| Target | 2.9 |
| Herbie | 1.5 |
if (- (* x y) (* z y)) < -1.36227180871352e+176 or 5.57254327720599e+294 < (- (* x y) (* z y)) Initial program 31.5
Taylor expanded around inf 31.5
Simplified1.2
rmApplied sub-neg1.2
Applied distribute-lft-in1.2
if -1.36227180871352e+176 < (- (* x y) (* z y)) < 5.57254327720599e+294Initial program 1.5
Final simplification1.5
herbie shell --seed 2020002 +o rules:numerics
(FPCore (x y z t)
:name "Linear.Projection:inverseInfinitePerspective from linear-1.19.1.3"
:precision binary64
:herbie-target
(if (< t -9.231879582886777e-80) (* (* y t) (- x z)) (if (< t 2.543067051564877e+83) (* y (* t (- x z))) (* (* y (- x z)) t)))
(* (- (* x y) (* z y)) t))