Average Error: 0.2 → 0.2
Time: 1.2m
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 r21422882 = x;
        double r21422883 = r21422882 * r21422882;
        double r21422884 = 3.0;
        double r21422885 = 2.0;
        double r21422886 = r21422882 * r21422885;
        double r21422887 = r21422884 - r21422886;
        double r21422888 = r21422883 * r21422887;
        return r21422888;
}

double f(double x) {
        double r21422889 = 3.0;
        double r21422890 = x;
        double r21422891 = 2.0;
        double r21422892 = r21422890 * r21422891;
        double r21422893 = r21422889 - r21422892;
        double r21422894 = r21422893 * r21422890;
        double r21422895 = r21422894 * r21422890;
        return r21422895;
}

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

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

Reproduce

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