Average Error: 0.2 → 0.2
Time: 17.4s
Precision: 64
\[\left(3 \cdot \left(2 - x \cdot 3\right)\right) \cdot x\]
\[x \cdot \left(\left(2 - 3 \cdot x\right) \cdot 3\right)\]
\left(3 \cdot \left(2 - x \cdot 3\right)\right) \cdot x
x \cdot \left(\left(2 - 3 \cdot x\right) \cdot 3\right)
double f(double x) {
        double r29042829 = 3.0;
        double r29042830 = 2.0;
        double r29042831 = x;
        double r29042832 = r29042831 * r29042829;
        double r29042833 = r29042830 - r29042832;
        double r29042834 = r29042829 * r29042833;
        double r29042835 = r29042834 * r29042831;
        return r29042835;
}

double f(double x) {
        double r29042836 = x;
        double r29042837 = 2.0;
        double r29042838 = 3.0;
        double r29042839 = r29042838 * r29042836;
        double r29042840 = r29042837 - r29042839;
        double r29042841 = r29042840 * r29042838;
        double r29042842 = r29042836 * r29042841;
        return r29042842;
}

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. Final simplification0.2

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

Reproduce

herbie shell --seed 2019172 +o rules:numerics
(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))