\tan^{-1} \left(N + 1\right) - \tan^{-1} N\left(\sqrt{\sqrt{\tan^{-1}_* \frac{1}{1 + \left(N + 1\right) \cdot N}}} \cdot \sqrt{\sqrt{\tan^{-1}_* \frac{1}{1 + \left(N + 1\right) \cdot N}}}\right) \cdot \sqrt{\tan^{-1}_* \frac{1}{1 + \left(N + 1\right) \cdot N}}double f(double N) {
double r127073 = N;
double r127074 = 1.0;
double r127075 = r127073 + r127074;
double r127076 = atan(r127075);
double r127077 = atan(r127073);
double r127078 = r127076 - r127077;
return r127078;
}
double f(double N) {
double r127079 = 1.0;
double r127080 = 1.0;
double r127081 = N;
double r127082 = r127081 + r127079;
double r127083 = r127082 * r127081;
double r127084 = r127080 + r127083;
double r127085 = atan2(r127079, r127084);
double r127086 = sqrt(r127085);
double r127087 = sqrt(r127086);
double r127088 = r127087 * r127087;
double r127089 = r127088 * r127086;
return r127089;
}




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