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

Percentage Accurate: 96.9% → 97.0%
Time: 9.2s
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.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{x - y}{z - y} \cdot t \end{array} \]
(FPCore (x y z t) :precision binary64 (* (/ (- x y) (- z y)) t))
double code(double x, double y, double z, double t) {
	return ((x - y) / (z - y)) * t;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = ((x - y) / (z - y)) * t
end function
public static double code(double x, double y, double z, double t) {
	return ((x - y) / (z - y)) * t;
}
def code(x, y, z, t):
	return ((x - y) / (z - y)) * t
function code(x, y, z, t)
	return Float64(Float64(Float64(x - y) / Float64(z - y)) * t)
end
function tmp = code(x, y, z, t)
	tmp = ((x - y) / (z - y)) * t;
end
code[x_, y_, z_, t_] := N[(N[(N[(x - y), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]
\begin{array}{l}

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

Alternative 1: 97.0% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{t}{\frac{z - y}{x - y}} \end{array} \]
(FPCore (x y z t) :precision binary64 (/ t (/ (- z y) (- x y))))
double code(double x, double y, double z, double t) {
	return t / ((z - y) / (x - y));
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = t / ((z - y) / (x - y))
end function
public static double code(double x, double y, double z, double t) {
	return t / ((z - y) / (x - y));
}
def code(x, y, z, t):
	return t / ((z - y) / (x - y))
function code(x, y, z, t)
	return Float64(t / Float64(Float64(z - y) / Float64(x - y)))
end
function tmp = code(x, y, z, t)
	tmp = t / ((z - y) / (x - y));
end
code[x_, y_, z_, t_] := N[(t / N[(N[(z - y), $MachinePrecision] / N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

    \[\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/82.1%

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

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

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

      \[\leadsto \color{blue}{\frac{x - y}{z - y} \cdot t} \]
    3. *-commutative97.6%

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

      \[\leadsto t \cdot \color{blue}{\frac{1}{\frac{z - y}{x - y}}} \]
    5. un-div-inv97.6%

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

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

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

Alternative 2: 75.3% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := t \cdot \left(1 - \frac{x}{y}\right)\\ \mathbf{if}\;y \leq -48:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -1.16 \cdot 10^{-29}:\\ \;\;\;\;\left(x - y\right) \cdot \frac{t}{z}\\ \mathbf{elif}\;y \leq -3.2 \cdot 10^{-37}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 5.5 \cdot 10^{+16}:\\ \;\;\;\;t \cdot \frac{x}{z - y}\\ \mathbf{elif}\;y \leq 6.2 \cdot 10^{+77}:\\ \;\;\;\;t \cdot \frac{x - y}{z}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* t (- 1.0 (/ x y)))))
   (if (<= y -48.0)
     t_1
     (if (<= y -1.16e-29)
       (* (- x y) (/ t z))
       (if (<= y -3.2e-37)
         t_1
         (if (<= y 5.5e+16)
           (* t (/ x (- z y)))
           (if (<= y 6.2e+77) (* t (/ (- x y) z)) t_1)))))))
double code(double x, double y, double z, double t) {
	double t_1 = t * (1.0 - (x / y));
	double tmp;
	if (y <= -48.0) {
		tmp = t_1;
	} else if (y <= -1.16e-29) {
		tmp = (x - y) * (t / z);
	} else if (y <= -3.2e-37) {
		tmp = t_1;
	} else if (y <= 5.5e+16) {
		tmp = t * (x / (z - y));
	} else if (y <= 6.2e+77) {
		tmp = t * ((x - y) / 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 * (1.0d0 - (x / y))
    if (y <= (-48.0d0)) then
        tmp = t_1
    else if (y <= (-1.16d-29)) then
        tmp = (x - y) * (t / z)
    else if (y <= (-3.2d-37)) then
        tmp = t_1
    else if (y <= 5.5d+16) then
        tmp = t * (x / (z - y))
    else if (y <= 6.2d+77) then
        tmp = t * ((x - y) / 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 * (1.0 - (x / y));
	double tmp;
	if (y <= -48.0) {
		tmp = t_1;
	} else if (y <= -1.16e-29) {
		tmp = (x - y) * (t / z);
	} else if (y <= -3.2e-37) {
		tmp = t_1;
	} else if (y <= 5.5e+16) {
		tmp = t * (x / (z - y));
	} else if (y <= 6.2e+77) {
		tmp = t * ((x - y) / z);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = t * (1.0 - (x / y))
	tmp = 0
	if y <= -48.0:
		tmp = t_1
	elif y <= -1.16e-29:
		tmp = (x - y) * (t / z)
	elif y <= -3.2e-37:
		tmp = t_1
	elif y <= 5.5e+16:
		tmp = t * (x / (z - y))
	elif y <= 6.2e+77:
		tmp = t * ((x - y) / z)
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(t * Float64(1.0 - Float64(x / y)))
	tmp = 0.0
	if (y <= -48.0)
		tmp = t_1;
	elseif (y <= -1.16e-29)
		tmp = Float64(Float64(x - y) * Float64(t / z));
	elseif (y <= -3.2e-37)
		tmp = t_1;
	elseif (y <= 5.5e+16)
		tmp = Float64(t * Float64(x / Float64(z - y)));
	elseif (y <= 6.2e+77)
		tmp = Float64(t * Float64(Float64(x - y) / z));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = t * (1.0 - (x / y));
	tmp = 0.0;
	if (y <= -48.0)
		tmp = t_1;
	elseif (y <= -1.16e-29)
		tmp = (x - y) * (t / z);
	elseif (y <= -3.2e-37)
		tmp = t_1;
	elseif (y <= 5.5e+16)
		tmp = t * (x / (z - y));
	elseif (y <= 6.2e+77)
		tmp = t * ((x - y) / z);
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(t * N[(1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -48.0], t$95$1, If[LessEqual[y, -1.16e-29], N[(N[(x - y), $MachinePrecision] * N[(t / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -3.2e-37], t$95$1, If[LessEqual[y, 5.5e+16], N[(t * N[(x / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.2e+77], N[(t * N[(N[(x - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := t \cdot \left(1 - \frac{x}{y}\right)\\
\mathbf{if}\;y \leq -48:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;y \leq -3.2 \cdot 10^{-37}:\\
\;\;\;\;t_1\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -48 or -1.15999999999999996e-29 < y < -3.1999999999999999e-37 or 6.19999999999999997e77 < y

    1. Initial program 99.9%

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-\left(x - y\right) \cdot t}}{y} \]
      4. distribute-rgt-neg-in59.4%

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

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

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

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

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

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

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

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

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

    if -48 < y < -1.15999999999999996e-29

    1. Initial program 99.3%

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

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

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

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

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

    if -3.1999999999999999e-37 < y < 5.5e16

    1. Initial program 95.0%

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

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

    if 5.5e16 < y < 6.19999999999999997e77

    1. Initial program 99.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -48:\\ \;\;\;\;t \cdot \left(1 - \frac{x}{y}\right)\\ \mathbf{elif}\;y \leq -1.16 \cdot 10^{-29}:\\ \;\;\;\;\left(x - y\right) \cdot \frac{t}{z}\\ \mathbf{elif}\;y \leq -3.2 \cdot 10^{-37}:\\ \;\;\;\;t \cdot \left(1 - \frac{x}{y}\right)\\ \mathbf{elif}\;y \leq 5.5 \cdot 10^{+16}:\\ \;\;\;\;t \cdot \frac{x}{z - y}\\ \mathbf{elif}\;y \leq 6.2 \cdot 10^{+77}:\\ \;\;\;\;t \cdot \frac{x - y}{z}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(1 - \frac{x}{y}\right)\\ \end{array} \]

Alternative 3: 75.4% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := t \cdot \left(1 - \frac{x}{y}\right)\\ \mathbf{if}\;y \leq -50:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -1.4 \cdot 10^{-30}:\\ \;\;\;\;\left(x - y\right) \cdot \frac{t}{z}\\ \mathbf{elif}\;y \leq -4.4 \cdot 10^{-37}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 1.85 \cdot 10^{+15}:\\ \;\;\;\;\frac{t}{\frac{z - y}{x}}\\ \mathbf{elif}\;y \leq 6 \cdot 10^{+77}:\\ \;\;\;\;t \cdot \frac{x - y}{z}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* t (- 1.0 (/ x y)))))
   (if (<= y -50.0)
     t_1
     (if (<= y -1.4e-30)
       (* (- x y) (/ t z))
       (if (<= y -4.4e-37)
         t_1
         (if (<= y 1.85e+15)
           (/ t (/ (- z y) x))
           (if (<= y 6e+77) (* t (/ (- x y) z)) t_1)))))))
double code(double x, double y, double z, double t) {
	double t_1 = t * (1.0 - (x / y));
	double tmp;
	if (y <= -50.0) {
		tmp = t_1;
	} else if (y <= -1.4e-30) {
		tmp = (x - y) * (t / z);
	} else if (y <= -4.4e-37) {
		tmp = t_1;
	} else if (y <= 1.85e+15) {
		tmp = t / ((z - y) / x);
	} else if (y <= 6e+77) {
		tmp = t * ((x - y) / 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 * (1.0d0 - (x / y))
    if (y <= (-50.0d0)) then
        tmp = t_1
    else if (y <= (-1.4d-30)) then
        tmp = (x - y) * (t / z)
    else if (y <= (-4.4d-37)) then
        tmp = t_1
    else if (y <= 1.85d+15) then
        tmp = t / ((z - y) / x)
    else if (y <= 6d+77) then
        tmp = t * ((x - y) / 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 * (1.0 - (x / y));
	double tmp;
	if (y <= -50.0) {
		tmp = t_1;
	} else if (y <= -1.4e-30) {
		tmp = (x - y) * (t / z);
	} else if (y <= -4.4e-37) {
		tmp = t_1;
	} else if (y <= 1.85e+15) {
		tmp = t / ((z - y) / x);
	} else if (y <= 6e+77) {
		tmp = t * ((x - y) / z);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = t * (1.0 - (x / y))
	tmp = 0
	if y <= -50.0:
		tmp = t_1
	elif y <= -1.4e-30:
		tmp = (x - y) * (t / z)
	elif y <= -4.4e-37:
		tmp = t_1
	elif y <= 1.85e+15:
		tmp = t / ((z - y) / x)
	elif y <= 6e+77:
		tmp = t * ((x - y) / z)
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(t * Float64(1.0 - Float64(x / y)))
	tmp = 0.0
	if (y <= -50.0)
		tmp = t_1;
	elseif (y <= -1.4e-30)
		tmp = Float64(Float64(x - y) * Float64(t / z));
	elseif (y <= -4.4e-37)
		tmp = t_1;
	elseif (y <= 1.85e+15)
		tmp = Float64(t / Float64(Float64(z - y) / x));
	elseif (y <= 6e+77)
		tmp = Float64(t * Float64(Float64(x - y) / z));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = t * (1.0 - (x / y));
	tmp = 0.0;
	if (y <= -50.0)
		tmp = t_1;
	elseif (y <= -1.4e-30)
		tmp = (x - y) * (t / z);
	elseif (y <= -4.4e-37)
		tmp = t_1;
	elseif (y <= 1.85e+15)
		tmp = t / ((z - y) / x);
	elseif (y <= 6e+77)
		tmp = t * ((x - y) / z);
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(t * N[(1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -50.0], t$95$1, If[LessEqual[y, -1.4e-30], N[(N[(x - y), $MachinePrecision] * N[(t / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -4.4e-37], t$95$1, If[LessEqual[y, 1.85e+15], N[(t / N[(N[(z - y), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6e+77], N[(t * N[(N[(x - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := t \cdot \left(1 - \frac{x}{y}\right)\\
\mathbf{if}\;y \leq -50:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;y \leq -4.4 \cdot 10^{-37}:\\
\;\;\;\;t_1\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -50 or -1.39999999999999994e-30 < y < -4.40000000000000004e-37 or 5.9999999999999996e77 < y

    1. Initial program 99.9%

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-\left(x - y\right) \cdot t}}{y} \]
      4. distribute-rgt-neg-in59.4%

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

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

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

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

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

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

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

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

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

    if -50 < y < -1.39999999999999994e-30

    1. Initial program 99.3%

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

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

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

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

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

    if -4.40000000000000004e-37 < y < 1.85e15

    1. Initial program 95.0%

      \[\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/93.5%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{t}{\frac{z - y}{x}}} \]
    8. Simplified81.7%

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

    if 1.85e15 < y < 5.9999999999999996e77

    1. Initial program 99.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -50:\\ \;\;\;\;t \cdot \left(1 - \frac{x}{y}\right)\\ \mathbf{elif}\;y \leq -1.4 \cdot 10^{-30}:\\ \;\;\;\;\left(x - y\right) \cdot \frac{t}{z}\\ \mathbf{elif}\;y \leq -4.4 \cdot 10^{-37}:\\ \;\;\;\;t \cdot \left(1 - \frac{x}{y}\right)\\ \mathbf{elif}\;y \leq 1.85 \cdot 10^{+15}:\\ \;\;\;\;\frac{t}{\frac{z - y}{x}}\\ \mathbf{elif}\;y \leq 6 \cdot 10^{+77}:\\ \;\;\;\;t \cdot \frac{x - y}{z}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(1 - \frac{x}{y}\right)\\ \end{array} \]

Alternative 4: 75.4% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := t \cdot \left(1 - \frac{x}{y}\right)\\ \mathbf{if}\;y \leq -95:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -2.05 \cdot 10^{-30}:\\ \;\;\;\;\left(x - y\right) \cdot \frac{t}{z}\\ \mathbf{elif}\;y \leq -1.25 \cdot 10^{-37} \lor \neg \left(y \leq 1.4 \cdot 10^{+53}\right):\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{t}{z - y}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* t (- 1.0 (/ x y)))))
   (if (<= y -95.0)
     t_1
     (if (<= y -2.05e-30)
       (* (- x y) (/ t z))
       (if (or (<= y -1.25e-37) (not (<= y 1.4e+53)))
         t_1
         (* x (/ t (- z y))))))))
double code(double x, double y, double z, double t) {
	double t_1 = t * (1.0 - (x / y));
	double tmp;
	if (y <= -95.0) {
		tmp = t_1;
	} else if (y <= -2.05e-30) {
		tmp = (x - y) * (t / z);
	} else if ((y <= -1.25e-37) || !(y <= 1.4e+53)) {
		tmp = t_1;
	} else {
		tmp = x * (t / (z - y));
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: tmp
    t_1 = t * (1.0d0 - (x / y))
    if (y <= (-95.0d0)) then
        tmp = t_1
    else if (y <= (-2.05d-30)) then
        tmp = (x - y) * (t / z)
    else if ((y <= (-1.25d-37)) .or. (.not. (y <= 1.4d+53))) then
        tmp = t_1
    else
        tmp = x * (t / (z - y))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = t * (1.0 - (x / y));
	double tmp;
	if (y <= -95.0) {
		tmp = t_1;
	} else if (y <= -2.05e-30) {
		tmp = (x - y) * (t / z);
	} else if ((y <= -1.25e-37) || !(y <= 1.4e+53)) {
		tmp = t_1;
	} else {
		tmp = x * (t / (z - y));
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = t * (1.0 - (x / y))
	tmp = 0
	if y <= -95.0:
		tmp = t_1
	elif y <= -2.05e-30:
		tmp = (x - y) * (t / z)
	elif (y <= -1.25e-37) or not (y <= 1.4e+53):
		tmp = t_1
	else:
		tmp = x * (t / (z - y))
	return tmp
function code(x, y, z, t)
	t_1 = Float64(t * Float64(1.0 - Float64(x / y)))
	tmp = 0.0
	if (y <= -95.0)
		tmp = t_1;
	elseif (y <= -2.05e-30)
		tmp = Float64(Float64(x - y) * Float64(t / z));
	elseif ((y <= -1.25e-37) || !(y <= 1.4e+53))
		tmp = t_1;
	else
		tmp = Float64(x * Float64(t / Float64(z - y)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = t * (1.0 - (x / y));
	tmp = 0.0;
	if (y <= -95.0)
		tmp = t_1;
	elseif (y <= -2.05e-30)
		tmp = (x - y) * (t / z);
	elseif ((y <= -1.25e-37) || ~((y <= 1.4e+53)))
		tmp = t_1;
	else
		tmp = x * (t / (z - y));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(t * N[(1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -95.0], t$95$1, If[LessEqual[y, -2.05e-30], N[(N[(x - y), $MachinePrecision] * N[(t / z), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y, -1.25e-37], N[Not[LessEqual[y, 1.4e+53]], $MachinePrecision]], t$95$1, N[(x * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := t \cdot \left(1 - \frac{x}{y}\right)\\
\mathbf{if}\;y \leq -95:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;y \leq -1.25 \cdot 10^{-37} \lor \neg \left(y \leq 1.4 \cdot 10^{+53}\right):\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -95 or -2.0500000000000002e-30 < y < -1.2499999999999999e-37 or 1.4e53 < y

    1. Initial program 99.9%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(t \cdot \left(x - y\right)\right)}{y}} \]
      2. *-commutative56.6%

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

        \[\leadsto \frac{\color{blue}{-\left(x - y\right) \cdot t}}{y} \]
      4. distribute-rgt-neg-in56.6%

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

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

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

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

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

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

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

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

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

    if -95 < y < -2.0500000000000002e-30

    1. Initial program 99.3%

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

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

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

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

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

    if -1.2499999999999999e-37 < y < 1.4e53

    1. Initial program 95.2%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -95:\\ \;\;\;\;t \cdot \left(1 - \frac{x}{y}\right)\\ \mathbf{elif}\;y \leq -2.05 \cdot 10^{-30}:\\ \;\;\;\;\left(x - y\right) \cdot \frac{t}{z}\\ \mathbf{elif}\;y \leq -1.25 \cdot 10^{-37} \lor \neg \left(y \leq 1.4 \cdot 10^{+53}\right):\\ \;\;\;\;t \cdot \left(1 - \frac{x}{y}\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{t}{z - y}\\ \end{array} \]

Alternative 5: 75.9% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := t \cdot \left(1 - \frac{x}{y}\right)\\ \mathbf{if}\;y \leq -85:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -3.9 \cdot 10^{-30}:\\ \;\;\;\;\left(x - y\right) \cdot \frac{t}{z}\\ \mathbf{elif}\;y \leq -4.4 \cdot 10^{-37} \lor \neg \left(y \leq 1.25 \cdot 10^{+53}\right):\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{x}{z - y}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* t (- 1.0 (/ x y)))))
   (if (<= y -85.0)
     t_1
     (if (<= y -3.9e-30)
       (* (- x y) (/ t z))
       (if (or (<= y -4.4e-37) (not (<= y 1.25e+53)))
         t_1
         (* t (/ x (- z y))))))))
double code(double x, double y, double z, double t) {
	double t_1 = t * (1.0 - (x / y));
	double tmp;
	if (y <= -85.0) {
		tmp = t_1;
	} else if (y <= -3.9e-30) {
		tmp = (x - y) * (t / z);
	} else if ((y <= -4.4e-37) || !(y <= 1.25e+53)) {
		tmp = t_1;
	} else {
		tmp = t * (x / (z - y));
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: tmp
    t_1 = t * (1.0d0 - (x / y))
    if (y <= (-85.0d0)) then
        tmp = t_1
    else if (y <= (-3.9d-30)) then
        tmp = (x - y) * (t / z)
    else if ((y <= (-4.4d-37)) .or. (.not. (y <= 1.25d+53))) then
        tmp = t_1
    else
        tmp = t * (x / (z - y))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = t * (1.0 - (x / y));
	double tmp;
	if (y <= -85.0) {
		tmp = t_1;
	} else if (y <= -3.9e-30) {
		tmp = (x - y) * (t / z);
	} else if ((y <= -4.4e-37) || !(y <= 1.25e+53)) {
		tmp = t_1;
	} else {
		tmp = t * (x / (z - y));
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = t * (1.0 - (x / y))
	tmp = 0
	if y <= -85.0:
		tmp = t_1
	elif y <= -3.9e-30:
		tmp = (x - y) * (t / z)
	elif (y <= -4.4e-37) or not (y <= 1.25e+53):
		tmp = t_1
	else:
		tmp = t * (x / (z - y))
	return tmp
function code(x, y, z, t)
	t_1 = Float64(t * Float64(1.0 - Float64(x / y)))
	tmp = 0.0
	if (y <= -85.0)
		tmp = t_1;
	elseif (y <= -3.9e-30)
		tmp = Float64(Float64(x - y) * Float64(t / z));
	elseif ((y <= -4.4e-37) || !(y <= 1.25e+53))
		tmp = t_1;
	else
		tmp = Float64(t * Float64(x / Float64(z - y)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = t * (1.0 - (x / y));
	tmp = 0.0;
	if (y <= -85.0)
		tmp = t_1;
	elseif (y <= -3.9e-30)
		tmp = (x - y) * (t / z);
	elseif ((y <= -4.4e-37) || ~((y <= 1.25e+53)))
		tmp = t_1;
	else
		tmp = t * (x / (z - y));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(t * N[(1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -85.0], t$95$1, If[LessEqual[y, -3.9e-30], N[(N[(x - y), $MachinePrecision] * N[(t / z), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y, -4.4e-37], N[Not[LessEqual[y, 1.25e+53]], $MachinePrecision]], t$95$1, N[(t * N[(x / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := t \cdot \left(1 - \frac{x}{y}\right)\\
\mathbf{if}\;y \leq -85:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;y \leq -4.4 \cdot 10^{-37} \lor \neg \left(y \leq 1.25 \cdot 10^{+53}\right):\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -85 or -3.9000000000000003e-30 < y < -4.40000000000000004e-37 or 1.2500000000000001e53 < y

    1. Initial program 99.9%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(t \cdot \left(x - y\right)\right)}{y}} \]
      2. *-commutative56.6%

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

        \[\leadsto \frac{\color{blue}{-\left(x - y\right) \cdot t}}{y} \]
      4. distribute-rgt-neg-in56.6%

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

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

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

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

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

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

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

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

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

    if -85 < y < -3.9000000000000003e-30

    1. Initial program 99.3%

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

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

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

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

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

    if -4.40000000000000004e-37 < y < 1.2500000000000001e53

    1. Initial program 95.2%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -85:\\ \;\;\;\;t \cdot \left(1 - \frac{x}{y}\right)\\ \mathbf{elif}\;y \leq -3.9 \cdot 10^{-30}:\\ \;\;\;\;\left(x - y\right) \cdot \frac{t}{z}\\ \mathbf{elif}\;y \leq -4.4 \cdot 10^{-37} \lor \neg \left(y \leq 1.25 \cdot 10^{+53}\right):\\ \;\;\;\;t \cdot \left(1 - \frac{x}{y}\right)\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{x}{z - y}\\ \end{array} \]

Alternative 6: 75.4% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{t}{\frac{z - y}{x}}\\ \mathbf{if}\;x \leq -0.0071:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq 5.4 \cdot 10^{-74}:\\ \;\;\;\;t \cdot \frac{-y}{z - y}\\ \mathbf{elif}\;x \leq 2.35 \cdot 10^{+73}:\\ \;\;\;\;t \cdot \left(1 - \frac{x}{y}\right)\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (/ t (/ (- z y) x))))
   (if (<= x -0.0071)
     t_1
     (if (<= x 5.4e-74)
       (* t (/ (- y) (- z y)))
       (if (<= x 2.35e+73) (* t (- 1.0 (/ x y))) t_1)))))
double code(double x, double y, double z, double t) {
	double t_1 = t / ((z - y) / x);
	double tmp;
	if (x <= -0.0071) {
		tmp = t_1;
	} else if (x <= 5.4e-74) {
		tmp = t * (-y / (z - y));
	} else if (x <= 2.35e+73) {
		tmp = t * (1.0 - (x / y));
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: tmp
    t_1 = t / ((z - y) / x)
    if (x <= (-0.0071d0)) then
        tmp = t_1
    else if (x <= 5.4d-74) then
        tmp = t * (-y / (z - y))
    else if (x <= 2.35d+73) then
        tmp = t * (1.0d0 - (x / y))
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = t / ((z - y) / x);
	double tmp;
	if (x <= -0.0071) {
		tmp = t_1;
	} else if (x <= 5.4e-74) {
		tmp = t * (-y / (z - y));
	} else if (x <= 2.35e+73) {
		tmp = t * (1.0 - (x / y));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = t / ((z - y) / x)
	tmp = 0
	if x <= -0.0071:
		tmp = t_1
	elif x <= 5.4e-74:
		tmp = t * (-y / (z - y))
	elif x <= 2.35e+73:
		tmp = t * (1.0 - (x / y))
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(t / Float64(Float64(z - y) / x))
	tmp = 0.0
	if (x <= -0.0071)
		tmp = t_1;
	elseif (x <= 5.4e-74)
		tmp = Float64(t * Float64(Float64(-y) / Float64(z - y)));
	elseif (x <= 2.35e+73)
		tmp = Float64(t * Float64(1.0 - Float64(x / y)));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = t / ((z - y) / x);
	tmp = 0.0;
	if (x <= -0.0071)
		tmp = t_1;
	elseif (x <= 5.4e-74)
		tmp = t * (-y / (z - y));
	elseif (x <= 2.35e+73)
		tmp = t * (1.0 - (x / y));
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(t / N[(N[(z - y), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -0.0071], t$95$1, If[LessEqual[x, 5.4e-74], N[(t * N[((-y) / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.35e+73], N[(t * N[(1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{t}{\frac{z - y}{x}}\\
\mathbf{if}\;x \leq -0.0071:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;x \leq 2.35 \cdot 10^{+73}:\\
\;\;\;\;t \cdot \left(1 - \frac{x}{y}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -0.0071000000000000004 or 2.3500000000000001e73 < x

    1. Initial program 98.2%

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

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

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

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

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

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

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

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

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

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

    if -0.0071000000000000004 < x < 5.40000000000000036e-74

    1. Initial program 96.5%

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

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

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

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

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

    if 5.40000000000000036e-74 < x < 2.3500000000000001e73

    1. Initial program 99.9%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(t \cdot \left(x - y\right)\right)}{y}} \]
      2. *-commutative57.5%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 89.8% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.8 \cdot 10^{+172} \lor \neg \left(y \leq 3 \cdot 10^{+131}\right):\\
\;\;\;\;t \cdot \left(1 - \frac{x}{y}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -6.7999999999999996e172 or 3.0000000000000001e131 < y

    1. Initial program 99.9%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(t \cdot \left(x - y\right)\right)}{y}} \]
      2. *-commutative63.5%

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

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

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

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

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

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

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

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

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

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

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

    if -6.7999999999999996e172 < y < 3.0000000000000001e131

    1. Initial program 96.8%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -6.8 \cdot 10^{+172} \lor \neg \left(y \leq 3 \cdot 10^{+131}\right):\\ \;\;\;\;t \cdot \left(1 - \frac{x}{y}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x - y\right) \cdot \frac{t}{z - y}\\ \end{array} \]

Alternative 8: 70.8% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -2.1 \cdot 10^{-67} \lor \neg \left(y \leq 6.2 \cdot 10^{-9}\right):\\ \;\;\;\;t \cdot \left(1 - \frac{x}{y}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{t}{\frac{z}{x}}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (or (<= y -2.1e-67) (not (<= y 6.2e-9)))
   (* t (- 1.0 (/ x y)))
   (/ t (/ z x))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((y <= -2.1e-67) || !(y <= 6.2e-9)) {
		tmp = t * (1.0 - (x / y));
	} else {
		tmp = t / (z / x);
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if ((y <= (-2.1d-67)) .or. (.not. (y <= 6.2d-9))) then
        tmp = t * (1.0d0 - (x / y))
    else
        tmp = t / (z / x)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if ((y <= -2.1e-67) || !(y <= 6.2e-9)) {
		tmp = t * (1.0 - (x / y));
	} else {
		tmp = t / (z / x);
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (y <= -2.1e-67) or not (y <= 6.2e-9):
		tmp = t * (1.0 - (x / y))
	else:
		tmp = t / (z / x)
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if ((y <= -2.1e-67) || !(y <= 6.2e-9))
		tmp = Float64(t * Float64(1.0 - Float64(x / y)));
	else
		tmp = Float64(t / Float64(z / x));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if ((y <= -2.1e-67) || ~((y <= 6.2e-9)))
		tmp = t * (1.0 - (x / y));
	else
		tmp = t / (z / x);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -2.1e-67], N[Not[LessEqual[y, 6.2e-9]], $MachinePrecision]], N[(t * N[(1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t / N[(z / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.1 \cdot 10^{-67} \lor \neg \left(y \leq 6.2 \cdot 10^{-9}\right):\\
\;\;\;\;t \cdot \left(1 - \frac{x}{y}\right)\\

\mathbf{else}:\\
\;\;\;\;\frac{t}{\frac{z}{x}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.1000000000000002e-67 or 6.2000000000000001e-9 < y

    1. Initial program 99.8%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(t \cdot \left(x - y\right)\right)}{y}} \]
      2. *-commutative54.8%

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

        \[\leadsto \frac{\color{blue}{-\left(x - y\right) \cdot t}}{y} \]
      4. distribute-rgt-neg-in54.8%

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

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

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

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

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

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

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

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

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

    if -2.1000000000000002e-67 < y < 6.2000000000000001e-9

    1. Initial program 94.2%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{t}{\frac{z}{x}}} \]
    6. Simplified75.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.1 \cdot 10^{-67} \lor \neg \left(y \leq 6.2 \cdot 10^{-9}\right):\\ \;\;\;\;t \cdot \left(1 - \frac{x}{y}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{t}{\frac{z}{x}}\\ \end{array} \]

Alternative 9: 75.4% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.25 \cdot 10^{-37} \lor \neg \left(y \leq 1.4 \cdot 10^{+53}\right):\\
\;\;\;\;t \cdot \left(1 - \frac{x}{y}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.2499999999999999e-37 or 1.4e53 < y

    1. Initial program 99.8%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(t \cdot \left(x - y\right)\right)}{y}} \]
      2. *-commutative55.0%

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

        \[\leadsto \frac{\color{blue}{-\left(x - y\right) \cdot t}}{y} \]
      4. distribute-rgt-neg-in55.0%

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

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

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

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

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

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

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

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

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

    if -1.2499999999999999e-37 < y < 1.4e53

    1. Initial program 95.2%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.25 \cdot 10^{-37} \lor \neg \left(y \leq 1.4 \cdot 10^{+53}\right):\\ \;\;\;\;t \cdot \left(1 - \frac{x}{y}\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{t}{z - y}\\ \end{array} \]

Alternative 10: 62.2% accurate, 1.0× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.30000000000000002e47 or 1.36e53 < y

    1. Initial program 99.9%

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

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

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

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

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

    if -1.30000000000000002e47 < y < 1.36e53

    1. Initial program 95.7%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.3 \cdot 10^{+47}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq 1.36 \cdot 10^{+53}:\\ \;\;\;\;t \cdot \frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]

Alternative 11: 96.9% accurate, 1.0× speedup?

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

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

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

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

Alternative 12: 34.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.6%

    \[\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/82.1%

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

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

    \[\leadsto \color{blue}{t} \]
  5. Final simplification38.1%

    \[\leadsto t \]

Developer target: 97.0% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{t}{\frac{z - y}{x - y}} \end{array} \]
(FPCore (x y z t) :precision binary64 (/ t (/ (- z y) (- x y))))
double code(double x, double y, double z, double t) {
	return t / ((z - y) / (x - y));
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = t / ((z - y) / (x - y))
end function
public static double code(double x, double y, double z, double t) {
	return t / ((z - y) / (x - y));
}
def code(x, y, z, t):
	return t / ((z - y) / (x - y))
function code(x, y, z, t)
	return Float64(t / Float64(Float64(z - y) / Float64(x - y)))
end
function tmp = code(x, y, z, t)
	tmp = t / ((z - y) / (x - y));
end
code[x_, y_, z_, t_] := N[(t / N[(N[(z - y), $MachinePrecision] / N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

Reproduce

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