Average Error: 0.4 → 0.1
Time: 10.0s
Precision: 64
$\frac{1}{\left(x + 2\right) \cdot \left(x - 2\right)}$
$\frac{\frac{1}{x + 2}}{x - 2}$
\frac{1}{\left(x + 2\right) \cdot \left(x - 2\right)}
\frac{\frac{1}{x + 2}}{x - 2}
double f(double x) {
double r29921 = 1.0;
double r29922 = x;
double r29923 = 2.0;
double r29924 = r29922 + r29923;
double r29925 = r29922 - r29923;
double r29926 = r29924 * r29925;
double r29927 = r29921 / r29926;
return r29927;
}


double f(double x) {
double r29928 = 1.0;
double r29929 = x;
double r29930 = 2.0;
double r29931 = r29929 + r29930;
double r29932 = r29928 / r29931;
double r29933 = r29929 - r29930;
double r29934 = r29932 / r29933;
return r29934;
}



# Try it out

Results

 In Out
Enter valid numbers for all inputs

# Derivation

1. Initial program 0.4

$\frac{1}{\left(x + 2\right) \cdot \left(x - 2\right)}$
2. Using strategy rm
3. Applied associate-/r*0.1

$\leadsto \color{blue}{\frac{\frac{1}{x + 2}}{x - 2}}$
4. Final simplification0.1

$\leadsto \frac{\frac{1}{x + 2}}{x - 2}$

# Reproduce

herbie shell --seed 1
(FPCore (x)
:name "1/((x+2)(x-2))"
:precision binary64
(/ 1 (* (+ x 2) (- x 2))))