Average Error: 0.2 → 0.2
Time: 2.8s
Precision: 64
\[\left(3 \cdot \left(2 - x \cdot 3\right)\right) \cdot x\]
\[x \cdot \left(6 - 9 \cdot x\right)\]
\left(3 \cdot \left(2 - x \cdot 3\right)\right) \cdot x
x \cdot \left(6 - 9 \cdot x\right)
double f(double x) {
        double r562060 = 3.0;
        double r562061 = 2.0;
        double r562062 = x;
        double r562063 = r562062 * r562060;
        double r562064 = r562061 - r562063;
        double r562065 = r562060 * r562064;
        double r562066 = r562065 * r562062;
        return r562066;
}

double f(double x) {
        double r562067 = x;
        double r562068 = 6.0;
        double r562069 = 9.0;
        double r562070 = r562069 * r562067;
        double r562071 = r562068 - r562070;
        double r562072 = r562067 * r562071;
        return r562072;
}

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
\[6 \cdot x - 9 \cdot \left(x \cdot x\right)\]

Derivation

  1. Initial program 0.2

    \[\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 x \cdot \left(6 - 9 \cdot x\right)\]

Reproduce

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

  :herbie-target
  (- (* 6 x) (* 9 (* x x)))

  (* (* 3 (- 2 (* x 3))) x))