\frac{\left(x \cdot 2\right) \cdot y}{x - y}\begin{array}{l}
\mathbf{if}\;x \le -1950896635033006241202453604204544:\\
\;\;\;\;\frac{2 \cdot x}{x - y} \cdot y\\
\mathbf{elif}\;x \le 1.525261129384541486350799582595845140217 \cdot 10^{75}:\\
\;\;\;\;\left(2 \cdot x\right) \cdot \frac{y}{x - y}\\
\mathbf{else}:\\
\;\;\;\;\frac{2 \cdot x}{x - y} \cdot y\\
\end{array}double f(double x, double y) {
double r20105779 = x;
double r20105780 = 2.0;
double r20105781 = r20105779 * r20105780;
double r20105782 = y;
double r20105783 = r20105781 * r20105782;
double r20105784 = r20105779 - r20105782;
double r20105785 = r20105783 / r20105784;
return r20105785;
}
double f(double x, double y) {
double r20105786 = x;
double r20105787 = -1.9508966350330062e+33;
bool r20105788 = r20105786 <= r20105787;
double r20105789 = 2.0;
double r20105790 = r20105789 * r20105786;
double r20105791 = y;
double r20105792 = r20105786 - r20105791;
double r20105793 = r20105790 / r20105792;
double r20105794 = r20105793 * r20105791;
double r20105795 = 1.5252611293845415e+75;
bool r20105796 = r20105786 <= r20105795;
double r20105797 = r20105791 / r20105792;
double r20105798 = r20105790 * r20105797;
double r20105799 = r20105796 ? r20105798 : r20105794;
double r20105800 = r20105788 ? r20105794 : r20105799;
return r20105800;
}




Bits error versus x




Bits error versus y
Results
| Original | 15.2 |
|---|---|
| Target | 0.3 |
| Herbie | 0.2 |
if x < -1.9508966350330062e+33 or 1.5252611293845415e+75 < x Initial program 19.0
rmApplied associate-/l*17.4
rmApplied associate-/r/0.1
if -1.9508966350330062e+33 < x < 1.5252611293845415e+75Initial program 12.5
rmApplied *-un-lft-identity12.5
Applied times-frac0.3
Simplified0.3
Final simplification0.2
herbie shell --seed 2019172 +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)))