Numeric.Signal.Multichannel:$cput from hsignal-0.2.7.1

Percentage Accurate: 96.9% → 96.9%
Time: 11.9s
Alternatives: 13
Speedup: 1.0×

Specification

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

\\
\frac{x - y}{z - y} \cdot t
\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 13 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: 96.9% accurate, 1.0× speedup?

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

\\
\frac{x - y}{z - y} \cdot t
\end{array}

Alternative 1: 96.9% accurate, 1.0× speedup?

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

\\
\frac{x - y}{z - y} \cdot t
\end{array}
Derivation
  1. Initial program 97.1%

    \[\frac{x - y}{z - y} \cdot t \]
  2. Add Preprocessing
  3. Final simplification97.1%

    \[\leadsto \frac{x - y}{z - y} \cdot t \]
  4. Add Preprocessing

Alternative 2: 68.5% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := t \cdot \frac{x}{z - y}\\ \mathbf{if}\;y \leq -1.65 \cdot 10^{+148}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq -1.8 \cdot 10^{+117}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -1.02 \cdot 10^{+86}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq -2.1 \cdot 10^{-26}:\\ \;\;\;\;\left(x - y\right) \cdot \frac{t}{z}\\ \mathbf{elif}\;y \leq 6.8 \cdot 10^{+72}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* t (/ x (- z y)))))
   (if (<= y -1.65e+148)
     t
     (if (<= y -1.8e+117)
       t_1
       (if (<= y -1.02e+86)
         t
         (if (<= y -2.1e-26)
           (* (- x y) (/ t z))
           (if (<= y 6.8e+72) t_1 t)))))))
