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

Percentage Accurate: 96.8% → 96.8%
Time: 10.6s
Alternatives: 12
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 12 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.8% 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.8% 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.5%

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

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

Alternative 2: 75.2% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{t}{1 - \frac{z}{y}}\\ t_2 := t \cdot \frac{y - x}{y}\\ \mathbf{if}\;y \leq -3.6 \cdot 10^{+78}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq -3.8 \cdot 10^{-51}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 1.8 \cdot 10^{-66}:\\ \;\;\;\;\frac{x}{\frac{z - y}{t}}\\ \mathbf{elif}\;y \leq 1.65 \cdot 10^{-23}:\\ \;\;\;\;y \cdot \frac{t}{y - z}\\ \mathbf{elif}\;y \leq 4 \cdot 10^{+55}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (/ t (- 1.0 (/ z y)))) (t_2 (* t (/ (- y x) y))))
   (if (<= y -3.6e+78)
     t_2
     (if (<= y -3.8e-51)
       t_1
       (if (<= y 1.8e-66)
         (/ x (/ (- z y) t))
         (if (<= y 1.65e-23)
           (* y (/ t (- y z)))
           (if (<= y 4e+55) t_2 t_1)))))))
double code(double x, double y, double z, double t) {
	double t_1 = t / (1.0 - (z / y));
	double t_2 = t * ((y - x) / y);
	double tmp;
	if (y <= -3.6e+78) {
		tmp = t_2;
	} else if (y <= -3.8e-51) {
		tmp = t_1;
	} else if (y <= 1.8e-66) {
		tmp = x / ((z - y) / t);
	} else if (y <= 1.65e-23) {
		tmp = y * (t / (y - z));
	} else if (y <= 4e+55) {
		tmp = t_2;
	} 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 / (1.0d0 - (z / y))
    t_2 = t * ((y - x) / y)
    if (y <= (-3.6d+78)) then
        tmp = t_2
    else if (y <= (-3.8d-51)) then
        tmp = t_1
    else if (y <= 1.8d-66) then
        tmp = x / ((z - y) / t)
    else if (y <= 1.65d-23) then
        tmp = y * (t / (y - z))
    else if (y <= 4d+55) then
        tmp = t_2
    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 / (1.0 - (z / y));
	double t_2 = t * ((y - x) / y);
	double tmp;
	if (y <= -3.6e+78) {
		tmp = t_2;
	} else if (y <= -3.8e-51) {
		tmp = t_1;
	} else if (y <= 1.8e-66) {
		tmp = x / ((z - y) / t);
	} else if (y <= 1.65e-23) {
		tmp = y * (t / (y - z));
	} else if (y <= 4e+55) {
		tmp = t_2;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = t / (1.0 - (z / y))
	t_2 = t * ((y - x) / y)
	tmp = 0
	if y <= -3.6e+78:
		tmp = t_2
	elif y <= -3.8e-51:
		tmp = t_1
	elif y <= 1.8e-66:
		tmp = x / ((z - y) / t)
	elif y <= 1.65e-23:
		tmp = y * (t / (y - z))
	elif y <= 4e+55:
		tmp = t_2
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(t / Float64(1.0 - Float64(z / y)))
	t_2 = Float64(t * Float64(Float64(y - x) / y))
	tmp = 0.0
	if (y <= -3.6e+78)
		tmp = t_2;
	elseif (y <= -3.8e-51)
		tmp = t_1;
	elseif (y <= 1.8e-66)
		tmp = Float64(x / Float64(Float64(z - y) / t));
	elseif (y <= 1.65e-23)
		tmp = Float64(y * Float64(t / Float64(y - z)));
	elseif (y <= 4e+55)
		tmp = t_2;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = t / (1.0 - (z / y));
	t_2 = t * ((y - x) / y);
	tmp = 0.0;
	if (y <= -3.6e+78)
		tmp = t_2;
	elseif (y <= -3.8e-51)
		tmp = t_1;
	elseif (y <= 1.8e-66)
		tmp = x / ((z - y) / t);
	elseif (y <= 1.65e-23)
		tmp = y * (t / (y - z));
	elseif (y <= 4e+55)
		tmp = t_2;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(t / N[(1.0 - N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t * N[(N[(y - x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -3.6e+78], t$95$2, If[LessEqual[y, -3.8e-51], t$95$1, If[LessEqual[y, 1.8e-66], N[(x / N[(N[(z - y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.65e-23], N[(y * N[(t / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4e+55], t$95$2, t$95$1]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq -3.8 \cdot 10^{-51}:\\
\;\;\;\;t_1\\

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

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

\mathbf{elif}\;y \leq 4 \cdot 10^{+55}:\\
\;\;\;\;t_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -3.6000000000000002e78 or 1.6500000000000001e-23 < y < 4.00000000000000004e55

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

    if -3.6000000000000002e78 < y < -3.80000000000000003e-51 or 4.00000000000000004e55 < y

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y \cdot 1}{\left(-z\right) + y}} \cdot t \]
      2. *-rgt-identity82.0%

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

        \[\leadsto \frac{y}{\color{blue}{y + \left(-z\right)}} \cdot t \]
      4. unsub-neg82.0%

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

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

      \[\leadsto \color{blue}{\frac{y \cdot t}{y - z}} \]
    10. Step-by-step derivation
      1. *-commutative62.6%

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

        \[\leadsto \color{blue}{\frac{t}{\frac{y - z}{y}}} \]
      3. div-sub82.1%

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

        \[\leadsto \frac{t}{\color{blue}{1} - \frac{z}{y}} \]
    11. Simplified82.1%

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

    if -3.80000000000000003e-51 < y < 1.80000000000000006e-66

    1. Initial program 94.1%

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

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

        \[\leadsto \color{blue}{\frac{x}{\frac{z - y}{t}}} \]
    4. Applied egg-rr89.5%

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

    if 1.80000000000000006e-66 < y < 1.6500000000000001e-23

    1. Initial program 92.7%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{y \cdot t}{\left(-z\right) + \color{blue}{y}} \]
    6. Applied egg-rr70.2%

      \[\leadsto \color{blue}{\frac{y \cdot t}{\left(-z\right) + y}} \]
    7. Step-by-step derivation
      1. *-commutative70.2%

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

        \[\leadsto \color{blue}{\frac{t}{\frac{\left(-z\right) + y}{y}}} \]
      3. associate-/r/82.5%

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

        \[\leadsto \frac{t}{\color{blue}{y + \left(-z\right)}} \cdot y \]
      5. unsub-neg82.5%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.6 \cdot 10^{+78}:\\ \;\;\;\;t \cdot \frac{y - x}{y}\\ \mathbf{elif}\;y \leq -3.8 \cdot 10^{-51}:\\ \;\;\;\;\frac{t}{1 - \frac{z}{y}}\\ \mathbf{elif}\;y \leq 1.8 \cdot 10^{-66}:\\ \;\;\;\;\frac{x}{\frac{z - y}{t}}\\ \mathbf{elif}\;y \leq 1.65 \cdot 10^{-23}:\\ \;\;\;\;y \cdot \frac{t}{y - z}\\ \mathbf{elif}\;y \leq 4 \cdot 10^{+55}:\\ \;\;\;\;t \cdot \frac{y - x}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{t}{1 - \frac{z}{y}}\\ \end{array} \]

Alternative 3: 66.5% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;y \leq -0.03 \lor \neg \left(y \leq 9.8 \cdot 10^{-67}\right):\\
\;\;\;\;y \cdot \frac{t}{y - z}\\

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


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

    1. Initial program 100.0%

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

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

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

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

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

    if -1.10000000000000012e214 < y < -0.029999999999999999 or 9.79999999999999987e-67 < y

    1. Initial program 99.2%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-\left(-y\right)}{-\left(z - y\right)}} \cdot t \]
      2. remove-double-neg76.5%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{y \cdot t}{\left(-z\right) + y}} \]
    7. Step-by-step derivation
      1. *-commutative59.6%

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

        \[\leadsto \color{blue}{\frac{t}{\frac{\left(-z\right) + y}{y}}} \]
      3. associate-/r/67.0%

        \[\leadsto \color{blue}{\frac{t}{\left(-z\right) + y} \cdot y} \]
      4. +-commutative67.0%

        \[\leadsto \frac{t}{\color{blue}{y + \left(-z\right)}} \cdot y \]
      5. unsub-neg67.0%

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

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

    if -0.029999999999999999 < y < 9.79999999999999987e-67

    1. Initial program 94.7%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.1 \cdot 10^{+214}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq -0.03 \lor \neg \left(y \leq 9.8 \cdot 10^{-67}\right):\\ \;\;\;\;y \cdot \frac{t}{y - z}\\ \mathbf{else}:\\ \;\;\;\;\left(x - y\right) \cdot \frac{t}{z}\\ \end{array} \]

Alternative 4: 67.9% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;y \leq -780000000000 \lor \neg \left(y \leq 1.9 \cdot 10^{-66}\right):\\
\;\;\;\;y \cdot \frac{t}{y - z}\\

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


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

    1. Initial program 100.0%

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

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

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

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

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

    if -7.2000000000000002e213 < y < -7.8e11 or 1.8999999999999999e-66 < y

    1. Initial program 99.2%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{y \cdot t}{\left(-z\right) + y}} \]
    7. Step-by-step derivation
      1. *-commutative59.9%

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

        \[\leadsto \color{blue}{\frac{t}{\frac{\left(-z\right) + y}{y}}} \]
      3. associate-/r/67.4%

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

        \[\leadsto \frac{t}{\color{blue}{y + \left(-z\right)}} \cdot y \]
      5. unsub-neg67.4%

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

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

    if -7.8e11 < y < 1.8999999999999999e-66

    1. Initial program 94.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -7.2 \cdot 10^{+213}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq -780000000000 \lor \neg \left(y \leq 1.9 \cdot 10^{-66}\right):\\ \;\;\;\;y \cdot \frac{t}{y - z}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{x}{z - y}\\ \end{array} \]

Alternative 5: 89.1% accurate, 0.7× speedup?

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

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

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

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


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

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

    if -2.8000000000000001e78 < y < 7.5000000000000003e205

    1. Initial program 96.7%

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

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

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

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

    if 7.5000000000000003e205 < y

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{y \cdot t}{y - z}} \]
    10. Step-by-step derivation
      1. *-commutative36.6%

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

        \[\leadsto \color{blue}{\frac{t}{\frac{y - z}{y}}} \]
      3. div-sub95.3%

        \[\leadsto \frac{t}{\color{blue}{\frac{y}{y} - \frac{z}{y}}} \]
      4. *-inverses95.3%

        \[\leadsto \frac{t}{\color{blue}{1} - \frac{z}{y}} \]
    11. Simplified95.3%

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

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

Alternative 6: 74.8% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.95 \cdot 10^{-52} \lor \neg \left(y \leq 1.95 \cdot 10^{-66}\right):\\
\;\;\;\;t \cdot \frac{y}{y - z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.95000000000000009e-52 or 1.94999999999999991e-66 < y

    1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y \cdot 1}{\left(-z\right) + y}} \cdot t \]
      2. *-rgt-identity77.6%

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

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

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

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

    if -1.95000000000000009e-52 < y < 1.94999999999999991e-66

    1. Initial program 94.1%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.95 \cdot 10^{-52} \lor \neg \left(y \leq 1.95 \cdot 10^{-66}\right):\\ \;\;\;\;t \cdot \frac{y}{y - z}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{x}{z - y}\\ \end{array} \]

