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

Percentage Accurate: 97.0% → 97.0%
Time: 10.9s
Alternatives: 14
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 14 alternatives:

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

Initial Program: 97.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 96.7%

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

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

Alternative 2: 75.1% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
t_1 := t \cdot \frac{x}{z - y}\\
\mathbf{if}\;x \leq -860:\\
\;\;\;\;t_1\\

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x < -860 or 2.1500000000000001e-36 < x

    1. Initial program 98.4%

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

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

    if -860 < x < 3.3999999999999999e-158

    1. Initial program 96.4%

      \[\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. *-commutative85.1%

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

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

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

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

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

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

        \[\leadsto \frac{-\color{blue}{y \cdot t}}{z - y} \]
      4. distribute-lft-neg-out76.0%

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

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

        \[\leadsto \color{blue}{\frac{-\left(-y\right) \cdot t}{-\left(z - y\right)}} \]
      2. div-inv75.9%

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

        \[\leadsto \left(-\color{blue}{\left(-y \cdot t\right)}\right) \cdot \frac{1}{-\left(z - y\right)} \]
      4. remove-double-neg75.9%

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

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

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

        \[\leadsto \left(t \cdot y\right) \cdot \frac{1}{\color{blue}{\left(-z\right) + \left(-\left(-y\right)\right)}} \]
      8. add-sqr-sqrt33.3%

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

        \[\leadsto \left(t \cdot y\right) \cdot \frac{1}{\left(-z\right) + \left(-\color{blue}{\sqrt{\left(-y\right) \cdot \left(-y\right)}}\right)} \]
      10. sqr-neg52.1%

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

        \[\leadsto \left(t \cdot y\right) \cdot \frac{1}{\left(-z\right) + \left(-\color{blue}{\sqrt{y} \cdot \sqrt{y}}\right)} \]
      12. add-sqr-sqrt43.1%

        \[\leadsto \left(t \cdot y\right) \cdot \frac{1}{\left(-z\right) + \left(-\color{blue}{y}\right)} \]
      13. add-sqr-sqrt15.9%

        \[\leadsto \left(t \cdot y\right) \cdot \frac{1}{\left(-z\right) + \color{blue}{\sqrt{-y} \cdot \sqrt{-y}}} \]
      14. sqrt-unprod51.0%

        \[\leadsto \left(t \cdot y\right) \cdot \frac{1}{\left(-z\right) + \color{blue}{\sqrt{\left(-y\right) \cdot \left(-y\right)}}} \]
      15. sqr-neg51.0%

        \[\leadsto \left(t \cdot y\right) \cdot \frac{1}{\left(-z\right) + \sqrt{\color{blue}{y \cdot y}}} \]
      16. sqrt-unprod42.5%

        \[\leadsto \left(t \cdot y\right) \cdot \frac{1}{\left(-z\right) + \color{blue}{\sqrt{y} \cdot \sqrt{y}}} \]
      17. add-sqr-sqrt75.9%

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

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

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

        \[\leadsto t \cdot \color{blue}{\frac{y \cdot 1}{\left(-z\right) + y}} \]
      3. *-rgt-identity87.9%

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

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

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

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

    if 3.3999999999999999e-158 < x < 2.9999999999999998e-137

    1. Initial program 72.7%

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

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

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

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

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

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

    if 2.9999999999999998e-137 < x < 2.1500000000000001e-36

    1. Initial program 94.3%

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{\frac{t}{\frac{z - y}{y}}} \]
      3. distribute-neg-frac83.3%

        \[\leadsto \color{blue}{\frac{-t}{\frac{z - y}{y}}} \]
      4. div-sub83.3%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -860:\\ \;\;\;\;t \cdot \frac{x}{z - y}\\ \mathbf{elif}\;x \leq 3.4 \cdot 10^{-158}:\\ \;\;\;\;t \cdot \frac{y}{y - z}\\ \mathbf{elif}\;x \leq 3 \cdot 10^{-137}:\\ \;\;\;\;\left(x - y\right) \cdot \frac{t}{z}\\ \mathbf{elif}\;x \leq 2.15 \cdot 10^{-36}:\\ \;\;\;\;\frac{-t}{\frac{z}{y} + -1}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{x}{z - y}\\ \end{array} \]