double code(double x, double y, double z, double t) {
	double t_1 = t * (x / (z - y));
	double tmp;
	if (y <= -1.65e+148) {
		tmp = t;
	} else if (y <= -1.8e+117) {
		tmp = t_1;
	} else if (y <= -1.02e+86) {
		tmp = t;
	} else if (y <= -2.1e-26) {
		tmp = (x - y) * (t / z);
	} else if (y <= 6.8e+72) {
		tmp = t_1;
	} else {
		tmp = 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) :: tmp
    t_1 = t * (x / (z - y))
    if (y <= (-1.65d+148)) then
        tmp = t
    else if (y <= (-1.8d+117)) then
        tmp = t_1
    else if (y <= (-1.02d+86)) then
        tmp = t
    else if (y <= (-2.1d-26)) then
        tmp = (x - y) * (t / z)
    else if (y <= 6.8d+72) then
        tmp = t_1
    else
        tmp = t
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = t * (x / (z - y));
	double tmp;
	if (y <= -1.65e+148) {
		tmp = t;
	} else if (y <= -1.8e+117) {
		tmp = t_1;
	} else if (y <= -1.02e+86) {
		tmp = t;
	} else if (y <= -2.1e-26) {
		tmp = (x - y) * (t / z);
	} else if (y <= 6.8e+72) {
		tmp = t_1;
	} else {
		tmp = t;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = t * (x / (z - y))
	tmp = 0
	if y <= -1.65e+148:
		tmp = t
	elif y <= -1.8e+117:
		tmp = t_1
	elif y <= -1.02e+86:
		tmp = t
	elif y <= -2.1e-26:
		tmp = (x - y) * (t / z)
	elif y <= 6.8e+72:
		tmp = t_1
	else:
		tmp = t
	return tmp
function code(x, y, z, t)
	t_1 = Float64(t * Float64(x / Float64(z - y)))
	tmp = 0.0
	if (y <= -1.65e+148)
		tmp = t;
	elseif (y <= -1.8e+117)
		tmp = t_1;
	elseif (y <= -1.02e+86)
		tmp = t;
	elseif (y <= -2.1e-26)
		tmp = Float64(Float64(x - y) * Float64(t / z));
	elseif (y <= 6.8e+72)
		tmp = t_1;
	else
		tmp = t;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = t * (x / (z - y));
	tmp = 0.0;
	if (y <= -1.65e+148)
		tmp = t;
	elseif (y <= -1.8e+117)
		tmp = t_1;
	elseif (y <= -1.02e+86)
		tmp = t;
	elseif (y <= -2.1e-26)
		tmp = (x - y) * (t / z);
	elseif (y <= 6.8e+72)
		tmp = t_1;
	else
		tmp = t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(t * N[(x / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.65e+148], t, If[LessEqual[y, -1.8e+117], t$95$1, If[LessEqual[y, -1.02e+86], t, If[LessEqual[y, -2.1e-26], N[(N[(x - y), $MachinePrecision] * N[(t / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.8e+72], t$95$1, t]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq -1.8 \cdot 10^{+117}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq -1.02 \cdot 10^{+86}:\\
\;\;\;\;t\\

\mathbf{elif}\;y \leq -2.1 \cdot 10^{-26}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{t}{z}\\

\mathbf{elif}\;y \leq 6.8 \cdot 10^{+72}:\\
\;\;\;\;t\_1\\

\mathbf{else}:\\
\;\;\;\;t\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.65000000000000005e148 or -1.80000000000000006e117 < y < -1.01999999999999996e86 or 6.7999999999999997e72 < y

    1. Initial program 100.0%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Step-by-step derivation
      1. associate-*l/61.1%

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

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

      \[\leadsto \color{blue}{\left(x - y\right) \cdot \frac{t}{z - y}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around inf 80.6%

      \[\leadsto \color{blue}{t} \]

    if -1.65000000000000005e148 < y < -1.80000000000000006e117 or -2.10000000000000008e-26 < y < 6.7999999999999997e72

    1. Initial program 95.1%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 76.0%

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

    if -1.01999999999999996e86 < y < -2.10000000000000008e-26

    1. Initial program 98.2%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Step-by-step derivation
      1. associate-*l/82.2%

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

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

      \[\leadsto \color{blue}{\left(x - y\right) \cdot \frac{t}{z - y}} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf 52.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.65 \cdot 10^{+148}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq -1.8 \cdot 10^{+117}:\\ \;\;\;\;t \cdot \frac{x}{z - y}\\ \mathbf{elif}\;y \leq -1.02 \cdot 10^{+86}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq -2.1 \cdot 10^{-26}:\\ \;\;\;\;\left(x - y\right) \cdot \frac{t}{z}\\ \mathbf{elif}\;y \leq 6.8 \cdot 10^{+72}:\\ \;\;\;\;t \cdot \frac{x}{z - y}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 73.1% accurate, 0.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.9 \cdot 10^{+117}:\\
\;\;\;\;t - t \cdot \frac{x}{y}\\

\mathbf{elif}\;y \leq -3.05 \cdot 10^{-30}:\\
\;\;\;\;\frac{y \cdot t}{y - z}\\

\mathbf{elif}\;y \leq -4.8 \cdot 10^{-149}:\\
\;\;\;\;\frac{x \cdot t}{z - y}\\

\mathbf{elif}\;y \leq 1.05 \cdot 10^{-88}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{t}{z}\\

\mathbf{elif}\;y \leq 3.3 \cdot 10^{-48}:\\
\;\;\;\;t \cdot \frac{x}{z - y}\\

\mathbf{else}:\\
\;\;\;\;t - \frac{t}{\frac{y}{x}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if y < -1.9000000000000001e117

    1. Initial program 100.0%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Add Preprocessing
    3. Taylor expanded in z around 0 82.4%

      \[\leadsto \color{blue}{\left(-1 \cdot \frac{x - y}{y}\right)} \cdot t \]
    4. Step-by-step derivation
      1. associate-*r/82.4%

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(x - y\right)}{y}} \cdot t \]
      2. neg-mul-182.4%

        \[\leadsto \frac{\color{blue}{-\left(x - y\right)}}{y} \cdot t \]
    5. Simplified82.4%

      \[\leadsto \color{blue}{\frac{-\left(x - y\right)}{y}} \cdot t \]
    6. Taylor expanded in x around 0 68.0%

      \[\leadsto \color{blue}{t + -1 \cdot \frac{t \cdot x}{y}} \]
    7. Step-by-step derivation
      1. mul-1-neg68.0%

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

        \[\leadsto \color{blue}{t - \frac{t \cdot x}{y}} \]
      3. associate-/l*82.4%

        \[\leadsto t - \color{blue}{t \cdot \frac{x}{y}} \]
    8. Simplified82.4%

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

    if -1.9000000000000001e117 < y < -3.0499999999999999e-30

    1. Initial program 98.9%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Step-by-step derivation
      1. associate-*l/85.4%

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

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

      \[\leadsto \color{blue}{\left(x - y\right) \cdot \frac{t}{z - y}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 0 71.0%

      \[\leadsto \color{blue}{-1 \cdot \frac{t \cdot y}{z - y}} \]
    6. Step-by-step derivation
      1. mul-1-neg71.0%

        \[\leadsto \color{blue}{-\frac{t \cdot y}{z - y}} \]
    7. Simplified71.0%

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

    if -3.0499999999999999e-30 < y < -4.8000000000000002e-149

    1. Initial program 96.3%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Step-by-step derivation
      1. associate-*l/95.3%

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

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

      \[\leadsto \color{blue}{\left(x - y\right) \cdot \frac{t}{z - y}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf 83.5%

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

    if -4.8000000000000002e-149 < y < 1.05e-88

    1. Initial program 92.2%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Step-by-step derivation
      1. associate-*l/90.1%

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

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

      \[\leadsto \color{blue}{\left(x - y\right) \cdot \frac{t}{z - y}} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf 88.0%

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

    if 1.05e-88 < y < 3.3e-48

    1. Initial program 100.0%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 100.0%

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

    if 3.3e-48 < y

    1. Initial program 99.7%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Add Preprocessing
    3. Taylor expanded in z around 0 78.4%

      \[\leadsto \color{blue}{\left(-1 \cdot \frac{x - y}{y}\right)} \cdot t \]
    4. Step-by-step derivation
      1. associate-*r/78.4%

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(x - y\right)}{y}} \cdot t \]
      2. neg-mul-178.4%

        \[\leadsto \frac{\color{blue}{-\left(x - y\right)}}{y} \cdot t \]
    5. Simplified78.4%

      \[\leadsto \color{blue}{\frac{-\left(x - y\right)}{y}} \cdot t \]
    6. Taylor expanded in x around 0 75.2%

      \[\leadsto \color{blue}{t + -1 \cdot \frac{t \cdot x}{y}} \]
    7. Step-by-step derivation
      1. mul-1-neg75.2%

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

        \[\leadsto \color{blue}{t - \frac{t \cdot x}{y}} \]
      3. associate-/l*78.4%

        \[\leadsto t - \color{blue}{t \cdot \frac{x}{y}} \]
    8. Simplified78.4%

      \[\leadsto \color{blue}{t - t \cdot \frac{x}{y}} \]
    9. Step-by-step derivation
      1. clear-num78.4%

        \[\leadsto t - t \cdot \color{blue}{\frac{1}{\frac{y}{x}}} \]
      2. un-div-inv78.4%

        \[\leadsto t - \color{blue}{\frac{t}{\frac{y}{x}}} \]
    10. Applied egg-rr78.4%

      \[\leadsto t - \color{blue}{\frac{t}{\frac{y}{x}}} \]
  3. Recombined 6 regimes into one program.
  4. Final simplification82.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.9 \cdot 10^{+117}:\\ \;\;\;\;t - t \cdot \frac{x}{y}\\ \mathbf{elif}\;y \leq -3.05 \cdot 10^{-30}:\\ \;\;\;\;\frac{y \cdot t}{y - z}\\ \mathbf{elif}\;y \leq -4.8 \cdot 10^{-149}:\\ \;\;\;\;\frac{x \cdot t}{z - y}\\ \mathbf{elif}\;y \leq 1.05 \cdot 10^{-88}:\\ \;\;\;\;\left(x - y\right) \cdot \frac{t}{z}\\ \mathbf{elif}\;y \leq 3.3 \cdot 10^{-48}:\\ \;\;\;\;t \cdot \frac{x}{z - y}\\ \mathbf{else}:\\ \;\;\;\;t - \frac{t}{\frac{y}{x}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 74.3% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := t - t \cdot \frac{x}{y}\\ \mathbf{if}\;y \leq -1.85 \cdot 10^{+83}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -5.4 \cdot 10^{+65}:\\ \;\;\;\;t \cdot \frac{x - y}{z}\\ \mathbf{elif}\;y \leq -5.5 \cdot 10^{-30} \lor \neg \left(y \leq 3.3 \cdot 10^{-48}\right):\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{x}{z - y}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (- t (* t (/ x y)))))
   (if (<= y -1.85e+83)
     t_1
     (if (<= y -5.4e+65)
       (* t (/ (- x y) z))
       (if (or (<= y -5.5e-30) (not (<= y 3.3e-48)))
         t_1
         (* t (/ x (- z y))))))))
double code(double x, double y, double z, double t) {
	double t_1 = t - (t * (x / y));
	double tmp;
	if (y <= -1.85e+83) {
		tmp = t_1;
	} else if (y <= -5.4e+65) {
		tmp = t * ((x - y) / z);
	} else if ((y <= -5.5e-30) || !(y <= 3.3e-48)) {
		tmp = t_1;
	} else {
		tmp = t * (x / (z - 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) :: t_1
    real(8) :: tmp
    t_1 = t - (t * (x / y))
    if (y <= (-1.85d+83)) then
        tmp = t_1
    else if (y <= (-5.4d+65)) then
        tmp = t * ((x - y) / z)
    else if ((y <= (-5.5d-30)) .or. (.not. (y <= 3.3d-48))) then
        tmp = t_1
    else
        tmp = t * (x / (z - y))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = t - (t * (x / y));
	double tmp;
	if (y <= -1.85e+83) {
		tmp = t_1;
	} else if (y <= -5.4e+65) {
		tmp = t * ((x - y) / z);
	} else if ((y <= -5.5e-30) || !(y <= 3.3e-48)) {
		tmp = t_1;
	} else {
		tmp = t * (x / (z - y));
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = t - (t * (x / y))
	tmp = 0
	if y <= -1.85e+83:
		tmp = t_1
	elif y <= -5.4e+65:
		tmp = t * ((x - y) / z)
	elif (y <= -5.5e-30) or not (y <= 3.3e-48):
		tmp = t_1
	else:
		tmp = t * (x / (z - y))
	return tmp
function code(x, y, z, t)
	t_1 = Float64(t - Float64(t * Float64(x / y)))
	tmp = 0.0
	if (y <= -1.85e+83)
		tmp = t_1;
	elseif (y <= -5.4e+65)
		tmp = Float64(t * Float64(Float64(x - y) / z));
	elseif ((y <= -5.5e-30) || !(y <= 3.3e-48))
		tmp = t_1;
	else
		tmp = Float64(t * Float64(x / Float64(z - y)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = t - (t * (x / y));
	tmp = 0.0;
	if (y <= -1.85e+83)
		tmp = t_1;
	elseif (y <= -5.4e+65)
		tmp = t * ((x - y) / z);
	elseif ((y <= -5.5e-30) || ~((y <= 3.3e-48)))
		tmp = t_1;
	else
		tmp = t * (x / (z - y));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(t - N[(t * N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.85e+83], t$95$1, If[LessEqual[y, -5.4e+65], N[(t * N[(N[(x - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y, -5.5e-30], N[Not[LessEqual[y, 3.3e-48]], $MachinePrecision]], t$95$1, N[(t * N[(x / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := t - t \cdot \frac{x}{y}\\
\mathbf{if}\;y \leq -1.85 \cdot 10^{+83}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq -5.4 \cdot 10^{+65}:\\
\;\;\;\;t \cdot \frac{x - y}{z}\\

\mathbf{elif}\;y \leq -5.5 \cdot 10^{-30} \lor \neg \left(y \leq 3.3 \cdot 10^{-48}\right):\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.8500000000000001e83 or -5.40000000000000038e65 < y < -5.49999999999999976e-30 or 3.3e-48 < y

    1. Initial program 99.7%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Add Preprocessing
    3. Taylor expanded in z around 0 76.9%

      \[\leadsto \color{blue}{\left(-1 \cdot \frac{x - y}{y}\right)} \cdot t \]
    4. Step-by-step derivation
      1. associate-*r/76.9%

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(x - y\right)}{y}} \cdot t \]
      2. neg-mul-176.9%

        \[\leadsto \frac{\color{blue}{-\left(x - y\right)}}{y} \cdot t \]
    5. Simplified76.9%

      \[\leadsto \color{blue}{\frac{-\left(x - y\right)}{y}} \cdot t \]
    6. Taylor expanded in x around 0 69.8%

      \[\leadsto \color{blue}{t + -1 \cdot \frac{t \cdot x}{y}} \]
    7. Step-by-step derivation
      1. mul-1-neg69.8%

        \[\leadsto t + \color{blue}{\left(-\frac{t \cdot x}{y}\right)} \]
      2. unsub-neg69.8%

        \[\leadsto \color{blue}{t - \frac{t \cdot x}{y}} \]
      3. associate-/l*76.9%

        \[\leadsto t - \color{blue}{t \cdot \frac{x}{y}} \]
    8. Simplified76.9%

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

    if -1.8500000000000001e83 < y < -5.40000000000000038e65

    1. Initial program 100.0%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf 99.0%

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

    if -5.49999999999999976e-30 < y < 3.3e-48

    1. Initial program 93.6%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 83.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.85 \cdot 10^{+83}:\\ \;\;\;\;t - t \cdot \frac{x}{y}\\ \mathbf{elif}\;y \leq -5.4 \cdot 10^{+65}:\\ \;\;\;\;t \cdot \frac{x - y}{z}\\ \mathbf{elif}\;y \leq -5.5 \cdot 10^{-30} \lor \neg \left(y \leq 3.3 \cdot 10^{-48}\right):\\ \;\;\;\;t - t \cdot \frac{x}{y}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{x}{z - y}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 74.2% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := t - t \cdot \frac{x}{y}\\ \mathbf{if}\;y \leq -1.95 \cdot 10^{+85}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -9.2 \cdot 10^{+64}:\\ \;\;\;\;t \cdot \frac{x - y}{z}\\ \mathbf{elif}\;y \leq -7.5 \cdot 10^{-30}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 3.3 \cdot 10^{-48}:\\ \;\;\;\;t \cdot \frac{x}{z - y}\\ \mathbf{else}:\\ \;\;\;\;t - \frac{t}{\frac{y}{x}}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (- t (* t (/ x y)))))
   (if (<= y -1.95e+85)
     t_1
     (if (<= y -9.2e+64)
       (* t (/ (- x y) z))
       (if (<= y -7.5e-30)
         t_1
         (if (<= y 3.3e-48) (* t (/ x (- z y))) (- t (/ t (/ y x)))))))))
double code(double x, double y, double z, double t) {
	double t_1 = t - (t * (x / y));
	double tmp;
	if (y <= -1.95e+85) {
		tmp = t_1;
	} else if (y <= -9.2e+64) {
		tmp = t * ((x - y) / z);
	} else if (y <= -7.5e-30) {
		tmp = t_1;
	} else if (y <= 3.3e-48) {
		tmp = t * (x / (z - y));
	} else {
		tmp = t - (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) :: t_1
    real(8) :: tmp
    t_1 = t - (t * (x / y))
    if (y <= (-1.95d+85)) then
        tmp = t_1
    else if (y <= (-9.2d+64)) then
        tmp = t * ((x - y) / z)
    else if (y <= (-7.5d-30)) then
        tmp = t_1
    else if (y <= 3.3d-48) then
        tmp = t * (x / (z - y))
    else
        tmp = t - (t / (y / x))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = t - (t * (x / y));
	double tmp;
	if (y <= -1.95e+85) {
		tmp = t_1;
	} else if (y <= -9.2e+64) {
		tmp = t * ((x - y) / z);
	} else if (y <= -7.5e-30) {
		tmp = t_1;
	} else if (y <= 3.3e-48) {
		tmp = t * (x / (z - y));
	} else {
		tmp = t - (t / (y / x));
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = t - (t * (x / y))
	tmp = 0
	if y <= -1.95e+85:
		tmp = t_1
	elif y <= -9.2e+64:
		tmp = t * ((x - y) / z)
	elif y <= -7.5e-30:
		tmp = t_1
	elif y <= 3.3e-48:
		tmp = t * (x / (z - y))
	else:
		tmp = t - (t / (y / x))
	return tmp
function code(x, y, z, t)
	t_1 = Float64(t - Float64(t * Float64(x / y)))
	tmp = 0.0
	if (y <= -1.95e+85)
		tmp = t_1;
	elseif (y <= -9.2e+64)
		tmp = Float64(t * Float64(Float64(x - y) / z));
	elseif (y <= -7.5e-30)
		tmp = t_1;
	elseif (y <= 3.3e-48)
		tmp = Float64(t * Float64(x / Float64(z - y)));
	else
		tmp = Float64(t - Float64(t / Float64(y / x)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = t - (t * (x / y));
	tmp = 0.0;
	if (y <= -1.95e+85)
		tmp = t_1;
	elseif (y <= -9.2e+64)
		tmp = t * ((x - y) / z);
	elseif (y <= -7.5e-30)
		tmp = t_1;
	elseif (y <= 3.3e-48)
		tmp = t * (x / (z - y));
	else
		tmp = t - (t / (y / x));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(t - N[(t * N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.95e+85], t$95$1, If[LessEqual[y, -9.2e+64], N[(t * N[(N[(x - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -7.5e-30], t$95$1, If[LessEqual[y, 3.3e-48], N[(t * N[(x / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t - N[(t / N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := t - t \cdot \frac{x}{y}\\
\mathbf{if}\;y \leq -1.95 \cdot 10^{+85}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq -9.2 \cdot 10^{+64}:\\
\;\;\;\;t \cdot \frac{x - y}{z}\\

\mathbf{elif}\;y \leq -7.5 \cdot 10^{-30}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq 3.3 \cdot 10^{-48}:\\
\;\;\;\;t \cdot \frac{x}{z - y}\\

\mathbf{else}:\\
\;\;\;\;t - \frac{t}{\frac{y}{x}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -1.95000000000000017e85 or -9.2e64 < y < -7.5000000000000006e-30

    1. Initial program 99.6%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Add Preprocessing
    3. Taylor expanded in z around 0 75.3%

      \[\leadsto \color{blue}{\left(-1 \cdot \frac{x - y}{y}\right)} \cdot t \]
    4. Step-by-step derivation
      1. associate-*r/75.3%

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(x - y\right)}{y}} \cdot t \]
      2. neg-mul-175.3%

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

      \[\leadsto \color{blue}{\frac{-\left(x - y\right)}{y}} \cdot t \]
    6. Taylor expanded in x around 0 64.0%

      \[\leadsto \color{blue}{t + -1 \cdot \frac{t \cdot x}{y}} \]
    7. Step-by-step derivation
      1. mul-1-neg64.0%

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

        \[\leadsto \color{blue}{t - \frac{t \cdot x}{y}} \]
      3. associate-/l*75.3%

        \[\leadsto t - \color{blue}{t \cdot \frac{x}{y}} \]
    8. Simplified75.3%

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

    if -1.95000000000000017e85 < y < -9.2e64

    1. Initial program 100.0%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf 99.0%

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

    if -7.5000000000000006e-30 < y < 3.3e-48

    1. Initial program 93.6%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 83.8%

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

    if 3.3e-48 < y

    1. Initial program 99.7%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Add Preprocessing
    3. Taylor expanded in z around 0 78.4%

      \[\leadsto \color{blue}{\left(-1 \cdot \frac{x - y}{y}\right)} \cdot t \]
    4. Step-by-step derivation
      1. associate-*r/78.4%

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(x - y\right)}{y}} \cdot t \]
      2. neg-mul-178.4%

        \[\leadsto \frac{\color{blue}{-\left(x - y\right)}}{y} \cdot t \]
    5. Simplified78.4%

      \[\leadsto \color{blue}{\frac{-\left(x - y\right)}{y}} \cdot t \]
    6. Taylor expanded in x around 0 75.2%

      \[\leadsto \color{blue}{t + -1 \cdot \frac{t \cdot x}{y}} \]
    7. Step-by-step derivation
      1. mul-1-neg75.2%

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

        \[\leadsto \color{blue}{t - \frac{t \cdot x}{y}} \]
      3. associate-/l*78.4%

        \[\leadsto t - \color{blue}{t \cdot \frac{x}{y}} \]
    8. Simplified78.4%

      \[\leadsto \color{blue}{t - t \cdot \frac{x}{y}} \]
    9. Step-by-step derivation
      1. clear-num78.4%

        \[\leadsto t - t \cdot \color{blue}{\frac{1}{\frac{y}{x}}} \]
      2. un-div-inv78.4%

        \[\leadsto t - \color{blue}{\frac{t}{\frac{y}{x}}} \]
    10. Applied egg-rr78.4%

      \[\leadsto t - \color{blue}{\frac{t}{\frac{y}{x}}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification80.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.95 \cdot 10^{+85}:\\ \;\;\;\;t - t \cdot \frac{x}{y}\\ \mathbf{elif}\;y \leq -9.2 \cdot 10^{+64}:\\ \;\;\;\;t \cdot \frac{x - y}{z}\\ \mathbf{elif}\;y \leq -7.5 \cdot 10^{-30}:\\ \;\;\;\;t - t \cdot \frac{x}{y}\\ \mathbf{elif}\;y \leq 3.3 \cdot 10^{-48}:\\ \;\;\;\;t \cdot \frac{x}{z - y}\\ \mathbf{else}:\\ \;\;\;\;t - \frac{t}{\frac{y}{x}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 74.3% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := t \cdot \frac{y}{y - z}\\ \mathbf{if}\;y \leq -2.8 \cdot 10^{-31}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -1 \cdot 10^{-149}:\\ \;\;\;\;\frac{x \cdot t}{z - y}\\ \mathbf{elif}\;y \leq 1.86 \cdot 10^{-88}:\\ \;\;\;\;\left(x - y\right) \cdot \frac{t}{z}\\ \mathbf{elif}\;y \leq 1.85 \cdot 10^{-48}:\\ \;\;\;\;t \cdot \frac{x}{z - y}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* t (/ y (- y z)))))
   (if (<= y -2.8e-31)
     t_1
     (if (<= y -1e-149)
       (/ (* x t) (- z y))
       (if (<= y 1.86e-88)
         (* (- x y) (/ t z))
         (if (<= y 1.85e-48) (* t (/ x (- z y))) t_1))))))
double code(double x, double y, double z, double t) {
	double t_1 = t * (y / (y - z));
	double tmp;
	if (y <= -2.8e-31) {
		tmp = t_1;
	} else if (y <= -1e-149) {
		tmp = (x * t) / (z - y);
	} else if (y <= 1.86e-88) {
		tmp = (x - y) * (t / z);
	} else if (y <= 1.85e-48) {
		tmp = t * (x / (z - y));
	} else {
		tmp = t_1;
	}
	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) :: tmp
    t_1 = t * (y / (y - z))
    if (y <= (-2.8d-31)) then
        tmp = t_1
    else if (y <= (-1d-149)) then
        tmp = (x * t) / (z - y)
    else if (y <= 1.86d-88) then
        tmp = (x - y) * (t / z)
    else if (y <= 1.85d-48) then
        tmp = t * (x / (z - y))
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = t * (y / (y - z));
	double tmp;
	if (y <= -2.8e-31) {
		tmp = t_1;
	} else if (y <= -1e-149) {
		tmp = (x * t) / (z - y);
	} else if (y <= 1.86e-88) {
		tmp = (x - y) * (t / z);
	} else if (y <= 1.85e-48) {
		tmp = t * (x / (z - y));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = t * (y / (y - z))
	tmp = 0
	if y <= -2.8e-31:
		tmp = t_1
	elif y <= -1e-149:
		tmp = (x * t) / (z - y)
	elif y <= 1.86e-88:
		tmp = (x - y) * (t / z)
	elif y <= 1.85e-48:
		tmp = t * (x / (z - y))
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(t * Float64(y / Float64(y - z)))
	tmp = 0.0
	if (y <= -2.8e-31)
		tmp = t_1;
	elseif (y <= -1e-149)
		tmp = Float64(Float64(x * t) / Float64(z - y));
	elseif (y <= 1.86e-88)
		tmp = Float64(Float64(x - y) * Float64(t / z));
	elseif (y <= 1.85e-48)
		tmp = Float64(t * Float64(x / Float64(z - y)));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = t * (y / (y - z));
	tmp = 0.0;
	if (y <= -2.8e-31)
		tmp = t_1;
	elseif (y <= -1e-149)
		tmp = (x * t) / (z - y);
	elseif (y <= 1.86e-88)
		tmp = (x - y) * (t / z);
	elseif (y <= 1.85e-48)
		tmp = t * (x / (z - y));
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(t * N[(y / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.8e-31], t$95$1, If[LessEqual[y, -1e-149], N[(N[(x * t), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.86e-88], N[(N[(x - y), $MachinePrecision] * N[(t / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.85e-48], N[(t * N[(x / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := t \cdot \frac{y}{y - z}\\
\mathbf{if}\;y \leq -2.8 \cdot 10^{-31}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq -1 \cdot 10^{-149}:\\
\;\;\;\;\frac{x \cdot t}{z - y}\\

\mathbf{elif}\;y \leq 1.86 \cdot 10^{-88}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{t}{z}\\

\mathbf{elif}\;y \leq 1.85 \cdot 10^{-48}:\\
\;\;\;\;t \cdot \frac{x}{z - y}\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -2.7999999999999999e-31 or 1.8499999999999999e-48 < y

    1. Initial program 99.7%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0 80.2%

      \[\leadsto \color{blue}{\left(-1 \cdot \frac{y}{z - y}\right)} \cdot t \]
    4. Step-by-step derivation
      1. neg-mul-180.2%

        \[\leadsto \color{blue}{\left(-\frac{y}{z - y}\right)} \cdot t \]
      2. distribute-neg-frac80.2%

        \[\leadsto \color{blue}{\frac{-y}{z - y}} \cdot t \]
    5. Simplified80.2%

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

    if -2.7999999999999999e-31 < y < -9.99999999999999979e-150

    1. Initial program 96.3%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Step-by-step derivation
      1. associate-*l/95.3%

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

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

      \[\leadsto \color{blue}{\left(x - y\right) \cdot \frac{t}{z - y}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf 83.5%

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

    if -9.99999999999999979e-150 < y < 1.85999999999999991e-88

    1. Initial program 92.2%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Step-by-step derivation
      1. associate-*l/90.1%

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

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

      \[\leadsto \color{blue}{\left(x - y\right) \cdot \frac{t}{z - y}} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf 88.0%

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

    if 1.85999999999999991e-88 < y < 1.8499999999999999e-48

    1. Initial program 100.0%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 100.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.8 \cdot 10^{-31}:\\ \;\;\;\;t \cdot \frac{y}{y - z}\\ \mathbf{elif}\;y \leq -1 \cdot 10^{-149}:\\ \;\;\;\;\frac{x \cdot t}{z - y}\\ \mathbf{elif}\;y \leq 1.86 \cdot 10^{-88}:\\ \;\;\;\;\left(x - y\right) \cdot \frac{t}{z}\\ \mathbf{elif}\;y \leq 1.85 \cdot 10^{-48}:\\ \;\;\;\;t \cdot \frac{x}{z - y}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{y}{y - z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 59.0% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -9 \cdot 10^{+148}:\\
\;\;\;\;t\\

\mathbf{elif}\;y \leq -4.2 \cdot 10^{-15}:\\
\;\;\;\;\frac{y}{z} \cdot \left(-t\right)\\

\mathbf{elif}\;y \leq -7 \cdot 10^{-30}:\\
\;\;\;\;t\\

\mathbf{elif}\;y \leq 3.3 \cdot 10^{-48}:\\
\;\;\;\;t \cdot \frac{x}{z}\\

\mathbf{else}:\\
\;\;\;\;t\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -8.99999999999999987e148 or -4.19999999999999962e-15 < y < -7.0000000000000006e-30 or 3.3e-48 < y

    1. Initial program 99.6%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Step-by-step derivation
      1. associate-*l/67.6%

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

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

      \[\leadsto \color{blue}{\left(x - y\right) \cdot \frac{t}{z - y}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around inf 72.0%

      \[\leadsto \color{blue}{t} \]

    if -8.99999999999999987e148 < y < -4.19999999999999962e-15

    1. Initial program 100.0%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Step-by-step derivation
      1. associate-*l/82.8%

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

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

      \[\leadsto \color{blue}{\left(x - y\right) \cdot \frac{t}{z - y}} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf 50.7%

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

      \[\leadsto \color{blue}{-1 \cdot \frac{t \cdot y}{z}} \]
    7. Step-by-step derivation
      1. mul-1-neg39.4%

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

        \[\leadsto -\color{blue}{t \cdot \frac{y}{z}} \]
    8. Simplified42.2%

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

    if -7.0000000000000006e-30 < y < 3.3e-48

    1. Initial program 93.6%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0 74.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -9 \cdot 10^{+148}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq -4.2 \cdot 10^{-15}:\\ \;\;\;\;\frac{y}{z} \cdot \left(-t\right)\\ \mathbf{elif}\;y \leq -7 \cdot 10^{-30}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq 3.3 \cdot 10^{-48}:\\ \;\;\;\;t \cdot \frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 68.6% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.75 \cdot 10^{+148}:\\
\;\;\;\;t\\

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

\mathbf{elif}\;y \leq 7 \cdot 10^{+72}:\\
\;\;\;\;t \cdot \frac{x}{z - y}\\

\mathbf{else}:\\
\;\;\;\;t\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.7499999999999999e148 or 7.0000000000000002e72 < y

    1. Initial program 99.9%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Step-by-step derivation
      1. associate-*l/58.6%

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

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

      \[\leadsto \color{blue}{\left(x - y\right) \cdot \frac{t}{z - y}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around inf 81.9%

      \[\leadsto \color{blue}{t} \]

    if -1.7499999999999999e148 < y < -3.8e-27

    1. Initial program 99.2%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf 55.1%

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

    if -3.8e-27 < y < 7.0000000000000002e72

    1. Initial program 94.7%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 76.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.75 \cdot 10^{+148}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq -3.8 \cdot 10^{-27}:\\ \;\;\;\;t \cdot \frac{x - y}{z}\\ \mathbf{elif}\;y \leq 7 \cdot 10^{+72}:\\ \;\;\;\;t \cdot \frac{x}{z - y}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 90.0% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.6 \cdot 10^{+149} \lor \neg \left(y \leq 6.4 \cdot 10^{+205}\right):\\
\;\;\;\;t \cdot \frac{y}{y - z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -4.5999999999999997e149 or 6.39999999999999993e205 < y

    1. Initial program 100.0%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0 96.0%

      \[\leadsto \color{blue}{\left(-1 \cdot \frac{y}{z - y}\right)} \cdot t \]
    4. Step-by-step derivation
      1. neg-mul-196.0%

        \[\leadsto \color{blue}{\left(-\frac{y}{z - y}\right)} \cdot t \]
      2. distribute-neg-frac96.0%

        \[\leadsto \color{blue}{\frac{-y}{z - y}} \cdot t \]
    5. Simplified96.0%

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

    if -4.5999999999999997e149 < y < 6.39999999999999993e205

    1. Initial program 96.3%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Step-by-step derivation
      1. associate-*l/86.8%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -4.6 \cdot 10^{+149} \lor \neg \left(y \leq 6.4 \cdot 10^{+205}\right):\\ \;\;\;\;t \cdot \frac{y}{y - z}\\ \mathbf{else}:\\ \;\;\;\;\left(y - x\right) \cdot \frac{t}{y - z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 66.0% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.65 \cdot 10^{+148}:\\
\;\;\;\;t\\

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

\mathbf{else}:\\
\;\;\;\;t\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.65000000000000005e148 or 7.60000000000000012e72 < y

    1. Initial program 99.9%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Step-by-step derivation
      1. associate-*l/58.6%

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

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

      \[\leadsto \color{blue}{\left(x - y\right) \cdot \frac{t}{z - y}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around inf 81.9%

      \[\leadsto \color{blue}{t} \]

    if -1.65000000000000005e148 < y < 7.60000000000000012e72

    1. Initial program 95.6%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Step-by-step derivation
      1. associate-*l/90.8%

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

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

      \[\leadsto \color{blue}{\left(x - y\right) \cdot \frac{t}{z - y}} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf 68.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.65 \cdot 10^{+148}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq 7.6 \cdot 10^{+72}:\\ \;\;\;\;\left(x - y\right) \cdot \frac{t}{z}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 59.8% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.2 \cdot 10^{-30}:\\
\;\;\;\;t\\

\mathbf{elif}\;y \leq 2.65 \cdot 10^{-48}:\\
\;\;\;\;x \cdot \frac{t}{z}\\

\mathbf{else}:\\
\;\;\;\;t\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -4.2000000000000004e-30 or 2.65e-48 < y

    1. Initial program 99.7%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Step-by-step derivation
      1. associate-*l/71.1%

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

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

      \[\leadsto \color{blue}{\left(x - y\right) \cdot \frac{t}{z - y}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around inf 61.0%

      \[\leadsto \color{blue}{t} \]

    if -4.2000000000000004e-30 < y < 2.65e-48

    1. Initial program 93.6%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Step-by-step derivation
      1. associate-*l/91.9%

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

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

      \[\leadsto \color{blue}{\left(x - y\right) \cdot \frac{t}{z - y}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around 0 72.3%

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

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

        \[\leadsto \color{blue}{x \cdot \frac{t}{z}} \]
    7. Simplified74.3%

      \[\leadsto \color{blue}{x \cdot \frac{t}{z}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification66.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -4.2 \cdot 10^{-30}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq 2.65 \cdot 10^{-48}:\\ \;\;\;\;x \cdot \frac{t}{z}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 60.5% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.2 \cdot 10^{-30}:\\
\;\;\;\;t\\

\mathbf{elif}\;y \leq 3.3 \cdot 10^{-48}:\\
\;\;\;\;t \cdot \frac{x}{z}\\

\mathbf{else}:\\
\;\;\;\;t\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -5.19999999999999973e-30 or 3.3e-48 < y

    1. Initial program 99.7%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Step-by-step derivation
      1. associate-*l/71.1%

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

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

      \[\leadsto \color{blue}{\left(x - y\right) \cdot \frac{t}{z - y}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around inf 61.0%

      \[\leadsto \color{blue}{t} \]

    if -5.19999999999999973e-30 < y < 3.3e-48

    1. Initial program 93.6%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0 74.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -5.2 \cdot 10^{-30}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq 3.3 \cdot 10^{-48}:\\ \;\;\;\;t \cdot \frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 34.7% accurate, 9.0× speedup?

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

\\
t
\end{array}
Derivation
  1. Initial program 97.1%

    \[\frac{x - y}{z - y} \cdot t \]
  2. Step-by-step derivation
    1. associate-*l/80.0%

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

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

    \[\leadsto \color{blue}{\left(x - y\right) \cdot \frac{t}{z - y}} \]
  4. Add Preprocessing
  5. Taylor expanded in y around inf 38.2%

    \[\leadsto \color{blue}{t} \]
  6. Final simplification38.2%

    \[\leadsto t \]
  7. Add Preprocessing

Developer target: 97.0% accurate, 1.0× speedup?

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

\\
\frac{t}{\frac{z - y}{x - y}}
\end{array}

Reproduce

?
herbie shell --seed 2024045 
(FPCore (x y z t)
  :name "Numeric.Signal.Multichannel:$cput from hsignal-0.2.7.1"
  :precision binary64

  :herbie-target
  (/ t (/ (- z y) (- x y)))

  (* (/ (- x y) (- z y)) t))