\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 r150000 = N;
double r150001 = 1.0;
double r150002 = r150000 + r150001;
double r150003 = atan(r150002);
double r150004 = atan(r150000);
double r150005 = r150003 - r150004;
return r150005;
}
double f(double N) {
double r150006 = 1.0;
double r150007 = 1.0;
double r150008 = N;
double r150009 = r150008 + r150006;
double r150010 = r150009 * r150008;
double r150011 = r150007 + r150010;
double r150012 = atan2(r150006, r150011);
return r150012;
}




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 2019208
(FPCore (N)
:name "2atan (example 3.5)"
:precision binary64
:herbie-target
(atan (/ 1 (+ 1 (* N (+ N 1)))))
(- (atan (+ N 1)) (atan N)))