Average Error: 0.2 → 0.1
Time: 12.2s
Precision: 64
\[\left(x \cdot x\right) \cdot \left(3 - x \cdot 2\right)\]
\[\left(3 \cdot x\right) \cdot {x}^{\left(\frac{2}{2}\right)} + \left(-2 \cdot {x}^{3}\right)\]
\left(x \cdot x\right) \cdot \left(3 - x \cdot 2\right)
\left(3 \cdot x\right) \cdot {x}^{\left(\frac{2}{2}\right)} + \left(-2 \cdot {x}^{3}\right)
double f(double x) {
        double r817495 = x;
        double r817496 = r817495 * r817495;
        double r817497 = 3.0;
        double r817498 = 2.0;
        double r817499 = r817495 * r817498;
        double r817500 = r817497 - r817499;
        double r817501 = r817496 * r817500;
        return r817501;
}

double f(double x) {
        double r817502 = 3.0;
        double r817503 = x;
        double r817504 = r817502 * r817503;
        double r817505 = 2.0;
        double r817506 = r817505 / r817505;
        double r817507 = pow(r817503, r817506);
        double r817508 = r817504 * r817507;
        double r817509 = 2.0;
        double r817510 = 3.0;
        double r817511 = pow(r817503, r817510);
        double r817512 = r817509 * r817511;
        double r817513 = -r817512;
        double r817514 = r817508 + r817513;
        return r817514;
}

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.1
\[x \cdot \left(x \cdot \left(3 - x \cdot 2\right)\right)\]

Derivation

  1. Initial program 0.2

    \[\left(x \cdot x\right) \cdot \left(3 - x \cdot 2\right)\]
  2. Using strategy rm
  3. Applied sub-neg0.2

    \[\leadsto \left(x \cdot x\right) \cdot \color{blue}{\left(3 + \left(-x \cdot 2\right)\right)}\]
  4. Applied distribute-lft-in0.2

    \[\leadsto \color{blue}{\left(x \cdot x\right) \cdot 3 + \left(x \cdot x\right) \cdot \left(-x \cdot 2\right)}\]
  5. Simplified0.2

    \[\leadsto \color{blue}{3 \cdot {x}^{2}} + \left(x \cdot x\right) \cdot \left(-x \cdot 2\right)\]
  6. Simplified0.1

    \[\leadsto 3 \cdot {x}^{2} + \color{blue}{\left(-2 \cdot {x}^{3}\right)}\]
  7. Using strategy rm
  8. Applied sqr-pow0.1

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

    \[\leadsto \color{blue}{\left(3 \cdot {x}^{\left(\frac{2}{2}\right)}\right) \cdot {x}^{\left(\frac{2}{2}\right)}} + \left(-2 \cdot {x}^{3}\right)\]
  10. Simplified0.1

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

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

Reproduce

herbie shell --seed 2020047 
(FPCore (x)
  :name "Data.Spline.Key:interpolateKeys from smoothie-0.4.0.2"
  :precision binary64

  :herbie-target
  (* x (* x (- 3 (* x 2))))

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