\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 r138751 = N;
double r138752 = 1.0;
double r138753 = r138751 + r138752;
double r138754 = atan(r138753);
double r138755 = atan(r138751);
double r138756 = r138754 - r138755;
return r138756;
}
double f(double N) {
double r138757 = 1.0;
double r138758 = N;
double r138759 = r138758 + r138757;
double r138760 = 1.0;
double r138761 = fma(r138758, r138759, r138760);
double r138762 = atan2(r138757, r138761);
return r138762;
}




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)))