Average Error: 0.2 → 0.2
Time: 2.3s
Precision: 64
\[\left(x \cdot x\right) \cdot \left(3 - x \cdot 2\right)\]
\[\left(3 - x \cdot 2\right) \cdot \left(x \cdot x\right)\]
\left(x \cdot x\right) \cdot \left(3 - x \cdot 2\right)
\left(3 - x \cdot 2\right) \cdot \left(x \cdot x\right)
double f(double x) {
        double r904665 = x;
        double r904666 = r904665 * r904665;
        double r904667 = 3.0;
        double r904668 = 2.0;
        double r904669 = r904665 * r904668;
        double r904670 = r904667 - r904669;
        double r904671 = r904666 * r904670;
        return r904671;
}

double f(double x) {
        double r904672 = 3.0;
        double r904673 = x;
        double r904674 = 2.0;
        double r904675 = r904673 * r904674;
        double r904676 = r904672 - r904675;
        double r904677 = r904673 * r904673;
        double r904678 = r904676 * r904677;
        return r904678;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original0.2
Target0.2
Herbie0.2
\[x \cdot \left(x \cdot \left(3 - x \cdot 2\right)\right)\]

Derivation

  1. Initial program 0.2

    \[\left(x \cdot x\right) \cdot \left(3 - x \cdot 2\right)\]
  2. Using strategy rm
  3. Applied *-commutative0.2

    \[\leadsto \color{blue}{\left(3 - x \cdot 2\right) \cdot \left(x \cdot x\right)}\]
  4. Final simplification0.2

    \[\leadsto \left(3 - x \cdot 2\right) \cdot \left(x \cdot x\right)\]

Reproduce

herbie shell --seed 2020083 
(FPCore (x)
  :name "Data.Spline.Key:interpolateKeys from smoothie-0.4.0.2"
  :precision binary64

  :herbie-target
  (* x (* x (- 3 (* x 2))))

  (* (* x x) (- 3 (* x 2))))