\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 r177850 = N;
double r177851 = 1.0;
double r177852 = r177850 + r177851;
double r177853 = atan(r177852);
double r177854 = atan(r177850);
double r177855 = r177853 - r177854;
return r177855;
}
double f(double N) {
double r177856 = 1.0;
double r177857 = 1.0;
double r177858 = N;
double r177859 = r177858 + r177856;
double r177860 = r177859 * r177858;
double r177861 = r177857 + r177860;
double r177862 = atan2(r177856, r177861);
return r177862;
}




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