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

Percentage Accurate: 96.8% → 97.3%
Time: 11.9s
Alternatives: 12
Speedup: 0.4×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 12 alternatives:

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

Initial Program: 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: 97.3% accurate, 0.4× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 (-.f64 x y) (-.f64 z y)) < 5.0000000000000002e136

    1. Initial program 97.7%

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

    if 5.0000000000000002e136 < (/.f64 (-.f64 x y) (-.f64 z y))

    1. Initial program 78.2%

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

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

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

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

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

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

Alternative 2: 68.2% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \frac{t}{z - y}\\ \mathbf{if}\;y \leq -1.4 \cdot 10^{+55}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq -0.085:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -7.8 \cdot 10^{-29}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq -1.45 \cdot 10^{-196}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 2.7 \cdot 10^{-261}:\\ \;\;\;\;\frac{x \cdot t}{z}\\ \mathbf{elif}\;y \leq 3.15 \cdot 10^{+66}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* x (/ t (- z y)))))
   (if (<= y -1.4e+55)
     t
     (if (<= y -0.085)
       t_1
       (if (<= y -7.8e-29)
         t
         (if (<= y -1.45e-196)
           t_1
           (if (<= y 2.7e-261) (/ (* x t) z) (if (<= y 3.15e+66) t_1 t))))))))
