Average Error: 0.2 → 0.2
Time: 20.2s
Precision: 64
\[\left(x \cdot x\right) \cdot \left(3 - x \cdot 2\right)\]
\[\left(x \cdot 3\right) \cdot x + \left(-\left(\left(x \cdot x\right) \cdot 2\right) \cdot x\right)\]
\left(x \cdot x\right) \cdot \left(3 - x \cdot 2\right)
\left(x \cdot 3\right) \cdot x + \left(-\left(\left(x \cdot x\right) \cdot 2\right) \cdot x\right)
double f(double x) {
        double r454306 = x;
        double r454307 = r454306 * r454306;
        double r454308 = 3.0;
        double r454309 = 2.0;
        double r454310 = r454306 * r454309;
        double r454311 = r454308 - r454310;
        double r454312 = r454307 * r454311;
        return r454312;
}

double f(double x) {
        double r454313 = x;
        double r454314 = 3.0;
        double r454315 = r454313 * r454314;
        double r454316 = r454315 * r454313;
        double r454317 = r454313 * r454313;
        double r454318 = 2.0;
        double r454319 = r454317 * r454318;
        double r454320 = r454319 * r454313;
        double r454321 = -r454320;
        double r454322 = r454316 + r454321;
        return r454322;
}

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 sub-neg0.2

    \[\leadsto \left(x \cdot x\right) \cdot \color{blue}{\left(3 + \left(-x \cdot 2\right)\right)}\]
  4. Applied distribute-lft-in0.2

    \[\leadsto \color{blue}{\left(x \cdot x\right) \cdot 3 + \left(x \cdot x\right) \cdot \left(-x \cdot 2\right)}\]
  5. Simplified0.2

    \[\leadsto \color{blue}{\left(x \cdot 3\right) \cdot x} + \left(x \cdot x\right) \cdot \left(-x \cdot 2\right)\]
  6. Simplified0.1

    \[\leadsto \left(x \cdot 3\right) \cdot x + \color{blue}{\left(-2 \cdot {x}^{3}\right)}\]
  7. Using strategy rm
  8. Applied unpow30.2

    \[\leadsto \left(x \cdot 3\right) \cdot x + \left(-2 \cdot \color{blue}{\left(\left(x \cdot x\right) \cdot x\right)}\right)\]
  9. Applied associate-*r*0.2

    \[\leadsto \left(x \cdot 3\right) \cdot x + \left(-\color{blue}{\left(2 \cdot \left(x \cdot x\right)\right) \cdot x}\right)\]
  10. Simplified0.2

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

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

Reproduce

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

  :herbie-target
  (* x (* x (- 3 (* x 2))))

  (* (* x x) (- 3 (* x 2))))