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

Percentage Accurate: 97.2% → 97.2%
Time: 8.9s
Alternatives: 13
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 13 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.2% 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.2% accurate, 1.0× speedup?

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

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

    \[\frac{x - y}{z - y} \cdot t \]
  2. Add Preprocessing
  3. Add Preprocessing

Alternative 2: 72.2% accurate, 0.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -9 \cdot 10^{+84} \lor \neg \left(y \leq 1.95 \cdot 10^{-91} \lor \neg \left(y \leq 5.5 \cdot 10^{-71}\right) \land y \leq 9.5 \cdot 10^{-28}\right):\\
\;\;\;\;t \cdot \frac{y - x}{y}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -8.9999999999999994e84 or 1.94999999999999997e-91 < y < 5.4999999999999997e-71 or 9.50000000000000001e-28 < y

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{t}{\color{blue}{-\frac{y}{x - y}}} \]
      2. distribute-neg-frac282.7%

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

        \[\leadsto \frac{t}{\frac{y}{-\color{blue}{\left(x + \left(-y\right)\right)}}} \]
      4. distribute-neg-in82.7%

        \[\leadsto \frac{t}{\frac{y}{\color{blue}{\left(-x\right) + \left(-\left(-y\right)\right)}}} \]
      5. remove-double-neg82.7%

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

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

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

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

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

    if -8.9999999999999994e84 < y < 1.94999999999999997e-91 or 5.4999999999999997e-71 < y < 9.50000000000000001e-28

    1. Initial program 94.4%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -9 \cdot 10^{+84} \lor \neg \left(y \leq 1.95 \cdot 10^{-91} \lor \neg \left(y \leq 5.5 \cdot 10^{-71}\right) \land y \leq 9.5 \cdot 10^{-28}\right):\\ \;\;\;\;t \cdot \frac{y - x}{y}\\ \mathbf{else}:\\ \;\;\;\;\left(x - y\right) \cdot \frac{t}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 75.1% accurate, 0.3× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{t}{1 - \frac{z}{y}}\\
\mathbf{if}\;y \leq -1.7 \cdot 10^{+21}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;y \leq -5.8 \cdot 10^{-55} \lor \neg \left(y \leq 2.1 \cdot 10^{+43}\right):\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.7e21 or -2.19999999999999997e-43 < y < -5.8e-55 or 2.10000000000000002e43 < y

    1. Initial program 99.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{t}{-\left(\frac{z}{y} + \left(-\color{blue}{1}\right)\right)} \]
      5. metadata-eval85.8%

        \[\leadsto \frac{t}{-\left(\frac{z}{y} + \color{blue}{-1}\right)} \]
    9. Simplified85.8%

      \[\leadsto \frac{t}{\color{blue}{-\left(\frac{z}{y} + -1\right)}} \]
    10. Taylor expanded in t around 0 85.8%

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

    if -1.7e21 < y < -2.19999999999999997e-43

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

    if -5.8e-55 < y < 2.10000000000000002e43

    1. Initial program 94.7%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.7 \cdot 10^{+21}:\\ \;\;\;\;\frac{t}{1 - \frac{z}{y}}\\ \mathbf{elif}\;y \leq -2.2 \cdot 10^{-43}:\\ \;\;\;\;\left(x - y\right) \cdot \frac{t}{z}\\ \mathbf{elif}\;y \leq -5.8 \cdot 10^{-55} \lor \neg \left(y \leq 2.1 \cdot 10^{+43}\right):\\ \;\;\;\;\frac{t}{1 - \frac{z}{y}}\\ \mathbf{else}:\\ \;\;\;\;\frac{t}{\frac{z - y}{x}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 75.1% accurate, 0.3× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{t}{1 - \frac{z}{y}}\\
\mathbf{if}\;y \leq -1.65 \cdot 10^{+21}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;y \leq -4.6 \cdot 10^{-55} \lor \neg \left(y \leq 6.7 \cdot 10^{+49}\right):\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.65e21 or -4.4999999999999999e-45 < y < -4.60000000000000023e-55 or 6.6999999999999999e49 < y

    1. Initial program 99.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{t}{-\left(\frac{z}{y} + \left(-\color{blue}{1}\right)\right)} \]
      5. metadata-eval85.8%

        \[\leadsto \frac{t}{-\left(\frac{z}{y} + \color{blue}{-1}\right)} \]
    9. Simplified85.8%

      \[\leadsto \frac{t}{\color{blue}{-\left(\frac{z}{y} + -1\right)}} \]
    10. Taylor expanded in t around 0 85.8%

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

    if -1.65e21 < y < -4.4999999999999999e-45

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

    if -4.60000000000000023e-55 < y < 6.6999999999999999e49

    1. Initial program 94.7%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.65 \cdot 10^{+21}:\\ \;\;\;\;\frac{t}{1 - \frac{z}{y}}\\ \mathbf{elif}\;y \leq -4.5 \cdot 10^{-45}:\\ \;\;\;\;\left(x - y\right) \cdot \frac{t}{z}\\ \mathbf{elif}\;y \leq -4.6 \cdot 10^{-55} \lor \neg \left(y \leq 6.7 \cdot 10^{+49}\right):\\ \;\;\;\;\frac{t}{1 - \frac{z}{y}}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{x}{z - y}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 68.4% accurate, 0.3× speedup?

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

