\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 r101548 = N;
double r101549 = 1.0;
double r101550 = r101548 + r101549;
double r101551 = atan(r101550);
double r101552 = atan(r101548);
double r101553 = r101551 - r101552;
return r101553;
}
double f(double N) {
double r101554 = 1.0;
double r101555 = N;
double r101556 = r101555 + r101554;
double r101557 = 1.0;
double r101558 = fma(r101555, r101556, r101557);
double r101559 = atan2(r101554, r101558);
return r101559;
}




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