\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 -2.037620220306589920571806417099506602023 \cdot 10^{149}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \le -5.301161031949812436014753866372397601436 \cdot 10^{-111}:\\
\;\;\;\;\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{elif}\;x \le 0.003134716524964163350541745955979422433302:\\
\;\;\;\;-1\\
\mathbf{elif}\;x \le 1.042090748945731696259607097644535350077 \cdot 10^{130}:\\
\;\;\;\;\sqrt[3]{{\left(\frac{x \cdot x}{x \cdot x + \left(y \cdot 4\right) \cdot y} - \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 r505101 = x;
double r505102 = r505101 * r505101;
double r505103 = y;
double r505104 = 4.0;
double r505105 = r505103 * r505104;
double r505106 = r505105 * r505103;
double r505107 = r505102 - r505106;
double r505108 = r505102 + r505106;
double r505109 = r505107 / r505108;
return r505109;
}
double f(double x, double y) {
double r505110 = x;
double r505111 = -2.03762022030659e+149;
bool r505112 = r505110 <= r505111;
double r505113 = 1.0;
double r505114 = -5.3011610319498124e-111;
bool r505115 = r505110 <= r505114;
double r505116 = r505110 * r505110;
double r505117 = y;
double r505118 = 4.0;
double r505119 = r505117 * r505118;
double r505120 = r505119 * r505117;
double r505121 = r505116 + r505120;
double r505122 = r505116 / r505121;
double r505123 = r505120 / r505121;
double r505124 = 3.0;
double r505125 = pow(r505123, r505124);
double r505126 = cbrt(r505125);
double r505127 = r505122 - r505126;
double r505128 = 0.0031347165249641634;
bool r505129 = r505110 <= r505128;
double r505130 = -1.0;
double r505131 = 1.0420907489457317e+130;
bool r505132 = r505110 <= r505131;
double r505133 = r505122 - r505123;
double r505134 = pow(r505133, r505124);
double r505135 = cbrt(r505134);
double r505136 = r505132 ? r505135 : r505113;
double r505137 = r505129 ? r505130 : r505136;
double r505138 = r505115 ? r505127 : r505137;
double r505139 = r505112 ? r505113 : r505138;
return r505139;
}




Bits error versus x




Bits error versus y
Results
| Original | 31.9 |
|---|---|
| Target | 31.6 |
| Herbie | 13.1 |
if x < -2.03762022030659e+149 or 1.0420907489457317e+130 < x Initial program 59.5
Taylor expanded around inf 9.2
if -2.03762022030659e+149 < x < -5.3011610319498124e-111Initial program 15.9
rmApplied div-sub15.9
rmApplied add-cbrt-cube30.9
Applied add-cbrt-cube31.3
Applied add-cbrt-cube31.3
Applied add-cbrt-cube31.4
Applied cbrt-unprod31.4
Applied cbrt-unprod32.5
Applied cbrt-undiv32.5
Simplified15.9
if -5.3011610319498124e-111 < x < 0.0031347165249641634Initial program 24.7
Taylor expanded around 0 13.6
if 0.0031347165249641634 < x < 1.0420907489457317e+130Initial program 16.3
rmApplied div-sub16.3
rmApplied add-cbrt-cube16.4
Simplified16.4
Final simplification13.1
herbie shell --seed 2019294
(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.974323384962678118) (- (/ (* 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))))