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

Percentage Accurate: 99.9% → 99.7%
Time: 8.5s
Alternatives: 11
Speedup: N/A×

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 11 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.7% accurate, 1.0× speedup?

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

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

    \[\frac{\left(x + y\right) - z}{t \cdot 2} \]
  2. Step-by-step derivation
    1. associate--l+99.6%

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 47.2% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;x \leq -2.5 \cdot 10^{-205} \lor \neg \left(x \leq 4.4 \cdot 10^{-307}\right) \land x \leq 6 \cdot 10^{-230}:\\
\;\;\;\;z \cdot \frac{-0.5}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -7.1999999999999997e23

    1. Initial program 99.9%

      \[\frac{\left(x + y\right) - z}{t \cdot 2} \]
    2. Step-by-step derivation
      1. associate--l+99.9%

        \[\leadsto \frac{\color{blue}{x + \left(y - z\right)}}{t \cdot 2} \]
    3. Simplified99.9%

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

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

    if -7.1999999999999997e23 < x < -2.5e-205 or 4.4e-307 < x < 6e-230

    1. Initial program 99.9%

      \[\frac{\left(x + y\right) - z}{t \cdot 2} \]
    2. Step-by-step derivation
      1. associate--l+99.9%

        \[\leadsto \frac{\color{blue}{x + \left(y - z\right)}}{t \cdot 2} \]
    3. Simplified99.9%

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

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

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

        \[\leadsto \color{blue}{\frac{-0.5}{\frac{t}{z}}} \]
    6. Simplified53.2%

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

        \[\leadsto \color{blue}{\frac{-0.5}{t} \cdot z} \]
    8. Applied egg-rr53.4%

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

    if -2.5e-205 < x < 4.4e-307 or 6e-230 < x

    1. Initial program 99.3%

      \[\frac{\left(x + y\right) - z}{t \cdot 2} \]
    2. Step-by-step derivation
      1. associate--l+99.3%

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

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

      \[\leadsto \color{blue}{0.5 \cdot \frac{x}{t} + 0.5 \cdot \frac{y - z}{t}} \]
    5. Step-by-step derivation
      1. +-commutative97.1%

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

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

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

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

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

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

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

      \[\leadsto \frac{0.5}{t} \cdot \color{blue}{\left(y - z\right)} \]
    8. Step-by-step derivation
      1. associate-/r/73.7%

        \[\leadsto \color{blue}{\frac{0.5}{\frac{t}{y - z}}} \]
    9. Applied egg-rr73.7%

      \[\leadsto \color{blue}{\frac{0.5}{\frac{t}{y - z}}} \]
    10. Taylor expanded in y around inf 41.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -7.2 \cdot 10^{+23}:\\ \;\;\;\;0.5 \cdot \frac{x}{t}\\ \mathbf{elif}\;x \leq -2.5 \cdot 10^{-205} \lor \neg \left(x \leq 4.4 \cdot 10^{-307}\right) \land x \leq 6 \cdot 10^{-230}:\\ \;\;\;\;z \cdot \frac{-0.5}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{0.5}{\frac{t}{y}}\\ \end{array} \]

