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

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

Alternatives

Alternative 1
Error30.5
Cost1376
\[\begin{array}{l} t_1 := \frac{0.5 \cdot x}{t}\\ t_2 := \frac{0.5 \cdot y}{t}\\ t_3 := \frac{z}{-2 \cdot t}\\ \mathbf{if}\;y \leq -7.8 \cdot 10^{+122}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq -1.55 \cdot 10^{+28}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -2.6 \cdot 10^{-48}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq -1.56 \cdot 10^{-74}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;y \leq -4.2 \cdot 10^{-99}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -2.5 \cdot 10^{-182}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;y \leq -1.4 \cdot 10^{-221}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 1.25 \cdot 10^{+14}:\\ \;\;\;\;t_3\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 2
Error10.0
Cost1108
\[\begin{array}{l} t_1 := \frac{0.5}{t} \cdot \left(y + x\right)\\ t_2 := \frac{0.5}{t} \cdot \left(y - z\right)\\ \mathbf{if}\;y \leq -6.2 \cdot 10^{+95}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq -7.4 \cdot 10^{+39}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -3.2 \cdot 10^{-54}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 2.1 \cdot 10^{+15}:\\ \;\;\;\;\frac{0.5}{t} \cdot \left(x - z\right)\\ \mathbf{elif}\;y \leq 2.4 \cdot 10^{+89}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 3
Error10.0
Cost1108
\[\begin{array}{l} t_1 := \frac{0.5 \cdot \left(y + x\right)}{t}\\ t_2 := \frac{0.5}{t} \cdot \left(y - z\right)\\ \mathbf{if}\;y \leq -1.1 \cdot 10^{+96}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq -6.6 \cdot 10^{+39}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -4.4 \cdot 10^{-51}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 3400000000000:\\ \;\;\;\;\frac{0.5}{t} \cdot \left(x - z\right)\\ \mathbf{elif}\;y \leq 6.6 \cdot 10^{+89}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 4
Error9.8
Cost1108
\[\begin{array}{l} t_1 := \frac{0.5 \cdot \left(y + x\right)}{t}\\ t_2 := \frac{0.5}{t} \cdot \left(y - z\right)\\ \mathbf{if}\;y \leq -3.5 \cdot 10^{+95}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq -1.1 \cdot 10^{+33}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -2.35 \cdot 10^{-48}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 33500000000:\\ \;\;\;\;\frac{0.5 \cdot \left(x - z\right)}{t}\\ \mathbf{elif}\;y \leq 4.6 \cdot 10^{+89}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 5
Error9.8
Cost1108
\[\begin{array}{l} t_1 := \frac{0.5 \cdot \left(y + x\right)}{t}\\ t_2 := \frac{0.5 \cdot \left(y - z\right)}{t}\\ \mathbf{if}\;y \leq -3.5 \cdot 10^{+95}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq -1.5 \cdot 10^{+34}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -3.9 \cdot 10^{-51}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 63000000000000:\\ \;\;\;\;\frac{0.5 \cdot \left(x - z\right)}{t}\\ \mathbf{elif}\;y \leq 4.1 \cdot 10^{+89}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 6
Error14.2
Cost976
\[\begin{array}{l} t_1 := \frac{z}{-2 \cdot t}\\ t_2 := \frac{0.5}{t} \cdot \left(y + x\right)\\ \mathbf{if}\;z \leq -7.8 \cdot 10^{+141}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -2.6 \cdot 10^{+104}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq -95000000000:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 1.95 \cdot 10^{+86}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 7
Error9.3
Cost712
\[\begin{array}{l} t_1 := \frac{0.5}{t} \cdot \left(y + x\right)\\ \mathbf{if}\;y \leq -2.2 \cdot 10^{-48}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 15800000:\\ \;\;\;\;\frac{0.5}{t} \cdot \left(x - z\right)\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 8
Error31.1
Cost584
\[\begin{array}{l} t_1 := \frac{0.5 \cdot x}{t}\\ \mathbf{if}\;x \leq -9.2 \cdot 10^{+14}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq 1.5 \cdot 10^{+151}:\\ \;\;\;\;\frac{z}{-2 \cdot t}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 9
Error0.3
Cost576
\[\frac{0.5}{t} \cdot \left(\left(x + y\right) - z\right) \]
Alternative 10
Error41.6
Cost320
\[\frac{z}{-2 \cdot t} \]

Error

Reproduce

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