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

Percentage Accurate: 97.0% → 97.0%
Time: 10.5s
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.0% accurate, 1.0× speedup?

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

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

Alternative 1: 97.0% accurate, 1.0× speedup?

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

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

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

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

Alternative 2: 59.1% accurate, 0.3× speedup?

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

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

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

\mathbf{elif}\;y \leq -2.1 \cdot 10^{-14}:\\
\;\;\;\;t\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -1.85000000000000002e112 or -2.4e12 < y < -2.0999999999999999e-14 or 6.8000000000000007e85 < y

    1. Initial program 99.9%

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

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

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

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

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

    if -1.85000000000000002e112 < y < -2.4e12

    1. Initial program 99.7%

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

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

    if -2.0999999999999999e-14 < y < 1.42e7

    1. Initial program 95.7%

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

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

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

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

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

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

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

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

    if 1.42e7 < y < 6.8000000000000007e85

    1. Initial program 99.5%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(-\left(\frac{x}{y} + -1\right)\right)} \cdot t \]
    6. Taylor expanded in x around inf 55.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.85 \cdot 10^{+112}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq -2400000000000:\\ \;\;\;\;t \cdot \frac{x}{z}\\ \mathbf{elif}\;y \leq -2.1 \cdot 10^{-14}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq 14200000:\\ \;\;\;\;x \cdot \frac{t}{z}\\ \mathbf{elif}\;y \leq 6.8 \cdot 10^{+85}:\\ \;\;\;\;t \cdot \frac{x}{-y}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 59.1% accurate, 0.3× speedup?

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

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

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

\mathbf{elif}\;y \leq -8 \cdot 10^{-16}:\\
\;\;\;\;t\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -1.85000000000000002e112 or -2.1e12 < y < -7.9999999999999998e-16 or 8.19999999999999957e85 < y

    1. Initial program 99.9%

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

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

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

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

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

    if -1.85000000000000002e112 < y < -2.1e12

    1. Initial program 99.7%

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

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

    if -7.9999999999999998e-16 < y < 1e6

    1. Initial program 95.7%

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

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

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

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

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

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

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

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

    if 1e6 < y < 8.19999999999999957e85

    1. Initial program 99.5%

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

        \[\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. Step-by-step derivation
      1. associate-*r/89.8%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{t}{\color{blue}{\frac{y}{-x}}} \]
    10. Simplified55.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.85 \cdot 10^{+112}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq -2100000000000:\\ \;\;\;\;t \cdot \frac{x}{z}\\ \mathbf{elif}\;y \leq -8 \cdot 10^{-16}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq 1000000:\\ \;\;\;\;x \cdot \frac{t}{z}\\ \mathbf{elif}\;y \leq 8.2 \cdot 10^{+85}:\\ \;\;\;\;\frac{t}{\frac{y}{-x}}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 72.7% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := t \cdot \left(1 - \frac{x}{y}\right)\\ \mathbf{if}\;y \leq -1.85 \cdot 10^{+112}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -2200000000000:\\ \;\;\;\;t \cdot \frac{x}{z - y}\\ \mathbf{elif}\;y \leq -3.6 \cdot 10^{-12} \lor \neg \left(y \leq 1250000\right):\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;\left(x - y\right) \cdot \frac{t}{z}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* t (- 1.0 (/ x y)))))
   (if (<= y -1.85e+112)
     t_1
     (if (<= y -2200000000000.0)
       (* t (/ x (- z y)))
       (if (or (<= y -3.6e-12) (not (<= y 1250000.0)))
         t_1
         (* (- x y) (/ t z)))))))
