Average Error: 0.2 → 0.3
Time: 11.3s
Precision: 64
\[\left(3 \cdot \left(2 - x \cdot 3\right)\right) \cdot x\]
\[\left(\left(2 - 3 \cdot x\right) \cdot x\right) \cdot 3\]
\left(3 \cdot \left(2 - x \cdot 3\right)\right) \cdot x
\left(\left(2 - 3 \cdot x\right) \cdot x\right) \cdot 3
double f(double x) {
        double r32016616 = 3.0;
        double r32016617 = 2.0;
        double r32016618 = x;
        double r32016619 = r32016618 * r32016616;
        double r32016620 = r32016617 - r32016619;
        double r32016621 = r32016616 * r32016620;
        double r32016622 = r32016621 * r32016618;
        return r32016622;
}

double f(double x) {
        double r32016623 = 2.0;
        double r32016624 = 3.0;
        double r32016625 = x;
        double r32016626 = r32016624 * r32016625;
        double r32016627 = r32016623 - r32016626;
        double r32016628 = r32016627 * r32016625;
        double r32016629 = r32016628 * r32016624;
        return r32016629;
}

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.3
\[6 \cdot x - 9 \cdot \left(x \cdot x\right)\]

Derivation

  1. Initial program 0.2

    \[\left(3 \cdot \left(2 - x \cdot 3\right)\right) \cdot x\]
  2. Using strategy rm
  3. Applied associate-*l*0.3

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

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

Reproduce

herbie shell --seed 2019174 
(FPCore (x)
  :name "Diagrams.Tangent:$catParam from diagrams-lib-1.3.0.3, E"

  :herbie-target
  (- (* 6.0 x) (* 9.0 (* x x)))

  (* (* 3.0 (- 2.0 (* x 3.0))) x))