\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 r218079 = N;
double r218080 = 1.0;
double r218081 = r218079 + r218080;
double r218082 = atan(r218081);
double r218083 = atan(r218079);
double r218084 = r218082 - r218083;
return r218084;
}
double f(double N) {
double r218085 = 1.0;
double r218086 = 1.0;
double r218087 = N;
double r218088 = r218087 + r218085;
double r218089 = r218088 * r218087;
double r218090 = r218086 + r218089;
double r218091 = atan2(r218085, r218090);
return r218091;
}




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