\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 \le -4.542162861981963339451786530680392909626 \cdot 10^{56}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \le -5.780522729495912693679807571274083237549 \cdot 10^{-162}:\\
\;\;\;\;\sqrt[3]{\frac{1}{\frac{\mathsf{fma}\left(x, x, y \cdot \left(4 \cdot y\right)\right)}{\mathsf{fma}\left(4, \left(-y\right) \cdot y, x \cdot x\right)}}} \cdot \left(\sqrt[3]{\frac{\mathsf{fma}\left(4 \cdot y, -y, x \cdot x\right)}{\mathsf{fma}\left(y, 4 \cdot y, x \cdot x\right)}} \cdot \sqrt[3]{\frac{\mathsf{fma}\left(4 \cdot y, -y, x \cdot x\right)}{\mathsf{fma}\left(y, 4 \cdot y, x \cdot x\right)}}\right)\\
\mathbf{elif}\;x \le 5.430501749338192800539606964665669060352 \cdot 10^{-128}:\\
\;\;\;\;-1\\
\mathbf{elif}\;x \le 6.680131771318429129718732452803437555736 \cdot 10^{54}:\\
\;\;\;\;\left(\sqrt[3]{\frac{\mathsf{fma}\left(4 \cdot y, -y, x \cdot x\right)}{\mathsf{fma}\left(y, 4 \cdot y, x \cdot x\right)}} \cdot \sqrt[3]{\frac{\mathsf{fma}\left(4 \cdot y, -y, x \cdot x\right)}{\mathsf{fma}\left(y, 4 \cdot y, x \cdot x\right)}}\right) \cdot \sqrt[3]{\frac{\mathsf{fma}\left(4 \cdot y, -y, x \cdot x\right)}{\mathsf{fma}\left(y, 4 \cdot y, x \cdot x\right)}}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}double f(double x, double y) {
double r622739 = x;
double r622740 = r622739 * r622739;
double r622741 = y;
double r622742 = 4.0;
double r622743 = r622741 * r622742;
double r622744 = r622743 * r622741;
double r622745 = r622740 - r622744;
double r622746 = r622740 + r622744;
double r622747 = r622745 / r622746;
return r622747;
}
double f(double x, double y) {
double r622748 = x;
double r622749 = -4.542162861981963e+56;
bool r622750 = r622748 <= r622749;
double r622751 = 1.0;
double r622752 = -5.780522729495913e-162;
bool r622753 = r622748 <= r622752;
double r622754 = y;
double r622755 = 4.0;
double r622756 = r622755 * r622754;
double r622757 = r622754 * r622756;
double r622758 = fma(r622748, r622748, r622757);
double r622759 = -r622754;
double r622760 = r622759 * r622754;
double r622761 = r622748 * r622748;
double r622762 = fma(r622755, r622760, r622761);
double r622763 = r622758 / r622762;
double r622764 = r622751 / r622763;
double r622765 = cbrt(r622764);
double r622766 = fma(r622756, r622759, r622761);
double r622767 = fma(r622754, r622756, r622761);
double r622768 = r622766 / r622767;
double r622769 = cbrt(r622768);
double r622770 = r622769 * r622769;
double r622771 = r622765 * r622770;
double r622772 = 5.430501749338193e-128;
bool r622773 = r622748 <= r622772;
double r622774 = -1.0;
double r622775 = 6.680131771318429e+54;
bool r622776 = r622748 <= r622775;
double r622777 = r622770 * r622769;
double r622778 = r622776 ? r622777 : r622751;
double r622779 = r622773 ? r622774 : r622778;
double r622780 = r622753 ? r622771 : r622779;
double r622781 = r622750 ? r622751 : r622780;
return r622781;
}




Bits error versus x




Bits error versus y
| Original | 31.5 |
|---|---|
| Target | 31.2 |
| Herbie | 13.2 |
if x < -4.542162861981963e+56 or 6.680131771318429e+54 < x Initial program 45.6
Taylor expanded around inf 13.9
if -4.542162861981963e+56 < x < -5.780522729495913e-162Initial program 15.8
rmApplied add-cube-cbrt15.8
Simplified15.8
Simplified15.8
rmApplied clear-num15.8
Simplified15.8
if -5.780522729495913e-162 < x < 5.430501749338193e-128Initial program 29.3
Taylor expanded around 0 9.3
if 5.430501749338193e-128 < x < 6.680131771318429e+54Initial program 15.3
rmApplied add-cube-cbrt15.4
Simplified15.4
Simplified15.4
Final simplification13.2
herbie shell --seed 2019196 +o rules:numerics
(FPCore (x y)
:name "Diagrams.TwoD.Arc:arcBetween from diagrams-lib-1.3.0.3"
:herbie-target
(if (< (/ (- (* x x) (* (* y 4.0) y)) (+ (* x x) (* (* y 4.0) y))) 0.9743233849626781) (- (/ (* x x) (+ (* x x) (* (* y y) 4.0))) (/ (* (* y y) 4.0) (+ (* x x) (* (* y y) 4.0)))) (- (pow (/ x (sqrt (+ (* x x) (* (* y y) 4.0)))) 2.0) (/ (* (* y y) 4.0) (+ (* x x) (* (* y y) 4.0)))))
(/ (- (* x x) (* (* y 4.0) y)) (+ (* x x) (* (* y 4.0) y))))