Average Error: 0.2 → 0.2
Time: 16.1s
Precision: 64
\[\left(x \cdot x\right) \cdot \left(3.0 - x \cdot 2.0\right)\]
\[\left(\left(3.0 - x \cdot 2.0\right) \cdot x\right) \cdot x\]
\left(x \cdot x\right) \cdot \left(3.0 - x \cdot 2.0\right)
\left(\left(3.0 - x \cdot 2.0\right) \cdot x\right) \cdot x
double f(double x) {
        double r30212878 = x;
        double r30212879 = r30212878 * r30212878;
        double r30212880 = 3.0;
        double r30212881 = 2.0;
        double r30212882 = r30212878 * r30212881;
        double r30212883 = r30212880 - r30212882;
        double r30212884 = r30212879 * r30212883;
        return r30212884;
}

double f(double x) {
        double r30212885 = 3.0;
        double r30212886 = x;
        double r30212887 = 2.0;
        double r30212888 = r30212886 * r30212887;
        double r30212889 = r30212885 - r30212888;
        double r30212890 = r30212889 * r30212886;
        double r30212891 = r30212890 * r30212886;
        return r30212891;
}

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. Taylor expanded around 0 0.1

    \[\leadsto \color{blue}{3.0 \cdot {x}^{2} - 2.0 \cdot {x}^{3}}\]
  3. Simplified0.2

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

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

Reproduce

herbie shell --seed 2019162 +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))))