double code(double x, double y, double z, double t) {
	double t_1 = x * (t / (z - y));
	double tmp;
	if (y <= -1.4e+55) {
		tmp = t;
	} else if (y <= -0.085) {
		tmp = t_1;
	} else if (y <= -7.8e-29) {
		tmp = t;
	} else if (y <= -1.45e-196) {
		tmp = t_1;
	} else if (y <= 2.7e-261) {
		tmp = (x * t) / z;
	} else if (y <= 3.15e+66) {
		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 = x * (t / (z - y))
    if (y <= (-1.4d+55)) then
        tmp = t
    else if (y <= (-0.085d0)) then
        tmp = t_1
    else if (y <= (-7.8d-29)) then
        tmp = t
    else if (y <= (-1.45d-196)) then
        tmp = t_1
    else if (y <= 2.7d-261) then
        tmp = (x * t) / z
    else if (y <= 3.15d+66) 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 = x * (t / (z - y));
	double tmp;
	if (y <= -1.4e+55) {
		tmp = t;
	} else if (y <= -0.085) {
		tmp = t_1;
	} else if (y <= -7.8e-29) {
		tmp = t;
	} else if (y <= -1.45e-196) {
		tmp = t_1;
	} else if (y <= 2.7e-261) {
		tmp = (x * t) / z;
	} else if (y <= 3.15e+66) {
		tmp = t_1;
	} else {
		tmp = t;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x * (t / (z - y))
	tmp = 0
	if y <= -1.4e+55:
		tmp = t
	elif y <= -0.085:
		tmp = t_1
	elif y <= -7.8e-29:
		tmp = t
	elif y <= -1.45e-196:
		tmp = t_1
	elif y <= 2.7e-261:
		tmp = (x * t) / z
	elif y <= 3.15e+66:
		tmp = t_1
	else:
		tmp = t
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x * Float64(t / Float64(z - y)))
	tmp = 0.0
	if (y <= -1.4e+55)
		tmp = t;
	elseif (y <= -0.085)
		tmp = t_1;
	elseif (y <= -7.8e-29)
		tmp = t;
	elseif (y <= -1.45e-196)
		tmp = t_1;
	elseif (y <= 2.7e-261)
		tmp = Float64(Float64(x * t) / z);
	elseif (y <= 3.15e+66)
		tmp = t_1;
	else
		tmp = t;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x * (t / (z - y));
	tmp = 0.0;
	if (y <= -1.4e+55)
		tmp = t;
	elseif (y <= -0.085)
		tmp = t_1;
	elseif (y <= -7.8e-29)
		tmp = t;
	elseif (y <= -1.45e-196)
		tmp = t_1;
	elseif (y <= 2.7e-261)
		tmp = (x * t) / z;
	elseif (y <= 3.15e+66)
		tmp = t_1;
	else
		tmp = t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.4e+55], t, If[LessEqual[y, -0.085], t$95$1, If[LessEqual[y, -7.8e-29], t, If[LessEqual[y, -1.45e-196], t$95$1, If[LessEqual[y, 2.7e-261], N[(N[(x * t), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[y, 3.15e+66], t$95$1, t]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq -0.085:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq -7.8 \cdot 10^{-29}:\\
\;\;\;\;t\\

\mathbf{elif}\;y \leq -1.45 \cdot 10^{-196}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;y \leq 3.15 \cdot 10^{+66}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.4e55 or -0.0850000000000000061 < y < -7.7999999999999995e-29 or 3.1499999999999999e66 < y

    1. Initial program 99.8%

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

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

    if -1.4e55 < y < -0.0850000000000000061 or -7.7999999999999995e-29 < y < -1.44999999999999994e-196 or 2.6999999999999999e-261 < y < 3.1499999999999999e66

    1. Initial program 93.9%

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

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

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

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

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

    if -1.44999999999999994e-196 < y < 2.6999999999999999e-261

    1. Initial program 89.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.4 \cdot 10^{+55}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq -0.085:\\ \;\;\;\;x \cdot \frac{t}{z - y}\\ \mathbf{elif}\;y \leq -7.8 \cdot 10^{-29}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq -1.45 \cdot 10^{-196}:\\ \;\;\;\;x \cdot \frac{t}{z - y}\\ \mathbf{elif}\;y \leq 2.7 \cdot 10^{-261}:\\ \;\;\;\;\frac{x \cdot t}{z}\\ \mathbf{elif}\;y \leq 3.15 \cdot 10^{+66}:\\ \;\;\;\;x \cdot \frac{t}{z - y}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 73.5% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \frac{t}{z - y}\\ t_2 := t \cdot \left(1 - \frac{x}{y}\right)\\ \mathbf{if}\;y \leq -5.5 \cdot 10^{+51}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;y \leq -0.7:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -7.8 \cdot 10^{-29}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq -1.45 \cdot 10^{-196}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 6.4 \cdot 10^{-261}:\\ \;\;\;\;\frac{x \cdot t}{z}\\ \mathbf{elif}\;y \leq 6.4 \cdot 10^{-67}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* x (/ t (- z y)))) (t_2 (* t (- 1.0 (/ x y)))))
   (if (<= y -5.5e+51)
     t_2
     (if (<= y -0.7)
       t_1
       (if (<= y -7.8e-29)
         t
         (if (<= y -1.45e-196)
           t_1
           (if (<= y 6.4e-261) (/ (* x t) z) (if (<= y 6.4e-67) t_1 t_2))))))))
double code(double x, double y, double z, double t) {
	double t_1 = x * (t / (z - y));
	double t_2 = t * (1.0 - (x / y));
	double tmp;
	if (y <= -5.5e+51) {
		tmp = t_2;
	} else if (y <= -0.7) {
		tmp = t_1;
	} else if (y <= -7.8e-29) {
		tmp = t;
	} else if (y <= -1.45e-196) {
		tmp = t_1;
	} else if (y <= 6.4e-261) {
		tmp = (x * t) / z;
	} else if (y <= 6.4e-67) {
		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 = x * (t / (z - y))
    t_2 = t * (1.0d0 - (x / y))
    if (y <= (-5.5d+51)) then
        tmp = t_2
    else if (y <= (-0.7d0)) then
        tmp = t_1
    else if (y <= (-7.8d-29)) then
        tmp = t
    else if (y <= (-1.45d-196)) then
        tmp = t_1
    else if (y <= 6.4d-261) then
        tmp = (x * t) / z
    else if (y <= 6.4d-67) 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 = x * (t / (z - y));
	double t_2 = t * (1.0 - (x / y));
	double tmp;
	if (y <= -5.5e+51) {
		tmp = t_2;
	} else if (y <= -0.7) {
		tmp = t_1;
	} else if (y <= -7.8e-29) {
		tmp = t;
	} else if (y <= -1.45e-196) {
		tmp = t_1;
	} else if (y <= 6.4e-261) {
		tmp = (x * t) / z;
	} else if (y <= 6.4e-67) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x * (t / (z - y))
	t_2 = t * (1.0 - (x / y))
	tmp = 0
	if y <= -5.5e+51:
		tmp = t_2
	elif y <= -0.7:
		tmp = t_1
	elif y <= -7.8e-29:
		tmp = t
	elif y <= -1.45e-196:
		tmp = t_1
	elif y <= 6.4e-261:
		tmp = (x * t) / z
	elif y <= 6.4e-67:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x * Float64(t / Float64(z - y)))
	t_2 = Float64(t * Float64(1.0 - Float64(x / y)))
	tmp = 0.0
	if (y <= -5.5e+51)
		tmp = t_2;
	elseif (y <= -0.7)
		tmp = t_1;
	elseif (y <= -7.8e-29)
		tmp = t;
	elseif (y <= -1.45e-196)
		tmp = t_1;
	elseif (y <= 6.4e-261)
		tmp = Float64(Float64(x * t) / z);
	elseif (y <= 6.4e-67)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x * (t / (z - y));
	t_2 = t * (1.0 - (x / y));
	tmp = 0.0;
	if (y <= -5.5e+51)
		tmp = t_2;
	elseif (y <= -0.7)
		tmp = t_1;
	elseif (y <= -7.8e-29)
		tmp = t;
	elseif (y <= -1.45e-196)
		tmp = t_1;
	elseif (y <= 6.4e-261)
		tmp = (x * t) / z;
	elseif (y <= 6.4e-67)
		tmp = t_1;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t * N[(1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -5.5e+51], t$95$2, If[LessEqual[y, -0.7], t$95$1, If[LessEqual[y, -7.8e-29], t, If[LessEqual[y, -1.45e-196], t$95$1, If[LessEqual[y, 6.4e-261], N[(N[(x * t), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[y, 6.4e-67], t$95$1, t$95$2]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq -0.7:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq -7.8 \cdot 10^{-29}:\\
\;\;\;\;t\\

\mathbf{elif}\;y \leq -1.45 \cdot 10^{-196}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;y \leq 6.4 \cdot 10^{-67}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -5.5e51 or 6.40000000000000043e-67 < y

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

    if -5.5e51 < y < -0.69999999999999996 or -7.7999999999999995e-29 < y < -1.44999999999999994e-196 or 6.40000000000000008e-261 < y < 6.40000000000000043e-67

    1. Initial program 92.7%

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

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

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

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

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

    if -0.69999999999999996 < y < -7.7999999999999995e-29

    1. Initial program 100.0%

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

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

    if -1.44999999999999994e-196 < y < 6.40000000000000008e-261

    1. Initial program 89.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -5.5 \cdot 10^{+51}:\\ \;\;\;\;t \cdot \left(1 - \frac{x}{y}\right)\\ \mathbf{elif}\;y \leq -0.7:\\ \;\;\;\;x \cdot \frac{t}{z - y}\\ \mathbf{elif}\;y \leq -7.8 \cdot 10^{-29}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq -1.45 \cdot 10^{-196}:\\ \;\;\;\;x \cdot \frac{t}{z - y}\\ \mathbf{elif}\;y \leq 6.4 \cdot 10^{-261}:\\ \;\;\;\;\frac{x \cdot t}{z}\\ \mathbf{elif}\;y \leq 6.4 \cdot 10^{-67}:\\ \;\;\;\;x \cdot \frac{t}{z - y}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(1 - \frac{x}{y}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 61.0% accurate, 0.2× speedup?

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

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

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

\mathbf{elif}\;y \leq -7.8 \cdot 10^{-29}:\\
\;\;\;\;t\\

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if y < -7.20000000000000022e51 or -0.104999999999999996 < y < -7.7999999999999995e-29 or 2e86 < y

    1. Initial program 99.9%

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

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

    if -7.20000000000000022e51 < y < -0.104999999999999996

    1. Initial program 99.6%

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

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

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

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

    if -7.7999999999999995e-29 < y < 5.7999999999999999e-260

    1. Initial program 89.3%

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

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

    if 5.7999999999999999e-260 < y < 7.0999999999999998e-7

    1. Initial program 94.8%

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

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

        \[\leadsto \color{blue}{\frac{t}{\frac{z}{x}}} \]
      2. associate-/r/62.9%

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

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

    if 7.0999999999999998e-7 < y < 2e86

    1. Initial program 99.6%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -7.2 \cdot 10^{+51}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq -0.105:\\ \;\;\;\;\frac{t}{\frac{z}{x}}\\ \mathbf{elif}\;y \leq -7.8 \cdot 10^{-29}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq 5.8 \cdot 10^{-260}:\\ \;\;\;\;\frac{x \cdot t}{z}\\ \mathbf{elif}\;y \leq 7.1 \cdot 10^{-7}:\\ \;\;\;\;x \cdot \frac{t}{z}\\ \mathbf{elif}\;y \leq 2 \cdot 10^{+86}:\\ \;\;\;\;\frac{-y \cdot t}{z}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 73.8% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := t \cdot \left(1 - \frac{x}{y}\right)\\ t_2 := x \cdot \frac{t}{z - y}\\ \mathbf{if}\;y \leq -1.8 \cdot 10^{+56}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -6 \cdot 10^{-32}:\\ \;\;\;\;y \cdot \frac{t}{y - z}\\ \mathbf{elif}\;y \leq -1.6 \cdot 10^{-195}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;y \leq 3.7 \cdot 10^{-261}:\\ \;\;\;\;\frac{x \cdot t}{z}\\ \mathbf{elif}\;y \leq 7.5 \cdot 10^{-67}:\\ \;\;\;\;t\_2\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* t (- 1.0 (/ x y)))) (t_2 (* x (/ t (- z y)))))
   (if (<= y -1.8e+56)
     t_1
     (if (<= y -6e-32)
       (* y (/ t (- y z)))
       (if (<= y -1.6e-195)
         t_2
         (if (<= y 3.7e-261) (/ (* x t) z) (if (<= y 7.5e-67) t_2 t_1)))))))
double code(double x, double y, double z, double t) {
	double t_1 = t * (1.0 - (x / y));
	double t_2 = x * (t / (z - y));
	double tmp;
	if (y <= -1.8e+56) {
		tmp = t_1;
	} else if (y <= -6e-32) {
		tmp = y * (t / (y - z));
	} else if (y <= -1.6e-195) {
		tmp = t_2;
	} else if (y <= 3.7e-261) {
		tmp = (x * t) / z;
	} else if (y <= 7.5e-67) {
		tmp = t_2;
	} 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) :: t_2
    real(8) :: tmp
    t_1 = t * (1.0d0 - (x / y))
    t_2 = x * (t / (z - y))
    if (y <= (-1.8d+56)) then
        tmp = t_1
    else if (y <= (-6d-32)) then
        tmp = y * (t / (y - z))
    else if (y <= (-1.6d-195)) then
        tmp = t_2
    else if (y <= 3.7d-261) then
        tmp = (x * t) / z
    else if (y <= 7.5d-67) then
        tmp = t_2
    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 - (x / y));
	double t_2 = x * (t / (z - y));
	double tmp;
	if (y <= -1.8e+56) {
		tmp = t_1;
	} else if (y <= -6e-32) {
		tmp = y * (t / (y - z));
	} else if (y <= -1.6e-195) {
		tmp = t_2;
	} else if (y <= 3.7e-261) {
		tmp = (x * t) / z;
	} else if (y <= 7.5e-67) {
		tmp = t_2;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = t * (1.0 - (x / y))
	t_2 = x * (t / (z - y))
	tmp = 0
	if y <= -1.8e+56:
		tmp = t_1
	elif y <= -6e-32:
		tmp = y * (t / (y - z))
	elif y <= -1.6e-195:
		tmp = t_2
	elif y <= 3.7e-261:
		tmp = (x * t) / z
	elif y <= 7.5e-67:
		tmp = t_2
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(t * Float64(1.0 - Float64(x / y)))
	t_2 = Float64(x * Float64(t / Float64(z - y)))
	tmp = 0.0
	if (y <= -1.8e+56)
		tmp = t_1;
	elseif (y <= -6e-32)
		tmp = Float64(y * Float64(t / Float64(y - z)));
	elseif (y <= -1.6e-195)
		tmp = t_2;
	elseif (y <= 3.7e-261)
		tmp = Float64(Float64(x * t) / z);
	elseif (y <= 7.5e-67)
		tmp = t_2;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = t * (1.0 - (x / y));
	t_2 = x * (t / (z - y));
	tmp = 0.0;
	if (y <= -1.8e+56)
		tmp = t_1;
	elseif (y <= -6e-32)
		tmp = y * (t / (y - z));
	elseif (y <= -1.6e-195)
		tmp = t_2;
	elseif (y <= 3.7e-261)
		tmp = (x * t) / z;
	elseif (y <= 7.5e-67)
		tmp = t_2;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(t * N[(1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.8e+56], t$95$1, If[LessEqual[y, -6e-32], N[(y * N[(t / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1.6e-195], t$95$2, If[LessEqual[y, 3.7e-261], N[(N[(x * t), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[y, 7.5e-67], t$95$2, t$95$1]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq -6 \cdot 10^{-32}:\\
\;\;\;\;y \cdot \frac{t}{y - z}\\

\mathbf{elif}\;y \leq -1.6 \cdot 10^{-195}:\\
\;\;\;\;t\_2\\

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

\mathbf{elif}\;y \leq 7.5 \cdot 10^{-67}:\\
\;\;\;\;t\_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -1.79999999999999999e56 or 7.5000000000000005e-67 < y

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

    if -1.79999999999999999e56 < y < -6.0000000000000001e-32

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{t}{\frac{y - z}{y}}} \]
      2. associate-/r/70.2%

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

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

    if -6.0000000000000001e-32 < y < -1.6000000000000001e-195 or 3.7000000000000002e-261 < y < 7.5000000000000005e-67

    1. Initial program 91.5%

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

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

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

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

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

    if -1.6000000000000001e-195 < y < 3.7000000000000002e-261

    1. Initial program 89.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.8 \cdot 10^{+56}:\\ \;\;\;\;t \cdot \left(1 - \frac{x}{y}\right)\\ \mathbf{elif}\;y \leq -6 \cdot 10^{-32}:\\ \;\;\;\;y \cdot \frac{t}{y - z}\\ \mathbf{elif}\;y \leq -1.6 \cdot 10^{-195}:\\ \;\;\;\;x \cdot \frac{t}{z - y}\\ \mathbf{elif}\;y \leq 3.7 \cdot 10^{-261}:\\ \;\;\;\;\frac{x \cdot t}{z}\\ \mathbf{elif}\;y \leq 7.5 \cdot 10^{-67}:\\ \;\;\;\;x \cdot \frac{t}{z - y}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(1 - \frac{x}{y}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 60.0% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;y \leq -0.31 \lor \neg \left(y \leq -5.2 \cdot 10^{-29}\right) \land y \leq 2.4 \cdot 10^{-70}:\\
\;\;\;\;x \cdot \frac{t}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -7.9999999999999999e53 or -0.309999999999999998 < y < -5.2000000000000004e-29 or 2.4000000000000001e-70 < y

    1. Initial program 99.8%

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

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

    if -7.9999999999999999e53 < y < -0.309999999999999998 or -5.2000000000000004e-29 < y < 2.4000000000000001e-70

    1. Initial program 92.0%

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

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

        \[\leadsto \color{blue}{\frac{t}{\frac{z}{x}}} \]
      2. associate-/r/63.2%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -8 \cdot 10^{+53}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq -0.31 \lor \neg \left(y \leq -5.2 \cdot 10^{-29}\right) \land y \leq 2.4 \cdot 10^{-70}:\\ \;\;\;\;x \cdot \frac{t}{z}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 62.0% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;y \leq -0.44 \lor \neg \left(y \leq -7.8 \cdot 10^{-29}\right) \land y \leq 4 \cdot 10^{+66}:\\
\;\;\;\;t \cdot \frac{x}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.65e52 or -0.440000000000000002 < y < -7.7999999999999995e-29 or 3.99999999999999978e66 < y

    1. Initial program 99.8%

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

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

    if -1.65e52 < y < -0.440000000000000002 or -7.7999999999999995e-29 < y < 3.99999999999999978e66

    1. Initial program 93.1%

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

      \[\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 -1.65 \cdot 10^{+52}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq -0.44 \lor \neg \left(y \leq -7.8 \cdot 10^{-29}\right) \land y \leq 4 \cdot 10^{+66}:\\ \;\;\;\;t \cdot \frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 62.0% accurate, 0.4× speedup?

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

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

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

\mathbf{elif}\;y \leq -7.8 \cdot 10^{-29}:\\
\;\;\;\;t\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.4e52 or -0.110000000000000001 < y < -7.7999999999999995e-29 or 3.10000000000000019e66 < y

    1. Initial program 99.8%

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

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

    if -1.4e52 < y < -0.110000000000000001

    1. Initial program 99.6%

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

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

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

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

    if -7.7999999999999995e-29 < y < 3.10000000000000019e66

    1. Initial program 92.6%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.4 \cdot 10^{+52}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq -0.11:\\ \;\;\;\;\frac{t}{\frac{z}{x}}\\ \mathbf{elif}\;y \leq -7.8 \cdot 10^{-29}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq 3.1 \cdot 10^{+66}:\\ \;\;\;\;t \cdot \frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 60.4% accurate, 0.4× speedup?

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

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

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

\mathbf{elif}\;y \leq -6.6 \cdot 10^{-29}:\\
\;\;\;\;t\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -8.4999999999999999e51 or -0.19500000000000001 < y < -6.60000000000000055e-29 or 1.35e-76 < y

    1. Initial program 99.8%

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

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

    if -8.4999999999999999e51 < y < -0.19500000000000001

    1. Initial program 99.6%

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

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

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

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

    if -6.60000000000000055e-29 < y < 1.35e-76

    1. Initial program 91.1%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -8.5 \cdot 10^{+51}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq -0.195:\\ \;\;\;\;\frac{t}{\frac{z}{x}}\\ \mathbf{elif}\;y \leq -6.6 \cdot 10^{-29}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq 1.35 \cdot 10^{-76}:\\ \;\;\;\;\frac{x \cdot t}{z}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 74.0% accurate, 0.5× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -1.15e21

    1. Initial program 98.1%

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

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

    if -1.15e21 < x < 2.55000000000000001e95

    1. Initial program 97.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.55000000000000001e95 < x

    1. Initial program 89.4%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.15 \cdot 10^{+21}:\\ \;\;\;\;t \cdot \frac{x}{z - y}\\ \mathbf{elif}\;x \leq 2.55 \cdot 10^{+95}:\\ \;\;\;\;t \cdot \frac{y}{y - z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{t}{z - y}\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 36.3% accurate, 0.6× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.7999999999999999e-98 or 2.2500000000000001e-80 < y

    1. Initial program 98.0%

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

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

    if -2.7999999999999999e-98 < y < 2.2500000000000001e-80

    1. Initial program 92.5%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{-x}{y}} \cdot t \]
    9. Step-by-step derivation
      1. frac-2neg27.0%

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

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

        \[\leadsto \color{blue}{\frac{x \cdot t}{-y}} \]
      4. *-commutative30.1%

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

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

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

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

        \[\leadsto \frac{t \cdot x}{\color{blue}{\sqrt{y} \cdot \sqrt{y}}} \]
      9. add-sqr-sqrt17.0%

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

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

        \[\leadsto \color{blue}{\frac{t}{\frac{y}{x}}} \]
      2. associate-/r/13.8%

        \[\leadsto \color{blue}{\frac{t}{y} \cdot x} \]
    12. Applied egg-rr13.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.8 \cdot 10^{-98}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq 2.25 \cdot 10^{-80}:\\ \;\;\;\;x \cdot \frac{t}{y}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 35.9% 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.0%

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

    \[\leadsto \color{blue}{t} \]
  4. Final simplification34.8%

    \[\leadsto t \]
  5. Add Preprocessing

Developer target: 96.8% 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 2024029 
(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))