\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.75486451228188590222826906220099481589 \cdot 10^{122}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \le -4.332313917220748901311195815363194649965 \cdot 10^{80}:\\
\;\;\;\;-1\\
\mathbf{elif}\;x \le -9211266202426181632:\\
\;\;\;\;\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}\\
\mathbf{elif}\;x \le 2.139551810604105186057739335770012586275 \cdot 10^{-153}:\\
\;\;\;\;-1\\
\mathbf{elif}\;x \le 7.373518315070099961643182713875384049377 \cdot 10^{127}:\\
\;\;\;\;\sqrt[3]{\left(\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) \cdot \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)\right) \cdot \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)}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}double f(double x, double y) {
double r47587477 = x;
double r47587478 = r47587477 * r47587477;
double r47587479 = y;
double r47587480 = 4.0;
double r47587481 = r47587479 * r47587480;
double r47587482 = r47587481 * r47587479;
double r47587483 = r47587478 - r47587482;
double r47587484 = r47587478 + r47587482;
double r47587485 = r47587483 / r47587484;
return r47587485;
}
double f(double x, double y) {
double r47587486 = x;
double r47587487 = -4.754864512281886e+122;
bool r47587488 = r47587486 <= r47587487;
double r47587489 = 1.0;
double r47587490 = -4.332313917220749e+80;
bool r47587491 = r47587486 <= r47587490;
double r47587492 = -1.0;
double r47587493 = -9.211266202426182e+18;
bool r47587494 = r47587486 <= r47587493;
double r47587495 = r47587486 * r47587486;
double r47587496 = y;
double r47587497 = 4.0;
double r47587498 = r47587496 * r47587497;
double r47587499 = r47587498 * r47587496;
double r47587500 = r47587495 + r47587499;
double r47587501 = r47587495 / r47587500;
double r47587502 = r47587499 / r47587500;
double r47587503 = r47587501 - r47587502;
double r47587504 = 2.1395518106041052e-153;
bool r47587505 = r47587486 <= r47587504;
double r47587506 = 7.3735183150701e+127;
bool r47587507 = r47587486 <= r47587506;
double r47587508 = r47587503 * r47587503;
double r47587509 = r47587508 * r47587503;
double r47587510 = cbrt(r47587509);
double r47587511 = r47587507 ? r47587510 : r47587489;
double r47587512 = r47587505 ? r47587492 : r47587511;
double r47587513 = r47587494 ? r47587503 : r47587512;
double r47587514 = r47587491 ? r47587492 : r47587513;
double r47587515 = r47587488 ? r47587489 : r47587514;
return r47587515;
}




Bits error versus x




Bits error versus y
Results
| Original | 31.4 |
|---|---|
| Target | 31.1 |
| Herbie | 13.8 |
if x < -4.754864512281886e+122 or 7.3735183150701e+127 < x Initial program 56.1
Taylor expanded around inf 9.9
if -4.754864512281886e+122 < x < -4.332313917220749e+80 or -9.211266202426182e+18 < x < 2.1395518106041052e-153Initial program 24.5
Taylor expanded around 0 15.6
if -4.332313917220749e+80 < x < -9.211266202426182e+18Initial program 17.5
rmApplied div-sub17.5
if 2.1395518106041052e-153 < x < 7.3735183150701e+127Initial program 14.8
rmApplied div-sub14.8
rmApplied add-cbrt-cube14.8
Final simplification13.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))))