\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 r70314 = N;
double r70315 = 1.0;
double r70316 = r70314 + r70315;
double r70317 = atan(r70316);
double r70318 = atan(r70314);
double r70319 = r70317 - r70318;
return r70319;
}
double f(double N) {
double r70320 = 1.0;
double r70321 = N;
double r70322 = r70321 + r70320;
double r70323 = 1.0;
double r70324 = fma(r70321, r70322, r70323);
double r70325 = atan2(r70320, r70324);
return r70325;
}




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