\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 r88567 = N;
double r88568 = 1.0;
double r88569 = r88567 + r88568;
double r88570 = atan(r88569);
double r88571 = atan(r88567);
double r88572 = r88570 - r88571;
return r88572;
}
double f(double N) {
double r88573 = 1.0;
double r88574 = 1.0;
double r88575 = N;
double r88576 = r88575 + r88573;
double r88577 = r88576 * r88575;
double r88578 = r88574 + r88577;
double r88579 = atan2(r88573, r88578);
return r88579;
}




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)))