Average Error: 0.6 → 0.2
Time: 3.9s
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 r440018 = 1.0;
        double r440019 = x;
        double r440020 = r440019 * r440019;
        double r440021 = r440018 / r440020;
        return r440021;
}

double f(double x) {
        double r440022 = 1.0;
        double r440023 = x;
        double r440024 = r440022 / r440023;
        double r440025 = r440024 / r440023;
        return r440025;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

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

Derivation

  1. Initial program 0.6

    \[\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 2020001 +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)))