\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 -2.2576090032348994 \cdot 10^{-207} \lor \neg \left(y \le 1.1707538281815936 \cdot 10^{-226}\right):\\
\;\;\;\;\frac{x}{\mathsf{fma}\left(4, \frac{{y}^{1}}{\frac{x}{y}}, x\right)} - \frac{y \cdot 4}{\mathsf{fma}\left(4, y, \frac{{x}^{2}}{y}\right)}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}double f(double x, double y) {
double r684073 = x;
double r684074 = r684073 * r684073;
double r684075 = y;
double r684076 = 4.0;
double r684077 = r684075 * r684076;
double r684078 = r684077 * r684075;
double r684079 = r684074 - r684078;
double r684080 = r684074 + r684078;
double r684081 = r684079 / r684080;
return r684081;
}
double f(double x, double y) {
double r684082 = y;
double r684083 = -2.2576090032348994e-207;
bool r684084 = r684082 <= r684083;
double r684085 = 1.1707538281815936e-226;
bool r684086 = r684082 <= r684085;
double r684087 = !r684086;
bool r684088 = r684084 || r684087;
double r684089 = x;
double r684090 = 4.0;
double r684091 = 1.0;
double r684092 = pow(r684082, r684091);
double r684093 = r684089 / r684082;
double r684094 = r684092 / r684093;
double r684095 = fma(r684090, r684094, r684089);
double r684096 = r684089 / r684095;
double r684097 = r684082 * r684090;
double r684098 = 2.0;
double r684099 = pow(r684089, r684098);
double r684100 = r684099 / r684082;
double r684101 = fma(r684090, r684082, r684100);
double r684102 = r684097 / r684101;
double r684103 = r684096 - r684102;
double r684104 = r684088 ? r684103 : r684091;
return r684104;
}




Bits error versus x




Bits error versus y
| Original | 31.2 |
|---|---|
| Target | 30.9 |
| Herbie | 3.0 |
if y < -2.2576090032348994e-207 or 1.1707538281815936e-226 < y Initial program 31.1
rmApplied div-sub31.1
Simplified30.8
Simplified30.3
Taylor expanded around 0 16.9
Simplified16.9
Taylor expanded around 0 5.9
Simplified5.9
rmApplied sqr-pow5.9
Applied associate-/l*2.6
Simplified2.6
if -2.2576090032348994e-207 < y < 1.1707538281815936e-226Initial program 31.8
Taylor expanded around inf 4.9
Final simplification3.0
herbie shell --seed 2020035 +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))))