\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 -2.88499570758548 \cdot 10^{124}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \le -1.48182733090046945 \cdot 10^{-95}:\\
\;\;\;\;\sqrt[3]{{\left(\frac{x \cdot x - \left(y \cdot 4\right) \cdot y}{x \cdot x + \left(y \cdot 4\right) \cdot y}\right)}^{3}}\\
\mathbf{elif}\;x \le 8.2778672837026512 \cdot 10^{-137}:\\
\;\;\;\;-1\\
\mathbf{elif}\;x \le 1.42914357264318537:\\
\;\;\;\;\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.4875935555596149 \cdot 10^{44}:\\
\;\;\;\;-1\\
\mathbf{elif}\;x \le 1.30263506617115279 \cdot 10^{154}:\\
\;\;\;\;\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 code(double x, double y) {
return (((x * x) - ((y * 4.0) * y)) / ((x * x) + ((y * 4.0) * y)));
}
double code(double x, double y) {
double VAR;
if ((x <= -2.88499570758548e+124)) {
VAR = 1.0;
} else {
double VAR_1;
if ((x <= -1.4818273309004695e-95)) {
VAR_1 = cbrt(pow((((x * x) - ((y * 4.0) * y)) / ((x * x) + ((y * 4.0) * y))), 3.0));
} else {
double VAR_2;
if ((x <= 8.277867283702651e-137)) {
VAR_2 = -1.0;
} else {
double VAR_3;
if ((x <= 1.4291435726431854)) {
VAR_3 = (((x * x) - ((y * 4.0) * y)) / ((x * x) + ((y * 4.0) * y)));
} else {
double VAR_4;
if ((x <= 2.487593555559615e+44)) {
VAR_4 = -1.0;
} else {
double VAR_5;
if ((x <= 1.3026350661711528e+154)) {
VAR_5 = (((x * x) - ((y * 4.0) * y)) / ((x * x) + ((y * 4.0) * y)));
} else {
VAR_5 = 1.0;
}
VAR_4 = VAR_5;
}
VAR_3 = VAR_4;
}
VAR_2 = VAR_3;
}
VAR_1 = VAR_2;
}
VAR = VAR_1;
}
return VAR;
}




Bits error versus x




Bits error versus y
Results
| Original | 31.5 |
|---|---|
| Target | 31.3 |
| Herbie | 13.0 |
if x < -2.88499570758548e+124 or 1.3026350661711528e+154 < x Initial program 60.1
Taylor expanded around inf 9.7
if -2.88499570758548e+124 < x < -1.4818273309004695e-95Initial program 15.8
rmApplied add-cbrt-cube44.3
Applied add-cbrt-cube44.8
Applied cbrt-undiv44.8
Simplified15.8
if -1.4818273309004695e-95 < x < 8.277867283702651e-137 or 1.4291435726431854 < x < 2.487593555559615e+44Initial program 26.4
Taylor expanded around 0 12.4
if 8.277867283702651e-137 < x < 1.4291435726431854 or 2.487593555559615e+44 < x < 1.3026350661711528e+154Initial program 15.8
Final simplification13.0
herbie shell --seed 2020079
(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))))