\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 r83350 = N;
double r83351 = 1.0;
double r83352 = r83350 + r83351;
double r83353 = atan(r83352);
double r83354 = atan(r83350);
double r83355 = r83353 - r83354;
return r83355;
}
double f(double N) {
double r83356 = 1.0;
double r83357 = 1.0;
double r83358 = N;
double r83359 = r83358 + r83356;
double r83360 = r83359 * r83358;
double r83361 = r83357 + r83360;
double r83362 = atan2(r83356, r83361);
return r83362;
}




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