Alternative 3: 58.8% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := t \cdot \frac{x}{z}\\ \mathbf{if}\;y \leq -2 \cdot 10^{+93}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq -2.85 \cdot 10^{-43}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -7.1 \cdot 10^{-81}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq -1.75 \cdot 10^{-207}:\\ \;\;\;\;x \cdot \frac{t}{z}\\ \mathbf{elif}\;y \leq 5 \cdot 10^{+97}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* t (/ x z))))
   (if (<= y -2e+93)
     t
     (if (<= y -2.85e-43)
       t_1
       (if (<= y -7.1e-81)
         t
         (if (<= y -1.75e-207) (* x (/ t z)) (if (<= y 5e+97) t_1 t)))))))
double code(double x, double y, double z, double t) {
	double t_1 = t * (x / z);
	double tmp;
	if (y <= -2e+93) {
		tmp = t;
	} else if (y <= -2.85e-43) {
		tmp = t_1;
	} else if (y <= -7.1e-81) {
		tmp = t;
	} else if (y <= -1.75e-207) {
		tmp = x * (t / z);
	} else if (y <= 5e+97) {
		tmp = t_1;
	} else {
		tmp = t;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: tmp
    t_1 = t * (x / z)
    if (y <= (-2d+93)) then
        tmp = t
    else if (y <= (-2.85d-43)) then
        tmp = t_1
    else if (y <= (-7.1d-81)) then
        tmp = t
    else if (y <= (-1.75d-207)) then
        tmp = x * (t / z)
    else if (y <= 5d+97) then
        tmp = t_1
    else
        tmp = t
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = t * (x / z);
	double tmp;
	if (y <= -2e+93) {
		tmp = t;
	} else if (y <= -2.85e-43) {
		tmp = t_1;
	} else if (y <= -7.1e-81) {
		tmp = t;
	} else if (y <= -1.75e-207) {
		tmp = x * (t / z);
	} else if (y <= 5e+97) {
		tmp = t_1;
	} else {
		tmp = t;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = t * (x / z)
	tmp = 0
	if y <= -2e+93:
		tmp = t
	elif y <= -2.85e-43:
		tmp = t_1
	elif y <= -7.1e-81:
		tmp = t
	elif y <= -1.75e-207:
		tmp = x * (t / z)
	elif y <= 5e+97:
		tmp = t_1
	else:
		tmp = t
	return tmp
function code(x, y, z, t)
	t_1 = Float64(t * Float64(x / z))
	tmp = 0.0
	if (y <= -2e+93)
		tmp = t;
	elseif (y <= -2.85e-43)
		tmp = t_1;
	elseif (y <= -7.1e-81)
		tmp = t;
	elseif (y <= -1.75e-207)
		tmp = Float64(x * Float64(t / z));
	elseif (y <= 5e+97)
		tmp = t_1;
	else
		tmp = t;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = t * (x / z);
	tmp = 0.0;
	if (y <= -2e+93)
		tmp = t;
	elseif (y <= -2.85e-43)
		tmp = t_1;
	elseif (y <= -7.1e-81)
		tmp = t;
	elseif (y <= -1.75e-207)
		tmp = x * (t / z);
	elseif (y <= 5e+97)
		tmp = t_1;
	else
		tmp = t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(t * N[(x / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2e+93], t, If[LessEqual[y, -2.85e-43], t$95$1, If[LessEqual[y, -7.1e-81], t, If[LessEqual[y, -1.75e-207], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5e+97], t$95$1, t]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq -2.85 \cdot 10^{-43}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq -7.1 \cdot 10^{-81}:\\
\;\;\;\;t\\

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

\mathbf{elif}\;y \leq 5 \cdot 10^{+97}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -2.00000000000000009e93 or -2.85e-43 < y < -7.10000000000000019e-81 or 4.99999999999999999e97 < y

    1. Initial program 99.9%

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

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

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

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

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

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

    if -2.00000000000000009e93 < y < -2.85e-43 or -1.7500000000000001e-207 < y < 4.99999999999999999e97

    1. Initial program 97.3%

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

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

    if -7.10000000000000019e-81 < y < -1.7500000000000001e-207

    1. Initial program 84.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2 \cdot 10^{+93}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq -2.85 \cdot 10^{-43}:\\ \;\;\;\;t \cdot \frac{x}{z}\\ \mathbf{elif}\;y \leq -7.1 \cdot 10^{-81}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq -1.75 \cdot 10^{-207}:\\ \;\;\;\;x \cdot \frac{t}{z}\\ \mathbf{elif}\;y \leq 5 \cdot 10^{+97}:\\ \;\;\;\;t \cdot \frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]

Alternative 4: 58.9% accurate, 0.6× speedup?

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

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

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

\mathbf{elif}\;y \leq -7.1 \cdot 10^{-81}:\\
\;\;\;\;t\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -1.25999999999999997e94 or -2.8e-44 < y < -7.10000000000000019e-81 or 1.6599999999999999e97 < y

    1. Initial program 99.9%

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

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

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

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

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

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

    if -1.25999999999999997e94 < y < -2.8e-44

    1. Initial program 99.7%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{t}{\frac{z}{x}}} \]
    6. Simplified40.4%

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

    if -7.10000000000000019e-81 < y < -6.4000000000000003e-208

    1. Initial program 84.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -6.4000000000000003e-208 < y < 1.6599999999999999e97

    1. Initial program 96.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.26 \cdot 10^{+94}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq -2.8 \cdot 10^{-44}:\\ \;\;\;\;\frac{t}{\frac{z}{x}}\\ \mathbf{elif}\;y \leq -7.1 \cdot 10^{-81}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq -6.4 \cdot 10^{-208}:\\ \;\;\;\;x \cdot \frac{t}{z}\\ \mathbf{elif}\;y \leq 1.66 \cdot 10^{+97}:\\ \;\;\;\;t \cdot \frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]

Alternative 5: 58.8% accurate, 0.6× speedup?

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

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

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

\mathbf{elif}\;y \leq -2.05 \cdot 10^{-82}:\\
\;\;\;\;t\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -1.82000000000000009e93 or -3.19999999999999995e-44 < y < -2.04999999999999998e-82 or 1.79999999999999983e97 < y

    1. Initial program 99.9%

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

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

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

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

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

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

    if -1.82000000000000009e93 < y < -3.19999999999999995e-44

    1. Initial program 99.7%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{t}{\frac{z}{x}}} \]
    6. Simplified40.4%

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

    if -2.04999999999999998e-82 < y < -1.30000000000000008e-208

    1. Initial program 84.4%

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

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

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

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

    if -1.30000000000000008e-208 < y < 1.79999999999999983e97

    1. Initial program 96.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.82 \cdot 10^{+93}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq -3.2 \cdot 10^{-44}:\\ \;\;\;\;\frac{t}{\frac{z}{x}}\\ \mathbf{elif}\;y \leq -2.05 \cdot 10^{-82}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq -1.3 \cdot 10^{-208}:\\ \;\;\;\;\frac{x}{\frac{z}{t}}\\ \mathbf{elif}\;y \leq 1.8 \cdot 10^{+97}:\\ \;\;\;\;t \cdot \frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]

