\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 \cdot x \le 9.283965764610774 \cdot 10^{-276}:\\
\;\;\;\;-1\\
\mathbf{elif}\;x \cdot x \le 2.44021913495856318 \cdot 10^{-149}:\\
\;\;\;\;\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 \cdot x \le 3.32968557572447191 \cdot 10^{-82}:\\
\;\;\;\;-1\\
\mathbf{elif}\;x \cdot x \le 4.2506266048630395 \cdot 10^{263}:\\
\;\;\;\;\frac{x \cdot x - \left(y \cdot 4\right) \cdot y}{x \cdot x + \left(y \cdot 4\right) \cdot y}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}double f(double x, double y) {
double r728615 = x;
double r728616 = r728615 * r728615;
double r728617 = y;
double r728618 = 4.0;
double r728619 = r728617 * r728618;
double r728620 = r728619 * r728617;
double r728621 = r728616 - r728620;
double r728622 = r728616 + r728620;
double r728623 = r728621 / r728622;
return r728623;
}
double f(double x, double y) {
double r728624 = x;
double r728625 = r728624 * r728624;
double r728626 = 9.283965764610774e-276;
bool r728627 = r728625 <= r728626;
double r728628 = -1.0;
double r728629 = 2.440219134958563e-149;
bool r728630 = r728625 <= r728629;
double r728631 = y;
double r728632 = 4.0;
double r728633 = r728631 * r728632;
double r728634 = r728633 * r728631;
double r728635 = r728625 - r728634;
double r728636 = r728625 + r728634;
double r728637 = r728635 / r728636;
double r728638 = cbrt(r728637);
double r728639 = r728638 * r728638;
double r728640 = r728639 * r728638;
double r728641 = 3.329685575724472e-82;
bool r728642 = r728625 <= r728641;
double r728643 = 4.2506266048630395e+263;
bool r728644 = r728625 <= r728643;
double r728645 = 1.0;
double r728646 = r728644 ? r728637 : r728645;
double r728647 = r728642 ? r728628 : r728646;
double r728648 = r728630 ? r728640 : r728647;
double r728649 = r728627 ? r728628 : r728648;
return r728649;
}




Bits error versus x




Bits error versus y
Results
| Original | 31.8 |
|---|---|
| Target | 31.5 |
| Herbie | 12.9 |
if (* x x) < 9.283965764610774e-276 or 2.440219134958563e-149 < (* x x) < 3.329685575724472e-82Initial program 27.8
Taylor expanded around 0 12.0
if 9.283965764610774e-276 < (* x x) < 2.440219134958563e-149Initial program 16.4
rmApplied add-cube-cbrt16.4
if 3.329685575724472e-82 < (* x x) < 4.2506266048630395e+263Initial program 15.9
if 4.2506266048630395e+263 < (* x x) Initial program 58.0
Taylor expanded around inf 9.5
Final simplification12.9
herbie shell --seed 2020062
(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))))