Average Error: 0.1 → 0.1
Time: 5.5s
Precision: binary64
Cost: 704
\[3 \cdot \left(\left(\left(x \cdot 3\right) \cdot x - x \cdot 4\right) + 1\right)\]
\[3 - \left(x \cdot \left(x \cdot -9\right) + x \cdot 12\right)\]
3 \cdot \left(\left(\left(x \cdot 3\right) \cdot x - x \cdot 4\right) + 1\right)
3 - \left(x \cdot \left(x \cdot -9\right) + x \cdot 12\right)
(FPCore (x) :precision binary64 (* 3.0 (+ (- (* (* x 3.0) x) (* x 4.0)) 1.0)))
(FPCore (x) :precision binary64 (- 3.0 (+ (* x (* x -9.0)) (* x 12.0))))
double code(double x) {
	return 3.0 * ((((x * 3.0) * x) - (x * 4.0)) + 1.0);
}
double code(double x) {
	return 3.0 - ((x * (x * -9.0)) + (x * 12.0));
}

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)\]

Alternatives

Alternative 1
Error0.5
Cost21312
\[\left(3 \cdot \left(\sqrt[3]{1 + x \cdot \left(3 \cdot x + -4\right)} \cdot \sqrt[3]{1 + x \cdot \left(3 \cdot x + -4\right)}\right)\right) \cdot \sqrt[3]{1 + \left(x \cdot \left(3 \cdot x\right) - x \cdot 4\right)}\]
Alternative 2
Error0.4
Cost20800
\[3 - \sqrt[3]{x \cdot \left(x \cdot -9 + 12\right)} \cdot \left(\sqrt[3]{x \cdot \left(x \cdot -9 + 12\right)} \cdot \sqrt[3]{x \cdot \left(x \cdot -9 + 12\right)}\right)\]
Alternative 3
Error0.5
Cost20544
\[3 - \left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \left(\sqrt[3]{x} \cdot \frac{144 - x \cdot \left(x \cdot 81\right)}{x \cdot 9 + 12}\right)\]
Alternative 4
Error0.5
Cost20544
\[3 - \sqrt[3]{x \cdot -9 + 12} \cdot \left(x \cdot \left(\sqrt[3]{x \cdot -9 + 12} \cdot \sqrt[3]{x \cdot -9 + 12}\right)\right)\]
Alternative 5
Error0.2
Cost20160
\[\left(\sqrt[3]{3} \cdot \sqrt[3]{3}\right) \cdot \left(\left(1 + x \cdot \left(3 \cdot x + -4\right)\right) \cdot \sqrt[3]{3}\right)\]
Alternative 6
Error0.4
Cost20032
\[3 - \left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \left(\sqrt[3]{x} \cdot \left(x \cdot -9 + 12\right)\right)\]
Alternative 7
Error0.9
Cost13632
\[\sqrt{3} \cdot \left(\left(1 + x \cdot \left(3 \cdot x + -4\right)\right) \cdot \sqrt{3}\right)\]
Alternative 8
Error7.1
Cost8576
\[3 - \left(x \cdot \frac{144 - x \cdot \left(x \cdot 81\right)}{1728 - {\left(x \cdot -9\right)}^{3}}\right) \cdot \left(144 + \left(\left(x \cdot 9\right) \cdot \left(x \cdot 9\right) + \left(x \cdot -9\right) \cdot 12\right)\right)\]
Alternative 9
Error0.2
Cost1088
\[3 - x \cdot \frac{144 - x \cdot \left(x \cdot 81\right)}{x \cdot 9 + 12}\]
Alternative 10
Error7.3
Cost1088
\[3 - \frac{x \cdot \left(144 - x \cdot \left(x \cdot 81\right)\right)}{x \cdot 9 + 12}\]
Alternative 11
Error42.8
Cost960
\[3 - x \cdot \frac{144 - x \cdot \left(x \cdot 81\right)}{x \cdot 9}\]
Alternative 12
Error0.1
Cost832
\[3 \cdot \left(1 + \left(x \cdot \left(3 \cdot x\right) - x \cdot 4\right)\right)\]
Alternative 13
Error0.1
Cost704
\[3 + 3 \cdot \left(x \cdot \left(3 \cdot x + -4\right)\right)\]
Alternative 14
Error2.1
Cost576
\[3 \cdot \left(x \cdot \left(3 \cdot x\right) + 1\right)\]
Alternative 15
Error0.1
Cost576
\[3 + x \cdot \left(x \cdot 9 + -12\right)\]
Alternative 16
Error41.2
Cost448
\[x \cdot \left(x \cdot 9 + -12\right)\]
Alternative 17
Error2.1
Cost448
\[3 - x \cdot \left(x \cdot -9\right)\]
Alternative 18
Error41.5
Cost320
\[x \cdot \left(x \cdot 9\right)\]
Alternative 19
Error21.4
Cost320
\[3 - x \cdot 12\]
Alternative 20
Error41.5
Cost320
\[9 \cdot \left(x \cdot x\right)\]
Alternative 21
Error21.6
Cost64
\[3\]
Alternative 22
Error55.3
Cost64
\[1\]
Alternative 23
Error62.2
Cost64
\[0\]
Alternative 24
Error63.1
Cost64
\[-1\]

Error

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 - x \cdot \left(12 + x \cdot -9\right)}\]
  3. Using strategy rm
  4. Applied distribute-rgt-in_binary64_150320.1

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

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

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

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

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

Reproduce

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

  :herbie-target
  (+ 3.0 (- (* (* 9.0 x) x) (* 12.0 x)))

  (* 3.0 (+ (- (* (* x 3.0) x) (* x 4.0)) 1.0)))