Alternative 3: 47.3% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -6.2 \cdot 10^{+23}:\\ \;\;\;\;0.5 \cdot \frac{x}{t}\\ \mathbf{elif}\;x \leq -1.56 \cdot 10^{-206} \lor \neg \left(x \leq -1.45 \cdot 10^{-301}\right) \land x \leq 8.2 \cdot 10^{-227}:\\ \;\;\;\;z \cdot \frac{-0.5}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{t \cdot 2}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= x -6.2e+23)
   (* 0.5 (/ x t))
   (if (or (<= x -1.56e-206) (and (not (<= x -1.45e-301)) (<= x 8.2e-227)))
     (* z (/ -0.5 t))
     (/ y (* t 2.0)))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (x <= -6.2e+23) {
		tmp = 0.5 * (x / t);
	} else if ((x <= -1.56e-206) || (!(x <= -1.45e-301) && (x <= 8.2e-227))) {
		tmp = z * (-0.5 / t);
	} else {
		tmp = y / (t * 2.0);
	}
	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 (x <= (-6.2d+23)) then
        tmp = 0.5d0 * (x / t)
    else if ((x <= (-1.56d-206)) .or. (.not. (x <= (-1.45d-301))) .and. (x <= 8.2d-227)) then
        tmp = z * ((-0.5d0) / t)
    else
        tmp = y / (t * 2.0d0)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (x <= -6.2e+23) {
		tmp = 0.5 * (x / t);
	} else if ((x <= -1.56e-206) || (!(x <= -1.45e-301) && (x <= 8.2e-227))) {
		tmp = z * (-0.5 / t);
	} else {
		tmp = y / (t * 2.0);
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if x <= -6.2e+23:
		tmp = 0.5 * (x / t)
	elif (x <= -1.56e-206) or (not (x <= -1.45e-301) and (x <= 8.2e-227)):
		tmp = z * (-0.5 / t)
	else:
		tmp = y / (t * 2.0)
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (x <= -6.2e+23)
		tmp = Float64(0.5 * Float64(x / t));
	elseif ((x <= -1.56e-206) || (!(x <= -1.45e-301) && (x <= 8.2e-227)))
		tmp = Float64(z * Float64(-0.5 / t));
	else
		tmp = Float64(y / Float64(t * 2.0));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (x <= -6.2e+23)
		tmp = 0.5 * (x / t);
	elseif ((x <= -1.56e-206) || (~((x <= -1.45e-301)) && (x <= 8.2e-227)))
		tmp = z * (-0.5 / t);
	else
		tmp = y / (t * 2.0);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[x, -6.2e+23], N[(0.5 * N[(x / t), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x, -1.56e-206], And[N[Not[LessEqual[x, -1.45e-301]], $MachinePrecision], LessEqual[x, 8.2e-227]]], N[(z * N[(-0.5 / t), $MachinePrecision]), $MachinePrecision], N[(y / N[(t * 2.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

\mathbf{elif}\;x \leq -1.56 \cdot 10^{-206} \lor \neg \left(x \leq -1.45 \cdot 10^{-301}\right) \land x \leq 8.2 \cdot 10^{-227}:\\
\;\;\;\;z \cdot \frac{-0.5}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -6.19999999999999941e23

    1. Initial program 99.9%

      \[\frac{\left(x + y\right) - z}{t \cdot 2} \]
    2. Step-by-step derivation
      1. associate--l+99.9%

        \[\leadsto \frac{\color{blue}{x + \left(y - z\right)}}{t \cdot 2} \]
    3. Simplified99.9%

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

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

    if -6.19999999999999941e23 < x < -1.56000000000000008e-206 or -1.44999999999999992e-301 < x < 8.20000000000000018e-227

    1. Initial program 98.5%

      \[\frac{\left(x + y\right) - z}{t \cdot 2} \]
    2. Step-by-step derivation
      1. associate--l+98.5%

        \[\leadsto \frac{\color{blue}{x + \left(y - z\right)}}{t \cdot 2} \]
    3. Simplified98.5%

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

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

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

        \[\leadsto \color{blue}{\frac{-0.5}{\frac{t}{z}}} \]
    6. Simplified53.9%

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

        \[\leadsto \color{blue}{\frac{-0.5}{t} \cdot z} \]
    8. Applied egg-rr54.0%

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

    if -1.56000000000000008e-206 < x < -1.44999999999999992e-301 or 8.20000000000000018e-227 < x

    1. Initial program 100.0%

      \[\frac{\left(x + y\right) - z}{t \cdot 2} \]
    2. Step-by-step derivation
      1. associate--l+100.0%

        \[\leadsto \frac{\color{blue}{x + \left(y - z\right)}}{t \cdot 2} \]
    3. Simplified100.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -6.2 \cdot 10^{+23}:\\ \;\;\;\;0.5 \cdot \frac{x}{t}\\ \mathbf{elif}\;x \leq -1.56 \cdot 10^{-206} \lor \neg \left(x \leq -1.45 \cdot 10^{-301}\right) \land x \leq 8.2 \cdot 10^{-227}:\\ \;\;\;\;z \cdot \frac{-0.5}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{t \cdot 2}\\ \end{array} \]

Alternative 4: 47.4% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -6.2 \cdot 10^{+23}:\\ \;\;\;\;0.5 \cdot \frac{x}{t}\\ \mathbf{elif}\;x \leq -9.5 \cdot 10^{-204}:\\ \;\;\;\;\frac{\frac{z}{-2}}{t}\\ \mathbf{elif}\;x \leq 3.5 \cdot 10^{-302} \lor \neg \left(x \leq 1.02 \cdot 10^{-225}\right):\\ \;\;\;\;\frac{y}{t \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;z \cdot \frac{-0.5}{t}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= x -6.2e+23)
   (* 0.5 (/ x t))
   (if (<= x -9.5e-204)
     (/ (/ z -2.0) t)
     (if (or (<= x 3.5e-302) (not (<= x 1.02e-225)))
       (/ y (* t 2.0))
       (* z (/ -0.5 t))))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (x <= -6.2e+23) {
		tmp = 0.5 * (x / t);
	} else if (x <= -9.5e-204) {
		tmp = (z / -2.0) / t;
	} else if ((x <= 3.5e-302) || !(x <= 1.02e-225)) {
		tmp = y / (t * 2.0);
	} else {
		tmp = z * (-0.5 / 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 (x <= (-6.2d+23)) then
        tmp = 0.5d0 * (x / t)
    else if (x <= (-9.5d-204)) then
        tmp = (z / (-2.0d0)) / t
    else if ((x <= 3.5d-302) .or. (.not. (x <= 1.02d-225))) then
        tmp = y / (t * 2.0d0)
    else
        tmp = z * ((-0.5d0) / t)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (x <= -6.2e+23) {
		tmp = 0.5 * (x / t);
	} else if (x <= -9.5e-204) {
		tmp = (z / -2.0) / t;
	} else if ((x <= 3.5e-302) || !(x <= 1.02e-225)) {
		tmp = y / (t * 2.0);
	} else {
		tmp = z * (-0.5 / t);
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if x <= -6.2e+23:
		tmp = 0.5 * (x / t)
	elif x <= -9.5e-204:
		tmp = (z / -2.0) / t
	elif (x <= 3.5e-302) or not (x <= 1.02e-225):
		tmp = y / (t * 2.0)
	else:
		tmp = z * (-0.5 / t)
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (x <= -6.2e+23)
		tmp = Float64(0.5 * Float64(x / t));
	elseif (x <= -9.5e-204)
		tmp = Float64(Float64(z / -2.0) / t);
	elseif ((x <= 3.5e-302) || !(x <= 1.02e-225))
		tmp = Float64(y / Float64(t * 2.0));
	else
		tmp = Float64(z * Float64(-0.5 / t));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (x <= -6.2e+23)
		tmp = 0.5 * (x / t);
	elseif (x <= -9.5e-204)
		tmp = (z / -2.0) / t;
	elseif ((x <= 3.5e-302) || ~((x <= 1.02e-225)))
		tmp = y / (t * 2.0);
	else
		tmp = z * (-0.5 / t);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[x, -6.2e+23], N[(0.5 * N[(x / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -9.5e-204], N[(N[(z / -2.0), $MachinePrecision] / t), $MachinePrecision], If[Or[LessEqual[x, 3.5e-302], N[Not[LessEqual[x, 1.02e-225]], $MachinePrecision]], N[(y / N[(t * 2.0), $MachinePrecision]), $MachinePrecision], N[(z * N[(-0.5 / t), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

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

\mathbf{elif}\;x \leq -9.5 \cdot 10^{-204}:\\
\;\;\;\;\frac{\frac{z}{-2}}{t}\\

\mathbf{elif}\;x \leq 3.5 \cdot 10^{-302} \lor \neg \left(x \leq 1.02 \cdot 10^{-225}\right):\\
\;\;\;\;\frac{y}{t \cdot 2}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x < -6.19999999999999941e23

    1. Initial program 99.9%

      \[\frac{\left(x + y\right) - z}{t \cdot 2} \]
    2. Step-by-step derivation
      1. associate--l+99.9%

        \[\leadsto \frac{\color{blue}{x + \left(y - z\right)}}{t \cdot 2} \]
    3. Simplified99.9%

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

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

    if -6.19999999999999941e23 < x < -9.50000000000000063e-204

    1. Initial program 99.9%

      \[\frac{\left(x + y\right) - z}{t \cdot 2} \]
    2. Step-by-step derivation
      1. associate--l+99.9%

        \[\leadsto \frac{\color{blue}{x + \left(y - z\right)}}{t \cdot 2} \]
    3. Simplified99.9%

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

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

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

        \[\leadsto \color{blue}{\frac{-0.5}{\frac{t}{z}}} \]
    6. Simplified53.5%

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

        \[\leadsto \color{blue}{\frac{-0.5}{t} \cdot z} \]
    8. Applied egg-rr53.6%

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

        \[\leadsto \color{blue}{\frac{-0.5}{\frac{t}{z}}} \]
      2. div-inv53.5%

        \[\leadsto \color{blue}{-0.5 \cdot \frac{1}{\frac{t}{z}}} \]
      3. metadata-eval53.5%

        \[\leadsto \color{blue}{\frac{1}{-2}} \cdot \frac{1}{\frac{t}{z}} \]
      4. metadata-eval53.5%

        \[\leadsto \frac{1}{\color{blue}{-2}} \cdot \frac{1}{\frac{t}{z}} \]
      5. clear-num53.7%

        \[\leadsto \frac{1}{-2} \cdot \color{blue}{\frac{z}{t}} \]
      6. times-frac53.7%

        \[\leadsto \color{blue}{\frac{1 \cdot z}{\left(-2\right) \cdot t}} \]
      7. *-lft-identity53.7%

        \[\leadsto \frac{\color{blue}{z}}{\left(-2\right) \cdot t} \]
      8. associate-/r*53.7%

        \[\leadsto \color{blue}{\frac{\frac{z}{-2}}{t}} \]
      9. metadata-eval53.7%

        \[\leadsto \frac{\frac{z}{\color{blue}{-2}}}{t} \]
    10. Applied egg-rr53.7%

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

    if -9.50000000000000063e-204 < x < 3.5000000000000001e-302 or 1.01999999999999995e-225 < x

    1. Initial program 99.3%

      \[\frac{\left(x + y\right) - z}{t \cdot 2} \]
    2. Step-by-step derivation
      1. associate--l+99.3%

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

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

      \[\leadsto \frac{\color{blue}{y}}{t \cdot 2} \]

    if 3.5000000000000001e-302 < x < 1.01999999999999995e-225

    1. Initial program 100.0%

      \[\frac{\left(x + y\right) - z}{t \cdot 2} \]
    2. Step-by-step derivation
      1. associate--l+100.0%

        \[\leadsto \frac{\color{blue}{x + \left(y - z\right)}}{t \cdot 2} \]
    3. Simplified100.0%

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

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

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

        \[\leadsto \color{blue}{\frac{-0.5}{\frac{t}{z}}} \]
    6. Simplified52.4%

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

        \[\leadsto \color{blue}{\frac{-0.5}{t} \cdot z} \]
    8. Applied egg-rr52.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -6.2 \cdot 10^{+23}:\\ \;\;\;\;0.5 \cdot \frac{x}{t}\\ \mathbf{elif}\;x \leq -9.5 \cdot 10^{-204}:\\ \;\;\;\;\frac{\frac{z}{-2}}{t}\\ \mathbf{elif}\;x \leq 3.5 \cdot 10^{-302} \lor \neg \left(x \leq 1.02 \cdot 10^{-225}\right):\\ \;\;\;\;\frac{y}{t \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;z \cdot \frac{-0.5}{t}\\ \end{array} \]

Alternative 5: 86.2% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.1 \cdot 10^{+32} \lor \neg \left(z \leq 9.5 \cdot 10^{-23}\right):\\
\;\;\;\;\frac{0.5}{t} \cdot \left(y - z\right)\\

\mathbf{else}:\\
\;\;\;\;\frac{0.5}{t} \cdot \left(y + x\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3.09999999999999993e32 or 9.50000000000000058e-23 < z

    1. Initial program 100.0%

      \[\frac{\left(x + y\right) - z}{t \cdot 2} \]
    2. Step-by-step derivation
      1. associate--l+100.0%

        \[\leadsto \frac{\color{blue}{x + \left(y - z\right)}}{t \cdot 2} \]
    3. Simplified100.0%

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

      \[\leadsto \color{blue}{0.5 \cdot \frac{x}{t} + 0.5 \cdot \frac{y - z}{t}} \]
    5. Step-by-step derivation
      1. +-commutative91.7%

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

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

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

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

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

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

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

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

    if -3.09999999999999993e32 < z < 9.50000000000000058e-23

    1. Initial program 99.3%

      \[\frac{\left(x + y\right) - z}{t \cdot 2} \]
    2. Step-by-step derivation
      1. associate--l+99.3%

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

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

      \[\leadsto \color{blue}{0.5 \cdot \frac{x}{t} + 0.5 \cdot \frac{y - z}{t}} \]
    5. Step-by-step derivation
      1. +-commutative98.5%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.1 \cdot 10^{+32} \lor \neg \left(z \leq 9.5 \cdot 10^{-23}\right):\\ \;\;\;\;\frac{0.5}{t} \cdot \left(y - z\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{0.5}{t} \cdot \left(y + x\right)\\ \end{array} \]

Alternative 6: 81.4% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.3 \cdot 10^{+88}:\\
\;\;\;\;\frac{\frac{z}{-2}}{t}\\

\mathbf{elif}\;z \leq 10^{+108}:\\
\;\;\;\;\frac{0.5}{t} \cdot \left(y + x\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -5.29999999999999987e88

    1. Initial program 100.0%

      \[\frac{\left(x + y\right) - z}{t \cdot 2} \]
    2. Step-by-step derivation
      1. associate--l+100.0%

        \[\leadsto \frac{\color{blue}{x + \left(y - z\right)}}{t \cdot 2} \]
    3. Simplified100.0%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-0.5}{t} \cdot z} \]
    8. Applied egg-rr87.5%

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

        \[\leadsto \color{blue}{\frac{-0.5}{\frac{t}{z}}} \]
      2. div-inv85.4%

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

        \[\leadsto \color{blue}{\frac{1}{-2}} \cdot \frac{1}{\frac{t}{z}} \]
      4. metadata-eval85.4%

        \[\leadsto \frac{1}{\color{blue}{-2}} \cdot \frac{1}{\frac{t}{z}} \]
      5. clear-num85.7%

        \[\leadsto \frac{1}{-2} \cdot \color{blue}{\frac{z}{t}} \]
      6. times-frac87.7%

        \[\leadsto \color{blue}{\frac{1 \cdot z}{\left(-2\right) \cdot t}} \]
      7. *-lft-identity87.7%

        \[\leadsto \frac{\color{blue}{z}}{\left(-2\right) \cdot t} \]
      8. associate-/r*87.7%

        \[\leadsto \color{blue}{\frac{\frac{z}{-2}}{t}} \]
      9. metadata-eval87.7%

        \[\leadsto \frac{\frac{z}{\color{blue}{-2}}}{t} \]
    10. Applied egg-rr87.7%

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

    if -5.29999999999999987e88 < z < 1e108

    1. Initial program 99.4%

      \[\frac{\left(x + y\right) - z}{t \cdot 2} \]
    2. Step-by-step derivation
      1. associate--l+99.4%

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

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

      \[\leadsto \color{blue}{0.5 \cdot \frac{x}{t} + 0.5 \cdot \frac{y - z}{t}} \]
    5. Step-by-step derivation
      1. +-commutative95.9%

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

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

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

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

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

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

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

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

    if 1e108 < z

    1. Initial program 100.0%

      \[\frac{\left(x + y\right) - z}{t \cdot 2} \]
    2. Step-by-step derivation
      1. associate--l+100.0%

        \[\leadsto \frac{\color{blue}{x + \left(y - z\right)}}{t \cdot 2} \]
    3. Simplified100.0%

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

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

        \[\leadsto \color{blue}{\frac{z}{t} \cdot -0.5} \]
    6. Simplified83.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -5.3 \cdot 10^{+88}:\\ \;\;\;\;\frac{\frac{z}{-2}}{t}\\ \mathbf{elif}\;z \leq 10^{+108}:\\ \;\;\;\;\frac{0.5}{t} \cdot \left(y + x\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{z}{t} \cdot -0.5\\ \end{array} \]

Alternative 7: 68.4% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y + x \leq -5 \cdot 10^{-130}:\\
\;\;\;\;\frac{x - z}{t \cdot 2}\\

\mathbf{else}:\\
\;\;\;\;\frac{0.5}{t} \cdot \left(y - z\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (+.f64 x y) < -4.9999999999999996e-130

    1. Initial program 99.1%

      \[\frac{\left(x + y\right) - z}{t \cdot 2} \]
    2. Step-by-step derivation
      1. associate--l+99.1%

        \[\leadsto \frac{\color{blue}{x + \left(y - z\right)}}{t \cdot 2} \]
    3. Simplified99.1%

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

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

    if -4.9999999999999996e-130 < (+.f64 x y)

    1. Initial program 100.0%

      \[\frac{\left(x + y\right) - z}{t \cdot 2} \]
    2. Step-by-step derivation
      1. associate--l+100.0%

        \[\leadsto \frac{\color{blue}{x + \left(y - z\right)}}{t \cdot 2} \]
    3. Simplified100.0%

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

      \[\leadsto \color{blue}{0.5 \cdot \frac{x}{t} + 0.5 \cdot \frac{y - z}{t}} \]
    5. Step-by-step derivation
      1. +-commutative95.1%

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

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

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

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

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

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

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

      \[\leadsto \frac{0.5}{t} \cdot \color{blue}{\left(y - z\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification68.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y + x \leq -5 \cdot 10^{-130}:\\ \;\;\;\;\frac{x - z}{t \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{0.5}{t} \cdot \left(y - z\right)\\ \end{array} \]

Alternative 8: 68.5% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y + x \leq -5 \cdot 10^{-130}:\\
\;\;\;\;\frac{x - z}{t \cdot 2}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (+.f64 x y) < -4.9999999999999996e-130

    1. Initial program 99.1%

      \[\frac{\left(x + y\right) - z}{t \cdot 2} \]
    2. Step-by-step derivation
      1. associate--l+99.1%

        \[\leadsto \frac{\color{blue}{x + \left(y - z\right)}}{t \cdot 2} \]
    3. Simplified99.1%

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

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

    if -4.9999999999999996e-130 < (+.f64 x y)

    1. Initial program 100.0%

      \[\frac{\left(x + y\right) - z}{t \cdot 2} \]
    2. Step-by-step derivation
      1. associate--l+100.0%

        \[\leadsto \frac{\color{blue}{x + \left(y - z\right)}}{t \cdot 2} \]
    3. Simplified100.0%

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

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

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

Alternative 9: 55.2% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -7 \cdot 10^{+30} \lor \neg \left(z \leq 3.7 \cdot 10^{-21}\right):\\
\;\;\;\;z \cdot \frac{-0.5}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -7.00000000000000042e30 or 3.7000000000000002e-21 < z

    1. Initial program 100.0%

      \[\frac{\left(x + y\right) - z}{t \cdot 2} \]
    2. Step-by-step derivation
      1. associate--l+100.0%

        \[\leadsto \frac{\color{blue}{x + \left(y - z\right)}}{t \cdot 2} \]
    3. Simplified100.0%

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

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

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

        \[\leadsto \color{blue}{\frac{-0.5}{\frac{t}{z}}} \]
    6. Simplified71.0%

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

        \[\leadsto \color{blue}{\frac{-0.5}{t} \cdot z} \]
    8. Applied egg-rr71.1%

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

    if -7.00000000000000042e30 < z < 3.7000000000000002e-21

    1. Initial program 99.3%

      \[\frac{\left(x + y\right) - z}{t \cdot 2} \]
    2. Step-by-step derivation
      1. associate--l+99.3%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -7 \cdot 10^{+30} \lor \neg \left(z \leq 3.7 \cdot 10^{-21}\right):\\ \;\;\;\;z \cdot \frac{-0.5}{t}\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \frac{x}{t}\\ \end{array} \]

Alternative 10: 55.2% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.6 \cdot 10^{+30}:\\
\;\;\;\;z \cdot \frac{-0.5}{t}\\

\mathbf{elif}\;z \leq 1.5 \cdot 10^{-27}:\\
\;\;\;\;0.5 \cdot \frac{x}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -8.6e30

    1. Initial program 100.0%

      \[\frac{\left(x + y\right) - z}{t \cdot 2} \]
    2. Step-by-step derivation
      1. associate--l+100.0%

        \[\leadsto \frac{\color{blue}{x + \left(y - z\right)}}{t \cdot 2} \]
    3. Simplified100.0%

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

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

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

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

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

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

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

    if -8.6e30 < z < 1.5000000000000001e-27

    1. Initial program 99.3%

      \[\frac{\left(x + y\right) - z}{t \cdot 2} \]
    2. Step-by-step derivation
      1. associate--l+99.3%

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

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

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

    if 1.5000000000000001e-27 < z

    1. Initial program 99.9%

      \[\frac{\left(x + y\right) - z}{t \cdot 2} \]
    2. Step-by-step derivation
      1. associate--l+99.9%

        \[\leadsto \frac{\color{blue}{x + \left(y - z\right)}}{t \cdot 2} \]
    3. Simplified99.9%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -8.6 \cdot 10^{+30}:\\ \;\;\;\;z \cdot \frac{-0.5}{t}\\ \mathbf{elif}\;z \leq 1.5 \cdot 10^{-27}:\\ \;\;\;\;0.5 \cdot \frac{x}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{z}{t} \cdot -0.5\\ \end{array} \]

Alternative 11: 37.1% 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 99.6%

    \[\frac{\left(x + y\right) - z}{t \cdot 2} \]
  2. Step-by-step derivation
    1. associate--l+99.6%

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

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

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

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

Reproduce

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