\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 r78703 = N;
double r78704 = 1.0;
double r78705 = r78703 + r78704;
double r78706 = atan(r78705);
double r78707 = atan(r78703);
double r78708 = r78706 - r78707;
return r78708;
}
double f(double N) {
double r78709 = 1.0;
double r78710 = 1.0;
double r78711 = N;
double r78712 = r78711 + r78709;
double r78713 = r78712 * r78711;
double r78714 = r78710 + r78713;
double r78715 = atan2(r78709, r78714);
return r78715;
}




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)))