Average Error: 0.2 → 0.2
Time: 1.6s
Precision: binary64
\[\left(x \cdot 3\right) \cdot x\]
\[\left(x \cdot x\right) \cdot 3\]
\left(x \cdot 3\right) \cdot x
\left(x \cdot x\right) \cdot 3
(FPCore (x) :precision binary64 (* (* x 3.0) x))
(FPCore (x) :precision binary64 (* (* x x) 3.0))
double code(double x) {
	return ((double) (((double) (x * 3.0)) * x));
}
double code(double x) {
	return ((double) (((double) (x * x)) * 3.0));
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program Error: 0.2 bits

    \[\left(x \cdot 3\right) \cdot x\]
  2. Using strategy rm
  3. Applied add-sqr-sqrtError: 0.4 bits

    \[\leadsto \color{blue}{\sqrt{\left(x \cdot 3\right) \cdot x} \cdot \sqrt{\left(x \cdot 3\right) \cdot x}}\]
  4. SimplifiedError: 0.4 bits

    \[\leadsto \color{blue}{\sqrt{x \cdot \left(x \cdot 3\right)}} \cdot \sqrt{\left(x \cdot 3\right) \cdot x}\]
  5. SimplifiedError: 0.4 bits

    \[\leadsto \sqrt{x \cdot \left(x \cdot 3\right)} \cdot \color{blue}{\sqrt{x \cdot \left(x \cdot 3\right)}}\]
  6. Using strategy rm
  7. Applied *-un-lft-identityError: 0.4 bits

    \[\leadsto \sqrt{x \cdot \left(x \cdot 3\right)} \cdot \color{blue}{\left(1 \cdot \sqrt{x \cdot \left(x \cdot 3\right)}\right)}\]
  8. Applied associate-*r*Error: 0.4 bits

    \[\leadsto \color{blue}{\left(\sqrt{x \cdot \left(x \cdot 3\right)} \cdot 1\right) \cdot \sqrt{x \cdot \left(x \cdot 3\right)}}\]
  9. SimplifiedError: 0.3 bits

    \[\leadsto \color{blue}{\left|x \cdot \sqrt{3}\right|} \cdot \sqrt{x \cdot \left(x \cdot 3\right)}\]
  10. Using strategy rm
  11. Applied associate-*r*Error: 0.3 bits

    \[\leadsto \left|x \cdot \sqrt{3}\right| \cdot \sqrt{\color{blue}{\left(x \cdot x\right) \cdot 3}}\]
  12. Using strategy rm
  13. Applied pow1Error: 0.3 bits

    \[\leadsto \left|x \cdot \sqrt{3}\right| \cdot \color{blue}{{\left(\sqrt{\left(x \cdot x\right) \cdot 3}\right)}^{1}}\]
  14. Applied pow1Error: 0.3 bits

    \[\leadsto \color{blue}{{\left(\left|x \cdot \sqrt{3}\right|\right)}^{1}} \cdot {\left(\sqrt{\left(x \cdot x\right) \cdot 3}\right)}^{1}\]
  15. Applied pow-prod-downError: 0.3 bits

    \[\leadsto \color{blue}{{\left(\left|x \cdot \sqrt{3}\right| \cdot \sqrt{\left(x \cdot x\right) \cdot 3}\right)}^{1}}\]
  16. SimplifiedError: 0.2 bits

    \[\leadsto {\color{blue}{\left(\left(x \cdot x\right) \cdot 3\right)}}^{1}\]
  17. Final simplificationError: 0.2 bits

    \[\leadsto \left(x \cdot x\right) \cdot 3\]

Reproduce

herbie shell --seed 2020205 
(FPCore (x)
  :name "Diagrams.Tangent:$catParam from diagrams-lib-1.3.0.3, F"
  :precision binary64
  (* (* x 3.0) x))