Average Error: 0.3 → 0.3
Time: 30.8s
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 r34966575 = 3.0;
        double r34966576 = 2.0;
        double r34966577 = x;
        double r34966578 = r34966577 * r34966575;
        double r34966579 = r34966576 - r34966578;
        double r34966580 = r34966575 * r34966579;
        double r34966581 = r34966580 * r34966577;
        return r34966581;
}

double f(double x) {
        double r34966582 = 2.0;
        double r34966583 = 3.0;
        double r34966584 = x;
        double r34966585 = r34966583 * r34966584;
        double r34966586 = r34966582 - r34966585;
        double r34966587 = r34966586 * r34966584;
        double r34966588 = r34966587 * r34966583;
        return r34966588;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original0.3
Target0.2
Herbie0.3
\[6 \cdot x - 9 \cdot \left(x \cdot x\right)\]

Derivation

  1. Initial program 0.3

    \[\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 2019168 
(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))