\tan^{-1} \left(N + 1\right) - \tan^{-1} N\tan^{-1}_* \frac{1}{\mathsf{fma}\left(N, N + 1, 1\right)}double f(double N) {
double r103417 = N;
double r103418 = 1.0;
double r103419 = r103417 + r103418;
double r103420 = atan(r103419);
double r103421 = atan(r103417);
double r103422 = r103420 - r103421;
return r103422;
}
double f(double N) {
double r103423 = 1.0;
double r103424 = N;
double r103425 = r103424 + r103423;
double r103426 = 1.0;
double r103427 = fma(r103424, r103425, r103426);
double r103428 = atan2(r103423, r103427);
return r103428;
}




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