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

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
Error0.0
Cost448
\[x + y \cdot \left(x + z\right)\]
Alternative 2
Error0.9
Cost648
\[\begin{array}{l} \mathbf{if}\;y \leq -1.013965942235674 \lor \neg \left(y \leq 0.9904418900705835\right):\\ \;\;\;\;y \cdot \left(x + z\right)\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot z\\ \end{array}\]
Alternative 3
Error6.7
Cost648
\[\begin{array}{l} \mathbf{if}\;z \leq -3.320538930979582 \cdot 10^{-133} \lor \neg \left(z \leq 5.977761113741552 \cdot 10^{-82}\right):\\ \;\;\;\;x + y \cdot z\\ \mathbf{else}:\\ \;\;\;\;x + x \cdot y\\ \end{array}\]
Alternative 4
Error15.7
Cost648
\[\begin{array}{l} \mathbf{if}\;x \leq -5.095514799684492 \cdot 10^{-160} \lor \neg \left(x \leq 4.87354262245467 \cdot 10^{-151}\right):\\ \;\;\;\;x + x \cdot y\\ \mathbf{else}:\\ \;\;\;\;y \cdot z\\ \end{array}\]
Alternative 5
Error23.3
Cost520
\[\begin{array}{l} \mathbf{if}\;y \leq -3.0219923869476414 \cdot 10^{-46} \lor \neg \left(y \leq 6.24263280653598 \cdot 10^{-17}\right):\\ \;\;\;\;y \cdot z\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array}\]
Alternative 6
Error35.1
Cost64
\[x\]

Error

Time

Derivation

  1. Initial program 0.0

    \[x + y \cdot \left(z + x\right)\]
  2. Using strategy rm
  3. Applied distribute-lft-in_binary64_44600.0

    \[\leadsto x + \color{blue}{\left(y \cdot z + y \cdot x\right)}\]
  4. Applied associate-+r+_binary64_44430.0

    \[\leadsto \color{blue}{\left(x + y \cdot z\right) + y \cdot x}\]
  5. Using strategy rm
  6. Applied pow1_binary64_45720.0

    \[\leadsto \color{blue}{{\left(x + y \cdot z\right)}^{1}} + y \cdot x\]
  7. Using strategy rm
  8. Applied pow1_binary64_45720.0

    \[\leadsto {\color{blue}{\left({\left(x + y \cdot z\right)}^{1}\right)}}^{1} + y \cdot x\]
  9. Simplified0.0

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

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

Reproduce

herbie shell --seed 2021065 
(FPCore (x y z)
  :name "Main:bigenough2 from A"
  :precision binary64
  (+ x (* y (+ z x))))