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

Percentage Accurate: 96.8% → 96.8%
Time: 9.7s
Alternatives: 10
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 10 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.6%

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

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

Alternative 2: 90.4% accurate, 0.7× speedup?

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

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

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

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


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

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.00000000000000008e140 < y < 3.0000000000000001e157

    1. Initial program 96.9%

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

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

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

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

    if 3.0000000000000001e157 < y

    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/47.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 61.1% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -6.8 \cdot 10^{+107}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq -5.5 \cdot 10^{+21}:\\ \;\;\;\;\frac{x}{y} \cdot \left(-t\right)\\ \mathbf{elif}\;y \leq 2 \cdot 10^{+38}:\\ \;\;\;\;t \cdot \frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= y -6.8e+107)
   t
   (if (<= y -5.5e+21) (* (/ x y) (- t)) (if (<= y 2e+38) (* t (/ x z)) t))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= -6.8e+107) {
		tmp = t;
	} else if (y <= -5.5e+21) {
		tmp = (x / y) * -t;
	} else if (y <= 2e+38) {
		tmp = t * (x / z);
	} else {
		tmp = t;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (y <= (-6.8d+107)) then
        tmp = t
    else if (y <= (-5.5d+21)) then
        tmp = (x / y) * -t
    else if (y <= 2d+38) then
        tmp = t * (x / z)
    else
        tmp = t
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= -6.8e+107) {
		tmp = t;
	} else if (y <= -5.5e+21) {
		tmp = (x / y) * -t;
	} else if (y <= 2e+38) {
		tmp = t * (x / z);
	} else {
		tmp = t;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if y <= -6.8e+107:
		tmp = t
	elif y <= -5.5e+21:
		tmp = (x / y) * -t
	elif y <= 2e+38:
		tmp = t * (x / z)
	else:
		tmp = t
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (y <= -6.8e+107)
		tmp = t;
	elseif (y <= -5.5e+21)
		tmp = Float64(Float64(x / y) * Float64(-t));
	elseif (y <= 2e+38)
		tmp = Float64(t * Float64(x / z));
	else
		tmp = t;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (y <= -6.8e+107)
		tmp = t;
	elseif (y <= -5.5e+21)
		tmp = (x / y) * -t;
	elseif (y <= 2e+38)
		tmp = t * (x / z);
	else
		tmp = t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[y, -6.8e+107], t, If[LessEqual[y, -5.5e+21], N[(N[(x / y), $MachinePrecision] * (-t)), $MachinePrecision], If[LessEqual[y, 2e+38], N[(t * N[(x / z), $MachinePrecision]), $MachinePrecision], t]]]
\begin{array}{l}

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -6.7999999999999994e107 or 1.99999999999999995e38 < y

    1. Initial program 99.9%

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

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

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

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

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

    if -6.7999999999999994e107 < y < -5.5e21

    1. Initial program 99.7%

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

        \[\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 z around 0 44.1%

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

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

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

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

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

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

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

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

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

        \[\leadsto t - \color{blue}{\frac{t}{\frac{y}{x}}} \]
    9. Simplified60.3%

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

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

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

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

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

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

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

    if -5.5e21 < y < 1.99999999999999995e38

    1. Initial program 96.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -6.8 \cdot 10^{+107}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq -5.5 \cdot 10^{+21}:\\ \;\;\;\;\frac{x}{y} \cdot \left(-t\right)\\ \mathbf{elif}\;y \leq 2 \cdot 10^{+38}:\\ \;\;\;\;t \cdot \frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]

Alternative 4: 75.3% accurate, 0.8× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.9000000000000001e-54 or 2.2e13 < x

    1. Initial program 97.7%

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

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

    if -1.9000000000000001e-54 < x < 2.2e13

    1. Initial program 97.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 68.0% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -2.2 \cdot 10^{+109}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq 1.85 \cdot 10^{+41}:\\ \;\;\;\;x \cdot \frac{t}{z - y}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= y -2.2e+109) t (if (<= y 1.85e+41) (* x (/ t (- z y))) t)))
