\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 r237178 = N;
double r237179 = 1.0;
double r237180 = r237178 + r237179;
double r237181 = atan(r237180);
double r237182 = atan(r237178);
double r237183 = r237181 - r237182;
return r237183;
}
double f(double N) {
double r237184 = 1.0;
double r237185 = 1.0;
double r237186 = N;
double r237187 = r237186 + r237184;
double r237188 = r237187 * r237186;
double r237189 = r237185 + r237188;
double r237190 = atan2(r237184, r237189);
return r237190;
}




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