\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 r119131 = N;
double r119132 = 1.0;
double r119133 = r119131 + r119132;
double r119134 = atan(r119133);
double r119135 = atan(r119131);
double r119136 = r119134 - r119135;
return r119136;
}
double f(double N) {
double r119137 = 1.0;
double r119138 = 1.0;
double r119139 = N;
double r119140 = r119139 + r119137;
double r119141 = r119140 * r119139;
double r119142 = r119138 + r119141;
double r119143 = atan2(r119137, r119142);
return r119143;
}




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