Average Error: 0.0 → 0.0
Time: 6.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
Error35.1
Cost1112
\[\begin{array}{l} t_1 := \frac{0.5}{\frac{t}{x}}\\ t_2 := y \cdot \frac{0.5}{t}\\ t_3 := \frac{-0.5}{\frac{t}{z}}\\ \mathbf{if}\;x \leq -1.02 \cdot 10^{+58}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq -2.6 \cdot 10^{+20}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;x \leq -0.075:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq -4 \cdot 10^{-179}:\\ \;\;\;\;z \cdot \frac{-0.5}{t}\\ \mathbf{elif}\;x \leq -2.4 \cdot 10^{-202}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \leq -1.7 \cdot 10^{-303}:\\ \;\;\;\;t_3\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 2
Error35.1
Cost1112
\[\begin{array}{l} t_1 := \frac{0.5}{\frac{t}{x}}\\ t_2 := y \cdot \frac{0.5}{t}\\ t_3 := \frac{z \cdot -0.5}{t}\\ \mathbf{if}\;x \leq -4.4 \cdot 10^{+57}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq -2.7 \cdot 10^{+24}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;x \leq -0.025:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq -2 \cdot 10^{-177}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;x \leq -2.2 \cdot 10^{-202}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \leq -1.45 \cdot 10^{-303}:\\ \;\;\;\;t_3\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 3
Error35.1
Cost1112
\[\begin{array}{l} t_1 := \frac{x \cdot 0.5}{t}\\ t_2 := y \cdot \frac{0.5}{t}\\ t_3 := \frac{z \cdot -0.5}{t}\\ \mathbf{if}\;x \leq -1.7 \cdot 10^{+54}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq -5.8 \cdot 10^{+23}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;x \leq -0.00172:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq -7.8 \cdot 10^{-178}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;x \leq -6.8 \cdot 10^{-203}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \leq -2.7 \cdot 10^{-303}:\\ \;\;\;\;t_3\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 4
Error35.1
Cost1112
\[\begin{array}{l} t_1 := \frac{x \cdot 0.5}{t}\\ t_2 := \frac{y \cdot 0.5}{t}\\ t_3 := \frac{z \cdot -0.5}{t}\\ \mathbf{if}\;x \leq -8.2 \cdot 10^{+52}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq -1.85 \cdot 10^{+23}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;x \leq -0.00095:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq -5.2 \cdot 10^{-178}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;x \leq -6 \cdot 10^{-202}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \leq -1.4 \cdot 10^{-303}:\\ \;\;\;\;t_3\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 5
Error29.9
Cost584
\[\begin{array}{l} t_1 := z \cdot \frac{-0.5}{t}\\ \mathbf{if}\;z \leq -4.1 \cdot 10^{-57}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 7.2 \cdot 10^{+59}:\\ \;\;\;\;y \cdot \frac{0.5}{t}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 6
Error18.0
Cost580
\[\begin{array}{l} \mathbf{if}\;y \leq 5.2 \cdot 10^{-24}:\\ \;\;\;\;0.5 \cdot \frac{x - z}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{y \cdot 0.5}{t}\\ \end{array} \]
Alternative 7
Error14.6
Cost580
\[\begin{array}{l} \mathbf{if}\;x \leq -0.037:\\ \;\;\;\;0.5 \cdot \frac{x - z}{t}\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \frac{y - z}{t}\\ \end{array} \]
Alternative 8
Error14.5
Cost580
\[\begin{array}{l} \mathbf{if}\;x \leq -1.42 \cdot 10^{-5}:\\ \;\;\;\;\frac{0.5}{t} \cdot \left(x - z\right)\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \frac{y - z}{t}\\ \end{array} \]
Alternative 9
Error0.3
Cost576
\[\left(\left(z - x\right) - y\right) \cdot \frac{-0.5}{t} \]
Alternative 10
Error40.4
Cost320
\[z \cdot \frac{-0.5}{t} \]

Error

Reproduce

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