Alternative 6: 58.0% accurate, 0.6× speedup?

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

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

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

\mathbf{elif}\;y \leq -1.7 \cdot 10^{-102}:\\
\;\;\;\;t\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -1.11999999999999996e94 or -2.79999999999999998e-42 < y < -1.70000000000000006e-102 or 1.6599999999999999e97 < y

    1. Initial program 99.8%

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

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

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

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

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

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

    if -1.11999999999999996e94 < y < -2.79999999999999998e-42

    1. Initial program 99.7%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{t}{\frac{z}{x}}} \]
    6. Simplified40.4%

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

    if -1.70000000000000006e-102 < y < 9.199999999999999e-246

    1. Initial program 89.5%

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

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

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

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

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

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

    if 9.199999999999999e-246 < y < 1.6599999999999999e97

    1. Initial program 97.2%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.12 \cdot 10^{+94}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq -2.8 \cdot 10^{-42}:\\ \;\;\;\;\frac{t}{\frac{z}{x}}\\ \mathbf{elif}\;y \leq -1.7 \cdot 10^{-102}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq 9.2 \cdot 10^{-246}:\\ \;\;\;\;\frac{x \cdot t}{z}\\ \mathbf{elif}\;y \leq 1.66 \cdot 10^{+97}:\\ \;\;\;\;t \cdot \frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]

