\frac{\left(x \cdot 2.0\right) \cdot y}{x - y}\begin{array}{l}
\mathbf{if}\;x \le -2.781519413694764 \cdot 10^{-10}:\\
\;\;\;\;\left(y \cdot 2.0\right) \cdot \frac{x}{x - y}\\
\mathbf{elif}\;x \le 1.7651574500804557 \cdot 10^{+52}:\\
\;\;\;\;\left(x \cdot 2.0\right) \cdot \frac{y}{x - y}\\
\mathbf{else}:\\
\;\;\;\;\left(y \cdot 2.0\right) \cdot \frac{x}{x - y}\\
\end{array}double f(double x, double y) {
double r23994657 = x;
double r23994658 = 2.0;
double r23994659 = r23994657 * r23994658;
double r23994660 = y;
double r23994661 = r23994659 * r23994660;
double r23994662 = r23994657 - r23994660;
double r23994663 = r23994661 / r23994662;
return r23994663;
}
double f(double x, double y) {
double r23994664 = x;
double r23994665 = -2.781519413694764e-10;
bool r23994666 = r23994664 <= r23994665;
double r23994667 = y;
double r23994668 = 2.0;
double r23994669 = r23994667 * r23994668;
double r23994670 = r23994664 - r23994667;
double r23994671 = r23994664 / r23994670;
double r23994672 = r23994669 * r23994671;
double r23994673 = 1.7651574500804557e+52;
bool r23994674 = r23994664 <= r23994673;
double r23994675 = r23994664 * r23994668;
double r23994676 = r23994667 / r23994670;
double r23994677 = r23994675 * r23994676;
double r23994678 = r23994674 ? r23994677 : r23994672;
double r23994679 = r23994666 ? r23994672 : r23994678;
return r23994679;
}




Bits error versus x




Bits error versus y
Results
| Original | 14.5 |
|---|---|
| Target | 0.4 |
| Herbie | 0.1 |
if x < -2.781519413694764e-10 or 1.7651574500804557e+52 < x Initial program 15.2
rmApplied associate-/l*16.8
rmApplied div-inv16.9
Applied times-frac0.3
Simplified0.1
if -2.781519413694764e-10 < x < 1.7651574500804557e+52Initial program 13.8
rmApplied *-un-lft-identity13.8
Applied times-frac0.1
Simplified0.1
Final simplification0.1
herbie shell --seed 2019164
(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)))