\frac{\left(x \cdot 2\right) \cdot y}{x - y}\begin{array}{l}
\mathbf{if}\;x \le -5.795611421145836744402935774403637790937 \cdot 10^{-17}:\\
\;\;\;\;\frac{x}{x - y} \cdot \left(2 \cdot y\right)\\
\mathbf{elif}\;x \le 3.247588547814785746124721995699073933232 \cdot 10^{-105}:\\
\;\;\;\;\frac{1}{\frac{\frac{x - y}{y}}{x \cdot 2}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{x - y} \cdot \left(2 \cdot y\right)\\
\end{array}double f(double x, double y) {
double r37565571 = x;
double r37565572 = 2.0;
double r37565573 = r37565571 * r37565572;
double r37565574 = y;
double r37565575 = r37565573 * r37565574;
double r37565576 = r37565571 - r37565574;
double r37565577 = r37565575 / r37565576;
return r37565577;
}
double f(double x, double y) {
double r37565578 = x;
double r37565579 = -5.795611421145837e-17;
bool r37565580 = r37565578 <= r37565579;
double r37565581 = y;
double r37565582 = r37565578 - r37565581;
double r37565583 = r37565578 / r37565582;
double r37565584 = 2.0;
double r37565585 = r37565584 * r37565581;
double r37565586 = r37565583 * r37565585;
double r37565587 = 3.2475885478147857e-105;
bool r37565588 = r37565578 <= r37565587;
double r37565589 = 1.0;
double r37565590 = r37565582 / r37565581;
double r37565591 = r37565578 * r37565584;
double r37565592 = r37565590 / r37565591;
double r37565593 = r37565589 / r37565592;
double r37565594 = r37565588 ? r37565593 : r37565586;
double r37565595 = r37565580 ? r37565586 : r37565594;
return r37565595;
}




Bits error versus x




Bits error versus y
Results
| Original | 14.9 |
|---|---|
| Target | 0.4 |
| Herbie | 0.5 |
if x < -5.795611421145837e-17 or 3.2475885478147857e-105 < x Initial program 14.4
rmApplied associate-/l*12.6
rmApplied div-inv12.7
Applied times-frac0.8
Simplified0.7
if -5.795611421145837e-17 < x < 3.2475885478147857e-105Initial program 15.6
rmApplied associate-/l*0.0
rmApplied clear-num0.2
Final simplification0.5
herbie shell --seed 2019174
(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)))