Average Error: 0.3 → 0.4
Time: 1.4s
Precision: 64
\[\left(x \cdot 27\right) \cdot y\]
\[\left(27 \cdot y\right) \cdot x\]
\left(x \cdot 27\right) \cdot y
\left(27 \cdot y\right) \cdot x
double code(double x, double y) {
	return ((double) (((double) (x * 27.0)) * y));
}
double code(double x, double y) {
	return ((double) (((double) (27.0 * y)) * x));
}

Error

Bits error versus x

Bits error versus y

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.3

    \[\left(x \cdot 27\right) \cdot y\]
  2. Using strategy rm
  3. Applied *-un-lft-identity0.3

    \[\leadsto \left(x \cdot \color{blue}{\left(1 \cdot 27\right)}\right) \cdot y\]
  4. Applied associate-*r*0.3

    \[\leadsto \color{blue}{\left(\left(x \cdot 1\right) \cdot 27\right)} \cdot y\]
  5. Applied associate-*l*0.4

    \[\leadsto \color{blue}{\left(x \cdot 1\right) \cdot \left(27 \cdot y\right)}\]
  6. Final simplification0.4

    \[\leadsto \left(27 \cdot y\right) \cdot x\]

Reproduce

herbie shell --seed 2020114 
(FPCore (x y)
  :name "Diagrams.Solve.Polynomial:cubForm  from diagrams-solve-0.1, F"
  :precision binary64
  (* (* x 27) y))