\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 r96044 = N;
double r96045 = 1.0;
double r96046 = r96044 + r96045;
double r96047 = atan(r96046);
double r96048 = atan(r96044);
double r96049 = r96047 - r96048;
return r96049;
}
double f(double N) {
double r96050 = 1.0;
double r96051 = N;
double r96052 = r96051 + r96050;
double r96053 = 1.0;
double r96054 = fma(r96051, r96052, r96053);
double r96055 = atan2(r96050, r96054);
return r96055;
}




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