Average Error: 0.2 → 0.2
Time: 10.1s
Precision: 64
\[\left(x \cdot x\right) \cdot \left(3 - x \cdot 2\right)\]
\[x \cdot \left(3 \cdot x\right) + x \cdot \left(\left(-x \cdot 2\right) \cdot x\right)\]
\left(x \cdot x\right) \cdot \left(3 - x \cdot 2\right)
x \cdot \left(3 \cdot x\right) + x \cdot \left(\left(-x \cdot 2\right) \cdot x\right)
double f(double x) {
        double r773642 = x;
        double r773643 = r773642 * r773642;
        double r773644 = 3.0;
        double r773645 = 2.0;
        double r773646 = r773642 * r773645;
        double r773647 = r773644 - r773646;
        double r773648 = r773643 * r773647;
        return r773648;
}

double f(double x) {
        double r773649 = x;
        double r773650 = 3.0;
        double r773651 = r773650 * r773649;
        double r773652 = r773649 * r773651;
        double r773653 = 2.0;
        double r773654 = r773649 * r773653;
        double r773655 = -r773654;
        double r773656 = r773655 * r773649;
        double r773657 = r773649 * r773656;
        double r773658 = r773652 + r773657;
        return r773658;
}

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. Using strategy rm
  5. Applied sub-neg0.2

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

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

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

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

Reproduce

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