\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 r100022 = N;
double r100023 = 1.0;
double r100024 = r100022 + r100023;
double r100025 = atan(r100024);
double r100026 = atan(r100022);
double r100027 = r100025 - r100026;
return r100027;
}
double f(double N) {
double r100028 = 1.0;
double r100029 = 1.0;
double r100030 = N;
double r100031 = r100030 + r100028;
double r100032 = r100031 * r100030;
double r100033 = r100029 + r100032;
double r100034 = atan2(r100028, r100033);
return r100034;
}




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