\frac{\left(x \cdot 2.0\right) \cdot y}{x - y}\begin{array}{l}
\mathbf{if}\;x \le -1.5429547294769742 \cdot 10^{+40}:\\
\;\;\;\;\frac{2.0 \cdot x}{x - y} \cdot y\\
\mathbf{elif}\;x \le 8733142429638575.0:\\
\;\;\;\;\frac{2.0 \cdot x}{\frac{x}{y} - 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{2.0 \cdot x}{x - y} \cdot y\\
\end{array}double f(double x, double y) {
double r24640561 = x;
double r24640562 = 2.0;
double r24640563 = r24640561 * r24640562;
double r24640564 = y;
double r24640565 = r24640563 * r24640564;
double r24640566 = r24640561 - r24640564;
double r24640567 = r24640565 / r24640566;
return r24640567;
}
double f(double x, double y) {
double r24640568 = x;
double r24640569 = -1.5429547294769742e+40;
bool r24640570 = r24640568 <= r24640569;
double r24640571 = 2.0;
double r24640572 = r24640571 * r24640568;
double r24640573 = y;
double r24640574 = r24640568 - r24640573;
double r24640575 = r24640572 / r24640574;
double r24640576 = r24640575 * r24640573;
double r24640577 = 8733142429638575.0;
bool r24640578 = r24640568 <= r24640577;
double r24640579 = r24640568 / r24640573;
double r24640580 = 1.0;
double r24640581 = r24640579 - r24640580;
double r24640582 = r24640572 / r24640581;
double r24640583 = r24640578 ? r24640582 : r24640576;
double r24640584 = r24640570 ? r24640576 : r24640583;
return r24640584;
}




Bits error versus x




Bits error versus y
Results
| Original | 14.5 |
|---|---|
| Target | 0.4 |
| Herbie | 0.1 |
if x < -1.5429547294769742e+40 or 8733142429638575.0 < x Initial program 16.6
rmApplied associate-/l*16.8
rmApplied associate-/r/0.1
if -1.5429547294769742e+40 < x < 8733142429638575.0Initial program 12.7
rmApplied associate-/l*0.2
rmApplied div-sub0.2
Simplified0.2
Final simplification0.1
herbie shell --seed 2019158
(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)))