\tan^{-1} \left(N + 1\right) - \tan^{-1} N\tan^{-1}_* \frac{1}{{N}^{2} + \left(1 \cdot N + 1\right)}double f(double N) {
double r192397 = N;
double r192398 = 1.0;
double r192399 = r192397 + r192398;
double r192400 = atan(r192399);
double r192401 = atan(r192397);
double r192402 = r192400 - r192401;
return r192402;
}
double f(double N) {
double r192403 = 1.0;
double r192404 = N;
double r192405 = 2.0;
double r192406 = pow(r192404, r192405);
double r192407 = r192403 * r192404;
double r192408 = 1.0;
double r192409 = r192407 + r192408;
double r192410 = r192406 + r192409;
double r192411 = atan2(r192403, r192410);
return r192411;
}




Bits error versus N
Results
| Original | 14.9 |
|---|---|
| Target | 0.4 |
| Herbie | 0.4 |
Initial program 14.9
rmApplied diff-atan13.8
Simplified0.4
rmApplied add-cube-cbrt0.7
Applied associate-*l*0.7
Taylor expanded around 0 0.4
Final simplification0.4
herbie shell --seed 2019354
(FPCore (N)
:name "2atan (example 3.5)"
:precision binary64
:herbie-target
(atan (/ 1 (+ 1 (* N (+ N 1)))))
(- (atan (+ N 1)) (atan N)))