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

Percentage Accurate: 96.8% → 96.9%
Time: 9.5s
Alternatives: 13
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 13 alternatives:

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

Initial Program: 96.8% 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: 96.9% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{\frac{t}{\frac{z - y}{x - y}}} \]
  6. Final simplification96.4%

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

Alternative 2: 67.6% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(x - y\right) \cdot \frac{t}{z}\\ t_2 := x \cdot \frac{t}{z - y}\\ \mathbf{if}\;y \leq -7 \cdot 10^{+66}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq -4.3 \cdot 10^{-38}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq -1.95 \cdot 10^{-252}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 8 \cdot 10^{-31}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 4.5 \cdot 10^{+21}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 3.5 \cdot 10^{+47}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq 5 \cdot 10^{+85}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* (- x y) (/ t z))) (t_2 (* x (/ t (- z y)))))
   (if (<= y -7e+66)
     t
     (if (<= y -4.3e-38)
       t_2
       (if (<= y -1.95e-252)
         t_1
         (if (<= y 8e-31)
           t_2
           (if (<= y 4.5e+21)
             t_1
             (if (<= y 3.5e+47) t (if (<= y 5e+85) t_2 t)))))))))
double code(double x, double y, double z, double t) {
	double t_1 = (x - y) * (t / z);
	double t_2 = x * (t / (z - y));
	double tmp;
	if (y <= -7e+66) {
		tmp = t;
	} else if (y <= -4.3e-38) {
		tmp = t_2;
	} else if (y <= -1.95e-252) {
		tmp = t_1;
	} else if (y <= 8e-31) {
		tmp = t_2;
	} else if (y <= 4.5e+21) {
		tmp = t_1;
	} else if (y <= 3.5e+47) {
		tmp = t;
	} else if (y <= 5e+85) {
		tmp = t_2;
	} 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) :: t_2
    real(8) :: tmp
    t_1 = (x - y) * (t / z)
    t_2 = x * (t / (z - y))
    if (y <= (-7d+66)) then
        tmp = t
    else if (y <= (-4.3d-38)) then
        tmp = t_2
    else if (y <= (-1.95d-252)) then
        tmp = t_1
    else if (y <= 8d-31) then
        tmp = t_2
    else if (y <= 4.5d+21) then
        tmp = t_1
    else if (y <= 3.5d+47) then
        tmp = t
    else if (y <= 5d+85) then
        tmp = t_2
    else
        tmp = t
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = (x - y) * (t / z);
	double t_2 = x * (t / (z - y));
	double tmp;
	if (y <= -7e+66) {
		tmp = t;
	} else if (y <= -4.3e-38) {
		tmp = t_2;
	} else if (y <= -1.95e-252) {
		tmp = t_1;
	} else if (y <= 8e-31) {
		tmp = t_2;
	} else if (y <= 4.5e+21) {
		tmp = t_1;
	} else if (y <= 3.5e+47) {
		tmp = t;
	} else if (y <= 5e+85) {
		tmp = t_2;
	} else {
		tmp = t;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = (x - y) * (t / z)
	t_2 = x * (t / (z - y))
	tmp = 0
	if y <= -7e+66:
		tmp = t
	elif y <= -4.3e-38:
		tmp = t_2
	elif y <= -1.95e-252:
		tmp = t_1
	elif y <= 8e-31:
		tmp = t_2
	elif y <= 4.5e+21:
		tmp = t_1
	elif y <= 3.5e+47:
		tmp = t
	elif y <= 5e+85:
		tmp = t_2
	else:
		tmp = t
	return tmp
function code(x, y, z, t)
	t_1 = Float64(Float64(x - y) * Float64(t / z))
	t_2 = Float64(x * Float64(t / Float64(z - y)))
	tmp = 0.0
	if (y <= -7e+66)
		tmp = t;
	elseif (y <= -4.3e-38)
		tmp = t_2;
	elseif (y <= -1.95e-252)
		tmp = t_1;
	elseif (y <= 8e-31)
		tmp = t_2;
	elseif (y <= 4.5e+21)
		tmp = t_1;
	elseif (y <= 3.5e+47)
		tmp = t;
	elseif (y <= 5e+85)
		tmp = t_2;
	else
		tmp = t;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = (x - y) * (t / z);
	t_2 = x * (t / (z - y));
	tmp = 0.0;
	if (y <= -7e+66)
		tmp = t;
	elseif (y <= -4.3e-38)
		tmp = t_2;
	elseif (y <= -1.95e-252)
		tmp = t_1;
	elseif (y <= 8e-31)
		tmp = t_2;
	elseif (y <= 4.5e+21)
		tmp = t_1;
	elseif (y <= 3.5e+47)
		tmp = t;
	elseif (y <= 5e+85)
		tmp = t_2;
	else
		tmp = t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x - y), $MachinePrecision] * N[(t / z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -7e+66], t, If[LessEqual[y, -4.3e-38], t$95$2, If[LessEqual[y, -1.95e-252], t$95$1, If[LessEqual[y, 8e-31], t$95$2, If[LessEqual[y, 4.5e+21], t$95$1, If[LessEqual[y, 3.5e+47], t, If[LessEqual[y, 5e+85], t$95$2, t]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq -4.3 \cdot 10^{-38}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;y \leq -1.95 \cdot 10^{-252}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq 8 \cdot 10^{-31}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;y \leq 4.5 \cdot 10^{+21}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq 3.5 \cdot 10^{+47}:\\
\;\;\;\;t\\

\mathbf{elif}\;y \leq 5 \cdot 10^{+85}:\\
\;\;\;\;t_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -6.9999999999999994e66 or 4.5e21 < y < 3.50000000000000015e47 or 5.0000000000000001e85 < y

    1. Initial program 99.8%

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

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

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

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

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

    if -6.9999999999999994e66 < y < -4.3000000000000002e-38 or -1.9499999999999999e-252 < y < 8.000000000000001e-31 or 3.50000000000000015e47 < y < 5.0000000000000001e85

    1. Initial program 94.2%

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

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

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

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

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

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

        \[\leadsto \color{blue}{x \cdot \frac{t}{z - y}} \]
    6. Simplified75.1%

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

    if -4.3000000000000002e-38 < y < -1.9499999999999999e-252 or 8.000000000000001e-31 < y < 4.5e21

    1. Initial program 93.3%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -7 \cdot 10^{+66}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq -4.3 \cdot 10^{-38}:\\ \;\;\;\;x \cdot \frac{t}{z - y}\\ \mathbf{elif}\;y \leq -1.95 \cdot 10^{-252}:\\ \;\;\;\;\left(x - y\right) \cdot \frac{t}{z}\\ \mathbf{elif}\;y \leq 8 \cdot 10^{-31}:\\ \;\;\;\;x \cdot \frac{t}{z - y}\\ \mathbf{elif}\;y \leq 4.5 \cdot 10^{+21}:\\ \;\;\;\;\left(x - y\right) \cdot \frac{t}{z}\\ \mathbf{elif}\;y \leq 3.5 \cdot 10^{+47}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq 5 \cdot 10^{+85}:\\ \;\;\;\;x \cdot \frac{t}{z - y}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]

Alternative 3: 68.0% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(x - y\right) \cdot \frac{t}{z}\\ t_2 := x \cdot \frac{t}{z - y}\\ \mathbf{if}\;y \leq -1.65 \cdot 10^{+66}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq -1.32 \cdot 10^{-42}:\\ \;\;\;\;t \cdot \frac{x}{z - y}\\ \mathbf{elif}\;y \leq -9.5 \cdot 10^{-251}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 2.6 \cdot 10^{-31}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 7.8 \cdot 10^{+31}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 3.3 \cdot 10^{+47}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq 5.5 \cdot 10^{+84}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* (- x y) (/ t z))) (t_2 (* x (/ t (- z y)))))
   (if (<= y -1.65e+66)
     t
     (if (<= y -1.32e-42)
       (* t (/ x (- z y)))
       (if (<= y -9.5e-251)
         t_1
         (if (<= y 2.6e-31)
           t_2
           (if (<= y 7.8e+31)
             t_1
             (if (<= y 3.3e+47) t (if (<= y 5.5e+84) t_2 t)))))))))
