\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 r99680 = N;
double r99681 = 1.0;
double r99682 = r99680 + r99681;
double r99683 = atan(r99682);
double r99684 = atan(r99680);
double r99685 = r99683 - r99684;
return r99685;
}
double f(double N) {
double r99686 = 1.0;
double r99687 = 1.0;
double r99688 = N;
double r99689 = r99688 + r99686;
double r99690 = r99689 * r99688;
double r99691 = r99687 + r99690;
double r99692 = atan2(r99686, r99691);
return r99692;
}




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