\tan^{-1} \left(N + 1\right) - \tan^{-1} N\mathsf{expm1}\left(\mathsf{log1p}\left(\tan^{-1}_* \frac{1}{\mathsf{fma}\left(N, N + 1, 1\right)}\right)\right)double f(double N) {
double r5899241 = N;
double r5899242 = 1.0;
double r5899243 = r5899241 + r5899242;
double r5899244 = atan(r5899243);
double r5899245 = atan(r5899241);
double r5899246 = r5899244 - r5899245;
return r5899246;
}
double f(double N) {
double r5899247 = 1.0;
double r5899248 = N;
double r5899249 = r5899248 + r5899247;
double r5899250 = 1.0;
double r5899251 = fma(r5899248, r5899249, r5899250);
double r5899252 = atan2(r5899247, r5899251);
double r5899253 = log1p(r5899252);
double r5899254 = expm1(r5899253);
return r5899254;
}




Bits error versus N
| Original | 15.2 |
|---|---|
| Target | 0.4 |
| Herbie | 0.9 |
Initial program 15.2
rmApplied diff-atan14.1
Simplified0.4
Simplified0.4
rmApplied expm1-log1p-u0.9
Final simplification0.9
herbie shell --seed 2019168 +o rules:numerics
(FPCore (N)
:name "2atan (example 3.5)"
:herbie-target
(atan (/ 1.0 (+ 1.0 (* N (+ N 1.0)))))
(- (atan (+ N 1.0)) (atan N)))