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

Percentage Accurate: 97.0% → 97.0%
Time: 9.6s
Alternatives: 11
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 11 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 97.0% 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{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 95.4%

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

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

Alternative 2: 75.1% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(\frac{x}{y} + -1\right) \cdot \left(-t\right)\\ \mathbf{if}\;y \leq -5 \cdot 10^{+46}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -9.6 \cdot 10^{-255}:\\ \;\;\;\;\frac{t}{\frac{z - y}{x}}\\ \mathbf{elif}\;y \leq 1.3 \cdot 10^{-153}:\\ \;\;\;\;\frac{x - y}{\frac{z}{t}}\\ \mathbf{elif}\;y \leq 450:\\ \;\;\;\;\frac{x \cdot t}{z - y}\\ \mathbf{elif}\;y \leq 4.5 \cdot 10^{+87}:\\ \;\;\;\;t \cdot \frac{y}{y - z}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* (+ (/ x y) -1.0) (- t))))
   (if (<= y -5e+46)
     t_1
     (if (<= y -9.6e-255)
       (/ t (/ (- z y) x))
       (if (<= y 1.3e-153)
         (/ (- x y) (/ z t))
         (if (<= y 450.0)
           (/ (* x t) (- z y))
           (if (<= y 4.5e+87) (* t (/ y (- y z))) t_1)))))))