double code(double x, double y, double z, double t) {
	double t_1 = (x - y) * (t / z);
	double t_2 = x * (t / (z - y));
	double tmp;
	if (y <= -1.65e+66) {
		tmp = t;
	} else if (y <= -1.32e-42) {
		tmp = t * (x / (z - y));
	} else if (y <= -9.5e-251) {
		tmp = t_1;
	} else if (y <= 2.6e-31) {
		tmp = t_2;
	} else if (y <= 7.8e+31) {
		tmp = t_1;
	} else if (y <= 3.3e+47) {
		tmp = t;
	} else if (y <= 5.5e+84) {
		tmp = t_2;
	} 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) :: t_2
    real(8) :: tmp
    t_1 = (x - y) * (t / z)
    t_2 = x * (t / (z - y))
    if (y <= (-1.65d+66)) then
        tmp = t
    else if (y <= (-1.32d-42)) then
        tmp = t * (x / (z - y))
    else if (y <= (-9.5d-251)) then
        tmp = t_1
    else if (y <= 2.6d-31) then
        tmp = t_2
    else if (y <= 7.8d+31) then
        tmp = t_1
    else if (y <= 3.3d+47) then
        tmp = t
    else if (y <= 5.5d+84) then
        tmp = t_2
    else
        tmp = t
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = (x - y) * (t / z);
	double t_2 = x * (t / (z - y));
	double tmp;
	if (y <= -1.65e+66) {
		tmp = t;
	} else if (y <= -1.32e-42) {
		tmp = t * (x / (z - y));
	} else if (y <= -9.5e-251) {
		tmp = t_1;
	} else if (y <= 2.6e-31) {
		tmp = t_2;
	} else if (y <= 7.8e+31) {
		tmp = t_1;
	} else if (y <= 3.3e+47) {
		tmp = t;
	} else if (y <= 5.5e+84) {
		tmp = t_2;
	} else {
		tmp = t;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = (x - y) * (t / z)
	t_2 = x * (t / (z - y))
	tmp = 0
	if y <= -1.65e+66:
		tmp = t
	elif y <= -1.32e-42:
		tmp = t * (x / (z - y))
	elif y <= -9.5e-251:
		tmp = t_1
	elif y <= 2.6e-31:
		tmp = t_2
	elif y <= 7.8e+31:
		tmp = t_1
	elif y <= 3.3e+47:
		tmp = t
	elif y <= 5.5e+84:
		tmp = t_2
	else:
		tmp = t
	return tmp
function code(x, y, z, t)
	t_1 = Float64(Float64(x - y) * Float64(t / z))
	t_2 = Float64(x * Float64(t / Float64(z - y)))
	tmp = 0.0
	if (y <= -1.65e+66)
		tmp = t;
	elseif (y <= -1.32e-42)
		tmp = Float64(t * Float64(x / Float64(z - y)));
	elseif (y <= -9.5e-251)
		tmp = t_1;
	elseif (y <= 2.6e-31)
		tmp = t_2;
	elseif (y <= 7.8e+31)
		tmp = t_1;
	elseif (y <= 3.3e+47)
		tmp = t;
	elseif (y <= 5.5e+84)
		tmp = t_2;
	else
		tmp = t;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = (x - y) * (t / z);
	t_2 = x * (t / (z - y));
	tmp = 0.0;
	if (y <= -1.65e+66)
		tmp = t;
	elseif (y <= -1.32e-42)
		tmp = t * (x / (z - y));
	elseif (y <= -9.5e-251)
		tmp = t_1;
	elseif (y <= 2.6e-31)
		tmp = t_2;
	elseif (y <= 7.8e+31)
		tmp = t_1;
	elseif (y <= 3.3e+47)
		tmp = t;
	elseif (y <= 5.5e+84)
		tmp = t_2;
	else
		tmp = t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x - y), $MachinePrecision] * N[(t / z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.65e+66], t, If[LessEqual[y, -1.32e-42], N[(t * N[(x / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -9.5e-251], t$95$1, If[LessEqual[y, 2.6e-31], t$95$2, If[LessEqual[y, 7.8e+31], t$95$1, If[LessEqual[y, 3.3e+47], t, If[LessEqual[y, 5.5e+84], t$95$2, t]]]]]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;y \leq -9.5 \cdot 10^{-251}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq 2.6 \cdot 10^{-31}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;y \leq 7.8 \cdot 10^{+31}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq 3.3 \cdot 10^{+47}:\\
\;\;\;\;t\\

\mathbf{elif}\;y \leq 5.5 \cdot 10^{+84}:\\
\;\;\;\;t_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -1.6500000000000001e66 or 7.79999999999999999e31 < y < 3.2999999999999999e47 or 5.5000000000000004e84 < y

    1. Initial program 99.8%

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

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

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

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

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

    if -1.6500000000000001e66 < y < -1.32000000000000006e-42

    1. Initial program 99.7%

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

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

    if -1.32000000000000006e-42 < y < -9.49999999999999927e-251 or 2.59999999999999995e-31 < y < 7.79999999999999999e31

    1. Initial program 93.1%

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

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

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

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

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

    if -9.49999999999999927e-251 < y < 2.59999999999999995e-31 or 3.2999999999999999e47 < y < 5.5000000000000004e84

    1. Initial program 92.2%

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

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

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

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

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

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

        \[\leadsto \color{blue}{x \cdot \frac{t}{z - y}} \]
    6. Simplified78.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.65 \cdot 10^{+66}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq -1.32 \cdot 10^{-42}:\\ \;\;\;\;t \cdot \frac{x}{z - y}\\ \mathbf{elif}\;y \leq -9.5 \cdot 10^{-251}:\\ \;\;\;\;\left(x - y\right) \cdot \frac{t}{z}\\ \mathbf{elif}\;y \leq 2.6 \cdot 10^{-31}:\\ \;\;\;\;x \cdot \frac{t}{z - y}\\ \mathbf{elif}\;y \leq 7.8 \cdot 10^{+31}:\\ \;\;\;\;\left(x - y\right) \cdot \frac{t}{z}\\ \mathbf{elif}\;y \leq 3.3 \cdot 10^{+47}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq 5.5 \cdot 10^{+84}:\\ \;\;\;\;x \cdot \frac{t}{z - y}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]

Alternative 4: 68.5% accurate, 0.5× speedup?

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

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

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

\mathbf{elif}\;y \leq 1.02 \cdot 10^{-271}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;y \leq 3.6 \cdot 10^{+33}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -3.3999999999999998e72 or 3.6000000000000003e33 < y

    1. Initial program 99.8%

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

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

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

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

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

    if -3.3999999999999998e72 < y < -3.0000000000000002e-36

    1. Initial program 99.8%

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

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

    if -3.0000000000000002e-36 < y < 1.02e-271 or 2.8e-147 < y < 3.6000000000000003e33

    1. Initial program 94.4%

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

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

    if 1.02e-271 < y < 2.8e-147

    1. Initial program 84.4%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.4 \cdot 10^{+72}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq -3 \cdot 10^{-36}:\\ \;\;\;\;t \cdot \frac{x}{z - y}\\ \mathbf{elif}\;y \leq 1.02 \cdot 10^{-271}:\\ \;\;\;\;t \cdot \frac{x - y}{z}\\ \mathbf{elif}\;y \leq 2.8 \cdot 10^{-147}:\\ \;\;\;\;x \cdot \frac{t}{z - y}\\ \mathbf{elif}\;y \leq 3.6 \cdot 10^{+33}:\\ \;\;\;\;t \cdot \frac{x - y}{z}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]

Alternative 5: 74.3% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := t \cdot \frac{x - y}{z}\\ t_2 := t - t \cdot \frac{x}{y}\\ \mathbf{if}\;y \leq -1.3 \cdot 10^{-35}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 10^{-272}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 1.85 \cdot 10^{-147}:\\ \;\;\;\;x \cdot \frac{t}{z - y}\\ \mathbf{elif}\;y \leq 9.2 \cdot 10^{+25}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* t (/ (- x y) z))) (t_2 (- t (* t (/ x y)))))
   (if (<= y -1.3e-35)
     t_2
     (if (<= y 1e-272)
       t_1
       (if (<= y 1.85e-147)
         (* x (/ t (- z y)))
         (if (<= y 9.2e+25) t_1 t_2))))))