Alternative 7: 57.7% accurate, 0.6× speedup?

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

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if y < -3.04999999999999991e85 or 1.6599999999999999e97 < y

    1. Initial program 99.9%

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

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

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

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

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

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

    if -3.04999999999999991e85 < y < -1.70000000000000006e-102

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

    if -1.70000000000000006e-102 < y < 4.7999999999999997e-13

    1. Initial program 92.7%

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

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

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

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

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

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

    if 4.7999999999999997e-13 < y < 3.20000000000000018e85

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

    if 3.20000000000000018e85 < y < 1.6599999999999999e97

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.05 \cdot 10^{+85}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq -1.7 \cdot 10^{-102}:\\ \;\;\;\;\frac{t}{y} \cdot \left(-x\right)\\ \mathbf{elif}\;y \leq 4.8 \cdot 10^{-13}:\\ \;\;\;\;\frac{x \cdot t}{z}\\ \mathbf{elif}\;y \leq 3.2 \cdot 10^{+85}:\\ \;\;\;\;t \cdot \frac{-y}{z}\\ \mathbf{elif}\;y \leq 1.66 \cdot 10^{+97}:\\ \;\;\;\;x \cdot \frac{t}{z}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]

Alternative 8: 75.1% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := t \cdot \frac{y}{y - z}\\ t_2 := t \cdot \frac{x}{z - y}\\ \mathbf{if}\;x \leq -2900:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \leq 3.4 \cdot 10^{-158}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq 4.8 \cdot 10^{-139}:\\ \;\;\;\;\left(x - y\right) \cdot \frac{t}{z}\\ \mathbf{elif}\;x \leq 5 \cdot 10^{-38}:\\ \;\;\;\;t_1\\ \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 (/ x (- z y)))))
   (if (<= x -2900.0)
     t_2
     (if (<= x 3.4e-158)
       t_1
       (if (<= x 4.8e-139) (* (- x y) (/ t z)) (if (<= x 5e-38) t_1 t_2))))))
