\tan^{-1} \left(N + 1\right) - \tan^{-1} N{\left(\sqrt{\sqrt{\tan^{-1}_* \frac{1}{\mathsf{fma}\left(N, N + 1, 1\right)}}}\right)}^{3} \cdot \sqrt{\sqrt{\tan^{-1}_* \frac{1}{\mathsf{fma}\left(N, N + 1, 1\right)}}}double f(double N) {
double r105571 = N;
double r105572 = 1.0;
double r105573 = r105571 + r105572;
double r105574 = atan(r105573);
double r105575 = atan(r105571);
double r105576 = r105574 - r105575;
return r105576;
}
double f(double N) {
double r105577 = 1.0;
double r105578 = N;
double r105579 = r105578 + r105577;
double r105580 = 1.0;
double r105581 = fma(r105578, r105579, r105580);
double r105582 = atan2(r105577, r105581);
double r105583 = sqrt(r105582);
double r105584 = sqrt(r105583);
double r105585 = 3.0;
double r105586 = pow(r105584, r105585);
double r105587 = r105586 * r105584;
return r105587;
}




Bits error versus N
| Original | 14.8 |
|---|---|
| Target | 0.4 |
| Herbie | 0.6 |
Initial program 14.8
rmApplied diff-atan13.7
Simplified0.4
Simplified0.4
rmApplied add-sqr-sqrt1.0
rmApplied add-sqr-sqrt1.0
Applied sqrt-prod0.5
Applied associate-*r*1.0
Simplified0.6
Final simplification0.6
herbie shell --seed 2019306 +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)))