double code(double x, double y, double z, double t) {
	double t_1 = t * (1.0 - (x / y));
	double tmp;
	if (y <= -1.85e+112) {
		tmp = t_1;
	} else if (y <= -2200000000000.0) {
		tmp = t * (x / (z - y));
	} else if ((y <= -3.6e-12) || !(y <= 1250000.0)) {
		tmp = t_1;
	} 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) :: t_1
    real(8) :: tmp
    t_1 = t * (1.0d0 - (x / y))
    if (y <= (-1.85d+112)) then
        tmp = t_1
    else if (y <= (-2200000000000.0d0)) then
        tmp = t * (x / (z - y))
    else if ((y <= (-3.6d-12)) .or. (.not. (y <= 1250000.0d0))) then
        tmp = t_1
    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 t_1 = t * (1.0 - (x / y));
	double tmp;
	if (y <= -1.85e+112) {
		tmp = t_1;
	} else if (y <= -2200000000000.0) {
		tmp = t * (x / (z - y));
	} else if ((y <= -3.6e-12) || !(y <= 1250000.0)) {
		tmp = t_1;
	} else {
		tmp = (x - y) * (t / z);
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = t * (1.0 - (x / y))
	tmp = 0
	if y <= -1.85e+112:
		tmp = t_1
	elif y <= -2200000000000.0:
		tmp = t * (x / (z - y))
	elif (y <= -3.6e-12) or not (y <= 1250000.0):
		tmp = t_1
	else:
		tmp = (x - y) * (t / z)
	return tmp
function code(x, y, z, t)
	t_1 = Float64(t * Float64(1.0 - Float64(x / y)))
	tmp = 0.0
	if (y <= -1.85e+112)
		tmp = t_1;
	elseif (y <= -2200000000000.0)
		tmp = Float64(t * Float64(x / Float64(z - y)));
	elseif ((y <= -3.6e-12) || !(y <= 1250000.0))
		tmp = t_1;
	else
		tmp = Float64(Float64(x - y) * Float64(t / z));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = t * (1.0 - (x / y));
	tmp = 0.0;
	if (y <= -1.85e+112)
		tmp = t_1;
	elseif (y <= -2200000000000.0)
		tmp = t * (x / (z - y));
	elseif ((y <= -3.6e-12) || ~((y <= 1250000.0)))
		tmp = t_1;
	else
		tmp = (x - y) * (t / z);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(t * N[(1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.85e+112], t$95$1, If[LessEqual[y, -2200000000000.0], N[(t * N[(x / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y, -3.6e-12], N[Not[LessEqual[y, 1250000.0]], $MachinePrecision]], t$95$1, N[(N[(x - y), $MachinePrecision] * N[(t / z), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;y \leq -3.6 \cdot 10^{-12} \lor \neg \left(y \leq 1250000\right):\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.85000000000000002e112 or -2.2e12 < y < -3.6e-12 or 1.25e6 < y

    1. Initial program 99.8%

      \[\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*76.9%

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

      \[\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.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.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.85000000000000002e112 < y < -2.2e12

    1. Initial program 99.7%

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

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

    if -3.6e-12 < y < 1.25e6

    1. Initial program 95.8%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.85 \cdot 10^{+112}:\\ \;\;\;\;t \cdot \left(1 - \frac{x}{y}\right)\\ \mathbf{elif}\;y \leq -2200000000000:\\ \;\;\;\;t \cdot \frac{x}{z - y}\\ \mathbf{elif}\;y \leq -3.6 \cdot 10^{-12} \lor \neg \left(y \leq 1250000\right):\\ \;\;\;\;t \cdot \left(1 - \frac{x}{y}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x - y\right) \cdot \frac{t}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 73.3% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := t \cdot \left(1 - \frac{x}{y}\right)\\ \mathbf{if}\;y \leq -1.85 \cdot 10^{+112}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -2.9 \cdot 10^{+70}:\\ \;\;\;\;t \cdot \frac{x - y}{z}\\ \mathbf{elif}\;y \leq -1.45 \cdot 10^{-11} \lor \neg \left(y \leq 1560000\right):\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;\left(x - y\right) \cdot \frac{t}{z}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* t (- 1.0 (/ x y)))))
   (if (<= y -1.85e+112)
     t_1
     (if (<= y -2.9e+70)
       (* t (/ (- x y) z))
       (if (or (<= y -1.45e-11) (not (<= y 1560000.0)))
         t_1
         (* (- x y) (/ t z)))))))
double code(double x, double y, double z, double t) {
	double t_1 = t * (1.0 - (x / y));
	double tmp;
	if (y <= -1.85e+112) {
		tmp = t_1;
	} else if (y <= -2.9e+70) {
		tmp = t * ((x - y) / z);
	} else if ((y <= -1.45e-11) || !(y <= 1560000.0)) {
		tmp = t_1;
	} 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) :: t_1
    real(8) :: tmp
    t_1 = t * (1.0d0 - (x / y))
    if (y <= (-1.85d+112)) then
        tmp = t_1
    else if (y <= (-2.9d+70)) then
        tmp = t * ((x - y) / z)
    else if ((y <= (-1.45d-11)) .or. (.not. (y <= 1560000.0d0))) then
        tmp = t_1
    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 t_1 = t * (1.0 - (x / y));
	double tmp;
	if (y <= -1.85e+112) {
		tmp = t_1;
	} else if (y <= -2.9e+70) {
		tmp = t * ((x - y) / z);
	} else if ((y <= -1.45e-11) || !(y <= 1560000.0)) {
		tmp = t_1;
	} else {
		tmp = (x - y) * (t / z);
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = t * (1.0 - (x / y))
	tmp = 0
	if y <= -1.85e+112:
		tmp = t_1
	elif y <= -2.9e+70:
		tmp = t * ((x - y) / z)
	elif (y <= -1.45e-11) or not (y <= 1560000.0):
		tmp = t_1
	else:
		tmp = (x - y) * (t / z)
	return tmp
function code(x, y, z, t)
	t_1 = Float64(t * Float64(1.0 - Float64(x / y)))
	tmp = 0.0
	if (y <= -1.85e+112)
		tmp = t_1;
	elseif (y <= -2.9e+70)
		tmp = Float64(t * Float64(Float64(x - y) / z));
	elseif ((y <= -1.45e-11) || !(y <= 1560000.0))
		tmp = t_1;
	else
		tmp = Float64(Float64(x - y) * Float64(t / z));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = t * (1.0 - (x / y));
	tmp = 0.0;
	if (y <= -1.85e+112)
		tmp = t_1;
	elseif (y <= -2.9e+70)
		tmp = t * ((x - y) / z);
	elseif ((y <= -1.45e-11) || ~((y <= 1560000.0)))
		tmp = t_1;
	else
		tmp = (x - y) * (t / z);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(t * N[(1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.85e+112], t$95$1, If[LessEqual[y, -2.9e+70], N[(t * N[(N[(x - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y, -1.45e-11], N[Not[LessEqual[y, 1560000.0]], $MachinePrecision]], t$95$1, N[(N[(x - y), $MachinePrecision] * N[(t / z), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;y \leq -1.45 \cdot 10^{-11} \lor \neg \left(y \leq 1560000\right):\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.85000000000000002e112 or -2.8999999999999998e70 < y < -1.45e-11 or 1.56e6 < y

    1. Initial program 99.8%

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

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

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

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

        \[\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.8%

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

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

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

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

        \[\leadsto -\color{blue}{t \cdot \frac{x - y}{y}} \]
      3. div-sub85.6%

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

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

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

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

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

        \[\leadsto t \cdot \left(-\color{blue}{\left(-1 + \frac{x}{y}\right)}\right) \]
      9. distribute-neg-in85.6%

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

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

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

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

    if -1.85000000000000002e112 < y < -2.8999999999999998e70

    1. Initial program 99.6%

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

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

    if -1.45e-11 < y < 1.56e6

    1. Initial program 95.8%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.85 \cdot 10^{+112}:\\ \;\;\;\;t \cdot \left(1 - \frac{x}{y}\right)\\ \mathbf{elif}\;y \leq -2.9 \cdot 10^{+70}:\\ \;\;\;\;t \cdot \frac{x - y}{z}\\ \mathbf{elif}\;y \leq -1.45 \cdot 10^{-11} \lor \neg \left(y \leq 1560000\right):\\ \;\;\;\;t \cdot \left(1 - \frac{x}{y}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x - y\right) \cdot \frac{t}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 73.2% accurate, 0.3× speedup?

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

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

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

\mathbf{elif}\;y \leq -4.6 \cdot 10^{-9} \lor \neg \left(y \leq 1100000\right):\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.9999999999999999e112 or -2.8999999999999998e70 < y < -4.5999999999999998e-9 or 1.1e6 < y

    1. Initial program 99.8%

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

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

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

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

        \[\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.8%

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

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

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

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

        \[\leadsto -\color{blue}{t \cdot \frac{x - y}{y}} \]
      3. div-sub85.6%

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

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

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

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

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

        \[\leadsto t \cdot \left(-\color{blue}{\left(-1 + \frac{x}{y}\right)}\right) \]
      9. distribute-neg-in85.6%

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

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

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

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

    if -1.9999999999999999e112 < y < -2.8999999999999998e70

    1. Initial program 99.6%

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

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

    if -4.5999999999999998e-9 < y < 1.1e6

    1. Initial program 95.8%

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

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

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

      \[\leadsto \color{blue}{\left(x - y\right) \cdot \frac{t}{z - y}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. clear-num95.9%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2 \cdot 10^{+112}:\\ \;\;\;\;t \cdot \left(1 - \frac{x}{y}\right)\\ \mathbf{elif}\;y \leq -2.9 \cdot 10^{+70}:\\ \;\;\;\;t \cdot \frac{x - y}{z}\\ \mathbf{elif}\;y \leq -4.6 \cdot 10^{-9} \lor \neg \left(y \leq 1100000\right):\\ \;\;\;\;t \cdot \left(1 - \frac{x}{y}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{x - y}{\frac{z}{t}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 75.6% accurate, 0.3× speedup?

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

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

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

\mathbf{elif}\;x \leq -1.3 \cdot 10^{-30} \lor \neg \left(x \leq 4.7 \cdot 10^{+30}\right):\\
\;\;\;\;\frac{t}{\frac{z - y}{x}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x < -1.30000000000000006e129

    1. Initial program 99.7%

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

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

    if -1.30000000000000006e129 < x < -3.9000000000000002e90

    1. Initial program 99.8%

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

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

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

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

        \[\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.6%

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

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

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

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

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

        \[\leadsto -\color{blue}{t \cdot \frac{x - y}{y}} \]
      3. div-sub100.0%

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

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

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

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

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

        \[\leadsto t \cdot \left(-\color{blue}{\left(-1 + \frac{x}{y}\right)}\right) \]
      9. distribute-neg-in100.0%

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

        \[\leadsto t \cdot \left(\color{blue}{1} + \left(-\frac{x}{y}\right)\right) \]
      11. sub-neg100.0%

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

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

    if -3.9000000000000002e90 < x < -1.29999999999999993e-30 or 4.6999999999999999e30 < x

    1. Initial program 97.7%

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

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

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

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

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

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

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

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

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

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

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

    if -1.29999999999999993e-30 < x < 4.6999999999999999e30

    1. Initial program 97.1%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.3 \cdot 10^{+129}:\\ \;\;\;\;t \cdot \frac{x}{z - y}\\ \mathbf{elif}\;x \leq -3.9 \cdot 10^{+90}:\\ \;\;\;\;t \cdot \left(1 - \frac{x}{y}\right)\\ \mathbf{elif}\;x \leq -1.3 \cdot 10^{-30} \lor \neg \left(x \leq 4.7 \cdot 10^{+30}\right):\\ \;\;\;\;\frac{t}{\frac{z - y}{x}}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{y}{y - z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 59.7% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -1.4 \cdot 10^{+102}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq -1900000000000 \lor \neg \left(y \leq -1.35 \cdot 10^{-14}\right) \land y \leq 1020000:\\ \;\;\;\;x \cdot \frac{t}{z}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= y -1.4e+102)
   t
   (if (or (<= y -1900000000000.0)
           (and (not (<= y -1.35e-14)) (<= y 1020000.0)))
     (* x (/ t z))
     t)))
double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= -1.4e+102) {
		tmp = t;
	} else if ((y <= -1900000000000.0) || (!(y <= -1.35e-14) && (y <= 1020000.0))) {
		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.4d+102)) then
        tmp = t
    else if ((y <= (-1900000000000.0d0)) .or. (.not. (y <= (-1.35d-14))) .and. (y <= 1020000.0d0)) 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.4e+102) {
		tmp = t;
	} else if ((y <= -1900000000000.0) || (!(y <= -1.35e-14) && (y <= 1020000.0))) {
		tmp = x * (t / z);
	} else {
		tmp = t;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if y <= -1.4e+102:
		tmp = t
	elif (y <= -1900000000000.0) or (not (y <= -1.35e-14) and (y <= 1020000.0)):
		tmp = x * (t / z)
	else:
		tmp = t
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (y <= -1.4e+102)
		tmp = t;
	elseif ((y <= -1900000000000.0) || (!(y <= -1.35e-14) && (y <= 1020000.0)))
		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.4e+102)
		tmp = t;
	elseif ((y <= -1900000000000.0) || (~((y <= -1.35e-14)) && (y <= 1020000.0)))
		tmp = x * (t / z);
	else
		tmp = t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.4e+102], t, If[Or[LessEqual[y, -1900000000000.0], And[N[Not[LessEqual[y, -1.35e-14]], $MachinePrecision], LessEqual[y, 1020000.0]]], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq -1900000000000 \lor \neg \left(y \leq -1.35 \cdot 10^{-14}\right) \land y \leq 1020000:\\
\;\;\;\;x \cdot \frac{t}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.40000000000000009e102 or -1.9e12 < y < -1.3499999999999999e-14 or 1.02e6 < y

    1. Initial program 99.8%

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

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

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

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

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

    if -1.40000000000000009e102 < y < -1.9e12 or -1.3499999999999999e-14 < y < 1.02e6

    1. Initial program 96.3%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.4 \cdot 10^{+102}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq -1900000000000 \lor \neg \left(y \leq -1.35 \cdot 10^{-14}\right) \land y \leq 1020000:\\ \;\;\;\;x \cdot \frac{t}{z}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 59.6% accurate, 0.4× speedup?

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

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

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

\mathbf{elif}\;y \leq -1.85 \cdot 10^{-14}:\\
\;\;\;\;t\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.85000000000000002e112 or -2e12 < y < -1.85000000000000001e-14 or 1.16e7 < y

    1. Initial program 99.8%

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

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

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

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

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

    if -1.85000000000000002e112 < y < -2e12

    1. Initial program 99.7%

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

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

    if -1.85000000000000001e-14 < y < 1.16e7

    1. Initial program 95.7%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.85 \cdot 10^{+112}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq -2000000000000:\\ \;\;\;\;t \cdot \frac{x}{z}\\ \mathbf{elif}\;y \leq -1.85 \cdot 10^{-14}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq 11600000:\\ \;\;\;\;x \cdot \frac{t}{z}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 90.3% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -9.5 \cdot 10^{+115} \lor \neg \left(y \leq 1.55 \cdot 10^{+182}\right):\\
\;\;\;\;t \cdot \left(1 - \frac{x}{y}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -9.4999999999999997e115 or 1.54999999999999998e182 < y

    1. Initial program 99.9%

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

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

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

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

        \[\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-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 66.7%

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

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

        \[\leadsto -\color{blue}{t \cdot \frac{x - y}{y}} \]
      3. div-sub97.1%

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

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

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

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

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

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

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

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

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

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

    if -9.4999999999999997e115 < y < 1.54999999999999998e182

    1. Initial program 97.2%

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

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

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

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

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

Alternative 11: 69.0% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.3 \cdot 10^{-16} \lor \neg \left(y \leq 2500000\right):\\
\;\;\;\;t \cdot \left(1 - \frac{x}{y}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -4.2999999999999999e-16 or 2.5e6 < y

    1. Initial program 99.8%

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

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

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

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

        \[\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.8%

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

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

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

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

        \[\leadsto -\color{blue}{t \cdot \frac{x - y}{y}} \]
      3. div-sub79.7%

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

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

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

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

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

        \[\leadsto t \cdot \left(-\color{blue}{\left(-1 + \frac{x}{y}\right)}\right) \]
      9. distribute-neg-in79.7%

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

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

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

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

    if -4.2999999999999999e-16 < y < 2.5e6

    1. Initial program 95.7%

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

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

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

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

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

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

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

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

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

Alternative 12: 74.1% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.85 \cdot 10^{-9} \lor \neg \left(y \leq 8000000\right):\\
\;\;\;\;t \cdot \left(1 - \frac{x}{y}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.8499999999999999e-9 or 8e6 < y

    1. Initial program 99.8%

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

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

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

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

        \[\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.8%

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

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

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

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

        \[\leadsto -\color{blue}{t \cdot \frac{x - y}{y}} \]
      3. div-sub80.7%

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

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

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

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

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

        \[\leadsto t \cdot \left(-\color{blue}{\left(-1 + \frac{x}{y}\right)}\right) \]
      9. distribute-neg-in80.7%

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

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

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

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

    if -2.8499999999999999e-9 < y < 8e6

    1. Initial program 95.8%

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

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

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

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

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

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

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

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

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

Alternative 13: 35.7% accurate, 9.0× speedup?

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

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

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

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

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

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

    \[\leadsto \color{blue}{t} \]
  6. Final simplification31.4%

    \[\leadsto t \]
  7. Add Preprocessing

Developer target: 97.0% accurate, 1.0× speedup?

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

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

Reproduce

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