\tan^{-1} \left(N + 1\right) - \tan^{-1} N\tan^{-1}_* \frac{1}{\mathsf{fma}\left(N, \left(N + 1\right), 1\right)}double f(double N) {
double r12706979 = N;
double r12706980 = 1.0;
double r12706981 = r12706979 + r12706980;
double r12706982 = atan(r12706981);
double r12706983 = atan(r12706979);
double r12706984 = r12706982 - r12706983;
return r12706984;
}
double f(double N) {
double r12706985 = 1.0;
double r12706986 = N;
double r12706987 = r12706986 + r12706985;
double r12706988 = fma(r12706986, r12706987, r12706985);
double r12706989 = atan2(r12706985, r12706988);
return r12706989;
}




Bits error versus N
| Original | 15.2 |
|---|---|
| Target | 0.3 |
| Herbie | 0.3 |
Initial program 15.2
rmApplied diff-atan14.1
Simplified0.3
Simplified0.3
Final simplification0.3
herbie shell --seed 2019124 +o rules:numerics
(FPCore (N)
:name "2atan (example 3.5)"
:herbie-target
(atan (/ 1 (+ 1 (* N (+ N 1)))))
(- (atan (+ N 1)) (atan N)))