\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 r123942 = N;
double r123943 = 1.0;
double r123944 = r123942 + r123943;
double r123945 = atan(r123944);
double r123946 = atan(r123942);
double r123947 = r123945 - r123946;
return r123947;
}
double f(double N) {
double r123948 = 1.0;
double r123949 = 1.0;
double r123950 = N;
double r123951 = r123950 + r123948;
double r123952 = r123951 * r123950;
double r123953 = r123949 + r123952;
double r123954 = atan2(r123948, r123953);
return r123954;
}




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 2019325
(FPCore (N)
:name "2atan (example 3.5)"
:precision binary64
:herbie-target
(atan (/ 1 (+ 1 (* N (+ N 1)))))
(- (atan (+ N 1)) (atan N)))