\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 r144650 = N;
double r144651 = 1.0;
double r144652 = r144650 + r144651;
double r144653 = atan(r144652);
double r144654 = atan(r144650);
double r144655 = r144653 - r144654;
return r144655;
}
double f(double N) {
double r144656 = 1.0;
double r144657 = N;
double r144658 = r144657 + r144656;
double r144659 = 1.0;
double r144660 = fma(r144657, r144658, r144659);
double r144661 = atan2(r144656, r144660);
return r144661;
}




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