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

Percentage Accurate: 97.0% → 97.0%
Time: 11.8s
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.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: 60.6% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := t \cdot \frac{y}{y - z}\\ t_2 := \frac{t}{\frac{y}{-x}}\\ t_3 := x \cdot \frac{t}{z}\\ \mathbf{if}\;x \leq -2 \cdot 10^{+117}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;x \leq -1.26 \cdot 10^{+57}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq -1.28 \cdot 10^{-30}:\\ \;\;\;\;\frac{t}{\frac{z}{x}}\\ \mathbf{elif}\;x \leq 1.8 \cdot 10^{+22}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 1.02 \cdot 10^{+169}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;x \leq 1.05 \cdot 10^{+217}:\\ \;\;\;\;\left(-x\right) \cdot \frac{t}{y}\\ \mathbf{elif}\;x \leq 8.2 \cdot 10^{+241}:\\ \;\;\;\;t\_3\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* t (/ y (- y z)))) (t_2 (/ t (/ y (- x)))) (t_3 (* x (/ t z))))
   (if (<= x -2e+117)
     t_2
     (if (<= x -1.26e+57)
       t_1
       (if (<= x -1.28e-30)
         (/ t (/ z x))
         (if (<= x 1.8e+22)
           t_1
           (if (<= x 1.02e+169)
             t_3
             (if (<= x 1.05e+217)
               (* (- x) (/ t y))
               (if (<= x 8.2e+241) t_3 t_2)))))))))
