\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 r114714 = N;
double r114715 = 1.0;
double r114716 = r114714 + r114715;
double r114717 = atan(r114716);
double r114718 = atan(r114714);
double r114719 = r114717 - r114718;
return r114719;
}
double f(double N) {
double r114720 = 1.0;
double r114721 = N;
double r114722 = r114721 + r114720;
double r114723 = 1.0;
double r114724 = fma(r114721, r114722, r114723);
double r114725 = atan2(r114720, r114724);
return r114725;
}




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