\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 r157202 = N;
double r157203 = 1.0;
double r157204 = r157202 + r157203;
double r157205 = atan(r157204);
double r157206 = atan(r157202);
double r157207 = r157205 - r157206;
return r157207;
}
double f(double N) {
double r157208 = 1.0;
double r157209 = N;
double r157210 = r157209 + r157208;
double r157211 = 1.0;
double r157212 = fma(r157209, r157210, r157211);
double r157213 = atan2(r157208, r157212);
return r157213;
}




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