\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 -1.10209323570294511 \cdot 10^{154}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \le -7.05570383594217736 \cdot 10^{-134}:\\
\;\;\;\;\frac{1}{\sqrt[3]{{\left(\frac{\mathsf{fma}\left(x, x, 4 \cdot {y}^{2}\right)}{\mathsf{fma}\left(x, x, -4 \cdot {y}^{2}\right)}\right)}^{3}}}\\
\mathbf{elif}\;x \le 3.30957855650517974 \cdot 10^{-97}:\\
\;\;\;\;-1\\
\mathbf{elif}\;x \le 2.70835173311075 \cdot 10^{105}:\\
\;\;\;\;\frac{1}{\sqrt[3]{{\left(\frac{\mathsf{fma}\left(x, x, 4 \cdot {y}^{2}\right)}{\mathsf{fma}\left(x, x, -4 \cdot {y}^{2}\right)}\right)}^{3}}}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}double f(double x, double y) {
double r625863 = x;
double r625864 = r625863 * r625863;
double r625865 = y;
double r625866 = 4.0;
double r625867 = r625865 * r625866;
double r625868 = r625867 * r625865;
double r625869 = r625864 - r625868;
double r625870 = r625864 + r625868;
double r625871 = r625869 / r625870;
return r625871;
}
double f(double x, double y) {
double r625872 = x;
double r625873 = -1.1020932357029451e+154;
bool r625874 = r625872 <= r625873;
double r625875 = 1.0;
double r625876 = -7.055703835942177e-134;
bool r625877 = r625872 <= r625876;
double r625878 = 4.0;
double r625879 = y;
double r625880 = 2.0;
double r625881 = pow(r625879, r625880);
double r625882 = r625878 * r625881;
double r625883 = fma(r625872, r625872, r625882);
double r625884 = -r625882;
double r625885 = fma(r625872, r625872, r625884);
double r625886 = r625883 / r625885;
double r625887 = 3.0;
double r625888 = pow(r625886, r625887);
double r625889 = cbrt(r625888);
double r625890 = r625875 / r625889;
double r625891 = 3.3095785565051797e-97;
bool r625892 = r625872 <= r625891;
double r625893 = -1.0;
double r625894 = 2.70835173311075e+105;
bool r625895 = r625872 <= r625894;
double r625896 = r625895 ? r625890 : r625875;
double r625897 = r625892 ? r625893 : r625896;
double r625898 = r625877 ? r625890 : r625897;
double r625899 = r625874 ? r625875 : r625898;
return r625899;
}




Bits error versus x




Bits error versus y
| Original | 32.4 |
|---|---|
| Target | 32.1 |
| Herbie | 12.2 |
if x < -1.1020932357029451e+154 or 2.70835173311075e+105 < x Initial program 57.5
Taylor expanded around inf 9.0
if -1.1020932357029451e+154 < x < -7.055703835942177e-134 or 3.3095785565051797e-97 < x < 2.70835173311075e+105Initial program 16.4
rmApplied clear-num16.4
Simplified16.4
rmApplied add-cbrt-cube45.7
Applied add-cbrt-cube45.6
Applied cbrt-undiv45.6
Simplified16.4
if -7.055703835942177e-134 < x < 3.3095785565051797e-97Initial program 28.8
Taylor expanded around 0 10.0
Final simplification12.2
herbie shell --seed 2020046 +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))))