\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 r166536 = N;
double r166537 = 1.0;
double r166538 = r166536 + r166537;
double r166539 = atan(r166538);
double r166540 = atan(r166536);
double r166541 = r166539 - r166540;
return r166541;
}
double f(double N) {
double r166542 = 1.0;
double r166543 = N;
double r166544 = r166543 + r166542;
double r166545 = 1.0;
double r166546 = fma(r166543, r166544, r166545);
double r166547 = atan2(r166542, r166546);
return r166547;
}




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