\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 r101033 = N;
double r101034 = 1.0;
double r101035 = r101033 + r101034;
double r101036 = atan(r101035);
double r101037 = atan(r101033);
double r101038 = r101036 - r101037;
return r101038;
}
double f(double N) {
double r101039 = 1.0;
double r101040 = 1.0;
double r101041 = N;
double r101042 = r101041 + r101039;
double r101043 = r101042 * r101041;
double r101044 = r101040 + r101043;
double r101045 = atan2(r101039, r101044);
return r101045;
}




Bits error versus N
Results
| Original | 15.1 |
|---|---|
| Target | 0.3 |
| Herbie | 0.3 |
Initial program 15.1
rmApplied diff-atan13.9
Simplified0.3
Final simplification0.3
herbie shell --seed 2019297
(FPCore (N)
:name "2atan (example 3.5)"
:precision binary64
:herbie-target
(atan (/ 1 (+ 1 (* N (+ N 1)))))
(- (atan (+ N 1)) (atan N)))