\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 r94485 = N;
double r94486 = 1.0;
double r94487 = r94485 + r94486;
double r94488 = atan(r94487);
double r94489 = atan(r94485);
double r94490 = r94488 - r94489;
return r94490;
}
double f(double N) {
double r94491 = 1.0;
double r94492 = 1.0;
double r94493 = N;
double r94494 = r94493 + r94491;
double r94495 = r94494 * r94493;
double r94496 = r94492 + r94495;
double r94497 = atan2(r94491, r94496);
return r94497;
}




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