\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 r130804 = N;
double r130805 = 1.0;
double r130806 = r130804 + r130805;
double r130807 = atan(r130806);
double r130808 = atan(r130804);
double r130809 = r130807 - r130808;
return r130809;
}
double f(double N) {
double r130810 = 1.0;
double r130811 = 1.0;
double r130812 = N;
double r130813 = r130812 + r130810;
double r130814 = r130813 * r130812;
double r130815 = r130811 + r130814;
double r130816 = atan2(r130810, r130815);
return r130816;
}




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