Average Error: 0.2 → 0.2
Time: 21.9s
Precision: 64
\[\left(x \cdot x\right) \cdot \left(3 - x \cdot 2\right)\]
\[\left(x \cdot x\right) \cdot \left(3 - 2 \cdot x\right)\]
\left(x \cdot x\right) \cdot \left(3 - x \cdot 2\right)
\left(x \cdot x\right) \cdot \left(3 - 2 \cdot x\right)
double f(double x) {
        double r94436854 = x;
        double r94436855 = r94436854 * r94436854;
        double r94436856 = 3.0;
        double r94436857 = 2.0;
        double r94436858 = r94436854 * r94436857;
        double r94436859 = r94436856 - r94436858;
        double r94436860 = r94436855 * r94436859;
        return r94436860;
}

double f(double x) {
        double r94436861 = x;
        double r94436862 = r94436861 * r94436861;
        double r94436863 = 3.0;
        double r94436864 = 2.0;
        double r94436865 = r94436864 * r94436861;
        double r94436866 = r94436863 - r94436865;
        double r94436867 = r94436862 * r94436866;
        return r94436867;
}

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 associate-*l*0.2

    \[\leadsto \color{blue}{x \cdot \left(x \cdot \left(3 - x \cdot 2\right)\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}{\left(x \cdot x\right) \cdot \left(3 - 2 \cdot x\right)}\]
  6. Final simplification0.2

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

Reproduce

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