\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 r132095 = N;
double r132096 = 1.0;
double r132097 = r132095 + r132096;
double r132098 = atan(r132097);
double r132099 = atan(r132095);
double r132100 = r132098 - r132099;
return r132100;
}
double f(double N) {
double r132101 = 1.0;
double r132102 = 1.0;
double r132103 = N;
double r132104 = r132103 + r132101;
double r132105 = r132104 * r132103;
double r132106 = r132102 + r132105;
double r132107 = atan2(r132101, r132106);
return r132107;
}




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