\tan^{-1} \left(N + 1\right) - \tan^{-1} N\tan^{-1}_* \frac{1}{N + \left(1 + N \cdot N\right)}double f(double N) {
double r5371607 = N;
double r5371608 = 1.0;
double r5371609 = r5371607 + r5371608;
double r5371610 = atan(r5371609);
double r5371611 = atan(r5371607);
double r5371612 = r5371610 - r5371611;
return r5371612;
}
double f(double N) {
double r5371613 = 1.0;
double r5371614 = N;
double r5371615 = r5371614 * r5371614;
double r5371616 = r5371613 + r5371615;
double r5371617 = r5371614 + r5371616;
double r5371618 = atan2(r5371613, r5371617);
return r5371618;
}




Bits error versus N
Results
| Original | 14.9 |
|---|---|
| Target | 0.4 |
| Herbie | 0.4 |
Initial program 14.9
rmApplied diff-atan13.7
Simplified0.4
rmApplied add-sqr-sqrt1.0
rmApplied add-sqr-sqrt1.0
Applied sqrt-prod0.6
Taylor expanded around 0 0.4
Simplified0.4
Final simplification0.4
herbie shell --seed 2019163
(FPCore (N)
:name "2atan (example 3.5)"
:herbie-target
(atan (/ 1 (+ 1 (* N (+ N 1)))))
(- (atan (+ N 1)) (atan N)))