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

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
\[z + x \cdot \left(y + 0.5\right)\]
Alternative 2
Error1.0
Cost648
\[\begin{array}{l} \mathbf{if}\;y \leq -57186541343612.39 \lor \neg \left(y \leq 0.4988278874837578\right):\\ \;\;\;\;z + x \cdot y\\ \mathbf{else}:\\ \;\;\;\;z + x \cdot 0.5\\ \end{array}\]
Alternative 3
Error14.4
Cost913
\[\begin{array}{l} \mathbf{if}\;x \leq -5.820966759135245 \cdot 10^{+107} \lor \neg \left(x \leq -1.5011935502403412 \cdot 10^{-27} \lor \neg \left(x \leq -8.09714337546656 \cdot 10^{-46}\right) \land x \leq 1.7415642758229257 \cdot 10^{+136}\right):\\ \;\;\;\;x \cdot 0.5\\ \mathbf{else}:\\ \;\;\;\;z + x \cdot y\\ \end{array}\]
Alternative 4
Error29.1
Cost3402
\[\begin{array}{l} \mathbf{if}\;y \leq -4.0060398078321 \cdot 10^{+212}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;y \leq -3.0032075688344868 \cdot 10^{+172}:\\ \;\;\;\;z\\ \mathbf{elif}\;y \leq -369104715116989.56:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;y \leq -1.3483557008359073 \cdot 10^{-211}:\\ \;\;\;\;z\\ \mathbf{elif}\;y \leq -1.319364071887117 \cdot 10^{-235}:\\ \;\;\;\;x \cdot 0.5\\ \mathbf{elif}\;y \leq -4.904274792415923 \cdot 10^{-275}:\\ \;\;\;\;z\\ \mathbf{elif}\;y \leq 1.4332821407900676 \cdot 10^{-287}:\\ \;\;\;\;x \cdot 0.5\\ \mathbf{elif}\;y \leq 3.012511810149545 \cdot 10^{-200}:\\ \;\;\;\;z\\ \mathbf{elif}\;y \leq 1.1652345658611517 \cdot 10^{-80}:\\ \;\;\;\;x \cdot 0.5\\ \mathbf{elif}\;y \leq 5.315622375114234 \cdot 10^{+115}:\\ \;\;\;\;z\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array}\]
Alternative 5
Error28.2
Cost834
\[\begin{array}{l} \mathbf{if}\;z \leq -2.445186539705759 \cdot 10^{-46}:\\ \;\;\;\;z\\ \mathbf{elif}\;z \leq 2.902980193625566 \cdot 10^{-108}:\\ \;\;\;\;x \cdot y\\ \mathbf{else}:\\ \;\;\;\;z\\ \end{array}\]
Alternative 6
Error34.3
Cost64
\[z\]

Error

Time

Derivation

  1. Initial program 0.0

    \[\left(\frac{x}{2} + y \cdot x\right) + z\]
  2. Using strategy rm
  3. Applied pow1_binary64_90050.0

    \[\leadsto \color{blue}{{\left(\frac{x}{2} + y \cdot x\right)}^{1}} + z\]
  4. Using strategy rm
  5. Applied pow1_binary64_90050.0

    \[\leadsto \color{blue}{{\left({\left(\frac{x}{2} + y \cdot x\right)}^{1} + z\right)}^{1}}\]
  6. Using strategy rm
  7. Applied *-un-lft-identity_binary64_89440.0

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

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

    \[\leadsto z + \left(x \cdot y + \frac{x}{2}\right)\]

Reproduce

herbie shell --seed 2021040 
(FPCore (x y z)
  :name "Data.Histogram.Bin.BinF:$cfromIndex from histogram-fill-0.8.4.1"
  :precision binary64
  (+ (+ (/ x 2.0) (* y x)) z))