double code(double x, double y, double z, double t) {
	double t_1 = t * (y / (y - z));
	double t_2 = t * (x / (z - y));
	double tmp;
	if (x <= -2900.0) {
		tmp = t_2;
	} else if (x <= 3.4e-158) {
		tmp = t_1;
	} else if (x <= 4.8e-139) {
		tmp = (x - y) * (t / z);
	} else if (x <= 5e-38) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = t * (y / (y - z))
    t_2 = t * (x / (z - y))
    if (x <= (-2900.0d0)) then
        tmp = t_2
    else if (x <= 3.4d-158) then
        tmp = t_1
    else if (x <= 4.8d-139) then
        tmp = (x - y) * (t / z)
    else if (x <= 5d-38) then
        tmp = t_1
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = t * (y / (y - z));
	double t_2 = t * (x / (z - y));
	double tmp;
	if (x <= -2900.0) {
		tmp = t_2;
	} else if (x <= 3.4e-158) {
		tmp = t_1;
	} else if (x <= 4.8e-139) {
		tmp = (x - y) * (t / z);
	} else if (x <= 5e-38) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = t * (y / (y - z))
	t_2 = t * (x / (z - y))
	tmp = 0
	if x <= -2900.0:
		tmp = t_2
	elif x <= 3.4e-158:
		tmp = t_1
	elif x <= 4.8e-139:
		tmp = (x - y) * (t / z)
	elif x <= 5e-38:
		tmp = t_1
	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(x / Float64(z - y)))
	tmp = 0.0
	if (x <= -2900.0)
		tmp = t_2;
	elseif (x <= 3.4e-158)
		tmp = t_1;
	elseif (x <= 4.8e-139)
		tmp = Float64(Float64(x - y) * Float64(t / z));
	elseif (x <= 5e-38)
		tmp = t_1;
	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 * (x / (z - y));
	tmp = 0.0;
	if (x <= -2900.0)
		tmp = t_2;
	elseif (x <= 3.4e-158)
		tmp = t_1;
	elseif (x <= 4.8e-139)
		tmp = (x - y) * (t / z);
	elseif (x <= 5e-38)
		tmp = t_1;
	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[(x / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2900.0], t$95$2, If[LessEqual[x, 3.4e-158], t$95$1, If[LessEqual[x, 4.8e-139], N[(N[(x - y), $MachinePrecision] * N[(t / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 5e-38], t$95$1, t$95$2]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := t \cdot \frac{y}{y - z}\\
t_2 := t \cdot \frac{x}{z - y}\\
\mathbf{if}\;x \leq -2900:\\
\;\;\;\;t_2\\

\mathbf{elif}\;x \leq 3.4 \cdot 10^{-158}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;x \leq 5 \cdot 10^{-38}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -2900 or 5.00000000000000033e-38 < x

    1. Initial program 98.4%

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

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

    if -2900 < x < 3.3999999999999999e-158 or 4.80000000000000029e-139 < x < 5.00000000000000033e-38

    1. Initial program 96.1%

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

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

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

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

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

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

        \[\leadsto \color{blue}{-\frac{t \cdot y}{z - y}} \]
      2. distribute-neg-frac74.6%

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

        \[\leadsto \frac{-\color{blue}{y \cdot t}}{z - y} \]
      4. distribute-lft-neg-out74.6%

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

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

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

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

        \[\leadsto \left(-\color{blue}{\left(-y \cdot t\right)}\right) \cdot \frac{1}{-\left(z - y\right)} \]
      4. remove-double-neg74.4%

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

        \[\leadsto \color{blue}{\left(t \cdot y\right)} \cdot \frac{1}{-\left(z - y\right)} \]
      6. sub-neg74.4%

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

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

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

        \[\leadsto \left(t \cdot y\right) \cdot \frac{1}{\left(-z\right) + \left(-\color{blue}{\sqrt{\left(-y\right) \cdot \left(-y\right)}}\right)} \]
      10. sqr-neg50.7%

        \[\leadsto \left(t \cdot y\right) \cdot \frac{1}{\left(-z\right) + \left(-\sqrt{\color{blue}{y \cdot y}}\right)} \]
      11. sqrt-unprod24.8%

        \[\leadsto \left(t \cdot y\right) \cdot \frac{1}{\left(-z\right) + \left(-\color{blue}{\sqrt{y} \cdot \sqrt{y}}\right)} \]
      12. add-sqr-sqrt40.4%

        \[\leadsto \left(t \cdot y\right) \cdot \frac{1}{\left(-z\right) + \left(-\color{blue}{y}\right)} \]
      13. add-sqr-sqrt15.5%

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

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

        \[\leadsto \left(t \cdot y\right) \cdot \frac{1}{\left(-z\right) + \sqrt{\color{blue}{y \cdot y}}} \]
      16. sqrt-unprod41.4%

        \[\leadsto \left(t \cdot y\right) \cdot \frac{1}{\left(-z\right) + \color{blue}{\sqrt{y} \cdot \sqrt{y}}} \]
      17. add-sqr-sqrt74.4%

        \[\leadsto \left(t \cdot y\right) \cdot \frac{1}{\left(-z\right) + \color{blue}{y}} \]
    8. Applied egg-rr74.4%

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

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

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

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

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

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

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

    if 3.3999999999999999e-158 < x < 4.80000000000000029e-139

    1. Initial program 72.7%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2900:\\ \;\;\;\;t \cdot \frac{x}{z - y}\\ \mathbf{elif}\;x \leq 3.4 \cdot 10^{-158}:\\ \;\;\;\;t \cdot \frac{y}{y - z}\\ \mathbf{elif}\;x \leq 4.8 \cdot 10^{-139}:\\ \;\;\;\;\left(x - y\right) \cdot \frac{t}{z}\\ \mathbf{elif}\;x \leq 5 \cdot 10^{-38}:\\ \;\;\;\;t \cdot \frac{y}{y - z}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{x}{z - y}\\ \end{array} \]

Alternative 9: 89.6% accurate, 0.7× speedup?

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

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

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

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


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

    1. Initial program 99.9%

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

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

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

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

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

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

        \[\leadsto \color{blue}{-\frac{t \cdot y}{z - y}} \]
      2. distribute-neg-frac46.3%

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

        \[\leadsto \frac{-\color{blue}{y \cdot t}}{z - y} \]
      4. distribute-lft-neg-out46.3%

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

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

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

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

        \[\leadsto \left(-\color{blue}{\left(-y \cdot t\right)}\right) \cdot \frac{1}{-\left(z - y\right)} \]
      4. remove-double-neg46.2%

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

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

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

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

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

        \[\leadsto \left(t \cdot y\right) \cdot \frac{1}{\left(-z\right) + \left(-\color{blue}{\sqrt{\left(-y\right) \cdot \left(-y\right)}}\right)} \]
      10. sqr-neg2.3%

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

        \[\leadsto \left(t \cdot y\right) \cdot \frac{1}{\left(-z\right) + \left(-\color{blue}{\sqrt{y} \cdot \sqrt{y}}\right)} \]
      12. add-sqr-sqrt5.3%

        \[\leadsto \left(t \cdot y\right) \cdot \frac{1}{\left(-z\right) + \left(-\color{blue}{y}\right)} \]
      13. add-sqr-sqrt5.3%

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

        \[\leadsto \left(t \cdot y\right) \cdot \frac{1}{\left(-z\right) + \color{blue}{\sqrt{\left(-y\right) \cdot \left(-y\right)}}} \]
      15. sqr-neg2.3%

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

        \[\leadsto \left(t \cdot y\right) \cdot \frac{1}{\left(-z\right) + \color{blue}{\sqrt{y} \cdot \sqrt{y}}} \]
      17. add-sqr-sqrt46.2%

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

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

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

        \[\leadsto t \cdot \color{blue}{\frac{y \cdot 1}{\left(-z\right) + y}} \]
      3. *-rgt-identity96.8%

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

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

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

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

    if -4.59999999999999996e155 < y < 6.40000000000000005e156

    1. Initial program 95.8%

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

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

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

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

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

    if 6.40000000000000005e156 < y

    1. Initial program 99.9%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -4.6 \cdot 10^{+155}:\\ \;\;\;\;t \cdot \frac{y}{y - z}\\ \mathbf{elif}\;y \leq 6.4 \cdot 10^{+156}:\\ \;\;\;\;\left(x - y\right) \cdot \frac{t}{z - y}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{y - x}{y}\\ \end{array} \]

Alternative 10: 57.7% accurate, 0.8× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -7.99999999999999937e81 or 2.30000000000000006e97 < y

    1. Initial program 99.9%

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

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

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

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

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

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

    if -7.99999999999999937e81 < y < -1.70000000000000006e-102

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

    if -1.70000000000000006e-102 < y < 2.30000000000000006e97

    1. Initial program 93.8%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -8 \cdot 10^{+81}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq -1.7 \cdot 10^{-102}:\\ \;\;\;\;\frac{t}{y} \cdot \left(-x\right)\\ \mathbf{elif}\;y \leq 2.3 \cdot 10^{+97}:\\ \;\;\;\;\frac{x \cdot t}{z}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]

Alternative 11: 68.7% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.85 \cdot 10^{-103} \lor \neg \left(y \leq 2.7 \cdot 10^{-14}\right):\\
\;\;\;\;t \cdot \frac{y}{y - z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.85e-103 or 2.6999999999999999e-14 < y

    1. Initial program 99.8%

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

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

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

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

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

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

        \[\leadsto \color{blue}{-\frac{t \cdot y}{z - y}} \]
      2. distribute-neg-frac51.9%

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

        \[\leadsto \frac{-\color{blue}{y \cdot t}}{z - y} \]
      4. distribute-lft-neg-out51.9%

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

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

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

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

        \[\leadsto \left(-\color{blue}{\left(-y \cdot t\right)}\right) \cdot \frac{1}{-\left(z - y\right)} \]
      4. remove-double-neg51.8%

        \[\leadsto \color{blue}{\left(y \cdot t\right)} \cdot \frac{1}{-\left(z - y\right)} \]
      5. *-commutative51.8%

        \[\leadsto \color{blue}{\left(t \cdot y\right)} \cdot \frac{1}{-\left(z - y\right)} \]
      6. sub-neg51.8%

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

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

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

        \[\leadsto \left(t \cdot y\right) \cdot \frac{1}{\left(-z\right) + \left(-\color{blue}{\sqrt{\left(-y\right) \cdot \left(-y\right)}}\right)} \]
      10. sqr-neg25.7%

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

        \[\leadsto \left(t \cdot y\right) \cdot \frac{1}{\left(-z\right) + \left(-\color{blue}{\sqrt{y} \cdot \sqrt{y}}\right)} \]
      12. add-sqr-sqrt17.5%

        \[\leadsto \left(t \cdot y\right) \cdot \frac{1}{\left(-z\right) + \left(-\color{blue}{y}\right)} \]
      13. add-sqr-sqrt8.3%

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

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

        \[\leadsto \left(t \cdot y\right) \cdot \frac{1}{\left(-z\right) + \sqrt{\color{blue}{y \cdot y}}} \]
      16. sqrt-unprod23.7%

        \[\leadsto \left(t \cdot y\right) \cdot \frac{1}{\left(-z\right) + \color{blue}{\sqrt{y} \cdot \sqrt{y}}} \]
      17. add-sqr-sqrt51.8%

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

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

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

        \[\leadsto t \cdot \color{blue}{\frac{y \cdot 1}{\left(-z\right) + y}} \]
      3. *-rgt-identity69.6%

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

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

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

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

    if -1.85e-103 < y < 2.6999999999999999e-14

    1. Initial program 92.7%

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

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

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

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

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

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

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

Alternative 12: 72.4% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -7 \cdot 10^{-81} \lor \neg \left(y \leq 4.8 \cdot 10^{-13}\right):\\
\;\;\;\;t \cdot \frac{y}{y - z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -6.99999999999999973e-81 or 4.7999999999999997e-13 < y

    1. Initial program 99.8%

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

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

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

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

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

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

        \[\leadsto \color{blue}{-\frac{t \cdot y}{z - y}} \]
      2. distribute-neg-frac52.9%

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

        \[\leadsto \frac{-\color{blue}{y \cdot t}}{z - y} \]
      4. distribute-lft-neg-out52.9%

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

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

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

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

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

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

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

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

        \[\leadsto \left(t \cdot y\right) \cdot \frac{1}{\color{blue}{\left(-z\right) + \left(-\left(-y\right)\right)}} \]
      8. add-sqr-sqrt28.4%

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

        \[\leadsto \left(t \cdot y\right) \cdot \frac{1}{\left(-z\right) + \left(-\color{blue}{\sqrt{\left(-y\right) \cdot \left(-y\right)}}\right)} \]
      10. sqr-neg26.1%

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

        \[\leadsto \left(t \cdot y\right) \cdot \frac{1}{\left(-z\right) + \left(-\color{blue}{\sqrt{y} \cdot \sqrt{y}}\right)} \]
      12. add-sqr-sqrt17.8%

        \[\leadsto \left(t \cdot y\right) \cdot \frac{1}{\left(-z\right) + \left(-\color{blue}{y}\right)} \]
      13. add-sqr-sqrt8.4%

        \[\leadsto \left(t \cdot y\right) \cdot \frac{1}{\left(-z\right) + \color{blue}{\sqrt{-y} \cdot \sqrt{-y}}} \]
      14. sqrt-unprod22.5%

        \[\leadsto \left(t \cdot y\right) \cdot \frac{1}{\left(-z\right) + \color{blue}{\sqrt{\left(-y\right) \cdot \left(-y\right)}}} \]
      15. sqr-neg22.5%

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

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

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

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

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

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

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

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

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

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

    if -6.99999999999999973e-81 < y < 4.7999999999999997e-13

    1. Initial program 92.8%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -7 \cdot 10^{-81} \lor \neg \left(y \leq 4.8 \cdot 10^{-13}\right):\\ \;\;\;\;t \cdot \frac{y}{y - z}\\ \mathbf{else}:\\ \;\;\;\;\left(x - y\right) \cdot \frac{t}{z}\\ \end{array} \]

Alternative 13: 58.2% accurate, 1.0× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.6500000000000002e93 or 1.6599999999999999e97 < y

    1. Initial program 99.9%

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

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

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

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

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

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

    if -2.6500000000000002e93 < y < 1.6599999999999999e97

    1. Initial program 95.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.65 \cdot 10^{+93}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq 1.66 \cdot 10^{+97}:\\ \;\;\;\;x \cdot \frac{t}{z}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]

Alternative 14: 35.1% accurate, 9.0× speedup?

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{t} \]
  5. Final simplification33.5%

    \[\leadsto t \]

Developer target: 97.1% accurate, 1.0× speedup?

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

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

Reproduce

?
herbie shell --seed 2023318 
(FPCore (x y z t)
  :name "Numeric.Signal.Multichannel:$cput from hsignal-0.2.7.1"
  :precision binary64

  :herbie-target
  (/ t (/ (- z y) (- x y)))

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