Data.Colour.Matrix:inverse from colour-2.3.3, B

Percentage Accurate: 91.2% → 94.9%
Time: 7.3s
Alternatives: 9
Speedup: 0.5×

Specification

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

\\
\frac{x \cdot y - z \cdot t}{a}
\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 9 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: 91.2% accurate, 1.0× speedup?

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

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

Alternative 1: 94.9% accurate, 0.5× speedup?

\[\begin{array}{l} [x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\ \\ \begin{array}{l} \mathbf{if}\;z \cdot t \leq -1 \cdot 10^{+267} \lor \neg \left(z \cdot t \leq 2 \cdot 10^{+234}\right):\\ \;\;\;\;\frac{-z}{a} \cdot t\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(y, x, \left(-z\right) \cdot t\right)}{a}\\ \end{array} \end{array} \]
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
 :precision binary64
 (if (or (<= (* z t) -1e+267) (not (<= (* z t) 2e+234)))
   (* (/ (- z) a) t)
   (/ (fma y x (* (- z) t)) a)))
assert(x < y && y < z && z < t && t < a);
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (((z * t) <= -1e+267) || !((z * t) <= 2e+234)) {
		tmp = (-z / a) * t;
	} else {
		tmp = fma(y, x, (-z * t)) / a;
	}
	return tmp;
}
x, y, z, t, a = sort([x, y, z, t, a])
function code(x, y, z, t, a)
	tmp = 0.0
	if ((Float64(z * t) <= -1e+267) || !(Float64(z * t) <= 2e+234))
		tmp = Float64(Float64(Float64(-z) / a) * t);
	else
		tmp = Float64(fma(y, x, Float64(Float64(-z) * t)) / a);
	end
	return tmp
end
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[N[(z * t), $MachinePrecision], -1e+267], N[Not[LessEqual[N[(z * t), $MachinePrecision], 2e+234]], $MachinePrecision]], N[(N[((-z) / a), $MachinePrecision] * t), $MachinePrecision], N[(N[(y * x + N[((-z) * t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \cdot t \leq -1 \cdot 10^{+267} \lor \neg \left(z \cdot t \leq 2 \cdot 10^{+234}\right):\\
\;\;\;\;\frac{-z}{a} \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 z t) < -9.9999999999999997e266 or 2.00000000000000004e234 < (*.f64 z t)

    1. Initial program 72.9%

      \[\frac{x \cdot y - z \cdot t}{a} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift--.f64N/A

        \[\leadsto \frac{\color{blue}{x \cdot y - z \cdot t}}{a} \]
      2. lift-*.f64N/A

        \[\leadsto \frac{x \cdot y - \color{blue}{z \cdot t}}{a} \]
      3. fp-cancel-sub-sign-invN/A

        \[\leadsto \frac{\color{blue}{x \cdot y + \left(\mathsf{neg}\left(z\right)\right) \cdot t}}{a} \]
      4. lift-*.f64N/A

        \[\leadsto \frac{\color{blue}{x \cdot y} + \left(\mathsf{neg}\left(z\right)\right) \cdot t}{a} \]
      5. *-commutativeN/A

        \[\leadsto \frac{\color{blue}{y \cdot x} + \left(\mathsf{neg}\left(z\right)\right) \cdot t}{a} \]
      6. lower-fma.f64N/A

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(y, x, \left(\mathsf{neg}\left(z\right)\right) \cdot t\right)}}{a} \]
      7. lower-*.f64N/A

        \[\leadsto \frac{\mathsf{fma}\left(y, x, \color{blue}{\left(\mathsf{neg}\left(z\right)\right) \cdot t}\right)}{a} \]
      8. lower-neg.f6475.3

        \[\leadsto \frac{\mathsf{fma}\left(y, x, \color{blue}{\left(-z\right)} \cdot t\right)}{a} \]
    4. Applied rewrites75.3%

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

      \[\leadsto \color{blue}{-1 \cdot \frac{t \cdot z}{a}} \]
    6. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto -1 \cdot \frac{\color{blue}{z \cdot t}}{a} \]
      2. associate-*l/N/A

        \[\leadsto -1 \cdot \color{blue}{\left(\frac{z}{a} \cdot t\right)} \]
      3. associate-*l*N/A

        \[\leadsto \color{blue}{\left(-1 \cdot \frac{z}{a}\right) \cdot t} \]
      4. lower-*.f64N/A

        \[\leadsto \color{blue}{\left(-1 \cdot \frac{z}{a}\right) \cdot t} \]
      5. associate-*r/N/A

        \[\leadsto \color{blue}{\frac{-1 \cdot z}{a}} \cdot t \]
      6. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{-1 \cdot z}{a}} \cdot t \]
      7. mul-1-negN/A

        \[\leadsto \frac{\color{blue}{\mathsf{neg}\left(z\right)}}{a} \cdot t \]
      8. lower-neg.f6496.0

        \[\leadsto \frac{\color{blue}{-z}}{a} \cdot t \]
    7. Applied rewrites96.0%

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

    if -9.9999999999999997e266 < (*.f64 z t) < 2.00000000000000004e234

    1. Initial program 97.5%

      \[\frac{x \cdot y - z \cdot t}{a} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift--.f64N/A

        \[\leadsto \frac{\color{blue}{x \cdot y - z \cdot t}}{a} \]
      2. lift-*.f64N/A

        \[\leadsto \frac{x \cdot y - \color{blue}{z \cdot t}}{a} \]
      3. fp-cancel-sub-sign-invN/A

        \[\leadsto \frac{\color{blue}{x \cdot y + \left(\mathsf{neg}\left(z\right)\right) \cdot t}}{a} \]
      4. lift-*.f64N/A

        \[\leadsto \frac{\color{blue}{x \cdot y} + \left(\mathsf{neg}\left(z\right)\right) \cdot t}{a} \]
      5. *-commutativeN/A

        \[\leadsto \frac{\color{blue}{y \cdot x} + \left(\mathsf{neg}\left(z\right)\right) \cdot t}{a} \]
      6. lower-fma.f64N/A

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(y, x, \left(\mathsf{neg}\left(z\right)\right) \cdot t\right)}}{a} \]
      7. lower-*.f64N/A

        \[\leadsto \frac{\mathsf{fma}\left(y, x, \color{blue}{\left(\mathsf{neg}\left(z\right)\right) \cdot t}\right)}{a} \]
      8. lower-neg.f6497.5

        \[\leadsto \frac{\mathsf{fma}\left(y, x, \color{blue}{\left(-z\right)} \cdot t\right)}{a} \]
    4. Applied rewrites97.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \cdot t \leq -1 \cdot 10^{+267} \lor \neg \left(z \cdot t \leq 2 \cdot 10^{+234}\right):\\ \;\;\;\;\frac{-z}{a} \cdot t\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(y, x, \left(-z\right) \cdot t\right)}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 74.2% accurate, 0.3× speedup?

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

