\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 r127905 = N;
double r127906 = 1.0;
double r127907 = r127905 + r127906;
double r127908 = atan(r127907);
double r127909 = atan(r127905);
double r127910 = r127908 - r127909;
return r127910;
}
double f(double N) {
double r127911 = 1.0;
double r127912 = 1.0;
double r127913 = N;
double r127914 = r127913 + r127911;
double r127915 = r127914 * r127913;
double r127916 = r127912 + r127915;
double r127917 = atan2(r127911, r127916);
return r127917;
}




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