\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.688721359903120564949235071844216306814 \cdot 10^{100}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \le -7.394329418796278633272453346909757071051 \cdot 10^{-66}:\\
\;\;\;\;\frac{x \cdot x}{\left(y \cdot 4\right) \cdot y + x \cdot x} - \sqrt[3]{\left(\frac{\left(y \cdot 4\right) \cdot y}{\left(y \cdot 4\right) \cdot y + x \cdot x} \cdot \frac{\left(y \cdot 4\right) \cdot y}{\left(y \cdot 4\right) \cdot y + x \cdot x}\right) \cdot \frac{\left(y \cdot 4\right) \cdot y}{\left(y \cdot 4\right) \cdot y + x \cdot x}}\\
\mathbf{elif}\;x \le 8.394176110344906536659390600257739023023 \cdot 10^{-193}:\\
\;\;\;\;-1\\
\mathbf{elif}\;x \le 5.306478096987979835000926393717769469618 \cdot 10^{92}:\\
\;\;\;\;\frac{x \cdot x}{\left(y \cdot 4\right) \cdot y + x \cdot x} - \log \left(e^{\frac{\left(y \cdot 4\right) \cdot y}{\left(y \cdot 4\right) \cdot y + x \cdot x}}\right)\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}double f(double x, double y) {
double r17009592 = x;
double r17009593 = r17009592 * r17009592;
double r17009594 = y;
double r17009595 = 4.0;
double r17009596 = r17009594 * r17009595;
double r17009597 = r17009596 * r17009594;
double r17009598 = r17009593 - r17009597;
double r17009599 = r17009593 + r17009597;
double r17009600 = r17009598 / r17009599;
return r17009600;
}
double f(double x, double y) {
double r17009601 = x;
double r17009602 = -1.6887213599031206e+100;
bool r17009603 = r17009601 <= r17009602;
double r17009604 = 1.0;
double r17009605 = -7.394329418796279e-66;
bool r17009606 = r17009601 <= r17009605;
double r17009607 = r17009601 * r17009601;
double r17009608 = y;
double r17009609 = 4.0;
double r17009610 = r17009608 * r17009609;
double r17009611 = r17009610 * r17009608;
double r17009612 = r17009611 + r17009607;
double r17009613 = r17009607 / r17009612;
double r17009614 = r17009611 / r17009612;
double r17009615 = r17009614 * r17009614;
double r17009616 = r17009615 * r17009614;
double r17009617 = cbrt(r17009616);
double r17009618 = r17009613 - r17009617;
double r17009619 = 8.394176110344907e-193;
bool r17009620 = r17009601 <= r17009619;
double r17009621 = -1.0;
double r17009622 = 5.30647809698798e+92;
bool r17009623 = r17009601 <= r17009622;
double r17009624 = exp(r17009614);
double r17009625 = log(r17009624);
double r17009626 = r17009613 - r17009625;
double r17009627 = r17009623 ? r17009626 : r17009604;
double r17009628 = r17009620 ? r17009621 : r17009627;
double r17009629 = r17009606 ? r17009618 : r17009628;
double r17009630 = r17009603 ? r17009604 : r17009629;
return r17009630;
}




Bits error versus x




Bits error versus y
Results
| Original | 31.8 |
|---|---|
| Target | 31.5 |
| Herbie | 12.9 |
if x < -1.6887213599031206e+100 or 5.30647809698798e+92 < x Initial program 50.9
Taylor expanded around inf 11.0
if -1.6887213599031206e+100 < x < -7.394329418796279e-66Initial program 16.4
rmApplied div-sub16.4
rmApplied add-cbrt-cube16.4
if -7.394329418796279e-66 < x < 8.394176110344907e-193Initial program 27.5
Taylor expanded around 0 10.8
if 8.394176110344907e-193 < x < 5.30647809698798e+92Initial program 16.5
rmApplied div-sub16.5
rmApplied add-log-exp16.5
Final simplification12.9
herbie shell --seed 2019171
(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))))