Average Error: 0.5 → 0.2
Time: 15.8s
Precision: 64
\[\frac{1}{x \cdot x}\]
\[\frac{\frac{1}{x}}{x}\]
\frac{1}{x \cdot x}
\frac{\frac{1}{x}}{x}
double f(double x) {
        double r538562 = 1.0;
        double r538563 = x;
        double r538564 = r538563 * r538563;
        double r538565 = r538562 / r538564;
        return r538565;
}

double f(double x) {
        double r538566 = 1.0;
        double r538567 = x;
        double r538568 = r538566 / r538567;
        double r538569 = r538568 / r538567;
        return r538569;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original0.5
Target0.2
Herbie0.2
\[\frac{\frac{1}{x}}{x}\]

Derivation

  1. Initial program 0.5

    \[\frac{1}{x \cdot x}\]
  2. Using strategy rm
  3. Applied associate-/r*0.2

    \[\leadsto \color{blue}{\frac{\frac{1}{x}}{x}}\]
  4. Final simplification0.2

    \[\leadsto \frac{\frac{1}{x}}{x}\]

Reproduce

herbie shell --seed 2019351 +o rules:numerics
(FPCore (x)
  :name "Numeric.SpecFunctions:$slogFactorial from math-functions-0.1.5.2, A"
  :precision binary64

  :herbie-target
  (/ (/ 1 x) x)

  (/ 1 (* x x)))