\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 -1.4667592323261061 \cdot 10^{131}:\\
\;\;\;\;\sqrt[3]{1}\\
\mathbf{elif}\;x \le -8.0114334775173874 \cdot 10^{-117}:\\
\;\;\;\;\left(\sqrt[3]{\frac{x \cdot x - \left(y \cdot 4\right) \cdot y}{x \cdot x + \left(y \cdot 4\right) \cdot y}} \cdot \sqrt[3]{\frac{x \cdot x - \left(y \cdot 4\right) \cdot y}{x \cdot x + \left(y \cdot 4\right) \cdot y}}\right) \cdot \sqrt[3]{\frac{x \cdot x - \left(y \cdot 4\right) \cdot y}{x \cdot x + \left(y \cdot 4\right) \cdot y}}\\
\mathbf{elif}\;x \le 1.9644387956096076 \cdot 10^{-169}:\\
\;\;\;\;\sqrt[3]{-1}\\
\mathbf{elif}\;x \le 1.06815270095652453 \cdot 10^{-15}:\\
\;\;\;\;\left(\sqrt[3]{\frac{x \cdot x - \left(y \cdot 4\right) \cdot y}{x \cdot x + \left(y \cdot 4\right) \cdot y}} \cdot \sqrt[3]{\frac{x \cdot x - \left(y \cdot 4\right) \cdot y}{x \cdot x + \left(y \cdot 4\right) \cdot y}}\right) \cdot \sqrt[3]{\frac{x \cdot x - \left(y \cdot 4\right) \cdot y}{x \cdot x + \left(y \cdot 4\right) \cdot y}}\\
\mathbf{elif}\;x \le 2.0459804393047752 \cdot 10^{46}:\\
\;\;\;\;\sqrt[3]{-1}\\
\mathbf{else}:\\
\;\;\;\;\sqrt[3]{1}\\
\end{array}double f(double x, double y) {
double r604323 = x;
double r604324 = r604323 * r604323;
double r604325 = y;
double r604326 = 4.0;
double r604327 = r604325 * r604326;
double r604328 = r604327 * r604325;
double r604329 = r604324 - r604328;
double r604330 = r604324 + r604328;
double r604331 = r604329 / r604330;
return r604331;
}
double f(double x, double y) {
double r604332 = x;
double r604333 = -1.4667592323261061e+131;
bool r604334 = r604332 <= r604333;
double r604335 = 1.0;
double r604336 = cbrt(r604335);
double r604337 = -8.011433477517387e-117;
bool r604338 = r604332 <= r604337;
double r604339 = r604332 * r604332;
double r604340 = y;
double r604341 = 4.0;
double r604342 = r604340 * r604341;
double r604343 = r604342 * r604340;
double r604344 = r604339 - r604343;
double r604345 = r604339 + r604343;
double r604346 = r604344 / r604345;
double r604347 = cbrt(r604346);
double r604348 = r604347 * r604347;
double r604349 = r604348 * r604347;
double r604350 = 1.9644387956096076e-169;
bool r604351 = r604332 <= r604350;
double r604352 = -1.0;
double r604353 = cbrt(r604352);
double r604354 = 1.0681527009565245e-15;
bool r604355 = r604332 <= r604354;
double r604356 = 2.0459804393047752e+46;
bool r604357 = r604332 <= r604356;
double r604358 = r604357 ? r604353 : r604336;
double r604359 = r604355 ? r604349 : r604358;
double r604360 = r604351 ? r604353 : r604359;
double r604361 = r604338 ? r604349 : r604360;
double r604362 = r604334 ? r604336 : r604361;
return r604362;
}




Bits error versus x




Bits error versus y
Results
| Original | 31.8 |
|---|---|
| Target | 31.5 |
| Herbie | 13.4 |
if x < -1.4667592323261061e+131 or 2.0459804393047752e+46 < x Initial program 51.0
rmApplied add-cbrt-cube63.2
Applied add-cbrt-cube63.6
Applied cbrt-undiv63.6
Simplified51.0
Taylor expanded around inf 12.1
if -1.4667592323261061e+131 < x < -8.011433477517387e-117 or 1.9644387956096076e-169 < x < 1.0681527009565245e-15Initial program 15.6
rmApplied add-cube-cbrt15.6
if -8.011433477517387e-117 < x < 1.9644387956096076e-169 or 1.0681527009565245e-15 < x < 2.0459804393047752e+46Initial program 27.4
rmApplied add-cbrt-cube48.4
Applied add-cbrt-cube48.4
Applied cbrt-undiv48.4
Simplified27.4
Taylor expanded around 0 12.6
Final simplification13.4
herbie shell --seed 2020027
(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))))