\tan^{-1} \left(N + 1\right) - \tan^{-1} N\tan^{-1}_* \frac{1}{1 + \left(N + 1\right) \cdot N}double f(double N) {
double r117816 = N;
double r117817 = 1.0;
double r117818 = r117816 + r117817;
double r117819 = atan(r117818);
double r117820 = atan(r117816);
double r117821 = r117819 - r117820;
return r117821;
}
double f(double N) {
double r117822 = 1.0;
double r117823 = 1.0;
double r117824 = N;
double r117825 = r117824 + r117822;
double r117826 = r117825 * r117824;
double r117827 = r117823 + r117826;
double r117828 = atan2(r117822, r117827);
return r117828;
}




Bits error versus N
Results
| Original | 14.6 |
|---|---|
| Target | 0.4 |
| Herbie | 0.4 |
Initial program 14.6
rmApplied diff-atan13.5
Simplified0.4
Final simplification0.4
herbie shell --seed 2019347
(FPCore (N)
:name "2atan (example 3.5)"
:precision binary64
:herbie-target
(atan (/ 1 (+ 1 (* N (+ N 1)))))
(- (atan (+ N 1)) (atan N)))