Average Error: 0.0 → 0.0
Time: 10.2s
Precision: binary64
Cost: 576
\[\frac{\left(x + y\right) - z}{t \cdot 2} \]
\[\frac{\left(x + y\right) - z}{t \cdot 2} \]
(FPCore (x y z t) :precision binary64 (/ (- (+ x y) z) (* t 2.0)))
(FPCore (x y z t) :precision binary64 (/ (- (+ x y) z) (* t 2.0)))
double code(double x, double y, double z, double t) {
	return ((x + y) - z) / (t * 2.0);
}
double code(double x, double y, double z, double t) {
	return ((x + y) - z) / (t * 2.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) / (t * 2.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 = ((x + y) - z) / (t * 2.0d0)
end function
public static double code(double x, double y, double z, double t) {
	return ((x + y) - z) / (t * 2.0);
}
public static double code(double x, double y, double z, double t) {
	return ((x + y) - z) / (t * 2.0);
}
def code(x, y, z, t):
	return ((x + y) - z) / (t * 2.0)
def code(x, y, z, t):
	return ((x + y) - z) / (t * 2.0)
function code(x, y, z, t)
	return Float64(Float64(Float64(x + y) - z) / Float64(t * 2.0))
end
function code(x, y, z, t)
	return Float64(Float64(Float64(x + y) - z) / Float64(t * 2.0))
end
function tmp = code(x, y, z, t)
	tmp = ((x + y) - z) / (t * 2.0);
end
function tmp = code(x, y, z, t)
	tmp = ((x + y) - z) / (t * 2.0);
end
code[x_, y_, z_, t_] := N[(N[(N[(x + y), $MachinePrecision] - z), $MachinePrecision] / N[(t * 2.0), $MachinePrecision]), $MachinePrecision]
code[x_, y_, z_, t_] := N[(N[(N[(x + y), $MachinePrecision] - z), $MachinePrecision] / N[(t * 2.0), $MachinePrecision]), $MachinePrecision]
\frac{\left(x + y\right) - z}{t \cdot 2}
\frac{\left(x + y\right) - z}{t \cdot 2}

Error

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.0

    \[\frac{\left(x + y\right) - z}{t \cdot 2} \]
  2. Final simplification0.0

    \[\leadsto \frac{\left(x + y\right) - z}{t \cdot 2} \]

Alternatives

Alternative 1
Error36.0
Cost1640
\[\begin{array}{l} t_1 := z \cdot \frac{-0.5}{t}\\ t_2 := \frac{x \cdot 0.5}{t}\\ \mathbf{if}\;y \leq -5.929598755103772 \cdot 10^{-183}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq -3.0487142073874627 \cdot 10^{-188}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -8.472534343986813 \cdot 10^{-308}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 2.380702399233408 \cdot 10^{-274}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 2.721129696409804 \cdot 10^{-220}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 2.9070302295466782 \cdot 10^{-204}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 1.148094167700041 \cdot 10^{-165}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 8.258781099415709 \cdot 10^{-72}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 6.300159433035089 \cdot 10^{-58}:\\ \;\;\;\;\frac{0.5}{\frac{t}{y}}\\ \mathbf{elif}\;y \leq 1.6180099264937618 \cdot 10^{-31}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{0.5}{t}\\ \end{array} \]
Alternative 2
Error36.0
Cost1640
\[\begin{array}{l} t_1 := \frac{z}{t} \cdot -0.5\\ t_2 := \frac{x \cdot 0.5}{t}\\ \mathbf{if}\;y \leq -5.929598755103772 \cdot 10^{-183}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq -3.0487142073874627 \cdot 10^{-188}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -8.472534343986813 \cdot 10^{-308}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 2.380702399233408 \cdot 10^{-274}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 2.721129696409804 \cdot 10^{-220}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 2.9070302295466782 \cdot 10^{-204}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 1.148094167700041 \cdot 10^{-165}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 8.258781099415709 \cdot 10^{-72}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 6.300159433035089 \cdot 10^{-58}:\\ \;\;\;\;\frac{0.5}{\frac{t}{y}}\\ \mathbf{elif}\;y \leq 1.6180099264937618 \cdot 10^{-31}:\\ \;\;\;\;z \cdot \frac{-0.5}{t}\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{0.5}{t}\\ \end{array} \]
Alternative 3
Error35.9
Cost1640
\[\begin{array}{l} t_1 := \frac{z}{t} \cdot -0.5\\ t_2 := \frac{x \cdot 0.5}{t}\\ \mathbf{if}\;y \leq -5.929598755103772 \cdot 10^{-183}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq -3.0487142073874627 \cdot 10^{-188}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -8.472534343986813 \cdot 10^{-308}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 2.380702399233408 \cdot 10^{-274}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 2.721129696409804 \cdot 10^{-220}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 2.9070302295466782 \cdot 10^{-204}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 1.148094167700041 \cdot 10^{-165}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 8.258781099415709 \cdot 10^{-72}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 6.300159433035089 \cdot 10^{-58}:\\ \;\;\;\;\frac{0.5}{\frac{t}{y}}\\ \mathbf{elif}\;y \leq 1.6180099264937618 \cdot 10^{-31}:\\ \;\;\;\;z \cdot \frac{-0.5}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{y \cdot 0.5}{t}\\ \end{array} \]
Alternative 4
Error15.8
Cost972
\[\begin{array}{l} t_1 := 0.5 \cdot \left(\frac{y}{t} - \frac{z}{t}\right)\\ \mathbf{if}\;y \leq 4.991619386417165 \cdot 10^{-72}:\\ \;\;\;\;0.5 \cdot \frac{x - z}{t}\\ \mathbf{elif}\;y \leq 0.09877579974271057:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 1.3252655633997375 \cdot 10^{+94}:\\ \;\;\;\;0.5 \cdot \frac{x + y}{t}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 5
Error16.5
Cost844
\[\begin{array}{l} \mathbf{if}\;x \leq -1.8665695606155457 \cdot 10^{+113}:\\ \;\;\;\;0.5 \cdot \frac{x + y}{t}\\ \mathbf{elif}\;x \leq -1.8032444676209992 \cdot 10^{+81}:\\ \;\;\;\;\frac{z}{t} \cdot -0.5\\ \mathbf{elif}\;x \leq -6.320118197212901 \cdot 10^{-52}:\\ \;\;\;\;\frac{0.5}{\frac{t}{x + y}}\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \frac{y - z}{t}\\ \end{array} \]
Alternative 6
Error15.8
Cost844
\[\begin{array}{l} t_1 := 0.5 \cdot \frac{y - z}{t}\\ \mathbf{if}\;y \leq 4.991619386417165 \cdot 10^{-72}:\\ \;\;\;\;0.5 \cdot \frac{x - z}{t}\\ \mathbf{elif}\;y \leq 0.09877579974271057:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 1.3252655633997375 \cdot 10^{+94}:\\ \;\;\;\;0.5 \cdot \frac{x + y}{t}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 7
Error13.8
Cost712
\[\begin{array}{l} t_1 := \frac{z}{t} \cdot -0.5\\ \mathbf{if}\;z \leq -3 \cdot 10^{+144}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 1.8 \cdot 10^{+165}:\\ \;\;\;\;\frac{0.5}{\frac{t}{x + y}}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 8
Error0.3
Cost576
\[\left(x + \left(y - z\right)\right) \cdot \frac{0.5}{t} \]
Alternative 9
Error36.4
Cost452
\[\begin{array}{l} \mathbf{if}\;y \leq 8.258781099415709 \cdot 10^{-72}:\\ \;\;\;\;x \cdot \frac{0.5}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{0.5}{\frac{t}{y}}\\ \end{array} \]
Alternative 10
Error36.4
Cost452
\[\begin{array}{l} \mathbf{if}\;y \leq 8.258781099415709 \cdot 10^{-72}:\\ \;\;\;\;\frac{x \cdot 0.5}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{0.5}{\frac{t}{y}}\\ \end{array} \]
Alternative 11
Error41.3
Cost320
\[\frac{0.5}{\frac{t}{y}} \]
Alternative 12
Error41.2
Cost320
\[y \cdot \frac{0.5}{t} \]

Error

Reproduce

herbie shell --seed 2022300 
(FPCore (x y z t)
  :name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, B"
  :precision binary64
  (/ (- (+ x y) z) (* t 2.0)))