?

Average Error: 0.1 → 0.1
Time: 31.6s
Precision: binary64
Cost: 960

?

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

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation?

  1. Initial program 0.1

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

    \[\leadsto \color{blue}{x \cdot \left(y + \left(z + \left(y + \left(z + t\right)\right)\right)\right) + y \cdot 5} \]
    Proof

    [Start]0.1

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

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

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

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

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

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

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

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

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

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

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

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

    \[ x \cdot \left(y + \left(z + \color{blue}{\left(y + \left(z + t\right)\right)}\right)\right) + y \cdot 5 \]
  3. Taylor expanded in z around 0 0.1

    \[\leadsto \color{blue}{\left(x \cdot \left(2 \cdot y + t\right) + 2 \cdot \left(z \cdot x\right)\right)} + y \cdot 5 \]
  4. Taylor expanded in x around 0 0.1

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

    \[\leadsto \color{blue}{\left(t + 2 \cdot \left(z + y\right)\right) \cdot x} + y \cdot 5 \]
    Proof

    [Start]0.1

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

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

    \[ \color{blue}{\left(t + \left(2 \cdot z + 2 \cdot y\right)\right)} \cdot x + y \cdot 5 \]

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

    \[ \left(t + \left(2 \cdot z + \color{blue}{y \cdot 2}\right)\right) \cdot x + y \cdot 5 \]

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

    \[ \left(t + \color{blue}{2 \cdot \left(y + z\right)}\right) \cdot x + y \cdot 5 \]

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

    \[ \left(t + 2 \cdot \color{blue}{\left(z + y\right)}\right) \cdot x + y \cdot 5 \]
  6. Taylor expanded in t around 0 0.1

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

    \[\leadsto \color{blue}{\left(2 \cdot \left(\left(y + z\right) \cdot x\right) + x \cdot t\right)} + y \cdot 5 \]
    Proof

    [Start]0.1

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

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

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

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

Alternatives

