Average Error: 15.2 → 0.4
Time: 10.6s
Precision: 64
$\tan^{-1} \left(N + 1\right) - \tan^{-1} N$
$\tan^{-1}_* \frac{1}{\left(1 + N\right) \cdot N + 1}$
\tan^{-1} \left(N + 1\right) - \tan^{-1} N
\tan^{-1}_* \frac{1}{\left(1 + N\right) \cdot N + 1}
double f(double N) {
double r822086 = N;
double r822087 = 1.0;
double r822088 = r822086 + r822087;
double r822089 = atan(r822088);
double r822090 = atan(r822086);
double r822091 = r822089 - r822090;
return r822091;
}


double f(double N) {
double r822092 = 1.0;
double r822093 = N;
double r822094 = r822092 + r822093;
double r822095 = r822094 * r822093;
double r822096 = r822095 + r822092;
double r822097 = atan2(r822092, r822096);
return r822097;
}



# Try it out

Results

 In Out
Enter valid numbers for all inputs

# Derivation

1. Initial program 15.2

$\tan^{-1} \left(N + 1\right) - \tan^{-1} N$
2. Using strategy rm
3. Applied diff-atan14.0

$\leadsto \color{blue}{\tan^{-1}_* \frac{\left(N + 1\right) - N}{1 + \left(N + 1\right) \cdot N}}$
4. Simplified0.4

$\leadsto \tan^{-1}_* \frac{\color{blue}{1}}{1 + \left(N + 1\right) \cdot N}$
5. Final simplification0.4

$\leadsto \tan^{-1}_* \frac{1}{\left(1 + N\right) \cdot N + 1}$

# Reproduce

herbie shell --seed 1
(FPCore (N)
:name "NMSE example 3.5"
(- (atan (+ N 1)) (atan N)))