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

Percentage Accurate: 97.1% → 97.1%
Time: 9.8s
Alternatives: 14
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 14 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: 97.1% 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: 97.1% 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.0%

    \[\frac{x - y}{z - y} \cdot t \]
  2. Final simplification97.0%

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

Alternative 2: 73.3% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := t \cdot \frac{y - x}{y}\\ t_2 := t \cdot \frac{y}{y - z}\\ \mathbf{if}\;y \leq -1.75 \cdot 10^{+84}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq -2 \cdot 10^{+29}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -1.85 \cdot 10^{+26}:\\ \;\;\;\;\left(x - y\right) \cdot \frac{t}{z}\\ \mathbf{elif}\;y \leq -2.8 \cdot 10^{-44}:\\ \;\;\;\;x \cdot \frac{t}{z - y}\\ \mathbf{elif}\;y \leq -3.65 \cdot 10^{-87}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq -8.5 \cdot 10^{-109}:\\ \;\;\;\;\frac{t}{\frac{z}{x - y}}\\ \mathbf{elif}\;y \leq -4.7 \cdot 10^{-194}:\\ \;\;\;\;t \cdot \frac{x}{z - y}\\ \mathbf{elif}\;y \leq 1.1 \cdot 10^{+38}:\\ \;\;\;\;\frac{\left(x - y\right) \cdot t}{z}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* t (/ (- y x) y))) (t_2 (* t (/ y (- y z)))))
   (if (<= y -1.75e+84)
     t_2
     (if (<= y -2e+29)
       t_1
       (if (<= y -1.85e+26)
         (* (- x y) (/ t z))
         (if (<= y -2.8e-44)
           (* x (/ t (- z y)))
           (if (<= y -3.65e-87)
             t_2
             (if (<= y -8.5e-109)
               (/ t (/ z (- x y)))
               (if (<= y -4.7e-194)
                 (* t (/ x (- z y)))
                 (if (<= y 1.1e+38) (/ (* (- x y) t) z) t_1))))))))))