\mathbf{elif}\;z \cdot t \leq -1 \cdot 10^{-66}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;z \cdot t \leq 5000000000000:\\
\;\;\;\;t\_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if (*.f64 z t) < -9.9999999999999997e266

    1. Initial program 74.2%

      \[\frac{x \cdot y - z \cdot t}{a} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift--.f64N/A

        \[\leadsto \frac{\color{blue}{x \cdot y - z \cdot t}}{a} \]
      2. lift-*.f64N/A

        \[\leadsto \frac{x \cdot y - \color{blue}{z \cdot t}}{a} \]
      3. fp-cancel-sub-sign-invN/A

        \[\leadsto \frac{\color{blue}{x \cdot y + \left(\mathsf{neg}\left(z\right)\right) \cdot t}}{a} \]
      4. lift-*.f64N/A

        \[\leadsto \frac{\color{blue}{x \cdot y} + \left(\mathsf{neg}\left(z\right)\right) \cdot t}{a} \]
      5. *-commutativeN/A

        \[\leadsto \frac{\color{blue}{y \cdot x} + \left(\mathsf{neg}\left(z\right)\right) \cdot t}{a} \]
      6. lower-fma.f64N/A

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(y, x, \left(\mathsf{neg}\left(z\right)\right) \cdot t\right)}}{a} \]
      7. lower-*.f64N/A

        \[\leadsto \frac{\mathsf{fma}\left(y, x, \color{blue}{\left(\mathsf{neg}\left(z\right)\right) \cdot t}\right)}{a} \]
      8. lower-neg.f6478.0

        \[\leadsto \frac{\mathsf{fma}\left(y, x, \color{blue}{\left(-z\right)} \cdot t\right)}{a} \]
    4. Applied rewrites78.0%

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

      \[\leadsto \color{blue}{-1 \cdot \frac{t \cdot z}{a}} \]
    6. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto -1 \cdot \frac{\color{blue}{z \cdot t}}{a} \]
      2. associate-*l/N/A

        \[\leadsto -1 \cdot \color{blue}{\left(\frac{z}{a} \cdot t\right)} \]
      3. associate-*l*N/A

        \[\leadsto \color{blue}{\left(-1 \cdot \frac{z}{a}\right) \cdot t} \]
      4. lower-*.f64N/A

        \[\leadsto \color{blue}{\left(-1 \cdot \frac{z}{a}\right) \cdot t} \]
      5. associate-*r/N/A

        \[\leadsto \color{blue}{\frac{-1 \cdot z}{a}} \cdot t \]
      6. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{-1 \cdot z}{a}} \cdot t \]
      7. mul-1-negN/A

        \[\leadsto \frac{\color{blue}{\mathsf{neg}\left(z\right)}}{a} \cdot t \]
      8. lower-neg.f6496.6

        \[\leadsto \frac{\color{blue}{-z}}{a} \cdot t \]
    7. Applied rewrites96.6%

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

    if -9.9999999999999997e266 < (*.f64 z t) < -9.9999999999999998e-67 or 1.00000000000000003e-53 < (*.f64 z t) < 5e12

    1. Initial program 98.5%

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

      \[\leadsto \frac{\color{blue}{-1 \cdot \left(t \cdot z\right)}}{a} \]
    4. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \frac{-1 \cdot \color{blue}{\left(z \cdot t\right)}}{a} \]
      2. associate-*r*N/A

        \[\leadsto \frac{\color{blue}{\left(-1 \cdot z\right) \cdot t}}{a} \]
      3. lower-*.f64N/A

        \[\leadsto \frac{\color{blue}{\left(-1 \cdot z\right) \cdot t}}{a} \]
      4. mul-1-negN/A

        \[\leadsto \frac{\color{blue}{\left(\mathsf{neg}\left(z\right)\right)} \cdot t}{a} \]
      5. lower-neg.f6475.6

        \[\leadsto \frac{\color{blue}{\left(-z\right)} \cdot t}{a} \]
    5. Applied rewrites75.6%

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

    if -9.9999999999999998e-67 < (*.f64 z t) < 1.00000000000000003e-53

    1. Initial program 97.6%

      \[\frac{x \cdot y - z \cdot t}{a} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift--.f64N/A

        \[\leadsto \frac{\color{blue}{x \cdot y - z \cdot t}}{a} \]
      2. lift-*.f64N/A

        \[\leadsto \frac{x \cdot y - \color{blue}{z \cdot t}}{a} \]
      3. fp-cancel-sub-sign-invN/A

        \[\leadsto \frac{\color{blue}{x \cdot y + \left(\mathsf{neg}\left(z\right)\right) \cdot t}}{a} \]
      4. unpow1N/A

        \[\leadsto \frac{\color{blue}{{\left(x \cdot y\right)}^{1}} + \left(\mathsf{neg}\left(z\right)\right) \cdot t}{a} \]
      5. metadata-evalN/A

        \[\leadsto \frac{{\left(x \cdot y\right)}^{\color{blue}{\left(\frac{2}{2}\right)}} + \left(\mathsf{neg}\left(z\right)\right) \cdot t}{a} \]
      6. sqrt-pow1N/A

        \[\leadsto \frac{\color{blue}{\sqrt{{\left(x \cdot y\right)}^{2}}} + \left(\mathsf{neg}\left(z\right)\right) \cdot t}{a} \]
      7. pow2N/A

        \[\leadsto \frac{\sqrt{\color{blue}{\left(x \cdot y\right) \cdot \left(x \cdot y\right)}} + \left(\mathsf{neg}\left(z\right)\right) \cdot t}{a} \]
      8. lift-*.f64N/A

        \[\leadsto \frac{\sqrt{\color{blue}{\left(x \cdot y\right)} \cdot \left(x \cdot y\right)} + \left(\mathsf{neg}\left(z\right)\right) \cdot t}{a} \]
      9. *-commutativeN/A

        \[\leadsto \frac{\sqrt{\color{blue}{\left(y \cdot x\right)} \cdot \left(x \cdot y\right)} + \left(\mathsf{neg}\left(z\right)\right) \cdot t}{a} \]
      10. associate-*l*N/A

        \[\leadsto \frac{\sqrt{\color{blue}{y \cdot \left(x \cdot \left(x \cdot y\right)\right)}} + \left(\mathsf{neg}\left(z\right)\right) \cdot t}{a} \]
      11. *-commutativeN/A

        \[\leadsto \frac{\sqrt{\color{blue}{\left(x \cdot \left(x \cdot y\right)\right) \cdot y}} + \left(\mathsf{neg}\left(z\right)\right) \cdot t}{a} \]
      12. sqrt-prodN/A

        \[\leadsto \frac{\color{blue}{\sqrt{x \cdot \left(x \cdot y\right)} \cdot \sqrt{y}} + \left(\mathsf{neg}\left(z\right)\right) \cdot t}{a} \]
      13. lower-fma.f64N/A

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\sqrt{x \cdot \left(x \cdot y\right)}, \sqrt{y}, \left(\mathsf{neg}\left(z\right)\right) \cdot t\right)}}{a} \]
      14. lower-sqrt.f64N/A

        \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{\sqrt{x \cdot \left(x \cdot y\right)}}, \sqrt{y}, \left(\mathsf{neg}\left(z\right)\right) \cdot t\right)}{a} \]
      15. lift-*.f64N/A

        \[\leadsto \frac{\mathsf{fma}\left(\sqrt{x \cdot \color{blue}{\left(x \cdot y\right)}}, \sqrt{y}, \left(\mathsf{neg}\left(z\right)\right) \cdot t\right)}{a} \]
      16. associate-*r*N/A

        \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\color{blue}{\left(x \cdot x\right) \cdot y}}, \sqrt{y}, \left(\mathsf{neg}\left(z\right)\right) \cdot t\right)}{a} \]
      17. lower-*.f64N/A

        \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\color{blue}{\left(x \cdot x\right) \cdot y}}, \sqrt{y}, \left(\mathsf{neg}\left(z\right)\right) \cdot t\right)}{a} \]
      18. lower-*.f64N/A

        \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\color{blue}{\left(x \cdot x\right)} \cdot y}, \sqrt{y}, \left(\mathsf{neg}\left(z\right)\right) \cdot t\right)}{a} \]
      19. lower-sqrt.f64N/A

        \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\left(x \cdot x\right) \cdot y}, \color{blue}{\sqrt{y}}, \left(\mathsf{neg}\left(z\right)\right) \cdot t\right)}{a} \]
      20. lower-*.f64N/A

        \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\left(x \cdot x\right) \cdot y}, \sqrt{y}, \color{blue}{\left(\mathsf{neg}\left(z\right)\right) \cdot t}\right)}{a} \]
      21. lower-neg.f6420.9

        \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\left(x \cdot x\right) \cdot y}, \sqrt{y}, \color{blue}{\left(-z\right)} \cdot t\right)}{a} \]
    4. Applied rewrites20.9%

      \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\sqrt{\left(x \cdot x\right) \cdot y}, \sqrt{y}, \left(-z\right) \cdot t\right)}}{a} \]
    5. Taylor expanded in y around -inf

      \[\leadsto \frac{\color{blue}{-1 \cdot \left(x \cdot \left(y \cdot {\left(\sqrt{-1}\right)}^{2}\right)\right)}}{a} \]
    6. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \frac{\color{blue}{\mathsf{neg}\left(x \cdot \left(y \cdot {\left(\sqrt{-1}\right)}^{2}\right)\right)}}{a} \]
      2. distribute-rgt-neg-inN/A

        \[\leadsto \frac{\color{blue}{x \cdot \left(\mathsf{neg}\left(y \cdot {\left(\sqrt{-1}\right)}^{2}\right)\right)}}{a} \]
      3. *-commutativeN/A

        \[\leadsto \frac{x \cdot \left(\mathsf{neg}\left(\color{blue}{{\left(\sqrt{-1}\right)}^{2} \cdot y}\right)\right)}{a} \]
      4. unpow2N/A

        \[\leadsto \frac{x \cdot \left(\mathsf{neg}\left(\color{blue}{\left(\sqrt{-1} \cdot \sqrt{-1}\right)} \cdot y\right)\right)}{a} \]
      5. rem-square-sqrtN/A

        \[\leadsto \frac{x \cdot \left(\mathsf{neg}\left(\color{blue}{-1} \cdot y\right)\right)}{a} \]
      6. mul-1-negN/A

        \[\leadsto \frac{x \cdot \left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(y\right)\right)}\right)\right)}{a} \]
      7. remove-double-negN/A

        \[\leadsto \frac{x \cdot \color{blue}{y}}{a} \]
      8. lower-*.f6488.4

        \[\leadsto \frac{\color{blue}{x \cdot y}}{a} \]
    7. Applied rewrites88.4%

      \[\leadsto \frac{\color{blue}{x \cdot y}}{a} \]

    if 5e12 < (*.f64 z t) < 1.00000000000000009e106

    1. Initial program 90.4%

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

      \[\leadsto \color{blue}{\frac{x \cdot y}{a}} \]
    4. Step-by-step derivation
      1. associate-*l/N/A

        \[\leadsto \color{blue}{\frac{x}{a} \cdot y} \]
      2. lower-*.f64N/A

        \[\leadsto \color{blue}{\frac{x}{a} \cdot y} \]
      3. lower-/.f6470.6

        \[\leadsto \color{blue}{\frac{x}{a}} \cdot y \]
    5. Applied rewrites70.6%

      \[\leadsto \color{blue}{\frac{x}{a} \cdot y} \]
    6. Step-by-step derivation
      1. Applied rewrites65.9%

        \[\leadsto x \cdot \color{blue}{\frac{y}{a}} \]

      if 1.00000000000000009e106 < (*.f64 z t)

      1. Initial program 86.1%

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

        \[\leadsto \color{blue}{-1 \cdot \frac{t \cdot z}{a}} \]
      4. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto -1 \cdot \frac{\color{blue}{z \cdot t}}{a} \]
        2. associate-*r/N/A

          \[\leadsto -1 \cdot \color{blue}{\left(z \cdot \frac{t}{a}\right)} \]
        3. associate-*r*N/A

          \[\leadsto \color{blue}{\left(-1 \cdot z\right) \cdot \frac{t}{a}} \]
        4. lower-*.f64N/A

          \[\leadsto \color{blue}{\left(-1 \cdot z\right) \cdot \frac{t}{a}} \]
        5. mul-1-negN/A

          \[\leadsto \color{blue}{\left(\mathsf{neg}\left(z\right)\right)} \cdot \frac{t}{a} \]
        6. lower-neg.f64N/A

          \[\leadsto \color{blue}{\left(-z\right)} \cdot \frac{t}{a} \]
        7. lower-/.f6490.6

          \[\leadsto \left(-z\right) \cdot \color{blue}{\frac{t}{a}} \]
      5. Applied rewrites90.6%

        \[\leadsto \color{blue}{\left(-z\right) \cdot \frac{t}{a}} \]
    7. Recombined 5 regimes into one program.
    8. Final simplification84.1%

      \[\leadsto \begin{array}{l} \mathbf{if}\;z \cdot t \leq -1 \cdot 10^{+267}:\\ \;\;\;\;\frac{-z}{a} \cdot t\\ \mathbf{elif}\;z \cdot t \leq -1 \cdot 10^{-66}:\\ \;\;\;\;\frac{\left(-z\right) \cdot t}{a}\\ \mathbf{elif}\;z \cdot t \leq 10^{-53}:\\ \;\;\;\;\frac{x \cdot y}{a}\\ \mathbf{elif}\;z \cdot t \leq 5000000000000:\\ \;\;\;\;\frac{\left(-z\right) \cdot t}{a}\\ \mathbf{elif}\;z \cdot t \leq 10^{+106}:\\ \;\;\;\;x \cdot \frac{y}{a}\\ \mathbf{else}:\\ \;\;\;\;\left(-z\right) \cdot \frac{t}{a}\\ \end{array} \]
    9. Add Preprocessing

    Alternative 3: 94.7% accurate, 0.5× speedup?

    \[\begin{array}{l} [x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\ \\ \begin{array}{l} \mathbf{if}\;x \cdot y - z \cdot t \leq 2 \cdot 10^{+270}:\\ \;\;\;\;\frac{\mathsf{fma}\left(y, x, \left(-z\right) \cdot t\right)}{a}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{y}{a}, x, \left(-t\right) \cdot \frac{z}{a}\right)\\ \end{array} \end{array} \]
    NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
    (FPCore (x y z t a)
     :precision binary64
     (if (<= (- (* x y) (* z t)) 2e+270)
       (/ (fma y x (* (- z) t)) a)
       (fma (/ y a) x (* (- t) (/ z a)))))
    assert(x < y && y < z && z < t && t < a);
    double code(double x, double y, double z, double t, double a) {
    	double tmp;
    	if (((x * y) - (z * t)) <= 2e+270) {
    		tmp = fma(y, x, (-z * t)) / a;
    	} else {
    		tmp = fma((y / a), x, (-t * (z / a)));
    	}
    	return tmp;
    }
    
    x, y, z, t, a = sort([x, y, z, t, a])
    function code(x, y, z, t, a)
    	tmp = 0.0
    	if (Float64(Float64(x * y) - Float64(z * t)) <= 2e+270)
    		tmp = Float64(fma(y, x, Float64(Float64(-z) * t)) / a);
    	else
    		tmp = fma(Float64(y / a), x, Float64(Float64(-t) * Float64(z / a)));
    	end
    	return tmp
    end
    
    NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
    code[x_, y_, z_, t_, a_] := If[LessEqual[N[(N[(x * y), $MachinePrecision] - N[(z * t), $MachinePrecision]), $MachinePrecision], 2e+270], N[(N[(y * x + N[((-z) * t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], N[(N[(y / a), $MachinePrecision] * x + N[((-t) * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
    
    \begin{array}{l}
    [x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
    \\
    \begin{array}{l}
    \mathbf{if}\;x \cdot y - z \cdot t \leq 2 \cdot 10^{+270}:\\
    \;\;\;\;\frac{\mathsf{fma}\left(y, x, \left(-z\right) \cdot t\right)}{a}\\
    
    \mathbf{else}:\\
    \;\;\;\;\mathsf{fma}\left(\frac{y}{a}, x, \left(-t\right) \cdot \frac{z}{a}\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if (-.f64 (*.f64 x y) (*.f64 z t)) < 2.0000000000000001e270

      1. Initial program 97.1%

        \[\frac{x \cdot y - z \cdot t}{a} \]
      2. Add Preprocessing
      3. Step-by-step derivation
        1. lift--.f64N/A

          \[\leadsto \frac{\color{blue}{x \cdot y - z \cdot t}}{a} \]
        2. lift-*.f64N/A

          \[\leadsto \frac{x \cdot y - \color{blue}{z \cdot t}}{a} \]
        3. fp-cancel-sub-sign-invN/A

          \[\leadsto \frac{\color{blue}{x \cdot y + \left(\mathsf{neg}\left(z\right)\right) \cdot t}}{a} \]
        4. lift-*.f64N/A

          \[\leadsto \frac{\color{blue}{x \cdot y} + \left(\mathsf{neg}\left(z\right)\right) \cdot t}{a} \]
        5. *-commutativeN/A

          \[\leadsto \frac{\color{blue}{y \cdot x} + \left(\mathsf{neg}\left(z\right)\right) \cdot t}{a} \]
        6. lower-fma.f64N/A

          \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(y, x, \left(\mathsf{neg}\left(z\right)\right) \cdot t\right)}}{a} \]
        7. lower-*.f64N/A

          \[\leadsto \frac{\mathsf{fma}\left(y, x, \color{blue}{\left(\mathsf{neg}\left(z\right)\right) \cdot t}\right)}{a} \]
        8. lower-neg.f6497.1

          \[\leadsto \frac{\mathsf{fma}\left(y, x, \color{blue}{\left(-z\right)} \cdot t\right)}{a} \]
      4. Applied rewrites97.1%

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(y, x, \left(-z\right) \cdot t\right)}}{a} \]

      if 2.0000000000000001e270 < (-.f64 (*.f64 x y) (*.f64 z t))

      1. Initial program 68.2%

        \[\frac{x \cdot y - z \cdot t}{a} \]
      2. Add Preprocessing
      3. Step-by-step derivation
        1. lift-/.f64N/A

          \[\leadsto \color{blue}{\frac{x \cdot y - z \cdot t}{a}} \]
        2. lift--.f64N/A

          \[\leadsto \frac{\color{blue}{x \cdot y - z \cdot t}}{a} \]
        3. div-subN/A

          \[\leadsto \color{blue}{\frac{x \cdot y}{a} - \frac{z \cdot t}{a}} \]
        4. lift-*.f64N/A

          \[\leadsto \frac{x \cdot y}{a} - \frac{\color{blue}{z \cdot t}}{a} \]
        5. *-commutativeN/A

          \[\leadsto \frac{x \cdot y}{a} - \frac{\color{blue}{t \cdot z}}{a} \]
        6. associate-/l*N/A

          \[\leadsto \frac{x \cdot y}{a} - \color{blue}{t \cdot \frac{z}{a}} \]
        7. fp-cancel-sub-sign-invN/A

          \[\leadsto \color{blue}{\frac{x \cdot y}{a} + \left(\mathsf{neg}\left(t\right)\right) \cdot \frac{z}{a}} \]
        8. lift-*.f64N/A

          \[\leadsto \frac{\color{blue}{x \cdot y}}{a} + \left(\mathsf{neg}\left(t\right)\right) \cdot \frac{z}{a} \]
        9. associate-/l*N/A

          \[\leadsto \color{blue}{x \cdot \frac{y}{a}} + \left(\mathsf{neg}\left(t\right)\right) \cdot \frac{z}{a} \]
        10. *-commutativeN/A

          \[\leadsto \color{blue}{\frac{y}{a} \cdot x} + \left(\mathsf{neg}\left(t\right)\right) \cdot \frac{z}{a} \]
        11. lower-fma.f64N/A

          \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y}{a}, x, \left(\mathsf{neg}\left(t\right)\right) \cdot \frac{z}{a}\right)} \]
        12. lower-/.f64N/A

          \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{y}{a}}, x, \left(\mathsf{neg}\left(t\right)\right) \cdot \frac{z}{a}\right) \]
        13. lower-*.f64N/A

          \[\leadsto \mathsf{fma}\left(\frac{y}{a}, x, \color{blue}{\left(\mathsf{neg}\left(t\right)\right) \cdot \frac{z}{a}}\right) \]
        14. lower-neg.f64N/A

          \[\leadsto \mathsf{fma}\left(\frac{y}{a}, x, \color{blue}{\left(-t\right)} \cdot \frac{z}{a}\right) \]
        15. lower-/.f6497.1

          \[\leadsto \mathsf{fma}\left(\frac{y}{a}, x, \left(-t\right) \cdot \color{blue}{\frac{z}{a}}\right) \]
      4. Applied rewrites97.1%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y}{a}, x, \left(-t\right) \cdot \frac{z}{a}\right)} \]
    3. Recombined 2 regimes into one program.
    4. Add Preprocessing

    Alternative 4: 94.9% accurate, 0.5× speedup?

    \[\begin{array}{l} [x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\ \\ \begin{array}{l} \mathbf{if}\;z \cdot t \leq -1 \cdot 10^{+267} \lor \neg \left(z \cdot t \leq 2 \cdot 10^{+234}\right):\\ \;\;\;\;\frac{-z}{a} \cdot t\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot y - z \cdot t}{a}\\ \end{array} \end{array} \]
    NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
    (FPCore (x y z t a)
     :precision binary64
     (if (or (<= (* z t) -1e+267) (not (<= (* z t) 2e+234)))
       (* (/ (- z) a) t)
       (/ (- (* x y) (* z t)) a)))
    assert(x < y && y < z && z < t && t < a);
    double code(double x, double y, double z, double t, double a) {
    	double tmp;
    	if (((z * t) <= -1e+267) || !((z * t) <= 2e+234)) {
    		tmp = (-z / a) * t;
    	} else {
    		tmp = ((x * y) - (z * t)) / a;
    	}
    	return tmp;
    }
    
    NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
    real(8) function code(x, y, z, t, a)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        real(8), intent (in) :: z
        real(8), intent (in) :: t
        real(8), intent (in) :: a
        real(8) :: tmp
        if (((z * t) <= (-1d+267)) .or. (.not. ((z * t) <= 2d+234))) then
            tmp = (-z / a) * t
        else
            tmp = ((x * y) - (z * t)) / a
        end if
        code = tmp
    end function
    
    assert x < y && y < z && z < t && t < a;
    public static double code(double x, double y, double z, double t, double a) {
    	double tmp;
    	if (((z * t) <= -1e+267) || !((z * t) <= 2e+234)) {
    		tmp = (-z / a) * t;
    	} else {
    		tmp = ((x * y) - (z * t)) / a;
    	}
    	return tmp;
    }
    
    [x, y, z, t, a] = sort([x, y, z, t, a])
    def code(x, y, z, t, a):
    	tmp = 0
    	if ((z * t) <= -1e+267) or not ((z * t) <= 2e+234):
    		tmp = (-z / a) * t
    	else:
    		tmp = ((x * y) - (z * t)) / a
    	return tmp
    
    x, y, z, t, a = sort([x, y, z, t, a])
    function code(x, y, z, t, a)
    	tmp = 0.0
    	if ((Float64(z * t) <= -1e+267) || !(Float64(z * t) <= 2e+234))
    		tmp = Float64(Float64(Float64(-z) / a) * t);
    	else
    		tmp = Float64(Float64(Float64(x * y) - Float64(z * t)) / a);
    	end
    	return tmp
    end
    
    x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
    function tmp_2 = code(x, y, z, t, a)
    	tmp = 0.0;
    	if (((z * t) <= -1e+267) || ~(((z * t) <= 2e+234)))
    		tmp = (-z / a) * t;
    	else
    		tmp = ((x * y) - (z * t)) / a;
    	end
    	tmp_2 = tmp;
    end
    
    NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
    code[x_, y_, z_, t_, a_] := If[Or[LessEqual[N[(z * t), $MachinePrecision], -1e+267], N[Not[LessEqual[N[(z * t), $MachinePrecision], 2e+234]], $MachinePrecision]], N[(N[((-z) / a), $MachinePrecision] * t), $MachinePrecision], N[(N[(N[(x * y), $MachinePrecision] - N[(z * t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]]
    
    \begin{array}{l}
    [x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
    \\
    \begin{array}{l}
    \mathbf{if}\;z \cdot t \leq -1 \cdot 10^{+267} \lor \neg \left(z \cdot t \leq 2 \cdot 10^{+234}\right):\\
    \;\;\;\;\frac{-z}{a} \cdot t\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{x \cdot y - z \cdot t}{a}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if (*.f64 z t) < -9.9999999999999997e266 or 2.00000000000000004e234 < (*.f64 z t)

      1. Initial program 72.9%

        \[\frac{x \cdot y - z \cdot t}{a} \]
      2. Add Preprocessing
      3. Step-by-step derivation
        1. lift--.f64N/A

          \[\leadsto \frac{\color{blue}{x \cdot y - z \cdot t}}{a} \]
        2. lift-*.f64N/A

          \[\leadsto \frac{x \cdot y - \color{blue}{z \cdot t}}{a} \]
        3. fp-cancel-sub-sign-invN/A

          \[\leadsto \frac{\color{blue}{x \cdot y + \left(\mathsf{neg}\left(z\right)\right) \cdot t}}{a} \]
        4. lift-*.f64N/A

          \[\leadsto \frac{\color{blue}{x \cdot y} + \left(\mathsf{neg}\left(z\right)\right) \cdot t}{a} \]
        5. *-commutativeN/A

          \[\leadsto \frac{\color{blue}{y \cdot x} + \left(\mathsf{neg}\left(z\right)\right) \cdot t}{a} \]
        6. lower-fma.f64N/A

          \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(y, x, \left(\mathsf{neg}\left(z\right)\right) \cdot t\right)}}{a} \]
        7. lower-*.f64N/A

          \[\leadsto \frac{\mathsf{fma}\left(y, x, \color{blue}{\left(\mathsf{neg}\left(z\right)\right) \cdot t}\right)}{a} \]
        8. lower-neg.f6475.3

          \[\leadsto \frac{\mathsf{fma}\left(y, x, \color{blue}{\left(-z\right)} \cdot t\right)}{a} \]
      4. Applied rewrites75.3%

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

        \[\leadsto \color{blue}{-1 \cdot \frac{t \cdot z}{a}} \]
      6. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto -1 \cdot \frac{\color{blue}{z \cdot t}}{a} \]
        2. associate-*l/N/A

          \[\leadsto -1 \cdot \color{blue}{\left(\frac{z}{a} \cdot t\right)} \]
        3. associate-*l*N/A

          \[\leadsto \color{blue}{\left(-1 \cdot \frac{z}{a}\right) \cdot t} \]
        4. lower-*.f64N/A

          \[\leadsto \color{blue}{\left(-1 \cdot \frac{z}{a}\right) \cdot t} \]
        5. associate-*r/N/A

          \[\leadsto \color{blue}{\frac{-1 \cdot z}{a}} \cdot t \]
        6. lower-/.f64N/A

          \[\leadsto \color{blue}{\frac{-1 \cdot z}{a}} \cdot t \]
        7. mul-1-negN/A

          \[\leadsto \frac{\color{blue}{\mathsf{neg}\left(z\right)}}{a} \cdot t \]
        8. lower-neg.f6496.0

          \[\leadsto \frac{\color{blue}{-z}}{a} \cdot t \]
      7. Applied rewrites96.0%

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

      if -9.9999999999999997e266 < (*.f64 z t) < 2.00000000000000004e234

      1. Initial program 97.5%

        \[\frac{x \cdot y - z \cdot t}{a} \]
      2. Add Preprocessing
    3. Recombined 2 regimes into one program.
    4. Final simplification97.2%

      \[\leadsto \begin{array}{l} \mathbf{if}\;z \cdot t \leq -1 \cdot 10^{+267} \lor \neg \left(z \cdot t \leq 2 \cdot 10^{+234}\right):\\ \;\;\;\;\frac{-z}{a} \cdot t\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot y - z \cdot t}{a}\\ \end{array} \]
    5. Add Preprocessing

    Alternative 5: 72.5% accurate, 0.6× speedup?

    \[\begin{array}{l} [x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\ \\ \begin{array}{l} \mathbf{if}\;z \cdot t \leq -1 \cdot 10^{-66} \lor \neg \left(z \cdot t \leq 10^{+106}\right):\\ \;\;\;\;\frac{-z}{a} \cdot t\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot y}{a}\\ \end{array} \end{array} \]
    NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
    (FPCore (x y z t a)
     :precision binary64
     (if (or (<= (* z t) -1e-66) (not (<= (* z t) 1e+106)))
       (* (/ (- z) a) t)
       (/ (* x y) a)))
    assert(x < y && y < z && z < t && t < a);
    double code(double x, double y, double z, double t, double a) {
    	double tmp;
    	if (((z * t) <= -1e-66) || !((z * t) <= 1e+106)) {
    		tmp = (-z / a) * t;
    	} else {
    		tmp = (x * y) / a;
    	}
    	return tmp;
    }
    
    NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
    real(8) function code(x, y, z, t, a)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        real(8), intent (in) :: z
        real(8), intent (in) :: t
        real(8), intent (in) :: a
        real(8) :: tmp
        if (((z * t) <= (-1d-66)) .or. (.not. ((z * t) <= 1d+106))) then
            tmp = (-z / a) * t
        else
            tmp = (x * y) / a
        end if
        code = tmp
    end function
    
    assert x < y && y < z && z < t && t < a;
    public static double code(double x, double y, double z, double t, double a) {
    	double tmp;
    	if (((z * t) <= -1e-66) || !((z * t) <= 1e+106)) {
    		tmp = (-z / a) * t;
    	} else {
    		tmp = (x * y) / a;
    	}
    	return tmp;
    }
    
    [x, y, z, t, a] = sort([x, y, z, t, a])
    def code(x, y, z, t, a):
    	tmp = 0
    	if ((z * t) <= -1e-66) or not ((z * t) <= 1e+106):
    		tmp = (-z / a) * t
    	else:
    		tmp = (x * y) / a
    	return tmp
    
    x, y, z, t, a = sort([x, y, z, t, a])
    function code(x, y, z, t, a)
    	tmp = 0.0
    	if ((Float64(z * t) <= -1e-66) || !(Float64(z * t) <= 1e+106))
    		tmp = Float64(Float64(Float64(-z) / a) * t);
    	else
    		tmp = Float64(Float64(x * y) / a);
    	end
    	return tmp
    end
    
    x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
    function tmp_2 = code(x, y, z, t, a)
    	tmp = 0.0;
    	if (((z * t) <= -1e-66) || ~(((z * t) <= 1e+106)))
    		tmp = (-z / a) * t;
    	else
    		tmp = (x * y) / a;
    	end
    	tmp_2 = tmp;
    end
    
    NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
    code[x_, y_, z_, t_, a_] := If[Or[LessEqual[N[(z * t), $MachinePrecision], -1e-66], N[Not[LessEqual[N[(z * t), $MachinePrecision], 1e+106]], $MachinePrecision]], N[(N[((-z) / a), $MachinePrecision] * t), $MachinePrecision], N[(N[(x * y), $MachinePrecision] / a), $MachinePrecision]]
    
    \begin{array}{l}
    [x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
    \\
    \begin{array}{l}
    \mathbf{if}\;z \cdot t \leq -1 \cdot 10^{-66} \lor \neg \left(z \cdot t \leq 10^{+106}\right):\\
    \;\;\;\;\frac{-z}{a} \cdot t\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{x \cdot y}{a}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if (*.f64 z t) < -9.9999999999999998e-67 or 1.00000000000000009e106 < (*.f64 z t)

      1. Initial program 89.7%

        \[\frac{x \cdot y - z \cdot t}{a} \]
      2. Add Preprocessing
      3. Step-by-step derivation
        1. lift--.f64N/A

          \[\leadsto \frac{\color{blue}{x \cdot y - z \cdot t}}{a} \]
        2. lift-*.f64N/A

          \[\leadsto \frac{x \cdot y - \color{blue}{z \cdot t}}{a} \]
        3. fp-cancel-sub-sign-invN/A

          \[\leadsto \frac{\color{blue}{x \cdot y + \left(\mathsf{neg}\left(z\right)\right) \cdot t}}{a} \]
        4. lift-*.f64N/A

          \[\leadsto \frac{\color{blue}{x \cdot y} + \left(\mathsf{neg}\left(z\right)\right) \cdot t}{a} \]
        5. *-commutativeN/A

          \[\leadsto \frac{\color{blue}{y \cdot x} + \left(\mathsf{neg}\left(z\right)\right) \cdot t}{a} \]
        6. lower-fma.f64N/A

          \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(y, x, \left(\mathsf{neg}\left(z\right)\right) \cdot t\right)}}{a} \]
        7. lower-*.f64N/A

          \[\leadsto \frac{\mathsf{fma}\left(y, x, \color{blue}{\left(\mathsf{neg}\left(z\right)\right) \cdot t}\right)}{a} \]
        8. lower-neg.f6490.5

          \[\leadsto \frac{\mathsf{fma}\left(y, x, \color{blue}{\left(-z\right)} \cdot t\right)}{a} \]
      4. Applied rewrites90.5%

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

        \[\leadsto \color{blue}{-1 \cdot \frac{t \cdot z}{a}} \]
      6. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto -1 \cdot \frac{\color{blue}{z \cdot t}}{a} \]
        2. associate-*l/N/A

          \[\leadsto -1 \cdot \color{blue}{\left(\frac{z}{a} \cdot t\right)} \]
        3. associate-*l*N/A

          \[\leadsto \color{blue}{\left(-1 \cdot \frac{z}{a}\right) \cdot t} \]
        4. lower-*.f64N/A

          \[\leadsto \color{blue}{\left(-1 \cdot \frac{z}{a}\right) \cdot t} \]
        5. associate-*r/N/A

          \[\leadsto \color{blue}{\frac{-1 \cdot z}{a}} \cdot t \]
        6. lower-/.f64N/A

          \[\leadsto \color{blue}{\frac{-1 \cdot z}{a}} \cdot t \]
        7. mul-1-negN/A

          \[\leadsto \frac{\color{blue}{\mathsf{neg}\left(z\right)}}{a} \cdot t \]
        8. lower-neg.f6479.3

          \[\leadsto \frac{\color{blue}{-z}}{a} \cdot t \]
      7. Applied rewrites79.3%

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

      if -9.9999999999999998e-67 < (*.f64 z t) < 1.00000000000000009e106

      1. Initial program 96.6%

        \[\frac{x \cdot y - z \cdot t}{a} \]
      2. Add Preprocessing
      3. Step-by-step derivation
        1. lift--.f64N/A

          \[\leadsto \frac{\color{blue}{x \cdot y - z \cdot t}}{a} \]
        2. lift-*.f64N/A

          \[\leadsto \frac{x \cdot y - \color{blue}{z \cdot t}}{a} \]
        3. fp-cancel-sub-sign-invN/A

          \[\leadsto \frac{\color{blue}{x \cdot y + \left(\mathsf{neg}\left(z\right)\right) \cdot t}}{a} \]
        4. unpow1N/A

          \[\leadsto \frac{\color{blue}{{\left(x \cdot y\right)}^{1}} + \left(\mathsf{neg}\left(z\right)\right) \cdot t}{a} \]
        5. metadata-evalN/A

          \[\leadsto \frac{{\left(x \cdot y\right)}^{\color{blue}{\left(\frac{2}{2}\right)}} + \left(\mathsf{neg}\left(z\right)\right) \cdot t}{a} \]
        6. sqrt-pow1N/A

          \[\leadsto \frac{\color{blue}{\sqrt{{\left(x \cdot y\right)}^{2}}} + \left(\mathsf{neg}\left(z\right)\right) \cdot t}{a} \]
        7. pow2N/A

          \[\leadsto \frac{\sqrt{\color{blue}{\left(x \cdot y\right) \cdot \left(x \cdot y\right)}} + \left(\mathsf{neg}\left(z\right)\right) \cdot t}{a} \]
        8. lift-*.f64N/A

          \[\leadsto \frac{\sqrt{\color{blue}{\left(x \cdot y\right)} \cdot \left(x \cdot y\right)} + \left(\mathsf{neg}\left(z\right)\right) \cdot t}{a} \]
        9. *-commutativeN/A

          \[\leadsto \frac{\sqrt{\color{blue}{\left(y \cdot x\right)} \cdot \left(x \cdot y\right)} + \left(\mathsf{neg}\left(z\right)\right) \cdot t}{a} \]
        10. associate-*l*N/A

          \[\leadsto \frac{\sqrt{\color{blue}{y \cdot \left(x \cdot \left(x \cdot y\right)\right)}} + \left(\mathsf{neg}\left(z\right)\right) \cdot t}{a} \]
        11. *-commutativeN/A

          \[\leadsto \frac{\sqrt{\color{blue}{\left(x \cdot \left(x \cdot y\right)\right) \cdot y}} + \left(\mathsf{neg}\left(z\right)\right) \cdot t}{a} \]
        12. sqrt-prodN/A

          \[\leadsto \frac{\color{blue}{\sqrt{x \cdot \left(x \cdot y\right)} \cdot \sqrt{y}} + \left(\mathsf{neg}\left(z\right)\right) \cdot t}{a} \]
        13. lower-fma.f64N/A

          \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\sqrt{x \cdot \left(x \cdot y\right)}, \sqrt{y}, \left(\mathsf{neg}\left(z\right)\right) \cdot t\right)}}{a} \]
        14. lower-sqrt.f64N/A

          \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{\sqrt{x \cdot \left(x \cdot y\right)}}, \sqrt{y}, \left(\mathsf{neg}\left(z\right)\right) \cdot t\right)}{a} \]
        15. lift-*.f64N/A

          \[\leadsto \frac{\mathsf{fma}\left(\sqrt{x \cdot \color{blue}{\left(x \cdot y\right)}}, \sqrt{y}, \left(\mathsf{neg}\left(z\right)\right) \cdot t\right)}{a} \]
        16. associate-*r*N/A

          \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\color{blue}{\left(x \cdot x\right) \cdot y}}, \sqrt{y}, \left(\mathsf{neg}\left(z\right)\right) \cdot t\right)}{a} \]
        17. lower-*.f64N/A

          \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\color{blue}{\left(x \cdot x\right) \cdot y}}, \sqrt{y}, \left(\mathsf{neg}\left(z\right)\right) \cdot t\right)}{a} \]
        18. lower-*.f64N/A

          \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\color{blue}{\left(x \cdot x\right)} \cdot y}, \sqrt{y}, \left(\mathsf{neg}\left(z\right)\right) \cdot t\right)}{a} \]
        19. lower-sqrt.f64N/A

          \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\left(x \cdot x\right) \cdot y}, \color{blue}{\sqrt{y}}, \left(\mathsf{neg}\left(z\right)\right) \cdot t\right)}{a} \]
        20. lower-*.f64N/A

          \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\left(x \cdot x\right) \cdot y}, \sqrt{y}, \color{blue}{\left(\mathsf{neg}\left(z\right)\right) \cdot t}\right)}{a} \]
        21. lower-neg.f6423.8

          \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\left(x \cdot x\right) \cdot y}, \sqrt{y}, \color{blue}{\left(-z\right)} \cdot t\right)}{a} \]
      4. Applied rewrites23.8%

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\sqrt{\left(x \cdot x\right) \cdot y}, \sqrt{y}, \left(-z\right) \cdot t\right)}}{a} \]
      5. Taylor expanded in y around -inf

        \[\leadsto \frac{\color{blue}{-1 \cdot \left(x \cdot \left(y \cdot {\left(\sqrt{-1}\right)}^{2}\right)\right)}}{a} \]
      6. Step-by-step derivation
        1. mul-1-negN/A

          \[\leadsto \frac{\color{blue}{\mathsf{neg}\left(x \cdot \left(y \cdot {\left(\sqrt{-1}\right)}^{2}\right)\right)}}{a} \]
        2. distribute-rgt-neg-inN/A

          \[\leadsto \frac{\color{blue}{x \cdot \left(\mathsf{neg}\left(y \cdot {\left(\sqrt{-1}\right)}^{2}\right)\right)}}{a} \]
        3. *-commutativeN/A

          \[\leadsto \frac{x \cdot \left(\mathsf{neg}\left(\color{blue}{{\left(\sqrt{-1}\right)}^{2} \cdot y}\right)\right)}{a} \]
        4. unpow2N/A

          \[\leadsto \frac{x \cdot \left(\mathsf{neg}\left(\color{blue}{\left(\sqrt{-1} \cdot \sqrt{-1}\right)} \cdot y\right)\right)}{a} \]
        5. rem-square-sqrtN/A

          \[\leadsto \frac{x \cdot \left(\mathsf{neg}\left(\color{blue}{-1} \cdot y\right)\right)}{a} \]
        6. mul-1-negN/A

          \[\leadsto \frac{x \cdot \left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(y\right)\right)}\right)\right)}{a} \]
        7. remove-double-negN/A

          \[\leadsto \frac{x \cdot \color{blue}{y}}{a} \]
        8. lower-*.f6477.9

          \[\leadsto \frac{\color{blue}{x \cdot y}}{a} \]
      7. Applied rewrites77.9%

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;z \cdot t \leq -1 \cdot 10^{-66} \lor \neg \left(z \cdot t \leq 10^{+106}\right):\\ \;\;\;\;\frac{-z}{a} \cdot t\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot y}{a}\\ \end{array} \]
    5. Add Preprocessing

    Alternative 6: 73.1% accurate, 0.6× speedup?

    \[\begin{array}{l} [x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\ \\ \begin{array}{l} \mathbf{if}\;z \cdot t \leq -1 \cdot 10^{-66}:\\ \;\;\;\;\frac{-z}{a} \cdot t\\ \mathbf{elif}\;z \cdot t \leq 10^{-53}:\\ \;\;\;\;\frac{x \cdot y}{a}\\ \mathbf{else}:\\ \;\;\;\;\left(-z\right) \cdot \frac{t}{a}\\ \end{array} \end{array} \]
    NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
    (FPCore (x y z t a)
     :precision binary64
     (if (<= (* z t) -1e-66)
       (* (/ (- z) a) t)
       (if (<= (* z t) 1e-53) (/ (* x y) a) (* (- z) (/ t a)))))
    assert(x < y && y < z && z < t && t < a);
    double code(double x, double y, double z, double t, double a) {
    	double tmp;
    	if ((z * t) <= -1e-66) {
    		tmp = (-z / a) * t;
    	} else if ((z * t) <= 1e-53) {
    		tmp = (x * y) / a;
    	} else {
    		tmp = -z * (t / a);
    	}
    	return tmp;
    }
    
    NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
    real(8) function code(x, y, z, t, a)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        real(8), intent (in) :: z
        real(8), intent (in) :: t
        real(8), intent (in) :: a
        real(8) :: tmp
        if ((z * t) <= (-1d-66)) then
            tmp = (-z / a) * t
        else if ((z * t) <= 1d-53) then
            tmp = (x * y) / a
        else
            tmp = -z * (t / a)
        end if
        code = tmp
    end function
    
    assert x < y && y < z && z < t && t < a;
    public static double code(double x, double y, double z, double t, double a) {
    	double tmp;
    	if ((z * t) <= -1e-66) {
    		tmp = (-z / a) * t;
    	} else if ((z * t) <= 1e-53) {
    		tmp = (x * y) / a;
    	} else {
    		tmp = -z * (t / a);
    	}
    	return tmp;
    }
    
    [x, y, z, t, a] = sort([x, y, z, t, a])
    def code(x, y, z, t, a):
    	tmp = 0
    	if (z * t) <= -1e-66:
    		tmp = (-z / a) * t
    	elif (z * t) <= 1e-53:
    		tmp = (x * y) / a
    	else:
    		tmp = -z * (t / a)
    	return tmp
    
    x, y, z, t, a = sort([x, y, z, t, a])
    function code(x, y, z, t, a)
    	tmp = 0.0
    	if (Float64(z * t) <= -1e-66)
    		tmp = Float64(Float64(Float64(-z) / a) * t);
    	elseif (Float64(z * t) <= 1e-53)
    		tmp = Float64(Float64(x * y) / a);
    	else
    		tmp = Float64(Float64(-z) * Float64(t / a));
    	end
    	return tmp
    end
    
    x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
    function tmp_2 = code(x, y, z, t, a)
    	tmp = 0.0;
    	if ((z * t) <= -1e-66)
    		tmp = (-z / a) * t;
    	elseif ((z * t) <= 1e-53)
    		tmp = (x * y) / a;
    	else
    		tmp = -z * (t / a);
    	end
    	tmp_2 = tmp;
    end
    
    NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
    code[x_, y_, z_, t_, a_] := If[LessEqual[N[(z * t), $MachinePrecision], -1e-66], N[(N[((-z) / a), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[N[(z * t), $MachinePrecision], 1e-53], N[(N[(x * y), $MachinePrecision] / a), $MachinePrecision], N[((-z) * N[(t / a), $MachinePrecision]), $MachinePrecision]]]
    
    \begin{array}{l}
    [x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
    \\
    \begin{array}{l}
    \mathbf{if}\;z \cdot t \leq -1 \cdot 10^{-66}:\\
    \;\;\;\;\frac{-z}{a} \cdot t\\
    
    \mathbf{elif}\;z \cdot t \leq 10^{-53}:\\
    \;\;\;\;\frac{x \cdot y}{a}\\
    
    \mathbf{else}:\\
    \;\;\;\;\left(-z\right) \cdot \frac{t}{a}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if (*.f64 z t) < -9.9999999999999998e-67

      1. Initial program 91.3%

        \[\frac{x \cdot y - z \cdot t}{a} \]
      2. Add Preprocessing
      3. Step-by-step derivation
        1. lift--.f64N/A

          \[\leadsto \frac{\color{blue}{x \cdot y - z \cdot t}}{a} \]
        2. lift-*.f64N/A

          \[\leadsto \frac{x \cdot y - \color{blue}{z \cdot t}}{a} \]
        3. fp-cancel-sub-sign-invN/A

          \[\leadsto \frac{\color{blue}{x \cdot y + \left(\mathsf{neg}\left(z\right)\right) \cdot t}}{a} \]
        4. lift-*.f64N/A

          \[\leadsto \frac{\color{blue}{x \cdot y} + \left(\mathsf{neg}\left(z\right)\right) \cdot t}{a} \]
        5. *-commutativeN/A

          \[\leadsto \frac{\color{blue}{y \cdot x} + \left(\mathsf{neg}\left(z\right)\right) \cdot t}{a} \]
        6. lower-fma.f64N/A

          \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(y, x, \left(\mathsf{neg}\left(z\right)\right) \cdot t\right)}}{a} \]
        7. lower-*.f64N/A

          \[\leadsto \frac{\mathsf{fma}\left(y, x, \color{blue}{\left(\mathsf{neg}\left(z\right)\right) \cdot t}\right)}{a} \]
        8. lower-neg.f6492.5

          \[\leadsto \frac{\mathsf{fma}\left(y, x, \color{blue}{\left(-z\right)} \cdot t\right)}{a} \]
      4. Applied rewrites92.5%

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

        \[\leadsto \color{blue}{-1 \cdot \frac{t \cdot z}{a}} \]
      6. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto -1 \cdot \frac{\color{blue}{z \cdot t}}{a} \]
        2. associate-*l/N/A

          \[\leadsto -1 \cdot \color{blue}{\left(\frac{z}{a} \cdot t\right)} \]
        3. associate-*l*N/A

          \[\leadsto \color{blue}{\left(-1 \cdot \frac{z}{a}\right) \cdot t} \]
        4. lower-*.f64N/A

          \[\leadsto \color{blue}{\left(-1 \cdot \frac{z}{a}\right) \cdot t} \]
        5. associate-*r/N/A

          \[\leadsto \color{blue}{\frac{-1 \cdot z}{a}} \cdot t \]
        6. lower-/.f64N/A

          \[\leadsto \color{blue}{\frac{-1 \cdot z}{a}} \cdot t \]
        7. mul-1-negN/A

          \[\leadsto \frac{\color{blue}{\mathsf{neg}\left(z\right)}}{a} \cdot t \]
        8. lower-neg.f6475.1

          \[\leadsto \frac{\color{blue}{-z}}{a} \cdot t \]
      7. Applied rewrites75.1%

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

      if -9.9999999999999998e-67 < (*.f64 z t) < 1.00000000000000003e-53

      1. Initial program 97.6%

        \[\frac{x \cdot y - z \cdot t}{a} \]
      2. Add Preprocessing
      3. Step-by-step derivation
        1. lift--.f64N/A

          \[\leadsto \frac{\color{blue}{x \cdot y - z \cdot t}}{a} \]
        2. lift-*.f64N/A

          \[\leadsto \frac{x \cdot y - \color{blue}{z \cdot t}}{a} \]
        3. fp-cancel-sub-sign-invN/A

          \[\leadsto \frac{\color{blue}{x \cdot y + \left(\mathsf{neg}\left(z\right)\right) \cdot t}}{a} \]
        4. unpow1N/A

          \[\leadsto \frac{\color{blue}{{\left(x \cdot y\right)}^{1}} + \left(\mathsf{neg}\left(z\right)\right) \cdot t}{a} \]
        5. metadata-evalN/A

          \[\leadsto \frac{{\left(x \cdot y\right)}^{\color{blue}{\left(\frac{2}{2}\right)}} + \left(\mathsf{neg}\left(z\right)\right) \cdot t}{a} \]
        6. sqrt-pow1N/A

          \[\leadsto \frac{\color{blue}{\sqrt{{\left(x \cdot y\right)}^{2}}} + \left(\mathsf{neg}\left(z\right)\right) \cdot t}{a} \]
        7. pow2N/A

          \[\leadsto \frac{\sqrt{\color{blue}{\left(x \cdot y\right) \cdot \left(x \cdot y\right)}} + \left(\mathsf{neg}\left(z\right)\right) \cdot t}{a} \]
        8. lift-*.f64N/A

          \[\leadsto \frac{\sqrt{\color{blue}{\left(x \cdot y\right)} \cdot \left(x \cdot y\right)} + \left(\mathsf{neg}\left(z\right)\right) \cdot t}{a} \]
        9. *-commutativeN/A

          \[\leadsto \frac{\sqrt{\color{blue}{\left(y \cdot x\right)} \cdot \left(x \cdot y\right)} + \left(\mathsf{neg}\left(z\right)\right) \cdot t}{a} \]
        10. associate-*l*N/A

          \[\leadsto \frac{\sqrt{\color{blue}{y \cdot \left(x \cdot \left(x \cdot y\right)\right)}} + \left(\mathsf{neg}\left(z\right)\right) \cdot t}{a} \]
        11. *-commutativeN/A

          \[\leadsto \frac{\sqrt{\color{blue}{\left(x \cdot \left(x \cdot y\right)\right) \cdot y}} + \left(\mathsf{neg}\left(z\right)\right) \cdot t}{a} \]
        12. sqrt-prodN/A

          \[\leadsto \frac{\color{blue}{\sqrt{x \cdot \left(x \cdot y\right)} \cdot \sqrt{y}} + \left(\mathsf{neg}\left(z\right)\right) \cdot t}{a} \]
        13. lower-fma.f64N/A

          \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\sqrt{x \cdot \left(x \cdot y\right)}, \sqrt{y}, \left(\mathsf{neg}\left(z\right)\right) \cdot t\right)}}{a} \]
        14. lower-sqrt.f64N/A

          \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{\sqrt{x \cdot \left(x \cdot y\right)}}, \sqrt{y}, \left(\mathsf{neg}\left(z\right)\right) \cdot t\right)}{a} \]
        15. lift-*.f64N/A

          \[\leadsto \frac{\mathsf{fma}\left(\sqrt{x \cdot \color{blue}{\left(x \cdot y\right)}}, \sqrt{y}, \left(\mathsf{neg}\left(z\right)\right) \cdot t\right)}{a} \]
        16. associate-*r*N/A

          \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\color{blue}{\left(x \cdot x\right) \cdot y}}, \sqrt{y}, \left(\mathsf{neg}\left(z\right)\right) \cdot t\right)}{a} \]
        17. lower-*.f64N/A

          \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\color{blue}{\left(x \cdot x\right) \cdot y}}, \sqrt{y}, \left(\mathsf{neg}\left(z\right)\right) \cdot t\right)}{a} \]
        18. lower-*.f64N/A

          \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\color{blue}{\left(x \cdot x\right)} \cdot y}, \sqrt{y}, \left(\mathsf{neg}\left(z\right)\right) \cdot t\right)}{a} \]
        19. lower-sqrt.f64N/A

          \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\left(x \cdot x\right) \cdot y}, \color{blue}{\sqrt{y}}, \left(\mathsf{neg}\left(z\right)\right) \cdot t\right)}{a} \]
        20. lower-*.f64N/A

          \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\left(x \cdot x\right) \cdot y}, \sqrt{y}, \color{blue}{\left(\mathsf{neg}\left(z\right)\right) \cdot t}\right)}{a} \]
        21. lower-neg.f6420.9

          \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\left(x \cdot x\right) \cdot y}, \sqrt{y}, \color{blue}{\left(-z\right)} \cdot t\right)}{a} \]
      4. Applied rewrites20.9%

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\sqrt{\left(x \cdot x\right) \cdot y}, \sqrt{y}, \left(-z\right) \cdot t\right)}}{a} \]
      5. Taylor expanded in y around -inf

        \[\leadsto \frac{\color{blue}{-1 \cdot \left(x \cdot \left(y \cdot {\left(\sqrt{-1}\right)}^{2}\right)\right)}}{a} \]
      6. Step-by-step derivation
        1. mul-1-negN/A

          \[\leadsto \frac{\color{blue}{\mathsf{neg}\left(x \cdot \left(y \cdot {\left(\sqrt{-1}\right)}^{2}\right)\right)}}{a} \]
        2. distribute-rgt-neg-inN/A

          \[\leadsto \frac{\color{blue}{x \cdot \left(\mathsf{neg}\left(y \cdot {\left(\sqrt{-1}\right)}^{2}\right)\right)}}{a} \]
        3. *-commutativeN/A

          \[\leadsto \frac{x \cdot \left(\mathsf{neg}\left(\color{blue}{{\left(\sqrt{-1}\right)}^{2} \cdot y}\right)\right)}{a} \]
        4. unpow2N/A

          \[\leadsto \frac{x \cdot \left(\mathsf{neg}\left(\color{blue}{\left(\sqrt{-1} \cdot \sqrt{-1}\right)} \cdot y\right)\right)}{a} \]
        5. rem-square-sqrtN/A

          \[\leadsto \frac{x \cdot \left(\mathsf{neg}\left(\color{blue}{-1} \cdot y\right)\right)}{a} \]
        6. mul-1-negN/A

          \[\leadsto \frac{x \cdot \left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(y\right)\right)}\right)\right)}{a} \]
        7. remove-double-negN/A

          \[\leadsto \frac{x \cdot \color{blue}{y}}{a} \]
        8. lower-*.f6488.4

          \[\leadsto \frac{\color{blue}{x \cdot y}}{a} \]
      7. Applied rewrites88.4%

        \[\leadsto \frac{\color{blue}{x \cdot y}}{a} \]

      if 1.00000000000000003e-53 < (*.f64 z t)

      1. Initial program 89.4%

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

        \[\leadsto \color{blue}{-1 \cdot \frac{t \cdot z}{a}} \]
      4. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto -1 \cdot \frac{\color{blue}{z \cdot t}}{a} \]
        2. associate-*r/N/A

          \[\leadsto -1 \cdot \color{blue}{\left(z \cdot \frac{t}{a}\right)} \]
        3. associate-*r*N/A

          \[\leadsto \color{blue}{\left(-1 \cdot z\right) \cdot \frac{t}{a}} \]
        4. lower-*.f64N/A

          \[\leadsto \color{blue}{\left(-1 \cdot z\right) \cdot \frac{t}{a}} \]
        5. mul-1-negN/A

          \[\leadsto \color{blue}{\left(\mathsf{neg}\left(z\right)\right)} \cdot \frac{t}{a} \]
        6. lower-neg.f64N/A

          \[\leadsto \color{blue}{\left(-z\right)} \cdot \frac{t}{a} \]
        7. lower-/.f6467.8

          \[\leadsto \left(-z\right) \cdot \color{blue}{\frac{t}{a}} \]
      5. Applied rewrites67.8%

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

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

    Alternative 7: 52.4% accurate, 0.7× speedup?

    \[\begin{array}{l} [x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\ \\ \begin{array}{l} \mathbf{if}\;x \cdot y - z \cdot t \leq 10^{+109}:\\ \;\;\;\;\frac{x \cdot y}{a}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{y}{a}\\ \end{array} \end{array} \]
    NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
    (FPCore (x y z t a)
     :precision binary64
     (if (<= (- (* x y) (* z t)) 1e+109) (/ (* x y) a) (* x (/ y a))))
    assert(x < y && y < z && z < t && t < a);
    double code(double x, double y, double z, double t, double a) {
    	double tmp;
    	if (((x * y) - (z * t)) <= 1e+109) {
    		tmp = (x * y) / a;
    	} else {
    		tmp = x * (y / a);
    	}
    	return tmp;
    }
    
    NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
    real(8) function code(x, y, z, t, a)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        real(8), intent (in) :: z
        real(8), intent (in) :: t
        real(8), intent (in) :: a
        real(8) :: tmp
        if (((x * y) - (z * t)) <= 1d+109) then
            tmp = (x * y) / a
        else
            tmp = x * (y / a)
        end if
        code = tmp
    end function
    
    assert x < y && y < z && z < t && t < a;
    public static double code(double x, double y, double z, double t, double a) {
    	double tmp;
    	if (((x * y) - (z * t)) <= 1e+109) {
    		tmp = (x * y) / a;
    	} else {
    		tmp = x * (y / a);
    	}
    	return tmp;
    }
    
    [x, y, z, t, a] = sort([x, y, z, t, a])
    def code(x, y, z, t, a):
    	tmp = 0
    	if ((x * y) - (z * t)) <= 1e+109:
    		tmp = (x * y) / a
    	else:
    		tmp = x * (y / a)
    	return tmp
    
    x, y, z, t, a = sort([x, y, z, t, a])
    function code(x, y, z, t, a)
    	tmp = 0.0
    	if (Float64(Float64(x * y) - Float64(z * t)) <= 1e+109)
    		tmp = Float64(Float64(x * y) / a);
    	else
    		tmp = Float64(x * Float64(y / a));
    	end
    	return tmp
    end
    
    x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
    function tmp_2 = code(x, y, z, t, a)
    	tmp = 0.0;
    	if (((x * y) - (z * t)) <= 1e+109)
    		tmp = (x * y) / a;
    	else
    		tmp = x * (y / a);
    	end
    	tmp_2 = tmp;
    end
    
    NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
    code[x_, y_, z_, t_, a_] := If[LessEqual[N[(N[(x * y), $MachinePrecision] - N[(z * t), $MachinePrecision]), $MachinePrecision], 1e+109], N[(N[(x * y), $MachinePrecision] / a), $MachinePrecision], N[(x * N[(y / a), $MachinePrecision]), $MachinePrecision]]
    
    \begin{array}{l}
    [x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
    \\
    \begin{array}{l}
    \mathbf{if}\;x \cdot y - z \cdot t \leq 10^{+109}:\\
    \;\;\;\;\frac{x \cdot y}{a}\\
    
    \mathbf{else}:\\
    \;\;\;\;x \cdot \frac{y}{a}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if (-.f64 (*.f64 x y) (*.f64 z t)) < 9.99999999999999982e108

      1. Initial program 96.5%

        \[\frac{x \cdot y - z \cdot t}{a} \]
      2. Add Preprocessing
      3. Step-by-step derivation
        1. lift--.f64N/A

          \[\leadsto \frac{\color{blue}{x \cdot y - z \cdot t}}{a} \]
        2. lift-*.f64N/A

          \[\leadsto \frac{x \cdot y - \color{blue}{z \cdot t}}{a} \]
        3. fp-cancel-sub-sign-invN/A

          \[\leadsto \frac{\color{blue}{x \cdot y + \left(\mathsf{neg}\left(z\right)\right) \cdot t}}{a} \]
        4. unpow1N/A

          \[\leadsto \frac{\color{blue}{{\left(x \cdot y\right)}^{1}} + \left(\mathsf{neg}\left(z\right)\right) \cdot t}{a} \]
        5. metadata-evalN/A

          \[\leadsto \frac{{\left(x \cdot y\right)}^{\color{blue}{\left(\frac{2}{2}\right)}} + \left(\mathsf{neg}\left(z\right)\right) \cdot t}{a} \]
        6. sqrt-pow1N/A

          \[\leadsto \frac{\color{blue}{\sqrt{{\left(x \cdot y\right)}^{2}}} + \left(\mathsf{neg}\left(z\right)\right) \cdot t}{a} \]
        7. pow2N/A

          \[\leadsto \frac{\sqrt{\color{blue}{\left(x \cdot y\right) \cdot \left(x \cdot y\right)}} + \left(\mathsf{neg}\left(z\right)\right) \cdot t}{a} \]
        8. lift-*.f64N/A

          \[\leadsto \frac{\sqrt{\color{blue}{\left(x \cdot y\right)} \cdot \left(x \cdot y\right)} + \left(\mathsf{neg}\left(z\right)\right) \cdot t}{a} \]
        9. *-commutativeN/A

          \[\leadsto \frac{\sqrt{\color{blue}{\left(y \cdot x\right)} \cdot \left(x \cdot y\right)} + \left(\mathsf{neg}\left(z\right)\right) \cdot t}{a} \]
        10. associate-*l*N/A

          \[\leadsto \frac{\sqrt{\color{blue}{y \cdot \left(x \cdot \left(x \cdot y\right)\right)}} + \left(\mathsf{neg}\left(z\right)\right) \cdot t}{a} \]
        11. *-commutativeN/A

          \[\leadsto \frac{\sqrt{\color{blue}{\left(x \cdot \left(x \cdot y\right)\right) \cdot y}} + \left(\mathsf{neg}\left(z\right)\right) \cdot t}{a} \]
        12. sqrt-prodN/A

          \[\leadsto \frac{\color{blue}{\sqrt{x \cdot \left(x \cdot y\right)} \cdot \sqrt{y}} + \left(\mathsf{neg}\left(z\right)\right) \cdot t}{a} \]
        13. lower-fma.f64N/A

          \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\sqrt{x \cdot \left(x \cdot y\right)}, \sqrt{y}, \left(\mathsf{neg}\left(z\right)\right) \cdot t\right)}}{a} \]
        14. lower-sqrt.f64N/A

          \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{\sqrt{x \cdot \left(x \cdot y\right)}}, \sqrt{y}, \left(\mathsf{neg}\left(z\right)\right) \cdot t\right)}{a} \]
        15. lift-*.f64N/A

          \[\leadsto \frac{\mathsf{fma}\left(\sqrt{x \cdot \color{blue}{\left(x \cdot y\right)}}, \sqrt{y}, \left(\mathsf{neg}\left(z\right)\right) \cdot t\right)}{a} \]
        16. associate-*r*N/A

          \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\color{blue}{\left(x \cdot x\right) \cdot y}}, \sqrt{y}, \left(\mathsf{neg}\left(z\right)\right) \cdot t\right)}{a} \]
        17. lower-*.f64N/A

          \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\color{blue}{\left(x \cdot x\right) \cdot y}}, \sqrt{y}, \left(\mathsf{neg}\left(z\right)\right) \cdot t\right)}{a} \]
        18. lower-*.f64N/A

          \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\color{blue}{\left(x \cdot x\right)} \cdot y}, \sqrt{y}, \left(\mathsf{neg}\left(z\right)\right) \cdot t\right)}{a} \]
        19. lower-sqrt.f64N/A

          \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\left(x \cdot x\right) \cdot y}, \color{blue}{\sqrt{y}}, \left(\mathsf{neg}\left(z\right)\right) \cdot t\right)}{a} \]
        20. lower-*.f64N/A

          \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\left(x \cdot x\right) \cdot y}, \sqrt{y}, \color{blue}{\left(\mathsf{neg}\left(z\right)\right) \cdot t}\right)}{a} \]
        21. lower-neg.f6428.6

          \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\left(x \cdot x\right) \cdot y}, \sqrt{y}, \color{blue}{\left(-z\right)} \cdot t\right)}{a} \]
      4. Applied rewrites28.6%

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\sqrt{\left(x \cdot x\right) \cdot y}, \sqrt{y}, \left(-z\right) \cdot t\right)}}{a} \]
      5. Taylor expanded in y around -inf

        \[\leadsto \frac{\color{blue}{-1 \cdot \left(x \cdot \left(y \cdot {\left(\sqrt{-1}\right)}^{2}\right)\right)}}{a} \]
      6. Step-by-step derivation
        1. mul-1-negN/A

          \[\leadsto \frac{\color{blue}{\mathsf{neg}\left(x \cdot \left(y \cdot {\left(\sqrt{-1}\right)}^{2}\right)\right)}}{a} \]
        2. distribute-rgt-neg-inN/A

          \[\leadsto \frac{\color{blue}{x \cdot \left(\mathsf{neg}\left(y \cdot {\left(\sqrt{-1}\right)}^{2}\right)\right)}}{a} \]
        3. *-commutativeN/A

          \[\leadsto \frac{x \cdot \left(\mathsf{neg}\left(\color{blue}{{\left(\sqrt{-1}\right)}^{2} \cdot y}\right)\right)}{a} \]
        4. unpow2N/A

          \[\leadsto \frac{x \cdot \left(\mathsf{neg}\left(\color{blue}{\left(\sqrt{-1} \cdot \sqrt{-1}\right)} \cdot y\right)\right)}{a} \]
        5. rem-square-sqrtN/A

          \[\leadsto \frac{x \cdot \left(\mathsf{neg}\left(\color{blue}{-1} \cdot y\right)\right)}{a} \]
        6. mul-1-negN/A

          \[\leadsto \frac{x \cdot \left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(y\right)\right)}\right)\right)}{a} \]
        7. remove-double-negN/A

          \[\leadsto \frac{x \cdot \color{blue}{y}}{a} \]
        8. lower-*.f6452.1

          \[\leadsto \frac{\color{blue}{x \cdot y}}{a} \]
      7. Applied rewrites52.1%

        \[\leadsto \frac{\color{blue}{x \cdot y}}{a} \]

      if 9.99999999999999982e108 < (-.f64 (*.f64 x y) (*.f64 z t))

      1. Initial program 84.8%

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

        \[\leadsto \color{blue}{\frac{x \cdot y}{a}} \]
      4. Step-by-step derivation
        1. associate-*l/N/A

          \[\leadsto \color{blue}{\frac{x}{a} \cdot y} \]
        2. lower-*.f64N/A

          \[\leadsto \color{blue}{\frac{x}{a} \cdot y} \]
        3. lower-/.f6444.5

          \[\leadsto \color{blue}{\frac{x}{a}} \cdot y \]
      5. Applied rewrites44.5%

        \[\leadsto \color{blue}{\frac{x}{a} \cdot y} \]
      6. Step-by-step derivation
        1. Applied rewrites41.9%

          \[\leadsto x \cdot \color{blue}{\frac{y}{a}} \]
      7. Recombined 2 regimes into one program.
      8. Final simplification49.1%

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

      Alternative 8: 51.4% accurate, 1.1× speedup?

      \[\begin{array}{l} [x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\ \\ \begin{array}{l} \mathbf{if}\;x \leq 8.2 \cdot 10^{-262}:\\ \;\;\;\;x \cdot \frac{y}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{a} \cdot y\\ \end{array} \end{array} \]
      NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
      (FPCore (x y z t a)
       :precision binary64
       (if (<= x 8.2e-262) (* x (/ y a)) (* (/ x a) y)))
      assert(x < y && y < z && z < t && t < a);
      double code(double x, double y, double z, double t, double a) {
      	double tmp;
      	if (x <= 8.2e-262) {
      		tmp = x * (y / a);
      	} else {
      		tmp = (x / a) * y;
      	}
      	return tmp;
      }
      
      NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
      real(8) function code(x, y, z, t, a)
          real(8), intent (in) :: x
          real(8), intent (in) :: y
          real(8), intent (in) :: z
          real(8), intent (in) :: t
          real(8), intent (in) :: a
          real(8) :: tmp
          if (x <= 8.2d-262) then
              tmp = x * (y / a)
          else
              tmp = (x / a) * y
          end if
          code = tmp
      end function
      
      assert x < y && y < z && z < t && t < a;
      public static double code(double x, double y, double z, double t, double a) {
      	double tmp;
      	if (x <= 8.2e-262) {
      		tmp = x * (y / a);
      	} else {
      		tmp = (x / a) * y;
      	}
      	return tmp;
      }
      
      [x, y, z, t, a] = sort([x, y, z, t, a])
      def code(x, y, z, t, a):
      	tmp = 0
      	if x <= 8.2e-262:
      		tmp = x * (y / a)
      	else:
      		tmp = (x / a) * y
      	return tmp
      
      x, y, z, t, a = sort([x, y, z, t, a])
      function code(x, y, z, t, a)
      	tmp = 0.0
      	if (x <= 8.2e-262)
      		tmp = Float64(x * Float64(y / a));
      	else
      		tmp = Float64(Float64(x / a) * y);
      	end
      	return tmp
      end
      
      x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
      function tmp_2 = code(x, y, z, t, a)
      	tmp = 0.0;
      	if (x <= 8.2e-262)
      		tmp = x * (y / a);
      	else
      		tmp = (x / a) * y;
      	end
      	tmp_2 = tmp;
      end
      
      NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
      code[x_, y_, z_, t_, a_] := If[LessEqual[x, 8.2e-262], N[(x * N[(y / a), $MachinePrecision]), $MachinePrecision], N[(N[(x / a), $MachinePrecision] * y), $MachinePrecision]]
      
      \begin{array}{l}
      [x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
      \\
      \begin{array}{l}
      \mathbf{if}\;x \leq 8.2 \cdot 10^{-262}:\\
      \;\;\;\;x \cdot \frac{y}{a}\\
      
      \mathbf{else}:\\
      \;\;\;\;\frac{x}{a} \cdot y\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if x < 8.20000000000000052e-262

        1. Initial program 90.1%

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

          \[\leadsto \color{blue}{\frac{x \cdot y}{a}} \]
        4. Step-by-step derivation
          1. associate-*l/N/A

            \[\leadsto \color{blue}{\frac{x}{a} \cdot y} \]
          2. lower-*.f64N/A

            \[\leadsto \color{blue}{\frac{x}{a} \cdot y} \]
          3. lower-/.f6446.8

            \[\leadsto \color{blue}{\frac{x}{a}} \cdot y \]
        5. Applied rewrites46.8%

          \[\leadsto \color{blue}{\frac{x}{a} \cdot y} \]
        6. Step-by-step derivation
          1. Applied rewrites48.5%

            \[\leadsto x \cdot \color{blue}{\frac{y}{a}} \]

          if 8.20000000000000052e-262 < x

          1. Initial program 96.0%

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

            \[\leadsto \color{blue}{\frac{x \cdot y}{a}} \]
          4. Step-by-step derivation
            1. associate-*l/N/A

              \[\leadsto \color{blue}{\frac{x}{a} \cdot y} \]
            2. lower-*.f64N/A

              \[\leadsto \color{blue}{\frac{x}{a} \cdot y} \]
            3. lower-/.f6445.1

              \[\leadsto \color{blue}{\frac{x}{a}} \cdot y \]
          5. Applied rewrites45.1%

            \[\leadsto \color{blue}{\frac{x}{a} \cdot y} \]
        7. Recombined 2 regimes into one program.
        8. Final simplification46.8%

          \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 8.2 \cdot 10^{-262}:\\ \;\;\;\;x \cdot \frac{y}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{a} \cdot y\\ \end{array} \]
        9. Add Preprocessing

        Alternative 9: 51.3% accurate, 1.5× speedup?

        \[\begin{array}{l} [x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\ \\ x \cdot \frac{y}{a} \end{array} \]
        NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
        (FPCore (x y z t a) :precision binary64 (* x (/ y a)))
        assert(x < y && y < z && z < t && t < a);
        double code(double x, double y, double z, double t, double a) {
        	return x * (y / a);
        }
        
        NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
        real(8) function code(x, y, z, t, a)
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            real(8), intent (in) :: z
            real(8), intent (in) :: t
            real(8), intent (in) :: a
            code = x * (y / a)
        end function
        
        assert x < y && y < z && z < t && t < a;
        public static double code(double x, double y, double z, double t, double a) {
        	return x * (y / a);
        }
        
        [x, y, z, t, a] = sort([x, y, z, t, a])
        def code(x, y, z, t, a):
        	return x * (y / a)
        
        x, y, z, t, a = sort([x, y, z, t, a])
        function code(x, y, z, t, a)
        	return Float64(x * Float64(y / a))
        end
        
        x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
        function tmp = code(x, y, z, t, a)
        	tmp = x * (y / a);
        end
        
        NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
        code[x_, y_, z_, t_, a_] := N[(x * N[(y / a), $MachinePrecision]), $MachinePrecision]
        
        \begin{array}{l}
        [x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
        \\
        x \cdot \frac{y}{a}
        \end{array}
        
        Derivation
        1. Initial program 93.0%

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

          \[\leadsto \color{blue}{\frac{x \cdot y}{a}} \]
        4. Step-by-step derivation
          1. associate-*l/N/A

            \[\leadsto \color{blue}{\frac{x}{a} \cdot y} \]
          2. lower-*.f64N/A

            \[\leadsto \color{blue}{\frac{x}{a} \cdot y} \]
          3. lower-/.f6446.0

            \[\leadsto \color{blue}{\frac{x}{a}} \cdot y \]
        5. Applied rewrites46.0%

          \[\leadsto \color{blue}{\frac{x}{a} \cdot y} \]
        6. Step-by-step derivation
          1. Applied rewrites47.3%

            \[\leadsto x \cdot \color{blue}{\frac{y}{a}} \]
          2. Final simplification47.3%

            \[\leadsto x \cdot \frac{y}{a} \]
          3. Add Preprocessing

          Developer Target 1: 91.6% accurate, 0.5× speedup?

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

          Reproduce

          ?
          herbie shell --seed 2024320 
          (FPCore (x y z t a)
            :name "Data.Colour.Matrix:inverse from colour-2.3.3, B"
            :precision binary64
          
            :alt
            (! :herbie-platform default (if (< z -246868496869954800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (- (* (/ y a) x) (* (/ t a) z)) (if (< z 6309831121978371/100000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (/ (- (* x y) (* z t)) a) (- (* (/ y a) x) (* (/ t a) z)))))
          
            (/ (- (* x y) (* z t)) a))