\frac{\left(x \cdot 2\right) \cdot y}{x - y}\begin{array}{l}
\mathbf{if}\;y \le -1.8379060927151348 \cdot 10^{37} \lor \neg \left(y \le 2.53558016914647718 \cdot 10^{-106}\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 r626756 = x;
double r626757 = 2.0;
double r626758 = r626756 * r626757;
double r626759 = y;
double r626760 = r626758 * r626759;
double r626761 = r626756 - r626759;
double r626762 = r626760 / r626761;
return r626762;
}
double f(double x, double y) {
double r626763 = y;
double r626764 = -1.8379060927151348e+37;
bool r626765 = r626763 <= r626764;
double r626766 = 2.535580169146477e-106;
bool r626767 = r626763 <= r626766;
double r626768 = !r626767;
bool r626769 = r626765 || r626768;
double r626770 = x;
double r626771 = 2.0;
double r626772 = r626770 * r626771;
double r626773 = r626770 - r626763;
double r626774 = r626763 / r626773;
double r626775 = r626772 * r626774;
double r626776 = r626772 / r626773;
double r626777 = r626776 * r626763;
double r626778 = r626769 ? r626775 : r626777;
return r626778;
}




Bits error versus x




Bits error versus y
Results
| Original | 14.7 |
|---|---|
| Target | 0.4 |
| Herbie | 0.4 |
if y < -1.8379060927151348e+37 or 2.535580169146477e-106 < y Initial program 14.6
rmApplied *-un-lft-identity14.6
Applied times-frac0.6
Simplified0.6
if -1.8379060927151348e+37 < y < 2.535580169146477e-106Initial program 15.0
rmApplied associate-/l*15.6
rmApplied associate-/r/0.2
Final simplification0.4
herbie shell --seed 2020045
(FPCore (x y)
:name "Linear.Projection:perspective from linear-1.19.1.3, B"
:precision binary64
:herbie-target
(if (< x -1.7210442634149447e+81) (* (/ (* 2 x) (- x y)) y) (if (< x 83645045635564432) (/ (* x 2) (/ (- x y) y)) (* (/ (* 2 x) (- x y)) y)))
(/ (* (* x 2) y) (- x y)))