\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}\;\left(y \cdot 4\right) \cdot y \le 6.010110955400427711290288737724765706272 \cdot 10^{-319}:\\
\;\;\;\;1\\
\mathbf{elif}\;\left(y \cdot 4\right) \cdot y \le 1.549630575373215400330647286125311139548 \cdot 10^{-272}:\\
\;\;\;\;\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{elif}\;\left(y \cdot 4\right) \cdot y \le 8.384919188504056437881495846608147200526 \cdot 10^{-205}:\\
\;\;\;\;1\\
\mathbf{elif}\;\left(y \cdot 4\right) \cdot y \le 1.230641633292964574763409282421415265643 \cdot 10^{201}:\\
\;\;\;\;\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}:\\
\;\;\;\;\sqrt[3]{{\left(-1\right)}^{3}}\\
\end{array}double f(double x, double y) {
double r511614 = x;
double r511615 = r511614 * r511614;
double r511616 = y;
double r511617 = 4.0;
double r511618 = r511616 * r511617;
double r511619 = r511618 * r511616;
double r511620 = r511615 - r511619;
double r511621 = r511615 + r511619;
double r511622 = r511620 / r511621;
return r511622;
}
double f(double x, double y) {
double r511623 = y;
double r511624 = 4.0;
double r511625 = r511623 * r511624;
double r511626 = r511625 * r511623;
double r511627 = 6.0101109554004e-319;
bool r511628 = r511626 <= r511627;
double r511629 = 1.0;
double r511630 = 1.5496305753732154e-272;
bool r511631 = r511626 <= r511630;
double r511632 = x;
double r511633 = r511632 * r511632;
double r511634 = r511633 + r511626;
double r511635 = r511633 / r511634;
double r511636 = r511626 / r511634;
double r511637 = r511635 - r511636;
double r511638 = 3.0;
double r511639 = pow(r511637, r511638);
double r511640 = cbrt(r511639);
double r511641 = 8.384919188504056e-205;
bool r511642 = r511626 <= r511641;
double r511643 = 1.2306416332929646e+201;
bool r511644 = r511626 <= r511643;
double r511645 = 1.0;
double r511646 = -r511645;
double r511647 = pow(r511646, r511638);
double r511648 = cbrt(r511647);
double r511649 = r511644 ? r511640 : r511648;
double r511650 = r511642 ? r511629 : r511649;
double r511651 = r511631 ? r511640 : r511650;
double r511652 = r511628 ? r511629 : r511651;
return r511652;
}




Bits error versus x




Bits error versus y
Results
| Original | 31.6 |
|---|---|
| Target | 31.3 |
| Herbie | 12.8 |
if (* (* y 4.0) y) < 6.0101109554004e-319 or 1.5496305753732154e-272 < (* (* y 4.0) y) < 8.384919188504056e-205Initial program 28.4
Taylor expanded around inf 9.9
if 6.0101109554004e-319 < (* (* y 4.0) y) < 1.5496305753732154e-272 or 8.384919188504056e-205 < (* (* y 4.0) y) < 1.2306416332929646e+201Initial program 16.2
rmApplied div-sub16.2
rmApplied add-cbrt-cube16.2
Simplified16.2
if 1.2306416332929646e+201 < (* (* y 4.0) y) Initial program 51.8
rmApplied div-sub51.8
rmApplied add-cbrt-cube51.8
Simplified51.8
Taylor expanded around 0 11.5
Final simplification12.8
herbie shell --seed 2019291
(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))))