Average Error: 0.2 → 0.2
Time: 3.4s
Precision: 64
\[\left(3 \cdot \left(2 - x \cdot 3\right)\right) \cdot x\]
\[3 \cdot \left(\left(2 - x \cdot 3\right) \cdot x\right)\]
\left(3 \cdot \left(2 - x \cdot 3\right)\right) \cdot x
3 \cdot \left(\left(2 - x \cdot 3\right) \cdot x\right)
double f(double x) {
        double r589126 = 3.0;
        double r589127 = 2.0;
        double r589128 = x;
        double r589129 = r589128 * r589126;
        double r589130 = r589127 - r589129;
        double r589131 = r589126 * r589130;
        double r589132 = r589131 * r589128;
        return r589132;
}

double f(double x) {
        double r589133 = 3.0;
        double r589134 = 2.0;
        double r589135 = x;
        double r589136 = r589135 * r589133;
        double r589137 = r589134 - r589136;
        double r589138 = r589137 * r589135;
        double r589139 = r589133 * r589138;
        return r589139;
}

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
\[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.2

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

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

Reproduce

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

  :herbie-target
  (- (* 6 x) (* 9 (* x x)))

  (* (* 3 (- 2 (* x 3))) x))