\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:\\
\;\;\;\;\sqrt[3]{{\left(\frac{\mathsf{fma}\left(4, y \cdot \left(-y\right), x \cdot x\right)}{\mathsf{fma}\left(x, x, y \cdot \left(4 \cdot y\right)\right)}\right)}^{3}}\\
\mathbf{elif}\;x \le 2.139551810604105186057739335770012586275 \cdot 10^{-153}:\\
\;\;\;\;-1\\
\mathbf{elif}\;x \le 7.373518315070099961643182713875384049377 \cdot 10^{127}:\\
\;\;\;\;\sqrt[3]{{\left(\frac{\mathsf{fma}\left(4, y \cdot \left(-y\right), x \cdot x\right)}{\mathsf{fma}\left(x, x, y \cdot \left(4 \cdot y\right)\right)}\right)}^{3}}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}double f(double x, double y) {
double r398446 = x;
double r398447 = r398446 * r398446;
double r398448 = y;
double r398449 = 4.0;
double r398450 = r398448 * r398449;
double r398451 = r398450 * r398448;
double r398452 = r398447 - r398451;
double r398453 = r398447 + r398451;
double r398454 = r398452 / r398453;
return r398454;
}
double f(double x, double y) {
double r398455 = x;
double r398456 = -4.754864512281886e+122;
bool r398457 = r398455 <= r398456;
double r398458 = 1.0;
double r398459 = -4.332313917220749e+80;
bool r398460 = r398455 <= r398459;
double r398461 = -1.0;
double r398462 = -9.211266202426182e+18;
bool r398463 = r398455 <= r398462;
double r398464 = 4.0;
double r398465 = y;
double r398466 = -r398465;
double r398467 = r398465 * r398466;
double r398468 = r398455 * r398455;
double r398469 = fma(r398464, r398467, r398468);
double r398470 = r398464 * r398465;
double r398471 = r398465 * r398470;
double r398472 = fma(r398455, r398455, r398471);
double r398473 = r398469 / r398472;
double r398474 = 3.0;
double r398475 = pow(r398473, r398474);
double r398476 = cbrt(r398475);
double r398477 = 2.1395518106041052e-153;
bool r398478 = r398455 <= r398477;
double r398479 = 7.3735183150701e+127;
bool r398480 = r398455 <= r398479;
double r398481 = r398480 ? r398476 : r398458;
double r398482 = r398478 ? r398461 : r398481;
double r398483 = r398463 ? r398476 : r398482;
double r398484 = r398460 ? r398461 : r398483;
double r398485 = r398457 ? r398458 : r398484;
return r398485;
}




Bits error versus x




Bits error versus y
| Original | 31.4 |
|---|---|
| Target | 31.1 |
| Herbie | 13.8 |
if x < -4.754864512281886e+122 or 7.3735183150701e+127 < x Initial program 56.1
Simplified56.1
rmApplied clear-num56.1
Simplified56.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
Simplified24.5
Taylor expanded around inf 15.6
if -4.332313917220749e+80 < x < -9.211266202426182e+18 or 2.1395518106041052e-153 < x < 7.3735183150701e+127Initial program 15.3
Simplified15.3
rmApplied add-cbrt-cube44.8
Applied add-cbrt-cube45.2
Applied cbrt-undiv45.2
Simplified15.3
Final simplification13.8
herbie shell --seed 2019174 +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))))