\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 r142676 = N;
double r142677 = 1.0;
double r142678 = r142676 + r142677;
double r142679 = atan(r142678);
double r142680 = atan(r142676);
double r142681 = r142679 - r142680;
return r142681;
}
double f(double N) {
double r142682 = 1.0;
double r142683 = N;
double r142684 = r142683 + r142682;
double r142685 = 1.0;
double r142686 = fma(r142683, r142684, r142685);
double r142687 = atan2(r142682, r142686);
return r142687;
}




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