\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 r443 = N;
double r444 = 1.0;
double r445 = r443 + r444;
double r446 = atan(r445);
double r447 = atan(r443);
double r448 = r446 - r447;
return r448;
}
double f(double N) {
double r449 = 1.0;
double r450 = N;
double r451 = r450 + r449;
double r452 = 1.0;
double r453 = fma(r450, r451, r452);
double r454 = atan2(r449, r453);
return r454;
}




Bits error versus N
| Original | 15.6 |
|---|---|
| Target | 0.5 |
| Herbie | 0.5 |
Initial program 15.6
rmApplied diff-atan14.3
Simplified0.5
Simplified0.5
Final simplification0.5
herbie shell --seed 2020025 +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)))