\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 r131062 = N;
double r131063 = 1.0;
double r131064 = r131062 + r131063;
double r131065 = atan(r131064);
double r131066 = atan(r131062);
double r131067 = r131065 - r131066;
return r131067;
}
double f(double N) {
double r131068 = 1.0;
double r131069 = 1.0;
double r131070 = N;
double r131071 = r131070 + r131068;
double r131072 = r131071 * r131070;
double r131073 = r131069 + r131072;
double r131074 = atan2(r131068, r131073);
return r131074;
}




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