\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 -4.00847790071649149 \cdot 10^{147}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \le -4.16780906636482433 \cdot 10^{-5}:\\
\;\;\;\;\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 \le 4.3335505177201293 \cdot 10^{-137}:\\
\;\;\;\;-1\\
\mathbf{elif}\;x \le 4.23767844119500403 \cdot 10^{65}:\\
\;\;\;\;\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{else}:\\
\;\;\;\;1\\
\end{array}double f(double x, double y) {
double r620866 = x;
double r620867 = r620866 * r620866;
double r620868 = y;
double r620869 = 4.0;
double r620870 = r620868 * r620869;
double r620871 = r620870 * r620868;
double r620872 = r620867 - r620871;
double r620873 = r620867 + r620871;
double r620874 = r620872 / r620873;
return r620874;
}
double f(double x, double y) {
double r620875 = x;
double r620876 = -4.0084779007164915e+147;
bool r620877 = r620875 <= r620876;
double r620878 = 1.0;
double r620879 = -4.167809066364824e-05;
bool r620880 = r620875 <= r620879;
double r620881 = r620875 * r620875;
double r620882 = y;
double r620883 = 4.0;
double r620884 = r620882 * r620883;
double r620885 = r620884 * r620882;
double r620886 = r620881 - r620885;
double r620887 = r620881 + r620885;
double r620888 = r620886 / r620887;
double r620889 = cbrt(r620888);
double r620890 = r620889 * r620889;
double r620891 = r620890 * r620889;
double r620892 = 4.333550517720129e-137;
bool r620893 = r620875 <= r620892;
double r620894 = -1.0;
double r620895 = 4.237678441195004e+65;
bool r620896 = r620875 <= r620895;
double r620897 = r620896 ? r620891 : r620878;
double r620898 = r620893 ? r620894 : r620897;
double r620899 = r620880 ? r620891 : r620898;
double r620900 = r620877 ? r620878 : r620899;
return r620900;
}




Bits error versus x




Bits error versus y
Results
| Original | 32.1 |
|---|---|
| Target | 31.7 |
| Herbie | 13.5 |
if x < -4.0084779007164915e+147 or 4.237678441195004e+65 < x Initial program 53.3
Taylor expanded around inf 11.2
if -4.0084779007164915e+147 < x < -4.167809066364824e-05 or 4.333550517720129e-137 < x < 4.237678441195004e+65Initial program 16.7
rmApplied add-cube-cbrt16.8
if -4.167809066364824e-05 < x < 4.333550517720129e-137Initial program 25.5
Taylor expanded around 0 13.0
Final simplification13.5
herbie shell --seed 2020034
(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))))