\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 r104786 = N;
double r104787 = 1.0;
double r104788 = r104786 + r104787;
double r104789 = atan(r104788);
double r104790 = atan(r104786);
double r104791 = r104789 - r104790;
return r104791;
}
double f(double N) {
double r104792 = 1.0;
double r104793 = N;
double r104794 = r104793 + r104792;
double r104795 = 1.0;
double r104796 = fma(r104793, r104794, r104795);
double r104797 = atan2(r104792, r104796);
return r104797;
}




Bits error versus N
| Original | 15.1 |
|---|---|
| Target | 0.4 |
| Herbie | 0.4 |
Initial program 15.1
rmApplied diff-atan14.1
Simplified0.4
Simplified0.4
Final simplification0.4
herbie shell --seed 2019323 +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)))