\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 r171476 = N;
double r171477 = 1.0;
double r171478 = r171476 + r171477;
double r171479 = atan(r171478);
double r171480 = atan(r171476);
double r171481 = r171479 - r171480;
return r171481;
}
double f(double N) {
double r171482 = 1.0;
double r171483 = N;
double r171484 = r171483 + r171482;
double r171485 = 1.0;
double r171486 = fma(r171483, r171484, r171485);
double r171487 = atan2(r171482, r171486);
return r171487;
}




Bits error versus N
| Original | 15.6 |
|---|---|
| Target | 0.5 |
| Herbie | 0.5 |
Initial program 15.6
rmApplied diff-atan14.3
Simplified0.5
Simplified0.5
Final simplification0.5
herbie shell --seed 2020025 +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)))