\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 r14655 = N;
double r14656 = 1.0;
double r14657 = r14655 + r14656;
double r14658 = atan(r14657);
double r14659 = atan(r14655);
double r14660 = r14658 - r14659;
return r14660;
}
double f(double N) {
double r14661 = 1.0;
double r14662 = N;
double r14663 = r14662 + r14661;
double r14664 = 1.0;
double r14665 = fma(r14662, r14663, r14664);
double r14666 = atan2(r14661, r14665);
return r14666;
}




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