Average Error: 0.2 → 0.1
Time: 14.8s
Precision: 64
\[\left(x \cdot x\right) \cdot \left(3 - x \cdot 2\right)\]
\[3 \cdot \left(x \cdot x\right) - 2 \cdot {x}^{3}\]
\left(x \cdot x\right) \cdot \left(3 - x \cdot 2\right)
3 \cdot \left(x \cdot x\right) - 2 \cdot {x}^{3}
double f(double x) {
        double r39563305 = x;
        double r39563306 = r39563305 * r39563305;
        double r39563307 = 3.0;
        double r39563308 = 2.0;
        double r39563309 = r39563305 * r39563308;
        double r39563310 = r39563307 - r39563309;
        double r39563311 = r39563306 * r39563310;
        return r39563311;
}

double f(double x) {
        double r39563312 = 3.0;
        double r39563313 = x;
        double r39563314 = r39563313 * r39563313;
        double r39563315 = r39563312 * r39563314;
        double r39563316 = 2.0;
        double r39563317 = 3.0;
        double r39563318 = pow(r39563313, r39563317);
        double r39563319 = r39563316 * r39563318;
        double r39563320 = r39563315 - r39563319;
        return r39563320;
}

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. Taylor expanded around 0 0.1

    \[\leadsto \color{blue}{3 \cdot {x}^{2} - 2 \cdot {x}^{3}}\]
  3. Simplified0.2

    \[\leadsto \color{blue}{3 \cdot \left(x \cdot x\right) - 2 \cdot \left(x \cdot \left(x \cdot x\right)\right)}\]
  4. Using strategy rm
  5. Applied pow10.2

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

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

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

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

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

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

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

Reproduce

herbie shell --seed 2019174 +o rules:numerics
(FPCore (x)
  :name "Data.Spline.Key:interpolateKeys from smoothie-0.4.0.2"

  :herbie-target
  (* x (* x (- 3.0 (* x 2.0))))

  (* (* x x) (- 3.0 (* x 2.0))))