\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 r149670 = N;
double r149671 = 1.0;
double r149672 = r149670 + r149671;
double r149673 = atan(r149672);
double r149674 = atan(r149670);
double r149675 = r149673 - r149674;
return r149675;
}
double f(double N) {
double r149676 = 1.0;
double r149677 = N;
double r149678 = r149677 + r149676;
double r149679 = 1.0;
double r149680 = fma(r149677, r149678, r149679);
double r149681 = atan2(r149676, r149680);
return r149681;
}




Bits error versus N
| Original | 14.7 |
|---|---|
| Target | 0.3 |
| Herbie | 0.3 |
Initial program 14.7
rmApplied diff-atan13.5
Simplified0.3
Simplified0.3
Final simplification0.3
herbie shell --seed 2020024 +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)))