\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 r149026 = N;
double r149027 = 1.0;
double r149028 = r149026 + r149027;
double r149029 = atan(r149028);
double r149030 = atan(r149026);
double r149031 = r149029 - r149030;
return r149031;
}
double f(double N) {
double r149032 = 1.0;
double r149033 = 1.0;
double r149034 = N;
double r149035 = r149034 + r149032;
double r149036 = r149035 * r149034;
double r149037 = r149033 + r149036;
double r149038 = atan2(r149032, r149037);
return r149038;
}




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