Average Error: 0.3 → 0.3
Time: 14.2s
Precision: 64
\[\left(3.0 \cdot \left(2.0 - x \cdot 3.0\right)\right) \cdot x\]
\[\left(\left(2.0 - 3.0 \cdot x\right) \cdot x\right) \cdot 3.0\]
\left(3.0 \cdot \left(2.0 - x \cdot 3.0\right)\right) \cdot x
\left(\left(2.0 - 3.0 \cdot x\right) \cdot x\right) \cdot 3.0
double f(double x) {
        double r33217851 = 3.0;
        double r33217852 = 2.0;
        double r33217853 = x;
        double r33217854 = r33217853 * r33217851;
        double r33217855 = r33217852 - r33217854;
        double r33217856 = r33217851 * r33217855;
        double r33217857 = r33217856 * r33217853;
        return r33217857;
}

double f(double x) {
        double r33217858 = 2.0;
        double r33217859 = 3.0;
        double r33217860 = x;
        double r33217861 = r33217859 * r33217860;
        double r33217862 = r33217858 - r33217861;
        double r33217863 = r33217862 * r33217860;
        double r33217864 = r33217863 * r33217859;
        return r33217864;
}

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.0 \cdot x - 9.0 \cdot \left(x \cdot x\right)\]

Derivation

  1. Initial program 0.3

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

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

    \[\leadsto \left(\left(2.0 - 3.0 \cdot x\right) \cdot x\right) \cdot 3.0\]

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))