Average Error: 0.2 → 0.3
Time: 10.8s
Precision: 64
\[\left(3 \cdot \left(2 - x \cdot 3\right)\right) \cdot x\]
\[\left(\frac{2 \cdot 2 - \left(x \cdot 3\right) \cdot \left(x \cdot 3\right)}{2 + x \cdot 3} \cdot x\right) \cdot 3\]
\left(3 \cdot \left(2 - x \cdot 3\right)\right) \cdot x
\left(\frac{2 \cdot 2 - \left(x \cdot 3\right) \cdot \left(x \cdot 3\right)}{2 + x \cdot 3} \cdot x\right) \cdot 3
double f(double x) {
        double r418221 = 3.0;
        double r418222 = 2.0;
        double r418223 = x;
        double r418224 = r418223 * r418221;
        double r418225 = r418222 - r418224;
        double r418226 = r418221 * r418225;
        double r418227 = r418226 * r418223;
        return r418227;
}

double f(double x) {
        double r418228 = 2.0;
        double r418229 = r418228 * r418228;
        double r418230 = x;
        double r418231 = 3.0;
        double r418232 = r418230 * r418231;
        double r418233 = r418232 * r418232;
        double r418234 = r418229 - r418233;
        double r418235 = r418228 + r418232;
        double r418236 = r418234 / r418235;
        double r418237 = r418236 * r418230;
        double r418238 = r418237 * r418231;
        return r418238;
}

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.3
\[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. Using strategy rm
  6. Applied *-un-lft-identity0.3

    \[\leadsto \frac{3 \cdot \left(2 \cdot 2 - \left(x \cdot 3\right) \cdot \left(x \cdot 3\right)\right)}{\color{blue}{1 \cdot \left(2 + x \cdot 3\right)}} \cdot x\]
  7. Applied times-frac0.3

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

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

    \[\leadsto \left(\frac{2 \cdot 2 - \left(x \cdot 3\right) \cdot \left(x \cdot 3\right)}{2 + x \cdot 3} \cdot x\right) \cdot 3\]

Reproduce

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