\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 3.77839364352374568196916187185312325383 \cdot 10^{-306}:\\
\;\;\;\;\sqrt[3]{{-1}^{3}}\\
\mathbf{elif}\;x \cdot x \le 1.980191050623079023019255468850286771049 \cdot 10^{-35}:\\
\;\;\;\;\frac{x}{\frac{y \cdot \left(4 \cdot y\right) + x \cdot x}{x}} - \frac{4 \cdot y}{\frac{y \cdot \left(4 \cdot y\right) + x \cdot x}{y}}\\
\mathbf{elif}\;x \cdot x \le 46369913269634036246010815144622292992:\\
\;\;\;\;\sqrt[3]{{-1}^{3}}\\
\mathbf{elif}\;x \cdot x \le 6.930492227353571361292600395069697176856 \cdot 10^{289}:\\
\;\;\;\;\frac{x}{\frac{y \cdot \left(4 \cdot y\right) + x \cdot x}{x}} - \frac{4 \cdot y}{\frac{y \cdot \left(4 \cdot y\right) + x \cdot x}{y}}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}double f(double x, double y) {
double r550423 = x;
double r550424 = r550423 * r550423;
double r550425 = y;
double r550426 = 4.0;
double r550427 = r550425 * r550426;
double r550428 = r550427 * r550425;
double r550429 = r550424 - r550428;
double r550430 = r550424 + r550428;
double r550431 = r550429 / r550430;
return r550431;
}
double f(double x, double y) {
double r550432 = x;
double r550433 = r550432 * r550432;
double r550434 = 3.7783936435237457e-306;
bool r550435 = r550433 <= r550434;
double r550436 = -1.0;
double r550437 = 3.0;
double r550438 = pow(r550436, r550437);
double r550439 = cbrt(r550438);
double r550440 = 1.980191050623079e-35;
bool r550441 = r550433 <= r550440;
double r550442 = y;
double r550443 = 4.0;
double r550444 = r550443 * r550442;
double r550445 = r550442 * r550444;
double r550446 = r550445 + r550433;
double r550447 = r550446 / r550432;
double r550448 = r550432 / r550447;
double r550449 = r550446 / r550442;
double r550450 = r550444 / r550449;
double r550451 = r550448 - r550450;
double r550452 = 4.636991326963404e+37;
bool r550453 = r550433 <= r550452;
double r550454 = 6.930492227353571e+289;
bool r550455 = r550433 <= r550454;
double r550456 = 1.0;
double r550457 = r550455 ? r550451 : r550456;
double r550458 = r550453 ? r550439 : r550457;
double r550459 = r550441 ? r550451 : r550458;
double r550460 = r550435 ? r550439 : r550459;
return r550460;
}




Bits error versus x




Bits error versus y
Results
| Original | 31.4 |
|---|---|
| Target | 31.1 |
| Herbie | 12.8 |
if (* x x) < 3.7783936435237457e-306 or 1.980191050623079e-35 < (* x x) < 4.636991326963404e+37Initial program 26.7
Simplified26.7
rmApplied add-cbrt-cube47.7
Applied add-cbrt-cube47.9
Applied cbrt-undiv47.9
Simplified26.7
Taylor expanded around 0 12.5
if 3.7783936435237457e-306 < (* x x) < 1.980191050623079e-35 or 4.636991326963404e+37 < (* x x) < 6.930492227353571e+289Initial program 15.9
Simplified15.9
rmApplied div-sub15.9
Simplified15.9
Simplified15.5
if 6.930492227353571e+289 < (* x x) Initial program 61.2
Simplified61.2
rmApplied add-cbrt-cube63.9
Applied add-cbrt-cube64.0
Applied cbrt-undiv64.0
Simplified61.2
Taylor expanded around inf 9.0
Final simplification12.8
herbie shell --seed 2019174
(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))))