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

Percentage Accurate: 97.1% → 97.1%
Time: 12.8s
Alternatives: 14
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 14 alternatives:

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

Initial Program: 97.1% accurate, 1.0× speedup?

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

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

Alternative 1: 97.1% accurate, 1.0× speedup?

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

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

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

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

Alternative 2: 62.7% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(y - x\right) \cdot \frac{t}{y}\\ \mathbf{if}\;y \leq -1.8 \cdot 10^{+94}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq -1.65 \cdot 10^{-143}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 9.5 \cdot 10^{-167}:\\ \;\;\;\;t \cdot \frac{x}{z}\\ \mathbf{elif}\;y \leq 1.75 \cdot 10^{-110}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 520000000000:\\ \;\;\;\;\frac{t}{\frac{z}{x}}\\ \mathbf{elif}\;y \leq 1.08 \cdot 10^{+194}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* (- y x) (/ t y))))
   (if (<= y -1.8e+94)
     t
     (if (<= y -1.65e-143)
       t_1
       (if (<= y 9.5e-167)
         (* t (/ x z))
         (if (<= y 1.75e-110)
           t_1
           (if (<= y 520000000000.0)
             (/ t (/ z x))
             (if (<= y 1.08e+194) t_1 t))))))))
double code(double x, double y, double z, double t) {
	double t_1 = (y - x) * (t / y);
	double tmp;
	if (y <= -1.8e+94) {
		tmp = t;
	} else if (y <= -1.65e-143) {
		tmp = t_1;
	} else if (y <= 9.5e-167) {
		tmp = t * (x / z);
	} else if (y <= 1.75e-110) {
		tmp = t_1;
	} else if (y <= 520000000000.0) {
		tmp = t / (z / x);
	} else if (y <= 1.08e+194) {
		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 = (y - x) * (t / y)
    if (y <= (-1.8d+94)) then
        tmp = t
    else if (y <= (-1.65d-143)) then
        tmp = t_1
    else if (y <= 9.5d-167) then
        tmp = t * (x / z)
    else if (y <= 1.75d-110) then
        tmp = t_1
    else if (y <= 520000000000.0d0) then
        tmp = t / (z / x)
    else if (y <= 1.08d+194) 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 = (y - x) * (t / y);
	double tmp;
	if (y <= -1.8e+94) {
		tmp = t;
	} else if (y <= -1.65e-143) {
		tmp = t_1;
	} else if (y <= 9.5e-167) {
		tmp = t * (x / z);
	} else if (y <= 1.75e-110) {
		tmp = t_1;
	} else if (y <= 520000000000.0) {
		tmp = t / (z / x);
	} else if (y <= 1.08e+194) {
		tmp = t_1;
	} else {
		tmp = t;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = (y - x) * (t / y)
	tmp = 0
	if y <= -1.8e+94:
		tmp = t
	elif y <= -1.65e-143:
		tmp = t_1
	elif y <= 9.5e-167:
		tmp = t * (x / z)
	elif y <= 1.75e-110:
		tmp = t_1
	elif y <= 520000000000.0:
		tmp = t / (z / x)
	elif y <= 1.08e+194:
		tmp = t_1
	else:
		tmp = t
	return tmp
function code(x, y, z, t)
	t_1 = Float64(Float64(y - x) * Float64(t / y))
	tmp = 0.0
	if (y <= -1.8e+94)
		tmp = t;
	elseif (y <= -1.65e-143)
		tmp = t_1;
	elseif (y <= 9.5e-167)
		tmp = Float64(t * Float64(x / z));
	elseif (y <= 1.75e-110)
		tmp = t_1;
	elseif (y <= 520000000000.0)
		tmp = Float64(t / Float64(z / x));
	elseif (y <= 1.08e+194)
		tmp = t_1;
	else
		tmp = t;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = (y - x) * (t / y);
	tmp = 0.0;
	if (y <= -1.8e+94)
		tmp = t;
	elseif (y <= -1.65e-143)
		tmp = t_1;
	elseif (y <= 9.5e-167)
		tmp = t * (x / z);
	elseif (y <= 1.75e-110)
		tmp = t_1;
	elseif (y <= 520000000000.0)
		tmp = t / (z / x);
	elseif (y <= 1.08e+194)
		tmp = t_1;
	else
		tmp = t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y - x), $MachinePrecision] * N[(t / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.8e+94], t, If[LessEqual[y, -1.65e-143], t$95$1, If[LessEqual[y, 9.5e-167], N[(t * N[(x / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.75e-110], t$95$1, If[LessEqual[y, 520000000000.0], N[(t / N[(z / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.08e+194], t$95$1, t]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq -1.65 \cdot 10^{-143}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;y \leq 1.75 \cdot 10^{-110}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;y \leq 1.08 \cdot 10^{+194}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -1.79999999999999996e94 or 1.08e194 < y

    1. Initial program 99.9%

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

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

    if -1.79999999999999996e94 < y < -1.65e-143 or 9.49999999999999955e-167 < y < 1.74999999999999987e-110 or 5.2e11 < y < 1.08e194

    1. Initial program 93.9%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Step-by-step derivation
      1. *-commutative93.9%

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

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

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

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

        \[\leadsto \frac{t}{\frac{z - y}{\color{blue}{\left(-y\right) + x}}} \]
      6. neg-sub093.6%

        \[\leadsto \frac{t}{\frac{z - y}{\color{blue}{\left(0 - y\right)} + x}} \]
      7. associate-+l-93.6%

        \[\leadsto \frac{t}{\frac{z - y}{\color{blue}{0 - \left(y - x\right)}}} \]
      8. sub0-neg93.6%

        \[\leadsto \frac{t}{\frac{z - y}{\color{blue}{-\left(y - x\right)}}} \]
      9. neg-mul-193.6%

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

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

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

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

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

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

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

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

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

    if -1.65e-143 < y < 9.49999999999999955e-167

    1. Initial program 94.3%

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

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

    if 1.74999999999999987e-110 < y < 5.2e11

    1. Initial program 96.5%

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

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

        \[\leadsto \color{blue}{\frac{t}{\frac{z}{x}}} \]
    4. Simplified57.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.8 \cdot 10^{+94}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq -1.65 \cdot 10^{-143}:\\ \;\;\;\;\left(y - x\right) \cdot \frac{t}{y}\\ \mathbf{elif}\;y \leq 9.5 \cdot 10^{-167}:\\ \;\;\;\;t \cdot \frac{x}{z}\\ \mathbf{elif}\;y \leq 1.75 \cdot 10^{-110}:\\ \;\;\;\;\left(y - x\right) \cdot \frac{t}{y}\\ \mathbf{elif}\;y \leq 520000000000:\\ \;\;\;\;\frac{t}{\frac{z}{x}}\\ \mathbf{elif}\;y \leq 1.08 \cdot 10^{+194}:\\ \;\;\;\;\left(y - x\right) \cdot \frac{t}{y}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]

Alternative 3: 89.5% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;y \leq -5.6 \cdot 10^{-259}:\\
\;\;\;\;t_1\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -3.54999999999999996e78 or 3.99999999999999993e157 < y

    1. Initial program 99.9%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Step-by-step derivation
      1. *-commutative99.9%

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

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

        \[\leadsto \color{blue}{\frac{t}{\frac{z - y}{x - y}}} \]
      4. sub-neg99.9%

        \[\leadsto \frac{t}{\frac{z - y}{\color{blue}{x + \left(-y\right)}}} \]
      5. +-commutative99.9%

        \[\leadsto \frac{t}{\frac{z - y}{\color{blue}{\left(-y\right) + x}}} \]
      6. neg-sub099.9%

        \[\leadsto \frac{t}{\frac{z - y}{\color{blue}{\left(0 - y\right)} + x}} \]
      7. associate-+l-99.9%

        \[\leadsto \frac{t}{\frac{z - y}{\color{blue}{0 - \left(y - x\right)}}} \]
      8. sub0-neg99.9%

        \[\leadsto \frac{t}{\frac{z - y}{\color{blue}{-\left(y - x\right)}}} \]
      9. neg-mul-199.9%

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

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

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

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

    if -3.54999999999999996e78 < y < -5.5999999999999999e-259 or 1.15000000000000006e-227 < y < 3.99999999999999993e157

    1. Initial program 93.9%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Step-by-step derivation
      1. *-commutative93.9%

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

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

        \[\leadsto \color{blue}{\frac{t}{\frac{z - y}{x - y}}} \]
      4. sub-neg94.0%

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

        \[\leadsto \frac{t}{\frac{z - y}{\color{blue}{\left(-y\right) + x}}} \]
      6. neg-sub094.0%

        \[\leadsto \frac{t}{\frac{z - y}{\color{blue}{\left(0 - y\right)} + x}} \]
      7. associate-+l-94.0%

        \[\leadsto \frac{t}{\frac{z - y}{\color{blue}{0 - \left(y - x\right)}}} \]
      8. sub0-neg94.0%

        \[\leadsto \frac{t}{\frac{z - y}{\color{blue}{-\left(y - x\right)}}} \]
      9. neg-mul-194.0%

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

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

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

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

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

    if -5.5999999999999999e-259 < y < 1.15000000000000006e-227

    1. Initial program 95.2%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.55 \cdot 10^{+78}:\\ \;\;\;\;\frac{t}{\frac{y - z}{y}}\\ \mathbf{elif}\;y \leq -5.6 \cdot 10^{-259}:\\ \;\;\;\;\frac{t}{y - z} \cdot \left(y - x\right)\\ \mathbf{elif}\;y \leq 1.15 \cdot 10^{-227}:\\ \;\;\;\;t \cdot \frac{x}{z - y}\\ \mathbf{elif}\;y \leq 4 \cdot 10^{+157}:\\ \;\;\;\;\frac{t}{y - z} \cdot \left(y - x\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{t}{\frac{y - z}{y}}\\ \end{array} \]

Alternative 4: 66.2% accurate, 0.7× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.5499999999999999e25 or 9.9999999999999998e119 < y

    1. Initial program 99.9%

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

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

    if -1.5499999999999999e25 < y < -1.02000000000000004e-97

    1. Initial program 85.6%

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

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

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

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

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

    if -1.02000000000000004e-97 < y < 9.9999999999999998e119

    1. Initial program 94.7%

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

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

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

Alternative 5: 73.1% accurate, 0.7× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -2.4000000000000001e200 or 6.00000000000000007e-43 < z

    1. Initial program 96.0%

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

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

    if -2.4000000000000001e200 < z < -1.12000000000000008e-6

    1. Initial program 98.2%

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

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

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

        \[\leadsto \color{blue}{\frac{t}{\frac{z - y}{x - y}}} \]
      4. sub-neg97.5%

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

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

        \[\leadsto \frac{t}{\frac{z - y}{\color{blue}{\left(0 - y\right)} + x}} \]
      7. associate-+l-97.5%

        \[\leadsto \frac{t}{\frac{z - y}{\color{blue}{0 - \left(y - x\right)}}} \]
      8. sub0-neg97.5%

        \[\leadsto \frac{t}{\frac{z - y}{\color{blue}{-\left(y - x\right)}}} \]
      9. neg-mul-197.5%

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

        \[\leadsto \frac{t}{\color{blue}{\frac{\frac{z - y}{-1}}{y - x}}} \]
    3. Simplified97.5%

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

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

    if -1.12000000000000008e-6 < z < 6.00000000000000007e-43

    1. Initial program 95.0%

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

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

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

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

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

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

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

        \[\leadsto t + \color{blue}{-1 \cdot \frac{t \cdot x - t \cdot z}{y}} \]
      7. mul-1-neg85.1%

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

        \[\leadsto \color{blue}{t - \frac{t \cdot x - t \cdot z}{y}} \]
      9. distribute-lft-out--85.1%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.4 \cdot 10^{+200}:\\ \;\;\;\;t \cdot \frac{x - y}{z}\\ \mathbf{elif}\;z \leq -1.12 \cdot 10^{-6}:\\ \;\;\;\;\frac{t}{\frac{y - z}{y}}\\ \mathbf{elif}\;z \leq 6 \cdot 10^{-43}:\\ \;\;\;\;t - x \cdot \frac{t}{y}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{x - y}{z}\\ \end{array} \]

Alternative 6: 59.2% accurate, 0.8× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.6999999999999999e63 or 2.4e76 < y

    1. Initial program 99.9%

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

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

    if -1.6999999999999999e63 < y < -1.65e-143

    1. Initial program 91.1%

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

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

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

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

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

        \[\leadsto \frac{t}{\frac{z - y}{\color{blue}{\left(-y\right) + x}}} \]
      6. neg-sub090.4%

        \[\leadsto \frac{t}{\frac{z - y}{\color{blue}{\left(0 - y\right)} + x}} \]
      7. associate-+l-90.4%

        \[\leadsto \frac{t}{\frac{z - y}{\color{blue}{0 - \left(y - x\right)}}} \]
      8. sub0-neg90.4%

        \[\leadsto \frac{t}{\frac{z - y}{\color{blue}{-\left(y - x\right)}}} \]
      9. neg-mul-190.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{\frac{x}{\frac{y}{-t}}} \]
      11. add-sqr-sqrt5.8%

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

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

        \[\leadsto -\frac{x}{\frac{y}{\sqrt{\color{blue}{t \cdot t}}}} \]
      14. sqrt-unprod21.7%

        \[\leadsto -\frac{x}{\frac{y}{\color{blue}{\sqrt{t} \cdot \sqrt{t}}}} \]
      15. add-sqr-sqrt39.8%

        \[\leadsto -\frac{x}{\frac{y}{\color{blue}{t}}} \]
    11. Applied egg-rr39.8%

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

    if -1.65e-143 < y < 2.4e76

    1. Initial program 94.6%

      \[\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 3 regimes into one program.
  4. Final simplification63.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.7 \cdot 10^{+63}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq -1.65 \cdot 10^{-143}:\\ \;\;\;\;\frac{-x}{\frac{y}{t}}\\ \mathbf{elif}\;y \leq 2.4 \cdot 10^{+76}:\\ \;\;\;\;t \cdot \frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]

Alternative 7: 59.4% accurate, 0.8× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -2.2999999999999999e24 or 8.50000000000000028e74 < y

    1. Initial program 99.9%

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

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

    if -2.2999999999999999e24 < y < -1.39999999999999999e-144

    1. Initial program 86.8%

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

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

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

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

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

    if -1.39999999999999999e-144 < y < 8.50000000000000028e74

    1. Initial program 94.7%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.3 \cdot 10^{+24}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq -1.4 \cdot 10^{-144}:\\ \;\;\;\;\frac{t \cdot \left(-y\right)}{z}\\ \mathbf{elif}\;y \leq 8.5 \cdot 10^{+74}:\\ \;\;\;\;t \cdot \frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]

Alternative 8: 68.8% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.7 \cdot 10^{+69} \lor \neg \left(z \leq 4.2 \cdot 10^{-43}\right):\\
\;\;\;\;t \cdot \frac{x - y}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.6999999999999998e69 or 4.2000000000000001e-43 < z

    1. Initial program 96.4%

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

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

    if -2.6999999999999998e69 < z < 4.2000000000000001e-43

    1. Initial program 95.5%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Step-by-step derivation
      1. *-commutative95.5%

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

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

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

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

        \[\leadsto \frac{t}{\frac{z - y}{\color{blue}{\left(-y\right) + x}}} \]
      6. neg-sub096.4%

        \[\leadsto \frac{t}{\frac{z - y}{\color{blue}{\left(0 - y\right)} + x}} \]
      7. associate-+l-96.4%

        \[\leadsto \frac{t}{\frac{z - y}{\color{blue}{0 - \left(y - x\right)}}} \]
      8. sub0-neg96.4%

        \[\leadsto \frac{t}{\frac{z - y}{\color{blue}{-\left(y - x\right)}}} \]
      9. neg-mul-196.4%

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

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

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

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

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

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

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

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

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

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

Alternative 9: 74.3% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.5 \cdot 10^{+86} \lor \neg \left(z \leq 3.2 \cdot 10^{-43}\right):\\
\;\;\;\;t \cdot \frac{x - y}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -6.49999999999999996e86 or 3.19999999999999985e-43 < z

    1. Initial program 96.3%

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

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

    if -6.49999999999999996e86 < z < 3.19999999999999985e-43

    1. Initial program 95.6%

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 73.4% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.15 \cdot 10^{+86} \lor \neg \left(z \leq 4.4 \cdot 10^{-43}\right):\\
\;\;\;\;t \cdot \frac{x - y}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.1500000000000001e86 or 4.39999999999999994e-43 < z

    1. Initial program 96.3%

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

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

    if -2.1500000000000001e86 < z < 4.39999999999999994e-43

    1. Initial program 95.6%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{t - \frac{t \cdot x - t \cdot z}{y}} \]
      9. distribute-lft-out--80.2%

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

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

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

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

        \[\leadsto t - \color{blue}{\frac{t}{y} \cdot x} \]
      2. *-commutative84.0%

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

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

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

Alternative 11: 40.9% accurate, 1.0× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.4e-127 or 8.7999999999999999e-71 < y

    1. Initial program 98.0%

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

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

    if -1.4e-127 < y < 8.7999999999999999e-71

    1. Initial program 92.4%

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

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\left(-\frac{y}{z}\right) \cdot t\right)\right)} \]
      2. expm1-udef18.7%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\left(-\frac{y}{z}\right) \cdot t\right)} - 1} \]
      3. add-sqr-sqrt14.6%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\left(\sqrt{-\frac{y}{z}} \cdot \sqrt{-\frac{y}{z}}\right)} \cdot t\right)} - 1 \]
      4. sqrt-unprod18.8%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\sqrt{\left(-\frac{y}{z}\right) \cdot \left(-\frac{y}{z}\right)}} \cdot t\right)} - 1 \]
      5. sqr-neg18.8%

        \[\leadsto e^{\mathsf{log1p}\left(\sqrt{\color{blue}{\frac{y}{z} \cdot \frac{y}{z}}} \cdot t\right)} - 1 \]
      6. sqrt-unprod13.5%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\left(\sqrt{\frac{y}{z}} \cdot \sqrt{\frac{y}{z}}\right)} \cdot t\right)} - 1 \]
      7. add-sqr-sqrt18.7%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\frac{y}{z}} \cdot t\right)} - 1 \]
      8. *-commutative18.7%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{t \cdot \frac{y}{z}}\right)} - 1 \]
    7. Applied egg-rr18.7%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(t \cdot \frac{y}{z}\right)} - 1} \]
    8. Step-by-step derivation
      1. expm1-def18.7%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(t \cdot \frac{y}{z}\right)\right)} \]
      2. expm1-log1p20.1%

        \[\leadsto \color{blue}{t \cdot \frac{y}{z}} \]
      3. associate-*r/20.1%

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

        \[\leadsto \color{blue}{\frac{t}{z} \cdot y} \]
      5. *-commutative25.1%

        \[\leadsto \color{blue}{y \cdot \frac{t}{z}} \]
    9. Simplified25.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.4 \cdot 10^{-127}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq 8.8 \cdot 10^{-71}:\\ \;\;\;\;y \cdot \frac{t}{z}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]

