\frac{\left(x \cdot 2\right) \cdot y}{x - y}\begin{array}{l}
\mathbf{if}\;y \le -1.794266843434528135733297660501734721002 \cdot 10^{-157}:\\
\;\;\;\;\frac{x \cdot 2}{\frac{x}{y} - 1}\\
\mathbf{elif}\;y \le 3.448485370032302944418093156077181588583 \cdot 10^{-155}:\\
\;\;\;\;y \cdot \sqrt[3]{{\left(\frac{x \cdot 2}{x - y}\right)}^{3}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot 2}{\frac{x - y}{y}}\\
\end{array}double f(double x, double y) {
double r414624 = x;
double r414625 = 2.0;
double r414626 = r414624 * r414625;
double r414627 = y;
double r414628 = r414626 * r414627;
double r414629 = r414624 - r414627;
double r414630 = r414628 / r414629;
return r414630;
}
double f(double x, double y) {
double r414631 = y;
double r414632 = -1.794266843434528e-157;
bool r414633 = r414631 <= r414632;
double r414634 = x;
double r414635 = 2.0;
double r414636 = r414634 * r414635;
double r414637 = r414634 / r414631;
double r414638 = 1.0;
double r414639 = r414637 - r414638;
double r414640 = r414636 / r414639;
double r414641 = 3.448485370032303e-155;
bool r414642 = r414631 <= r414641;
double r414643 = r414634 - r414631;
double r414644 = r414636 / r414643;
double r414645 = 3.0;
double r414646 = pow(r414644, r414645);
double r414647 = cbrt(r414646);
double r414648 = r414631 * r414647;
double r414649 = r414643 / r414631;
double r414650 = r414636 / r414649;
double r414651 = r414642 ? r414648 : r414650;
double r414652 = r414633 ? r414640 : r414651;
return r414652;
}




Bits error versus x




Bits error versus y
Results
| Original | 15.0 |
|---|---|
| Target | 0.3 |
| Herbie | 2.0 |
if y < -1.794266843434528e-157Initial program 13.4
Simplified2.4
rmApplied *-un-lft-identity2.4
Applied *-un-lft-identity2.4
Applied times-frac2.4
Simplified2.4
Simplified2.4
if -1.794266843434528e-157 < y < 3.448485370032303e-155Initial program 21.1
Simplified22.8
rmApplied associate-/r/0.1
rmApplied add-cbrt-cube41.1
Applied add-cbrt-cube41.1
Applied add-cbrt-cube42.2
Applied cbrt-unprod42.2
Applied cbrt-undiv42.2
Simplified0.7
if 3.448485370032303e-155 < y Initial program 12.6
Simplified2.3
Final simplification2.0
herbie shell --seed 2019194 +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)))