\tan^{-1} \left(N + 1\right) - \tan^{-1} N\tan^{-1}_* \frac{1}{1 + \left(N + 1\right) \cdot N}double f(double N) {
double r153678 = N;
double r153679 = 1.0;
double r153680 = r153678 + r153679;
double r153681 = atan(r153680);
double r153682 = atan(r153678);
double r153683 = r153681 - r153682;
return r153683;
}
double f(double N) {
double r153684 = 1.0;
double r153685 = 1.0;
double r153686 = N;
double r153687 = r153686 + r153684;
double r153688 = r153687 * r153686;
double r153689 = r153685 + r153688;
double r153690 = atan2(r153684, r153689);
return r153690;
}




Bits error versus N
Results
| Original | 14.8 |
|---|---|
| Target | 0.4 |
| Herbie | 0.4 |
Initial program 14.8
rmApplied diff-atan13.7
Simplified0.4
Final simplification0.4
herbie shell --seed 2020036
(FPCore (N)
:name "2atan (example 3.5)"
:precision binary64
:herbie-target
(atan (/ 1 (+ 1 (* N (+ N 1)))))
(- (atan (+ N 1)) (atan N)))