Linear.Projection:inverseInfinitePerspective from linear-1.19.1.3

Percentage Accurate: 90.8% → 97.1%
Time: 7.6s
Alternatives: 8
Speedup: 1.3×

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: 90.8% 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: 97.1% accurate, 0.8× speedup?

\[\begin{array}{l} [y, t] = \mathsf{sort}([y, t])\\ \\ \begin{array}{l} \mathbf{if}\;y \leq -16600000000000:\\ \;\;\;\;y \cdot \left(t \cdot \left(x - z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(y \cdot x - y \cdot z\right)\\ \end{array} \end{array} \]
NOTE: y and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
 :precision binary64
 (if (<= y -16600000000000.0) (* y (* t (- x z))) (* t (- (* y x) (* y z)))))
assert(y < t);
double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= -16600000000000.0) {
		tmp = y * (t * (x - z));
	} else {
		tmp = t * ((y * x) - (y * z));
	}
	return tmp;
}
NOTE: y and t should be sorted in increasing order before calling this function.
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 <= (-16600000000000.0d0)) then
        tmp = y * (t * (x - z))
    else
        tmp = t * ((y * x) - (y * z))
    end if
    code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= -16600000000000.0) {
		tmp = y * (t * (x - z));
	} else {
		tmp = t * ((y * x) - (y * z));
	}
	return tmp;
}
[y, t] = sort([y, t])
def code(x, y, z, t):
	tmp = 0
	if y <= -16600000000000.0:
		tmp = y * (t * (x - z))
	else:
		tmp = t * ((y * x) - (y * z))
	return tmp
y, t = sort([y, t])
function code(x, y, z, t)
	tmp = 0.0
	if (y <= -16600000000000.0)
		tmp = Float64(y * Float64(t * Float64(x - z)));
	else
		tmp = Float64(t * Float64(Float64(y * x) - Float64(y * z)));
	end
	return tmp
