\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}\;y \le -8.629188524547341 \cdot 10^{-170} \lor \neg \left(y \le 1.9187342776890177 \cdot 10^{-228}\right):\\
\;\;\;\;\frac{x}{\mathsf{fma}\left(4, \frac{y}{\frac{x}{y}}, x\right)} - \frac{y \cdot 4}{\mathsf{fma}\left(4, y, \frac{{x}^{2}}{y}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\mathsf{fma}\left(4, \frac{y}{\frac{x}{y}}, x\right)} - 0\\
\end{array}double f(double x, double y) {
double r675887 = x;
double r675888 = r675887 * r675887;
double r675889 = y;
double r675890 = 4.0;
double r675891 = r675889 * r675890;
double r675892 = r675891 * r675889;
double r675893 = r675888 - r675892;
double r675894 = r675888 + r675892;
double r675895 = r675893 / r675894;
return r675895;
}
double f(double x, double y) {
double r675896 = y;
double r675897 = -8.629188524547341e-170;
bool r675898 = r675896 <= r675897;
double r675899 = 1.9187342776890177e-228;
bool r675900 = r675896 <= r675899;
double r675901 = !r675900;
bool r675902 = r675898 || r675901;
double r675903 = x;
double r675904 = 4.0;
double r675905 = r675903 / r675896;
double r675906 = r675896 / r675905;
double r675907 = fma(r675904, r675906, r675903);
double r675908 = r675903 / r675907;
double r675909 = r675896 * r675904;
double r675910 = 2.0;
double r675911 = pow(r675903, r675910);
double r675912 = r675911 / r675896;
double r675913 = fma(r675904, r675896, r675912);
double r675914 = r675909 / r675913;
double r675915 = r675908 - r675914;
double r675916 = 0.0;
double r675917 = r675908 - r675916;
double r675918 = r675902 ? r675915 : r675917;
return r675918;
}




Bits error versus x




Bits error versus y
| Original | 32.0 |
|---|---|
| Target | 31.7 |
| Herbie | 3.8 |
if y < -8.629188524547341e-170 or 1.9187342776890177e-228 < y Initial program 32.2
rmApplied div-sub32.2
Simplified31.9
Simplified31.4
Taylor expanded around 0 20.7
Simplified20.7
rmApplied unpow220.7
Applied associate-/l*18.4
Taylor expanded around 0 3.2
Simplified3.2
if -8.629188524547341e-170 < y < 1.9187342776890177e-228Initial program 31.0
rmApplied div-sub31.0
Simplified31.0
Simplified31.0
Taylor expanded around 0 15.6
Simplified15.6
rmApplied unpow215.6
Applied associate-/l*15.6
Taylor expanded around 0 6.4
Final simplification3.8
herbie shell --seed 2020083 +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))))