\\
\begin{array}{l}
t_1 := t \cdot \frac{y - x}{y}\\
\mathbf{if}\;y \leq -9 \cdot 10^{+84}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;y \leq -1.4 \cdot 10^{-55} \lor \neg \left(y \leq 1.6 \cdot 10^{-91}\right):\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -8.9999999999999994e84 or -1.24999999999999993e33 < y < -1.39999999999999992e-55 or 1.59999999999999998e-91 < y

    1. Initial program 99.2%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{t}{\color{blue}{-\frac{y}{x - y}}} \]
      2. distribute-neg-frac275.3%

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

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

        \[\leadsto \frac{t}{\frac{y}{\color{blue}{\left(-x\right) + \left(-\left(-y\right)\right)}}} \]
      5. remove-double-neg75.3%

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

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

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

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

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

    if -8.9999999999999994e84 < y < -1.24999999999999993e33

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.39999999999999992e-55 < y < 1.59999999999999998e-91

    1. Initial program 93.2%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -9 \cdot 10^{+84}:\\ \;\;\;\;t \cdot \frac{y - x}{y}\\ \mathbf{elif}\;y \leq -1.25 \cdot 10^{+33}:\\ \;\;\;\;\frac{y}{z} \cdot \left(-t\right)\\ \mathbf{elif}\;y \leq -1.4 \cdot 10^{-55} \lor \neg \left(y \leq 1.6 \cdot 10^{-91}\right):\\ \;\;\;\;t \cdot \frac{y - x}{y}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{x}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 74.8% accurate, 0.3× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{t}{1 - \frac{z}{y}}\\
