\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 r159018 = N;
double r159019 = 1.0;
double r159020 = r159018 + r159019;
double r159021 = atan(r159020);
double r159022 = atan(r159018);
double r159023 = r159021 - r159022;
return r159023;
}
double f(double N) {
double r159024 = 1.0;
double r159025 = 1.0;
double r159026 = N;
double r159027 = r159026 + r159024;
double r159028 = r159027 * r159026;
double r159029 = r159025 + r159028;
double r159030 = atan2(r159024, r159029);
return r159030;
}




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