Linear.Projection:inverseInfinitePerspective from linear-1.19.1.3

Percentage Accurate: 90.1% → 98.5%
Time: 7.3s
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.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: 98.5% accurate, 0.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(x \cdot y - y \cdot z\right) \cdot t\\ \mathbf{if}\;t_1 \leq -\infty \lor \neg \left(t_1 \leq 5 \cdot 10^{+303}\right):\\ \;\;\;\;y \cdot \left(t \cdot \left(x - z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y \cdot \left(x - z\right), t, t \cdot \mathsf{fma}\left(y, -z, y \cdot z\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* (- (* x y) (* y z)) t)))
   (if (or (<= t_1 (- INFINITY)) (not (<= t_1 5e+303)))
     (* y (* t (- x z)))
     (fma (* y (- x z)) t (* t (fma y (- z) (* y z)))))))
double code(double x, double y, double z, double t) {
	double t_1 = ((x * y) - (y * z)) * t;
	double tmp;
	if ((t_1 <= -((double) INFINITY)) || !(t_1 <= 5e+303)) {
		tmp = y * (t * (x - z));
	} else {
		tmp = fma((y * (x - z)), t, (t * fma(y, -z, (y * z))));
	}
	return tmp;
}
function code(x, y, z, t)
	t_1 = Float64(Float64(Float64(x * y) - Float64(y * z)) * t)
	tmp = 0.0
	if ((t_1 <= Float64(-Inf)) || !(t_1 <= 5e+303))
		tmp = Float64(y * Float64(t * Float64(x - z)));
	else
		tmp = fma(Float64(y * Float64(x - z)), t, Float64(t * fma(y, Float64(-z), Float64(y * z))));
	end
	return tmp
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(N[(x * y), $MachinePrecision] - N[(y * z), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]}, If[Or[LessEqual[t$95$1, (-Infinity)], N[Not[LessEqual[t$95$1, 5e+303]], $MachinePrecision]], N[(y * N[(t * N[(x - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * N[(x - z), $MachinePrecision]), $MachinePrecision] * t + N[(t * N[(y * (-z) + N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(x \cdot y - y \cdot z\right) \cdot t\\
\mathbf{if}\;t_1 \leq -\infty \lor \neg \left(t_1 \leq 5 \cdot 10^{+303}\right):\\
\;\;\;\;y \cdot \left(t \cdot \left(x - z\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (-.f64 (*.f64 x y) (*.f64 z y)) t) < -inf.0 or 4.9999999999999997e303 < (*.f64 (-.f64 (*.f64 x y) (*.f64 z y)) t)

    1. Initial program 73.0%

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

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

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

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

    if -inf.0 < (*.f64 (-.f64 (*.f64 x y) (*.f64 z y)) t) < 4.9999999999999997e303

    1. Initial program 98.0%

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

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

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

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

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

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

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

        \[\leadsto t \cdot \color{blue}{\left(\mathsf{fma}\left(x, y, -y \cdot z\right) + \mathsf{fma}\left(-y, z, y \cdot z\right)\right)} \]
      5. *-commutative98.0%

        \[\leadsto t \cdot \left(\mathsf{fma}\left(x, y, -\color{blue}{z \cdot y}\right) + \mathsf{fma}\left(-y, z, y \cdot z\right)\right) \]
      6. fma-neg98.0%

        \[\leadsto t \cdot \left(\color{blue}{\left(x \cdot y - z \cdot y\right)} + \mathsf{fma}\left(-y, z, y \cdot z\right)\right) \]
      7. distribute-rgt-in98.1%

        \[\leadsto \color{blue}{\left(x \cdot y - z \cdot y\right) \cdot t + \mathsf{fma}\left(-y, z, y \cdot z\right) \cdot t} \]
      8. fma-def98.2%

        \[\leadsto \color{blue}{\mathsf{fma}\left(x \cdot y - z \cdot y, t, \mathsf{fma}\left(-y, z, y \cdot z\right) \cdot t\right)} \]
      9. distribute-rgt-out--98.2%

        \[\leadsto \mathsf{fma}\left(\color{blue}{y \cdot \left(x - z\right)}, t, \mathsf{fma}\left(-y, z, y \cdot z\right) \cdot t\right) \]
      10. *-commutative98.2%

        \[\leadsto \mathsf{fma}\left(y \cdot \left(x - z\right), t, \mathsf{fma}\left(-y, z, \color{blue}{z \cdot y}\right) \cdot t\right) \]
      11. fma-udef98.0%

        \[\leadsto \mathsf{fma}\left(y \cdot \left(x - z\right), t, \color{blue}{\left(\left(-y\right) \cdot z + z \cdot y\right)} \cdot t\right) \]
      12. distribute-lft-neg-in98.0%

        \[\leadsto \mathsf{fma}\left(y \cdot \left(x - z\right), t, \left(\color{blue}{\left(-y \cdot z\right)} + z \cdot y\right) \cdot t\right) \]
      13. distribute-rgt-neg-in98.0%

        \[\leadsto \mathsf{fma}\left(y \cdot \left(x - z\right), t, \left(\color{blue}{y \cdot \left(-z\right)} + z \cdot y\right) \cdot t\right) \]
      14. fma-def98.2%

        \[\leadsto \mathsf{fma}\left(y \cdot \left(x - z\right), t, \color{blue}{\mathsf{fma}\left(y, -z, z \cdot y\right)} \cdot t\right) \]
      15. *-commutative98.2%

        \[\leadsto \mathsf{fma}\left(y \cdot \left(x - z\right), t, \mathsf{fma}\left(y, -z, \color{blue}{y \cdot z}\right) \cdot t\right) \]
    5. Applied egg-rr98.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(x \cdot y - y \cdot z\right) \cdot t \leq -\infty \lor \neg \left(\left(x \cdot y - y \cdot z\right) \cdot t \leq 5 \cdot 10^{+303}\right):\\ \;\;\;\;y \cdot \left(t \cdot \left(x - z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y \cdot \left(x - z\right), t, t \cdot \mathsf{fma}\left(y, -z, y \cdot z\right)\right)\\ \end{array} \]

Alternative 2: 98.2% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;t_1 \leq 10^{+174}:\\
\;\;\;\;t_1 \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (-.f64 (*.f64 x y) (*.f64 z y)) < -9.9999999999999996e297

    1. Initial program 61.5%

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

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

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

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

    if -9.9999999999999996e297 < (-.f64 (*.f64 x y) (*.f64 z y)) < 1.00000000000000007e174

    1. Initial program 98.1%

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

    if 1.00000000000000007e174 < (-.f64 (*.f64 x y) (*.f64 z y))

    1. Initial program 76.4%

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

        \[\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. Step-by-step derivation
      1. *-commutative99.8%

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

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

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

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

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

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

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

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

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

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

Alternative 3: 72.9% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.45 \cdot 10^{-37}:\\
\;\;\;\;x \cdot \left(y \cdot t\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -2.45000000000000009e-37

    1. Initial program 88.1%

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

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

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

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

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

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

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

        \[\leadsto t \cdot \color{blue}{\left(\mathsf{fma}\left(x, y, -y \cdot z\right) + \mathsf{fma}\left(-y, z, y \cdot z\right)\right)} \]
      5. *-commutative88.0%

        \[\leadsto t \cdot \left(\mathsf{fma}\left(x, y, -\color{blue}{z \cdot y}\right) + \mathsf{fma}\left(-y, z, y \cdot z\right)\right) \]
      6. fma-neg88.0%

        \[\leadsto t \cdot \left(\color{blue}{\left(x \cdot y - z \cdot y\right)} + \mathsf{fma}\left(-y, z, y \cdot z\right)\right) \]
      7. distribute-rgt-in85.3%

        \[\leadsto \color{blue}{\left(x \cdot y - z \cdot y\right) \cdot t + \mathsf{fma}\left(-y, z, y \cdot z\right) \cdot t} \]
      8. fma-def85.4%

        \[\leadsto \color{blue}{\mathsf{fma}\left(x \cdot y - z \cdot y, t, \mathsf{fma}\left(-y, z, y \cdot z\right) \cdot t\right)} \]
      9. distribute-rgt-out--86.7%

        \[\leadsto \mathsf{fma}\left(\color{blue}{y \cdot \left(x - z\right)}, t, \mathsf{fma}\left(-y, z, y \cdot z\right) \cdot t\right) \]
      10. *-commutative86.7%

        \[\leadsto \mathsf{fma}\left(y \cdot \left(x - z\right), t, \mathsf{fma}\left(-y, z, \color{blue}{z \cdot y}\right) \cdot t\right) \]
      11. fma-udef88.0%

        \[\leadsto \mathsf{fma}\left(y \cdot \left(x - z\right), t, \color{blue}{\left(\left(-y\right) \cdot z + z \cdot y\right)} \cdot t\right) \]
      12. distribute-lft-neg-in88.0%

        \[\leadsto \mathsf{fma}\left(y \cdot \left(x - z\right), t, \left(\color{blue}{\left(-y \cdot z\right)} + z \cdot y\right) \cdot t\right) \]
      13. distribute-rgt-neg-in88.0%

        \[\leadsto \mathsf{fma}\left(y \cdot \left(x - z\right), t, \left(\color{blue}{y \cdot \left(-z\right)} + z \cdot y\right) \cdot t\right) \]
      14. fma-def86.7%

        \[\leadsto \mathsf{fma}\left(y \cdot \left(x - z\right), t, \color{blue}{\mathsf{fma}\left(y, -z, z \cdot y\right)} \cdot t\right) \]
      15. *-commutative86.7%

        \[\leadsto \mathsf{fma}\left(y \cdot \left(x - z\right), t, \mathsf{fma}\left(y, -z, \color{blue}{y \cdot z}\right) \cdot t\right) \]
    5. Applied egg-rr86.7%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y \cdot \left(x - z\right), t, \mathsf{fma}\left(y, -z, y \cdot z\right) \cdot t\right)} \]
    6. Taylor expanded in z around 0 81.3%

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

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

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

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

    if -2.45000000000000009e-37 < x < 1.0000000000000001e-18

    1. Initial program 95.4%

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

        \[\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. Simplified90.6%

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

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

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

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

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

    if 1.0000000000000001e-18 < x

    1. Initial program 86.3%

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

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

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

      \[\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)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification75.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.45 \cdot 10^{-37}:\\ \;\;\;\;x \cdot \left(y \cdot t\right)\\ \mathbf{elif}\;x \leq 10^{-18}:\\ \;\;\;\;-y \cdot \left(z \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(x \cdot t\right)\\ \end{array} \]

Alternative 4: 73.1% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -3.1 \cdot 10^{-36}:\\ \;\;\;\;x \cdot \left(y \cdot t\right)\\ \mathbf{elif}\;x \leq 8.2 \cdot 10^{-15}:\\ \;\;\;\;t \cdot \left(y \cdot \left(-z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(x \cdot t\right)\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= x -3.1e-36)
   (* x (* y t))
   (if (<= x 8.2e-15) (* t (* y (- z))) (* y (* x t)))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (x <= -3.1e-36) {
		tmp = x * (y * t);
	} else if (x <= 8.2e-15) {
		tmp = t * (y * -z);
	} else {
		tmp = y * (x * 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 (x <= (-3.1d-36)) then
        tmp = x * (y * t)
    else if (x <= 8.2d-15) then
        tmp = t * (y * -z)
    else
        tmp = y * (x * t)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (x <= -3.1e-36) {
		tmp = x * (y * t);
	} else if (x <= 8.2e-15) {
		tmp = t * (y * -z);
	} else {
		tmp = y * (x * t);
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if x <= -3.1e-36:
		tmp = x * (y * t)
	elif x <= 8.2e-15:
		tmp = t * (y * -z)
	else:
		tmp = y * (x * t)
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (x <= -3.1e-36)
		tmp = Float64(x * Float64(y * t));
	elseif (x <= 8.2e-15)
		tmp = Float64(t * Float64(y * Float64(-z)));
	else
		tmp = Float64(y * Float64(x * t));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (x <= -3.1e-36)
		tmp = x * (y * t);
	elseif (x <= 8.2e-15)
		tmp = t * (y * -z);
	else
		tmp = y * (x * t);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[x, -3.1e-36], N[(x * N[(y * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 8.2e-15], N[(t * N[(y * (-z)), $MachinePrecision]), $MachinePrecision], N[(y * N[(x * t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.1 \cdot 10^{-36}:\\
\;\;\;\;x \cdot \left(y \cdot t\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -3.0999999999999999e-36

    1. Initial program 88.1%

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

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

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

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

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

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

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

        \[\leadsto t \cdot \color{blue}{\left(\mathsf{fma}\left(x, y, -y \cdot z\right) + \mathsf{fma}\left(-y, z, y \cdot z\right)\right)} \]
      5. *-commutative88.0%

        \[\leadsto t \cdot \left(\mathsf{fma}\left(x, y, -\color{blue}{z \cdot y}\right) + \mathsf{fma}\left(-y, z, y \cdot z\right)\right) \]
      6. fma-neg88.0%

        \[\leadsto t \cdot \left(\color{blue}{\left(x \cdot y - z \cdot y\right)} + \mathsf{fma}\left(-y, z, y \cdot z\right)\right) \]
      7. distribute-rgt-in85.3%

        \[\leadsto \color{blue}{\left(x \cdot y - z \cdot y\right) \cdot t + \mathsf{fma}\left(-y, z, y \cdot z\right) \cdot t} \]
      8. fma-def85.4%

        \[\leadsto \color{blue}{\mathsf{fma}\left(x \cdot y - z \cdot y, t, \mathsf{fma}\left(-y, z, y \cdot z\right) \cdot t\right)} \]
      9. distribute-rgt-out--86.7%

        \[\leadsto \mathsf{fma}\left(\color{blue}{y \cdot \left(x - z\right)}, t, \mathsf{fma}\left(-y, z, y \cdot z\right) \cdot t\right) \]
      10. *-commutative86.7%

        \[\leadsto \mathsf{fma}\left(y \cdot \left(x - z\right), t, \mathsf{fma}\left(-y, z, \color{blue}{z \cdot y}\right) \cdot t\right) \]
      11. fma-udef88.0%

        \[\leadsto \mathsf{fma}\left(y \cdot \left(x - z\right), t, \color{blue}{\left(\left(-y\right) \cdot z + z \cdot y\right)} \cdot t\right) \]
      12. distribute-lft-neg-in88.0%

        \[\leadsto \mathsf{fma}\left(y \cdot \left(x - z\right), t, \left(\color{blue}{\left(-y \cdot z\right)} + z \cdot y\right) \cdot t\right) \]
      13. distribute-rgt-neg-in88.0%

        \[\leadsto \mathsf{fma}\left(y \cdot \left(x - z\right), t, \left(\color{blue}{y \cdot \left(-z\right)} + z \cdot y\right) \cdot t\right) \]
      14. fma-def86.7%

        \[\leadsto \mathsf{fma}\left(y \cdot \left(x - z\right), t, \color{blue}{\mathsf{fma}\left(y, -z, z \cdot y\right)} \cdot t\right) \]
      15. *-commutative86.7%

        \[\leadsto \mathsf{fma}\left(y \cdot \left(x - z\right), t, \mathsf{fma}\left(y, -z, \color{blue}{y \cdot z}\right) \cdot t\right) \]
    5. Applied egg-rr86.7%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y \cdot \left(x - z\right), t, \mathsf{fma}\left(y, -z, y \cdot z\right) \cdot t\right)} \]
    6. Taylor expanded in z around 0 81.3%

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

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

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

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

    if -3.0999999999999999e-36 < x < 8.20000000000000072e-15

    1. Initial program 95.4%

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

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

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

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

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

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

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

    if 8.20000000000000072e-15 < x

    1. Initial program 86.3%

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

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

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

      \[\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)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification76.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -3.1 \cdot 10^{-36}:\\ \;\;\;\;x \cdot \left(y \cdot t\right)\\ \mathbf{elif}\;x \leq 8.2 \cdot 10^{-15}:\\ \;\;\;\;t \cdot \left(y \cdot \left(-z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(x \cdot t\right)\\ \end{array} \]

Alternative 5: 94.5% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq 700000000000:\\ \;\;\;\;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} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= t 700000000000.0) (* y (* t (- x z))) (* t (* y (- x z)))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (t <= 700000000000.0) {
		tmp = y * (t * (x - z));
	} else {
		tmp = t * (y * (x - z));
	}
	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 <= 700000000000.0d0) then
        tmp = y * (t * (x - z))
    else
        tmp = t * (y * (x - z))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (t <= 700000000000.0) {
		tmp = y * (t * (x - z));
	} else {
		tmp = t * (y * (x - z));
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if t <= 700000000000.0:
		tmp = y * (t * (x - z))
	else:
		tmp = t * (y * (x - z))
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (t <= 700000000000.0)
		tmp = Float64(y * Float64(t * Float64(x - z)));
	else
		tmp = Float64(t * Float64(y * Float64(x - z)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (t <= 700000000000.0)
		tmp = y * (t * (x - z));
	else
		tmp = t * (y * (x - z));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[t, 700000000000.0], N[(y * N[(t * N[(x - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(y * N[(x - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq 700000000000:\\
\;\;\;\;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 < 7e11

    1. Initial program 87.7%

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

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

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

    if 7e11 < t

    1. Initial program 98.5%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 700000000000:\\ \;\;\;\;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.4% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq 1.65 \cdot 10^{-72}:\\ \;\;\;\;y \cdot \left(x \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(y \cdot t\right)\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= t 1.65e-72) (* y (* x t)) (* x (* y t))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (t <= 1.65e-72) {
		tmp = y * (x * t);
	} else {
		tmp = x * (y * 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 <= 1.65d-72) then
        tmp = y * (x * t)
    else
        tmp = x * (y * t)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (t <= 1.65e-72) {
		tmp = y * (x * t);
	} else {
		tmp = x * (y * t);
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if t <= 1.65e-72:
		tmp = y * (x * t)
	else:
		tmp = x * (y * t)
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (t <= 1.65e-72)
		tmp = Float64(y * Float64(x * t));
	else
		tmp = Float64(x * Float64(y * t));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (t <= 1.65e-72)
		tmp = y * (x * t);
	else
		tmp = x * (y * t);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[t, 1.65e-72], N[(y * N[(x * t), $MachinePrecision]), $MachinePrecision], N[(x * N[(y * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq 1.65 \cdot 10^{-72}:\\
\;\;\;\;y \cdot \left(x \cdot t\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < 1.65e-72

    1. Initial program 86.7%

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

        \[\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 55.6%

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

    if 1.65e-72 < t

    1. Initial program 97.8%

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

        \[\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. Step-by-step derivation
      1. associate-*r*97.8%

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

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

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

        \[\leadsto t \cdot \color{blue}{\left(\mathsf{fma}\left(x, y, -y \cdot z\right) + \mathsf{fma}\left(-y, z, y \cdot z\right)\right)} \]
      5. *-commutative90.3%

        \[\leadsto t \cdot \left(\mathsf{fma}\left(x, y, -\color{blue}{z \cdot y}\right) + \mathsf{fma}\left(-y, z, y \cdot z\right)\right) \]
      6. fma-neg90.3%

        \[\leadsto t \cdot \left(\color{blue}{\left(x \cdot y - z \cdot y\right)} + \mathsf{fma}\left(-y, z, y \cdot z\right)\right) \]
      7. distribute-rgt-in82.8%

        \[\leadsto \color{blue}{\left(x \cdot y - z \cdot y\right) \cdot t + \mathsf{fma}\left(-y, z, y \cdot z\right) \cdot t} \]
      8. fma-def83.0%

        \[\leadsto \color{blue}{\mathsf{fma}\left(x \cdot y - z \cdot y, t, \mathsf{fma}\left(-y, z, y \cdot z\right) \cdot t\right)} \]
      9. distribute-rgt-out--83.0%

        \[\leadsto \mathsf{fma}\left(\color{blue}{y \cdot \left(x - z\right)}, t, \mathsf{fma}\left(-y, z, y \cdot z\right) \cdot t\right) \]
      10. *-commutative83.0%

        \[\leadsto \mathsf{fma}\left(y \cdot \left(x - z\right), t, \mathsf{fma}\left(-y, z, \color{blue}{z \cdot y}\right) \cdot t\right) \]
      11. fma-udef90.3%

        \[\leadsto \mathsf{fma}\left(y \cdot \left(x - z\right), t, \color{blue}{\left(\left(-y\right) \cdot z + z \cdot y\right)} \cdot t\right) \]
      12. distribute-lft-neg-in90.3%

        \[\leadsto \mathsf{fma}\left(y \cdot \left(x - z\right), t, \left(\color{blue}{\left(-y \cdot z\right)} + z \cdot y\right) \cdot t\right) \]
      13. distribute-rgt-neg-in90.3%

        \[\leadsto \mathsf{fma}\left(y \cdot \left(x - z\right), t, \left(\color{blue}{y \cdot \left(-z\right)} + z \cdot y\right) \cdot t\right) \]
      14. fma-def83.0%

        \[\leadsto \mathsf{fma}\left(y \cdot \left(x - z\right), t, \color{blue}{\mathsf{fma}\left(y, -z, z \cdot y\right)} \cdot t\right) \]
      15. *-commutative83.0%

        \[\leadsto \mathsf{fma}\left(y \cdot \left(x - z\right), t, \mathsf{fma}\left(y, -z, \color{blue}{y \cdot z}\right) \cdot t\right) \]
    5. Applied egg-rr83.0%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y \cdot \left(x - z\right), t, \mathsf{fma}\left(y, -z, y \cdot z\right) \cdot t\right)} \]
    6. Taylor expanded in z around 0 88.7%

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

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

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

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

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

Alternative 7: 92.2% accurate, 1.3× speedup?

\[\begin{array}{l} \\ y \cdot \left(t \cdot \left(x - z\right)\right) \end{array} \]
(FPCore (x y z t) :precision binary64 (* y (* t (- x z))))
double code(double x, double y, double z, double t) {
	return y * (t * (x - z));
}
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
public static double code(double x, double y, double z, double t) {
	return y * (t * (x - z));
}
def code(x, y, z, t):
	return y * (t * (x - z))
function code(x, y, z, t)
	return Float64(y * Float64(t * Float64(x - z)))
end
function tmp = code(x, y, z, t)
	tmp = y * (t * (x - z));
end
code[x_, y_, z_, t_] := N[(y * N[(t * N[(x - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
y \cdot \left(t \cdot \left(x - z\right)\right)
\end{array}
Derivation
  1. Initial program 90.8%

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

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

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

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

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

Alternative 8: 53.7% accurate, 1.8× speedup?

\[\begin{array}{l} \\ y \cdot \left(x \cdot t\right) \end{array} \]
(FPCore (x y z t) :precision binary64 (* y (* x t)))
double code(double x, double y, double z, double t) {
	return y * (x * 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 = y * (x * t)
end function
public static double code(double x, double y, double z, double t) {
	return y * (x * t);
}
def code(x, y, z, t):
	return y * (x * t)
function code(x, y, z, t)
	return Float64(y * Float64(x * t))
end
function tmp = code(x, y, z, t)
	tmp = y * (x * t);
end
code[x_, y_, z_, t_] := N[(y * N[(x * t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
y \cdot \left(x \cdot t\right)
\end{array}
Derivation
  1. Initial program 90.8%

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

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

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

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

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

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

Developer target: 96.7% 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 2023230 
(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))