?

Average Error: 0.1 → 0.1
Time: 15.5s
Precision: binary64
Cost: 576

?

\[\left(\left(\left(\left(x + y\right) + y\right) + x\right) + z\right) + x \]
\[\left(z + x \cdot 3\right) - y \cdot -2 \]
(FPCore (x y z) :precision binary64 (+ (+ (+ (+ (+ x y) y) x) z) x))
(FPCore (x y z) :precision binary64 (- (+ z (* x 3.0)) (* y -2.0)))
double code(double x, double y, double z) {
	return ((((x + y) + y) + x) + z) + x;
}
double code(double x, double y, double z) {
	return (z + (x * 3.0)) - (y * -2.0);
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    code = ((((x + y) + y) + x) + z) + x
end function
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    code = (z + (x * 3.0d0)) - (y * (-2.0d0))
end function
public static double code(double x, double y, double z) {
	return ((((x + y) + y) + x) + z) + x;
}
public static double code(double x, double y, double z) {
	return (z + (x * 3.0)) - (y * -2.0);
}
def code(x, y, z):
	return ((((x + y) + y) + x) + z) + x
def code(x, y, z):
	return (z + (x * 3.0)) - (y * -2.0)
function code(x, y, z)
	return Float64(Float64(Float64(Float64(Float64(x + y) + y) + x) + z) + x)
end
function code(x, y, z)
	return Float64(Float64(z + Float64(x * 3.0)) - Float64(y * -2.0))
end
function tmp = code(x, y, z)
	tmp = ((((x + y) + y) + x) + z) + x;
end
function tmp = code(x, y, z)
	tmp = (z + (x * 3.0)) - (y * -2.0);
end
code[x_, y_, z_] := N[(N[(N[(N[(N[(x + y), $MachinePrecision] + y), $MachinePrecision] + x), $MachinePrecision] + z), $MachinePrecision] + x), $MachinePrecision]
code[x_, y_, z_] := N[(N[(z + N[(x * 3.0), $MachinePrecision]), $MachinePrecision] - N[(y * -2.0), $MachinePrecision]), $MachinePrecision]
\left(\left(\left(\left(x + y\right) + y\right) + x\right) + z\right) + x
\left(z + x \cdot 3\right) - y \cdot -2

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

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}{\left(x + \left(y + y\right)\right) + \left(\left(x + z\right) + x\right)} \]
    Proof

    [Start]0.1

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

    rational.json-simplify-1 [=>]0.1

    \[ \color{blue}{x + \left(\left(\left(\left(x + y\right) + y\right) + x\right) + z\right)} \]

    rational.json-simplify-41 [=>]0.1

    \[ \color{blue}{\left(\left(\left(x + y\right) + y\right) + x\right) + \left(z + x\right)} \]

    rational.json-simplify-1 [=>]0.1

    \[ \color{blue}{\left(z + x\right) + \left(\left(\left(x + y\right) + y\right) + x\right)} \]

    rational.json-simplify-1 [=>]0.1

    \[ \left(z + x\right) + \color{blue}{\left(x + \left(\left(x + y\right) + y\right)\right)} \]

    rational.json-simplify-41 [<=]0.1

    \[ \color{blue}{\left(\left(x + y\right) + y\right) + \left(\left(z + x\right) + x\right)} \]

    rational.json-simplify-1 [=>]0.1

    \[ \color{blue}{\left(y + \left(x + y\right)\right)} + \left(\left(z + x\right) + x\right) \]

    rational.json-simplify-41 [=>]0.1

    \[ \color{blue}{\left(x + \left(y + y\right)\right)} + \left(\left(z + x\right) + x\right) \]

    rational.json-simplify-1 [=>]0.1

    \[ \left(x + \left(y + y\right)\right) + \left(\color{blue}{\left(x + z\right)} + x\right) \]
  3. Applied egg-rr0.1

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

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

Alternatives

Alternative 1
Error30.3
Cost1116
\[\begin{array}{l} \mathbf{if}\;y \leq -9.8 \cdot 10^{+54}:\\ \;\;\;\;2 \cdot y\\ \mathbf{elif}\;y \leq -2.3 \cdot 10^{-124}:\\ \;\;\;\;z\\ \mathbf{elif}\;y \leq -1.55 \cdot 10^{-263}:\\ \;\;\;\;x \cdot 3\\ \mathbf{elif}\;y \leq 3 \cdot 10^{-112}:\\ \;\;\;\;z\\ \mathbf{elif}\;y \leq 6.2 \cdot 10^{-51}:\\ \;\;\;\;x \cdot 3\\ \mathbf{elif}\;y \leq 5.5 \cdot 10^{-39}:\\ \;\;\;\;z\\ \mathbf{elif}\;y \leq 5.9 \cdot 10^{+97}:\\ \;\;\;\;x \cdot 3\\ \mathbf{else}:\\ \;\;\;\;2 \cdot y\\ \end{array} \]
Alternative 2
Error14.4
Cost584
\[\begin{array}{l} \mathbf{if}\;x \leq -4.2 \cdot 10^{+220}:\\ \;\;\;\;x \cdot 3\\ \mathbf{elif}\;x \leq 1.9 \cdot 10^{+68}:\\ \;\;\;\;2 \cdot y + z\\ \mathbf{else}:\\ \;\;\;\;x \cdot 3\\ \end{array} \]
Alternative 3
Error9.6
Cost584
\[\begin{array}{l} t_0 := 2 \cdot y + z\\ \mathbf{if}\;y \leq -7.5 \cdot 10^{+15}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 5.7 \cdot 10^{+97}:\\ \;\;\;\;z - x \cdot -3\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 4
Error30.7
Cost456
\[\begin{array}{l} \mathbf{if}\;y \leq -1.9 \cdot 10^{+56}:\\ \;\;\;\;2 \cdot y\\ \mathbf{elif}\;y \leq 7.4 \cdot 10^{+73}:\\ \;\;\;\;z\\ \mathbf{else}:\\ \;\;\;\;2 \cdot y\\ \end{array} \]
Alternative 5
Error42.6
Cost64
\[z \]

Error

Reproduce?

herbie shell --seed 2023077 
(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))