Average Error: 0.4 → 0.1
Time: 6.3s
Precision: 64
\[\frac{1}{x \cdot x - 1}\]
\[\frac{\frac{1}{x + \sqrt{1}}}{x - \sqrt{1}}\]
\frac{1}{x \cdot x - 1}
\frac{\frac{1}{x + \sqrt{1}}}{x - \sqrt{1}}
double f(double x) {
        double r1515261 = 1.0;
        double r1515262 = x;
        double r1515263 = r1515262 * r1515262;
        double r1515264 = r1515263 - r1515261;
        double r1515265 = r1515261 / r1515264;
        return r1515265;
}

double f(double x) {
        double r1515266 = 1.0;
        double r1515267 = x;
        double r1515268 = sqrt(r1515266);
        double r1515269 = r1515267 + r1515268;
        double r1515270 = r1515266 / r1515269;
        double r1515271 = r1515267 - r1515268;
        double r1515272 = r1515270 / r1515271;
        return r1515272;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.4

    \[\frac{1}{x \cdot x - 1}\]
  2. Using strategy rm
  3. Applied add-sqr-sqrt0.4

    \[\leadsto \frac{1}{x \cdot x - \color{blue}{\sqrt{1} \cdot \sqrt{1}}}\]
  4. Applied difference-of-squares0.4

    \[\leadsto \frac{1}{\color{blue}{\left(x + \sqrt{1}\right) \cdot \left(x - \sqrt{1}\right)}}\]
  5. Applied associate-/r*0.1

    \[\leadsto \color{blue}{\frac{\frac{1}{x + \sqrt{1}}}{x - \sqrt{1}}}\]
  6. Final simplification0.1

    \[\leadsto \frac{\frac{1}{x + \sqrt{1}}}{x - \sqrt{1}}\]

Reproduce

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