\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 r114090 = N;
double r114091 = 1.0;
double r114092 = r114090 + r114091;
double r114093 = atan(r114092);
double r114094 = atan(r114090);
double r114095 = r114093 - r114094;
return r114095;
}
double f(double N) {
double r114096 = 1.0;
double r114097 = N;
double r114098 = r114097 + r114096;
double r114099 = 1.0;
double r114100 = fma(r114097, r114098, r114099);
double r114101 = atan2(r114096, r114100);
return r114101;
}




Bits error versus N
| Original | 14.9 |
|---|---|
| Target | 0.3 |
| Herbie | 0.3 |
Initial program 14.9
rmApplied diff-atan13.9
Simplified0.3
Simplified0.3
Final simplification0.3
herbie shell --seed 2019350 +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)))