Optimisation.CirclePacking:place from circle-packing-0.1.0.4, B

Percentage Accurate: 99.9% → 99.9%
Time: 6.4s
Alternatives: 10
Speedup: 1.0×

Specification

?
\[\begin{array}{l} \\ \frac{\left(x + y\right) - z}{t \cdot 2} \end{array} \]
(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);
}
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);
}
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 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]
\begin{array}{l}

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 10 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 99.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{\left(x + y\right) - z}{t \cdot 2} \end{array} \]
(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);
}
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);
}
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 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]
\begin{array}{l}

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

Alternative 1: 99.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{\left(x + y\right) - z}{t \cdot 2} \end{array} \]
(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);
}
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);
}
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 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]
\begin{array}{l}

\\
\frac{\left(x + y\right) - z}{t \cdot 2}
\end{array}
Derivation
  1. Initial program 100.0%

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

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

Alternative 2: 81.1% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -5.2 \cdot 10^{+170} \lor \neg \left(z \leq -6 \cdot 10^{+99} \lor \neg \left(z \leq -2.4 \cdot 10^{+61}\right) \land z \leq 3.7 \cdot 10^{+105}\right):\\ \;\;\;\;\frac{z}{t} \cdot -0.5\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \frac{x + y}{t}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (or (<= z -5.2e+170)
         (not (or (<= z -6e+99) (and (not (<= z -2.4e+61)) (<= z 3.7e+105)))))
   (* (/ z t) -0.5)
   (* 0.5 (/ (+ x y) t))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((z <= -5.2e+170) || !((z <= -6e+99) || (!(z <= -2.4e+61) && (z <= 3.7e+105)))) {
		tmp = (z / t) * -0.5;
	} else {
		tmp = 0.5 * ((x + y) / t);
	}
	return tmp;
}
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
    real(8) :: tmp
    if ((z <= (-5.2d+170)) .or. (.not. (z <= (-6d+99)) .or. (.not. (z <= (-2.4d+61))) .and. (z <= 3.7d+105))) then
        tmp = (z / t) * (-0.5d0)
    else
        tmp = 0.5d0 * ((x + y) / t)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if ((z <= -5.2e+170) || !((z <= -6e+99) || (!(z <= -2.4e+61) && (z <= 3.7e+105)))) {
		tmp = (z / t) * -0.5;
	} else {
		tmp = 0.5 * ((x + y) / t);
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (z <= -5.2e+170) or not ((z <= -6e+99) or (not (z <= -2.4e+61) and (z <= 3.7e+105))):
		tmp = (z / t) * -0.5
	else:
		tmp = 0.5 * ((x + y) / t)
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if ((z <= -5.2e+170) || !((z <= -6e+99) || (!(z <= -2.4e+61) && (z <= 3.7e+105))))
		tmp = Float64(Float64(z / t) * -0.5);
	else
		tmp = Float64(0.5 * Float64(Float64(x + y) / t));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if ((z <= -5.2e+170) || ~(((z <= -6e+99) || (~((z <= -2.4e+61)) && (z <= 3.7e+105)))))
		tmp = (z / t) * -0.5;
	else
		tmp = 0.5 * ((x + y) / t);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -5.2e+170], N[Not[Or[LessEqual[z, -6e+99], And[N[Not[LessEqual[z, -2.4e+61]], $MachinePrecision], LessEqual[z, 3.7e+105]]]], $MachinePrecision]], N[(N[(z / t), $MachinePrecision] * -0.5), $MachinePrecision], N[(0.5 * N[(N[(x + y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.2 \cdot 10^{+170} \lor \neg \left(z \leq -6 \cdot 10^{+99} \lor \neg \left(z \leq -2.4 \cdot 10^{+61}\right) \land z \leq 3.7 \cdot 10^{+105}\right):\\
\;\;\;\;\frac{z}{t} \cdot -0.5\\

\mathbf{else}:\\
\;\;\;\;0.5 \cdot \frac{x + y}{t}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -5.1999999999999996e170 or -6.00000000000000029e99 < z < -2.3999999999999999e61 or 3.69999999999999985e105 < z

    1. Initial program 100.0%

      \[\frac{\left(x + y\right) - z}{t \cdot 2} \]
    2. Taylor expanded in z around inf 77.3%

      \[\leadsto \color{blue}{-0.5 \cdot \frac{z}{t}} \]
    3. Step-by-step derivation
      1. *-commutative77.3%

        \[\leadsto \color{blue}{\frac{z}{t} \cdot -0.5} \]
    4. Simplified77.3%

      \[\leadsto \color{blue}{\frac{z}{t} \cdot -0.5} \]

    if -5.1999999999999996e170 < z < -6.00000000000000029e99 or -2.3999999999999999e61 < z < 3.69999999999999985e105

    1. Initial program 100.0%

      \[\frac{\left(x + y\right) - z}{t \cdot 2} \]
    2. Taylor expanded in z around 0 87.2%

      \[\leadsto \color{blue}{0.5 \cdot \frac{x + y}{t}} \]
    3. Step-by-step derivation
      1. +-commutative87.2%

        \[\leadsto 0.5 \cdot \frac{\color{blue}{y + x}}{t} \]
    4. Simplified87.2%

      \[\leadsto \color{blue}{0.5 \cdot \frac{y + x}{t}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification83.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -5.2 \cdot 10^{+170} \lor \neg \left(z \leq -6 \cdot 10^{+99} \lor \neg \left(z \leq -2.4 \cdot 10^{+61}\right) \land z \leq 3.7 \cdot 10^{+105}\right):\\ \;\;\;\;\frac{z}{t} \cdot -0.5\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \frac{x + y}{t}\\ \end{array} \]

Alternative 3: 46.7% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := z \cdot \frac{-0.5}{t}\\ t_2 := 0.5 \cdot \frac{x}{t}\\ \mathbf{if}\;y \leq -6.5 \cdot 10^{-148}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq -1.25 \cdot 10^{-212}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 1.12 \cdot 10^{-272}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 1.45 \cdot 10^{+26}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \frac{y}{t}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* z (/ -0.5 t))) (t_2 (* 0.5 (/ x t))))
   (if (<= y -6.5e-148)
     t_2
     (if (<= y -1.25e-212)
       t_1
       (if (<= y 1.12e-272) t_2 (if (<= y 1.45e+26) t_1 (* 0.5 (/ y t))))))))
double code(double x, double y, double z, double t) {
	double t_1 = z * (-0.5 / t);
	double t_2 = 0.5 * (x / t);
	double tmp;
	if (y <= -6.5e-148) {
		tmp = t_2;
	} else if (y <= -1.25e-212) {
		tmp = t_1;
	} else if (y <= 1.12e-272) {
		tmp = t_2;
	} else if (y <= 1.45e+26) {
		tmp = t_1;
	} else {
		tmp = 0.5 * (y / t);
	}
	return tmp;
}
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
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = z * ((-0.5d0) / t)
    t_2 = 0.5d0 * (x / t)
    if (y <= (-6.5d-148)) then
        tmp = t_2
    else if (y <= (-1.25d-212)) then
        tmp = t_1
    else if (y <= 1.12d-272) then
        tmp = t_2
    else if (y <= 1.45d+26) then
        tmp = t_1
    else
        tmp = 0.5d0 * (y / t)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = z * (-0.5 / t);
	double t_2 = 0.5 * (x / t);
	double tmp;
	if (y <= -6.5e-148) {
		tmp = t_2;
	} else if (y <= -1.25e-212) {
		tmp = t_1;
	} else if (y <= 1.12e-272) {
		tmp = t_2;
	} else if (y <= 1.45e+26) {
		tmp = t_1;
	} else {
		tmp = 0.5 * (y / t);
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = z * (-0.5 / t)
	t_2 = 0.5 * (x / t)
	tmp = 0
	if y <= -6.5e-148:
		tmp = t_2
	elif y <= -1.25e-212:
		tmp = t_1
	elif y <= 1.12e-272:
		tmp = t_2
	elif y <= 1.45e+26:
		tmp = t_1
	else:
		tmp = 0.5 * (y / t)
	return tmp
function code(x, y, z, t)
	t_1 = Float64(z * Float64(-0.5 / t))
	t_2 = Float64(0.5 * Float64(x / t))
	tmp = 0.0
	if (y <= -6.5e-148)
		tmp = t_2;
	elseif (y <= -1.25e-212)
		tmp = t_1;
	elseif (y <= 1.12e-272)
		tmp = t_2;
	elseif (y <= 1.45e+26)
		tmp = t_1;
	else
		tmp = Float64(0.5 * Float64(y / t));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = z * (-0.5 / t);
	t_2 = 0.5 * (x / t);
	tmp = 0.0;
	if (y <= -6.5e-148)
		tmp = t_2;
	elseif (y <= -1.25e-212)
		tmp = t_1;
	elseif (y <= 1.12e-272)
		tmp = t_2;
	elseif (y <= 1.45e+26)
		tmp = t_1;
	else
		tmp = 0.5 * (y / t);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(z * N[(-0.5 / t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(0.5 * N[(x / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -6.5e-148], t$95$2, If[LessEqual[y, -1.25e-212], t$95$1, If[LessEqual[y, 1.12e-272], t$95$2, If[LessEqual[y, 1.45e+26], t$95$1, N[(0.5 * N[(y / t), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := z \cdot \frac{-0.5}{t}\\
t_2 := 0.5 \cdot \frac{x}{t}\\
\mathbf{if}\;y \leq -6.5 \cdot 10^{-148}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;y \leq -1.25 \cdot 10^{-212}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq 1.12 \cdot 10^{-272}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;y \leq 1.45 \cdot 10^{+26}:\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;0.5 \cdot \frac{y}{t}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -6.4999999999999997e-148 or -1.25000000000000011e-212 < y < 1.11999999999999994e-272

    1. Initial program 100.0%

      \[\frac{\left(x + y\right) - z}{t \cdot 2} \]
    2. Taylor expanded in x around inf 41.4%

      \[\leadsto \color{blue}{0.5 \cdot \frac{x}{t}} \]

    if -6.4999999999999997e-148 < y < -1.25000000000000011e-212 or 1.11999999999999994e-272 < y < 1.45e26

    1. Initial program 100.0%

      \[\frac{\left(x + y\right) - z}{t \cdot 2} \]
    2. Taylor expanded in x around 0 100.0%

      \[\leadsto \color{blue}{0.5 \cdot \frac{x}{t} + 0.5 \cdot \frac{y - z}{t}} \]
    3. Step-by-step derivation
      1. associate-*r/100.0%

        \[\leadsto \color{blue}{\frac{0.5 \cdot x}{t}} + 0.5 \cdot \frac{y - z}{t} \]
      2. associate-*l/99.9%

        \[\leadsto \color{blue}{\frac{0.5}{t} \cdot x} + 0.5 \cdot \frac{y - z}{t} \]
      3. associate-*r/99.9%

        \[\leadsto \frac{0.5}{t} \cdot x + \color{blue}{\frac{0.5 \cdot \left(y - z\right)}{t}} \]
      4. associate-*l/99.7%

        \[\leadsto \frac{0.5}{t} \cdot x + \color{blue}{\frac{0.5}{t} \cdot \left(y - z\right)} \]
      5. distribute-lft-in99.7%

        \[\leadsto \color{blue}{\frac{0.5}{t} \cdot \left(x + \left(y - z\right)\right)} \]
      6. associate-+r-99.7%

        \[\leadsto \frac{0.5}{t} \cdot \color{blue}{\left(\left(x + y\right) - z\right)} \]
      7. sub-neg99.7%

        \[\leadsto \frac{0.5}{t} \cdot \color{blue}{\left(\left(x + y\right) + \left(-z\right)\right)} \]
      8. +-commutative99.7%

        \[\leadsto \frac{0.5}{t} \cdot \left(\color{blue}{\left(y + x\right)} + \left(-z\right)\right) \]
      9. associate-+l+99.7%

        \[\leadsto \frac{0.5}{t} \cdot \color{blue}{\left(y + \left(x + \left(-z\right)\right)\right)} \]
      10. sub-neg99.7%

        \[\leadsto \frac{0.5}{t} \cdot \left(y + \color{blue}{\left(x - z\right)}\right) \]
    4. Simplified99.7%

      \[\leadsto \color{blue}{\frac{0.5}{t} \cdot \left(y + \left(x - z\right)\right)} \]
    5. Taylor expanded in z around inf 55.4%

      \[\leadsto \color{blue}{-0.5 \cdot \frac{z}{t}} \]
    6. Step-by-step derivation
      1. associate-*r/55.4%

        \[\leadsto \color{blue}{\frac{-0.5 \cdot z}{t}} \]
      2. associate-/l*55.3%

        \[\leadsto \color{blue}{\frac{-0.5}{\frac{t}{z}}} \]
    7. Simplified55.3%

      \[\leadsto \color{blue}{\frac{-0.5}{\frac{t}{z}}} \]
    8. Step-by-step derivation
      1. associate-/r/55.3%

        \[\leadsto \color{blue}{\frac{-0.5}{t} \cdot z} \]
    9. Applied egg-rr55.3%

      \[\leadsto \color{blue}{\frac{-0.5}{t} \cdot z} \]

    if 1.45e26 < y

    1. Initial program 100.0%

      \[\frac{\left(x + y\right) - z}{t \cdot 2} \]
    2. Taylor expanded in y around inf 66.0%

      \[\leadsto \color{blue}{0.5 \cdot \frac{y}{t}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification53.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -6.5 \cdot 10^{-148}:\\ \;\;\;\;0.5 \cdot \frac{x}{t}\\ \mathbf{elif}\;y \leq -1.25 \cdot 10^{-212}:\\ \;\;\;\;z \cdot \frac{-0.5}{t}\\ \mathbf{elif}\;y \leq 1.12 \cdot 10^{-272}:\\ \;\;\;\;0.5 \cdot \frac{x}{t}\\ \mathbf{elif}\;y \leq 1.45 \cdot 10^{+26}:\\ \;\;\;\;z \cdot \frac{-0.5}{t}\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \frac{y}{t}\\ \end{array} \]

Alternative 4: 47.0% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{z}{t} \cdot -0.5\\ t_2 := 0.5 \cdot \frac{x}{t}\\ \mathbf{if}\;y \leq -5.8 \cdot 10^{-148}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq -1.45 \cdot 10^{-198}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 5.5 \cdot 10^{-272}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 7.8 \cdot 10^{+26}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \frac{y}{t}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* (/ z t) -0.5)) (t_2 (* 0.5 (/ x t))))
   (if (<= y -5.8e-148)
     t_2
     (if (<= y -1.45e-198)
       t_1
       (if (<= y 5.5e-272) t_2 (if (<= y 7.8e+26) t_1 (* 0.5 (/ y t))))))))
double code(double x, double y, double z, double t) {
	double t_1 = (z / t) * -0.5;
	double t_2 = 0.5 * (x / t);
	double tmp;
	if (y <= -5.8e-148) {
		tmp = t_2;
	} else if (y <= -1.45e-198) {
		tmp = t_1;
	} else if (y <= 5.5e-272) {
		tmp = t_2;
	} else if (y <= 7.8e+26) {
		tmp = t_1;
	} else {
		tmp = 0.5 * (y / t);
	}
	return tmp;
}
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
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = (z / t) * (-0.5d0)
    t_2 = 0.5d0 * (x / t)
    if (y <= (-5.8d-148)) then
        tmp = t_2
    else if (y <= (-1.45d-198)) then
        tmp = t_1
    else if (y <= 5.5d-272) then
        tmp = t_2
    else if (y <= 7.8d+26) then
        tmp = t_1
    else
        tmp = 0.5d0 * (y / t)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = (z / t) * -0.5;
	double t_2 = 0.5 * (x / t);
	double tmp;
	if (y <= -5.8e-148) {
		tmp = t_2;
	} else if (y <= -1.45e-198) {
		tmp = t_1;
	} else if (y <= 5.5e-272) {
		tmp = t_2;
	} else if (y <= 7.8e+26) {
		tmp = t_1;
	} else {
		tmp = 0.5 * (y / t);
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = (z / t) * -0.5
	t_2 = 0.5 * (x / t)
	tmp = 0
	if y <= -5.8e-148:
		tmp = t_2
	elif y <= -1.45e-198:
		tmp = t_1
	elif y <= 5.5e-272:
		tmp = t_2
	elif y <= 7.8e+26:
		tmp = t_1
	else:
		tmp = 0.5 * (y / t)
	return tmp
function code(x, y, z, t)
	t_1 = Float64(Float64(z / t) * -0.5)
	t_2 = Float64(0.5 * Float64(x / t))
	tmp = 0.0
	if (y <= -5.8e-148)
		tmp = t_2;
	elseif (y <= -1.45e-198)
		tmp = t_1;
	elseif (y <= 5.5e-272)
		tmp = t_2;
	elseif (y <= 7.8e+26)
		tmp = t_1;
	else
		tmp = Float64(0.5 * Float64(y / t));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = (z / t) * -0.5;
	t_2 = 0.5 * (x / t);
	tmp = 0.0;
	if (y <= -5.8e-148)
		tmp = t_2;
	elseif (y <= -1.45e-198)
		tmp = t_1;
	elseif (y <= 5.5e-272)
		tmp = t_2;
	elseif (y <= 7.8e+26)
		tmp = t_1;
	else
		tmp = 0.5 * (y / t);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(z / t), $MachinePrecision] * -0.5), $MachinePrecision]}, Block[{t$95$2 = N[(0.5 * N[(x / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -5.8e-148], t$95$2, If[LessEqual[y, -1.45e-198], t$95$1, If[LessEqual[y, 5.5e-272], t$95$2, If[LessEqual[y, 7.8e+26], t$95$1, N[(0.5 * N[(y / t), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{z}{t} \cdot -0.5\\
t_2 := 0.5 \cdot \frac{x}{t}\\
\mathbf{if}\;y \leq -5.8 \cdot 10^{-148}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;y \leq -1.45 \cdot 10^{-198}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq 5.5 \cdot 10^{-272}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;y \leq 7.8 \cdot 10^{+26}:\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;0.5 \cdot \frac{y}{t}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -5.7999999999999997e-148 or -1.45e-198 < y < 5.4999999999999999e-272

    1. Initial program 100.0%

      \[\frac{\left(x + y\right) - z}{t \cdot 2} \]
    2. Taylor expanded in x around inf 40.6%

      \[\leadsto \color{blue}{0.5 \cdot \frac{x}{t}} \]

    if -5.7999999999999997e-148 < y < -1.45e-198 or 5.4999999999999999e-272 < y < 7.8e26

    1. Initial program 100.0%

      \[\frac{\left(x + y\right) - z}{t \cdot 2} \]
    2. Taylor expanded in z around inf 55.1%

      \[\leadsto \color{blue}{-0.5 \cdot \frac{z}{t}} \]
    3. Step-by-step derivation
      1. *-commutative55.1%

        \[\leadsto \color{blue}{\frac{z}{t} \cdot -0.5} \]
    4. Simplified55.1%

      \[\leadsto \color{blue}{\frac{z}{t} \cdot -0.5} \]

    if 7.8e26 < y

    1. Initial program 100.0%

      \[\frac{\left(x + y\right) - z}{t \cdot 2} \]
    2. Taylor expanded in y around inf 66.0%

      \[\leadsto \color{blue}{0.5 \cdot \frac{y}{t}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification52.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -5.8 \cdot 10^{-148}:\\ \;\;\;\;0.5 \cdot \frac{x}{t}\\ \mathbf{elif}\;y \leq -1.45 \cdot 10^{-198}:\\ \;\;\;\;\frac{z}{t} \cdot -0.5\\ \mathbf{elif}\;y \leq 5.5 \cdot 10^{-272}:\\ \;\;\;\;0.5 \cdot \frac{x}{t}\\ \mathbf{elif}\;y \leq 7.8 \cdot 10^{+26}:\\ \;\;\;\;\frac{z}{t} \cdot -0.5\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \frac{y}{t}\\ \end{array} \]

Alternative 5: 78.0% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 1.95 \cdot 10^{+32}:\\ \;\;\;\;0.5 \cdot \frac{x - z}{t}\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \frac{x + y}{t}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= y 1.95e+32) (* 0.5 (/ (- x z) t)) (* 0.5 (/ (+ x y) t))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= 1.95e+32) {
		tmp = 0.5 * ((x - z) / t);
	} else {
		tmp = 0.5 * ((x + y) / t);
	}
	return tmp;
}
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
    real(8) :: tmp
    if (y <= 1.95d+32) then
        tmp = 0.5d0 * ((x - z) / t)
    else
        tmp = 0.5d0 * ((x + y) / t)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= 1.95e+32) {
		tmp = 0.5 * ((x - z) / t);
	} else {
		tmp = 0.5 * ((x + y) / t);
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if y <= 1.95e+32:
		tmp = 0.5 * ((x - z) / t)
	else:
		tmp = 0.5 * ((x + y) / t)
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (y <= 1.95e+32)
		tmp = Float64(0.5 * Float64(Float64(x - z) / t));
	else
		tmp = Float64(0.5 * Float64(Float64(x + y) / t));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (y <= 1.95e+32)
		tmp = 0.5 * ((x - z) / t);
	else
		tmp = 0.5 * ((x + y) / t);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[y, 1.95e+32], N[(0.5 * N[(N[(x - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(N[(x + y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.95 \cdot 10^{+32}:\\
\;\;\;\;0.5 \cdot \frac{x - z}{t}\\

\mathbf{else}:\\
\;\;\;\;0.5 \cdot \frac{x + y}{t}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 1.95e32

    1. Initial program 100.0%

      \[\frac{\left(x + y\right) - z}{t \cdot 2} \]
    2. Taylor expanded in y around 0 82.4%

      \[\leadsto \color{blue}{0.5 \cdot \frac{x - z}{t}} \]

    if 1.95e32 < y

    1. Initial program 100.0%

      \[\frac{\left(x + y\right) - z}{t \cdot 2} \]
    2. Taylor expanded in z around 0 86.4%

      \[\leadsto \color{blue}{0.5 \cdot \frac{x + y}{t}} \]
    3. Step-by-step derivation
      1. +-commutative86.4%

        \[\leadsto 0.5 \cdot \frac{\color{blue}{y + x}}{t} \]
    4. Simplified86.4%

      \[\leadsto \color{blue}{0.5 \cdot \frac{y + x}{t}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification83.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 1.95 \cdot 10^{+32}:\\ \;\;\;\;0.5 \cdot \frac{x - z}{t}\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \frac{x + y}{t}\\ \end{array} \]

Alternative 6: 77.4% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 1060000000:\\ \;\;\;\;0.5 \cdot \frac{x - z}{t}\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \frac{y - z}{t}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= y 1060000000.0) (* 0.5 (/ (- x z) t)) (* 0.5 (/ (- y z) t))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= 1060000000.0) {
		tmp = 0.5 * ((x - z) / t);
	} else {
		tmp = 0.5 * ((y - z) / t);
	}
	return tmp;
}
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
    real(8) :: tmp
    if (y <= 1060000000.0d0) then
        tmp = 0.5d0 * ((x - z) / t)
    else
        tmp = 0.5d0 * ((y - z) / t)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= 1060000000.0) {
		tmp = 0.5 * ((x - z) / t);
	} else {
		tmp = 0.5 * ((y - z) / t);
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if y <= 1060000000.0:
		tmp = 0.5 * ((x - z) / t)
	else:
		tmp = 0.5 * ((y - z) / t)
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (y <= 1060000000.0)
		tmp = Float64(0.5 * Float64(Float64(x - z) / t));
	else
		tmp = Float64(0.5 * Float64(Float64(y - z) / t));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (y <= 1060000000.0)
		tmp = 0.5 * ((x - z) / t);
	else
		tmp = 0.5 * ((y - z) / t);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[y, 1060000000.0], N[(0.5 * N[(N[(x - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(N[(y - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq 1060000000:\\
\;\;\;\;0.5 \cdot \frac{x - z}{t}\\

\mathbf{else}:\\
\;\;\;\;0.5 \cdot \frac{y - z}{t}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 1.06e9

    1. Initial program 100.0%

      \[\frac{\left(x + y\right) - z}{t \cdot 2} \]
    2. Taylor expanded in y around 0 83.0%

      \[\leadsto \color{blue}{0.5 \cdot \frac{x - z}{t}} \]

    if 1.06e9 < y

    1. Initial program 100.0%

      \[\frac{\left(x + y\right) - z}{t \cdot 2} \]
    2. Taylor expanded in x around 0 81.0%

      \[\leadsto \color{blue}{0.5 \cdot \frac{y - z}{t}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification82.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 1060000000:\\ \;\;\;\;0.5 \cdot \frac{x - z}{t}\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \frac{y - z}{t}\\ \end{array} \]

Alternative 7: 99.7% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \left(y + \left(x - z\right)\right) \cdot \frac{0.5}{t} \end{array} \]
(FPCore (x y z t) :precision binary64 (* (+ y (- x z)) (/ 0.5 t)))
double code(double x, double y, double z, double t) {
	return (y + (x - z)) * (0.5 / t);
}
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 = (y + (x - z)) * (0.5d0 / t)
end function
public static double code(double x, double y, double z, double t) {
	return (y + (x - z)) * (0.5 / t);
}
def code(x, y, z, t):
	return (y + (x - z)) * (0.5 / t)
function code(x, y, z, t)
	return Float64(Float64(y + Float64(x - z)) * Float64(0.5 / t))
end
function tmp = code(x, y, z, t)
	tmp = (y + (x - z)) * (0.5 / t);
end
code[x_, y_, z_, t_] := N[(N[(y + N[(x - z), $MachinePrecision]), $MachinePrecision] * N[(0.5 / t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\left(y + \left(x - z\right)\right) \cdot \frac{0.5}{t}
\end{array}
Derivation
  1. Initial program 100.0%

    \[\frac{\left(x + y\right) - z}{t \cdot 2} \]
  2. Taylor expanded in x around 0 98.0%

    \[\leadsto \color{blue}{0.5 \cdot \frac{x}{t} + 0.5 \cdot \frac{y - z}{t}} \]
  3. Step-by-step derivation
    1. associate-*r/98.0%

      \[\leadsto \color{blue}{\frac{0.5 \cdot x}{t}} + 0.5 \cdot \frac{y - z}{t} \]
    2. associate-*l/97.9%

      \[\leadsto \color{blue}{\frac{0.5}{t} \cdot x} + 0.5 \cdot \frac{y - z}{t} \]
    3. associate-*r/97.9%

      \[\leadsto \frac{0.5}{t} \cdot x + \color{blue}{\frac{0.5 \cdot \left(y - z\right)}{t}} \]
    4. associate-*l/97.7%

      \[\leadsto \frac{0.5}{t} \cdot x + \color{blue}{\frac{0.5}{t} \cdot \left(y - z\right)} \]
    5. distribute-lft-in99.6%

      \[\leadsto \color{blue}{\frac{0.5}{t} \cdot \left(x + \left(y - z\right)\right)} \]
    6. associate-+r-99.6%

      \[\leadsto \frac{0.5}{t} \cdot \color{blue}{\left(\left(x + y\right) - z\right)} \]
    7. sub-neg99.6%

      \[\leadsto \frac{0.5}{t} \cdot \color{blue}{\left(\left(x + y\right) + \left(-z\right)\right)} \]
    8. +-commutative99.6%

      \[\leadsto \frac{0.5}{t} \cdot \left(\color{blue}{\left(y + x\right)} + \left(-z\right)\right) \]
    9. associate-+l+99.6%

      \[\leadsto \frac{0.5}{t} \cdot \color{blue}{\left(y + \left(x + \left(-z\right)\right)\right)} \]
    10. sub-neg99.6%

      \[\leadsto \frac{0.5}{t} \cdot \left(y + \color{blue}{\left(x - z\right)}\right) \]
  4. Simplified99.6%

    \[\leadsto \color{blue}{\frac{0.5}{t} \cdot \left(y + \left(x - z\right)\right)} \]
  5. Final simplification99.6%

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

Alternative 8: 99.6% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{0.5}{\frac{t}{y + \left(x - z\right)}} \end{array} \]
(FPCore (x y z t) :precision binary64 (/ 0.5 (/ t (+ y (- x z)))))
double code(double x, double y, double z, double t) {
	return 0.5 / (t / (y + (x - z)));
}
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 = 0.5d0 / (t / (y + (x - z)))
end function
public static double code(double x, double y, double z, double t) {
	return 0.5 / (t / (y + (x - z)));
}
def code(x, y, z, t):
	return 0.5 / (t / (y + (x - z)))
function code(x, y, z, t)
	return Float64(0.5 / Float64(t / Float64(y + Float64(x - z))))
end
function tmp = code(x, y, z, t)
	tmp = 0.5 / (t / (y + (x - z)));
end
code[x_, y_, z_, t_] := N[(0.5 / N[(t / N[(y + N[(x - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{0.5}{\frac{t}{y + \left(x - z\right)}}
\end{array}
Derivation
  1. Initial program 100.0%

    \[\frac{\left(x + y\right) - z}{t \cdot 2} \]
  2. Taylor expanded in x around 0 98.0%

    \[\leadsto \color{blue}{0.5 \cdot \frac{x}{t} + 0.5 \cdot \frac{y - z}{t}} \]
  3. Step-by-step derivation
    1. associate-*r/98.0%

      \[\leadsto \color{blue}{\frac{0.5 \cdot x}{t}} + 0.5 \cdot \frac{y - z}{t} \]
    2. associate-*l/97.9%

      \[\leadsto \color{blue}{\frac{0.5}{t} \cdot x} + 0.5 \cdot \frac{y - z}{t} \]
    3. associate-*r/97.9%

      \[\leadsto \frac{0.5}{t} \cdot x + \color{blue}{\frac{0.5 \cdot \left(y - z\right)}{t}} \]
    4. associate-*l/97.7%

      \[\leadsto \frac{0.5}{t} \cdot x + \color{blue}{\frac{0.5}{t} \cdot \left(y - z\right)} \]
    5. distribute-lft-in99.6%

      \[\leadsto \color{blue}{\frac{0.5}{t} \cdot \left(x + \left(y - z\right)\right)} \]
    6. associate-+r-99.6%

      \[\leadsto \frac{0.5}{t} \cdot \color{blue}{\left(\left(x + y\right) - z\right)} \]
    7. sub-neg99.6%

      \[\leadsto \frac{0.5}{t} \cdot \color{blue}{\left(\left(x + y\right) + \left(-z\right)\right)} \]
    8. +-commutative99.6%

      \[\leadsto \frac{0.5}{t} \cdot \left(\color{blue}{\left(y + x\right)} + \left(-z\right)\right) \]
    9. associate-+l+99.6%

      \[\leadsto \frac{0.5}{t} \cdot \color{blue}{\left(y + \left(x + \left(-z\right)\right)\right)} \]
    10. sub-neg99.6%

      \[\leadsto \frac{0.5}{t} \cdot \left(y + \color{blue}{\left(x - z\right)}\right) \]
  4. Simplified99.6%

    \[\leadsto \color{blue}{\frac{0.5}{t} \cdot \left(y + \left(x - z\right)\right)} \]
  5. Step-by-step derivation
    1. associate-*l/100.0%

      \[\leadsto \color{blue}{\frac{0.5 \cdot \left(y + \left(x - z\right)\right)}{t}} \]
    2. associate-/l*99.8%

      \[\leadsto \color{blue}{\frac{0.5}{\frac{t}{y + \left(x - z\right)}}} \]
  6. Applied egg-rr99.8%

    \[\leadsto \color{blue}{\frac{0.5}{\frac{t}{y + \left(x - z\right)}}} \]
  7. Final simplification99.8%

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

Alternative 9: 46.6% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 2.2 \cdot 10^{+23}:\\ \;\;\;\;0.5 \cdot \frac{x}{t}\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \frac{y}{t}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= y 2.2e+23) (* 0.5 (/ x t)) (* 0.5 (/ y t))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= 2.2e+23) {
		tmp = 0.5 * (x / t);
	} else {
		tmp = 0.5 * (y / t);
	}
	return tmp;
}
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
    real(8) :: tmp
    if (y <= 2.2d+23) then
        tmp = 0.5d0 * (x / t)
    else
        tmp = 0.5d0 * (y / t)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= 2.2e+23) {
		tmp = 0.5 * (x / t);
	} else {
		tmp = 0.5 * (y / t);
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if y <= 2.2e+23:
		tmp = 0.5 * (x / t)
	else:
		tmp = 0.5 * (y / t)
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (y <= 2.2e+23)
		tmp = Float64(0.5 * Float64(x / t));
	else
		tmp = Float64(0.5 * Float64(y / t));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (y <= 2.2e+23)
		tmp = 0.5 * (x / t);
	else
		tmp = 0.5 * (y / t);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[y, 2.2e+23], N[(0.5 * N[(x / t), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(y / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.2 \cdot 10^{+23}:\\
\;\;\;\;0.5 \cdot \frac{x}{t}\\

\mathbf{else}:\\
\;\;\;\;0.5 \cdot \frac{y}{t}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 2.20000000000000008e23

    1. Initial program 100.0%

      \[\frac{\left(x + y\right) - z}{t \cdot 2} \]
    2. Taylor expanded in x around inf 42.9%

      \[\leadsto \color{blue}{0.5 \cdot \frac{x}{t}} \]

    if 2.20000000000000008e23 < y

    1. Initial program 100.0%

      \[\frac{\left(x + y\right) - z}{t \cdot 2} \]
    2. Taylor expanded in y around inf 65.6%

      \[\leadsto \color{blue}{0.5 \cdot \frac{y}{t}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification49.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 2.2 \cdot 10^{+23}:\\ \;\;\;\;0.5 \cdot \frac{x}{t}\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \frac{y}{t}\\ \end{array} \]

Alternative 10: 37.2% accurate, 1.8× speedup?

\[\begin{array}{l} \\ 0.5 \cdot \frac{x}{t} \end{array} \]
(FPCore (x y z t) :precision binary64 (* 0.5 (/ x t)))
double code(double x, double y, double z, double t) {
	return 0.5 * (x / t);
}
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 = 0.5d0 * (x / t)
end function
public static double code(double x, double y, double z, double t) {
	return 0.5 * (x / t);
}
def code(x, y, z, t):
	return 0.5 * (x / t)
function code(x, y, z, t)
	return Float64(0.5 * Float64(x / t))
end
function tmp = code(x, y, z, t)
	tmp = 0.5 * (x / t);
end
code[x_, y_, z_, t_] := N[(0.5 * N[(x / t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
0.5 \cdot \frac{x}{t}
\end{array}
Derivation
  1. Initial program 100.0%

    \[\frac{\left(x + y\right) - z}{t \cdot 2} \]
  2. Taylor expanded in x around inf 36.5%

    \[\leadsto \color{blue}{0.5 \cdot \frac{x}{t}} \]
  3. Final simplification36.5%

    \[\leadsto 0.5 \cdot \frac{x}{t} \]

Reproduce

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