\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 -3.759129799435656048380758639203459110241 \cdot 10^{141}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \le -6.751306280841241990574366329684766225048 \cdot 10^{-71}:\\
\;\;\;\;\sqrt[3]{{\left(\frac{x \cdot x - \left(y \cdot 4\right) \cdot y}{\mathsf{fma}\left(x, x, \left(y \cdot 4\right) \cdot y\right)}\right)}^{3}}\\
\mathbf{elif}\;x \le 8.488500927325731364094840215005056497754 \cdot 10^{-70}:\\
\;\;\;\;\sqrt[3]{-1}\\
\mathbf{elif}\;x \le 5.311417125820034023983251080218725430022 \cdot 10^{136}:\\
\;\;\;\;\sqrt[3]{{\left(\frac{x \cdot x - \left(y \cdot 4\right) \cdot y}{\mathsf{fma}\left(x, x, \left(y \cdot 4\right) \cdot y\right)}\right)}^{3}}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}double f(double x, double y) {
double r722027 = x;
double r722028 = r722027 * r722027;
double r722029 = y;
double r722030 = 4.0;
double r722031 = r722029 * r722030;
double r722032 = r722031 * r722029;
double r722033 = r722028 - r722032;
double r722034 = r722028 + r722032;
double r722035 = r722033 / r722034;
return r722035;
}
double f(double x, double y) {
double r722036 = x;
double r722037 = -3.759129799435656e+141;
bool r722038 = r722036 <= r722037;
double r722039 = 1.0;
double r722040 = -6.751306280841242e-71;
bool r722041 = r722036 <= r722040;
double r722042 = r722036 * r722036;
double r722043 = y;
double r722044 = 4.0;
double r722045 = r722043 * r722044;
double r722046 = r722045 * r722043;
double r722047 = r722042 - r722046;
double r722048 = fma(r722036, r722036, r722046);
double r722049 = r722047 / r722048;
double r722050 = 3.0;
double r722051 = pow(r722049, r722050);
double r722052 = cbrt(r722051);
double r722053 = 8.488500927325731e-70;
bool r722054 = r722036 <= r722053;
double r722055 = -1.0;
double r722056 = cbrt(r722055);
double r722057 = 5.311417125820034e+136;
bool r722058 = r722036 <= r722057;
double r722059 = r722058 ? r722052 : r722039;
double r722060 = r722054 ? r722056 : r722059;
double r722061 = r722041 ? r722052 : r722060;
double r722062 = r722038 ? r722039 : r722061;
return r722062;
}




Bits error versus x




Bits error versus y
| Original | 32.6 |
|---|---|
| Target | 32.2 |
| Herbie | 12.9 |
if x < -3.759129799435656e+141 or 5.311417125820034e+136 < x Initial program 60.2
Taylor expanded around inf 9.1
if -3.759129799435656e+141 < x < -6.751306280841242e-71 or 8.488500927325731e-70 < x < 5.311417125820034e+136Initial program 16.8
rmApplied add-cbrt-cube44.0
Applied add-cbrt-cube44.5
Applied cbrt-undiv44.5
Simplified16.8
if -6.751306280841242e-71 < x < 8.488500927325731e-70Initial program 26.3
rmApplied add-cbrt-cube53.6
Applied add-cbrt-cube53.7
Applied cbrt-undiv53.7
Simplified26.3
Taylor expanded around 0 12.0
Final simplification12.9
herbie shell --seed 2020002 +o rules:numerics
(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))))