\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 r97383 = N;
double r97384 = 1.0;
double r97385 = r97383 + r97384;
double r97386 = atan(r97385);
double r97387 = atan(r97383);
double r97388 = r97386 - r97387;
return r97388;
}
double f(double N) {
double r97389 = 1.0;
double r97390 = N;
double r97391 = r97390 + r97389;
double r97392 = 1.0;
double r97393 = fma(r97390, r97391, r97392);
double r97394 = atan2(r97389, r97393);
return r97394;
}




Bits error versus N
| Original | 14.8 |
|---|---|
| Target | 0.4 |
| Herbie | 0.4 |
Initial program 14.8
rmApplied diff-atan13.8
Simplified0.4
Simplified0.4
Final simplification0.4
herbie shell --seed 2020089 +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)))