Alternative 7: 65.9% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;y \leq 1.55 \cdot 10^{-5}:\\
\;\;\;\;\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 < -3.4000000000000003e66 or 1.55000000000000007e-5 < y

    1. Initial program 99.9%

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

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

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

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

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

    if -3.4000000000000003e66 < y < 1.55000000000000007e-5

    1. Initial program 95.5%

      \[\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-*r/97.0%

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

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

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

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

Alternative 8: 74.8% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.3 \cdot 10^{-50}:\\
\;\;\;\;\frac{t}{1 - \frac{z}{y}}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.3000000000000001e-50

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y \cdot 1}{\left(-z\right) + y}} \cdot t \]
      2. *-rgt-identity78.1%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{t}{\frac{y - z}{y}}} \]
      3. div-sub78.1%

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

        \[\leadsto \frac{t}{\color{blue}{1} - \frac{z}{y}} \]
    11. Simplified78.1%

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

    if -1.3000000000000001e-50 < y < 1.05e-66

    1. Initial program 94.1%

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

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

    if 1.05e-66 < y

    1. Initial program 98.8%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y \cdot 1}{\left(-z\right) + y}} \cdot t \]
      2. *-rgt-identity77.1%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.3 \cdot 10^{-50}:\\ \;\;\;\;\frac{t}{1 - \frac{z}{y}}\\ \mathbf{elif}\;y \leq 1.05 \cdot 10^{-66}:\\ \;\;\;\;t \cdot \frac{x}{z - y}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{y}{y - z}\\ \end{array} \]

