\tan^{-1} \left(N + 1\right) - \tan^{-1} N\left(\sqrt{\sqrt{\tan^{-1}_* \frac{1}{\mathsf{fma}\left(N, \left(N + 1\right), 1\right)}}} \cdot \sqrt{\sqrt{\tan^{-1}_* \frac{1}{\mathsf{fma}\left(N, \left(N + 1\right), 1\right)}}}\right) \cdot \sqrt{\tan^{-1}_* \frac{1}{\mathsf{fma}\left(N, \left(N + 1\right), 1\right)}}double f(double N) {
double r12275432 = N;
double r12275433 = 1.0;
double r12275434 = r12275432 + r12275433;
double r12275435 = atan(r12275434);
double r12275436 = atan(r12275432);
double r12275437 = r12275435 - r12275436;
return r12275437;
}
double f(double N) {
double r12275438 = 1.0;
double r12275439 = N;
double r12275440 = r12275439 + r12275438;
double r12275441 = fma(r12275439, r12275440, r12275438);
double r12275442 = atan2(r12275438, r12275441);
double r12275443 = sqrt(r12275442);
double r12275444 = sqrt(r12275443);
double r12275445 = r12275444 * r12275444;
double r12275446 = r12275445 * r12275443;
return r12275446;
}




Bits error versus N
| Original | 14.9 |
|---|---|
| Target | 0.3 |
| Herbie | 0.5 |
Initial program 14.9
rmApplied diff-atan13.9
Simplified0.3
Simplified0.3
rmApplied add-sqr-sqrt0.9
rmApplied add-sqr-sqrt0.9
Applied sqrt-prod0.5
Final simplification0.5
herbie shell --seed 2019125 +o rules:numerics
(FPCore (N)
:name "2atan (example 3.5)"
:herbie-target
(atan (/ 1 (+ 1 (* N (+ N 1)))))
(- (atan (+ N 1)) (atan N)))