\mathbf{if}\;y \leq -4.5 \cdot 10^{+22}:\\
\;\;\;\;t\_1\\

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -4.4999999999999998e22 or 4.3e39 < y

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{t}{-\left(\frac{z}{y} + \left(-\color{blue}{1}\right)\right)} \]
      5. metadata-eval85.8%

        \[\leadsto \frac{t}{-\left(\frac{z}{y} + \color{blue}{-1}\right)} \]
    9. Simplified85.8%

      \[\leadsto \frac{t}{\color{blue}{-\left(\frac{z}{y} + -1\right)}} \]
    10. Taylor expanded in t around 0 85.8%

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

    if -4.4999999999999998e22 < y < -4.2999999999999999e-45

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

    if -4.2999999999999999e-45 < y < -3.3999999999999999e-81

    1. Initial program 80.6%

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

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

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

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

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

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

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

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

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

    if -3.3999999999999999e-81 < y < 4.3e39

    1. Initial program 95.6%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -4.5 \cdot 10^{+22}:\\ \;\;\;\;\frac{t}{1 - \frac{z}{y}}\\ \mathbf{elif}\;y \leq -4.3 \cdot 10^{-45}:\\ \;\;\;\;\left(x - y\right) \cdot \frac{t}{z}\\ \mathbf{elif}\;y \leq -3.4 \cdot 10^{-81}:\\ \;\;\;\;y \cdot \frac{t}{y - z}\\ \mathbf{elif}\;y \leq 4.3 \cdot 10^{+39}:\\ \;\;\;\;\frac{t}{\frac{z - y}{x}}\\ \mathbf{else}:\\ \;\;\;\;\frac{t}{1 - \frac{z}{y}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 59.3% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;y \leq -1.45 \cdot 10^{-46} \lor \neg \left(y \leq -3.4 \cdot 10^{-55}\right) \land y \leq 2.15 \cdot 10^{+41}:\\
\;\;\;\;x \cdot \frac{t}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.7000000000000001e89 or -1.45000000000000002e-46 < y < -3.39999999999999973e-55 or 2.15000000000000012e41 < y

    1. Initial program 99.0%

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

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

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

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

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

    if -1.7000000000000001e89 < y < -1.45000000000000002e-46 or -3.39999999999999973e-55 < y < 2.15000000000000012e41

    1. Initial program 95.5%

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

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

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

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

      \[\leadsto \color{blue}{\frac{t \cdot x}{z}} \]
    6. Step-by-step derivation
      1. *-commutative54.7%

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

        \[\leadsto \color{blue}{x \cdot \frac{t}{z}} \]
    7. Simplified56.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.7 \cdot 10^{+89}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq -1.45 \cdot 10^{-46} \lor \neg \left(y \leq -3.4 \cdot 10^{-55}\right) \land y \leq 2.15 \cdot 10^{+41}:\\ \;\;\;\;x \cdot \frac{t}{z}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 60.2% accurate, 0.4× speedup?

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

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

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

\mathbf{elif}\;y \leq -4.6 \cdot 10^{-55}:\\
\;\;\;\;t\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.7000000000000001e89 or -2.2999999999999999e-46 < y < -4.60000000000000023e-55 or 1.25000000000000001e40 < y

    1. Initial program 99.0%

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

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

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

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

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

    if -1.7000000000000001e89 < y < -2.2999999999999999e-46

    1. Initial program 99.8%

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

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

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

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

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

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

        \[\leadsto \color{blue}{x \cdot \frac{t}{z}} \]
    7. Simplified38.7%

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

    if -4.60000000000000023e-55 < y < 1.25000000000000001e40

    1. Initial program 94.7%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.7 \cdot 10^{+89}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq -2.3 \cdot 10^{-46}:\\ \;\;\;\;x \cdot \frac{t}{z}\\ \mathbf{elif}\;y \leq -4.6 \cdot 10^{-55}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq 1.25 \cdot 10^{+40}:\\ \;\;\;\;t \cdot \frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 74.2% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
t_1 := t \cdot \frac{y - x}{y}\\
\mathbf{if}\;y \leq -5.7 \cdot 10^{+85}:\\
\;\;\;\;t\_1\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -5.7000000000000002e85 or 2.04999999999999982e44 < y

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{t}{\color{blue}{-\frac{y}{x - y}}} \]
      2. distribute-neg-frac284.2%

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

        \[\leadsto \frac{t}{\frac{y}{-\color{blue}{\left(x + \left(-y\right)\right)}}} \]
      4. distribute-neg-in84.2%

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

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

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

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

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

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

    if -5.7000000000000002e85 < y < -5.1999999999999998e-81

    1. Initial program 93.4%

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

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

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

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

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

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

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

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

    if -5.1999999999999998e-81 < y < 2.04999999999999982e44

    1. Initial program 95.6%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -5.7 \cdot 10^{+85}:\\ \;\;\;\;t \cdot \frac{y - x}{y}\\ \mathbf{elif}\;y \leq -5.2 \cdot 10^{-81}:\\ \;\;\;\;\left(x - y\right) \cdot \frac{t}{z}\\ \mathbf{elif}\;y \leq 2.05 \cdot 10^{+44}:\\ \;\;\;\;t \cdot \frac{x}{z - y}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{y - x}{y}\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 60.0% accurate, 0.4× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.4500000000000001e106 or 1.04999999999999993e44 < y

    1. Initial program 99.9%

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

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

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

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

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

    if -1.4500000000000001e106 < y < -7.19999999999999996e-82

    1. Initial program 93.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -7.19999999999999996e-82 < y < 1.04999999999999993e44

    1. Initial program 95.6%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.45 \cdot 10^{+106}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq -7.2 \cdot 10^{-82}:\\ \;\;\;\;y \cdot \frac{t}{-z}\\ \mathbf{elif}\;y \leq 1.05 \cdot 10^{+44}:\\ \;\;\;\;\frac{t}{\frac{z}{x}}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 60.7% accurate, 0.4× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.4500000000000001e106 or 3.34999999999999994e45 < y

    1. Initial program 99.9%

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

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

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

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

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

    if -1.4500000000000001e106 < y < -7.5e14

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -7.5e14 < y < 3.34999999999999994e45

    1. Initial program 94.7%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.45 \cdot 10^{+106}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq -7.5 \cdot 10^{+14}:\\ \;\;\;\;\frac{y}{z} \cdot \left(-t\right)\\ \mathbf{elif}\;y \leq 3.35 \cdot 10^{+45}:\\ \;\;\;\;t \cdot \frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 89.7% accurate, 0.5× speedup?

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

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

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

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


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

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{t}{\color{blue}{-\left(\frac{z}{y} + -1\right)}} \]
    10. Taylor expanded in t around 0 91.1%

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

    if -3.9999999999999998e105 < y < 1.55e111

    1. Initial program 95.4%

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

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

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

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

    if 1.55e111 < y

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{t}{\color{blue}{-\frac{y}{x - y}}} \]
      2. distribute-neg-frac289.6%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -4 \cdot 10^{+105}:\\ \;\;\;\;\frac{t}{1 - \frac{z}{y}}\\ \mathbf{elif}\;y \leq 1.55 \cdot 10^{+111}:\\ \;\;\;\;\left(y - x\right) \cdot \frac{t}{y - z}\\ \mathbf{else}:\\ \;\;\;\;\frac{t}{\frac{y}{y - x}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 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 97.0%

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

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

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

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

    \[\leadsto \color{blue}{t} \]
  6. Add Preprocessing

Developer target: 97.2% 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 2024085 
(FPCore (x y z t)
  :name "Numeric.Signal.Multichannel:$cput from hsignal-0.2.7.1"
  :precision binary64

  :alt
  (/ t (/ (- z y) (- x y)))

  (* (/ (- x y) (- z y)) t))