Alternative 9: 75.0% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.4 \cdot 10^{-51}:\\
\;\;\;\;\frac{t}{1 - \frac{z}{y}}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -7.39999999999999946e-51

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y \cdot 1}{\left(-z\right) + y}} \cdot t \]
      2. *-rgt-identity78.1%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{t}{\frac{y - z}{y}}} \]
      3. div-sub78.1%

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

        \[\leadsto \frac{t}{\color{blue}{1} - \frac{z}{y}} \]
    11. Simplified78.1%

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

    if -7.39999999999999946e-51 < y < 1.94999999999999991e-66

    1. Initial program 94.1%

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

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

        \[\leadsto \color{blue}{\frac{x}{\frac{z - y}{t}}} \]
    4. Applied egg-rr89.5%

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

    if 1.94999999999999991e-66 < y

    1. Initial program 98.8%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y \cdot 1}{\left(-z\right) + y}} \cdot t \]
      2. *-rgt-identity77.1%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -7.4 \cdot 10^{-51}:\\ \;\;\;\;\frac{t}{1 - \frac{z}{y}}\\ \mathbf{elif}\;y \leq 1.95 \cdot 10^{-66}:\\ \;\;\;\;\frac{x}{\frac{z - y}{t}}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{y}{y - z}\\ \end{array} \]

