\tan^{-1} \left(N + 1\right) - \tan^{-1} N\tan^{-1}_* \frac{1}{\mathsf{fma}\left(N, N + 1, 1\right)}double f(double N) {
double r133448 = N;
double r133449 = 1.0;
double r133450 = r133448 + r133449;
double r133451 = atan(r133450);
double r133452 = atan(r133448);
double r133453 = r133451 - r133452;
return r133453;
}
double f(double N) {
double r133454 = 1.0;
double r133455 = N;
double r133456 = r133455 + r133454;
double r133457 = 1.0;
double r133458 = fma(r133455, r133456, r133457);
double r133459 = atan2(r133454, r133458);
return r133459;
}




Bits error versus N
| Original | 15.3 |
|---|---|
| Target | 0.4 |
| Herbie | 0.4 |
Initial program 15.3
rmApplied diff-atan14.1
Simplified0.4
Simplified0.4
Final simplification0.4
herbie shell --seed 2020042 +o rules:numerics
(FPCore (N)
:name "2atan (example 3.5)"
:precision binary64
:herbie-target
(atan (/ 1 (+ 1 (* N (+ N 1)))))
(- (atan (+ N 1)) (atan N)))