Average Error: 0.1 → 0.1
Time: 11.4s
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.1

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

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

Alternatives

Alternative 1
Error35.3
Cost1112
\[\begin{array}{l} t_1 := \frac{-0.5}{\frac{t}{z}}\\ t_2 := \frac{x \cdot 0.5}{t}\\ \mathbf{if}\;y \leq -9.557169910237266 \cdot 10^{-200}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 1.955149164768997 \cdot 10^{-257}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 4.0487655050718834 \cdot 10^{-206}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 5.516225809719667 \cdot 10^{-106}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 1.7058390288661465 \cdot 10^{-74}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 1.2677055827045534 \cdot 10^{-6}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{0.5}{t}\\ \end{array} \]
Alternative 2
Error35.3
Cost1112
\[\begin{array}{l} t_1 := \frac{-0.5}{\frac{t}{z}}\\ t_2 := \frac{x \cdot 0.5}{t}\\ \mathbf{if}\;y \leq -9.557169910237266 \cdot 10^{-200}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 1.955149164768997 \cdot 10^{-257}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 4.0487655050718834 \cdot 10^{-206}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 5.516225809719667 \cdot 10^{-106}:\\ \;\;\;\;z \cdot \frac{-0.5}{t}\\ \mathbf{elif}\;y \leq 1.7058390288661465 \cdot 10^{-74}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 1.2677055827045534 \cdot 10^{-6}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{0.5}{t}\\ \end{array} \]
Alternative 3
Error35.3
Cost1112
\[\begin{array}{l} t_1 := -0.5 \cdot \frac{z}{t}\\ t_2 := \frac{x \cdot 0.5}{t}\\ \mathbf{if}\;y \leq -9.557169910237266 \cdot 10^{-200}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 1.955149164768997 \cdot 10^{-257}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 4.0487655050718834 \cdot 10^{-206}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 5.516225809719667 \cdot 10^{-106}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 1.7058390288661465 \cdot 10^{-74}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 1.2677055827045534 \cdot 10^{-6}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{0.5}{t}\\ \end{array} \]
Alternative 4
Error35.2
Cost1112
\[\begin{array}{l} t_1 := -0.5 \cdot \frac{z}{t}\\ t_2 := \frac{x \cdot 0.5}{t}\\ \mathbf{if}\;y \leq -9.557169910237266 \cdot 10^{-200}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 1.955149164768997 \cdot 10^{-257}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 4.0487655050718834 \cdot 10^{-206}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 5.516225809719667 \cdot 10^{-106}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 1.7058390288661465 \cdot 10^{-74}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 1.2677055827045534 \cdot 10^{-6}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\frac{y \cdot 0.5}{t}\\ \end{array} \]
Alternative 5
Error18.7
Cost1108
\[\begin{array}{l} t_1 := \frac{x \cdot 0.5}{t}\\ t_2 := \left(y - z\right) \cdot \frac{0.5}{t}\\ \mathbf{if}\;x \leq -3.2 \cdot 10^{+232}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq -2 \cdot 10^{+191}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \leq -2.032335729972429 \cdot 10^{+87}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq -1.232040060606032 \cdot 10^{+69}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \leq -2.7819515744491045 \cdot 10^{+27}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 6
Error9.5
Cost712
\[\begin{array}{l} t_1 := \left(y - z\right) \cdot \frac{0.5}{t}\\ \mathbf{if}\;z \leq -0.0004270739275422078:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 9.793595996424329 \cdot 10^{-24}:\\ \;\;\;\;\frac{x + y}{t \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 7
Error15.8
Cost580
\[\begin{array}{l} \mathbf{if}\;y \leq 9.09041517759575 \cdot 10^{-69}:\\ \;\;\;\;\frac{x - z}{t \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\left(y - z\right) \cdot \frac{0.5}{t}\\ \end{array} \]
Alternative 8
Error15.7
Cost580
\[\begin{array}{l} \mathbf{if}\;y \leq 9.09041517759575 \cdot 10^{-69}:\\ \;\;\;\;\frac{x - z}{t \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{y - z}{t \cdot 2}\\ \end{array} \]
Alternative 9
Error0.3
Cost576
\[\left(x + \left(y - z\right)\right) \cdot \frac{0.5}{t} \]
Alternative 10
Error35.9
Cost452
\[\begin{array}{l} \mathbf{if}\;y \leq 3.5952067883380883 \cdot 10^{-68}:\\ \;\;\;\;\frac{x \cdot 0.5}{t}\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{0.5}{t}\\ \end{array} \]
Alternative 11
Error40.9
Cost320
\[\frac{x \cdot 0.5}{t} \]

Error

Reproduce

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