\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 r109113 = N;
double r109114 = 1.0;
double r109115 = r109113 + r109114;
double r109116 = atan(r109115);
double r109117 = atan(r109113);
double r109118 = r109116 - r109117;
return r109118;
}
double f(double N) {
double r109119 = 1.0;
double r109120 = 1.0;
double r109121 = N;
double r109122 = r109121 + r109119;
double r109123 = r109122 * r109121;
double r109124 = r109120 + r109123;
double r109125 = atan2(r109119, r109124);
return r109125;
}




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