\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 r77463 = N;
double r77464 = 1.0;
double r77465 = r77463 + r77464;
double r77466 = atan(r77465);
double r77467 = atan(r77463);
double r77468 = r77466 - r77467;
return r77468;
}
double f(double N) {
double r77469 = 1.0;
double r77470 = N;
double r77471 = r77470 + r77469;
double r77472 = 1.0;
double r77473 = fma(r77470, r77471, r77472);
double r77474 = atan2(r77469, r77473);
return r77474;
}




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