Average Error: 0.2 → 0.2
Time: 10.7s
Precision: 64
\[\left(3 \cdot \left(2 - x \cdot 3\right)\right) \cdot x\]
\[x \cdot \left(6 - x \cdot 9\right)\]
\left(3 \cdot \left(2 - x \cdot 3\right)\right) \cdot x
x \cdot \left(6 - x \cdot 9\right)
double f(double x) {
        double r565692 = 3.0;
        double r565693 = 2.0;
        double r565694 = x;
        double r565695 = r565694 * r565692;
        double r565696 = r565693 - r565695;
        double r565697 = r565692 * r565696;
        double r565698 = r565697 * r565694;
        return r565698;
}

double f(double x) {
        double r565699 = x;
        double r565700 = 6.0;
        double r565701 = 9.0;
        double r565702 = r565699 * r565701;
        double r565703 = r565700 - r565702;
        double r565704 = r565699 * r565703;
        return r565704;
}

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 flip--0.3

    \[\leadsto \left(3 \cdot \color{blue}{\frac{2 \cdot 2 - \left(x \cdot 3\right) \cdot \left(x \cdot 3\right)}{2 + x \cdot 3}}\right) \cdot x\]
  4. Applied associate-*r/0.3

    \[\leadsto \color{blue}{\frac{3 \cdot \left(2 \cdot 2 - \left(x \cdot 3\right) \cdot \left(x \cdot 3\right)\right)}{2 + x \cdot 3}} \cdot x\]
  5. Taylor expanded around 0 0.2

    \[\leadsto \color{blue}{6 \cdot x - 9 \cdot {x}^{2}}\]
  6. Final simplification0.2

    \[\leadsto x \cdot \left(6 - x \cdot 9\right)\]

Reproduce

herbie shell --seed 2019294 
(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))