\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 r145921 = N;
double r145922 = 1.0;
double r145923 = r145921 + r145922;
double r145924 = atan(r145923);
double r145925 = atan(r145921);
double r145926 = r145924 - r145925;
return r145926;
}
double f(double N) {
double r145927 = 1.0;
double r145928 = N;
double r145929 = r145928 + r145927;
double r145930 = 1.0;
double r145931 = fma(r145928, r145929, r145930);
double r145932 = atan2(r145927, r145931);
return r145932;
}




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