\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 -2.509016255470818 \cdot 10^{-23}:\\
\;\;\;\;\frac{x \cdot 2}{\frac{x - y}{y}}\\
\mathbf{elif}\;\frac{\left(x \cdot 2\right) \cdot y}{x - y} \le -2.14150251518745915 \cdot 10^{-306}:\\
\;\;\;\;\frac{\left(x \cdot 2\right) \cdot y}{x - y}\\
\mathbf{elif}\;\frac{\left(x \cdot 2\right) \cdot y}{x - y} \le 0.0:\\
\;\;\;\;\left(x \cdot 2\right) \cdot \frac{y}{x - y}\\
\mathbf{elif}\;\frac{\left(x \cdot 2\right) \cdot y}{x - y} \le 9.93900771339059028 \cdot 10^{-129}:\\
\;\;\;\;\frac{\left(x \cdot 2\right) \cdot \left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right)}{\sqrt[3]{x - y} \cdot \sqrt[3]{x - y}} \cdot \frac{\sqrt[3]{y}}{\sqrt[3]{x - y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot 2}{\frac{x - y}{y}}\\
\end{array}double f(double x, double y) {
double r569644 = x;
double r569645 = 2.0;
double r569646 = r569644 * r569645;
double r569647 = y;
double r569648 = r569646 * r569647;
double r569649 = r569644 - r569647;
double r569650 = r569648 / r569649;
return r569650;
}
double f(double x, double y) {
double r569651 = x;
double r569652 = 2.0;
double r569653 = r569651 * r569652;
double r569654 = y;
double r569655 = r569653 * r569654;
double r569656 = r569651 - r569654;
double r569657 = r569655 / r569656;
double r569658 = -2.509016255470818e-23;
bool r569659 = r569657 <= r569658;
double r569660 = r569656 / r569654;
double r569661 = r569653 / r569660;
double r569662 = -2.141502515187459e-306;
bool r569663 = r569657 <= r569662;
double r569664 = 0.0;
bool r569665 = r569657 <= r569664;
double r569666 = r569654 / r569656;
double r569667 = r569653 * r569666;
double r569668 = 9.93900771339059e-129;
bool r569669 = r569657 <= r569668;
double r569670 = cbrt(r569654);
double r569671 = r569670 * r569670;
double r569672 = r569653 * r569671;
double r569673 = cbrt(r569656);
double r569674 = r569673 * r569673;
double r569675 = r569672 / r569674;
double r569676 = r569670 / r569673;
double r569677 = r569675 * r569676;
double r569678 = r569669 ? r569677 : r569661;
double r569679 = r569665 ? r569667 : r569678;
double r569680 = r569663 ? r569657 : r569679;
double r569681 = r569659 ? r569661 : r569680;
return r569681;
}




Bits error versus x




Bits error versus y
Results
| Original | 14.4 |
|---|---|
| Target | 0.3 |
| Herbie | 1.1 |
if (/ (* (* x 2.0) y) (- x y)) < -2.509016255470818e-23 or 9.93900771339059e-129 < (/ (* (* x 2.0) y) (- x y)) Initial program 19.9
rmApplied associate-/l*1.7
if -2.509016255470818e-23 < (/ (* (* x 2.0) y) (- x y)) < -2.141502515187459e-306Initial program 0.7
if -2.141502515187459e-306 < (/ (* (* x 2.0) y) (- x y)) < 0.0Initial program 57.5
rmApplied *-un-lft-identity57.5
Applied times-frac0.7
Simplified0.7
if 0.0 < (/ (* (* x 2.0) y) (- x y)) < 9.93900771339059e-129Initial program 13.0
rmApplied *-un-lft-identity13.0
Applied times-frac12.1
Simplified12.1
rmApplied add-cube-cbrt13.2
Applied *-un-lft-identity13.2
Applied times-frac13.2
Applied associate-*r*14.5
Simplified14.5
rmApplied *-un-lft-identity14.5
Applied add-cube-cbrt14.3
Applied times-frac14.3
Applied associate-*r*10.3
Simplified9.8
Final simplification1.1
herbie shell --seed 2020003
(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)))