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

Percentage Accurate: 97.2% → 97.2%
Time: 8.6s
Alternatives: 12
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 12 alternatives:

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{\frac{t}{\frac{z - y}{x - y}}} \]
  5. Add Preprocessing

Alternative 2: 87.4% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;y \leq 10^{-265}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;y \leq 5.2 \cdot 10^{+254}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -5.59999999999999997e94

    1. Initial program 100.0%

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

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

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

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

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

    if -5.59999999999999997e94 < y < 9.99999999999999985e-266 or 1.6499999999999999e-151 < y < 5.2000000000000002e254

    1. Initial program 93.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.99999999999999985e-266 < y < 1.6499999999999999e-151

    1. Initial program 95.0%

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

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

    if 5.2000000000000002e254 < y

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -5.6 \cdot 10^{+94}:\\ \;\;\;\;t \cdot \frac{y}{y - z}\\ \mathbf{elif}\;y \leq 10^{-265}:\\ \;\;\;\;\left(x - y\right) \cdot \frac{t}{z - y}\\ \mathbf{elif}\;y \leq 1.65 \cdot 10^{-151}:\\ \;\;\;\;\frac{t \cdot x}{z - y}\\ \mathbf{elif}\;y \leq 5.2 \cdot 10^{+254}:\\ \;\;\;\;\left(x - y\right) \cdot \frac{t}{z - y}\\ \mathbf{else}:\\ \;\;\;\;\frac{t}{\left(--1\right) - \frac{z}{y}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 73.8% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := t \cdot \left(\frac{x}{-y} - -1\right)\\ \mathbf{if}\;y \leq -7 \cdot 10^{+111}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -3.05 \cdot 10^{+63}:\\ \;\;\;\;t \cdot \frac{x - y}{z}\\ \mathbf{elif}\;y \leq 1.85 \cdot 10^{-265}:\\ \;\;\;\;x \cdot \frac{t}{z - y}\\ \mathbf{elif}\;y \leq 6.4 \cdot 10^{+35}:\\ \;\;\;\;\frac{t \cdot x}{z - y}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* t (- (/ x (- y)) -1.0))))
   (if (<= y -7e+111)
     t_1
     (if (<= y -3.05e+63)
       (* t (/ (- x y) z))
       (if (<= y 1.85e-265)
         (* x (/ t (- z y)))
         (if (<= y 6.4e+35) (/ (* t x) (- z y)) t_1))))))
