\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 r113491 = N;
double r113492 = 1.0;
double r113493 = r113491 + r113492;
double r113494 = atan(r113493);
double r113495 = atan(r113491);
double r113496 = r113494 - r113495;
return r113496;
}
double f(double N) {
double r113497 = 1.0;
double r113498 = N;
double r113499 = r113498 + r113497;
double r113500 = 1.0;
double r113501 = fma(r113498, r113499, r113500);
double r113502 = atan2(r113497, r113501);
return r113502;
}




Bits error versus N
| Original | 15.4 |
|---|---|
| Target | 0.4 |
| Herbie | 0.4 |
Initial program 15.4
rmApplied diff-atan14.2
Simplified0.4
Simplified0.4
Final simplification0.4
herbie shell --seed 2020049 +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)))