\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 r87585 = N;
double r87586 = 1.0;
double r87587 = r87585 + r87586;
double r87588 = atan(r87587);
double r87589 = atan(r87585);
double r87590 = r87588 - r87589;
return r87590;
}
double f(double N) {
double r87591 = 1.0;
double r87592 = N;
double r87593 = r87592 + r87591;
double r87594 = 1.0;
double r87595 = fma(r87592, r87593, r87594);
double r87596 = atan2(r87591, r87595);
return r87596;
}




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