\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 r953820 = x;
double r953821 = r953820 * r953820;
double r953822 = y;
double r953823 = 4.0;
double r953824 = r953822 * r953823;
double r953825 = r953824 * r953822;
double r953826 = r953821 - r953825;
double r953827 = r953821 + r953825;
double r953828 = r953826 / r953827;
return r953828;
}
double f(double x, double y) {
double r953829 = x;
double r953830 = -4.0084779007164915e+147;
bool r953831 = r953829 <= r953830;
double r953832 = 1.0;
double r953833 = -4.167809066364824e-05;
bool r953834 = r953829 <= r953833;
double r953835 = r953829 * r953829;
double r953836 = y;
double r953837 = 4.0;
double r953838 = r953836 * r953837;
double r953839 = r953838 * r953836;
double r953840 = r953835 - r953839;
double r953841 = r953835 + r953839;
double r953842 = r953840 / r953841;
double r953843 = cbrt(r953842);
double r953844 = r953843 * r953843;
double r953845 = r953844 * r953843;
double r953846 = 4.333550517720129e-137;
bool r953847 = r953829 <= r953846;
double r953848 = -1.0;
double r953849 = 4.237678441195004e+65;
bool r953850 = r953829 <= r953849;
double r953851 = r953850 ? r953845 : r953832;
double r953852 = r953847 ? r953848 : r953851;
double r953853 = r953834 ? r953845 : r953852;
double r953854 = r953831 ? r953832 : r953853;
return r953854;
}




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 +o rules:numerics
(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))))