\tan^{-1} \left(N + 1\right) - \tan^{-1} N\tan^{-1}_* \frac{1}{\mathsf{fma}\left(N, N + 1, 1\right)}double f(double N) {
double r193166 = N;
double r193167 = 1.0;
double r193168 = r193166 + r193167;
double r193169 = atan(r193168);
double r193170 = atan(r193166);
double r193171 = r193169 - r193170;
return r193171;
}
double f(double N) {
double r193172 = 1.0;
double r193173 = N;
double r193174 = r193173 + r193172;
double r193175 = 1.0;
double r193176 = fma(r193173, r193174, r193175);
double r193177 = atan2(r193172, r193176);
return r193177;
}




Bits error versus N
| Original | 14.9 |
|---|---|
| Target | 0.3 |
| Herbie | 0.3 |
Initial program 14.9
rmApplied diff-atan13.8
Simplified0.3
Simplified0.3
Final simplification0.3
herbie shell --seed 2020047 +o rules:numerics
(FPCore (N)
:name "2atan (example 3.5)"
:precision binary64
:herbie-target
(atan (/ 1 (+ 1 (* N (+ N 1)))))
(- (atan (+ N 1)) (atan N)))