\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 r77541 = N;
double r77542 = 1.0;
double r77543 = r77541 + r77542;
double r77544 = atan(r77543);
double r77545 = atan(r77541);
double r77546 = r77544 - r77545;
return r77546;
}
double f(double N) {
double r77547 = 1.0;
double r77548 = N;
double r77549 = r77548 + r77547;
double r77550 = 1.0;
double r77551 = fma(r77548, r77549, r77550);
double r77552 = atan2(r77547, r77551);
return r77552;
}




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