\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 r154832 = N;
double r154833 = 1.0;
double r154834 = r154832 + r154833;
double r154835 = atan(r154834);
double r154836 = atan(r154832);
double r154837 = r154835 - r154836;
return r154837;
}
double f(double N) {
double r154838 = 1.0;
double r154839 = 1.0;
double r154840 = N;
double r154841 = r154840 + r154838;
double r154842 = r154841 * r154840;
double r154843 = r154839 + r154842;
double r154844 = atan2(r154838, r154843);
return r154844;
}




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