\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 r159198 = N;
double r159199 = 1.0;
double r159200 = r159198 + r159199;
double r159201 = atan(r159200);
double r159202 = atan(r159198);
double r159203 = r159201 - r159202;
return r159203;
}
double f(double N) {
double r159204 = 1.0;
double r159205 = N;
double r159206 = r159205 + r159204;
double r159207 = 1.0;
double r159208 = fma(r159205, r159206, r159207);
double r159209 = atan2(r159204, r159208);
return r159209;
}




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