?

Average Error: 0.1 → 0.1
Time: 4.0s
Precision: binary64
Cost: 704

?

\[\left(\left(\left(\left(x + y\right) + y\right) + x\right) + z\right) + x \]
\[\left(\left(\left(\left(x + y\right) + y\right) + x\right) + z\right) + x \]
(FPCore (x y z) :precision binary64 (+ (+ (+ (+ (+ x y) y) x) z) x))
(FPCore (x y z) :precision binary64 (+ (+ (+ (+ (+ x y) y) x) z) x))
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 + y) + y) + x) + z) + x;
}
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 = ((((x + y) + y) + x) + z) + x
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 ((((x + y) + y) + x) + z) + x;
}
def code(x, y, z):
	return ((((x + y) + y) + x) + z) + x
def code(x, y, z):
	return ((((x + y) + y) + x) + z) + x
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(Float64(Float64(Float64(x + y) + y) + x) + z) + x)
end
function tmp = code(x, y, z)
	tmp = ((((x + y) + y) + x) + z) + x;
end
function tmp = code(x, y, z)
	tmp = ((((x + y) + y) + x) + z) + x;
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[(N[(N[(N[(x + y), $MachinePrecision] + y), $MachinePrecision] + x), $MachinePrecision] + z), $MachinePrecision] + x), $MachinePrecision]
\left(\left(\left(\left(x + y\right) + y\right) + x\right) + z\right) + x
\left(\left(\left(\left(x + y\right) + y\right) + x\right) + z\right) + x

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. Final simplification0.1

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

Alternatives

Alternative 1
Error30.2
Cost852
\[\begin{array}{l} \mathbf{if}\;y \leq -21:\\ \;\;\;\;2 \cdot y\\ \mathbf{elif}\;y \leq -5 \cdot 10^{-249}:\\ \;\;\;\;z\\ \mathbf{elif}\;y \leq 8 \cdot 10^{-193}:\\ \;\;\;\;x \cdot 3\\ \mathbf{elif}\;y \leq 1.25 \cdot 10^{-73}:\\ \;\;\;\;z\\ \mathbf{elif}\;y \leq 8.6 \cdot 10^{+67}:\\ \;\;\;\;x \cdot 3\\ \mathbf{else}:\\ \;\;\;\;2 \cdot y\\ \end{array} \]
Alternative 2
Error9.2
Cost712
\[\begin{array}{l} t_0 := x + 2 \cdot \left(y + x\right)\\ \mathbf{if}\;y \leq -1.15 \cdot 10^{+17}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 3.6 \cdot 10^{+33}:\\ \;\;\;\;3 \cdot x + z\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 3
Error13.1
Cost584
\[\begin{array}{l} \mathbf{if}\;x \leq -1.6 \cdot 10^{+166}:\\ \;\;\;\;x \cdot 3\\ \mathbf{elif}\;x \leq 1.05 \cdot 10^{+92}:\\ \;\;\;\;2 \cdot y + z\\ \mathbf{else}:\\ \;\;\;\;x \cdot 3\\ \end{array} \]
Alternative 4
Error9.1
Cost584
\[\begin{array}{l} t_0 := 2 \cdot y + z\\ \mathbf{if}\;y \leq -3.8 \cdot 10^{+14}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 1.35 \cdot 10^{+68}:\\ \;\;\;\;3 \cdot x + z\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 5
Error30.0
Cost456
\[\begin{array}{l} \mathbf{if}\;y \leq -0.245:\\ \;\;\;\;2 \cdot y\\ \mathbf{elif}\;y \leq 1.7 \cdot 10^{+38}:\\ \;\;\;\;z\\ \mathbf{else}:\\ \;\;\;\;2 \cdot y\\ \end{array} \]
Alternative 6
Error41.3
Cost64
\[z \]

Error

Reproduce?

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