\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 r103437 = N;
double r103438 = 1.0;
double r103439 = r103437 + r103438;
double r103440 = atan(r103439);
double r103441 = atan(r103437);
double r103442 = r103440 - r103441;
return r103442;
}
double f(double N) {
double r103443 = 1.0;
double r103444 = N;
double r103445 = r103444 + r103443;
double r103446 = 1.0;
double r103447 = fma(r103444, r103445, r103446);
double r103448 = atan2(r103443, r103447);
return r103448;
}




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