double code(double x, double y, double z, double t) {
	double t_1 = t * ((x / -y) - -1.0);
	double tmp;
	if (y <= -7e+111) {
		tmp = t_1;
	} else if (y <= -3.05e+63) {
		tmp = t * ((x - y) / z);
	} else if (y <= 1.85e-265) {
		tmp = x * (t / (z - y));
	} else if (y <= 6.4e+35) {
		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 * ((x / -y) - (-1.0d0))
    if (y <= (-7d+111)) then
        tmp = t_1
    else if (y <= (-3.05d+63)) then
        tmp = t * ((x - y) / z)
    else if (y <= 1.85d-265) then
        tmp = x * (t / (z - y))
    else if (y <= 6.4d+35) 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 * ((x / -y) - -1.0);
	double tmp;
	if (y <= -7e+111) {
		tmp = t_1;
	} else if (y <= -3.05e+63) {
		tmp = t * ((x - y) / z);
	} else if (y <= 1.85e-265) {
		tmp = x * (t / (z - y));
	} else if (y <= 6.4e+35) {
		tmp = (t * x) / (z - y);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = t * ((x / -y) - -1.0)
	tmp = 0
	if y <= -7e+111:
		tmp = t_1
	elif y <= -3.05e+63:
		tmp = t * ((x - y) / z)
	elif y <= 1.85e-265:
		tmp = x * (t / (z - y))
	elif y <= 6.4e+35:
		tmp = (t * x) / (z - y)
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(t * Float64(Float64(x / Float64(-y)) - -1.0))
	tmp = 0.0
	if (y <= -7e+111)
		tmp = t_1;
	elseif (y <= -3.05e+63)
		tmp = Float64(t * Float64(Float64(x - y) / z));
	elseif (y <= 1.85e-265)
		tmp = Float64(x * Float64(t / Float64(z - y)));
	elseif (y <= 6.4e+35)
		tmp = Float64(Float64(t * x) / Float64(z - y));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = t * ((x / -y) - -1.0);
	tmp = 0.0;
	if (y <= -7e+111)
		tmp = t_1;
	elseif (y <= -3.05e+63)
		tmp = t * ((x - y) / z);
	elseif (y <= 1.85e-265)
		tmp = x * (t / (z - y));
	elseif (y <= 6.4e+35)
		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[(x / (-y)), $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -7e+111], t$95$1, If[LessEqual[y, -3.05e+63], N[(t * N[(N[(x - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.85e-265], N[(x * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.4e+35], N[(N[(t * x), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -7.0000000000000004e111 or 6.39999999999999965e35 < y

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

    if -7.0000000000000004e111 < y < -3.04999999999999984e63

    1. Initial program 99.9%

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

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

    if -3.04999999999999984e63 < y < 1.8499999999999999e-265

    1. Initial program 90.9%

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

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

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

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

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

    if 1.8499999999999999e-265 < y < 6.39999999999999965e35

    1. Initial program 93.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -7 \cdot 10^{+111}:\\ \;\;\;\;t \cdot \left(\frac{x}{-y} - -1\right)\\ \mathbf{elif}\;y \leq -3.05 \cdot 10^{+63}:\\ \;\;\;\;t \cdot \frac{x - y}{z}\\ \mathbf{elif}\;y \leq 1.85 \cdot 10^{-265}:\\ \;\;\;\;x \cdot \frac{t}{z - y}\\ \mathbf{elif}\;y \leq 6.4 \cdot 10^{+35}:\\ \;\;\;\;\frac{t \cdot x}{z - y}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(\frac{x}{-y} - -1\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 74.8% accurate, 0.4× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -3.1999999999999998e46

    1. Initial program 100.0%

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

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

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

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

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

    if -3.1999999999999998e46 < y < 2.6000000000000001e-265

    1. Initial program 90.7%

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

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

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

        \[\leadsto \color{blue}{x \cdot \frac{t}{z - y}} \]
    5. Applied egg-rr83.2%

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

    if 2.6000000000000001e-265 < y < 7.80000000000000038e34

    1. Initial program 93.0%

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

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

    if 7.80000000000000038e34 < y

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.2 \cdot 10^{+46}:\\ \;\;\;\;t \cdot \frac{y}{y - z}\\ \mathbf{elif}\;y \leq 2.6 \cdot 10^{-265}:\\ \;\;\;\;x \cdot \frac{t}{z - y}\\ \mathbf{elif}\;y \leq 7.8 \cdot 10^{+34}:\\ \;\;\;\;\frac{t \cdot x}{z - y}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(\frac{x}{-y} - -1\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 74.8% accurate, 0.4× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -2.80000000000000018e46

    1. Initial program 100.0%

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

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

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

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

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

    if -2.80000000000000018e46 < y < 1.2e-265

    1. Initial program 90.7%

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

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

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

        \[\leadsto \color{blue}{x \cdot \frac{t}{z - y}} \]
    5. Applied egg-rr83.2%

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

    if 1.2e-265 < y < 1.00000000000000004e36

    1. Initial program 93.0%

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

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

    if 1.00000000000000004e36 < y

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.8 \cdot 10^{+46}:\\ \;\;\;\;t \cdot \frac{y}{y - z}\\ \mathbf{elif}\;y \leq 1.2 \cdot 10^{-265}:\\ \;\;\;\;x \cdot \frac{t}{z - y}\\ \mathbf{elif}\;y \leq 10^{+36}:\\ \;\;\;\;\frac{t \cdot x}{z - y}\\ \mathbf{else}:\\ \;\;\;\;\frac{t}{\frac{y}{y - x}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 60.3% accurate, 0.4× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -2.05e114 or 3.4999999999999998e36 < y

    1. Initial program 99.8%

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

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

    if -2.05e114 < y < -8.5000000000000002e-24

    1. Initial program 99.8%

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

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

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

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

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

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

        \[\leadsto x \cdot \color{blue}{\frac{-1 \cdot t}{y}} \]
      2. neg-mul-151.8%

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

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

    if -8.5000000000000002e-24 < y < 3.4999999999999998e36

    1. Initial program 91.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.05 \cdot 10^{+114}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq -8.5 \cdot 10^{-24}:\\ \;\;\;\;x \cdot \frac{t}{-y}\\ \mathbf{elif}\;y \leq 3.5 \cdot 10^{+36}:\\ \;\;\;\;t \cdot \frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 65.8% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.9 \cdot 10^{+113} \lor \neg \left(y \leq 10^{+164}\right):\\
\;\;\;\;t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -5.90000000000000023e113 or 1e164 < y

    1. Initial program 99.9%

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

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

    if -5.90000000000000023e113 < y < 1e164

    1. Initial program 93.2%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -5.9 \cdot 10^{+113} \lor \neg \left(y \leq 10^{+164}\right):\\ \;\;\;\;t\\ \mathbf{else}:\\ \;\;\;\;\frac{t \cdot x}{z - y}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 66.5% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.4 \cdot 10^{+114} \lor \neg \left(y \leq 3 \cdot 10^{+163}\right):\\
\;\;\;\;t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.4e114 or 3.00000000000000013e163 < y

    1. Initial program 99.9%

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

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

    if -2.4e114 < y < 3.00000000000000013e163

    1. Initial program 93.2%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.4 \cdot 10^{+114} \lor \neg \left(y \leq 3 \cdot 10^{+163}\right):\\ \;\;\;\;t\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{t}{z - y}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 60.3% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.2 \cdot 10^{+101} \lor \neg \left(y \leq 1.7 \cdot 10^{+40}\right):\\
\;\;\;\;t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -5.2e101 or 1.69999999999999994e40 < y

    1. Initial program 99.8%

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

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

    if -5.2e101 < y < 1.69999999999999994e40

    1. Initial program 92.3%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -5.2 \cdot 10^{+101} \lor \neg \left(y \leq 1.7 \cdot 10^{+40}\right):\\ \;\;\;\;t\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{x}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 59.1% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.2 \cdot 10^{+101} \lor \neg \left(y \leq 3.8 \cdot 10^{+37}\right):\\
\;\;\;\;t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -5.2e101 or 3.7999999999999999e37 < y

    1. Initial program 99.8%

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

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

    if -5.2e101 < y < 3.7999999999999999e37

    1. Initial program 92.3%

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

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

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

        \[\leadsto \color{blue}{x \cdot \frac{t}{z}} \]
    5. Applied egg-rr58.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -5.2 \cdot 10^{+101} \lor \neg \left(y \leq 3.8 \cdot 10^{+37}\right):\\ \;\;\;\;t\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{t}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 97.2% accurate, 1.0× speedup?

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

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

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

    \[\leadsto t \cdot \frac{x - y}{z - y} \]
  4. Add Preprocessing

Alternative 12: 35.1% 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.5%

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

    \[\leadsto \color{blue}{t} \]
  4. 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 2024096 
(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))