Average Error: 0.2 → 0.2
Time: 16.0s
Precision: 64
\[\left(x \cdot x\right) \cdot \left(3 - x \cdot 2\right)\]
\[\frac{x \cdot x}{\frac{1}{3 - x \cdot 2}}\]
\left(x \cdot x\right) \cdot \left(3 - x \cdot 2\right)
\frac{x \cdot x}{\frac{1}{3 - x \cdot 2}}
double f(double x) {
        double r33652013 = x;
        double r33652014 = r33652013 * r33652013;
        double r33652015 = 3.0;
        double r33652016 = 2.0;
        double r33652017 = r33652013 * r33652016;
        double r33652018 = r33652015 - r33652017;
        double r33652019 = r33652014 * r33652018;
        return r33652019;
}

double f(double x) {
        double r33652020 = x;
        double r33652021 = r33652020 * r33652020;
        double r33652022 = 1.0;
        double r33652023 = 3.0;
        double r33652024 = 2.0;
        double r33652025 = r33652020 * r33652024;
        double r33652026 = r33652023 - r33652025;
        double r33652027 = r33652022 / r33652026;
        double r33652028 = r33652021 / r33652027;
        return r33652028;
}

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 associate-*l*0.2

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

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

    \[\leadsto x \cdot \color{blue}{\frac{x \cdot \left(3 \cdot 3 - \left(x \cdot 2\right) \cdot \left(x \cdot 2\right)\right)}{3 + x \cdot 2}}\]
  7. Using strategy rm
  8. Applied *-un-lft-identity0.2

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

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

    \[\leadsto 1 \cdot \color{blue}{\frac{x \cdot x}{\frac{1}{3 - x \cdot 2}}}\]
  11. Final simplification0.2

    \[\leadsto \frac{x \cdot x}{\frac{1}{3 - x \cdot 2}}\]

Reproduce

herbie shell --seed 2019172 +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))))