\frac{x \cdot x - \left(y \cdot 4\right) \cdot y}{x \cdot x + \left(y \cdot 4\right) \cdot y}\begin{array}{l}
\mathbf{if}\;x \cdot x \le 2.757556978790064116743818529955834991566 \cdot 10^{-173}:\\
\;\;\;\;-1\\
\mathbf{elif}\;x \cdot x \le 1.02761016817255949891811789914490538041 \cdot 10^{266}:\\
\;\;\;\;\frac{x \cdot x}{x \cdot x + \left(y \cdot 4\right) \cdot y} - \sqrt[3]{{\left(\frac{\left(y \cdot 4\right) \cdot y}{x \cdot x + \left(y \cdot 4\right) \cdot y}\right)}^{3}}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}double f(double x, double y) {
double r444781 = x;
double r444782 = r444781 * r444781;
double r444783 = y;
double r444784 = 4.0;
double r444785 = r444783 * r444784;
double r444786 = r444785 * r444783;
double r444787 = r444782 - r444786;
double r444788 = r444782 + r444786;
double r444789 = r444787 / r444788;
return r444789;
}
double f(double x, double y) {
double r444790 = x;
double r444791 = r444790 * r444790;
double r444792 = 2.757556978790064e-173;
bool r444793 = r444791 <= r444792;
double r444794 = 1.0;
double r444795 = -r444794;
double r444796 = 1.0276101681725595e+266;
bool r444797 = r444791 <= r444796;
double r444798 = y;
double r444799 = 4.0;
double r444800 = r444798 * r444799;
double r444801 = r444800 * r444798;
double r444802 = r444791 + r444801;
double r444803 = r444791 / r444802;
double r444804 = r444801 / r444802;
double r444805 = 3.0;
double r444806 = pow(r444804, r444805);
double r444807 = cbrt(r444806);
double r444808 = r444803 - r444807;
double r444809 = 1.0;
double r444810 = r444797 ? r444808 : r444809;
double r444811 = r444793 ? r444795 : r444810;
return r444811;
}




Bits error versus x




Bits error versus y
Results
| Original | 32.2 |
|---|---|
| Target | 31.9 |
| Herbie | 12.8 |
if (* x x) < 2.757556978790064e-173Initial program 26.7
rmApplied div-sub26.7
Taylor expanded around 0 12.0
if 2.757556978790064e-173 < (* x x) < 1.0276101681725595e+266Initial program 16.5
rmApplied div-sub16.4
rmApplied add-cbrt-cube29.0
Applied add-cbrt-cube29.3
Applied add-cbrt-cube29.3
Applied add-cbrt-cube29.3
Applied cbrt-unprod29.3
Applied cbrt-unprod30.5
Applied cbrt-undiv30.4
Simplified16.4
if 1.0276101681725595e+266 < (* x x) Initial program 58.3
Taylor expanded around inf 9.2
Final simplification12.8
herbie shell --seed 2019322
(FPCore (x y)
:name "Diagrams.TwoD.Arc:arcBetween from diagrams-lib-1.3.0.3"
:precision binary64
:herbie-target
(if (< (/ (- (* x x) (* (* y 4) y)) (+ (* x x) (* (* y 4) y))) 0.9743233849626781) (- (/ (* x x) (+ (* x x) (* (* y y) 4))) (/ (* (* y y) 4) (+ (* x x) (* (* y y) 4)))) (- (pow (/ x (sqrt (+ (* x x) (* (* y y) 4)))) 2) (/ (* (* y y) 4) (+ (* x x) (* (* y y) 4)))))
(/ (- (* x x) (* (* y 4) y)) (+ (* x x) (* (* y 4) y))))