double code(double x, double y, double z, double t) {
	double t_1 = t * ((y - x) / y);
	double t_2 = t * (y / (y - z));
	double tmp;
	if (y <= -1.75e+84) {
		tmp = t_2;
	} else if (y <= -2e+29) {
		tmp = t_1;
	} else if (y <= -1.85e+26) {
		tmp = (x - y) * (t / z);
	} else if (y <= -2.8e-44) {
		tmp = x * (t / (z - y));
	} else if (y <= -3.65e-87) {
		tmp = t_2;
	} else if (y <= -8.5e-109) {
		tmp = t / (z / (x - y));
	} else if (y <= -4.7e-194) {
		tmp = t * (x / (z - y));
	} else if (y <= 1.1e+38) {
		tmp = ((x - y) * t) / z;
	} 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) :: t_2
    real(8) :: tmp
    t_1 = t * ((y - x) / y)
    t_2 = t * (y / (y - z))
    if (y <= (-1.75d+84)) then
        tmp = t_2
    else if (y <= (-2d+29)) then
        tmp = t_1
    else if (y <= (-1.85d+26)) then
        tmp = (x - y) * (t / z)
    else if (y <= (-2.8d-44)) then
        tmp = x * (t / (z - y))
    else if (y <= (-3.65d-87)) then
        tmp = t_2
    else if (y <= (-8.5d-109)) then
        tmp = t / (z / (x - y))
    else if (y <= (-4.7d-194)) then
        tmp = t * (x / (z - y))
    else if (y <= 1.1d+38) then
        tmp = ((x - y) * t) / z
    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 - x) / y);
	double t_2 = t * (y / (y - z));
	double tmp;
	if (y <= -1.75e+84) {
		tmp = t_2;
	} else if (y <= -2e+29) {
		tmp = t_1;
	} else if (y <= -1.85e+26) {
		tmp = (x - y) * (t / z);
	} else if (y <= -2.8e-44) {
		tmp = x * (t / (z - y));
	} else if (y <= -3.65e-87) {
		tmp = t_2;
	} else if (y <= -8.5e-109) {
		tmp = t / (z / (x - y));
	} else if (y <= -4.7e-194) {
		tmp = t * (x / (z - y));
	} else if (y <= 1.1e+38) {
		tmp = ((x - y) * t) / z;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = t * ((y - x) / y)
	t_2 = t * (y / (y - z))
	tmp = 0
	if y <= -1.75e+84:
		tmp = t_2
	elif y <= -2e+29:
		tmp = t_1
	elif y <= -1.85e+26:
		tmp = (x - y) * (t / z)
	elif y <= -2.8e-44:
		tmp = x * (t / (z - y))
	elif y <= -3.65e-87:
		tmp = t_2
	elif y <= -8.5e-109:
		tmp = t / (z / (x - y))
	elif y <= -4.7e-194:
		tmp = t * (x / (z - y))
	elif y <= 1.1e+38:
		tmp = ((x - y) * t) / z
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(t * Float64(Float64(y - x) / y))
	t_2 = Float64(t * Float64(y / Float64(y - z)))
	tmp = 0.0
	if (y <= -1.75e+84)
		tmp = t_2;
	elseif (y <= -2e+29)
		tmp = t_1;
	elseif (y <= -1.85e+26)
		tmp = Float64(Float64(x - y) * Float64(t / z));
	elseif (y <= -2.8e-44)
		tmp = Float64(x * Float64(t / Float64(z - y)));
	elseif (y <= -3.65e-87)
		tmp = t_2;
	elseif (y <= -8.5e-109)
		tmp = Float64(t / Float64(z / Float64(x - y)));
	elseif (y <= -4.7e-194)
		tmp = Float64(t * Float64(x / Float64(z - y)));
	elseif (y <= 1.1e+38)
		tmp = Float64(Float64(Float64(x - y) * t) / z);
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = t * ((y - x) / y);
	t_2 = t * (y / (y - z));
	tmp = 0.0;
	if (y <= -1.75e+84)
		tmp = t_2;
	elseif (y <= -2e+29)
		tmp = t_1;
	elseif (y <= -1.85e+26)
		tmp = (x - y) * (t / z);
	elseif (y <= -2.8e-44)
		tmp = x * (t / (z - y));
	elseif (y <= -3.65e-87)
		tmp = t_2;
	elseif (y <= -8.5e-109)
		tmp = t / (z / (x - y));
	elseif (y <= -4.7e-194)
		tmp = t * (x / (z - y));
	elseif (y <= 1.1e+38)
		tmp = ((x - y) * t) / z;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(t * N[(N[(y - x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t * N[(y / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.75e+84], t$95$2, If[LessEqual[y, -2e+29], t$95$1, If[LessEqual[y, -1.85e+26], N[(N[(x - y), $MachinePrecision] * N[(t / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -2.8e-44], N[(x * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -3.65e-87], t$95$2, If[LessEqual[y, -8.5e-109], N[(t / N[(z / N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -4.7e-194], N[(t * N[(x / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.1e+38], N[(N[(N[(x - y), $MachinePrecision] * t), $MachinePrecision] / z), $MachinePrecision], t$95$1]]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq -2 \cdot 10^{+29}:\\
\;\;\;\;t_1\\

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

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

\mathbf{elif}\;y \leq -3.65 \cdot 10^{-87}:\\
\;\;\;\;t_2\\

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

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

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

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 7 regimes
  2. if y < -1.7499999999999999e84 or -2.8e-44 < y < -3.64999999999999984e-87

    1. Initial program 99.9%

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

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

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

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

      \[\leadsto \color{blue}{\frac{-y}{z - y}} \cdot t \]
    5. Step-by-step derivation
      1. frac-2neg86.1%

        \[\leadsto \color{blue}{\frac{-\left(-y\right)}{-\left(z - y\right)}} \cdot t \]
      2. div-inv85.9%

        \[\leadsto \color{blue}{\left(\left(-\left(-y\right)\right) \cdot \frac{1}{-\left(z - y\right)}\right)} \cdot t \]
      3. remove-double-neg85.9%

        \[\leadsto \left(\color{blue}{y} \cdot \frac{1}{-\left(z - y\right)}\right) \cdot t \]
      4. sub-neg85.9%

        \[\leadsto \left(y \cdot \frac{1}{-\color{blue}{\left(z + \left(-y\right)\right)}}\right) \cdot t \]
      5. distribute-neg-in85.9%

        \[\leadsto \left(y \cdot \frac{1}{\color{blue}{\left(-z\right) + \left(-\left(-y\right)\right)}}\right) \cdot t \]
      6. remove-double-neg85.9%

        \[\leadsto \left(y \cdot \frac{1}{\left(-z\right) + \color{blue}{y}}\right) \cdot t \]
      7. +-commutative85.9%

        \[\leadsto \left(y \cdot \frac{1}{\color{blue}{y + \left(-z\right)}}\right) \cdot t \]
      8. sub-neg85.9%

        \[\leadsto \left(y \cdot \frac{1}{\color{blue}{y - z}}\right) \cdot t \]
    6. Applied egg-rr85.9%

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

        \[\leadsto \color{blue}{\frac{y \cdot 1}{y - z}} \cdot t \]
      2. *-rgt-identity86.1%

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

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

    if -1.7499999999999999e84 < y < -1.99999999999999983e29 or 1.10000000000000003e38 < y

    1. Initial program 99.9%

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

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

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

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

        \[\leadsto \frac{\color{blue}{0 - \left(x - y\right)}}{y} \cdot t \]
      4. associate--r-87.2%

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

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

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

    if -1.99999999999999983e29 < y < -1.84999999999999994e26

    1. Initial program 99.6%

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

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

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

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

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

    if -1.84999999999999994e26 < y < -2.8e-44

    1. Initial program 89.8%

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

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

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

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

      \[\leadsto \color{blue}{\frac{t \cdot x}{z - y}} \]
    5. Step-by-step derivation
      1. associate-*l/80.9%

        \[\leadsto \color{blue}{\frac{t}{z - y} \cdot x} \]
      2. *-commutative80.9%

        \[\leadsto \color{blue}{x \cdot \frac{t}{z - y}} \]
    6. Simplified80.9%

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

    if -3.64999999999999984e-87 < y < -8.50000000000000005e-109

    1. Initial program 99.1%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{t}{\frac{z}{x - y}}} \]
    6. Simplified100.0%

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

    if -8.50000000000000005e-109 < y < -4.7000000000000003e-194

    1. Initial program 95.8%

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

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

    if -4.7000000000000003e-194 < y < 1.10000000000000003e38

    1. Initial program 92.9%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.75 \cdot 10^{+84}:\\ \;\;\;\;t \cdot \frac{y}{y - z}\\ \mathbf{elif}\;y \leq -2 \cdot 10^{+29}:\\ \;\;\;\;t \cdot \frac{y - x}{y}\\ \mathbf{elif}\;y \leq -1.85 \cdot 10^{+26}:\\ \;\;\;\;\left(x - y\right) \cdot \frac{t}{z}\\ \mathbf{elif}\;y \leq -2.8 \cdot 10^{-44}:\\ \;\;\;\;x \cdot \frac{t}{z - y}\\ \mathbf{elif}\;y \leq -3.65 \cdot 10^{-87}:\\ \;\;\;\;t \cdot \frac{y}{y - z}\\ \mathbf{elif}\;y \leq -8.5 \cdot 10^{-109}:\\ \;\;\;\;\frac{t}{\frac{z}{x - y}}\\ \mathbf{elif}\;y \leq -4.7 \cdot 10^{-194}:\\ \;\;\;\;t \cdot \frac{x}{z - y}\\ \mathbf{elif}\;y \leq 1.1 \cdot 10^{+38}:\\ \;\;\;\;\frac{\left(x - y\right) \cdot t}{z}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{y - x}{y}\\ \end{array} \]

Alternative 3: 75.1% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := t \cdot \frac{x}{z - y}\\ t_2 := t \cdot \frac{y}{y - z}\\ \mathbf{if}\;y \leq -7.5 \cdot 10^{+78}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq -9.8 \cdot 10^{-230}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 8.8 \cdot 10^{-304}:\\ \;\;\;\;\left(x - y\right) \cdot \frac{t}{z}\\ \mathbf{elif}\;y \leq 2.7 \cdot 10^{-205}:\\ \;\;\;\;\frac{x \cdot t}{z - y}\\ \mathbf{elif}\;y \leq 2.6 \cdot 10^{-110}:\\ \;\;\;\;\frac{t}{\frac{z}{x - y}}\\ \mathbf{elif}\;y \leq 7.5 \cdot 10^{+73}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* t (/ x (- z y)))) (t_2 (* t (/ y (- y z)))))
   (if (<= y -7.5e+78)
     t_2
     (if (<= y -9.8e-230)
       t_1
       (if (<= y 8.8e-304)
         (* (- x y) (/ t z))
         (if (<= y 2.7e-205)
           (/ (* x t) (- z y))
           (if (<= y 2.6e-110)
             (/ t (/ z (- x y)))
             (if (<= y 7.5e+73) t_1 t_2))))))))
double code(double x, double y, double z, double t) {
	double t_1 = t * (x / (z - y));
	double t_2 = t * (y / (y - z));
	double tmp;
	if (y <= -7.5e+78) {
		tmp = t_2;
	} else if (y <= -9.8e-230) {
		tmp = t_1;
	} else if (y <= 8.8e-304) {
		tmp = (x - y) * (t / z);
	} else if (y <= 2.7e-205) {
		tmp = (x * t) / (z - y);
	} else if (y <= 2.6e-110) {
		tmp = t / (z / (x - y));
	} else if (y <= 7.5e+73) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = t * (x / (z - y))
    t_2 = t * (y / (y - z))
    if (y <= (-7.5d+78)) then
        tmp = t_2
    else if (y <= (-9.8d-230)) then
        tmp = t_1
    else if (y <= 8.8d-304) then
        tmp = (x - y) * (t / z)
    else if (y <= 2.7d-205) then
        tmp = (x * t) / (z - y)
    else if (y <= 2.6d-110) then
        tmp = t / (z / (x - y))
    else if (y <= 7.5d+73) then
        tmp = t_1
    else
        tmp = t_2
    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 t_2 = t * (y / (y - z));
	double tmp;
	if (y <= -7.5e+78) {
		tmp = t_2;
	} else if (y <= -9.8e-230) {
		tmp = t_1;
	} else if (y <= 8.8e-304) {
		tmp = (x - y) * (t / z);
	} else if (y <= 2.7e-205) {
		tmp = (x * t) / (z - y);
	} else if (y <= 2.6e-110) {
		tmp = t / (z / (x - y));
	} else if (y <= 7.5e+73) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = t * (x / (z - y))
	t_2 = t * (y / (y - z))
	tmp = 0
	if y <= -7.5e+78:
		tmp = t_2
	elif y <= -9.8e-230:
		tmp = t_1
	elif y <= 8.8e-304:
		tmp = (x - y) * (t / z)
	elif y <= 2.7e-205:
		tmp = (x * t) / (z - y)
	elif y <= 2.6e-110:
		tmp = t / (z / (x - y))
	elif y <= 7.5e+73:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t)
	t_1 = Float64(t * Float64(x / Float64(z - y)))
	t_2 = Float64(t * Float64(y / Float64(y - z)))
	tmp = 0.0
	if (y <= -7.5e+78)
		tmp = t_2;
	elseif (y <= -9.8e-230)
		tmp = t_1;
	elseif (y <= 8.8e-304)
		tmp = Float64(Float64(x - y) * Float64(t / z));
	elseif (y <= 2.7e-205)
		tmp = Float64(Float64(x * t) / Float64(z - y));
	elseif (y <= 2.6e-110)
		tmp = Float64(t / Float64(z / Float64(x - y)));
	elseif (y <= 7.5e+73)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = t * (x / (z - y));
	t_2 = t * (y / (y - z));
	tmp = 0.0;
	if (y <= -7.5e+78)
		tmp = t_2;
	elseif (y <= -9.8e-230)
		tmp = t_1;
	elseif (y <= 8.8e-304)
		tmp = (x - y) * (t / z);
	elseif (y <= 2.7e-205)
		tmp = (x * t) / (z - y);
	elseif (y <= 2.6e-110)
		tmp = t / (z / (x - y));
	elseif (y <= 7.5e+73)
		tmp = t_1;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(t * N[(x / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t * N[(y / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -7.5e+78], t$95$2, If[LessEqual[y, -9.8e-230], t$95$1, If[LessEqual[y, 8.8e-304], N[(N[(x - y), $MachinePrecision] * N[(t / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.7e-205], N[(N[(x * t), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.6e-110], N[(t / N[(z / N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7.5e+73], t$95$1, t$95$2]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq -9.8 \cdot 10^{-230}:\\
\;\;\;\;t_1\\

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

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

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

\mathbf{elif}\;y \leq 7.5 \cdot 10^{+73}:\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;t_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if y < -7.49999999999999934e78 or 7.5e73 < y

    1. Initial program 99.9%

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

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

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

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

      \[\leadsto \color{blue}{\frac{-y}{z - y}} \cdot t \]
    5. Step-by-step derivation
      1. frac-2neg84.1%

        \[\leadsto \color{blue}{\frac{-\left(-y\right)}{-\left(z - y\right)}} \cdot t \]
      2. div-inv83.9%

        \[\leadsto \color{blue}{\left(\left(-\left(-y\right)\right) \cdot \frac{1}{-\left(z - y\right)}\right)} \cdot t \]
      3. remove-double-neg83.9%

        \[\leadsto \left(\color{blue}{y} \cdot \frac{1}{-\left(z - y\right)}\right) \cdot t \]
      4. sub-neg83.9%

        \[\leadsto \left(y \cdot \frac{1}{-\color{blue}{\left(z + \left(-y\right)\right)}}\right) \cdot t \]
      5. distribute-neg-in83.9%

        \[\leadsto \left(y \cdot \frac{1}{\color{blue}{\left(-z\right) + \left(-\left(-y\right)\right)}}\right) \cdot t \]
      6. remove-double-neg83.9%

        \[\leadsto \left(y \cdot \frac{1}{\left(-z\right) + \color{blue}{y}}\right) \cdot t \]
      7. +-commutative83.9%

        \[\leadsto \left(y \cdot \frac{1}{\color{blue}{y + \left(-z\right)}}\right) \cdot t \]
      8. sub-neg83.9%

        \[\leadsto \left(y \cdot \frac{1}{\color{blue}{y - z}}\right) \cdot t \]
    6. Applied egg-rr83.9%

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

        \[\leadsto \color{blue}{\frac{y \cdot 1}{y - z}} \cdot t \]
      2. *-rgt-identity84.1%

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

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

    if -7.49999999999999934e78 < y < -9.79999999999999984e-230 or 2.5999999999999999e-110 < y < 7.5e73

    1. Initial program 96.9%

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

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

    if -9.79999999999999984e-230 < y < 8.799999999999999e-304

    1. Initial program 85.0%

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

        \[\leadsto \color{blue}{\frac{\left(x - y\right) \cdot t}{z - y}} \]
      2. associate-*r/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. Taylor expanded in z around inf 99.8%

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

    if 8.799999999999999e-304 < y < 2.7000000000000001e-205

    1. Initial program 85.2%

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

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

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

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

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

    if 2.7000000000000001e-205 < y < 2.5999999999999999e-110

    1. Initial program 99.9%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{t}{\frac{z}{x - y}}} \]
    6. Simplified94.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -7.5 \cdot 10^{+78}:\\ \;\;\;\;t \cdot \frac{y}{y - z}\\ \mathbf{elif}\;y \leq -9.8 \cdot 10^{-230}:\\ \;\;\;\;t \cdot \frac{x}{z - y}\\ \mathbf{elif}\;y \leq 8.8 \cdot 10^{-304}:\\ \;\;\;\;\left(x - y\right) \cdot \frac{t}{z}\\ \mathbf{elif}\;y \leq 2.7 \cdot 10^{-205}:\\ \;\;\;\;\frac{x \cdot t}{z - y}\\ \mathbf{elif}\;y \leq 2.6 \cdot 10^{-110}:\\ \;\;\;\;\frac{t}{\frac{z}{x - y}}\\ \mathbf{elif}\;y \leq 7.5 \cdot 10^{+73}:\\ \;\;\;\;t \cdot \frac{x}{z - y}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{y}{y - z}\\ \end{array} \]

Alternative 4: 69.4% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := t \cdot \frac{x}{z - y}\\ \mathbf{if}\;y \leq -4.5 \cdot 10^{+92}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq -8.5 \cdot 10^{-229}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 8 \cdot 10^{-110}:\\ \;\;\;\;\left(x - y\right) \cdot \frac{t}{z}\\ \mathbf{elif}\;y \leq 2.2 \cdot 10^{+75}:\\ \;\;\;\;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 -4.5e+92)
     t
     (if (<= y -8.5e-229)
       t_1
       (if (<= y 8e-110) (* (- x y) (/ t z)) (if (<= y 2.2e+75) t_1 t))))))
double code(double x, double y, double z, double t) {
	double t_1 = t * (x / (z - y));
	double tmp;
	if (y <= -4.5e+92) {
		tmp = t;
	} else if (y <= -8.5e-229) {
		tmp = t_1;
	} else if (y <= 8e-110) {
		tmp = (x - y) * (t / z);
	} else if (y <= 2.2e+75) {
		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 <= (-4.5d+92)) then
        tmp = t
    else if (y <= (-8.5d-229)) then
        tmp = t_1
    else if (y <= 8d-110) then
        tmp = (x - y) * (t / z)
    else if (y <= 2.2d+75) 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 <= -4.5e+92) {
		tmp = t;
	} else if (y <= -8.5e-229) {
		tmp = t_1;
	} else if (y <= 8e-110) {
		tmp = (x - y) * (t / z);
	} else if (y <= 2.2e+75) {
		tmp = t_1;
	} else {
		tmp = t;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = t * (x / (z - y))
	tmp = 0
	if y <= -4.5e+92:
		tmp = t
	elif y <= -8.5e-229:
		tmp = t_1
	elif y <= 8e-110:
		tmp = (x - y) * (t / z)
	elif y <= 2.2e+75:
		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 <= -4.5e+92)
		tmp = t;
	elseif (y <= -8.5e-229)
		tmp = t_1;
	elseif (y <= 8e-110)
		tmp = Float64(Float64(x - y) * Float64(t / z));
	elseif (y <= 2.2e+75)
		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 <= -4.5e+92)
		tmp = t;
	elseif (y <= -8.5e-229)
		tmp = t_1;
	elseif (y <= 8e-110)
		tmp = (x - y) * (t / z);
	elseif (y <= 2.2e+75)
		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, -4.5e+92], t, If[LessEqual[y, -8.5e-229], t$95$1, If[LessEqual[y, 8e-110], N[(N[(x - y), $MachinePrecision] * N[(t / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.2e+75], t$95$1, t]]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq -8.5 \cdot 10^{-229}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;y \leq 2.2 \cdot 10^{+75}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -4.4999999999999999e92 or 2.20000000000000012e75 < y

    1. Initial program 99.9%

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

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

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

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

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

    if -4.4999999999999999e92 < y < -8.49999999999999977e-229 or 8.0000000000000004e-110 < y < 2.20000000000000012e75

    1. Initial program 97.0%

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

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

    if -8.49999999999999977e-229 < y < 8.0000000000000004e-110

    1. Initial program 91.1%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -4.5 \cdot 10^{+92}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq -8.5 \cdot 10^{-229}:\\ \;\;\;\;t \cdot \frac{x}{z - y}\\ \mathbf{elif}\;y \leq 8 \cdot 10^{-110}:\\ \;\;\;\;\left(x - y\right) \cdot \frac{t}{z}\\ \mathbf{elif}\;y \leq 2.2 \cdot 10^{+75}:\\ \;\;\;\;t \cdot \frac{x}{z - y}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]

Alternative 5: 74.7% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := t \cdot \frac{x}{z - y}\\ t_2 := t \cdot \frac{y}{y - z}\\ \mathbf{if}\;y \leq -1 \cdot 10^{+79}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq -2.4 \cdot 10^{-228}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 9 \cdot 10^{-108}:\\ \;\;\;\;\left(x - y\right) \cdot \frac{t}{z}\\ \mathbf{elif}\;y \leq 5.4 \cdot 10^{+73}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* t (/ x (- z y)))) (t_2 (* t (/ y (- y z)))))
   (if (<= y -1e+79)
     t_2
     (if (<= y -2.4e-228)
       t_1
       (if (<= y 9e-108) (* (- x y) (/ t z)) (if (<= y 5.4e+73) t_1 t_2))))))
double code(double x, double y, double z, double t) {
	double t_1 = t * (x / (z - y));
	double t_2 = t * (y / (y - z));
	double tmp;
	if (y <= -1e+79) {
		tmp = t_2;
	} else if (y <= -2.4e-228) {
		tmp = t_1;
	} else if (y <= 9e-108) {
		tmp = (x - y) * (t / z);
	} else if (y <= 5.4e+73) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = t * (x / (z - y))
    t_2 = t * (y / (y - z))
    if (y <= (-1d+79)) then
        tmp = t_2
    else if (y <= (-2.4d-228)) then
        tmp = t_1
    else if (y <= 9d-108) then
        tmp = (x - y) * (t / z)
    else if (y <= 5.4d+73) then
        tmp = t_1
    else
        tmp = t_2
    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 t_2 = t * (y / (y - z));
	double tmp;
	if (y <= -1e+79) {
		tmp = t_2;
	} else if (y <= -2.4e-228) {
		tmp = t_1;
	} else if (y <= 9e-108) {
		tmp = (x - y) * (t / z);
	} else if (y <= 5.4e+73) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = t * (x / (z - y))
	t_2 = t * (y / (y - z))
	tmp = 0
	if y <= -1e+79:
		tmp = t_2
	elif y <= -2.4e-228:
		tmp = t_1
	elif y <= 9e-108:
		tmp = (x - y) * (t / z)
	elif y <= 5.4e+73:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t)
	t_1 = Float64(t * Float64(x / Float64(z - y)))
	t_2 = Float64(t * Float64(y / Float64(y - z)))
	tmp = 0.0
	if (y <= -1e+79)
		tmp = t_2;
	elseif (y <= -2.4e-228)
		tmp = t_1;
	elseif (y <= 9e-108)
		tmp = Float64(Float64(x - y) * Float64(t / z));
	elseif (y <= 5.4e+73)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = t * (x / (z - y));
	t_2 = t * (y / (y - z));
	tmp = 0.0;
	if (y <= -1e+79)
		tmp = t_2;
	elseif (y <= -2.4e-228)
		tmp = t_1;
	elseif (y <= 9e-108)
		tmp = (x - y) * (t / z);
	elseif (y <= 5.4e+73)
		tmp = t_1;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(t * N[(x / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t * N[(y / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1e+79], t$95$2, If[LessEqual[y, -2.4e-228], t$95$1, If[LessEqual[y, 9e-108], N[(N[(x - y), $MachinePrecision] * N[(t / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.4e+73], t$95$1, t$95$2]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq -2.4 \cdot 10^{-228}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;y \leq 5.4 \cdot 10^{+73}:\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;t_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -9.99999999999999967e78 or 5.3999999999999998e73 < y

    1. Initial program 99.9%

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

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

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

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

      \[\leadsto \color{blue}{\frac{-y}{z - y}} \cdot t \]
    5. Step-by-step derivation
      1. frac-2neg84.1%

        \[\leadsto \color{blue}{\frac{-\left(-y\right)}{-\left(z - y\right)}} \cdot t \]
      2. div-inv83.9%

        \[\leadsto \color{blue}{\left(\left(-\left(-y\right)\right) \cdot \frac{1}{-\left(z - y\right)}\right)} \cdot t \]
      3. remove-double-neg83.9%

        \[\leadsto \left(\color{blue}{y} \cdot \frac{1}{-\left(z - y\right)}\right) \cdot t \]
      4. sub-neg83.9%

        \[\leadsto \left(y \cdot \frac{1}{-\color{blue}{\left(z + \left(-y\right)\right)}}\right) \cdot t \]
      5. distribute-neg-in83.9%

        \[\leadsto \left(y \cdot \frac{1}{\color{blue}{\left(-z\right) + \left(-\left(-y\right)\right)}}\right) \cdot t \]
      6. remove-double-neg83.9%

        \[\leadsto \left(y \cdot \frac{1}{\left(-z\right) + \color{blue}{y}}\right) \cdot t \]
      7. +-commutative83.9%

        \[\leadsto \left(y \cdot \frac{1}{\color{blue}{y + \left(-z\right)}}\right) \cdot t \]
      8. sub-neg83.9%

        \[\leadsto \left(y \cdot \frac{1}{\color{blue}{y - z}}\right) \cdot t \]
    6. Applied egg-rr83.9%

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

        \[\leadsto \color{blue}{\frac{y \cdot 1}{y - z}} \cdot t \]
      2. *-rgt-identity84.1%

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

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

    if -9.99999999999999967e78 < y < -2.40000000000000002e-228 or 8.99999999999999941e-108 < y < 5.3999999999999998e73

    1. Initial program 96.9%

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

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

    if -2.40000000000000002e-228 < y < 8.99999999999999941e-108

    1. Initial program 91.1%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1 \cdot 10^{+79}:\\ \;\;\;\;t \cdot \frac{y}{y - z}\\ \mathbf{elif}\;y \leq -2.4 \cdot 10^{-228}:\\ \;\;\;\;t \cdot \frac{x}{z - y}\\ \mathbf{elif}\;y \leq 9 \cdot 10^{-108}:\\ \;\;\;\;\left(x - y\right) \cdot \frac{t}{z}\\ \mathbf{elif}\;y \leq 5.4 \cdot 10^{+73}:\\ \;\;\;\;t \cdot \frac{x}{z - y}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{y}{y - z}\\ \end{array} \]

Alternative 6: 62.1% accurate, 0.7× speedup?

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

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

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

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

\mathbf{elif}\;y \leq 1.45 \cdot 10^{+38}:\\
\;\;\;\;t \cdot \frac{x}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -3.19999999999999973e30 or 1.45000000000000003e38 < y

    1. Initial program 99.9%

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

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

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

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

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

    if -3.19999999999999973e30 < y < -1.70000000000000008e-217

    1. Initial program 94.1%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{t}{\frac{z}{x}}} \]
    6. Simplified54.9%

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

    if -1.70000000000000008e-217 < y < 6.99999999999999979e-206

    1. Initial program 85.9%

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

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

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

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

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

    if 6.99999999999999979e-206 < y < 1.45000000000000003e38

    1. Initial program 99.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.2 \cdot 10^{+30}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq -1.7 \cdot 10^{-217}:\\ \;\;\;\;\frac{t}{\frac{z}{x}}\\ \mathbf{elif}\;y \leq 7 \cdot 10^{-206}:\\ \;\;\;\;\frac{x \cdot t}{z}\\ \mathbf{elif}\;y \leq 1.45 \cdot 10^{+38}:\\ \;\;\;\;t \cdot \frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]

Alternative 7: 60.6% accurate, 0.7× speedup?

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

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

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

\mathbf{elif}\;y \leq -5.5 \cdot 10^{-57}:\\
\;\;\;\;x \cdot \frac{-t}{y}\\

\mathbf{elif}\;y \leq 1.4 \cdot 10^{+38}:\\
\;\;\;\;\frac{x \cdot t}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -3.19999999999999973e30 or 1.4e38 < y

    1. Initial program 99.9%

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

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

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

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

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

    if -3.19999999999999973e30 < y < -3.8000000000000003e-30

    1. Initial program 99.6%

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

      \[\leadsto \color{blue}{\frac{x}{z}} \cdot t \]
    3. Step-by-step derivation
      1. associate-*l/39.6%

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

        \[\leadsto \color{blue}{\frac{x}{\frac{z}{t}}} \]
    4. Applied egg-rr65.3%

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

    if -3.8000000000000003e-30 < y < -5.50000000000000011e-57

    1. Initial program 83.5%

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

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

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

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

      \[\leadsto \color{blue}{\frac{t \cdot x}{z - y}} \]
    5. Step-by-step derivation
      1. associate-*l/52.5%

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

        \[\leadsto \color{blue}{x \cdot \frac{t}{z - y}} \]
    6. Simplified52.5%

      \[\leadsto \color{blue}{x \cdot \frac{t}{z - y}} \]
    7. Taylor expanded in z around 0 52.6%

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

        \[\leadsto x \cdot \color{blue}{\frac{-1 \cdot t}{y}} \]
      2. neg-mul-152.6%

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

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

    if -5.50000000000000011e-57 < y < 1.4e38

    1. Initial program 93.9%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.2 \cdot 10^{+30}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq -3.8 \cdot 10^{-30}:\\ \;\;\;\;\frac{x}{\frac{z}{t}}\\ \mathbf{elif}\;y \leq -5.5 \cdot 10^{-57}:\\ \;\;\;\;x \cdot \frac{-t}{y}\\ \mathbf{elif}\;y \leq 1.4 \cdot 10^{+38}:\\ \;\;\;\;\frac{x \cdot t}{z}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]

Alternative 8: 60.7% accurate, 0.7× speedup?

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

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

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

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

\mathbf{elif}\;y \leq 1.45 \cdot 10^{+38}:\\
\;\;\;\;\frac{x \cdot t}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -2.2000000000000001e31 or 1.45000000000000003e38 < y

    1. Initial program 99.9%

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

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

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

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

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

    if -2.2000000000000001e31 < y < -4.7999999999999997e-30

    1. Initial program 99.6%

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

      \[\leadsto \color{blue}{\frac{x}{z}} \cdot t \]
    3. Step-by-step derivation
      1. associate-*l/39.6%

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

        \[\leadsto \color{blue}{\frac{x}{\frac{z}{t}}} \]
    4. Applied egg-rr65.3%

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

    if -4.7999999999999997e-30 < y < -3.9000000000000002e-53

    1. Initial program 83.5%

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

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

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

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

      \[\leadsto \color{blue}{\frac{t \cdot x}{z - y}} \]
    5. Step-by-step derivation
      1. associate-*l/52.5%

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

        \[\leadsto \color{blue}{x \cdot \frac{t}{z - y}} \]
    6. Simplified52.5%

      \[\leadsto \color{blue}{x \cdot \frac{t}{z - y}} \]
    7. Taylor expanded in z around 0 52.9%

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

        \[\leadsto \color{blue}{-\frac{t \cdot x}{y}} \]
      2. distribute-neg-frac52.9%

        \[\leadsto \color{blue}{\frac{-t \cdot x}{y}} \]
      3. distribute-rgt-neg-out52.9%

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

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

    if -3.9000000000000002e-53 < y < 1.45000000000000003e38

    1. Initial program 93.9%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.2 \cdot 10^{+31}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq -4.8 \cdot 10^{-30}:\\ \;\;\;\;\frac{x}{\frac{z}{t}}\\ \mathbf{elif}\;y \leq -3.9 \cdot 10^{-53}:\\ \;\;\;\;\frac{x \cdot \left(-t\right)}{y}\\ \mathbf{elif}\;y \leq 1.45 \cdot 10^{+38}:\\ \;\;\;\;\frac{x \cdot t}{z}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]

Alternative 9: 74.2% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := t \cdot \frac{y}{y - z}\\ \mathbf{if}\;y \leq -8 \cdot 10^{+78}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -1.4 \cdot 10^{-195}:\\ \;\;\;\;t \cdot \frac{x}{z - y}\\ \mathbf{elif}\;y \leq 1.4 \cdot 10^{+38}:\\ \;\;\;\;\frac{\left(x - y\right) \cdot t}{z}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* t (/ y (- y z)))))
   (if (<= y -8e+78)
     t_1
     (if (<= y -1.4e-195)
       (* t (/ x (- z y)))
       (if (<= y 1.4e+38) (/ (* (- x y) t) z) t_1)))))
double code(double x, double y, double z, double t) {
	double t_1 = t * (y / (y - z));
	double tmp;
	if (y <= -8e+78) {
		tmp = t_1;
	} else if (y <= -1.4e-195) {
		tmp = t * (x / (z - y));
	} else if (y <= 1.4e+38) {
		tmp = ((x - y) * t) / z;
	} 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 <= (-8d+78)) then
        tmp = t_1
    else if (y <= (-1.4d-195)) then
        tmp = t * (x / (z - y))
    else if (y <= 1.4d+38) then
        tmp = ((x - y) * t) / z
    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 <= -8e+78) {
		tmp = t_1;
	} else if (y <= -1.4e-195) {
		tmp = t * (x / (z - y));
	} else if (y <= 1.4e+38) {
		tmp = ((x - y) * t) / z;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = t * (y / (y - z))
	tmp = 0
	if y <= -8e+78:
		tmp = t_1
	elif y <= -1.4e-195:
		tmp = t * (x / (z - y))
	elif y <= 1.4e+38:
		tmp = ((x - y) * t) / z
	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 <= -8e+78)
		tmp = t_1;
	elseif (y <= -1.4e-195)
		tmp = Float64(t * Float64(x / Float64(z - y)));
	elseif (y <= 1.4e+38)
		tmp = Float64(Float64(Float64(x - y) * t) / z);
	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 <= -8e+78)
		tmp = t_1;
	elseif (y <= -1.4e-195)
		tmp = t * (x / (z - y));
	elseif (y <= 1.4e+38)
		tmp = ((x - y) * t) / z;
	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, -8e+78], t$95$1, If[LessEqual[y, -1.4e-195], N[(t * N[(x / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.4e+38], N[(N[(N[(x - y), $MachinePrecision] * t), $MachinePrecision] / z), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

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

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

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

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -8.00000000000000007e78 or 1.4e38 < y

    1. Initial program 99.9%

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

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

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

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

      \[\leadsto \color{blue}{\frac{-y}{z - y}} \cdot t \]
    5. Step-by-step derivation
      1. frac-2neg80.9%

        \[\leadsto \color{blue}{\frac{-\left(-y\right)}{-\left(z - y\right)}} \cdot t \]
      2. div-inv80.7%

        \[\leadsto \color{blue}{\left(\left(-\left(-y\right)\right) \cdot \frac{1}{-\left(z - y\right)}\right)} \cdot t \]
      3. remove-double-neg80.7%

        \[\leadsto \left(\color{blue}{y} \cdot \frac{1}{-\left(z - y\right)}\right) \cdot t \]
      4. sub-neg80.7%

        \[\leadsto \left(y \cdot \frac{1}{-\color{blue}{\left(z + \left(-y\right)\right)}}\right) \cdot t \]
      5. distribute-neg-in80.7%

        \[\leadsto \left(y \cdot \frac{1}{\color{blue}{\left(-z\right) + \left(-\left(-y\right)\right)}}\right) \cdot t \]
      6. remove-double-neg80.7%

        \[\leadsto \left(y \cdot \frac{1}{\left(-z\right) + \color{blue}{y}}\right) \cdot t \]
      7. +-commutative80.7%

        \[\leadsto \left(y \cdot \frac{1}{\color{blue}{y + \left(-z\right)}}\right) \cdot t \]
      8. sub-neg80.7%

        \[\leadsto \left(y \cdot \frac{1}{\color{blue}{y - z}}\right) \cdot t \]
    6. Applied egg-rr80.7%

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

        \[\leadsto \color{blue}{\frac{y \cdot 1}{y - z}} \cdot t \]
      2. *-rgt-identity80.9%

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

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

    if -8.00000000000000007e78 < y < -1.40000000000000002e-195

    1. Initial program 96.6%

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

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

    if -1.40000000000000002e-195 < y < 1.4e38

    1. Initial program 93.0%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -8 \cdot 10^{+78}:\\ \;\;\;\;t \cdot \frac{y}{y - z}\\ \mathbf{elif}\;y \leq -1.4 \cdot 10^{-195}:\\ \;\;\;\;t \cdot \frac{x}{z - y}\\ \mathbf{elif}\;y \leq 1.4 \cdot 10^{+38}:\\ \;\;\;\;\frac{\left(x - y\right) \cdot t}{z}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{y}{y - z}\\ \end{array} \]

Alternative 10: 89.6% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -3 \cdot 10^{+102}:\\
\;\;\;\;t \cdot \frac{y}{y - z}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -2.9999999999999998e102

    1. Initial program 99.9%

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

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

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

        \[\leadsto \color{blue}{\frac{-y}{z - y}} \cdot t \]
    4. Simplified86.9%

      \[\leadsto \color{blue}{\frac{-y}{z - y}} \cdot t \]
    5. Step-by-step derivation
      1. frac-2neg86.9%

        \[\leadsto \color{blue}{\frac{-\left(-y\right)}{-\left(z - y\right)}} \cdot t \]
      2. div-inv86.7%

        \[\leadsto \color{blue}{\left(\left(-\left(-y\right)\right) \cdot \frac{1}{-\left(z - y\right)}\right)} \cdot t \]
      3. remove-double-neg86.7%

        \[\leadsto \left(\color{blue}{y} \cdot \frac{1}{-\left(z - y\right)}\right) \cdot t \]
      4. sub-neg86.7%

        \[\leadsto \left(y \cdot \frac{1}{-\color{blue}{\left(z + \left(-y\right)\right)}}\right) \cdot t \]
      5. distribute-neg-in86.7%

        \[\leadsto \left(y \cdot \frac{1}{\color{blue}{\left(-z\right) + \left(-\left(-y\right)\right)}}\right) \cdot t \]
      6. remove-double-neg86.7%

        \[\leadsto \left(y \cdot \frac{1}{\left(-z\right) + \color{blue}{y}}\right) \cdot t \]
      7. +-commutative86.7%

        \[\leadsto \left(y \cdot \frac{1}{\color{blue}{y + \left(-z\right)}}\right) \cdot t \]
      8. sub-neg86.7%

        \[\leadsto \left(y \cdot \frac{1}{\color{blue}{y - z}}\right) \cdot t \]
    6. Applied egg-rr86.7%

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

        \[\leadsto \color{blue}{\frac{y \cdot 1}{y - z}} \cdot t \]
      2. *-rgt-identity86.9%

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

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

    if -2.9999999999999998e102 < y < 2.8000000000000002e152

    1. Initial program 95.3%

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

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

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

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

    if 2.8000000000000002e152 < y

    1. Initial program 99.8%

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

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

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

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

        \[\leadsto \frac{\color{blue}{0 - \left(x - y\right)}}{y} \cdot t \]
      4. associate--r-92.7%

        \[\leadsto \frac{\color{blue}{\left(0 - x\right) + y}}{y} \cdot t \]
      5. neg-sub092.7%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3 \cdot 10^{+102}:\\ \;\;\;\;t \cdot \frac{y}{y - z}\\ \mathbf{elif}\;y \leq 2.8 \cdot 10^{+152}:\\ \;\;\;\;\left(x - y\right) \cdot \frac{t}{z - y}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{y - x}{y}\\ \end{array} \]

Alternative 11: 68.8% accurate, 0.8× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -3.55e92 or 1.4500000000000001e74 < y

    1. Initial program 99.9%

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

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

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

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

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

    if -3.55e92 < y < 1.4500000000000001e74

    1. Initial program 94.8%

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

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

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

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

      \[\leadsto \color{blue}{\frac{t \cdot x}{z - y}} \]
    5. Step-by-step derivation
      1. associate-*l/69.8%

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

        \[\leadsto \color{blue}{x \cdot \frac{t}{z - y}} \]
    6. Simplified69.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.55 \cdot 10^{+92}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq 1.45 \cdot 10^{+74}:\\ \;\;\;\;x \cdot \frac{t}{z - y}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]

Alternative 12: 62.3% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;y \leq 1.4 \cdot 10^{+38}:\\
\;\;\;\;t \cdot \frac{x}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.99999999999999989e31 or 1.4e38 < y

    1. Initial program 99.9%

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

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

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

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

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

    if -2.99999999999999989e31 < y < 1.4e38

    1. Initial program 93.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3 \cdot 10^{+31}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq 1.4 \cdot 10^{+38}:\\ \;\;\;\;t \cdot \frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]

Alternative 13: 62.3% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;y \leq 1.6 \cdot 10^{+38}:\\
\;\;\;\;\frac{t}{\frac{z}{x}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.8999999999999998e30 or 1.59999999999999993e38 < y

    1. Initial program 99.9%

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

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

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

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

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

    if -2.8999999999999998e30 < y < 1.59999999999999993e38

    1. Initial program 93.9%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{t}{\frac{z}{x}}} \]
    6. Simplified65.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.9 \cdot 10^{+30}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq 1.6 \cdot 10^{+38}:\\ \;\;\;\;\frac{t}{\frac{z}{x}}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]

Alternative 14: 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.0%

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

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

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

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

    \[\leadsto \color{blue}{t} \]
  5. Final simplification39.4%

    \[\leadsto t \]

Developer target: 97.1% 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 2023238 
(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))