Average Error: 0.2 → 0.2
Time: 18.1s
Precision: 64
\[\left(x \cdot x\right) \cdot \left(3.0 - x \cdot 2.0\right)\]
\[\left(3.0 - 2.0 \cdot x\right) \cdot \left(x \cdot x\right)\]
\left(x \cdot x\right) \cdot \left(3.0 - x \cdot 2.0\right)
\left(3.0 - 2.0 \cdot x\right) \cdot \left(x \cdot x\right)
double f(double x) {
        double r24477934 = x;
        double r24477935 = r24477934 * r24477934;
        double r24477936 = 3.0;
        double r24477937 = 2.0;
        double r24477938 = r24477934 * r24477937;
        double r24477939 = r24477936 - r24477938;
        double r24477940 = r24477935 * r24477939;
        return r24477940;
}

double f(double x) {
        double r24477941 = 3.0;
        double r24477942 = 2.0;
        double r24477943 = x;
        double r24477944 = r24477942 * r24477943;
        double r24477945 = r24477941 - r24477944;
        double r24477946 = r24477943 * r24477943;
        double r24477947 = r24477945 * r24477946;
        return r24477947;
}

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.0 - x \cdot 2.0\right)\right)\]

Derivation

  1. Initial program 0.2

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

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

    \[\leadsto \left(3.0 - 2.0 \cdot x\right) \cdot \left(x \cdot x\right)\]

Reproduce

herbie shell --seed 2019163 +o rules:numerics
(FPCore (x)
  :name "Data.Spline.Key:interpolateKeys from smoothie-0.4.0.2"

  :herbie-target
  (* x (* x (- 3.0 (* x 2.0))))

  (* (* x x) (- 3.0 (* x 2.0))))