\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 r293316 = N;
double r293317 = 1.0;
double r293318 = r293316 + r293317;
double r293319 = atan(r293318);
double r293320 = atan(r293316);
double r293321 = r293319 - r293320;
return r293321;
}
double f(double N) {
double r293322 = 1.0;
double r293323 = 1.0;
double r293324 = N;
double r293325 = r293324 + r293322;
double r293326 = r293325 * r293324;
double r293327 = r293323 + r293326;
double r293328 = atan2(r293322, r293327);
return r293328;
}




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