\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 r94454 = N;
double r94455 = 1.0;
double r94456 = r94454 + r94455;
double r94457 = atan(r94456);
double r94458 = atan(r94454);
double r94459 = r94457 - r94458;
return r94459;
}
double f(double N) {
double r94460 = 1.0;
double r94461 = 1.0;
double r94462 = N;
double r94463 = r94462 + r94460;
double r94464 = r94463 * r94462;
double r94465 = r94461 + r94464;
double r94466 = atan2(r94460, r94465);
return r94466;
}




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