Average Error: 0.2 → 0.2
Time: 14.2s
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 r38622945 = x;
        double r38622946 = r38622945 * r38622945;
        double r38622947 = 3.0;
        double r38622948 = 2.0;
        double r38622949 = r38622945 * r38622948;
        double r38622950 = r38622947 - r38622949;
        double r38622951 = r38622946 * r38622950;
        return r38622951;
}

double f(double x) {
        double r38622952 = 3.0;
        double r38622953 = 2.0;
        double r38622954 = x;
        double r38622955 = r38622953 * r38622954;
        double r38622956 = r38622952 - r38622955;
        double r38622957 = r38622954 * r38622954;
        double r38622958 = r38622956 * r38622957;
        return r38622958;
}

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. Final simplification0.2

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

Reproduce

herbie shell --seed 2019164 
(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))))