Average Error: 0.1 → 0.1
Time: 7.8s
Precision: binary64
Cost: 576
\[\left(\left(\left(\left(x + y\right) + y\right) + x\right) + z\right) + x\]
\[x + \left(\left(x + y\right) \cdot 2 + z\right)\]
\left(\left(\left(\left(x + y\right) + y\right) + x\right) + z\right) + x
x + \left(\left(x + y\right) \cdot 2 + z\right)
(FPCore (x y z) :precision binary64 (+ (+ (+ (+ (+ x y) y) x) z) x))
(FPCore (x y z) :precision binary64 (+ x (+ (* (+ x y) 2.0) z)))
double code(double x, double y, double z) {
	return ((((x + y) + y) + x) + z) + x;
}
double code(double x, double y, double z) {
	return x + (((x + y) * 2.0) + 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
Error9.6
Cost962
\[\begin{array}{l} \mathbf{if}\;y \leq -4429505744626565.5:\\ \;\;\;\;x + \left(x + y\right) \cdot 2\\ \mathbf{elif}\;y \leq 32332440428.776733:\\ \;\;\;\;z + x \cdot 3\\ \mathbf{else}:\\ \;\;\;\;z + \left(y + y\right)\\ \end{array}\]
Alternative 2
Error10.5
Cost1178
\[\begin{array}{l} \mathbf{if}\;x \leq -1.5746241265694534 \cdot 10^{+79} \lor \neg \left(x \leq -7.556894985165785 \cdot 10^{+39} \lor \neg \left(x \leq -2.1300916330879537 \cdot 10^{-50}\right) \land \left(x \leq 1815967673.5985475 \lor \neg \left(x \leq 9.231738273350996 \cdot 10^{+145}\right) \land x \leq 5.447935918106146 \cdot 10^{+175}\right)\right):\\ \;\;\;\;z + x \cdot 3\\ \mathbf{else}:\\ \;\;\;\;z + \left(y + y\right)\\ \end{array}\]
Alternative 3
Error13.6
Cost913
\[\begin{array}{l} \mathbf{if}\;y \leq -1.873162488547066 \cdot 10^{+121} \lor \neg \left(y \leq 7.003794247188141 \cdot 10^{+89} \lor \neg \left(y \leq 2.3009499683882742 \cdot 10^{+182}\right) \land y \leq 4.462965352906481 \cdot 10^{+232}\right):\\ \;\;\;\;y + y\\ \mathbf{else}:\\ \;\;\;\;z + x \cdot 3\\ \end{array}\]
Alternative 4
Error30.3
Cost3164
\[\begin{array}{l} \mathbf{if}\;x \leq -3.2253954486367324 \cdot 10^{+81}:\\ \;\;\;\;x \cdot 3\\ \mathbf{elif}\;x \leq -2.1595592120073467 \cdot 10^{+42}:\\ \;\;\;\;y + y\\ \mathbf{elif}\;x \leq -2.1814180357360506 \cdot 10^{-147}:\\ \;\;\;\;z\\ \mathbf{elif}\;x \leq -6.2243467008708644 \cdot 10^{-260}:\\ \;\;\;\;y + y\\ \mathbf{elif}\;x \leq 9.718539567503092 \cdot 10^{-284}:\\ \;\;\;\;z\\ \mathbf{elif}\;x \leq 7.220278433245301 \cdot 10^{-173}:\\ \;\;\;\;y + y\\ \mathbf{elif}\;x \leq 7.825255972969949 \cdot 10^{-45}:\\ \;\;\;\;z\\ \mathbf{elif}\;x \leq 15344855150607.389 \lor \neg \left(x \leq 1.8149576817243297 \cdot 10^{+30}\right) \land \left(x \leq 2.7248247480791156 \cdot 10^{+91} \lor \neg \left(x \leq 3.2935562786785273 \cdot 10^{+146}\right) \land x \leq 6.190416025844443 \cdot 10^{+175}\right):\\ \;\;\;\;y + y\\ \mathbf{else}:\\ \;\;\;\;x \cdot 3\\ \end{array}\]
Alternative 5
Error30.6
Cost520
\[\begin{array}{l} \mathbf{if}\;y \leq -3091657514221.233 \lor \neg \left(y \leq 5.701171549051062 \cdot 10^{+26}\right):\\ \;\;\;\;y + y\\ \mathbf{else}:\\ \;\;\;\;z\\ \end{array}\]
Alternative 6
Error42.4
Cost64
\[z\]
Alternative 7
Error62.0
Cost64
\[-1\]
Alternative 8
Error62.0
Cost64
\[1\]

Error

Derivation

  1. Initial program 0.1

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

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

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

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

Reproduce

herbie shell --seed 2021044 
(FPCore (x y z)
  :name "Graphics.Rendering.Plot.Render.Plot.Legend:renderLegendInside from plot-0.2.3.4"
  :precision binary64
  (+ (+ (+ (+ (+ x y) y) x) z) x))