end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (y <= -16600000000000.0)
		tmp = y * (t * (x - z));
	else
		tmp = t * ((y * x) - (y * z));
	end
	tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := If[LessEqual[y, -16600000000000.0], N[(y * N[(t * N[(x - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(N[(y * x), $MachinePrecision] - N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -16600000000000:\\
\;\;\;\;y \cdot \left(t \cdot \left(x - z\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.66e13

    1. Initial program 69.4%

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

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

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

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

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

    if -1.66e13 < y

    1. Initial program 94.2%

      \[\left(x \cdot y - z \cdot y\right) \cdot t \]
  3. Recombined 2 regimes into one program.
  4. Final simplification94.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -16600000000000:\\ \;\;\;\;y \cdot \left(t \cdot \left(x - z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(y \cdot x - y \cdot z\right)\\ \end{array} \]

Alternative 2: 74.0% accurate, 0.6× speedup?

\[\begin{array}{l} [y, t] = \mathsf{sort}([y, t])\\ \\ \begin{array}{l} t_1 := t \cdot \left(y \cdot x\right)\\ t_2 := y \cdot \left(z \cdot \left(-t\right)\right)\\ \mathbf{if}\;z \leq -2.1 \cdot 10^{-94}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq 3.8 \cdot 10^{-237}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 3.45 \cdot 10^{+18}:\\ \;\;\;\;x \cdot \left(y \cdot t\right)\\ \mathbf{elif}\;z \leq 5 \cdot 10^{+28}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \end{array} \]
NOTE: y and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* t (* y x))) (t_2 (* y (* z (- t)))))
   (if (<= z -2.1e-94)
     t_2
     (if (<= z 3.8e-237)
       t_1
       (if (<= z 3.45e+18) (* x (* y t)) (if (<= z 5e+28) t_1 t_2))))))
assert(y < t);
double code(double x, double y, double z, double t) {
	double t_1 = t * (y * x);
	double t_2 = y * (z * -t);
	double tmp;
	if (z <= -2.1e-94) {
		tmp = t_2;
	} else if (z <= 3.8e-237) {
		tmp = t_1;
	} else if (z <= 3.45e+18) {
		tmp = x * (y * t);
	} else if (z <= 5e+28) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
NOTE: y and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = t * (y * x)
    t_2 = y * (z * -t)
    if (z <= (-2.1d-94)) then
        tmp = t_2
    else if (z <= 3.8d-237) then
        tmp = t_1
    else if (z <= 3.45d+18) then
        tmp = x * (y * t)
    else if (z <= 5d+28) then
        tmp = t_1
    else
        tmp = t_2
    end if
    code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
	double t_1 = t * (y * x);
	double t_2 = y * (z * -t);
	double tmp;
	if (z <= -2.1e-94) {
		tmp = t_2;
	} else if (z <= 3.8e-237) {
		tmp = t_1;
	} else if (z <= 3.45e+18) {
		tmp = x * (y * t);
	} else if (z <= 5e+28) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
[y, t] = sort([y, t])
def code(x, y, z, t):
	t_1 = t * (y * x)
	t_2 = y * (z * -t)
	tmp = 0
	if z <= -2.1e-94:
		tmp = t_2
	elif z <= 3.8e-237:
		tmp = t_1
	elif z <= 3.45e+18:
		tmp = x * (y * t)
	elif z <= 5e+28:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
y, t = sort([y, t])
function code(x, y, z, t)
	t_1 = Float64(t * Float64(y * x))
	t_2 = Float64(y * Float64(z * Float64(-t)))
	tmp = 0.0
	if (z <= -2.1e-94)
		tmp = t_2;
	elseif (z <= 3.8e-237)
		tmp = t_1;
	elseif (z <= 3.45e+18)
		tmp = Float64(x * Float64(y * t));
	elseif (z <= 5e+28)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
	t_1 = t * (y * x);
	t_2 = y * (z * -t);
	tmp = 0.0;
	if (z <= -2.1e-94)
		tmp = t_2;
	elseif (z <= 3.8e-237)
		tmp = t_1;
	elseif (z <= 3.45e+18)
		tmp = x * (y * t);
	elseif (z <= 5e+28)
		tmp = t_1;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(t * N[(y * x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y * N[(z * (-t)), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.1e-94], t$95$2, If[LessEqual[z, 3.8e-237], t$95$1, If[LessEqual[z, 3.45e+18], N[(x * N[(y * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5e+28], t$95$1, t$95$2]]]]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
t_1 := t \cdot \left(y \cdot x\right)\\
t_2 := y \cdot \left(z \cdot \left(-t\right)\right)\\
\mathbf{if}\;z \leq -2.1 \cdot 10^{-94}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;z \leq 3.8 \cdot 10^{-237}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq 3.45 \cdot 10^{+18}:\\
\;\;\;\;x \cdot \left(y \cdot t\right)\\

\mathbf{elif}\;z \leq 5 \cdot 10^{+28}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -2.1000000000000001e-94 or 4.99999999999999957e28 < z

    1. Initial program 83.9%

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

        \[\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. Taylor expanded in x around 0 76.4%

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

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

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

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

    if -2.1000000000000001e-94 < z < 3.80000000000000024e-237 or 3.45e18 < z < 4.99999999999999957e28

    1. Initial program 95.6%

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

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

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

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

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

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

    if 3.80000000000000024e-237 < z < 3.45e18

    1. Initial program 93.2%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.1 \cdot 10^{-94}:\\ \;\;\;\;y \cdot \left(z \cdot \left(-t\right)\right)\\ \mathbf{elif}\;z \leq 3.8 \cdot 10^{-237}:\\ \;\;\;\;t \cdot \left(y \cdot x\right)\\ \mathbf{elif}\;z \leq 3.45 \cdot 10^{+18}:\\ \;\;\;\;x \cdot \left(y \cdot t\right)\\ \mathbf{elif}\;z \leq 5 \cdot 10^{+28}:\\ \;\;\;\;t \cdot \left(y \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(z \cdot \left(-t\right)\right)\\ \end{array} \]

Alternative 3: 74.0% accurate, 0.6× speedup?

\[\begin{array}{l} [y, t] = \mathsf{sort}([y, t])\\ \\ \begin{array}{l} t_1 := t \cdot \left(y \cdot x\right)\\ \mathbf{if}\;z \leq -2.1 \cdot 10^{-94}:\\ \;\;\;\;y \cdot \left(z \cdot \left(-t\right)\right)\\ \mathbf{elif}\;z \leq 7.5 \cdot 10^{-237}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 8.8 \cdot 10^{+18}:\\ \;\;\;\;x \cdot \left(y \cdot t\right)\\ \mathbf{elif}\;z \leq 3 \cdot 10^{+31}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(y \cdot \left(-t\right)\right)\\ \end{array} \end{array} \]
NOTE: y and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* t (* y x))))
   (if (<= z -2.1e-94)
     (* y (* z (- t)))
     (if (<= z 7.5e-237)
       t_1
       (if (<= z 8.8e+18)
         (* x (* y t))
         (if (<= z 3e+31) t_1 (* z (* y (- t)))))))))
assert(y < t);
double code(double x, double y, double z, double t) {
	double t_1 = t * (y * x);
	double tmp;
	if (z <= -2.1e-94) {
		tmp = y * (z * -t);
	} else if (z <= 7.5e-237) {
		tmp = t_1;
	} else if (z <= 8.8e+18) {
		tmp = x * (y * t);
	} else if (z <= 3e+31) {
		tmp = t_1;
	} else {
		tmp = z * (y * -t);
	}
	return tmp;
}
NOTE: y and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: tmp
    t_1 = t * (y * x)
    if (z <= (-2.1d-94)) then
        tmp = y * (z * -t)
    else if (z <= 7.5d-237) then
        tmp = t_1
    else if (z <= 8.8d+18) then
        tmp = x * (y * t)
    else if (z <= 3d+31) then
        tmp = t_1
    else
        tmp = z * (y * -t)
    end if
    code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
	double t_1 = t * (y * x);
	double tmp;
	if (z <= -2.1e-94) {
		tmp = y * (z * -t);
	} else if (z <= 7.5e-237) {
		tmp = t_1;
	} else if (z <= 8.8e+18) {
		tmp = x * (y * t);
	} else if (z <= 3e+31) {
		tmp = t_1;
	} else {
		tmp = z * (y * -t);
	}
	return tmp;
}
[y, t] = sort([y, t])
def code(x, y, z, t):
	t_1 = t * (y * x)
	tmp = 0
	if z <= -2.1e-94:
		tmp = y * (z * -t)
	elif z <= 7.5e-237:
		tmp = t_1
	elif z <= 8.8e+18:
		tmp = x * (y * t)
	elif z <= 3e+31:
		tmp = t_1
	else:
		tmp = z * (y * -t)
	return tmp
y, t = sort([y, t])
function code(x, y, z, t)
	t_1 = Float64(t * Float64(y * x))
	tmp = 0.0
	if (z <= -2.1e-94)
		tmp = Float64(y * Float64(z * Float64(-t)));
	elseif (z <= 7.5e-237)
		tmp = t_1;
	elseif (z <= 8.8e+18)
		tmp = Float64(x * Float64(y * t));
	elseif (z <= 3e+31)
		tmp = t_1;
	else
		tmp = Float64(z * Float64(y * Float64(-t)));
	end
	return tmp
end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
	t_1 = t * (y * x);
	tmp = 0.0;
	if (z <= -2.1e-94)
		tmp = y * (z * -t);
	elseif (z <= 7.5e-237)
		tmp = t_1;
	elseif (z <= 8.8e+18)
		tmp = x * (y * t);
	elseif (z <= 3e+31)
		tmp = t_1;
	else
		tmp = z * (y * -t);
	end
	tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(t * N[(y * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.1e-94], N[(y * N[(z * (-t)), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7.5e-237], t$95$1, If[LessEqual[z, 8.8e+18], N[(x * N[(y * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3e+31], t$95$1, N[(z * N[(y * (-t)), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
t_1 := t \cdot \left(y \cdot x\right)\\
\mathbf{if}\;z \leq -2.1 \cdot 10^{-94}:\\
\;\;\;\;y \cdot \left(z \cdot \left(-t\right)\right)\\

\mathbf{elif}\;z \leq 7.5 \cdot 10^{-237}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq 8.8 \cdot 10^{+18}:\\
\;\;\;\;x \cdot \left(y \cdot t\right)\\

\mathbf{elif}\;z \leq 3 \cdot 10^{+31}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -2.1000000000000001e-94

    1. Initial program 85.0%

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

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

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

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

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

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

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

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

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

    if -2.1000000000000001e-94 < z < 7.50000000000000034e-237 or 8.8e18 < z < 2.99999999999999989e31

    1. Initial program 95.6%

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

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

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

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

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

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

    if 7.50000000000000034e-237 < z < 8.8e18

    1. Initial program 93.2%

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

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

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

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

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

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

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

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

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

    if 2.99999999999999989e31 < z

    1. Initial program 82.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto y \cdot \frac{1}{\frac{\color{blue}{1}}{-t \cdot z}} \]
      4. remove-double-div72.9%

        \[\leadsto y \cdot \color{blue}{\left(-t \cdot z\right)} \]
      5. distribute-lft-neg-in72.9%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.1 \cdot 10^{-94}:\\ \;\;\;\;y \cdot \left(z \cdot \left(-t\right)\right)\\ \mathbf{elif}\;z \leq 7.5 \cdot 10^{-237}:\\ \;\;\;\;t \cdot \left(y \cdot x\right)\\ \mathbf{elif}\;z \leq 8.8 \cdot 10^{+18}:\\ \;\;\;\;x \cdot \left(y \cdot t\right)\\ \mathbf{elif}\;z \leq 3 \cdot 10^{+31}:\\ \;\;\;\;t \cdot \left(y \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(y \cdot \left(-t\right)\right)\\ \end{array} \]

Alternative 4: 97.5% accurate, 1.0× speedup?

\[\begin{array}{l} [y, t] = \mathsf{sort}([y, t])\\ \\ \begin{array}{l} \mathbf{if}\;t \leq 200000:\\ \;\;\;\;y \cdot \left(t \cdot \left(x - z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x - z\right) \cdot \left(y \cdot t\right)\\ \end{array} \end{array} \]
NOTE: y and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
 :precision binary64
 (if (<= t 200000.0) (* y (* t (- x z))) (* (- x z) (* y t))))
assert(y < t);
double code(double x, double y, double z, double t) {
	double tmp;
	if (t <= 200000.0) {
		tmp = y * (t * (x - z));
	} else {
		tmp = (x - z) * (y * t);
	}
	return tmp;
}
NOTE: y and t should be sorted in increasing order before calling this function.
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 <= 200000.0d0) then
        tmp = y * (t * (x - z))
    else
        tmp = (x - z) * (y * t)
    end if
    code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (t <= 200000.0) {
		tmp = y * (t * (x - z));
	} else {
		tmp = (x - z) * (y * t);
	}
	return tmp;
}
[y, t] = sort([y, t])
def code(x, y, z, t):
	tmp = 0
	if t <= 200000.0:
		tmp = y * (t * (x - z))
	else:
		tmp = (x - z) * (y * t)
	return tmp
y, t = sort([y, t])
function code(x, y, z, t)
	tmp = 0.0
	if (t <= 200000.0)
		tmp = Float64(y * Float64(t * Float64(x - z)));
	else
		tmp = Float64(Float64(x - z) * Float64(y * t));
	end
	return tmp
end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (t <= 200000.0)
		tmp = y * (t * (x - z));
	else
		tmp = (x - z) * (y * t);
	end
	tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := If[LessEqual[t, 200000.0], N[(y * N[(t * N[(x - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x - z), $MachinePrecision] * N[(y * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq 200000:\\
\;\;\;\;y \cdot \left(t \cdot \left(x - z\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < 2e5

    1. Initial program 86.6%

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

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

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

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

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

    if 2e5 < t

    1. Initial program 94.7%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 200000:\\ \;\;\;\;y \cdot \left(t \cdot \left(x - z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x - z\right) \cdot \left(y \cdot t\right)\\ \end{array} \]

Alternative 5: 97.2% accurate, 1.0× speedup?

\[\begin{array}{l} [y, t] = \mathsf{sort}([y, t])\\ \\ \begin{array}{l} \mathbf{if}\;y \leq -21500000000000:\\ \;\;\;\;y \cdot \left(t \cdot \left(x - z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(y \cdot \left(x - z\right)\right)\\ \end{array} \end{array} \]
NOTE: y and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
 :precision binary64
 (if (<= y -21500000000000.0) (* y (* t (- x z))) (* t (* y (- x z)))))
assert(y < t);
double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= -21500000000000.0) {
		tmp = y * (t * (x - z));
	} else {
		tmp = t * (y * (x - z));
	}
	return tmp;
}
NOTE: y and t should be sorted in increasing order before calling this function.
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 <= (-21500000000000.0d0)) then
        tmp = y * (t * (x - z))
    else
        tmp = t * (y * (x - z))
    end if
    code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= -21500000000000.0) {
		tmp = y * (t * (x - z));
	} else {
		tmp = t * (y * (x - z));
	}
	return tmp;
}
[y, t] = sort([y, t])
def code(x, y, z, t):
	tmp = 0
	if y <= -21500000000000.0:
		tmp = y * (t * (x - z))
	else:
		tmp = t * (y * (x - z))
	return tmp
y, t = sort([y, t])
function code(x, y, z, t)
	tmp = 0.0
	if (y <= -21500000000000.0)
		tmp = Float64(y * Float64(t * Float64(x - z)));
	else
		tmp = Float64(t * Float64(y * Float64(x - z)));
	end
	return tmp
end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (y <= -21500000000000.0)
		tmp = y * (t * (x - z));
	else
		tmp = t * (y * (x - z));
	end
	tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := If[LessEqual[y, -21500000000000.0], N[(y * N[(t * N[(x - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(y * N[(x - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -21500000000000:\\
\;\;\;\;y \cdot \left(t \cdot \left(x - z\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.15e13

    1. Initial program 69.4%

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

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

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

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

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

    if -2.15e13 < y

    1. Initial program 94.2%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -21500000000000:\\ \;\;\;\;y \cdot \left(t \cdot \left(x - z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(y \cdot \left(x - z\right)\right)\\ \end{array} \]

Alternative 6: 55.7% accurate, 1.3× speedup?

\[\begin{array}{l} [y, t] = \mathsf{sort}([y, t])\\ \\ \begin{array}{l} \mathbf{if}\;y \leq -17000000000000:\\ \;\;\;\;y \cdot \left(t \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(y \cdot x\right)\\ \end{array} \end{array} \]
NOTE: y and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
 :precision binary64
 (if (<= y -17000000000000.0) (* y (* t x)) (* t (* y x))))
assert(y < t);
double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= -17000000000000.0) {
		tmp = y * (t * x);
	} else {
		tmp = t * (y * x);
	}
	return tmp;
}
NOTE: y and t should be sorted in increasing order before calling this function.
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 <= (-17000000000000.0d0)) then
        tmp = y * (t * x)
    else
        tmp = t * (y * x)
    end if
    code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= -17000000000000.0) {
		tmp = y * (t * x);
	} else {
		tmp = t * (y * x);
	}
	return tmp;
}
[y, t] = sort([y, t])
def code(x, y, z, t):
	tmp = 0
	if y <= -17000000000000.0:
		tmp = y * (t * x)
	else:
		tmp = t * (y * x)
	return tmp
y, t = sort([y, t])
function code(x, y, z, t)
	tmp = 0.0
	if (y <= -17000000000000.0)
		tmp = Float64(y * Float64(t * x));
	else
		tmp = Float64(t * Float64(y * x));
	end
	return tmp
end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (y <= -17000000000000.0)
		tmp = y * (t * x);
	else
		tmp = t * (y * x);
	end
	tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := If[LessEqual[y, -17000000000000.0], N[(y * N[(t * x), $MachinePrecision]), $MachinePrecision], N[(t * N[(y * x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -17000000000000:\\
\;\;\;\;y \cdot \left(t \cdot x\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.7e13

    1. Initial program 69.4%

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

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

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

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

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

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

    if -1.7e13 < y

    1. Initial program 94.2%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -17000000000000:\\ \;\;\;\;y \cdot \left(t \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(y \cdot x\right)\\ \end{array} \]

Alternative 7: 92.3% accurate, 1.3× speedup?

\[\begin{array}{l} [y, t] = \mathsf{sort}([y, t])\\ \\ y \cdot \left(t \cdot \left(x - z\right)\right) \end{array} \]
NOTE: y and t should be sorted in increasing order before calling this function.
(FPCore (x y z t) :precision binary64 (* y (* t (- x z))))
assert(y < t);
double code(double x, double y, double z, double t) {
	return y * (t * (x - z));
}
NOTE: y and t should be sorted in increasing order before calling this function.
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 = y * (t * (x - z))
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
	return y * (t * (x - z));
}
[y, t] = sort([y, t])
def code(x, y, z, t):
	return y * (t * (x - z))
y, t = sort([y, t])
function code(x, y, z, t)
	return Float64(y * Float64(t * Float64(x - z)))
end
y, t = num2cell(sort([y, t])){:}
function tmp = code(x, y, z, t)
	tmp = y * (t * (x - z));
end
NOTE: y and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := N[(y * N[(t * N[(x - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
y \cdot \left(t \cdot \left(x - z\right)\right)
\end{array}
Derivation
  1. Initial program 88.8%

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

      \[\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. Final simplification90.9%

    \[\leadsto y \cdot \left(t \cdot \left(x - z\right)\right) \]

Alternative 8: 53.3% accurate, 1.8× speedup?

\[\begin{array}{l} [y, t] = \mathsf{sort}([y, t])\\ \\ y \cdot \left(t \cdot x\right) \end{array} \]
NOTE: y and t should be sorted in increasing order before calling this function.
(FPCore (x y z t) :precision binary64 (* y (* t x)))
assert(y < t);
double code(double x, double y, double z, double t) {
	return y * (t * x);
}
NOTE: y and t should be sorted in increasing order before calling this function.
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 = y * (t * x)
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
	return y * (t * x);
}
[y, t] = sort([y, t])
def code(x, y, z, t):
	return y * (t * x)
y, t = sort([y, t])
function code(x, y, z, t)
	return Float64(y * Float64(t * x))
end
y, t = num2cell(sort([y, t])){:}
function tmp = code(x, y, z, t)
	tmp = y * (t * x);
end
NOTE: y and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := N[(y * N[(t * x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
y \cdot \left(t \cdot x\right)
\end{array}
Derivation
  1. Initial program 88.8%

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

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

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

    \[\leadsto y \cdot \left(t \cdot x\right) \]

Developer target: 96.2% 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 2023297 
(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))