Average Error: 0.5 → 0
Time: 3.3s
Precision: 64
\[\frac{1}{x \cdot x}\]
\[{x}^{-2} \cdot 1\]
\frac{1}{x \cdot x}
{x}^{-2} \cdot 1
double f(double x) {
        double r377877 = 1.0;
        double r377878 = x;
        double r377879 = r377878 * r377878;
        double r377880 = r377877 / r377879;
        return r377880;
}

double f(double x) {
        double r377881 = x;
        double r377882 = -2.0;
        double r377883 = pow(r377881, r377882);
        double r377884 = 1.0;
        double r377885 = r377883 * r377884;
        return r377885;
}

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
\[\frac{\frac{1}{x}}{x}\]

Derivation

  1. Initial program 0.5

    \[\frac{1}{x \cdot x}\]
  2. Using strategy rm
  3. Applied div-inv0.5

    \[\leadsto \color{blue}{1 \cdot \frac{1}{x \cdot x}}\]
  4. Simplified0.2

    \[\leadsto 1 \cdot \color{blue}{\frac{\frac{1}{x}}{x}}\]
  5. Using strategy rm
  6. Applied pow10.2

    \[\leadsto 1 \cdot \frac{\frac{1}{x}}{\color{blue}{{x}^{1}}}\]
  7. Applied inv-pow0.2

    \[\leadsto 1 \cdot \frac{\color{blue}{{x}^{-1}}}{{x}^{1}}\]
  8. Applied pow-div0

    \[\leadsto 1 \cdot \color{blue}{{x}^{\left(-1 - 1\right)}}\]
  9. Simplified0

    \[\leadsto 1 \cdot {x}^{\color{blue}{-2}}\]
  10. Final simplification0

    \[\leadsto {x}^{-2} \cdot 1\]

Reproduce

herbie shell --seed 2019194 
(FPCore (x)
  :name "Numeric.SpecFunctions:$slogFactorial from math-functions-0.1.5.2, A"

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

  (/ 1.0 (* x x)))