Average Error: 0.3 → 0.2
Time: 54.3s
Precision: 64
\[\left(3 \cdot \left(2 - x \cdot 3\right)\right) \cdot x\]
\[\left(6 - x \cdot 9\right) \cdot x\]
\left(3 \cdot \left(2 - x \cdot 3\right)\right) \cdot x
\left(6 - x \cdot 9\right) \cdot x
double f(double x) {
        double r34200560 = 3.0;
        double r34200561 = 2.0;
        double r34200562 = x;
        double r34200563 = r34200562 * r34200560;
        double r34200564 = r34200561 - r34200563;
        double r34200565 = r34200560 * r34200564;
        double r34200566 = r34200565 * r34200562;
        return r34200566;
}

double f(double x) {
        double r34200567 = 6.0;
        double r34200568 = x;
        double r34200569 = 9.0;
        double r34200570 = r34200568 * r34200569;
        double r34200571 = r34200567 - r34200570;
        double r34200572 = r34200571 * r34200568;
        return r34200572;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original0.3
Target0.2
Herbie0.2
\[6 \cdot x - 9 \cdot \left(x \cdot x\right)\]

Derivation

  1. Initial program 0.3

    \[\left(3 \cdot \left(2 - x \cdot 3\right)\right) \cdot x\]
  2. Taylor expanded around 0 0.2

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

    \[\leadsto \color{blue}{x \cdot \left(6 - 9 \cdot x\right)}\]
  4. Final simplification0.2

    \[\leadsto \left(6 - x \cdot 9\right) \cdot x\]

Reproduce

herbie shell --seed 2019200 
(FPCore (x)
  :name "Diagrams.Tangent:$catParam from diagrams-lib-1.3.0.3, E"

  :herbie-target
  (- (* 6.0 x) (* 9.0 (* x x)))

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