\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 r169351 = N;
double r169352 = 1.0;
double r169353 = r169351 + r169352;
double r169354 = atan(r169353);
double r169355 = atan(r169351);
double r169356 = r169354 - r169355;
return r169356;
}
double f(double N) {
double r169357 = 1.0;
double r169358 = N;
double r169359 = r169358 + r169357;
double r169360 = 1.0;
double r169361 = fma(r169358, r169359, r169360);
double r169362 = atan2(r169357, r169361);
return r169362;
}




Bits error versus N
| Original | 14.6 |
|---|---|
| Target | 0.4 |
| Herbie | 0.4 |
Initial program 14.6
rmApplied diff-atan13.7
Simplified0.4
Simplified0.4
Final simplification0.4
herbie shell --seed 2020021 +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)))