\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 r91949 = N;
double r91950 = 1.0;
double r91951 = r91949 + r91950;
double r91952 = atan(r91951);
double r91953 = atan(r91949);
double r91954 = r91952 - r91953;
return r91954;
}
double f(double N) {
double r91955 = 1.0;
double r91956 = 1.0;
double r91957 = N;
double r91958 = r91957 + r91955;
double r91959 = r91958 * r91957;
double r91960 = r91956 + r91959;
double r91961 = atan2(r91955, r91960);
return r91961;
}




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