\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 r90613 = N;
double r90614 = 1.0;
double r90615 = r90613 + r90614;
double r90616 = atan(r90615);
double r90617 = atan(r90613);
double r90618 = r90616 - r90617;
return r90618;
}
double f(double N) {
double r90619 = 1.0;
double r90620 = N;
double r90621 = r90620 + r90619;
double r90622 = 1.0;
double r90623 = fma(r90620, r90621, r90622);
double r90624 = atan2(r90619, r90623);
return r90624;
}




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 2019352 +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)))