Average Error: 0.2 → 0.2
Time: 18.7s
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 r27482601 = x;
        double r27482602 = r27482601 * r27482601;
        double r27482603 = 3.0;
        double r27482604 = 2.0;
        double r27482605 = r27482601 * r27482604;
        double r27482606 = r27482603 - r27482605;
        double r27482607 = r27482602 * r27482606;
        return r27482607;
}

double f(double x) {
        double r27482608 = 3.0;
        double r27482609 = 2.0;
        double r27482610 = x;
        double r27482611 = r27482609 * r27482610;
        double r27482612 = r27482608 - r27482611;
        double r27482613 = r27482610 * r27482610;
        double r27482614 = r27482612 * r27482613;
        return r27482614;
}

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))))