\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 r245332 = N;
double r245333 = 1.0;
double r245334 = r245332 + r245333;
double r245335 = atan(r245334);
double r245336 = atan(r245332);
double r245337 = r245335 - r245336;
return r245337;
}
double f(double N) {
double r245338 = 1.0;
double r245339 = 1.0;
double r245340 = N;
double r245341 = r245340 + r245338;
double r245342 = r245341 * r245340;
double r245343 = r245339 + r245342;
double r245344 = atan2(r245338, r245343);
return r245344;
}




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 2020020
(FPCore (N)
:name "2atan (example 3.5)"
:precision binary64
:herbie-target
(atan (/ 1 (+ 1 (* N (+ N 1)))))
(- (atan (+ N 1)) (atan N)))