\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}{\left(-\frac{x}{y}\right) + 1}\\
\mathbf{elif}\;y \le 3.448485370032302944418093156077181588583 \cdot 10^{-155}:\\
\;\;\;\;\sqrt[3]{{\left(\frac{x}{x - y}\right)}^{3}} \cdot \left(2 \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot 2}{\frac{x - y}{y}}\\
\end{array}double f(double x, double y) {
double r428514 = x;
double r428515 = 2.0;
double r428516 = r428514 * r428515;
double r428517 = y;
double r428518 = r428516 * r428517;
double r428519 = r428514 - r428517;
double r428520 = r428518 / r428519;
return r428520;
}
double f(double x, double y) {
double r428521 = y;
double r428522 = -1.794266843434528e-157;
bool r428523 = r428521 <= r428522;
double r428524 = x;
double r428525 = 2.0;
double r428526 = r428524 * r428525;
double r428527 = -r428526;
double r428528 = r428524 / r428521;
double r428529 = -r428528;
double r428530 = 1.0;
double r428531 = r428529 + r428530;
double r428532 = r428527 / r428531;
double r428533 = 3.448485370032303e-155;
bool r428534 = r428521 <= r428533;
double r428535 = r428524 - r428521;
double r428536 = r428524 / r428535;
double r428537 = 3.0;
double r428538 = pow(r428536, r428537);
double r428539 = cbrt(r428538);
double r428540 = r428525 * r428521;
double r428541 = r428539 * r428540;
double r428542 = r428535 / r428521;
double r428543 = r428526 / r428542;
double r428544 = r428534 ? r428541 : r428543;
double r428545 = r428523 ? r428532 : r428544;
return r428545;
}




Bits error versus x




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