\tan^{-1} \left(N + 1\right) - \tan^{-1} N\tan^{-1}_* \frac{1}{1 + \left(N + 1\right) \cdot N}double f(double N) {
double r124980 = N;
double r124981 = 1.0;
double r124982 = r124980 + r124981;
double r124983 = atan(r124982);
double r124984 = atan(r124980);
double r124985 = r124983 - r124984;
return r124985;
}
double f(double N) {
double r124986 = 1.0;
double r124987 = 1.0;
double r124988 = N;
double r124989 = r124988 + r124986;
double r124990 = r124989 * r124988;
double r124991 = r124987 + r124990;
double r124992 = atan2(r124986, r124991);
return r124992;
}




Bits error versus N
Results
| Original | 14.5 |
|---|---|
| Target | 0.4 |
| Herbie | 0.4 |
Initial program 14.5
rmApplied diff-atan13.4
Simplified0.4
Final simplification0.4
herbie shell --seed 2020083
(FPCore (N)
:name "2atan (example 3.5)"
:precision binary64
:herbie-target
(atan (/ 1 (+ 1 (* N (+ N 1)))))
(- (atan (+ N 1)) (atan N)))