Linear.Projection:inverseInfinitePerspective from linear-1.19.1.3

Percentage Accurate: 90.1% → 96.5%
Time: 8.7s
Alternatives: 7
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 7 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.1% 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: 96.5% accurate, 0.8× speedup?

\[\begin{array}{l} [y, t] = \mathsf{sort}([y, t])\\ \\ \begin{array}{l} \mathbf{if}\;t \leq 1.35 \cdot 10^{+73}:\\ \;\;\;\;y \cdot \left(t \cdot \left(x - z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{t \cdot y}{\frac{1}{x - z}}\\ \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 1.35e+73) (* y (* t (- x z))) (/ (* t y) (/ 1.0 (- x z)))))
assert(y < t);
double code(double x, double y, double z, double t) {
	double tmp;
	if (t <= 1.35e+73) {
		tmp = y * (t * (x - z));
	} else {
		tmp = (t * y) / (1.0 / (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 (t <= 1.35d+73) then
        tmp = y * (t * (x - z))
    else
        tmp = (t * y) / (1.0d0 / (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 (t <= 1.35e+73) {
		tmp = y * (t * (x - z));
	} else {
		tmp = (t * y) / (1.0 / (x - z));
	}
	return tmp;
}
[y, t] = sort([y, t])
def code(x, y, z, t):
	tmp = 0
	if t <= 1.35e+73:
		tmp = y * (t * (x - z))
	else:
		tmp = (t * y) / (1.0 / (x - z))
	return tmp
y, t = sort([y, t])
function code(x, y, z, t)
	tmp = 0.0
	if (t <= 1.35e+73)
		tmp = Float64(y * Float64(t * Float64(x - z)));
	else
		tmp = Float64(Float64(t * y) / Float64(1.0 / 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 (t <= 1.35e+73)
		tmp = y * (t * (x - z));
	else
		tmp = (t * y) / (1.0 / (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[t, 1.35e+73], N[(y * N[(t * N[(x - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t * y), $MachinePrecision] / N[(1.0 / N[(x - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq 1.35 \cdot 10^{+73}:\\
\;\;\;\;y \cdot \left(t \cdot \left(x - z\right)\right)\\

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


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

    1. Initial program 87.5%

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

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

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

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

    if 1.35e73 < t

    1. Initial program 93.6%

      \[\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. Step-by-step derivation
      1. add-cbrt-cube72.9%

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

        \[\leadsto \sqrt[3]{\color{blue}{{\left(y \cdot \left(x - z\right)\right)}^{3}}} \cdot t \]
    5. Applied egg-rr72.9%

      \[\leadsto \color{blue}{\sqrt[3]{{\left(y \cdot \left(x - z\right)\right)}^{3}}} \cdot t \]
    6. Step-by-step derivation
      1. rem-cbrt-cube93.6%

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

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

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

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

        \[\leadsto \color{blue}{\frac{y}{\frac{x + z}{x \cdot x - z \cdot z}}} \cdot t \]
      2. difference-of-squares65.6%

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

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

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

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

        \[\leadsto \color{blue}{\frac{y \cdot t}{\frac{1}{x - z}}} \]
    11. Applied egg-rr97.7%

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

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

Alternative 2: 72.5% accurate, 0.6× speedup?

\[\begin{array}{l} [y, t] = \mathsf{sort}([y, t])\\ \\ \begin{array}{l} t_1 := -z \cdot \left(t \cdot y\right)\\ \mathbf{if}\;z \leq -1.1 \cdot 10^{+90}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -1 \cdot 10^{+68}:\\ \;\;\;\;y \cdot \left(t \cdot x\right)\\ \mathbf{elif}\;z \leq -3.45 \cdot 10^{-81} \lor \neg \left(z \leq 0.012\right):\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(t \cdot y\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 (- (* z (* t y)))))
   (if (<= z -1.1e+90)
     t_1
     (if (<= z -1e+68)
       (* y (* t x))
       (if (or (<= z -3.45e-81) (not (<= z 0.012))) t_1 (* x (* t y)))))))
assert(y < t);
double code(double x, double y, double z, double t) {
	double t_1 = -(z * (t * y));
	double tmp;
	if (z <= -1.1e+90) {
		tmp = t_1;
	} else if (z <= -1e+68) {
		tmp = y * (t * x);
	} else if ((z <= -3.45e-81) || !(z <= 0.012)) {
		tmp = t_1;
	} else {
		tmp = x * (t * y);
	}
	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 = -(z * (t * y))
    if (z <= (-1.1d+90)) then
        tmp = t_1
    else if (z <= (-1d+68)) then
        tmp = y * (t * x)
    else if ((z <= (-3.45d-81)) .or. (.not. (z <= 0.012d0))) then
        tmp = t_1
    else
        tmp = x * (t * y)
    end if
    code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
	double t_1 = -(z * (t * y));
	double tmp;
	if (z <= -1.1e+90) {
		tmp = t_1;
	} else if (z <= -1e+68) {
		tmp = y * (t * x);
	} else if ((z <= -3.45e-81) || !(z <= 0.012)) {
		tmp = t_1;
	} else {
		tmp = x * (t * y);
	}
	return tmp;
}
[y, t] = sort([y, t])
def code(x, y, z, t):
	t_1 = -(z * (t * y))
	tmp = 0
	if z <= -1.1e+90:
		tmp = t_1
	elif z <= -1e+68:
		tmp = y * (t * x)
	elif (z <= -3.45e-81) or not (z <= 0.012):
		tmp = t_1
	else:
		tmp = x * (t * y)
	return tmp
y, t = sort([y, t])
function code(x, y, z, t)
	t_1 = Float64(-Float64(z * Float64(t * y)))
	tmp = 0.0
	if (z <= -1.1e+90)
		tmp = t_1;
	elseif (z <= -1e+68)
		tmp = Float64(y * Float64(t * x));
	elseif ((z <= -3.45e-81) || !(z <= 0.012))
		tmp = t_1;
	else
		tmp = Float64(x * Float64(t * y));
	end
	return tmp
end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
	t_1 = -(z * (t * y));
	tmp = 0.0;
	if (z <= -1.1e+90)
		tmp = t_1;
	elseif (z <= -1e+68)
		tmp = y * (t * x);
	elseif ((z <= -3.45e-81) || ~((z <= 0.012)))
		tmp = t_1;
	else
		tmp = x * (t * y);
	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[(z * N[(t * y), $MachinePrecision]), $MachinePrecision])}, If[LessEqual[z, -1.1e+90], t$95$1, If[LessEqual[z, -1e+68], N[(y * N[(t * x), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, -3.45e-81], N[Not[LessEqual[z, 0.012]], $MachinePrecision]], t$95$1, N[(x * N[(t * y), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
t_1 := -z \cdot \left(t \cdot y\right)\\
\mathbf{if}\;z \leq -1.1 \cdot 10^{+90}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;z \leq -3.45 \cdot 10^{-81} \lor \neg \left(z \leq 0.012\right):\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.09999999999999995e90 or -9.99999999999999953e67 < z < -3.4500000000000001e-81 or 0.012 < z

    1. Initial program 86.6%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(y \cdot \left(-z\right)\right)} \cdot t \]
    7. Step-by-step derivation
      1. distribute-rgt-neg-out76.0%

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

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

        \[\leadsto -\color{blue}{\left(z \cdot y\right)} \cdot t \]
      4. add-sqr-sqrt27.5%

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

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

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

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

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

        \[\leadsto -\color{blue}{\left(-z\right) \cdot \left(y \cdot t\right)} \]
      10. add-sqr-sqrt3.4%

        \[\leadsto -\color{blue}{\left(\sqrt{-z} \cdot \sqrt{-z}\right)} \cdot \left(y \cdot t\right) \]
      11. sqrt-unprod21.9%

        \[\leadsto -\color{blue}{\sqrt{\left(-z\right) \cdot \left(-z\right)}} \cdot \left(y \cdot t\right) \]
      12. sqr-neg21.9%

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

        \[\leadsto -\color{blue}{\left(\sqrt{z} \cdot \sqrt{z}\right)} \cdot \left(y \cdot t\right) \]
      14. add-sqr-sqrt80.0%

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

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

    if -1.09999999999999995e90 < z < -9.99999999999999953e67

    1. Initial program 78.3%

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

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

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

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

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

    if -3.4500000000000001e-81 < z < 0.012

    1. Initial program 91.4%

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

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

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

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

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

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

        \[\leadsto \log \left(e^{\color{blue}{\left(y \cdot t\right) \cdot x}}\right) \]
      3. exp-prod28.6%

        \[\leadsto \log \color{blue}{\left({\left(e^{y \cdot t}\right)}^{x}\right)} \]
    6. Applied egg-rr28.6%

      \[\leadsto \color{blue}{\log \left({\left(e^{y \cdot t}\right)}^{x}\right)} \]
    7. Step-by-step derivation
      1. log-pow30.5%

        \[\leadsto \color{blue}{x \cdot \log \left(e^{y \cdot t}\right)} \]
      2. rem-log-exp79.6%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.1 \cdot 10^{+90}:\\ \;\;\;\;-z \cdot \left(t \cdot y\right)\\ \mathbf{elif}\;z \leq -1 \cdot 10^{+68}:\\ \;\;\;\;y \cdot \left(t \cdot x\right)\\ \mathbf{elif}\;z \leq -3.45 \cdot 10^{-81} \lor \neg \left(z \leq 0.012\right):\\ \;\;\;\;-z \cdot \left(t \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(t \cdot y\right)\\ \end{array} \]

Alternative 3: 72.5% accurate, 0.6× speedup?

\[\begin{array}{l} [y, t] = \mathsf{sort}([y, t])\\ \\ \begin{array}{l} t_1 := -z \cdot \left(t \cdot y\right)\\ \mathbf{if}\;z \leq -1.1 \cdot 10^{+90}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -7.6 \cdot 10^{+67}:\\ \;\;\;\;y \cdot \left(t \cdot x\right)\\ \mathbf{elif}\;z \leq -3.3 \cdot 10^{-81}:\\ \;\;\;\;t \cdot \left(y \cdot \left(-z\right)\right)\\ \mathbf{elif}\;z \leq 0.0032:\\ \;\;\;\;x \cdot \left(t \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \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 (- (* z (* t y)))))
   (if (<= z -1.1e+90)
     t_1
     (if (<= z -7.6e+67)
       (* y (* t x))
       (if (<= z -3.3e-81)
         (* t (* y (- z)))
         (if (<= z 0.0032) (* x (* t y)) t_1))))))
assert(y < t);
double code(double x, double y, double z, double t) {
	double t_1 = -(z * (t * y));
	double tmp;
	if (z <= -1.1e+90) {
		tmp = t_1;
	} else if (z <= -7.6e+67) {
		tmp = y * (t * x);
	} else if (z <= -3.3e-81) {
		tmp = t * (y * -z);
	} else if (z <= 0.0032) {
		tmp = x * (t * y);
	} else {
		tmp = t_1;
	}
	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 = -(z * (t * y))
    if (z <= (-1.1d+90)) then
        tmp = t_1
    else if (z <= (-7.6d+67)) then
        tmp = y * (t * x)
    else if (z <= (-3.3d-81)) then
        tmp = t * (y * -z)
    else if (z <= 0.0032d0) then
        tmp = x * (t * y)
    else
        tmp = t_1
    end if
    code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
	double t_1 = -(z * (t * y));
	double tmp;
	if (z <= -1.1e+90) {
		tmp = t_1;
	} else if (z <= -7.6e+67) {
		tmp = y * (t * x);
	} else if (z <= -3.3e-81) {
		tmp = t * (y * -z);
	} else if (z <= 0.0032) {
		tmp = x * (t * y);
	} else {
		tmp = t_1;
	}
	return tmp;
}
[y, t] = sort([y, t])
def code(x, y, z, t):
	t_1 = -(z * (t * y))
	tmp = 0
	if z <= -1.1e+90:
		tmp = t_1
	elif z <= -7.6e+67:
		tmp = y * (t * x)
	elif z <= -3.3e-81:
		tmp = t * (y * -z)
	elif z <= 0.0032:
		tmp = x * (t * y)
	else:
		tmp = t_1
	return tmp
y, t = sort([y, t])
function code(x, y, z, t)
	t_1 = Float64(-Float64(z * Float64(t * y)))
	tmp = 0.0
	if (z <= -1.1e+90)
		tmp = t_1;
	elseif (z <= -7.6e+67)
		tmp = Float64(y * Float64(t * x));
	elseif (z <= -3.3e-81)
		tmp = Float64(t * Float64(y * Float64(-z)));
	elseif (z <= 0.0032)
		tmp = Float64(x * Float64(t * y));
	else
		tmp = t_1;
	end
	return tmp
end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
	t_1 = -(z * (t * y));
	tmp = 0.0;
	if (z <= -1.1e+90)
		tmp = t_1;
	elseif (z <= -7.6e+67)
		tmp = y * (t * x);
	elseif (z <= -3.3e-81)
		tmp = t * (y * -z);
	elseif (z <= 0.0032)
		tmp = x * (t * y);
	else
		tmp = t_1;
	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[(z * N[(t * y), $MachinePrecision]), $MachinePrecision])}, If[LessEqual[z, -1.1e+90], t$95$1, If[LessEqual[z, -7.6e+67], N[(y * N[(t * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -3.3e-81], N[(t * N[(y * (-z)), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.0032], N[(x * N[(t * y), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
t_1 := -z \cdot \left(t \cdot y\right)\\
\mathbf{if}\;z \leq -1.1 \cdot 10^{+90}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;z \leq -3.3 \cdot 10^{-81}:\\
\;\;\;\;t \cdot \left(y \cdot \left(-z\right)\right)\\

\mathbf{elif}\;z \leq 0.0032:\\
\;\;\;\;x \cdot \left(t \cdot y\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -1.09999999999999995e90 or 0.00320000000000000015 < z

    1. Initial program 83.0%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(y \cdot \left(-z\right)\right)} \cdot t \]
    7. Step-by-step derivation
      1. distribute-rgt-neg-out76.1%

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

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

        \[\leadsto -\color{blue}{\left(z \cdot y\right)} \cdot t \]
      4. add-sqr-sqrt35.5%

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

        \[\leadsto -\left(\color{blue}{\sqrt{z \cdot z}} \cdot y\right) \cdot t \]
      6. sqr-neg23.1%

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

        \[\leadsto -\left(\color{blue}{\left(\sqrt{-z} \cdot \sqrt{-z}\right)} \cdot y\right) \cdot t \]
      8. add-sqr-sqrt1.5%

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

        \[\leadsto -\color{blue}{\left(-z\right) \cdot \left(y \cdot t\right)} \]
      10. add-sqr-sqrt0.6%

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

        \[\leadsto -\color{blue}{\sqrt{\left(-z\right) \cdot \left(-z\right)}} \cdot \left(y \cdot t\right) \]
      12. sqr-neg24.4%

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

        \[\leadsto -\color{blue}{\left(\sqrt{z} \cdot \sqrt{z}\right)} \cdot \left(y \cdot t\right) \]
      14. add-sqr-sqrt81.3%

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

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

    if -1.09999999999999995e90 < z < -7.60000000000000041e67

    1. Initial program 78.3%

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

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

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

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

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

    if -7.60000000000000041e67 < z < -3.29999999999999987e-81

    1. Initial program 99.3%

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

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

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

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

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

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

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

    if -3.29999999999999987e-81 < z < 0.00320000000000000015

    1. Initial program 91.4%

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

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

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

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

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

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

        \[\leadsto \log \left(e^{\color{blue}{\left(y \cdot t\right) \cdot x}}\right) \]
      3. exp-prod28.6%

        \[\leadsto \log \color{blue}{\left({\left(e^{y \cdot t}\right)}^{x}\right)} \]
    6. Applied egg-rr28.6%

      \[\leadsto \color{blue}{\log \left({\left(e^{y \cdot t}\right)}^{x}\right)} \]
    7. Step-by-step derivation
      1. log-pow30.5%

        \[\leadsto \color{blue}{x \cdot \log \left(e^{y \cdot t}\right)} \]
      2. rem-log-exp79.6%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.1 \cdot 10^{+90}:\\ \;\;\;\;-z \cdot \left(t \cdot y\right)\\ \mathbf{elif}\;z \leq -7.6 \cdot 10^{+67}:\\ \;\;\;\;y \cdot \left(t \cdot x\right)\\ \mathbf{elif}\;z \leq -3.3 \cdot 10^{-81}:\\ \;\;\;\;t \cdot \left(y \cdot \left(-z\right)\right)\\ \mathbf{elif}\;z \leq 0.0032:\\ \;\;\;\;x \cdot \left(t \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;-z \cdot \left(t \cdot y\right)\\ \end{array} \]

Alternative 4: 96.7% accurate, 1.0× speedup?

\[\begin{array}{l} [y, t] = \mathsf{sort}([y, t])\\ \\ \begin{array}{l} \mathbf{if}\;t \leq 10^{+48}:\\ \;\;\;\;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 (<= t 1e+48) (* y (* t (- x z))) (* t (* y (- x z)))))
assert(y < t);
double code(double x, double y, double z, double t) {
	double tmp;
	if (t <= 1e+48) {
		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 (t <= 1d+48) 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 (t <= 1e+48) {
		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 t <= 1e+48:
		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 (t <= 1e+48)
		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 (t <= 1e+48)
		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[t, 1e+48], 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}\;t \leq 10^{+48}:\\
\;\;\;\;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 t < 1.00000000000000004e48

    1. Initial program 87.4%

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

        \[\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. Simplified92.8%

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

    if 1.00000000000000004e48 < t

    1. Initial program 93.9%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 10^{+48}:\\ \;\;\;\;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 5: 56.3% accurate, 1.3× speedup?

\[\begin{array}{l} [y, t] = \mathsf{sort}([y, t])\\ \\ \begin{array}{l} \mathbf{if}\;y \leq -1.2 \cdot 10^{-74}:\\ \;\;\;\;x \cdot \left(t \cdot y\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 -1.2e-74) (* x (* t y)) (* t (* y x))))
assert(y < t);
double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= -1.2e-74) {
		tmp = x * (t * y);
	} 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 <= (-1.2d-74)) then
        tmp = x * (t * y)
    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 <= -1.2e-74) {
		tmp = x * (t * y);
	} else {
		tmp = t * (y * x);
	}
	return tmp;
}
[y, t] = sort([y, t])
def code(x, y, z, t):
	tmp = 0
	if y <= -1.2e-74:
		tmp = x * (t * y)
	else:
		tmp = t * (y * x)
	return tmp
y, t = sort([y, t])
function code(x, y, z, t)
	tmp = 0.0
	if (y <= -1.2e-74)
		tmp = Float64(x * Float64(t * y));
	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 <= -1.2e-74)
		tmp = x * (t * y);
	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, -1.2e-74], N[(x * N[(t * y), $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 -1.2 \cdot 10^{-74}:\\
\;\;\;\;x \cdot \left(t \cdot y\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.1999999999999999e-74

    1. Initial program 82.2%

      \[\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 \]
      2. associate-*l*94.7%

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

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

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

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

        \[\leadsto \log \left(e^{\color{blue}{\left(y \cdot t\right) \cdot x}}\right) \]
      3. exp-prod30.6%

        \[\leadsto \log \color{blue}{\left({\left(e^{y \cdot t}\right)}^{x}\right)} \]
    6. Applied egg-rr30.6%

      \[\leadsto \color{blue}{\log \left({\left(e^{y \cdot t}\right)}^{x}\right)} \]
    7. Step-by-step derivation
      1. log-pow33.4%

        \[\leadsto \color{blue}{x \cdot \log \left(e^{y \cdot t}\right)} \]
      2. rem-log-exp52.5%

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

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

    if -1.1999999999999999e-74 < y

    1. Initial program 92.3%

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

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

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

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

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

Alternative 6: 91.8% 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.6%

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

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

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

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

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

Alternative 7: 54.7% accurate, 1.8× speedup?

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

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

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

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

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

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

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

      \[\leadsto \log \left(e^{\color{blue}{\left(y \cdot t\right) \cdot x}}\right) \]
    3. exp-prod25.9%

      \[\leadsto \log \color{blue}{\left({\left(e^{y \cdot t}\right)}^{x}\right)} \]
  6. Applied egg-rr25.9%

    \[\leadsto \color{blue}{\log \left({\left(e^{y \cdot t}\right)}^{x}\right)} \]
  7. Step-by-step derivation
    1. log-pow27.5%

      \[\leadsto \color{blue}{x \cdot \log \left(e^{y \cdot t}\right)} \]
    2. rem-log-exp54.3%

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

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

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

Developer target: 95.9% 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 2023173 
(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))