Average Error: 0.0 → 0.0
Time: 9.5s
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
Error30.2
Cost1244
\[\begin{array}{l} t_1 := y \cdot \frac{0.5}{t}\\ t_2 := z \cdot \frac{-0.5}{t}\\ t_3 := x \cdot \frac{0.5}{t}\\ \mathbf{if}\;z \leq -2 \cdot 10^{+70}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq -1.06 \cdot 10^{-104}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;z \leq -2.65 \cdot 10^{-213}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -3.25 \cdot 10^{-276}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;z \leq 1.5 \cdot 10^{-119}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 9.5 \cdot 10^{-59}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;z \leq 6.5 \cdot 10^{+64}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 2
Error30.1
Cost1244
\[\begin{array}{l} t_1 := y \cdot \frac{0.5}{t}\\ t_2 := x \cdot \frac{0.5}{t}\\ \mathbf{if}\;z \leq -4.2 \cdot 10^{+67}:\\ \;\;\;\;\frac{-0.5}{\frac{t}{z}}\\ \mathbf{elif}\;z \leq -3.9 \cdot 10^{-104}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq -1.65 \cdot 10^{-213}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -4.1 \cdot 10^{-281}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq 2 \cdot 10^{-118}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 2.4 \cdot 10^{-61}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq 4.8 \cdot 10^{+64}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;z \cdot \frac{-0.5}{t}\\ \end{array} \]
Alternative 3
Error30.2
Cost1244
\[\begin{array}{l} t_1 := y \cdot \frac{0.5}{t}\\ t_2 := \frac{x}{\frac{t}{0.5}}\\ \mathbf{if}\;z \leq -5.6 \cdot 10^{+68}:\\ \;\;\;\;\frac{-0.5}{\frac{t}{z}}\\ \mathbf{elif}\;z \leq -1.05 \cdot 10^{-104}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq -5.8 \cdot 10^{-213}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -1.08 \cdot 10^{-279}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq 4.2 \cdot 10^{-120}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 2.6 \cdot 10^{-61}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq 5 \cdot 10^{+64}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;z \cdot \frac{-0.5}{t}\\ \end{array} \]
Alternative 4
Error30.1
Cost1244
\[\begin{array}{l} t_1 := \frac{y}{\frac{t}{0.5}}\\ t_2 := \frac{x}{\frac{t}{0.5}}\\ \mathbf{if}\;z \leq -1.7 \cdot 10^{+67}:\\ \;\;\;\;\frac{-0.5}{\frac{t}{z}}\\ \mathbf{elif}\;z \leq -3 \cdot 10^{-104}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq -4.5 \cdot 10^{-213}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -3.9 \cdot 10^{-279}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq 2.2 \cdot 10^{-119}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 1.7 \cdot 10^{-60}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq 5.6 \cdot 10^{+64}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;z \cdot \frac{-0.5}{t}\\ \end{array} \]
Alternative 5
Error30.0
Cost1244
\[\begin{array}{l} t_1 := \frac{y}{\frac{t}{0.5}}\\ t_2 := \frac{z \cdot -0.5}{t}\\ t_3 := \frac{x}{\frac{t}{0.5}}\\ \mathbf{if}\;z \leq -2.7 \cdot 10^{+67}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq -2.65 \cdot 10^{-104}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;z \leq -4 \cdot 10^{-213}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -1.08 \cdot 10^{-277}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;z \leq 7.2 \cdot 10^{-118}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 4 \cdot 10^{-59}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;z \leq 6.5 \cdot 10^{+64}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 6
Error9.6
Cost841
\[\begin{array}{l} \mathbf{if}\;z \leq -1.4 \cdot 10^{+67} \lor \neg \left(z \leq 1.4 \cdot 10^{+34}\right):\\ \;\;\;\;\frac{\frac{y - z}{t}}{2}\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \left(\frac{y}{t} + \frac{x}{t}\right)\\ \end{array} \]
Alternative 7
Error9.6
Cost840
\[\begin{array}{l} \mathbf{if}\;z \leq -2.8 \cdot 10^{+67}:\\ \;\;\;\;\frac{\frac{y - z}{t}}{2}\\ \mathbf{elif}\;z \leq 6.8 \cdot 10^{+34}:\\ \;\;\;\;0.5 \cdot \left(\frac{y}{t} + \frac{x}{t}\right)\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \left(\frac{y}{t} - \frac{z}{t}\right)\\ \end{array} \]
Alternative 8
Error13.6
Cost713
\[\begin{array}{l} \mathbf{if}\;z \leq -8.2 \cdot 10^{+71} \lor \neg \left(z \leq 7.5 \cdot 10^{+64}\right):\\ \;\;\;\;\frac{z \cdot -0.5}{t}\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \frac{x + y}{t}\\ \end{array} \]
Alternative 9
Error10.0
Cost713
\[\begin{array}{l} \mathbf{if}\;z \leq -3.55 \cdot 10^{+37} \lor \neg \left(z \leq 5.5 \cdot 10^{+64}\right):\\ \;\;\;\;\frac{-0.5}{t} \cdot \left(z - x\right)\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \frac{x + y}{t}\\ \end{array} \]
Alternative 10
Error9.7
Cost713
\[\begin{array}{l} \mathbf{if}\;z \leq -8.2 \cdot 10^{+67} \lor \neg \left(z \leq 3.6 \cdot 10^{+34}\right):\\ \;\;\;\;\frac{-0.5}{\frac{t}{z - y}}\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \frac{x + y}{t}\\ \end{array} \]
Alternative 11
Error9.6
Cost713
\[\begin{array}{l} \mathbf{if}\;z \leq -1.6 \cdot 10^{+67} \lor \neg \left(z \leq 1.45 \cdot 10^{+35}\right):\\ \;\;\;\;\frac{\frac{y - z}{t}}{2}\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \frac{x + y}{t}\\ \end{array} \]
Alternative 12
Error0.3
Cost576
\[\left(z - \left(x + y\right)\right) \cdot \frac{-0.5}{t} \]
Alternative 13
Error35.2
Cost452
\[\begin{array}{l} \mathbf{if}\;x \leq -58000000000:\\ \;\;\;\;x \cdot \frac{0.5}{t}\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{0.5}{t}\\ \end{array} \]
Alternative 14
Error41.2
Cost320
\[x \cdot \frac{0.5}{t} \]

Error

Reproduce

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