Alternative 12: 60.8% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2050000:\\
\;\;\;\;t\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.05e6 or 1.25000000000000005e47 < y

    1. Initial program 99.8%

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

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

    if -2.05e6 < y < 1.25000000000000005e47

    1. Initial program 92.6%

      \[\frac{x - y}{z - y} \cdot t \]
    2. Step-by-step derivation
      1. *-commutative92.6%

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

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

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

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

        \[\leadsto \frac{t}{\frac{z - y}{\color{blue}{\left(-y\right) + x}}} \]
      6. neg-sub092.2%

        \[\leadsto \frac{t}{\frac{z - y}{\color{blue}{\left(0 - y\right)} + x}} \]
      7. associate-+l-92.2%

        \[\leadsto \frac{t}{\frac{z - y}{\color{blue}{0 - \left(y - x\right)}}} \]
      8. sub0-neg92.2%

        \[\leadsto \frac{t}{\frac{z - y}{\color{blue}{-\left(y - x\right)}}} \]
      9. neg-mul-192.2%

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

        \[\leadsto \frac{t}{\color{blue}{\frac{\frac{z - y}{-1}}{y - x}}} \]
    3. Simplified92.2%

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

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

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

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

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

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

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

Alternative 13: 61.5% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -105000:\\
\;\;\;\;t\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -105000 or 2.80000000000000012e75 < y

    1. Initial program 99.9%

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

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

    if -105000 < y < 2.80000000000000012e75

    1. Initial program 93.0%

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

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

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

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

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

    \[\leadsto \color{blue}{t} \]
  3. Final simplification35.7%

    \[\leadsto t \]

Developer target: 97.1% accurate, 1.0× speedup?

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

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

Reproduce

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