\frac{\left(x \cdot 2\right) \cdot y}{x - y}\begin{array}{l}
\mathbf{if}\;\frac{\left(x \cdot 2\right) \cdot y}{x - y} \le -0.0:\\
\;\;\;\;\left(\left(x \cdot 2\right) \cdot \frac{\sqrt[3]{y} \cdot \sqrt[3]{y}}{\sqrt[3]{x - y} \cdot \sqrt[3]{x - y}}\right) \cdot \frac{\sqrt[3]{y}}{\sqrt[3]{x - y}}\\
\mathbf{elif}\;\frac{\left(x \cdot 2\right) \cdot y}{x - y} \le 1.5055267344693184 \cdot 10^{-5}:\\
\;\;\;\;\frac{\left(x \cdot 2\right) \cdot y}{x - y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot 2}{\frac{x - y}{y}}\\
\end{array}double f(double x, double y) {
double r617722 = x;
double r617723 = 2.0;
double r617724 = r617722 * r617723;
double r617725 = y;
double r617726 = r617724 * r617725;
double r617727 = r617722 - r617725;
double r617728 = r617726 / r617727;
return r617728;
}
double f(double x, double y) {
double r617729 = x;
double r617730 = 2.0;
double r617731 = r617729 * r617730;
double r617732 = y;
double r617733 = r617731 * r617732;
double r617734 = r617729 - r617732;
double r617735 = r617733 / r617734;
double r617736 = -0.0;
bool r617737 = r617735 <= r617736;
double r617738 = cbrt(r617732);
double r617739 = r617738 * r617738;
double r617740 = cbrt(r617734);
double r617741 = r617740 * r617740;
double r617742 = r617739 / r617741;
double r617743 = r617731 * r617742;
double r617744 = r617738 / r617740;
double r617745 = r617743 * r617744;
double r617746 = 1.5055267344693184e-05;
bool r617747 = r617735 <= r617746;
double r617748 = r617734 / r617732;
double r617749 = r617731 / r617748;
double r617750 = r617747 ? r617735 : r617749;
double r617751 = r617737 ? r617745 : r617750;
return r617751;
}




Bits error versus x




Bits error versus y
Results
| Original | 15.3 |
|---|---|
| Target | 0.4 |
| Herbie | 1.4 |
if (/ (* (* x 2.0) y) (- x y)) < -0.0Initial program 19.5
rmApplied *-un-lft-identity19.5
Applied times-frac6.3
Simplified6.3
rmApplied add-cube-cbrt7.5
Applied add-cube-cbrt6.9
Applied times-frac6.9
Applied associate-*r*2.3
if -0.0 < (/ (* (* x 2.0) y) (- x y)) < 1.5055267344693184e-05Initial program 0.4
if 1.5055267344693184e-05 < (/ (* (* x 2.0) y) (- x y)) Initial program 31.5
rmApplied associate-/l*0.1
Final simplification1.4
herbie shell --seed 2020100
(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)))