\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 r95248 = N;
double r95249 = 1.0;
double r95250 = r95248 + r95249;
double r95251 = atan(r95250);
double r95252 = atan(r95248);
double r95253 = r95251 - r95252;
return r95253;
}
double f(double N) {
double r95254 = 1.0;
double r95255 = 1.0;
double r95256 = N;
double r95257 = r95256 + r95254;
double r95258 = r95257 * r95256;
double r95259 = r95255 + r95258;
double r95260 = atan2(r95254, r95259);
return r95260;
}




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)))