\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 r140283 = N;
double r140284 = 1.0;
double r140285 = r140283 + r140284;
double r140286 = atan(r140285);
double r140287 = atan(r140283);
double r140288 = r140286 - r140287;
return r140288;
}
double f(double N) {
double r140289 = 1.0;
double r140290 = N;
double r140291 = r140290 + r140289;
double r140292 = 1.0;
double r140293 = fma(r140290, r140291, r140292);
double r140294 = atan2(r140289, r140293);
return r140294;
}




Bits error versus N
| Original | 14.9 |
|---|---|
| Target | 0.4 |
| Herbie | 0.4 |
Initial program 14.9
rmApplied diff-atan13.9
Simplified0.4
Simplified0.4
Final simplification0.4
herbie shell --seed 2019356 +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)))