double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= -2.2e+109) {
		tmp = t;
	} else if (y <= 1.85e+41) {
		tmp = x * (t / (z - y));
	} else {
		tmp = t;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (y <= (-2.2d+109)) then
        tmp = t
    else if (y <= 1.85d+41) then
        tmp = x * (t / (z - y))
    else
        tmp = t
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= -2.2e+109) {
		tmp = t;
	} else if (y <= 1.85e+41) {
		tmp = x * (t / (z - y));
	} else {
		tmp = t;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if y <= -2.2e+109:
		tmp = t
	elif y <= 1.85e+41:
		tmp = x * (t / (z - y))
	else:
		tmp = t
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (y <= -2.2e+109)
		tmp = t;
	elseif (y <= 1.85e+41)
		tmp = Float64(x * Float64(t / Float64(z - y)));
	else
		tmp = t;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (y <= -2.2e+109)
		tmp = t;
	elseif (y <= 1.85e+41)
		tmp = x * (t / (z - y));
	else
		tmp = t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[y, -2.2e+109], t, If[LessEqual[y, 1.85e+41], N[(x * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.1999999999999999e109 or 1.84999999999999991e41 < y

    1. Initial program 99.9%

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

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

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

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

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

    if -2.1999999999999999e109 < y < 1.84999999999999991e41

    1. Initial program 96.4%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.2 \cdot 10^{+109}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq 1.85 \cdot 10^{+41}:\\ \;\;\;\;x \cdot \frac{t}{z - y}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]

Alternative 6: 68.8% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -7.2 \cdot 10^{+117}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq 5.2 \cdot 10^{+38}:\\ \;\;\;\;t \cdot \frac{x}{z - y}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= y -7.2e+117) t (if (<= y 5.2e+38) (* t (/ x (- z y))) t)))
double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= -7.2e+117) {
		tmp = t;
	} else if (y <= 5.2e+38) {
		tmp = t * (x / (z - y));
	} else {
		tmp = t;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (y <= (-7.2d+117)) then
        tmp = t
    else if (y <= 5.2d+38) then
        tmp = t * (x / (z - y))
    else
        tmp = t
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= -7.2e+117) {
		tmp = t;
	} else if (y <= 5.2e+38) {
		tmp = t * (x / (z - y));
	} else {
		tmp = t;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if y <= -7.2e+117:
		tmp = t
	elif y <= 5.2e+38:
		tmp = t * (x / (z - y))
	else:
		tmp = t
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (y <= -7.2e+117)
		tmp = t;
	elseif (y <= 5.2e+38)
		tmp = Float64(t * Float64(x / Float64(z - y)));
	else
		tmp = t;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (y <= -7.2e+117)
		tmp = t;
	elseif (y <= 5.2e+38)
		tmp = t * (x / (z - y));
	else
		tmp = t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[y, -7.2e+117], t, If[LessEqual[y, 5.2e+38], N[(t * N[(x / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -7.20000000000000025e117 or 5.1999999999999998e38 < y

    1. Initial program 99.9%

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

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

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

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

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

    if -7.20000000000000025e117 < y < 5.1999999999999998e38

    1. Initial program 96.4%

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

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

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

Alternative 7: 75.5% accurate, 0.8× speedup?

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

\mathbf{elif}\;x \leq 4600000000000:\\
\;\;\;\;t \cdot \frac{y}{y - z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -3.10000000000000016e-48

    1. Initial program 97.4%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{t}{\frac{z - y}{x - y}}} \]
    6. Taylor expanded in x around inf 73.6%

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

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

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

    if -3.10000000000000016e-48 < x < 4.6e12

    1. Initial program 97.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.6e12 < x

    1. Initial program 98.3%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -3.1 \cdot 10^{-48}:\\ \;\;\;\;\frac{t}{\frac{z - y}{x}}\\ \mathbf{elif}\;x \leq 4600000000000:\\ \;\;\;\;t \cdot \frac{y}{y - z}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{x}{z - y}\\ \end{array} \]

Alternative 8: 60.3% accurate, 1.0× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -8.40000000000000048e58 or 1.4199999999999999e37 < y

    1. Initial program 99.8%

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

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

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

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

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

    if -8.40000000000000048e58 < y < 1.4199999999999999e37

    1. Initial program 96.2%

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

        \[\leadsto \color{blue}{\frac{1}{\frac{z - y}{x - y}}} \cdot t \]
      2. associate-/r/96.2%

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

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

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

        \[\leadsto \color{blue}{\frac{t}{z} \cdot x} \]
      2. *-commutative59.4%

        \[\leadsto \color{blue}{x \cdot \frac{t}{z}} \]
    6. Simplified59.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -8.4 \cdot 10^{+58}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq 1.42 \cdot 10^{+37}:\\ \;\;\;\;x \cdot \frac{t}{z}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]

Alternative 9: 61.5% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -7.6 \cdot 10^{+58}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq 8.5 \cdot 10^{+38}:\\ \;\;\;\;t \cdot \frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= y -7.6e+58) t (if (<= y 8.5e+38) (* t (/ x z)) t)))
double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= -7.6e+58) {
		tmp = t;
	} else if (y <= 8.5e+38) {
		tmp = t * (x / z);
	} else {
		tmp = t;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (y <= (-7.6d+58)) then
        tmp = t
    else if (y <= 8.5d+38) then
        tmp = t * (x / z)
    else
        tmp = t
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= -7.6e+58) {
		tmp = t;
	} else if (y <= 8.5e+38) {
		tmp = t * (x / z);
	} else {
		tmp = t;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if y <= -7.6e+58:
		tmp = t
	elif y <= 8.5e+38:
		tmp = t * (x / z)
	else:
		tmp = t
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (y <= -7.6e+58)
		tmp = t;
	elseif (y <= 8.5e+38)
		tmp = Float64(t * Float64(x / z));
	else
		tmp = t;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (y <= -7.6e+58)
		tmp = t;
	elseif (y <= 8.5e+38)
		tmp = t * (x / z);
	else
		tmp = t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[y, -7.6e+58], t, If[LessEqual[y, 8.5e+38], N[(t * N[(x / z), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -7.5999999999999997e58 or 8.4999999999999997e38 < y

    1. Initial program 99.8%

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

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

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

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

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

    if -7.5999999999999997e58 < y < 8.4999999999999997e38

    1. Initial program 96.2%

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

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

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

Alternative 10: 35.7% accurate, 9.0× speedup?

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

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

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

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

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

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

    \[\leadsto \color{blue}{t} \]
  5. Final simplification34.7%

    \[\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 2023185 
(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))