\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 r117600 = N;
double r117601 = 1.0;
double r117602 = r117600 + r117601;
double r117603 = atan(r117602);
double r117604 = atan(r117600);
double r117605 = r117603 - r117604;
return r117605;
}
double f(double N) {
double r117606 = 1.0;
double r117607 = 1.0;
double r117608 = N;
double r117609 = r117608 + r117606;
double r117610 = r117609 * r117608;
double r117611 = r117607 + r117610;
double r117612 = atan2(r117606, r117611);
return r117612;
}




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