\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 r94206 = N;
double r94207 = 1.0;
double r94208 = r94206 + r94207;
double r94209 = atan(r94208);
double r94210 = atan(r94206);
double r94211 = r94209 - r94210;
return r94211;
}
double f(double N) {
double r94212 = 1.0;
double r94213 = N;
double r94214 = r94213 + r94212;
double r94215 = 1.0;
double r94216 = fma(r94213, r94214, r94215);
double r94217 = atan2(r94212, r94216);
return r94217;
}




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