\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 r97588 = N;
double r97589 = 1.0;
double r97590 = r97588 + r97589;
double r97591 = atan(r97590);
double r97592 = atan(r97588);
double r97593 = r97591 - r97592;
return r97593;
}
double f(double N) {
double r97594 = 1.0;
double r97595 = N;
double r97596 = r97595 + r97594;
double r97597 = 1.0;
double r97598 = fma(r97595, r97596, r97597);
double r97599 = atan2(r97594, r97598);
return r97599;
}




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