Average Error: 0.1 → 0.1
Time: 2.3s
Precision: 64
\[3 \cdot \left(\left(\left(x \cdot 3\right) \cdot x - x \cdot 4\right) + 1\right)\]
\[\left(\left(\sqrt[3]{9} \cdot \sqrt[3]{9}\right) \cdot \left(\left(x \cdot \sqrt[3]{9}\right) \cdot x\right) + 3\right) - 12 \cdot x\]
3 \cdot \left(\left(\left(x \cdot 3\right) \cdot x - x \cdot 4\right) + 1\right)
\left(\left(\sqrt[3]{9} \cdot \sqrt[3]{9}\right) \cdot \left(\left(x \cdot \sqrt[3]{9}\right) \cdot x\right) + 3\right) - 12 \cdot x
double code(double x) {
	return (3.0 * ((((x * 3.0) * x) - (x * 4.0)) + 1.0));
}
double code(double x) {
	return ((((cbrt(9.0) * cbrt(9.0)) * ((x * cbrt(9.0)) * x)) + 3.0) - (12.0 * x));
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original0.1
Target0.1
Herbie0.1
\[3 + \left(\left(9 \cdot x\right) \cdot x - 12 \cdot x\right)\]

Derivation

  1. Initial program 0.1

    \[3 \cdot \left(\left(\left(x \cdot 3\right) \cdot x - x \cdot 4\right) + 1\right)\]
  2. Simplified0.1

    \[\leadsto \color{blue}{3 \cdot \left(1 + x \cdot \left(x \cdot 3 - 4\right)\right)}\]
  3. Taylor expanded around 0 0.1

    \[\leadsto \color{blue}{\left(9 \cdot {x}^{2} + 3\right) - 12 \cdot x}\]
  4. Using strategy rm
  5. Applied add-cube-cbrt0.1

    \[\leadsto \left(\color{blue}{\left(\left(\sqrt[3]{9} \cdot \sqrt[3]{9}\right) \cdot \sqrt[3]{9}\right)} \cdot {x}^{2} + 3\right) - 12 \cdot x\]
  6. Applied associate-*l*0.1

    \[\leadsto \left(\color{blue}{\left(\sqrt[3]{9} \cdot \sqrt[3]{9}\right) \cdot \left(\sqrt[3]{9} \cdot {x}^{2}\right)} + 3\right) - 12 \cdot x\]
  7. Using strategy rm
  8. Applied unpow20.1

    \[\leadsto \left(\left(\sqrt[3]{9} \cdot \sqrt[3]{9}\right) \cdot \left(\sqrt[3]{9} \cdot \color{blue}{\left(x \cdot x\right)}\right) + 3\right) - 12 \cdot x\]
  9. Applied associate-*r*0.1

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

    \[\leadsto \left(\left(\sqrt[3]{9} \cdot \sqrt[3]{9}\right) \cdot \left(\color{blue}{\left(x \cdot \sqrt[3]{9}\right)} \cdot x\right) + 3\right) - 12 \cdot x\]
  11. Final simplification0.1

    \[\leadsto \left(\left(\sqrt[3]{9} \cdot \sqrt[3]{9}\right) \cdot \left(\left(x \cdot \sqrt[3]{9}\right) \cdot x\right) + 3\right) - 12 \cdot x\]

Reproduce

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

  :herbie-target
  (+ 3 (- (* (* 9 x) x) (* 12 x)))

  (* 3 (+ (- (* (* x 3) x) (* x 4)) 1)))