Average Error: 0.2 → 0.2
Time: 16.8s
Precision: 64
\[\left(x \cdot x\right) \cdot \left(3 - x \cdot 2\right)\]
\[\left(\left(3 - x \cdot 2\right) \cdot x\right) \cdot x\]
\left(x \cdot x\right) \cdot \left(3 - x \cdot 2\right)
\left(\left(3 - x \cdot 2\right) \cdot x\right) \cdot x
double f(double x) {
        double r37200303 = x;
        double r37200304 = r37200303 * r37200303;
        double r37200305 = 3.0;
        double r37200306 = 2.0;
        double r37200307 = r37200303 * r37200306;
        double r37200308 = r37200305 - r37200307;
        double r37200309 = r37200304 * r37200308;
        return r37200309;
}

double f(double x) {
        double r37200310 = 3.0;
        double r37200311 = x;
        double r37200312 = 2.0;
        double r37200313 = r37200311 * r37200312;
        double r37200314 = r37200310 - r37200313;
        double r37200315 = r37200314 * r37200311;
        double r37200316 = r37200315 * r37200311;
        return r37200316;
}

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

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

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

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

Reproduce

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