\frac{\left(x \cdot 2\right) \cdot y}{x - y}\begin{array}{l}
\mathbf{if}\;y \le -73036423.040567547 \lor \neg \left(y \le 2.86811390672079895 \cdot 10^{31}\right):\\
\;\;\;\;\left(x \cdot 2\right) \cdot \frac{y}{x - y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot 2}{x - y} \cdot y\\
\end{array}double f(double x, double y) {
double r332676 = x;
double r332677 = 2.0;
double r332678 = r332676 * r332677;
double r332679 = y;
double r332680 = r332678 * r332679;
double r332681 = r332676 - r332679;
double r332682 = r332680 / r332681;
return r332682;
}
double f(double x, double y) {
double r332683 = y;
double r332684 = -73036423.04056755;
bool r332685 = r332683 <= r332684;
double r332686 = 2.868113906720799e+31;
bool r332687 = r332683 <= r332686;
double r332688 = !r332687;
bool r332689 = r332685 || r332688;
double r332690 = x;
double r332691 = 2.0;
double r332692 = r332690 * r332691;
double r332693 = r332690 - r332683;
double r332694 = r332683 / r332693;
double r332695 = r332692 * r332694;
double r332696 = r332692 / r332693;
double r332697 = r332696 * r332683;
double r332698 = r332689 ? r332695 : r332697;
return r332698;
}




Bits error versus x




Bits error versus y
Results
| Original | 15.3 |
|---|---|
| Target | 0.3 |
| Herbie | 0.1 |
if y < -73036423.04056755 or 2.868113906720799e+31 < y Initial program 17.1
rmApplied *-un-lft-identity17.1
Applied times-frac0.1
Simplified0.1
if -73036423.04056755 < y < 2.868113906720799e+31Initial program 13.7
rmApplied associate-/l*13.9
rmApplied associate-/r/0.1
Final simplification0.1
herbie shell --seed 2019198 +o rules:numerics
(FPCore (x y)
:name "Linear.Projection:perspective from linear-1.19.1.3, B"
:herbie-target
(if (< x -1.7210442634149447e+81) (* (/ (* 2.0 x) (- x y)) y) (if (< x 8.364504563556443e+16) (/ (* x 2.0) (/ (- x y) y)) (* (/ (* 2.0 x) (- x y)) y)))
(/ (* (* x 2.0) y) (- x y)))