\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 r116293 = N;
double r116294 = 1.0;
double r116295 = r116293 + r116294;
double r116296 = atan(r116295);
double r116297 = atan(r116293);
double r116298 = r116296 - r116297;
return r116298;
}
double f(double N) {
double r116299 = 1.0;
double r116300 = N;
double r116301 = r116300 + r116299;
double r116302 = 1.0;
double r116303 = fma(r116300, r116301, r116302);
double r116304 = atan2(r116299, r116303);
return r116304;
}




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