Average Error: 0.2 → 0.2
Time: 8.0s
Precision: 64
\[\left(x \cdot x\right) \cdot \left(3 - x \cdot 2\right)\]
\[x \cdot \left(3 \cdot x + \left(-2 \cdot {x}^{2}\right)\right)\]
\left(x \cdot x\right) \cdot \left(3 - x \cdot 2\right)
x \cdot \left(3 \cdot x + \left(-2 \cdot {x}^{2}\right)\right)
double f(double x) {
        double r814053 = x;
        double r814054 = r814053 * r814053;
        double r814055 = 3.0;
        double r814056 = 2.0;
        double r814057 = r814053 * r814056;
        double r814058 = r814055 - r814057;
        double r814059 = r814054 * r814058;
        return r814059;
}

double f(double x) {
        double r814060 = x;
        double r814061 = 3.0;
        double r814062 = r814061 * r814060;
        double r814063 = 2.0;
        double r814064 = 2.0;
        double r814065 = pow(r814060, r814064);
        double r814066 = r814063 * r814065;
        double r814067 = -r814066;
        double r814068 = r814062 + r814067;
        double r814069 = r814060 * r814068;
        return r814069;
}

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
\[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 pow10.2

    \[\leadsto \left(x \cdot x\right) \cdot \color{blue}{{\left(3 - x \cdot 2\right)}^{1}}\]
  4. Applied pow10.2

    \[\leadsto \left(x \cdot \color{blue}{{x}^{1}}\right) \cdot {\left(3 - x \cdot 2\right)}^{1}\]
  5. Applied pow10.2

    \[\leadsto \left(\color{blue}{{x}^{1}} \cdot {x}^{1}\right) \cdot {\left(3 - x \cdot 2\right)}^{1}\]
  6. Applied pow-prod-down0.2

    \[\leadsto \color{blue}{{\left(x \cdot x\right)}^{1}} \cdot {\left(3 - x \cdot 2\right)}^{1}\]
  7. Applied pow-prod-down0.2

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

    \[\leadsto {\color{blue}{\left(x \cdot \left(x \cdot \left(3 - x \cdot 2\right)\right)\right)}}^{1}\]
  9. Using strategy rm
  10. Applied sub-neg0.2

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

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

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

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

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

Reproduce

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