\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 r146836 = N;
double r146837 = 1.0;
double r146838 = r146836 + r146837;
double r146839 = atan(r146838);
double r146840 = atan(r146836);
double r146841 = r146839 - r146840;
return r146841;
}
double f(double N) {
double r146842 = 1.0;
double r146843 = 1.0;
double r146844 = N;
double r146845 = r146844 + r146842;
double r146846 = r146845 * r146844;
double r146847 = r146843 + r146846;
double r146848 = atan2(r146842, r146847);
return r146848;
}




Bits error versus N
Results
| Original | 14.9 |
|---|---|
| Target | 0.3 |
| Herbie | 0.3 |
Initial program 14.9
rmApplied diff-atan13.9
Simplified0.3
Final simplification0.3
herbie shell --seed 2019350
(FPCore (N)
:name "2atan (example 3.5)"
:precision binary64
:herbie-target
(atan (/ 1 (+ 1 (* N (+ N 1)))))
(- (atan (+ N 1)) (atan N)))