?

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

?

\[x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5 \]
\[y \cdot \left(5 + 2 \cdot x\right) + \left(2 \cdot z + t\right) \cdot x \]
(FPCore (x y z t)
 :precision binary64
 (+ (* x (+ (+ (+ (+ y z) z) y) t)) (* y 5.0)))
(FPCore (x y z t)
 :precision binary64
 (+ (* y (+ 5.0 (* 2.0 x))) (* (+ (* 2.0 z) t) x)))
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 (y * (5.0 + (2.0 * x))) + (((2.0 * z) + t) * x);
}
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 = (y * (5.0d0 + (2.0d0 * x))) + (((2.0d0 * z) + t) * x)
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 (y * (5.0 + (2.0 * x))) + (((2.0 * z) + t) * x);
}
def code(x, y, z, t):
	return (x * ((((y + z) + z) + y) + t)) + (y * 5.0)
def code(x, y, z, t):
	return (y * (5.0 + (2.0 * x))) + (((2.0 * z) + t) * x)
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(y * Float64(5.0 + Float64(2.0 * x))) + Float64(Float64(Float64(2.0 * z) + t) * x))
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 = (y * (5.0 + (2.0 * x))) + (((2.0 * z) + t) * x);
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[(y * N[(5.0 + N[(2.0 * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(2.0 * z), $MachinePrecision] + t), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]
x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5
y \cdot \left(5 + 2 \cdot x\right) + \left(2 \cdot z + t\right) \cdot x

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. Taylor expanded in y around 0 0.1

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

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

Alternatives

Alternative 1
Error9.4
Cost1364
\[\begin{array}{l} t_1 := z \cdot \left(2 \cdot x\right) + y \cdot 5\\ t_2 := x \cdot \left(t + 2 \cdot \left(z + y\right)\right)\\ t_3 := t \cdot x + \left(x \cdot 2 + 5\right) \cdot y\\ \mathbf{if}\;x \leq -3.6 \cdot 10^{-9}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \leq -5.5 \cdot 10^{-81}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq -1.8 \cdot 10^{-150}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;x \leq -9.5 \cdot 10^{-294}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq 2 \cdot 10^{-12}:\\ \;\;\;\;t_3\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 2
Error28.6
Cost1240
\[\begin{array}{l} t_1 := x \cdot \left(2 \cdot \left(z + y\right)\right)\\ \mathbf{if}\;x \leq -2.5 \cdot 10^{+106}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq -1.5 \cdot 10^{+41}:\\ \;\;\;\;t \cdot x\\ \mathbf{elif}\;x \leq -4.5 \cdot 10^{-79}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq -1.05 \cdot 10^{-150}:\\ \;\;\;\;t \cdot x\\ \mathbf{elif}\;x \leq -3 \cdot 10^{-161}:\\ \;\;\;\;z \cdot \left(2 \cdot x\right)\\ \mathbf{elif}\;x \leq 1.3 \cdot 10^{-14}:\\ \;\;\;\;y \cdot 5\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 3
Error24.9
Cost1240
\[\begin{array}{l} t_1 := \left(x + \left(x + 5\right)\right) \cdot y\\ t_2 := \left(2 \cdot y + t\right) \cdot x\\ \mathbf{if}\;y \leq -3200:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -1.46 \cdot 10^{-28}:\\ \;\;\;\;x \cdot \left(2 \cdot \left(z + y\right)\right)\\ \mathbf{elif}\;y \leq -4.5 \cdot 10^{-67}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -4.4 \cdot 10^{-218}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 3 \cdot 10^{-298}:\\ \;\;\;\;z \cdot \left(2 \cdot x\right)\\ \mathbf{elif}\;y \leq 2.2 \cdot 10^{-34}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 4
Error9.4
Cost1236
\[\begin{array}{l} t_1 := z \cdot \left(2 \cdot x\right) + y \cdot 5\\ t_2 := x \cdot \left(t + 2 \cdot \left(z + y\right)\right)\\ t_3 := t \cdot x + y \cdot 5\\ \mathbf{if}\;x \leq -3.6 \cdot 10^{-9}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \leq -2.65 \cdot 10^{-79}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq -2.5 \cdot 10^{-150}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;x \leq -5 \cdot 10^{-294}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq 6.2 \cdot 10^{-15}:\\ \;\;\;\;t_3\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 5
Error25.7
Cost1108
\[\begin{array}{l} t_1 := \left(x + \left(x + 5\right)\right) \cdot y\\ \mathbf{if}\;y \leq -1700:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -8.6 \cdot 10^{-169}:\\ \;\;\;\;x \cdot \left(2 \cdot \left(z + y\right)\right)\\ \mathbf{elif}\;y \leq -6 \cdot 10^{-216}:\\ \;\;\;\;t \cdot x\\ \mathbf{elif}\;y \leq 2.15 \cdot 10^{-299}:\\ \;\;\;\;z \cdot \left(2 \cdot x\right)\\ \mathbf{elif}\;y \leq 7 \cdot 10^{-50}:\\ \;\;\;\;t \cdot x\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 6
Error31.6
Cost984
\[\begin{array}{l} t_1 := z \cdot \left(2 \cdot x\right)\\ \mathbf{if}\;y \leq -2250:\\ \;\;\;\;y \cdot 5\\ \mathbf{elif}\;y \leq -2.7 \cdot 10^{-29}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -9.2 \cdot 10^{-70}:\\ \;\;\;\;y \cdot 5\\ \mathbf{elif}\;y \leq -2.2 \cdot 10^{-219}:\\ \;\;\;\;t \cdot x\\ \mathbf{elif}\;y \leq 1.35 \cdot 10^{-298}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 1.15 \cdot 10^{-31}:\\ \;\;\;\;t \cdot x\\ \mathbf{else}:\\ \;\;\;\;y \cdot 5\\ \end{array} \]
Alternative 7
Error32.9
Cost980
\[\begin{array}{l} \mathbf{if}\;x \leq -2.55 \cdot 10^{-9}:\\ \;\;\;\;t \cdot x\\ \mathbf{elif}\;x \leq -1.4 \cdot 10^{-78}:\\ \;\;\;\;y \cdot 5\\ \mathbf{elif}\;x \leq -3.2 \cdot 10^{-120}:\\ \;\;\;\;t \cdot x\\ \mathbf{elif}\;x \leq 6 \cdot 10^{-77}:\\ \;\;\;\;y \cdot 5\\ \mathbf{elif}\;x \leq 9.5 \cdot 10^{+14}:\\ \;\;\;\;t \cdot x\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(x \cdot 2\right)\\ \end{array} \]
Alternative 8
Error14.5
Cost976
\[\begin{array}{l} t_1 := \left(x + \left(x + 5\right)\right) \cdot y\\ \mathbf{if}\;y \leq -1650:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -1.6 \cdot 10^{-29}:\\ \;\;\;\;x \cdot \left(2 \cdot \left(z + y\right)\right)\\ \mathbf{elif}\;y \leq -1.3 \cdot 10^{-65}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 1.5 \cdot 10^{+20}:\\ \;\;\;\;\left(2 \cdot z + t\right) \cdot x\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 9
Error14.5
Cost976
\[\begin{array}{l} t_1 := \left(x + \left(x + 5\right)\right) \cdot y\\ \mathbf{if}\;y \leq -2650:\\ \;\;\;\;\left(5 - x \cdot -2\right) \cdot y\\ \mathbf{elif}\;y \leq -2.8 \cdot 10^{-28}:\\ \;\;\;\;x \cdot \left(2 \cdot \left(z + y\right)\right)\\ \mathbf{elif}\;y \leq -1.3 \cdot 10^{-65}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 7.4 \cdot 10^{+19}:\\ \;\;\;\;\left(2 \cdot z + t\right) \cdot x\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 10
Error8.8
Cost972
\[\begin{array}{l} t_1 := 2 \cdot \left(z + y\right)\\ \mathbf{if}\;t \leq -1460000:\\ \;\;\;\;t \cdot x + \left(x \cdot 2 + 5\right) \cdot y\\ \mathbf{elif}\;t \leq 5.5 \cdot 10^{-45}:\\ \;\;\;\;x \cdot t_1 + y \cdot 5\\ \mathbf{elif}\;t \leq 2 \cdot 10^{+84}:\\ \;\;\;\;x \cdot \left(t + t_1\right)\\ \mathbf{else}:\\ \;\;\;\;t \cdot x + y \cdot 5\\ \end{array} \]
Alternative 11
Error8.8
Cost972
\[\begin{array}{l} t_1 := 2 \cdot \left(z + y\right)\\ \mathbf{if}\;t \leq -38000000:\\ \;\;\;\;\left(2 \cdot y + t\right) \cdot x + y \cdot 5\\ \mathbf{elif}\;t \leq 5.5 \cdot 10^{-45}:\\ \;\;\;\;x \cdot t_1 + y \cdot 5\\ \mathbf{elif}\;t \leq 2 \cdot 10^{+84}:\\ \;\;\;\;x \cdot \left(t + t_1\right)\\ \mathbf{else}:\\ \;\;\;\;t \cdot x + y \cdot 5\\ \end{array} \]
Alternative 12
Error0.6
Cost968
\[\begin{array}{l} t_1 := x \cdot \left(t + 2 \cdot \left(z + y\right)\right)\\ \mathbf{if}\;x \leq -2.5:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq 2.5:\\ \;\;\;\;\left(2 \cdot z + t\right) \cdot x + y \cdot 5\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 13
Error0.1
Cost960
\[x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5 \]
Alternative 14
Error10.4
Cost840
\[\begin{array}{l} t_1 := x \cdot \left(t + 2 \cdot \left(z + y\right)\right)\\ \mathbf{if}\;x \leq -5.8 \cdot 10^{-97}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq 3 \cdot 10^{-14}:\\ \;\;\;\;t \cdot x + y \cdot 5\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 15
Error31.6
Cost456
\[\begin{array}{l} \mathbf{if}\;y \leq -7 \cdot 10^{-66}:\\ \;\;\;\;y \cdot 5\\ \mathbf{elif}\;y \leq 10^{-31}:\\ \;\;\;\;t \cdot x\\ \mathbf{else}:\\ \;\;\;\;y \cdot 5\\ \end{array} \]
Alternative 16
Error47.2
Cost192
\[t \cdot x \]

Error

Reproduce?

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