double code(double x, double y, double z, double t) {
	double t_1 = ((x / y) + -1.0) * -t;
	double tmp;
	if (y <= -5e+46) {
		tmp = t_1;
	} else if (y <= -9.6e-255) {
		tmp = t / ((z - y) / x);
	} else if (y <= 1.3e-153) {
		tmp = (x - y) / (z / t);
	} else if (y <= 450.0) {
		tmp = (x * t) / (z - y);
	} else if (y <= 4.5e+87) {
		tmp = t * (y / (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 = ((x / y) + (-1.0d0)) * -t
    if (y <= (-5d+46)) then
        tmp = t_1
    else if (y <= (-9.6d-255)) then
        tmp = t / ((z - y) / x)
    else if (y <= 1.3d-153) then
        tmp = (x - y) / (z / t)
    else if (y <= 450.0d0) then
        tmp = (x * t) / (z - y)
    else if (y <= 4.5d+87) then
        tmp = t * (y / (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 = ((x / y) + -1.0) * -t;
	double tmp;
	if (y <= -5e+46) {
		tmp = t_1;
	} else if (y <= -9.6e-255) {
		tmp = t / ((z - y) / x);
	} else if (y <= 1.3e-153) {
		tmp = (x - y) / (z / t);
	} else if (y <= 450.0) {
		tmp = (x * t) / (z - y);
	} else if (y <= 4.5e+87) {
		tmp = t * (y / (y - z));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = ((x / y) + -1.0) * -t
	tmp = 0
	if y <= -5e+46:
		tmp = t_1
	elif y <= -9.6e-255:
		tmp = t / ((z - y) / x)
	elif y <= 1.3e-153:
		tmp = (x - y) / (z / t)
	elif y <= 450.0:
		tmp = (x * t) / (z - y)
	elif y <= 4.5e+87:
		tmp = t * (y / (y - z))
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(Float64(Float64(x / y) + -1.0) * Float64(-t))
	tmp = 0.0
	if (y <= -5e+46)
		tmp = t_1;
	elseif (y <= -9.6e-255)
		tmp = Float64(t / Float64(Float64(z - y) / x));
	elseif (y <= 1.3e-153)
		tmp = Float64(Float64(x - y) / Float64(z / t));
	elseif (y <= 450.0)
		tmp = Float64(Float64(x * t) / Float64(z - y));
	elseif (y <= 4.5e+87)
		tmp = Float64(t * Float64(y / Float64(y - z)));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = ((x / y) + -1.0) * -t;
	tmp = 0.0;
	if (y <= -5e+46)
		tmp = t_1;
	elseif (y <= -9.6e-255)
		tmp = t / ((z - y) / x);
	elseif (y <= 1.3e-153)
		tmp = (x - y) / (z / t);
	elseif (y <= 450.0)
		tmp = (x * t) / (z - y);
	elseif (y <= 4.5e+87)
		tmp = t * (y / (y - z));
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(N[(x / y), $MachinePrecision] + -1.0), $MachinePrecision] * (-t)), $MachinePrecision]}, If[LessEqual[y, -5e+46], t$95$1, If[LessEqual[y, -9.6e-255], N[(t / N[(N[(z - y), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.3e-153], N[(N[(x - y), $MachinePrecision] / N[(z / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 450.0], N[(N[(x * t), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.5e+87], N[(t * N[(y / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}

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

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

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

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

\mathbf{elif}\;y \leq 4.5 \cdot 10^{+87}:\\
\;\;\;\;t \cdot \frac{y}{y - z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if y < -5.0000000000000002e46 or 4.5000000000000003e87 < y

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

    if -5.0000000000000002e46 < y < -9.5999999999999993e-255

    1. Initial program 95.1%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{x - y}{\frac{z - y}{t}}} \]
      4. div-inv89.2%

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

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

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

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

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

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

    if -9.5999999999999993e-255 < y < 1.3000000000000001e-153

    1. Initial program 88.6%

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

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

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

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

    if 1.3000000000000001e-153 < y < 450

    1. Initial program 91.1%

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

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

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

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

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

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

    if 450 < y < 4.5000000000000003e87

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -5 \cdot 10^{+46}:\\ \;\;\;\;\left(\frac{x}{y} + -1\right) \cdot \left(-t\right)\\ \mathbf{elif}\;y \leq -9.6 \cdot 10^{-255}:\\ \;\;\;\;\frac{t}{\frac{z - y}{x}}\\ \mathbf{elif}\;y \leq 1.3 \cdot 10^{-153}:\\ \;\;\;\;\frac{x - y}{\frac{z}{t}}\\ \mathbf{elif}\;y \leq 450:\\ \;\;\;\;\frac{x \cdot t}{z - y}\\ \mathbf{elif}\;y \leq 4.5 \cdot 10^{+87}:\\ \;\;\;\;t \cdot \frac{y}{y - z}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{x}{y} + -1\right) \cdot \left(-t\right)\\ \end{array} \]

Alternative 3: 66.1% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;y \leq 1100:\\
\;\;\;\;t_1\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.42e47 or 2.2000000000000001e157 < y

    1. Initial program 99.9%

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

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

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

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

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

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

    if -1.42e47 < y < 1100 or 1.02e119 < y < 2.2000000000000001e157

    1. Initial program 92.7%

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

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

    if 1100 < y < 1.02e119

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.42 \cdot 10^{+47}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq 1100:\\ \;\;\;\;t \cdot \frac{x}{z - y}\\ \mathbf{elif}\;y \leq 1.02 \cdot 10^{+119}:\\ \;\;\;\;t \cdot \frac{-y}{z}\\ \mathbf{elif}\;y \leq 2.2 \cdot 10^{+157}:\\ \;\;\;\;t \cdot \frac{x}{z - y}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]

Alternative 4: 74.9% accurate, 0.6× speedup?

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -2.25e44 or 0.11799999999999999 < y

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.25e44 < y < -1.46e-255

    1. Initial program 95.1%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{x - y}{\frac{z - y}{t}}} \]
      4. div-inv89.1%

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

        \[\leadsto \color{blue}{\frac{\frac{x - y}{z - y}}{\frac{1}{t}}} \]
    5. Applied egg-rr95.0%

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

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

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

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

    if -1.46e-255 < y < 1.06e-153

    1. Initial program 88.6%

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

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

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

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

    if 1.06e-153 < y < 0.11799999999999999

    1. Initial program 91.1%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.25 \cdot 10^{+44}:\\ \;\;\;\;t \cdot \frac{y}{y - z}\\ \mathbf{elif}\;y \leq -1.46 \cdot 10^{-255}:\\ \;\;\;\;\frac{t}{\frac{z - y}{x}}\\ \mathbf{elif}\;y \leq 1.06 \cdot 10^{-153}:\\ \;\;\;\;\frac{x - y}{\frac{z}{t}}\\ \mathbf{elif}\;y \leq 0.118:\\ \;\;\;\;\frac{x \cdot t}{z - y}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{y}{y - z}\\ \end{array} \]

Alternative 5: 89.4% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.3 \cdot 10^{+107} \lor \neg \left(y \leq 2 \cdot 10^{+113}\right):\\
\;\;\;\;\left(\frac{x}{y} + -1\right) \cdot \left(-t\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 < -1.3000000000000001e107 or 2e113 < y

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

    if -1.3000000000000001e107 < y < 2e113

    1. Initial program 93.5%

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

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

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

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

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

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

Alternative 6: 60.5% accurate, 0.7× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -5.8999999999999999e46 or 3.5000000000000002e108 < y

    1. Initial program 99.9%

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

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

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

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

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

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

    if -5.8999999999999999e46 < y < 82

    1. Initial program 92.2%

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

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

    if 82 < y < 3.5000000000000002e108

    1. Initial program 99.7%

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{\frac{t}{\frac{z}{y}}} \]
      3. distribute-neg-frac57.9%

        \[\leadsto \color{blue}{\frac{-t}{\frac{z}{y}}} \]
    7. Simplified57.9%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -5.9 \cdot 10^{+46}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq 82:\\ \;\;\;\;t \cdot \frac{x}{z}\\ \mathbf{elif}\;y \leq 3.5 \cdot 10^{+108}:\\ \;\;\;\;y \cdot \left(-\frac{t}{z}\right)\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]

Alternative 7: 60.6% accurate, 0.7× speedup?

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

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

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

\mathbf{elif}\;y \leq 3.5 \cdot 10^{+108}:\\
\;\;\;\;t \cdot \frac{-y}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -5.60000000000000037e46 or 3.5000000000000002e108 < y

    1. Initial program 99.9%

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

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

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

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

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

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

    if -5.60000000000000037e46 < y < 1.4199999999999999

    1. Initial program 92.2%

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

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

    if 1.4199999999999999 < y < 3.5000000000000002e108

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

Alternative 8: 75.3% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.6 \cdot 10^{+45} \lor \neg \left(y \leq 0.0265\right):\\
\;\;\;\;t \cdot \frac{y}{y - z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -7.6000000000000004e45 or 0.0264999999999999993 < y

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -7.6000000000000004e45 < y < 0.0264999999999999993

    1. Initial program 92.2%

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

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

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

Alternative 9: 60.2% accurate, 1.0× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.8e-27 or 3.1e26 < y

    1. Initial program 99.8%

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

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

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

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

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

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

    if -2.8e-27 < y < 3.1e26

    1. Initial program 91.8%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{x - y}{\frac{z - y}{t}}} \]
      4. div-inv94.7%

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

        \[\leadsto \color{blue}{\frac{\frac{x - y}{z - y}}{\frac{1}{t}}} \]
    5. Applied egg-rr91.7%

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

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

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

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

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

Alternative 10: 62.0% accurate, 1.0× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -5.60000000000000037e46 or 4.9e20 < y

    1. Initial program 99.8%

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

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

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

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

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

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

    if -5.60000000000000037e46 < y < 4.9e20

    1. Initial program 92.5%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -5.6 \cdot 10^{+46}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq 4.9 \cdot 10^{+20}:\\ \;\;\;\;t \cdot \frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]

Alternative 11: 35.3% 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 95.4%

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

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

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

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

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

    \[\leadsto \color{blue}{t} \]
  5. Final simplification31.0%

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