\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 r498 = N;
double r499 = 1.0;
double r500 = r498 + r499;
double r501 = atan(r500);
double r502 = atan(r498);
double r503 = r501 - r502;
return r503;
}
double f(double N) {
double r504 = 1.0;
double r505 = 1.0;
double r506 = N;
double r507 = r506 + r504;
double r508 = r507 * r506;
double r509 = r505 + r508;
double r510 = atan2(r504, r509);
return r510;
}




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