double code(double x, double y, double z, double t) {
	double t_1 = t * (y / (y - z));
	double t_2 = t / (y / -x);
	double t_3 = x * (t / z);
	double tmp;
	if (x <= -2e+117) {
		tmp = t_2;
	} else if (x <= -1.26e+57) {
		tmp = t_1;
	} else if (x <= -1.28e-30) {
		tmp = t / (z / x);
	} else if (x <= 1.8e+22) {
		tmp = t_1;
	} else if (x <= 1.02e+169) {
		tmp = t_3;
	} else if (x <= 1.05e+217) {
		tmp = -x * (t / y);
	} else if (x <= 8.2e+241) {
		tmp = t_3;
	} else {
		tmp = t_2;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: tmp
    t_1 = t * (y / (y - z))
    t_2 = t / (y / -x)
    t_3 = x * (t / z)
    if (x <= (-2d+117)) then
        tmp = t_2
    else if (x <= (-1.26d+57)) then
        tmp = t_1
    else if (x <= (-1.28d-30)) then
        tmp = t / (z / x)
    else if (x <= 1.8d+22) then
        tmp = t_1
    else if (x <= 1.02d+169) then
        tmp = t_3
    else if (x <= 1.05d+217) then
        tmp = -x * (t / y)
    else if (x <= 8.2d+241) then
        tmp = t_3
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = t * (y / (y - z));
	double t_2 = t / (y / -x);
	double t_3 = x * (t / z);
	double tmp;
	if (x <= -2e+117) {
		tmp = t_2;
	} else if (x <= -1.26e+57) {
		tmp = t_1;
	} else if (x <= -1.28e-30) {
		tmp = t / (z / x);
	} else if (x <= 1.8e+22) {
		tmp = t_1;
	} else if (x <= 1.02e+169) {
		tmp = t_3;
	} else if (x <= 1.05e+217) {
		tmp = -x * (t / y);
	} else if (x <= 8.2e+241) {
		tmp = t_3;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = t * (y / (y - z))
	t_2 = t / (y / -x)
	t_3 = x * (t / z)
	tmp = 0
	if x <= -2e+117:
		tmp = t_2
	elif x <= -1.26e+57:
		tmp = t_1
	elif x <= -1.28e-30:
		tmp = t / (z / x)
	elif x <= 1.8e+22:
		tmp = t_1
	elif x <= 1.02e+169:
		tmp = t_3
	elif x <= 1.05e+217:
		tmp = -x * (t / y)
	elif x <= 8.2e+241:
		tmp = t_3
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t)
	t_1 = Float64(t * Float64(y / Float64(y - z)))
	t_2 = Float64(t / Float64(y / Float64(-x)))
	t_3 = Float64(x * Float64(t / z))
	tmp = 0.0
	if (x <= -2e+117)
		tmp = t_2;
	elseif (x <= -1.26e+57)
		tmp = t_1;
	elseif (x <= -1.28e-30)
		tmp = Float64(t / Float64(z / x));
	elseif (x <= 1.8e+22)
		tmp = t_1;
	elseif (x <= 1.02e+169)
		tmp = t_3;
	elseif (x <= 1.05e+217)
		tmp = Float64(Float64(-x) * Float64(t / y));
	elseif (x <= 8.2e+241)
		tmp = t_3;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = t * (y / (y - z));
	t_2 = t / (y / -x);
	t_3 = x * (t / z);
	tmp = 0.0;
	if (x <= -2e+117)
		tmp = t_2;
	elseif (x <= -1.26e+57)
		tmp = t_1;
	elseif (x <= -1.28e-30)
		tmp = t / (z / x);
	elseif (x <= 1.8e+22)
		tmp = t_1;
	elseif (x <= 1.02e+169)
		tmp = t_3;
	elseif (x <= 1.05e+217)
		tmp = -x * (t / y);
	elseif (x <= 8.2e+241)
		tmp = t_3;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(t * N[(y / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t / N[(y / (-x)), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2e+117], t$95$2, If[LessEqual[x, -1.26e+57], t$95$1, If[LessEqual[x, -1.28e-30], N[(t / N[(z / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.8e+22], t$95$1, If[LessEqual[x, 1.02e+169], t$95$3, If[LessEqual[x, 1.05e+217], N[((-x) * N[(t / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 8.2e+241], t$95$3, t$95$2]]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := t \cdot \frac{y}{y - z}\\
t_2 := \frac{t}{\frac{y}{-x}}\\
t_3 := x \cdot \frac{t}{z}\\
\mathbf{if}\;x \leq -2 \cdot 10^{+117}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;x \leq -1.26 \cdot 10^{+57}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \leq -1.28 \cdot 10^{-30}:\\
\;\;\;\;\frac{t}{\frac{z}{x}}\\

\mathbf{elif}\;x \leq 1.8 \cdot 10^{+22}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \leq 1.02 \cdot 10^{+169}:\\
\;\;\;\;t\_3\\

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

\mathbf{elif}\;x \leq 8.2 \cdot 10^{+241}:\\
\;\;\;\;t\_3\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if x < -2.0000000000000001e117 or 8.2000000000000003e241 < x

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.0000000000000001e117 < x < -1.26e57 or -1.28000000000000007e-30 < x < 1.8e22

    1. Initial program 97.3%

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

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

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

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

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

        \[\leadsto \color{blue}{t \cdot \frac{-y}{z - y}} \]
      2. distribute-frac-neg80.1%

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

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

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

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

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

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

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

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

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

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

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

    if -1.26e57 < x < -1.28000000000000007e-30

    1. Initial program 99.4%

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

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

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

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

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

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

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

        \[\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 y around 0 78.5%

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

    if 1.8e22 < x < 1.02000000000000005e169 or 1.05e217 < x < 8.2000000000000003e241

    1. Initial program 95.1%

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

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

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

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

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

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

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

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

    if 1.02000000000000005e169 < x < 1.05e217

    1. Initial program 99.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{\left(-x\right) \cdot \left(t \cdot \frac{1}{y}\right)} \]
      11. add-sqr-sqrt0.0%

        \[\leadsto -\color{blue}{\left(\sqrt{-x} \cdot \sqrt{-x}\right)} \cdot \left(t \cdot \frac{1}{y}\right) \]
      12. sqrt-unprod23.2%

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

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

        \[\leadsto -\color{blue}{\left(\sqrt{x} \cdot \sqrt{x}\right)} \cdot \left(t \cdot \frac{1}{y}\right) \]
      15. add-sqr-sqrt79.9%

        \[\leadsto -\color{blue}{x} \cdot \left(t \cdot \frac{1}{y}\right) \]
      16. add-sqr-sqrt59.4%

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

        \[\leadsto -x \cdot \left(t \cdot \frac{1}{\color{blue}{\sqrt{y \cdot y}}}\right) \]
      18. sqr-neg60.3%

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

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

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

        \[\leadsto -x \cdot \color{blue}{\frac{t}{-y}} \]
      22. add-sqr-sqrt0.7%

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

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

        \[\leadsto -x \cdot \frac{t}{\sqrt{\color{blue}{y \cdot y}}} \]
      25. sqrt-unprod59.6%

        \[\leadsto -x \cdot \frac{t}{\color{blue}{\sqrt{y} \cdot \sqrt{y}}} \]
      26. add-sqr-sqrt80.5%

        \[\leadsto -x \cdot \frac{t}{\color{blue}{y}} \]
    10. Applied egg-rr80.5%

      \[\leadsto \color{blue}{-x \cdot \frac{t}{y}} \]
    11. Step-by-step derivation
      1. distribute-rgt-neg-in80.5%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2 \cdot 10^{+117}:\\ \;\;\;\;\frac{t}{\frac{y}{-x}}\\ \mathbf{elif}\;x \leq -1.26 \cdot 10^{+57}:\\ \;\;\;\;t \cdot \frac{y}{y - z}\\ \mathbf{elif}\;x \leq -1.28 \cdot 10^{-30}:\\ \;\;\;\;\frac{t}{\frac{z}{x}}\\ \mathbf{elif}\;x \leq 1.8 \cdot 10^{+22}:\\ \;\;\;\;t \cdot \frac{y}{y - z}\\ \mathbf{elif}\;x \leq 1.02 \cdot 10^{+169}:\\ \;\;\;\;x \cdot \frac{t}{z}\\ \mathbf{elif}\;x \leq 1.05 \cdot 10^{+217}:\\ \;\;\;\;\left(-x\right) \cdot \frac{t}{y}\\ \mathbf{elif}\;x \leq 8.2 \cdot 10^{+241}:\\ \;\;\;\;x \cdot \frac{t}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{t}{\frac{y}{-x}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 59.0% accurate, 0.3× speedup?

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

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

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

\mathbf{elif}\;y \leq -7.6 \cdot 10^{-15}:\\
\;\;\;\;t\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -1.85000000000000002e112 or -1.9e12 < y < -7.6000000000000004e-15 or 1.49999999999999988e86 < 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 < -1.9e12

    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.6000000000000004e-15 < y < 5e6

    1. Initial program 95.7%

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

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

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

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

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

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

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

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

    if 5e6 < y < 1.49999999999999988e86

    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. Taylor expanded in x around inf 57.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{\left(-x\right) \cdot \left(t \cdot \frac{1}{y}\right)} \]
      11. add-sqr-sqrt6.4%

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

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

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

        \[\leadsto -\color{blue}{\left(\sqrt{x} \cdot \sqrt{x}\right)} \cdot \left(t \cdot \frac{1}{y}\right) \]
      15. add-sqr-sqrt53.9%

        \[\leadsto -\color{blue}{x} \cdot \left(t \cdot \frac{1}{y}\right) \]
      16. add-sqr-sqrt53.7%

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

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

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

        \[\leadsto -x \cdot \left(t \cdot \frac{1}{\color{blue}{\sqrt{-y} \cdot \sqrt{-y}}}\right) \]
      20. add-sqr-sqrt7.1%

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

        \[\leadsto -x \cdot \color{blue}{\frac{t}{-y}} \]
      22. add-sqr-sqrt0.0%

        \[\leadsto -x \cdot \frac{t}{\color{blue}{\sqrt{-y} \cdot \sqrt{-y}}} \]
      23. sqrt-unprod54.1%

        \[\leadsto -x \cdot \frac{t}{\color{blue}{\sqrt{\left(-y\right) \cdot \left(-y\right)}}} \]
      24. sqr-neg54.1%

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

        \[\leadsto -x \cdot \frac{t}{\color{blue}{\sqrt{y} \cdot \sqrt{y}}} \]
      26. add-sqr-sqrt54.1%

        \[\leadsto -x \cdot \frac{t}{\color{blue}{y}} \]
    10. Applied egg-rr54.1%

      \[\leadsto \color{blue}{-x \cdot \frac{t}{y}} \]
    11. Step-by-step derivation
      1. distribute-rgt-neg-in54.1%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.85 \cdot 10^{+112}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq -1900000000000:\\ \;\;\;\;t \cdot \frac{x}{z}\\ \mathbf{elif}\;y \leq -7.6 \cdot 10^{-15}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq 5000000:\\ \;\;\;\;x \cdot \frac{t}{z}\\ \mathbf{elif}\;y \leq 1.5 \cdot 10^{+86}:\\ \;\;\;\;\left(-x\right) \cdot \frac{t}{y}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 59.1% accurate, 0.3× speedup?

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

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

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

\mathbf{elif}\;y \leq -1.02 \cdot 10^{-15}:\\
\;\;\;\;t\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -1.2e114 or -2e12 < y < -1.02e-15 or 1.0499999999999999e86 < 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.2e114 < 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.02e-15 < y < 6.2e6

    1. Initial program 95.7%

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

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

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

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

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

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

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

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

    if 6.2e6 < y < 1.0499999999999999e86

    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.2 \cdot 10^{+114}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq -2000000000000:\\ \;\;\;\;t \cdot \frac{x}{z}\\ \mathbf{elif}\;y \leq -1.02 \cdot 10^{-15}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq 6200000:\\ \;\;\;\;x \cdot \frac{t}{z}\\ \mathbf{elif}\;y \leq 1.05 \cdot 10^{+86}:\\ \;\;\;\;\frac{t}{\frac{y}{-x}}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 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}:\\ \;\;\;\;\left(\frac{x}{y} + -1\right) \cdot \left(-t\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)
     (* (+ (/ x y) -1.0) (- t))
     (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 = ((x / y) + -1.0) * -t;
	} 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 = ((x / y) + (-1.0d0)) * -t
    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 = ((x / y) + -1.0) * -t;
	} 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 = ((x / y) + -1.0) * -t
	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(Float64(Float64(x / y) + -1.0) * Float64(-t));
	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 = ((x / y) + -1.0) * -t;
	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[(N[(N[(x / y), $MachinePrecision] + -1.0), $MachinePrecision] * (-t)), $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}:\\
\;\;\;\;\left(\frac{x}{y} + -1\right) \cdot \left(-t\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. Add Preprocessing
    3. Taylor expanded in z around 0 99.8%

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

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

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

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

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

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

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

    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-frac81.0%

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

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

        \[\leadsto \color{blue}{t \cdot \frac{-y}{z - y}} \]
      2. distribute-frac-neg81.0%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{t \cdot \frac{y}{y - z}} \]
  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}:\\ \;\;\;\;\left(\frac{x}{y} + -1\right) \cdot \left(-t\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 6: 59.7% accurate, 0.4× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.56e102 or -1.7e12 < y < -1.7500000000000001e-14 or 2e6 < 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.56e102 < y < -1.7e12 or -1.7500000000000001e-14 < y < 2e6

    1. Initial program 96.3%

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

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

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

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

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

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

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

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

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

Alternative 7: 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 -1900000000000:\\ \;\;\;\;t \cdot \frac{x}{z}\\ \mathbf{elif}\;y \leq -2.1 \cdot 10^{-14}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq 1300000:\\ \;\;\;\;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 -1900000000000.0)
     (* t (/ x z))
     (if (<= y -2.1e-14) t (if (<= y 1300000.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 <= -1900000000000.0) {
		tmp = t * (x / z);
	} else if (y <= -2.1e-14) {
		tmp = t;
	} else if (y <= 1300000.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 <= (-1900000000000.0d0)) then
        tmp = t * (x / z)
    else if (y <= (-2.1d-14)) then
        tmp = t
    else if (y <= 1300000.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 <= -1900000000000.0) {
		tmp = t * (x / z);
	} else if (y <= -2.1e-14) {
		tmp = t;
	} else if (y <= 1300000.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 <= -1900000000000.0:
		tmp = t * (x / z)
	elif y <= -2.1e-14:
		tmp = t
	elif y <= 1300000.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 <= -1900000000000.0)
		tmp = Float64(t * Float64(x / z));
	elseif (y <= -2.1e-14)
		tmp = t;
	elseif (y <= 1300000.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 <= -1900000000000.0)
		tmp = t * (x / z);
	elseif (y <= -2.1e-14)
		tmp = t;
	elseif (y <= 1300000.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, -1900000000000.0], N[(t * N[(x / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -2.1e-14], t, If[LessEqual[y, 1300000.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 -1900000000000:\\
\;\;\;\;t \cdot \frac{x}{z}\\

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

\mathbf{elif}\;y \leq 1300000:\\
\;\;\;\;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 -1.9e12 < y < -2.0999999999999999e-14 or 1.3e6 < 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 < -1.9e12

    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.3e6

    1. Initial program 95.7%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{t}{z} \cdot x} \]
  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 -1900000000000:\\ \;\;\;\;t \cdot \frac{x}{z}\\ \mathbf{elif}\;y \leq -2.1 \cdot 10^{-14}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq 1300000:\\ \;\;\;\;x \cdot \frac{t}{z}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 71.8% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
t_1 := t \cdot \frac{y}{y - z}\\
\mathbf{if}\;y \leq -1.08 \cdot 10^{-16}:\\
\;\;\;\;t\_1\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.08e-16 or 2.2000000000000001e82 < y

    1. Initial program 99.8%

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

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

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

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

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

        \[\leadsto \color{blue}{t \cdot \frac{-y}{z - y}} \]
      2. distribute-frac-neg69.8%

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

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

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

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

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

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

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

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

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

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

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

    if -1.08e-16 < y < 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 z around inf 77.8%

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

    if 5e6 < y < 2.2000000000000001e82

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.08 \cdot 10^{-16}:\\ \;\;\;\;t \cdot \frac{y}{y - z}\\ \mathbf{elif}\;y \leq 5000000:\\ \;\;\;\;\left(x - y\right) \cdot \frac{t}{z}\\ \mathbf{elif}\;y \leq 2.2 \cdot 10^{+82}:\\ \;\;\;\;\frac{t}{\frac{y}{-x}}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{y}{y - z}\\ \end{array} \]
  5. Add Preprocessing

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

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

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


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

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

    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):\\ \;\;\;\;\left(\frac{x}{y} + -1\right) \cdot \left(-t\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x - y\right) \cdot \frac{t}{z - y}\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 76.2% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.2 \cdot 10^{-31} \lor \neg \left(x \leq 2.45 \cdot 10^{+30}\right):\\
\;\;\;\;t \cdot \frac{x}{z - y}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -6.19999999999999999e-31 or 2.44999999999999992e30 < x

    1. Initial program 98.3%

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

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

    if -6.19999999999999999e-31 < x < 2.44999999999999992e30

    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-frac81.0%

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

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

        \[\leadsto \color{blue}{t \cdot \frac{-y}{z - y}} \]
      2. distribute-frac-neg81.0%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 76.3% accurate, 0.5× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.44999999999999995e-30 or 1.2999999999999999e33 < x

    1. Initial program 98.3%

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

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

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

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

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

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

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

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

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

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

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

    if -1.44999999999999995e-30 < x < 1.2999999999999999e33

    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-frac81.0%

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

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

        \[\leadsto \color{blue}{t \cdot \frac{-y}{z - y}} \]
      2. distribute-frac-neg81.0%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 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))