Average Error: 0.1 → 0.1
Time: 4.3s
Precision: binary64
Cost: 448
\[x + \left(y \cdot z\right) \cdot z\]
\[x + z \cdot \left(z \cdot y\right)\]
x + \left(y \cdot z\right) \cdot z
x + z \cdot \left(z \cdot y\right)
(FPCore (x y z) :precision binary64 (+ x (* (* y z) z)))
(FPCore (x y z) :precision binary64 (+ x (* z (* z y))))
double code(double x, double y, double z) {
	return x + ((y * z) * z);
}
double code(double x, double y, double z) {
	return x + (z * (z * y));
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Alternatives

Alternative 1
Error14.0
Cost648
\[\begin{array}{l} \mathbf{if}\;z \leq -5.775347209345589 \cdot 10^{-31} \lor \neg \left(z \leq 9.244144524481902 \cdot 10^{-10}\right):\\ \;\;\;\;z \cdot \left(z \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array}\]
Alternative 2
Error20.5
Cost64
\[x\]
Alternative 3
Error61.8
Cost64
\[-1\]
Alternative 4
Error61.9
Cost64
\[1\]

Error

Derivation

  1. Initial program 0.1

    \[x + \left(y \cdot z\right) \cdot z\]
  2. Simplified0.1

    \[\leadsto \color{blue}{x + z \cdot \left(z \cdot y\right)}\]
  3. Final simplification0.1

    \[\leadsto x + z \cdot \left(z \cdot y\right)\]

Reproduce

herbie shell --seed 2021044 
(FPCore (x y z)
  :name "Statistics.Sample:robustSumVarWeighted from math-functions-0.1.5.2"
  :precision binary64
  (+ x (* (* y z) z)))