Average Error: 0.2 → 0.2
Time: 10.2s
Precision: 64
\[\left(x \cdot x\right) \cdot \left(3 - x \cdot 2\right)\]
\[\left(3 - 2 \cdot x\right) \cdot {x}^{2}\]
\left(x \cdot x\right) \cdot \left(3 - x \cdot 2\right)
\left(3 - 2 \cdot x\right) \cdot {x}^{2}
double f(double x) {
        double r588268 = x;
        double r588269 = r588268 * r588268;
        double r588270 = 3.0;
        double r588271 = 2.0;
        double r588272 = r588268 * r588271;
        double r588273 = r588270 - r588272;
        double r588274 = r588269 * r588273;
        return r588274;
}

double f(double x) {
        double r588275 = 3.0;
        double r588276 = 2.0;
        double r588277 = x;
        double r588278 = r588276 * r588277;
        double r588279 = r588275 - r588278;
        double r588280 = 2.0;
        double r588281 = pow(r588277, r588280);
        double r588282 = r588279 * r588281;
        return r588282;
}

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. Simplified0.2

    \[\leadsto \color{blue}{\left(\mathsf{fma}\left(-x, 2, 3\right) \cdot x\right) \cdot x}\]
  3. Taylor expanded around 0 0.1

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

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

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

Reproduce

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