Alternative 1
Error26.9
Cost1240
\[\begin{array}{l} t_1 := z \cdot \left(2 \cdot x\right)\\ t_2 := y \cdot \left(5 - x \cdot -2\right)\\ t_3 := \left(y + t\right) \cdot x\\ \mathbf{if}\;y \leq -4.7 \cdot 10^{-136}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq -1.45 \cdot 10^{-256}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 5.2 \cdot 10^{-220}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;y \leq 2.6 \cdot 10^{-120}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 5.8 \cdot 10^{-75}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 4.8 \cdot 10^{-27}:\\ \;\;\;\;t_3\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 2
Error26.7
Cost1240
\[\begin{array}{l} t_1 := y \cdot \left(5 - x \cdot -2\right)\\ t_2 := \left(y + t\right) \cdot x\\ \mathbf{if}\;y \leq -1.24 \cdot 10^{-135}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -6.2 \cdot 10^{-257}:\\ \;\;\;\;\left(y + z\right) \cdot \left(2 \cdot x\right)\\ \mathbf{elif}\;y \leq 2.4 \cdot 10^{-220}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 4.2 \cdot 10^{-111}:\\ \;\;\;\;z \cdot \left(2 \cdot x\right)\\ \mathbf{elif}\;y \leq 6.6 \cdot 10^{-73}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 5 \cdot 10^{-27}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 3
Error9.9
Cost1232
\[\begin{array}{l} t_1 := x \cdot \left(y + \left(y + t\right)\right) + y \cdot 5\\ t_2 := \left(t + 2 \cdot \left(y + z\right)\right) \cdot x\\ \mathbf{if}\;x \leq -1.42 \cdot 10^{-11}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \leq -3 \cdot 10^{-199}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq 5.5 \cdot 10^{-185}:\\ \;\;\;\;z \cdot \left(x + x\right) + y \cdot 5\\ \mathbf{elif}\;x \leq 4.6 \cdot 10^{+14}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 4
Error31.6
Cost1112
\[\begin{array}{l} t_1 := y \cdot \left(x - -5\right)\\ t_2 := z \cdot \left(2 \cdot x\right)\\ \mathbf{if}\;y \leq -1.48 \cdot 10^{-136}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -1.92 \cdot 10^{-256}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 9.5 \cdot 10^{-219}:\\ \;\;\;\;t \cdot x\\ \mathbf{elif}\;y \leq 3.7 \cdot 10^{-109}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 2.4 \cdot 10^{-75}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 5.8 \cdot 10^{-26}:\\ \;\;\;\;t \cdot x\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 5
Error31.6
Cost1112
\[\begin{array}{l} t_1 := \left(y + t\right) \cdot x\\ t_2 := y \cdot \left(x - -5\right)\\ t_3 := z \cdot \left(2 \cdot x\right)\\ \mathbf{if}\;y \leq -1.76 \cdot 10^{-135}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq -1.92 \cdot 10^{-256}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;y \leq 3 \cdot 10^{-217}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 3 \cdot 10^{-110}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;y \leq 6.5 \cdot 10^{-75}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 8.5 \cdot 10^{-27}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 6
Error15.1
Cost1108
\[\begin{array}{l} t_1 := t \cdot x + y \cdot 5\\ t_2 := y \cdot \left(5 - x \cdot -2\right)\\ t_3 := \left(2 \cdot z + t\right) \cdot x\\ \mathbf{if}\;y \leq -1.2 \cdot 10^{+63}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq -1.95 \cdot 10^{-135}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 7.2 \cdot 10^{-109}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;y \leq 2.3 \cdot 10^{-72}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 3.3 \cdot 10^{-26}:\\ \;\;\;\;t_3\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 7
Error9.7
Cost1104
\[\begin{array}{l} t_1 := t \cdot x + y \cdot 5\\ t_2 := \left(t + 2 \cdot \left(y + z\right)\right) \cdot x\\ \mathbf{if}\;x \leq -9.5 \cdot 10^{-14}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \leq -1.65 \cdot 10^{-201}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq 3.8 \cdot 10^{-184}:\\ \;\;\;\;z \cdot \left(x + x\right) + y \cdot 5\\ \mathbf{elif}\;x \leq 1.55 \cdot 10^{-13}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 8
Error0.7
Cost968
\[\begin{array}{l} t_1 := \left(t + 2 \cdot \left(y + z\right)\right) \cdot x\\ \mathbf{if}\;x \leq -1700000:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq 2.5:\\ \;\;\;\;x \cdot \left(z + \left(z + t\right)\right) + y \cdot 5\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 9
Error0.1
Cost960
\[x \cdot \left(y + \left(z + \left(y + \left(z + t\right)\right)\right)\right) + y \cdot 5 \]
Alternative 10
Error31.9
Cost848
\[\begin{array}{l} t_1 := y \cdot \left(x - -5\right)\\ \mathbf{if}\;y \leq -3.2 \cdot 10^{-128}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 6.2 \cdot 10^{-131}:\\ \;\;\;\;t \cdot x\\ \mathbf{elif}\;y \leq 2.6 \cdot 10^{-76}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 5.8 \cdot 10^{-27}:\\ \;\;\;\;t \cdot x\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 11
Error10.0
Cost840
\[\begin{array}{l} t_1 := \left(t + 2 \cdot \left(y + z\right)\right) \cdot x\\ \mathbf{if}\;x \leq -5 \cdot 10^{-13}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq 3.2 \cdot 10^{-16}:\\ \;\;\;\;t \cdot x + y \cdot 5\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 12
Error0.1
Cost832
\[y \cdot 5 + x \cdot \left(t + 2 \cdot \left(z + y\right)\right) \]
Alternative 13
Error32.8
Cost720
\[\begin{array}{l} \mathbf{if}\;y \leq -6 \cdot 10^{-130}:\\ \;\;\;\;y \cdot 5\\ \mathbf{elif}\;y \leq 8 \cdot 10^{-125}:\\ \;\;\;\;t \cdot x\\ \mathbf{elif}\;y \leq 8.8 \cdot 10^{-77}:\\ \;\;\;\;y \cdot 5\\ \mathbf{elif}\;y \leq 4.9 \cdot 10^{-27}:\\ \;\;\;\;t \cdot x\\ \mathbf{else}:\\ \;\;\;\;y \cdot 5\\ \end{array} \]
Alternative 14
Error14.6
Cost712
\[\begin{array}{l} t_1 := y \cdot \left(5 - x \cdot -2\right)\\ \mathbf{if}\;y \leq -62:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 1.7 \cdot 10^{-26}:\\ \;\;\;\;\left(2 \cdot z + t\right) \cdot x\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 15
Error47.1
Cost192
\[t \cdot x \]

Error

Reproduce?

herbie shell --seed 2023074 
(FPCore (x y z t)
  :name "Graphics.Rendering.Plot.Render.Plot.Legend:renderLegendOutside from plot-0.2.3.4, B"
  :precision binary64
  (+ (* x (+ (+ (+ (+ y z) z) y) t)) (* y 5.0)))