double code(double x, double y, double z, double t) {
	double t_1 = t * ((x - y) / z);
	double t_2 = t - (t * (x / y));
	double tmp;
	if (y <= -1.3e-35) {
		tmp = t_2;
	} else if (y <= 1e-272) {
		tmp = t_1;
	} else if (y <= 1.85e-147) {
		tmp = x * (t / (z - y));
	} else if (y <= 9.2e+25) {
		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 * ((x - y) / z)
    t_2 = t - (t * (x / y))
    if (y <= (-1.3d-35)) then
        tmp = t_2
    else if (y <= 1d-272) then
        tmp = t_1
    else if (y <= 1.85d-147) then
        tmp = x * (t / (z - y))
    else if (y <= 9.2d+25) 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 * ((x - y) / z);
	double t_2 = t - (t * (x / y));
	double tmp;
	if (y <= -1.3e-35) {
		tmp = t_2;
	} else if (y <= 1e-272) {
		tmp = t_1;
	} else if (y <= 1.85e-147) {
		tmp = x * (t / (z - y));
	} else if (y <= 9.2e+25) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = t * ((x - y) / z)
	t_2 = t - (t * (x / y))
	tmp = 0
	if y <= -1.3e-35:
		tmp = t_2
	elif y <= 1e-272:
		tmp = t_1
	elif y <= 1.85e-147:
		tmp = x * (t / (z - y))
	elif y <= 9.2e+25:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t)
	t_1 = Float64(t * Float64(Float64(x - y) / z))
	t_2 = Float64(t - Float64(t * Float64(x / y)))
	tmp = 0.0
	if (y <= -1.3e-35)
		tmp = t_2;
	elseif (y <= 1e-272)
		tmp = t_1;
	elseif (y <= 1.85e-147)
		tmp = Float64(x * Float64(t / Float64(z - y)));
	elseif (y <= 9.2e+25)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = t * ((x - y) / z);
	t_2 = t - (t * (x / y));
	tmp = 0.0;
	if (y <= -1.3e-35)
		tmp = t_2;
	elseif (y <= 1e-272)
		tmp = t_1;
	elseif (y <= 1.85e-147)
		tmp = x * (t / (z - y));
	elseif (y <= 9.2e+25)
		tmp = t_1;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(t * N[(N[(x - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t - N[(t * N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.3e-35], t$95$2, If[LessEqual[y, 1e-272], t$95$1, If[LessEqual[y, 1.85e-147], N[(x * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 9.2e+25], t$95$1, t$95$2]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq 10^{-272}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;y \leq 9.2 \cdot 10^{+25}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.30000000000000002e-35 or 9.1999999999999992e25 < y

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.30000000000000002e-35 < y < 9.9999999999999993e-273 or 1.8500000000000001e-147 < y < 9.1999999999999992e25

    1. Initial program 94.4%

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

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

    if 9.9999999999999993e-273 < y < 1.8500000000000001e-147

    1. Initial program 84.4%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.3 \cdot 10^{-35}:\\ \;\;\;\;t - t \cdot \frac{x}{y}\\ \mathbf{elif}\;y \leq 10^{-272}:\\ \;\;\;\;t \cdot \frac{x - y}{z}\\ \mathbf{elif}\;y \leq 1.85 \cdot 10^{-147}:\\ \;\;\;\;x \cdot \frac{t}{z - y}\\ \mathbf{elif}\;y \leq 9.2 \cdot 10^{+25}:\\ \;\;\;\;t \cdot \frac{x - y}{z}\\ \mathbf{else}:\\ \;\;\;\;t - t \cdot \frac{x}{y}\\ \end{array} \]

Alternative 6: 74.9% accurate, 0.6× speedup?

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -3.40000000000000011e75 or 5.80000000000000048e-29 < y

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{t}{\frac{\color{blue}{0 - \left(z - y\right)}}{y}} \]
      4. associate--r-83.8%

        \[\leadsto \frac{t}{\frac{\color{blue}{\left(0 - z\right) + y}}{y}} \]
      5. neg-sub083.8%

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

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

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

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

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

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

    if -3.40000000000000011e75 < y < -2.8e-33

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.8e-33 < y < 1.09999999999999994e-272

    1. Initial program 93.7%

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

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

    if 1.09999999999999994e-272 < y < 5.80000000000000048e-29

    1. Initial program 88.8%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.4 \cdot 10^{+75}:\\ \;\;\;\;\frac{t}{1 - \frac{z}{y}}\\ \mathbf{elif}\;y \leq -2.8 \cdot 10^{-33}:\\ \;\;\;\;t - t \cdot \frac{x}{y}\\ \mathbf{elif}\;y \leq 1.1 \cdot 10^{-272}:\\ \;\;\;\;t \cdot \frac{x - y}{z}\\ \mathbf{elif}\;y \leq 5.8 \cdot 10^{-29}:\\ \;\;\;\;x \cdot \frac{t}{z - y}\\ \mathbf{else}:\\ \;\;\;\;\frac{t}{1 - \frac{z}{y}}\\ \end{array} \]

Alternative 7: 89.1% accurate, 0.7× speedup?

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

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

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

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


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

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto t + \color{blue}{\left(-\frac{t \cdot x}{y}\right)} \]
      2. unsub-neg86.6%

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

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

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

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

    if -7.6000000000000003e239 < y < 5.9e85

    1. Initial program 95.1%

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

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

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

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

    if 5.9e85 < y

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{t}{\frac{\color{blue}{0 - \left(z - y\right)}}{y}} \]
      4. associate--r-90.6%

        \[\leadsto \frac{t}{\frac{\color{blue}{\left(0 - z\right) + y}}{y}} \]
      5. neg-sub090.6%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -7.6 \cdot 10^{+239}:\\ \;\;\;\;t - t \cdot \frac{x}{y}\\ \mathbf{elif}\;y \leq 5.9 \cdot 10^{+85}:\\ \;\;\;\;\left(x - y\right) \cdot \frac{t}{z - y}\\ \mathbf{else}:\\ \;\;\;\;\frac{t}{1 - \frac{z}{y}}\\ \end{array} \]

Alternative 8: 68.9% accurate, 0.8× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -3.35000000000000005e69 or 2.2999999999999999e85 < y

    1. Initial program 99.8%

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

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

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

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

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

    if -3.35000000000000005e69 < y < 2.2999999999999999e85

    1. Initial program 93.9%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.35 \cdot 10^{+69}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq 2.3 \cdot 10^{+85}:\\ \;\;\;\;x \cdot \frac{t}{z - y}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]

Alternative 9: 61.0% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.3 \cdot 10^{-18}:\\
\;\;\;\;t\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -3.3000000000000002e-18 or 1.15000000000000004e-26 < y

    1. Initial program 99.8%

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

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

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

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

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

    if -3.3000000000000002e-18 < y < 1.15000000000000004e-26

    1. Initial program 92.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.3 \cdot 10^{-18}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq 1.15 \cdot 10^{-26}:\\ \;\;\;\;x \cdot \frac{t}{z}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]

Alternative 10: 61.6% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.6 \cdot 10^{-18}:\\
\;\;\;\;t\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.6e-18 or 9.1999999999999998e-27 < y

    1. Initial program 99.8%

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

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

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

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

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

    if -2.6e-18 < y < 9.1999999999999998e-27

    1. Initial program 92.2%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.6 \cdot 10^{-18}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq 9.2 \cdot 10^{-27}:\\ \;\;\;\;t \cdot \frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]

Alternative 11: 61.6% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.3 \cdot 10^{-18}:\\
\;\;\;\;t\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -3.3000000000000002e-18 or 1.2e-26 < y

    1. Initial program 99.8%

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

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

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

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

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

    if -3.3000000000000002e-18 < y < 1.2e-26

    1. Initial program 92.2%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.3 \cdot 10^{-18}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq 1.2 \cdot 10^{-26}:\\ \;\;\;\;\frac{t}{\frac{z}{x}}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]

Alternative 12: 96.8% accurate, 1.0× speedup?

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

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

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

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

Alternative 13: 35.2% 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.3%

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

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

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

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

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

    \[\leadsto t \]

Developer target: 96.9% 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 2023174 
(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))