\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 r660584 = x;
double r660585 = r660584 * r660584;
double r660586 = y;
double r660587 = 4.0;
double r660588 = r660586 * r660587;
double r660589 = r660588 * r660586;
double r660590 = r660585 - r660589;
double r660591 = r660585 + r660589;
double r660592 = r660590 / r660591;
return r660592;
}
double f(double x, double y) {
double r660593 = x;
double r660594 = r660593 * r660593;
double r660595 = 9.283965764610774e-276;
bool r660596 = r660594 <= r660595;
double r660597 = -1.0;
double r660598 = 2.440219134958563e-149;
bool r660599 = r660594 <= r660598;
double r660600 = y;
double r660601 = 4.0;
double r660602 = r660600 * r660601;
double r660603 = r660602 * r660600;
double r660604 = r660594 - r660603;
double r660605 = r660594 + r660603;
double r660606 = r660604 / r660605;
double r660607 = cbrt(r660606);
double r660608 = r660607 * r660607;
double r660609 = r660608 * r660607;
double r660610 = 3.329685575724472e-82;
bool r660611 = r660594 <= r660610;
double r660612 = 4.2506266048630395e+263;
bool r660613 = r660594 <= r660612;
double r660614 = 1.0;
double r660615 = r660613 ? r660606 : r660614;
double r660616 = r660611 ? r660597 : r660615;
double r660617 = r660599 ? r660609 : r660616;
double r660618 = r660596 ? r660597 : r660617;
return r660618;
}




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))))