Average Error: 0.3 → 0.2
Time: 14.7s
Precision: 64
\[\left(3 \cdot \left(2 - x \cdot 3\right)\right) \cdot x\]
\[\left(6 - 9 \cdot x\right) \cdot x\]
\left(3 \cdot \left(2 - x \cdot 3\right)\right) \cdot x
\left(6 - 9 \cdot x\right) \cdot x
double f(double x) {
        double r484563 = 3.0;
        double r484564 = 2.0;
        double r484565 = x;
        double r484566 = r484565 * r484563;
        double r484567 = r484564 - r484566;
        double r484568 = r484563 * r484567;
        double r484569 = r484568 * r484565;
        return r484569;
}

double f(double x) {
        double r484570 = 6.0;
        double r484571 = 9.0;
        double r484572 = x;
        double r484573 = r484571 * r484572;
        double r484574 = r484570 - r484573;
        double r484575 = r484574 * r484572;
        return r484575;
}

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}{\left(6 - 9 \cdot x\right)} \cdot x\]
  3. Final simplification0.2

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

Reproduce

herbie shell --seed 2019303 
(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))