Alternative 10: 35.1% accurate, 1.0× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -6.8e-8 or 2.3999999999999999e-120 < y

    1. Initial program 99.3%

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

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

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

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

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

    if -6.8e-8 < y < 2.3999999999999999e-120

    1. Initial program 94.1%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{t}{\frac{y}{-x}}} \]
      2. associate-/r/31.5%

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

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

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

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

        \[\leadsto \frac{t}{y} \cdot \color{blue}{\left(\sqrt{x} \cdot \sqrt{x}\right)} \]
      7. add-sqr-sqrt18.9%

        \[\leadsto \frac{t}{y} \cdot \color{blue}{x} \]
    7. Applied egg-rr18.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -6.8 \cdot 10^{-8}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq 2.4 \cdot 10^{-120}:\\ \;\;\;\;x \cdot \frac{t}{y}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]

Alternative 11: 60.4% accurate, 1.0× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.4e14 or 3.6e14 < y

    1. Initial program 99.8%

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

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

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

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

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

    if -1.4e14 < y < 3.6e14

    1. Initial program 95.0%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Step-by-step derivation
      1. clear-num93.7%

        \[\leadsto \color{blue}{\frac{1}{\frac{z - y}{x - y}}} \cdot t \]
      2. inv-pow93.7%

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

      \[\leadsto \color{blue}{{\left(\frac{z - y}{x - y}\right)}^{-1}} \cdot t \]
    4. Step-by-step derivation
      1. unpow-193.7%

        \[\leadsto \color{blue}{\frac{1}{\frac{z - y}{x - y}}} \cdot t \]
    5. Simplified93.7%

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

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

        \[\leadsto \color{blue}{\frac{t}{\frac{z}{x}}} \]
      2. associate-/r/65.8%

        \[\leadsto \color{blue}{\frac{t}{z} \cdot x} \]
    8. Simplified65.8%

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

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

Alternative 12: 35.5% 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.5%

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

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

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

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

    \[\leadsto \color{blue}{t} \]
  5. Final simplification37.2%

    \[\leadsto t \]

Developer target: 96.8% 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 2023199 
(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))