Linear.Projection:inverseInfinitePerspective from linear-1.19.1.3

Percentage Accurate: 96.4% → 98.4%
Time: 9.1s
Alternatives: 8
Speedup: 1.0×

Specification

?
\[\begin{array}{l} \\ \left(x \cdot y - z \cdot y\right) \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}

\\
\left(x \cdot y - z \cdot y\right) \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 8 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.4% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \left(x \cdot y - z \cdot y\right) \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}

\\
\left(x \cdot y - z \cdot y\right) \cdot t
\end{array}

Alternative 1: 98.4% accurate, 1.0× speedup?

\[\begin{array}{l} y_m = \left|y\right| \\ y_s = \mathsf{copysign}\left(1, y\right) \\ t_m = \left|t\right| \\ t_s = \mathsf{copysign}\left(1, t\right) \\ [x, y_m, z, t_m] = \mathsf{sort}([x, y_m, z, t_m])\\ \\ t_s \cdot \left(y_s \cdot \begin{array}{l} \mathbf{if}\;t_m \leq 10^{-9}:\\ \;\;\;\;y_m \cdot \left(t_m \cdot \left(x - z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x - z\right) \cdot \left(t_m \cdot y_m\right)\\ \end{array}\right) \end{array} \]
y_m = (fabs.f64 y)
y_s = (copysign.f64 1 y)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
NOTE: x, y_m, z, and t_m should be sorted in increasing order before calling this function.
(FPCore (t_s y_s x y_m z t_m)
 :precision binary64
 (*
  t_s
  (* y_s (if (<= t_m 1e-9) (* y_m (* t_m (- x z))) (* (- x z) (* t_m y_m))))))
y_m = fabs(y);
y_s = copysign(1.0, y);
t_m = fabs(t);
t_s = copysign(1.0, t);
assert(x < y_m && y_m < z && z < t_m);
double code(double t_s, double y_s, double x, double y_m, double z, double t_m) {
	double tmp;
	if (t_m <= 1e-9) {
		tmp = y_m * (t_m * (x - z));
	} else {
		tmp = (x - z) * (t_m * y_m);
	}
	return t_s * (y_s * tmp);
}
y_m = abs(y)
y_s = copysign(1.0d0, y)
t_m = abs(t)
t_s = copysign(1.0d0, t)
NOTE: x, y_m, z, and t_m should be sorted in increasing order before calling this function.
real(8) function code(t_s, y_s, x, y_m, z, t_m)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: y_s
    real(8), intent (in) :: x
    real(8), intent (in) :: y_m
    real(8), intent (in) :: z
    real(8), intent (in) :: t_m
    real(8) :: tmp
    if (t_m <= 1d-9) then
        tmp = y_m * (t_m * (x - z))
    else
        tmp = (x - z) * (t_m * y_m)
    end if
    code = t_s * (y_s * tmp)
end function
y_m = Math.abs(y);
y_s = Math.copySign(1.0, y);
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
assert x < y_m && y_m < z && z < t_m;
public static double code(double t_s, double y_s, double x, double y_m, double z, double t_m) {
	double tmp;
	if (t_m <= 1e-9) {
		tmp = y_m * (t_m * (x - z));
	} else {
		tmp = (x - z) * (t_m * y_m);
	}
	return t_s * (y_s * tmp);
}
y_m = math.fabs(y)
y_s = math.copysign(1.0, y)
t_m = math.fabs(t)
t_s = math.copysign(1.0, t)
[x, y_m, z, t_m] = sort([x, y_m, z, t_m])
def code(t_s, y_s, x, y_m, z, t_m):
	tmp = 0
	if t_m <= 1e-9:
		tmp = y_m * (t_m * (x - z))
	else:
		tmp = (x - z) * (t_m * y_m)
	return t_s * (y_s * tmp)
y_m = abs(y)
y_s = copysign(1.0, y)
t_m = abs(t)
t_s = copysign(1.0, t)
x, y_m, z, t_m = sort([x, y_m, z, t_m])
function code(t_s, y_s, x, y_m, z, t_m)
	tmp = 0.0
	if (t_m <= 1e-9)
		tmp = Float64(y_m * Float64(t_m * Float64(x - z)));
	else
		tmp = Float64(Float64(x - z) * Float64(t_m * y_m));
	end
	return Float64(t_s * Float64(y_s * tmp))
end
y_m = abs(y);
y_s = sign(y) * abs(1.0);
t_m = abs(t);
t_s = sign(t) * abs(1.0);
x, y_m, z, t_m = num2cell(sort([x, y_m, z, t_m])){:}
function tmp_2 = code(t_s, y_s, x, y_m, z, t_m)
	tmp = 0.0;
	if (t_m <= 1e-9)
		tmp = y_m * (t_m * (x - z));
	else
		tmp = (x - z) * (t_m * y_m);
	end
	tmp_2 = t_s * (y_s * tmp);
end
y_m = N[Abs[y], $MachinePrecision]
y_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
t_m = N[Abs[t], $MachinePrecision]
t_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y_m, z, and t_m should be sorted in increasing order before calling this function.
code[t$95$s_, y$95$s_, x_, y$95$m_, z_, t$95$m_] := N[(t$95$s * N[(y$95$s * If[LessEqual[t$95$m, 1e-9], N[(y$95$m * N[(t$95$m * N[(x - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x - z), $MachinePrecision] * N[(t$95$m * y$95$m), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
y_m = \left|y\right|
\\
y_s = \mathsf{copysign}\left(1, y\right)
\\
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
[x, y_m, z, t_m] = \mathsf{sort}([x, y_m, z, t_m])\\
\\
t_s \cdot \left(y_s \cdot \begin{array}{l}
\mathbf{if}\;t_m \leq 10^{-9}:\\
\;\;\;\;y_m \cdot \left(t_m \cdot \left(x - z\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\left(x - z\right) \cdot \left(t_m \cdot y_m\right)\\


\end{array}\right)
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < 1.00000000000000006e-9

    1. Initial program 90.8%

      \[\left(x \cdot y - z \cdot y\right) \cdot t \]
    2. Step-by-step derivation
      1. distribute-rgt-out--91.8%

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

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

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

      \[\leadsto \color{blue}{y \cdot \left(t \cdot \left(x - z\right)\right)} \]
    4. Add Preprocessing

    if 1.00000000000000006e-9 < t

    1. Initial program 99.9%

      \[\left(x \cdot y - z \cdot y\right) \cdot t \]
    2. Step-by-step derivation
      1. *-commutative99.9%

        \[\leadsto \color{blue}{t \cdot \left(x \cdot y - z \cdot y\right)} \]
      2. distribute-rgt-out--99.9%

        \[\leadsto t \cdot \color{blue}{\left(y \cdot \left(x - z\right)\right)} \]
      3. associate-*r*96.5%

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

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

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

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

Alternative 2: 76.7% accurate, 0.6× speedup?

\[\begin{array}{l} y_m = \left|y\right| \\ y_s = \mathsf{copysign}\left(1, y\right) \\ t_m = \left|t\right| \\ t_s = \mathsf{copysign}\left(1, t\right) \\ [x, y_m, z, t_m] = \mathsf{sort}([x, y_m, z, t_m])\\ \\ \begin{array}{l} t_2 := t_m \cdot \left(y_m \cdot \left(-z\right)\right)\\ t_3 := t_m \cdot \left(y_m \cdot x\right)\\ t_s \cdot \left(y_s \cdot \begin{array}{l} \mathbf{if}\;x \leq -1.95 \cdot 10^{+59}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;x \leq -7.2 \cdot 10^{+32}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \leq -4.1 \cdot 10^{-63}:\\ \;\;\;\;x \cdot \left(t_m \cdot y_m\right)\\ \mathbf{elif}\;x \leq 4.1 \cdot 10^{+35}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_3\\ \end{array}\right) \end{array} \end{array} \]
y_m = (fabs.f64 y)
y_s = (copysign.f64 1 y)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
NOTE: x, y_m, z, and t_m should be sorted in increasing order before calling this function.
(FPCore (t_s y_s x y_m z t_m)
 :precision binary64
 (let* ((t_2 (* t_m (* y_m (- z)))) (t_3 (* t_m (* y_m x))))
   (*
    t_s
    (*
     y_s
     (if (<= x -1.95e+59)
       t_3
       (if (<= x -7.2e+32)
         t_2
         (if (<= x -4.1e-63)
           (* x (* t_m y_m))
           (if (<= x 4.1e+35) t_2 t_3))))))))
y_m = fabs(y);
y_s = copysign(1.0, y);
t_m = fabs(t);
t_s = copysign(1.0, t);
assert(x < y_m && y_m < z && z < t_m);
double code(double t_s, double y_s, double x, double y_m, double z, double t_m) {
	double t_2 = t_m * (y_m * -z);
	double t_3 = t_m * (y_m * x);
	double tmp;
	if (x <= -1.95e+59) {
		tmp = t_3;
	} else if (x <= -7.2e+32) {
		tmp = t_2;
	} else if (x <= -4.1e-63) {
		tmp = x * (t_m * y_m);
	} else if (x <= 4.1e+35) {
		tmp = t_2;
	} else {
		tmp = t_3;
	}
	return t_s * (y_s * tmp);
}
y_m = abs(y)
y_s = copysign(1.0d0, y)
t_m = abs(t)
t_s = copysign(1.0d0, t)
NOTE: x, y_m, z, and t_m should be sorted in increasing order before calling this function.
real(8) function code(t_s, y_s, x, y_m, z, t_m)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: y_s
    real(8), intent (in) :: x
    real(8), intent (in) :: y_m
    real(8), intent (in) :: z
    real(8), intent (in) :: t_m
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: tmp
    t_2 = t_m * (y_m * -z)
    t_3 = t_m * (y_m * x)
    if (x <= (-1.95d+59)) then
        tmp = t_3
    else if (x <= (-7.2d+32)) then
        tmp = t_2
    else if (x <= (-4.1d-63)) then
        tmp = x * (t_m * y_m)
    else if (x <= 4.1d+35) then
        tmp = t_2
    else
        tmp = t_3
    end if
    code = t_s * (y_s * tmp)
end function
y_m = Math.abs(y);
y_s = Math.copySign(1.0, y);
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
assert x < y_m && y_m < z && z < t_m;
public static double code(double t_s, double y_s, double x, double y_m, double z, double t_m) {
	double t_2 = t_m * (y_m * -z);
	double t_3 = t_m * (y_m * x);
	double tmp;
	if (x <= -1.95e+59) {
		tmp = t_3;
	} else if (x <= -7.2e+32) {
		tmp = t_2;
	} else if (x <= -4.1e-63) {
		tmp = x * (t_m * y_m);
	} else if (x <= 4.1e+35) {
		tmp = t_2;
	} else {
		tmp = t_3;
	}
	return t_s * (y_s * tmp);
}
y_m = math.fabs(y)
y_s = math.copysign(1.0, y)
t_m = math.fabs(t)
t_s = math.copysign(1.0, t)
[x, y_m, z, t_m] = sort([x, y_m, z, t_m])
def code(t_s, y_s, x, y_m, z, t_m):
	t_2 = t_m * (y_m * -z)
	t_3 = t_m * (y_m * x)
	tmp = 0
	if x <= -1.95e+59:
		tmp = t_3
	elif x <= -7.2e+32:
		tmp = t_2
	elif x <= -4.1e-63:
		tmp = x * (t_m * y_m)
	elif x <= 4.1e+35:
		tmp = t_2
	else:
		tmp = t_3
	return t_s * (y_s * tmp)
y_m = abs(y)
y_s = copysign(1.0, y)
t_m = abs(t)
t_s = copysign(1.0, t)
x, y_m, z, t_m = sort([x, y_m, z, t_m])
function code(t_s, y_s, x, y_m, z, t_m)
	t_2 = Float64(t_m * Float64(y_m * Float64(-z)))
	t_3 = Float64(t_m * Float64(y_m * x))
	tmp = 0.0
	if (x <= -1.95e+59)
		tmp = t_3;
	elseif (x <= -7.2e+32)
		tmp = t_2;
	elseif (x <= -4.1e-63)
		tmp = Float64(x * Float64(t_m * y_m));
	elseif (x <= 4.1e+35)
		tmp = t_2;
	else
		tmp = t_3;
	end
	return Float64(t_s * Float64(y_s * tmp))
end
y_m = abs(y);
y_s = sign(y) * abs(1.0);
t_m = abs(t);
t_s = sign(t) * abs(1.0);
x, y_m, z, t_m = num2cell(sort([x, y_m, z, t_m])){:}
function tmp_2 = code(t_s, y_s, x, y_m, z, t_m)
	t_2 = t_m * (y_m * -z);
	t_3 = t_m * (y_m * x);
	tmp = 0.0;
	if (x <= -1.95e+59)
		tmp = t_3;
	elseif (x <= -7.2e+32)
		tmp = t_2;
	elseif (x <= -4.1e-63)
		tmp = x * (t_m * y_m);
	elseif (x <= 4.1e+35)
		tmp = t_2;
	else
		tmp = t_3;
	end
	tmp_2 = t_s * (y_s * tmp);
end
y_m = N[Abs[y], $MachinePrecision]
y_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
t_m = N[Abs[t], $MachinePrecision]
t_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y_m, z, and t_m should be sorted in increasing order before calling this function.
code[t$95$s_, y$95$s_, x_, y$95$m_, z_, t$95$m_] := Block[{t$95$2 = N[(t$95$m * N[(y$95$m * (-z)), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$m * N[(y$95$m * x), $MachinePrecision]), $MachinePrecision]}, N[(t$95$s * N[(y$95$s * If[LessEqual[x, -1.95e+59], t$95$3, If[LessEqual[x, -7.2e+32], t$95$2, If[LessEqual[x, -4.1e-63], N[(x * N[(t$95$m * y$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 4.1e+35], t$95$2, t$95$3]]]]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
y_m = \left|y\right|
\\
y_s = \mathsf{copysign}\left(1, y\right)
\\
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
[x, y_m, z, t_m] = \mathsf{sort}([x, y_m, z, t_m])\\
\\
\begin{array}{l}
t_2 := t_m \cdot \left(y_m \cdot \left(-z\right)\right)\\
t_3 := t_m \cdot \left(y_m \cdot x\right)\\
t_s \cdot \left(y_s \cdot \begin{array}{l}
\mathbf{if}\;x \leq -1.95 \cdot 10^{+59}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;x \leq -7.2 \cdot 10^{+32}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;x \leq -4.1 \cdot 10^{-63}:\\
\;\;\;\;x \cdot \left(t_m \cdot y_m\right)\\

\mathbf{elif}\;x \leq 4.1 \cdot 10^{+35}:\\
\;\;\;\;t_2\\

\mathbf{else}:\\
\;\;\;\;t_3\\


\end{array}\right)
\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -1.95000000000000011e59 or 4.0999999999999998e35 < x

    1. Initial program 91.5%

      \[\left(x \cdot y - z \cdot y\right) \cdot t \]
    2. Step-by-step derivation
      1. distribute-rgt-out--93.3%

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

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

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

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

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

    if -1.95000000000000011e59 < x < -7.1999999999999994e32 or -4.0999999999999998e-63 < x < 4.0999999999999998e35

    1. Initial program 93.0%

      \[\left(x \cdot y - z \cdot y\right) \cdot t \]
    2. Step-by-step derivation
      1. distribute-rgt-out--93.0%

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

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

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

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

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

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

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

    if -7.1999999999999994e32 < x < -4.0999999999999998e-63

    1. Initial program 99.8%

      \[\left(x \cdot y - z \cdot y\right) \cdot t \]
    2. Step-by-step derivation
      1. distribute-rgt-out--99.8%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y}{\frac{x + z}{{x}^{2} - {z}^{2}}}} \cdot t \]
      2. unpow289.1%

        \[\leadsto \frac{y}{\frac{x + z}{\color{blue}{x \cdot x} - {z}^{2}}} \cdot t \]
      3. unpow289.1%

        \[\leadsto \frac{y}{\frac{x + z}{x \cdot x - \color{blue}{z \cdot z}}} \cdot t \]
      4. difference-of-squares89.1%

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

        \[\leadsto \frac{y}{\color{blue}{\frac{\frac{x + z}{x + z}}{x - z}}} \cdot t \]
      6. *-inverses99.6%

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

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

        \[\leadsto \color{blue}{\frac{y \cdot t}{\frac{1}{x - z}}} \]
      2. clear-num98.9%

        \[\leadsto \color{blue}{\frac{1}{\frac{\frac{1}{x - z}}{y \cdot t}}} \]
      3. sub-neg98.9%

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

        \[\leadsto \frac{1}{\frac{\frac{1}{x + \color{blue}{\sqrt{-z} \cdot \sqrt{-z}}}}{y \cdot t}} \]
      5. sqrt-unprod76.7%

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

        \[\leadsto \frac{1}{\frac{\frac{1}{x + \sqrt{\color{blue}{z \cdot z}}}}{y \cdot t}} \]
      7. sqrt-unprod46.8%

        \[\leadsto \frac{1}{\frac{\frac{1}{x + \color{blue}{\sqrt{z} \cdot \sqrt{z}}}}{y \cdot t}} \]
      8. add-sqr-sqrt70.0%

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

      \[\leadsto \color{blue}{\frac{1}{\frac{\frac{1}{x + z}}{y \cdot t}}} \]
    11. Taylor expanded in x around inf 70.8%

      \[\leadsto \frac{1}{\frac{\color{blue}{\frac{1}{x}}}{y \cdot t}} \]
    12. Step-by-step derivation
      1. clear-num71.2%

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

        \[\leadsto \color{blue}{\left(y \cdot t\right) \cdot \frac{1}{\frac{1}{x}}} \]
      3. remove-double-div71.6%

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

        \[\leadsto \color{blue}{\left(t \cdot y\right)} \cdot x \]
    13. Applied egg-rr71.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.95 \cdot 10^{+59}:\\ \;\;\;\;t \cdot \left(y \cdot x\right)\\ \mathbf{elif}\;x \leq -7.2 \cdot 10^{+32}:\\ \;\;\;\;t \cdot \left(y \cdot \left(-z\right)\right)\\ \mathbf{elif}\;x \leq -4.1 \cdot 10^{-63}:\\ \;\;\;\;x \cdot \left(t \cdot y\right)\\ \mathbf{elif}\;x \leq 4.1 \cdot 10^{+35}:\\ \;\;\;\;t \cdot \left(y \cdot \left(-z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(y \cdot x\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 75.0% accurate, 0.9× speedup?

\[\begin{array}{l} y_m = \left|y\right| \\ y_s = \mathsf{copysign}\left(1, y\right) \\ t_m = \left|t\right| \\ t_s = \mathsf{copysign}\left(1, t\right) \\ [x, y_m, z, t_m] = \mathsf{sort}([x, y_m, z, t_m])\\ \\ t_s \cdot \left(y_s \cdot \begin{array}{l} \mathbf{if}\;x \leq -1.76 \cdot 10^{-62} \lor \neg \left(x \leq 1.2 \cdot 10^{+16}\right):\\ \;\;\;\;t_m \cdot \left(y_m \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;y_m \cdot \left(t_m \cdot \left(-z\right)\right)\\ \end{array}\right) \end{array} \]
y_m = (fabs.f64 y)
y_s = (copysign.f64 1 y)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
NOTE: x, y_m, z, and t_m should be sorted in increasing order before calling this function.
(FPCore (t_s y_s x y_m z t_m)
 :precision binary64
 (*
  t_s
  (*
   y_s
   (if (or (<= x -1.76e-62) (not (<= x 1.2e+16)))
     (* t_m (* y_m x))
     (* y_m (* t_m (- z)))))))
y_m = fabs(y);
y_s = copysign(1.0, y);
t_m = fabs(t);
t_s = copysign(1.0, t);
assert(x < y_m && y_m < z && z < t_m);
double code(double t_s, double y_s, double x, double y_m, double z, double t_m) {
	double tmp;
	if ((x <= -1.76e-62) || !(x <= 1.2e+16)) {
		tmp = t_m * (y_m * x);
	} else {
		tmp = y_m * (t_m * -z);
	}
	return t_s * (y_s * tmp);
}
y_m = abs(y)
y_s = copysign(1.0d0, y)
t_m = abs(t)
t_s = copysign(1.0d0, t)
NOTE: x, y_m, z, and t_m should be sorted in increasing order before calling this function.
real(8) function code(t_s, y_s, x, y_m, z, t_m)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: y_s
    real(8), intent (in) :: x
    real(8), intent (in) :: y_m
    real(8), intent (in) :: z
    real(8), intent (in) :: t_m
    real(8) :: tmp
    if ((x <= (-1.76d-62)) .or. (.not. (x <= 1.2d+16))) then
        tmp = t_m * (y_m * x)
    else
        tmp = y_m * (t_m * -z)
    end if
    code = t_s * (y_s * tmp)
end function
y_m = Math.abs(y);
y_s = Math.copySign(1.0, y);
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
assert x < y_m && y_m < z && z < t_m;
public static double code(double t_s, double y_s, double x, double y_m, double z, double t_m) {
	double tmp;
	if ((x <= -1.76e-62) || !(x <= 1.2e+16)) {
		tmp = t_m * (y_m * x);
	} else {
		tmp = y_m * (t_m * -z);
	}
	return t_s * (y_s * tmp);
}
y_m = math.fabs(y)
y_s = math.copysign(1.0, y)
t_m = math.fabs(t)
t_s = math.copysign(1.0, t)
[x, y_m, z, t_m] = sort([x, y_m, z, t_m])
def code(t_s, y_s, x, y_m, z, t_m):
	tmp = 0
	if (x <= -1.76e-62) or not (x <= 1.2e+16):
		tmp = t_m * (y_m * x)
	else:
		tmp = y_m * (t_m * -z)
	return t_s * (y_s * tmp)
y_m = abs(y)
y_s = copysign(1.0, y)
t_m = abs(t)
t_s = copysign(1.0, t)
x, y_m, z, t_m = sort([x, y_m, z, t_m])
function code(t_s, y_s, x, y_m, z, t_m)
	tmp = 0.0
	if ((x <= -1.76e-62) || !(x <= 1.2e+16))
		tmp = Float64(t_m * Float64(y_m * x));
	else
		tmp = Float64(y_m * Float64(t_m * Float64(-z)));
	end
	return Float64(t_s * Float64(y_s * tmp))
end
y_m = abs(y);
y_s = sign(y) * abs(1.0);
t_m = abs(t);
t_s = sign(t) * abs(1.0);
x, y_m, z, t_m = num2cell(sort([x, y_m, z, t_m])){:}
function tmp_2 = code(t_s, y_s, x, y_m, z, t_m)
	tmp = 0.0;
	if ((x <= -1.76e-62) || ~((x <= 1.2e+16)))
		tmp = t_m * (y_m * x);
	else
		tmp = y_m * (t_m * -z);
	end
	tmp_2 = t_s * (y_s * tmp);
end
y_m = N[Abs[y], $MachinePrecision]
y_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
t_m = N[Abs[t], $MachinePrecision]
t_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y_m, z, and t_m should be sorted in increasing order before calling this function.
code[t$95$s_, y$95$s_, x_, y$95$m_, z_, t$95$m_] := N[(t$95$s * N[(y$95$s * If[Or[LessEqual[x, -1.76e-62], N[Not[LessEqual[x, 1.2e+16]], $MachinePrecision]], N[(t$95$m * N[(y$95$m * x), $MachinePrecision]), $MachinePrecision], N[(y$95$m * N[(t$95$m * (-z)), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
y_m = \left|y\right|
\\
y_s = \mathsf{copysign}\left(1, y\right)
\\
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
[x, y_m, z, t_m] = \mathsf{sort}([x, y_m, z, t_m])\\
\\
t_s \cdot \left(y_s \cdot \begin{array}{l}
\mathbf{if}\;x \leq -1.76 \cdot 10^{-62} \lor \neg \left(x \leq 1.2 \cdot 10^{+16}\right):\\
\;\;\;\;t_m \cdot \left(y_m \cdot x\right)\\

\mathbf{else}:\\
\;\;\;\;y_m \cdot \left(t_m \cdot \left(-z\right)\right)\\


\end{array}\right)
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.76e-62 or 1.2e16 < x

    1. Initial program 92.7%

      \[\left(x \cdot y - z \cdot y\right) \cdot t \]
    2. Step-by-step derivation
      1. distribute-rgt-out--94.1%

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

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

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

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

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

    if -1.76e-62 < x < 1.2e16

    1. Initial program 92.9%

      \[\left(x \cdot y - z \cdot y\right) \cdot t \]
    2. Step-by-step derivation
      1. distribute-rgt-out--93.0%

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

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

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

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

      \[\leadsto y \cdot \color{blue}{\left(-1 \cdot \left(t \cdot z\right)\right)} \]
    6. Step-by-step derivation
      1. mul-1-neg79.5%

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

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

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

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

Alternative 4: 76.2% accurate, 0.9× speedup?

\[\begin{array}{l} y_m = \left|y\right| \\ y_s = \mathsf{copysign}\left(1, y\right) \\ t_m = \left|t\right| \\ t_s = \mathsf{copysign}\left(1, t\right) \\ [x, y_m, z, t_m] = \mathsf{sort}([x, y_m, z, t_m])\\ \\ t_s \cdot \left(y_s \cdot \begin{array}{l} \mathbf{if}\;x \leq -4.9 \cdot 10^{-65} \lor \neg \left(x \leq 2.7 \cdot 10^{+35}\right):\\ \;\;\;\;t_m \cdot \left(y_m \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(t_m \cdot \left(-y_m\right)\right)\\ \end{array}\right) \end{array} \]
y_m = (fabs.f64 y)
y_s = (copysign.f64 1 y)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
NOTE: x, y_m, z, and t_m should be sorted in increasing order before calling this function.
(FPCore (t_s y_s x y_m z t_m)
 :precision binary64
 (*
  t_s
  (*
   y_s
   (if (or (<= x -4.9e-65) (not (<= x 2.7e+35)))
     (* t_m (* y_m x))
     (* z (* t_m (- y_m)))))))
y_m = fabs(y);
y_s = copysign(1.0, y);
t_m = fabs(t);
t_s = copysign(1.0, t);
assert(x < y_m && y_m < z && z < t_m);
double code(double t_s, double y_s, double x, double y_m, double z, double t_m) {
	double tmp;
	if ((x <= -4.9e-65) || !(x <= 2.7e+35)) {
		tmp = t_m * (y_m * x);
	} else {
		tmp = z * (t_m * -y_m);
	}
	return t_s * (y_s * tmp);
}
y_m = abs(y)
y_s = copysign(1.0d0, y)
t_m = abs(t)
t_s = copysign(1.0d0, t)
NOTE: x, y_m, z, and t_m should be sorted in increasing order before calling this function.
real(8) function code(t_s, y_s, x, y_m, z, t_m)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: y_s
    real(8), intent (in) :: x
    real(8), intent (in) :: y_m
    real(8), intent (in) :: z
    real(8), intent (in) :: t_m
    real(8) :: tmp
    if ((x <= (-4.9d-65)) .or. (.not. (x <= 2.7d+35))) then
        tmp = t_m * (y_m * x)
    else
        tmp = z * (t_m * -y_m)
    end if
    code = t_s * (y_s * tmp)
end function
y_m = Math.abs(y);
y_s = Math.copySign(1.0, y);
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
assert x < y_m && y_m < z && z < t_m;
public static double code(double t_s, double y_s, double x, double y_m, double z, double t_m) {
	double tmp;
	if ((x <= -4.9e-65) || !(x <= 2.7e+35)) {
		tmp = t_m * (y_m * x);
	} else {
		tmp = z * (t_m * -y_m);
	}
	return t_s * (y_s * tmp);
}
y_m = math.fabs(y)
y_s = math.copysign(1.0, y)
t_m = math.fabs(t)
t_s = math.copysign(1.0, t)
[x, y_m, z, t_m] = sort([x, y_m, z, t_m])
def code(t_s, y_s, x, y_m, z, t_m):
	tmp = 0
	if (x <= -4.9e-65) or not (x <= 2.7e+35):
		tmp = t_m * (y_m * x)
	else:
		tmp = z * (t_m * -y_m)
	return t_s * (y_s * tmp)
y_m = abs(y)
y_s = copysign(1.0, y)
t_m = abs(t)
t_s = copysign(1.0, t)
x, y_m, z, t_m = sort([x, y_m, z, t_m])
function code(t_s, y_s, x, y_m, z, t_m)
	tmp = 0.0
	if ((x <= -4.9e-65) || !(x <= 2.7e+35))
		tmp = Float64(t_m * Float64(y_m * x));
	else
		tmp = Float64(z * Float64(t_m * Float64(-y_m)));
	end
	return Float64(t_s * Float64(y_s * tmp))
end
y_m = abs(y);
y_s = sign(y) * abs(1.0);
t_m = abs(t);
t_s = sign(t) * abs(1.0);
x, y_m, z, t_m = num2cell(sort([x, y_m, z, t_m])){:}
function tmp_2 = code(t_s, y_s, x, y_m, z, t_m)
	tmp = 0.0;
	if ((x <= -4.9e-65) || ~((x <= 2.7e+35)))
		tmp = t_m * (y_m * x);
	else
		tmp = z * (t_m * -y_m);
	end
	tmp_2 = t_s * (y_s * tmp);
end
y_m = N[Abs[y], $MachinePrecision]
y_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
t_m = N[Abs[t], $MachinePrecision]
t_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y_m, z, and t_m should be sorted in increasing order before calling this function.
code[t$95$s_, y$95$s_, x_, y$95$m_, z_, t$95$m_] := N[(t$95$s * N[(y$95$s * If[Or[LessEqual[x, -4.9e-65], N[Not[LessEqual[x, 2.7e+35]], $MachinePrecision]], N[(t$95$m * N[(y$95$m * x), $MachinePrecision]), $MachinePrecision], N[(z * N[(t$95$m * (-y$95$m)), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
y_m = \left|y\right|
\\
y_s = \mathsf{copysign}\left(1, y\right)
\\
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
[x, y_m, z, t_m] = \mathsf{sort}([x, y_m, z, t_m])\\
\\
t_s \cdot \left(y_s \cdot \begin{array}{l}
\mathbf{if}\;x \leq -4.9 \cdot 10^{-65} \lor \neg \left(x \leq 2.7 \cdot 10^{+35}\right):\\
\;\;\;\;t_m \cdot \left(y_m \cdot x\right)\\

\mathbf{else}:\\
\;\;\;\;z \cdot \left(t_m \cdot \left(-y_m\right)\right)\\


\end{array}\right)
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -4.89999999999999964e-65 or 2.70000000000000003e35 < x

    1. Initial program 92.4%

      \[\left(x \cdot y - z \cdot y\right) \cdot t \]
    2. Step-by-step derivation
      1. distribute-rgt-out--93.8%

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

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

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

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

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

    if -4.89999999999999964e-65 < x < 2.70000000000000003e35

    1. Initial program 93.3%

      \[\left(x \cdot y - z \cdot y\right) \cdot t \]
    2. Step-by-step derivation
      1. distribute-rgt-out--93.3%

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

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

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

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

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

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

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

        \[\leadsto t \cdot \color{blue}{\left(y \cdot \left(-z\right)\right)} \]
      4. associate-*l*80.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -4.9 \cdot 10^{-65} \lor \neg \left(x \leq 2.7 \cdot 10^{+35}\right):\\ \;\;\;\;t \cdot \left(y \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(t \cdot \left(-y\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 88.4% accurate, 1.0× speedup?

\[\begin{array}{l} y_m = \left|y\right| \\ y_s = \mathsf{copysign}\left(1, y\right) \\ t_m = \left|t\right| \\ t_s = \mathsf{copysign}\left(1, t\right) \\ [x, y_m, z, t_m] = \mathsf{sort}([x, y_m, z, t_m])\\ \\ t_s \cdot \left(y_s \cdot \begin{array}{l} \mathbf{if}\;z \leq -4.5 \cdot 10^{+246}:\\ \;\;\;\;t_m \cdot \left(y_m \cdot \left(-z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;y_m \cdot \left(t_m \cdot \left(x - z\right)\right)\\ \end{array}\right) \end{array} \]
y_m = (fabs.f64 y)
y_s = (copysign.f64 1 y)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
NOTE: x, y_m, z, and t_m should be sorted in increasing order before calling this function.
(FPCore (t_s y_s x y_m z t_m)
 :precision binary64
 (*
  t_s
  (* y_s (if (<= z -4.5e+246) (* t_m (* y_m (- z))) (* y_m (* t_m (- x z)))))))
y_m = fabs(y);
y_s = copysign(1.0, y);
t_m = fabs(t);
t_s = copysign(1.0, t);
assert(x < y_m && y_m < z && z < t_m);
double code(double t_s, double y_s, double x, double y_m, double z, double t_m) {
	double tmp;
	if (z <= -4.5e+246) {
		tmp = t_m * (y_m * -z);
	} else {
		tmp = y_m * (t_m * (x - z));
	}
	return t_s * (y_s * tmp);
}
y_m = abs(y)
y_s = copysign(1.0d0, y)
t_m = abs(t)
t_s = copysign(1.0d0, t)
NOTE: x, y_m, z, and t_m should be sorted in increasing order before calling this function.
real(8) function code(t_s, y_s, x, y_m, z, t_m)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: y_s
    real(8), intent (in) :: x
    real(8), intent (in) :: y_m
    real(8), intent (in) :: z
    real(8), intent (in) :: t_m
    real(8) :: tmp
    if (z <= (-4.5d+246)) then
        tmp = t_m * (y_m * -z)
    else
        tmp = y_m * (t_m * (x - z))
    end if
    code = t_s * (y_s * tmp)
end function
y_m = Math.abs(y);
y_s = Math.copySign(1.0, y);
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
assert x < y_m && y_m < z && z < t_m;
public static double code(double t_s, double y_s, double x, double y_m, double z, double t_m) {
	double tmp;
	if (z <= -4.5e+246) {
		tmp = t_m * (y_m * -z);
	} else {
		tmp = y_m * (t_m * (x - z));
	}
	return t_s * (y_s * tmp);
}
y_m = math.fabs(y)
y_s = math.copysign(1.0, y)
t_m = math.fabs(t)
t_s = math.copysign(1.0, t)
[x, y_m, z, t_m] = sort([x, y_m, z, t_m])
def code(t_s, y_s, x, y_m, z, t_m):
	tmp = 0
	if z <= -4.5e+246:
		tmp = t_m * (y_m * -z)
	else:
		tmp = y_m * (t_m * (x - z))
	return t_s * (y_s * tmp)
y_m = abs(y)
y_s = copysign(1.0, y)
t_m = abs(t)
t_s = copysign(1.0, t)
x, y_m, z, t_m = sort([x, y_m, z, t_m])
function code(t_s, y_s, x, y_m, z, t_m)
	tmp = 0.0
	if (z <= -4.5e+246)
		tmp = Float64(t_m * Float64(y_m * Float64(-z)));
	else
		tmp = Float64(y_m * Float64(t_m * Float64(x - z)));
	end
	return Float64(t_s * Float64(y_s * tmp))
end
y_m = abs(y);
y_s = sign(y) * abs(1.0);
t_m = abs(t);
t_s = sign(t) * abs(1.0);
x, y_m, z, t_m = num2cell(sort([x, y_m, z, t_m])){:}
function tmp_2 = code(t_s, y_s, x, y_m, z, t_m)
	tmp = 0.0;
	if (z <= -4.5e+246)
		tmp = t_m * (y_m * -z);
	else
		tmp = y_m * (t_m * (x - z));
	end
	tmp_2 = t_s * (y_s * tmp);
end
y_m = N[Abs[y], $MachinePrecision]
y_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
t_m = N[Abs[t], $MachinePrecision]
t_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y_m, z, and t_m should be sorted in increasing order before calling this function.
code[t$95$s_, y$95$s_, x_, y$95$m_, z_, t$95$m_] := N[(t$95$s * N[(y$95$s * If[LessEqual[z, -4.5e+246], N[(t$95$m * N[(y$95$m * (-z)), $MachinePrecision]), $MachinePrecision], N[(y$95$m * N[(t$95$m * N[(x - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
y_m = \left|y\right|
\\
y_s = \mathsf{copysign}\left(1, y\right)
\\
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
[x, y_m, z, t_m] = \mathsf{sort}([x, y_m, z, t_m])\\
\\
t_s \cdot \left(y_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -4.5 \cdot 10^{+246}:\\
\;\;\;\;t_m \cdot \left(y_m \cdot \left(-z\right)\right)\\

\mathbf{else}:\\
\;\;\;\;y_m \cdot \left(t_m \cdot \left(x - z\right)\right)\\


\end{array}\right)
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -4.5e246

    1. Initial program 84.7%

      \[\left(x \cdot y - z \cdot y\right) \cdot t \]
    2. Step-by-step derivation
      1. distribute-rgt-out--84.7%

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

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

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

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

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

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

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

    if -4.5e246 < z

    1. Initial program 93.4%

      \[\left(x \cdot y - z \cdot y\right) \cdot t \]
    2. Step-by-step derivation
      1. distribute-rgt-out--94.3%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.5 \cdot 10^{+246}:\\ \;\;\;\;t \cdot \left(y \cdot \left(-z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(t \cdot \left(x - z\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 57.5% accurate, 1.3× speedup?

\[\begin{array}{l} y_m = \left|y\right| \\ y_s = \mathsf{copysign}\left(1, y\right) \\ t_m = \left|t\right| \\ t_s = \mathsf{copysign}\left(1, t\right) \\ [x, y_m, z, t_m] = \mathsf{sort}([x, y_m, z, t_m])\\ \\ t_s \cdot \left(y_s \cdot \begin{array}{l} \mathbf{if}\;t_m \leq 5 \cdot 10^{+17}:\\ \;\;\;\;y_m \cdot \left(t_m \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(t_m \cdot y_m\right)\\ \end{array}\right) \end{array} \]
y_m = (fabs.f64 y)
y_s = (copysign.f64 1 y)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
NOTE: x, y_m, z, and t_m should be sorted in increasing order before calling this function.
(FPCore (t_s y_s x y_m z t_m)
 :precision binary64
 (* t_s (* y_s (if (<= t_m 5e+17) (* y_m (* t_m x)) (* x (* t_m y_m))))))
y_m = fabs(y);
y_s = copysign(1.0, y);
t_m = fabs(t);
t_s = copysign(1.0, t);
assert(x < y_m && y_m < z && z < t_m);
double code(double t_s, double y_s, double x, double y_m, double z, double t_m) {
	double tmp;
	if (t_m <= 5e+17) {
		tmp = y_m * (t_m * x);
	} else {
		tmp = x * (t_m * y_m);
	}
	return t_s * (y_s * tmp);
}
y_m = abs(y)
y_s = copysign(1.0d0, y)
t_m = abs(t)
t_s = copysign(1.0d0, t)
NOTE: x, y_m, z, and t_m should be sorted in increasing order before calling this function.
real(8) function code(t_s, y_s, x, y_m, z, t_m)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: y_s
    real(8), intent (in) :: x
    real(8), intent (in) :: y_m
    real(8), intent (in) :: z
    real(8), intent (in) :: t_m
    real(8) :: tmp
    if (t_m <= 5d+17) then
        tmp = y_m * (t_m * x)
    else
        tmp = x * (t_m * y_m)
    end if
    code = t_s * (y_s * tmp)
end function
y_m = Math.abs(y);
y_s = Math.copySign(1.0, y);
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
assert x < y_m && y_m < z && z < t_m;
public static double code(double t_s, double y_s, double x, double y_m, double z, double t_m) {
	double tmp;
	if (t_m <= 5e+17) {
		tmp = y_m * (t_m * x);
	} else {
		tmp = x * (t_m * y_m);
	}
	return t_s * (y_s * tmp);
}
y_m = math.fabs(y)
y_s = math.copysign(1.0, y)
t_m = math.fabs(t)
t_s = math.copysign(1.0, t)
[x, y_m, z, t_m] = sort([x, y_m, z, t_m])
def code(t_s, y_s, x, y_m, z, t_m):
	tmp = 0
	if t_m <= 5e+17:
		tmp = y_m * (t_m * x)
	else:
		tmp = x * (t_m * y_m)
	return t_s * (y_s * tmp)
y_m = abs(y)
y_s = copysign(1.0, y)
t_m = abs(t)
t_s = copysign(1.0, t)
x, y_m, z, t_m = sort([x, y_m, z, t_m])
function code(t_s, y_s, x, y_m, z, t_m)
	tmp = 0.0
	if (t_m <= 5e+17)
		tmp = Float64(y_m * Float64(t_m * x));
	else
		tmp = Float64(x * Float64(t_m * y_m));
	end
	return Float64(t_s * Float64(y_s * tmp))
end
y_m = abs(y);
y_s = sign(y) * abs(1.0);
t_m = abs(t);
t_s = sign(t) * abs(1.0);
x, y_m, z, t_m = num2cell(sort([x, y_m, z, t_m])){:}
function tmp_2 = code(t_s, y_s, x, y_m, z, t_m)
	tmp = 0.0;
	if (t_m <= 5e+17)
		tmp = y_m * (t_m * x);
	else
		tmp = x * (t_m * y_m);
	end
	tmp_2 = t_s * (y_s * tmp);
end
y_m = N[Abs[y], $MachinePrecision]
y_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
t_m = N[Abs[t], $MachinePrecision]
t_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y_m, z, and t_m should be sorted in increasing order before calling this function.
code[t$95$s_, y$95$s_, x_, y$95$m_, z_, t$95$m_] := N[(t$95$s * N[(y$95$s * If[LessEqual[t$95$m, 5e+17], N[(y$95$m * N[(t$95$m * x), $MachinePrecision]), $MachinePrecision], N[(x * N[(t$95$m * y$95$m), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
y_m = \left|y\right|
\\
y_s = \mathsf{copysign}\left(1, y\right)
\\
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
[x, y_m, z, t_m] = \mathsf{sort}([x, y_m, z, t_m])\\
\\
t_s \cdot \left(y_s \cdot \begin{array}{l}
\mathbf{if}\;t_m \leq 5 \cdot 10^{+17}:\\
\;\;\;\;y_m \cdot \left(t_m \cdot x\right)\\

\mathbf{else}:\\
\;\;\;\;x \cdot \left(t_m \cdot y_m\right)\\


\end{array}\right)
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < 5e17

    1. Initial program 90.9%

      \[\left(x \cdot y - z \cdot y\right) \cdot t \]
    2. Step-by-step derivation
      1. distribute-rgt-out--91.9%

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

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

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

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

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

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

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

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

    if 5e17 < t

    1. Initial program 99.9%

      \[\left(x \cdot y - z \cdot y\right) \cdot t \]
    2. Step-by-step derivation
      1. distribute-rgt-out--99.9%

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

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

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

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

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

        \[\leadsto \frac{y \cdot \left({x}^{2} - \color{blue}{{z}^{2}}\right)}{x + z} \cdot t \]
    6. Applied egg-rr72.9%

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

        \[\leadsto \color{blue}{\frac{y}{\frac{x + z}{{x}^{2} - {z}^{2}}}} \cdot t \]
      2. unpow272.9%

        \[\leadsto \frac{y}{\frac{x + z}{\color{blue}{x \cdot x} - {z}^{2}}} \cdot t \]
      3. unpow272.9%

        \[\leadsto \frac{y}{\frac{x + z}{x \cdot x - \color{blue}{z \cdot z}}} \cdot t \]
      4. difference-of-squares76.8%

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

        \[\leadsto \frac{y}{\color{blue}{\frac{\frac{x + z}{x + z}}{x - z}}} \cdot t \]
      6. *-inverses99.7%

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

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

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

        \[\leadsto \color{blue}{\frac{1}{\frac{\frac{1}{x - z}}{y \cdot t}}} \]
      3. sub-neg96.3%

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

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

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

        \[\leadsto \frac{1}{\frac{\frac{1}{x + \sqrt{\color{blue}{z \cdot z}}}}{y \cdot t}} \]
      7. sqrt-unprod24.2%

        \[\leadsto \frac{1}{\frac{\frac{1}{x + \color{blue}{\sqrt{z} \cdot \sqrt{z}}}}{y \cdot t}} \]
      8. add-sqr-sqrt50.4%

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

      \[\leadsto \color{blue}{\frac{1}{\frac{\frac{1}{x + z}}{y \cdot t}}} \]
    11. Taylor expanded in x around inf 64.1%

      \[\leadsto \frac{1}{\frac{\color{blue}{\frac{1}{x}}}{y \cdot t}} \]
    12. Step-by-step derivation
      1. clear-num64.1%

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

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

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

        \[\leadsto \color{blue}{\left(t \cdot y\right)} \cdot x \]
    13. Applied egg-rr64.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 5 \cdot 10^{+17}:\\ \;\;\;\;y \cdot \left(t \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(t \cdot y\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 51.2% accurate, 1.8× speedup?

\[\begin{array}{l} y_m = \left|y\right| \\ y_s = \mathsf{copysign}\left(1, y\right) \\ t_m = \left|t\right| \\ t_s = \mathsf{copysign}\left(1, t\right) \\ [x, y_m, z, t_m] = \mathsf{sort}([x, y_m, z, t_m])\\ \\ t_s \cdot \left(y_s \cdot \left(y_m \cdot \left(t_m \cdot x\right)\right)\right) \end{array} \]
y_m = (fabs.f64 y)
y_s = (copysign.f64 1 y)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
NOTE: x, y_m, z, and t_m should be sorted in increasing order before calling this function.
(FPCore (t_s y_s x y_m z t_m)
 :precision binary64
 (* t_s (* y_s (* y_m (* t_m x)))))
y_m = fabs(y);
y_s = copysign(1.0, y);
t_m = fabs(t);
t_s = copysign(1.0, t);
assert(x < y_m && y_m < z && z < t_m);
double code(double t_s, double y_s, double x, double y_m, double z, double t_m) {
	return t_s * (y_s * (y_m * (t_m * x)));
}
y_m = abs(y)
y_s = copysign(1.0d0, y)
t_m = abs(t)
t_s = copysign(1.0d0, t)
NOTE: x, y_m, z, and t_m should be sorted in increasing order before calling this function.
real(8) function code(t_s, y_s, x, y_m, z, t_m)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: y_s
    real(8), intent (in) :: x
    real(8), intent (in) :: y_m
    real(8), intent (in) :: z
    real(8), intent (in) :: t_m
    code = t_s * (y_s * (y_m * (t_m * x)))
end function
y_m = Math.abs(y);
y_s = Math.copySign(1.0, y);
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
assert x < y_m && y_m < z && z < t_m;
public static double code(double t_s, double y_s, double x, double y_m, double z, double t_m) {
	return t_s * (y_s * (y_m * (t_m * x)));
}
y_m = math.fabs(y)
y_s = math.copysign(1.0, y)
t_m = math.fabs(t)
t_s = math.copysign(1.0, t)
[x, y_m, z, t_m] = sort([x, y_m, z, t_m])
def code(t_s, y_s, x, y_m, z, t_m):
	return t_s * (y_s * (y_m * (t_m * x)))
y_m = abs(y)
y_s = copysign(1.0, y)
t_m = abs(t)
t_s = copysign(1.0, t)
x, y_m, z, t_m = sort([x, y_m, z, t_m])
function code(t_s, y_s, x, y_m, z, t_m)
	return Float64(t_s * Float64(y_s * Float64(y_m * Float64(t_m * x))))
end
y_m = abs(y);
y_s = sign(y) * abs(1.0);
t_m = abs(t);
t_s = sign(t) * abs(1.0);
x, y_m, z, t_m = num2cell(sort([x, y_m, z, t_m])){:}
function tmp = code(t_s, y_s, x, y_m, z, t_m)
	tmp = t_s * (y_s * (y_m * (t_m * x)));
end
y_m = N[Abs[y], $MachinePrecision]
y_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
t_m = N[Abs[t], $MachinePrecision]
t_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y_m, z, and t_m should be sorted in increasing order before calling this function.
code[t$95$s_, y$95$s_, x_, y$95$m_, z_, t$95$m_] := N[(t$95$s * N[(y$95$s * N[(y$95$m * N[(t$95$m * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
y_m = \left|y\right|
\\
y_s = \mathsf{copysign}\left(1, y\right)
\\
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
[x, y_m, z, t_m] = \mathsf{sort}([x, y_m, z, t_m])\\
\\
t_s \cdot \left(y_s \cdot \left(y_m \cdot \left(t_m \cdot x\right)\right)\right)
\end{array}
Derivation
  1. Initial program 92.8%

    \[\left(x \cdot y - z \cdot y\right) \cdot t \]
  2. Step-by-step derivation
    1. distribute-rgt-out--93.6%

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

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

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

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

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

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

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

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

    \[\leadsto y \cdot \left(t \cdot x\right) \]
  9. Add Preprocessing

Alternative 8: 55.9% accurate, 1.8× speedup?

\[\begin{array}{l} y_m = \left|y\right| \\ y_s = \mathsf{copysign}\left(1, y\right) \\ t_m = \left|t\right| \\ t_s = \mathsf{copysign}\left(1, t\right) \\ [x, y_m, z, t_m] = \mathsf{sort}([x, y_m, z, t_m])\\ \\ t_s \cdot \left(y_s \cdot \left(t_m \cdot \left(y_m \cdot x\right)\right)\right) \end{array} \]
y_m = (fabs.f64 y)
y_s = (copysign.f64 1 y)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
NOTE: x, y_m, z, and t_m should be sorted in increasing order before calling this function.
(FPCore (t_s y_s x y_m z t_m)
 :precision binary64
 (* t_s (* y_s (* t_m (* y_m x)))))
y_m = fabs(y);
y_s = copysign(1.0, y);
t_m = fabs(t);
t_s = copysign(1.0, t);
assert(x < y_m && y_m < z && z < t_m);
double code(double t_s, double y_s, double x, double y_m, double z, double t_m) {
	return t_s * (y_s * (t_m * (y_m * x)));
}
y_m = abs(y)
y_s = copysign(1.0d0, y)
t_m = abs(t)
t_s = copysign(1.0d0, t)
NOTE: x, y_m, z, and t_m should be sorted in increasing order before calling this function.
real(8) function code(t_s, y_s, x, y_m, z, t_m)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: y_s
    real(8), intent (in) :: x
    real(8), intent (in) :: y_m
    real(8), intent (in) :: z
    real(8), intent (in) :: t_m
    code = t_s * (y_s * (t_m * (y_m * x)))
end function
y_m = Math.abs(y);
y_s = Math.copySign(1.0, y);
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
assert x < y_m && y_m < z && z < t_m;
public static double code(double t_s, double y_s, double x, double y_m, double z, double t_m) {
	return t_s * (y_s * (t_m * (y_m * x)));
}
y_m = math.fabs(y)
y_s = math.copysign(1.0, y)
t_m = math.fabs(t)
t_s = math.copysign(1.0, t)
[x, y_m, z, t_m] = sort([x, y_m, z, t_m])
def code(t_s, y_s, x, y_m, z, t_m):
	return t_s * (y_s * (t_m * (y_m * x)))
y_m = abs(y)
y_s = copysign(1.0, y)
t_m = abs(t)
t_s = copysign(1.0, t)
x, y_m, z, t_m = sort([x, y_m, z, t_m])
function code(t_s, y_s, x, y_m, z, t_m)
	return Float64(t_s * Float64(y_s * Float64(t_m * Float64(y_m * x))))
end
y_m = abs(y);
y_s = sign(y) * abs(1.0);
t_m = abs(t);
t_s = sign(t) * abs(1.0);
x, y_m, z, t_m = num2cell(sort([x, y_m, z, t_m])){:}
function tmp = code(t_s, y_s, x, y_m, z, t_m)
	tmp = t_s * (y_s * (t_m * (y_m * x)));
end
y_m = N[Abs[y], $MachinePrecision]
y_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
t_m = N[Abs[t], $MachinePrecision]
t_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y_m, z, and t_m should be sorted in increasing order before calling this function.
code[t$95$s_, y$95$s_, x_, y$95$m_, z_, t$95$m_] := N[(t$95$s * N[(y$95$s * N[(t$95$m * N[(y$95$m * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
y_m = \left|y\right|
\\
y_s = \mathsf{copysign}\left(1, y\right)
\\
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
[x, y_m, z, t_m] = \mathsf{sort}([x, y_m, z, t_m])\\
\\
t_s \cdot \left(y_s \cdot \left(t_m \cdot \left(y_m \cdot x\right)\right)\right)
\end{array}
Derivation
  1. Initial program 92.8%

    \[\left(x \cdot y - z \cdot y\right) \cdot t \]
  2. Step-by-step derivation
    1. distribute-rgt-out--93.6%

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

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

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

      \[\leadsto \color{blue}{\left(y \cdot x\right)} \cdot t \]
  7. Simplified54.5%

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

    \[\leadsto t \cdot \left(y \cdot x\right) \]
  9. Add Preprocessing

Developer target: 95.6% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t < -9.231879582886777 \cdot 10^{-80}:\\
\;\;\;\;\left(y \cdot t\right) \cdot \left(x - z\right)\\

\mathbf{elif}\;t < 2.543067051564877 \cdot 10^{+83}:\\
\;\;\;\;y \cdot \left(t \cdot \left(x - z\right)\right)\\

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


\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2024010 
(FPCore (x y z t)
  :name "Linear.Projection:inverseInfinitePerspective from linear-1.19.1.3"
  :precision binary64

  :herbie-target
  (if (< t -9.231879582886777e-80) (* (* y t) (- x z)) (if (< t 2.543067051564877e+83) (* y (* t (- x z))) (* (* y (- x z)) t)))

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