\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 r116626 = N;
double r116627 = 1.0;
double r116628 = r116626 + r116627;
double r116629 = atan(r116628);
double r116630 = atan(r116626);
double r116631 = r116629 - r116630;
return r116631;
}
double f(double N) {
double r116632 = 1.0;
double r116633 = N;
double r116634 = r116633 + r116632;
double r116635 = 1.0;
double r116636 = fma(r116633, r116634, r116635);
double r116637 = atan2(r116632, r116636);
return r116637;
}




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