Average Error: 0.2 → 0.1
Time: 2.7s
Precision: 64
\[\left(x \cdot x\right) \cdot \left(3 - x \cdot 2\right)\]
\[\left(x \cdot x\right) \cdot 3 + \left(-2 \cdot {x}^{3}\right)\]
\left(x \cdot x\right) \cdot \left(3 - x \cdot 2\right)
\left(x \cdot x\right) \cdot 3 + \left(-2 \cdot {x}^{3}\right)
double f(double x) {
        double r826769 = x;
        double r826770 = r826769 * r826769;
        double r826771 = 3.0;
        double r826772 = 2.0;
        double r826773 = r826769 * r826772;
        double r826774 = r826771 - r826773;
        double r826775 = r826770 * r826774;
        return r826775;
}

double f(double x) {
        double r826776 = x;
        double r826777 = r826776 * r826776;
        double r826778 = 3.0;
        double r826779 = r826777 * r826778;
        double r826780 = 2.0;
        double r826781 = 3.0;
        double r826782 = pow(r826776, r826781);
        double r826783 = r826780 * r826782;
        double r826784 = -r826783;
        double r826785 = r826779 + r826784;
        return r826785;
}

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.1
\[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.1

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

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

Reproduce

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