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

Percentage Accurate: 91.6% → 93.6%
Time: 10.7s
Alternatives: 9
Speedup: 0.7×

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.6% 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: 93.6% accurate, 0.4× speedup?

\[\begin{array}{l} [x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\ \\ \begin{array}{l} t_1 := x \cdot y - z \cdot t\\ \mathbf{if}\;t\_1 \leq 10^{+283}:\\ \;\;\;\;\frac{t\_1}{a}\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(\frac{x}{a} - t \cdot \frac{z}{y \cdot 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
 (let* ((t_1 (- (* x y) (* z t))))
   (if (<= t_1 1e+283) (/ t_1 a) (* y (- (/ x a) (* t (/ z (* y 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 = (x * y) - (z * t);
	double tmp;
	if (t_1 <= 1e+283) {
		tmp = t_1 / a;
	} else {
		tmp = y * ((x / a) - (t * (z / (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) :: t_1
    real(8) :: tmp
    t_1 = (x * y) - (z * t)
    if (t_1 <= 1d+283) then
        tmp = t_1 / a
    else
        tmp = y * ((x / a) - (t * (z / (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 t_1 = (x * y) - (z * t);
	double tmp;
	if (t_1 <= 1e+283) {
		tmp = t_1 / a;
	} else {
		tmp = y * ((x / a) - (t * (z / (y * a))));
	}
	return tmp;
}
[x, y, z, t, a] = sort([x, y, z, t, a])
def code(x, y, z, t, a):
	t_1 = (x * y) - (z * t)
	tmp = 0
	if t_1 <= 1e+283:
		tmp = t_1 / a
	else:
		tmp = y * ((x / a) - (t * (z / (y * 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(x * y) - Float64(z * t))
	tmp = 0.0
	if (t_1 <= 1e+283)
		tmp = Float64(t_1 / a);
	else
		tmp = Float64(y * Float64(Float64(x / a) - Float64(t * Float64(z / 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)
	t_1 = (x * y) - (z * t);
	tmp = 0.0;
	if (t_1 <= 1e+283)
		tmp = t_1 / a;
	else
		tmp = y * ((x / a) - (t * (z / (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_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] - N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 1e+283], N[(t$95$1 / a), $MachinePrecision], N[(y * N[(N[(x / a), $MachinePrecision] - N[(t * N[(z / N[(y * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\begin{array}{l}
t_1 := x \cdot y - z \cdot t\\
\mathbf{if}\;t\_1 \leq 10^{+283}:\\
\;\;\;\;\frac{t\_1}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 (*.f64 x y) (*.f64 z t)) < 9.99999999999999955e282

    1. Initial program 97.7%

      \[\frac{x \cdot y - z \cdot t}{a} \]
    2. Add Preprocessing

    if 9.99999999999999955e282 < (-.f64 (*.f64 x y) (*.f64 z t))

    1. Initial program 69.0%

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

      \[\leadsto \frac{\color{blue}{x \cdot y}}{a} \]
    4. Step-by-step derivation
      1. lower-*.f6435.3

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

      \[\leadsto \frac{\color{blue}{x \cdot y}}{a} \]
    6. Taylor expanded in y around inf

      \[\leadsto \color{blue}{y \cdot \left(-1 \cdot \frac{t \cdot z}{a \cdot y} + \frac{x}{a}\right)} \]
    7. Step-by-step derivation
      1. lower-*.f64N/A

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

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

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

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

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

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

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

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

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

        \[\leadsto y \cdot \left(\frac{x}{a} - t \cdot \frac{z}{\color{blue}{y \cdot a}}\right) \]
      11. lower-*.f6496.1

        \[\leadsto y \cdot \left(\frac{x}{a} - t \cdot \frac{z}{\color{blue}{y \cdot a}}\right) \]
    8. Applied rewrites96.1%

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

Alternative 2: 72.2% accurate, 0.4× speedup?

\[\begin{array}{l} [x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\ \\ \begin{array}{l} t_1 := \frac{x \cdot y}{a}\\ \mathbf{if}\;x \cdot y \leq -5 \cdot 10^{-86}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{-31}:\\ \;\;\;\;\frac{z \cdot \left(-t\right)}{a}\\ \mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{+43}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{+111}:\\ \;\;\;\;t \cdot \frac{z}{-a}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(y \cdot \frac{1}{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
 (let* ((t_1 (/ (* x y) a)))
   (if (<= (* x y) -5e-86)
     t_1
     (if (<= (* x y) 2e-31)
       (/ (* z (- t)) a)
       (if (<= (* x y) 5e+43)
         t_1
         (if (<= (* x y) 5e+111) (* t (/ z (- a))) (* x (* y (/ 1.0 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 = (x * y) / a;
	double tmp;
	if ((x * y) <= -5e-86) {
		tmp = t_1;
	} else if ((x * y) <= 2e-31) {
		tmp = (z * -t) / a;
	} else if ((x * y) <= 5e+43) {
		tmp = t_1;
	} else if ((x * y) <= 5e+111) {
		tmp = t * (z / -a);
	} else {
		tmp = x * (y * (1.0 / 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 = (x * y) / a
    if ((x * y) <= (-5d-86)) then
        tmp = t_1
    else if ((x * y) <= 2d-31) then
        tmp = (z * -t) / a
    else if ((x * y) <= 5d+43) then
        tmp = t_1
    else if ((x * y) <= 5d+111) then
        tmp = t * (z / -a)
    else
        tmp = x * (y * (1.0d0 / 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 = (x * y) / a;
	double tmp;
	if ((x * y) <= -5e-86) {
		tmp = t_1;
	} else if ((x * y) <= 2e-31) {
		tmp = (z * -t) / a;
	} else if ((x * y) <= 5e+43) {
		tmp = t_1;
	} else if ((x * y) <= 5e+111) {
		tmp = t * (z / -a);
	} else {
		tmp = x * (y * (1.0 / a));
	}
	return tmp;
}
[x, y, z, t, a] = sort([x, y, z, t, a])
def code(x, y, z, t, a):
	t_1 = (x * y) / a
	tmp = 0
	if (x * y) <= -5e-86:
		tmp = t_1
	elif (x * y) <= 2e-31:
		tmp = (z * -t) / a
	elif (x * y) <= 5e+43:
		tmp = t_1
	elif (x * y) <= 5e+111:
		tmp = t * (z / -a)
	else:
		tmp = x * (y * (1.0 / 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(x * y) / a)
	tmp = 0.0
	if (Float64(x * y) <= -5e-86)
		tmp = t_1;
	elseif (Float64(x * y) <= 2e-31)
		tmp = Float64(Float64(z * Float64(-t)) / a);
	elseif (Float64(x * y) <= 5e+43)
		tmp = t_1;
	elseif (Float64(x * y) <= 5e+111)
		tmp = Float64(t * Float64(z / Float64(-a)));
	else
		tmp = Float64(x * Float64(y * Float64(1.0 / 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 = (x * y) / a;
	tmp = 0.0;
	if ((x * y) <= -5e-86)
		tmp = t_1;
	elseif ((x * y) <= 2e-31)
		tmp = (z * -t) / a;
	elseif ((x * y) <= 5e+43)
		tmp = t_1;
	elseif ((x * y) <= 5e+111)
		tmp = t * (z / -a);
	else
		tmp = x * (y * (1.0 / 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[(x * y), $MachinePrecision] / a), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -5e-86], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 2e-31], N[(N[(z * (-t)), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 5e+43], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 5e+111], N[(t * N[(z / (-a)), $MachinePrecision]), $MachinePrecision], N[(x * N[(y * N[(1.0 / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\begin{array}{l}
t_1 := \frac{x \cdot y}{a}\\
\mathbf{if}\;x \cdot y \leq -5 \cdot 10^{-86}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{+43}:\\
\;\;\;\;t\_1\\

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

\mathbf{else}:\\
\;\;\;\;x \cdot \left(y \cdot \frac{1}{a}\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 x y) < -4.9999999999999999e-86 or 2e-31 < (*.f64 x y) < 5.0000000000000004e43

    1. Initial program 95.7%

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

      \[\leadsto \frac{\color{blue}{x \cdot y}}{a} \]
    4. Step-by-step derivation
      1. lower-*.f6473.0

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

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

    if -4.9999999999999999e-86 < (*.f64 x y) < 2e-31

    1. Initial program 97.9%

      \[\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. mul-1-negN/A

        \[\leadsto \frac{\color{blue}{\mathsf{neg}\left(t \cdot z\right)}}{a} \]
      2. distribute-rgt-neg-inN/A

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

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

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

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

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

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

    if 5.0000000000000004e43 < (*.f64 x y) < 4.9999999999999997e111

    1. Initial program 85.2%

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

      \[\leadsto \frac{\color{blue}{x \cdot y}}{a} \]
    4. Step-by-step derivation
      1. lower-*.f6432.3

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

      \[\leadsto \frac{\color{blue}{x \cdot y}}{a} \]
    6. Taylor expanded in x around 0

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{z \cdot \frac{t}{-a}} \]
    9. Step-by-step derivation
      1. Applied rewrites70.5%

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

      if 4.9999999999999997e111 < (*.f64 x y)

      1. Initial program 87.5%

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

        \[\leadsto \frac{\color{blue}{x \cdot y}}{a} \]
      4. Step-by-step derivation
        1. lower-*.f6476.3

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

        \[\leadsto \frac{\color{blue}{x \cdot y}}{a} \]
      6. Taylor expanded in x around 0

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

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

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

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

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

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

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

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

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

          \[\leadsto z \cdot \frac{t}{\color{blue}{\mathsf{neg}\left(a\right)}} \]
        10. lower-neg.f6419.4

          \[\leadsto z \cdot \frac{t}{\color{blue}{-a}} \]
      8. Applied rewrites19.4%

        \[\leadsto \color{blue}{z \cdot \frac{t}{-a}} \]
      9. Taylor expanded in x around inf

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

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

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

          \[\leadsto x \cdot \color{blue}{\frac{y}{a}} \]
      11. Applied rewrites82.3%

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

          \[\leadsto x \cdot \left(\frac{1}{a} \cdot \color{blue}{y}\right) \]
      13. Recombined 4 regimes into one program.
      14. Final simplification80.4%

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

      Alternative 3: 72.2% accurate, 0.4× speedup?

      \[\begin{array}{l} [x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\ \\ \begin{array}{l} t_1 := \frac{x \cdot y}{a}\\ \mathbf{if}\;x \cdot y \leq -5 \cdot 10^{-86}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{-31}:\\ \;\;\;\;\frac{z \cdot \left(-t\right)}{a}\\ \mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{+43}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{+111}:\\ \;\;\;\;t \cdot \frac{z}{-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
       (let* ((t_1 (/ (* x y) a)))
         (if (<= (* x y) -5e-86)
           t_1
           (if (<= (* x y) 2e-31)
             (/ (* z (- t)) a)
             (if (<= (* x y) 5e+43)
               t_1
               (if (<= (* x y) 5e+111) (* t (/ z (- 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 t_1 = (x * y) / a;
      	double tmp;
      	if ((x * y) <= -5e-86) {
      		tmp = t_1;
      	} else if ((x * y) <= 2e-31) {
      		tmp = (z * -t) / a;
      	} else if ((x * y) <= 5e+43) {
      		tmp = t_1;
      	} else if ((x * y) <= 5e+111) {
      		tmp = t * (z / -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) :: t_1
          real(8) :: tmp
          t_1 = (x * y) / a
          if ((x * y) <= (-5d-86)) then
              tmp = t_1
          else if ((x * y) <= 2d-31) then
              tmp = (z * -t) / a
          else if ((x * y) <= 5d+43) then
              tmp = t_1
          else if ((x * y) <= 5d+111) then
              tmp = t * (z / -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 t_1 = (x * y) / a;
      	double tmp;
      	if ((x * y) <= -5e-86) {
      		tmp = t_1;
      	} else if ((x * y) <= 2e-31) {
      		tmp = (z * -t) / a;
      	} else if ((x * y) <= 5e+43) {
      		tmp = t_1;
      	} else if ((x * y) <= 5e+111) {
      		tmp = t * (z / -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):
      	t_1 = (x * y) / a
      	tmp = 0
      	if (x * y) <= -5e-86:
      		tmp = t_1
      	elif (x * y) <= 2e-31:
      		tmp = (z * -t) / a
      	elif (x * y) <= 5e+43:
      		tmp = t_1
      	elif (x * y) <= 5e+111:
      		tmp = t * (z / -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)
      	t_1 = Float64(Float64(x * y) / a)
      	tmp = 0.0
      	if (Float64(x * y) <= -5e-86)
      		tmp = t_1;
      	elseif (Float64(x * y) <= 2e-31)
      		tmp = Float64(Float64(z * Float64(-t)) / a);
      	elseif (Float64(x * y) <= 5e+43)
      		tmp = t_1;
      	elseif (Float64(x * y) <= 5e+111)
      		tmp = Float64(t * Float64(z / Float64(-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)
      	t_1 = (x * y) / a;
      	tmp = 0.0;
      	if ((x * y) <= -5e-86)
      		tmp = t_1;
      	elseif ((x * y) <= 2e-31)
      		tmp = (z * -t) / a;
      	elseif ((x * y) <= 5e+43)
      		tmp = t_1;
      	elseif ((x * y) <= 5e+111)
      		tmp = t * (z / -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_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] / a), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -5e-86], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 2e-31], N[(N[(z * (-t)), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 5e+43], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 5e+111], N[(t * N[(z / (-a)), $MachinePrecision]), $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}
      t_1 := \frac{x \cdot y}{a}\\
      \mathbf{if}\;x \cdot y \leq -5 \cdot 10^{-86}:\\
      \;\;\;\;t\_1\\
      
      \mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{-31}:\\
      \;\;\;\;\frac{z \cdot \left(-t\right)}{a}\\
      
      \mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{+43}:\\
      \;\;\;\;t\_1\\
      
      \mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{+111}:\\
      \;\;\;\;t \cdot \frac{z}{-a}\\
      
      \mathbf{else}:\\
      \;\;\;\;x \cdot \frac{y}{a}\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 4 regimes
      2. if (*.f64 x y) < -4.9999999999999999e-86 or 2e-31 < (*.f64 x y) < 5.0000000000000004e43

        1. Initial program 95.7%

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

          \[\leadsto \frac{\color{blue}{x \cdot y}}{a} \]
        4. Step-by-step derivation
          1. lower-*.f6473.0

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

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

        if -4.9999999999999999e-86 < (*.f64 x y) < 2e-31

        1. Initial program 97.9%

          \[\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. mul-1-negN/A

            \[\leadsto \frac{\color{blue}{\mathsf{neg}\left(t \cdot z\right)}}{a} \]
          2. distribute-rgt-neg-inN/A

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

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

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

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

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

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

        if 5.0000000000000004e43 < (*.f64 x y) < 4.9999999999999997e111

        1. Initial program 85.2%

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

          \[\leadsto \frac{\color{blue}{x \cdot y}}{a} \]
        4. Step-by-step derivation
          1. lower-*.f6432.3

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

          \[\leadsto \frac{\color{blue}{x \cdot y}}{a} \]
        6. Taylor expanded in x around 0

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \color{blue}{z \cdot \frac{t}{-a}} \]
        9. Step-by-step derivation
          1. Applied rewrites70.5%

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

          if 4.9999999999999997e111 < (*.f64 x y)

          1. Initial program 87.5%

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

            \[\leadsto \frac{\color{blue}{x \cdot y}}{a} \]
          4. Step-by-step derivation
            1. lower-*.f6476.3

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

            \[\leadsto \frac{\color{blue}{x \cdot y}}{a} \]
          6. Taylor expanded in x around 0

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

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

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

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

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

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

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

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

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

              \[\leadsto z \cdot \frac{t}{\color{blue}{\mathsf{neg}\left(a\right)}} \]
            10. lower-neg.f6419.4

              \[\leadsto z \cdot \frac{t}{\color{blue}{-a}} \]
          8. Applied rewrites19.4%

            \[\leadsto \color{blue}{z \cdot \frac{t}{-a}} \]
          9. Taylor expanded in x around inf

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

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

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

              \[\leadsto x \cdot \color{blue}{\frac{y}{a}} \]
          11. Applied rewrites82.3%

            \[\leadsto \color{blue}{x \cdot \frac{y}{a}} \]
        10. Recombined 4 regimes into one program.
        11. Final simplification80.4%

          \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -5 \cdot 10^{-86}:\\ \;\;\;\;\frac{x \cdot y}{a}\\ \mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{-31}:\\ \;\;\;\;\frac{z \cdot \left(-t\right)}{a}\\ \mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{+43}:\\ \;\;\;\;\frac{x \cdot y}{a}\\ \mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{+111}:\\ \;\;\;\;t \cdot \frac{z}{-a}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{y}{a}\\ \end{array} \]
        12. Add Preprocessing

        Alternative 4: 94.5% accurate, 0.5× speedup?

        \[\begin{array}{l} [x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\ \\ \begin{array}{l} t_1 := x \cdot y - z \cdot t\\ \mathbf{if}\;t\_1 \leq 5 \cdot 10^{+262}:\\ \;\;\;\;\frac{t\_1}{a}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{y}{a}, x, t \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
         (let* ((t_1 (- (* x y) (* z t))))
           (if (<= t_1 5e+262) (/ t_1 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 t_1 = (x * y) - (z * t);
        	double tmp;
        	if (t_1 <= 5e+262) {
        		tmp = t_1 / 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)
        	t_1 = Float64(Float64(x * y) - Float64(z * t))
        	tmp = 0.0
        	if (t_1 <= 5e+262)
        		tmp = Float64(t_1 / a);
        	else
        		tmp = fma(Float64(y / a), x, Float64(t * Float64(z / Float64(-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_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] - N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 5e+262], N[(t$95$1 / 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}
        t_1 := x \cdot y - z \cdot t\\
        \mathbf{if}\;t\_1 \leq 5 \cdot 10^{+262}:\\
        \;\;\;\;\frac{t\_1}{a}\\
        
        \mathbf{else}:\\
        \;\;\;\;\mathsf{fma}\left(\frac{y}{a}, x, t \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)) < 5.00000000000000008e262

          1. Initial program 97.6%

            \[\frac{x \cdot y - z \cdot t}{a} \]
          2. Add Preprocessing

          if 5.00000000000000008e262 < (-.f64 (*.f64 x y) (*.f64 z t))

          1. Initial program 74.6%

            \[\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. sub-negN/A

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

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

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

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

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

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

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

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

            \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y}{a}, x, -\frac{z \cdot t}{a}\right)} \]
          5. Step-by-step derivation
            1. lift-neg.f64N/A

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

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

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

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

              \[\leadsto \mathsf{fma}\left(\frac{y}{a}, x, \mathsf{neg}\left(\color{blue}{t \cdot \frac{z}{a}}\right)\right) \]
            6. distribute-lft-neg-inN/A

              \[\leadsto \mathsf{fma}\left(\frac{y}{a}, x, \color{blue}{\left(\mathsf{neg}\left(t\right)\right) \cdot \frac{z}{a}}\right) \]
            7. 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) \]
            8. lower-neg.f64N/A

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

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

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

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

        Alternative 5: 52.6% accurate, 0.5× speedup?

        \[\begin{array}{l} [x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\ \\ \begin{array}{l} \mathbf{if}\;\frac{x \cdot y - z \cdot t}{a} \leq 10^{+268}:\\ \;\;\;\;\frac{x \cdot y}{a}\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{x}{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)) a) 1e+268) (/ (* x y) a) (* y (/ x 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)) / a) <= 1e+268) {
        		tmp = (x * y) / a;
        	} else {
        		tmp = y * (x / 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)) / a) <= 1d+268) then
                tmp = (x * y) / a
            else
                tmp = y * (x / 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)) / a) <= 1e+268) {
        		tmp = (x * y) / a;
        	} else {
        		tmp = y * (x / 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)) / a) <= 1e+268:
        		tmp = (x * y) / a
        	else:
        		tmp = y * (x / 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(Float64(x * y) - Float64(z * t)) / a) <= 1e+268)
        		tmp = Float64(Float64(x * y) / a);
        	else
        		tmp = Float64(y * Float64(x / 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)) / a) <= 1e+268)
        		tmp = (x * y) / a;
        	else
        		tmp = y * (x / 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[(N[(x * y), $MachinePrecision] - N[(z * t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], 1e+268], N[(N[(x * y), $MachinePrecision] / a), $MachinePrecision], N[(y * N[(x / a), $MachinePrecision]), $MachinePrecision]]
        
        \begin{array}{l}
        [x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
        \\
        \begin{array}{l}
        \mathbf{if}\;\frac{x \cdot y - z \cdot t}{a} \leq 10^{+268}:\\
        \;\;\;\;\frac{x \cdot y}{a}\\
        
        \mathbf{else}:\\
        \;\;\;\;y \cdot \frac{x}{a}\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if (/.f64 (-.f64 (*.f64 x y) (*.f64 z t)) a) < 9.9999999999999997e267

          1. Initial program 95.9%

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

            \[\leadsto \frac{\color{blue}{x \cdot y}}{a} \]
          4. Step-by-step derivation
            1. lower-*.f6453.5

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

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

          if 9.9999999999999997e267 < (/.f64 (-.f64 (*.f64 x y) (*.f64 z t)) a)

          1. Initial program 87.4%

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

            \[\leadsto \frac{\color{blue}{x \cdot y}}{a} \]
          4. Step-by-step derivation
            1. lower-*.f6444.5

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

            \[\leadsto \frac{\color{blue}{x \cdot y}}{a} \]
          6. Taylor expanded in x around 0

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \color{blue}{z \cdot \frac{t}{-a}} \]
          9. Taylor expanded in x around inf

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

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

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

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

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

              \[\leadsto y \cdot \color{blue}{\frac{x}{a}} \]
          13. Recombined 2 regimes into one program.
          14. Add Preprocessing

          Alternative 6: 72.4% 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^{-103}:\\ \;\;\;\;t \cdot \frac{z}{-a}\\ \mathbf{elif}\;z \cdot t \leq 5 \cdot 10^{+101}:\\ \;\;\;\;\frac{x \cdot y}{a}\\ \mathbf{else}:\\ \;\;\;\;z \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-103)
             (* t (/ z (- a)))
             (if (<= (* z t) 5e+101) (/ (* 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-103) {
          		tmp = t * (z / -a);
          	} else if ((z * t) <= 5e+101) {
          		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-103)) then
                  tmp = t * (z / -a)
              else if ((z * t) <= 5d+101) 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-103) {
          		tmp = t * (z / -a);
          	} else if ((z * t) <= 5e+101) {
          		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-103:
          		tmp = t * (z / -a)
          	elif (z * t) <= 5e+101:
          		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-103)
          		tmp = Float64(t * Float64(z / Float64(-a)));
          	elseif (Float64(z * t) <= 5e+101)
          		tmp = Float64(Float64(x * y) / a);
          	else
          		tmp = Float64(z * Float64(t / Float64(-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-103)
          		tmp = t * (z / -a);
          	elseif ((z * t) <= 5e+101)
          		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-103], N[(t * N[(z / (-a)), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(z * t), $MachinePrecision], 5e+101], 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^{-103}:\\
          \;\;\;\;t \cdot \frac{z}{-a}\\
          
          \mathbf{elif}\;z \cdot t \leq 5 \cdot 10^{+101}:\\
          \;\;\;\;\frac{x \cdot y}{a}\\
          
          \mathbf{else}:\\
          \;\;\;\;z \cdot \frac{t}{-a}\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 3 regimes
          2. if (*.f64 z t) < -9.99999999999999958e-104

            1. Initial program 93.7%

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

              \[\leadsto \frac{\color{blue}{x \cdot y}}{a} \]
            4. Step-by-step derivation
              1. lower-*.f6427.8

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

              \[\leadsto \frac{\color{blue}{x \cdot y}}{a} \]
            6. Taylor expanded in x around 0

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

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

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

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

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

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

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

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

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

                \[\leadsto z \cdot \frac{t}{\color{blue}{\mathsf{neg}\left(a\right)}} \]
              10. lower-neg.f6473.9

                \[\leadsto z \cdot \frac{t}{\color{blue}{-a}} \]
            8. Applied rewrites73.9%

              \[\leadsto \color{blue}{z \cdot \frac{t}{-a}} \]
            9. Step-by-step derivation
              1. Applied rewrites68.0%

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

              if -9.99999999999999958e-104 < (*.f64 z t) < 4.99999999999999989e101

              1. Initial program 96.2%

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

                \[\leadsto \frac{\color{blue}{x \cdot y}}{a} \]
              4. Step-by-step derivation
                1. lower-*.f6476.0

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

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

              if 4.99999999999999989e101 < (*.f64 z t)

              1. Initial program 91.4%

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

                \[\leadsto \frac{\color{blue}{x \cdot y}}{a} \]
              4. Step-by-step derivation
                1. lower-*.f6420.5

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

                \[\leadsto \frac{\color{blue}{x \cdot y}}{a} \]
              6. Taylor expanded in x around 0

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

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

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

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

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

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

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

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

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

                  \[\leadsto z \cdot \frac{t}{\color{blue}{\mathsf{neg}\left(a\right)}} \]
                10. lower-neg.f6484.4

                  \[\leadsto z \cdot \frac{t}{\color{blue}{-a}} \]
              8. Applied rewrites84.4%

                \[\leadsto \color{blue}{z \cdot \frac{t}{-a}} \]
            10. Recombined 3 regimes into one program.
            11. Final simplification75.0%

              \[\leadsto \begin{array}{l} \mathbf{if}\;z \cdot t \leq -1 \cdot 10^{-103}:\\ \;\;\;\;t \cdot \frac{z}{-a}\\ \mathbf{elif}\;z \cdot t \leq 5 \cdot 10^{+101}:\\ \;\;\;\;\frac{x \cdot y}{a}\\ \mathbf{else}:\\ \;\;\;\;z \cdot \frac{t}{-a}\\ \end{array} \]
            12. Add Preprocessing

            Alternative 7: 72.4% accurate, 0.6× speedup?

            \[\begin{array}{l} [x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\ \\ \begin{array}{l} t_1 := z \cdot \frac{t}{-a}\\ \mathbf{if}\;z \cdot t \leq -1 \cdot 10^{-103}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \cdot t \leq 5 \cdot 10^{+101}:\\ \;\;\;\;\frac{x \cdot y}{a}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \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-103) t_1 (if (<= (* z t) 5e+101) (/ (* x y) a) t_1))))
            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-103) {
            		tmp = t_1;
            	} else if ((z * t) <= 5e+101) {
            		tmp = (x * y) / a;
            	} else {
            		tmp = t_1;
            	}
            	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-103)) then
                    tmp = t_1
                else if ((z * t) <= 5d+101) then
                    tmp = (x * y) / a
                else
                    tmp = t_1
                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-103) {
            		tmp = t_1;
            	} else if ((z * t) <= 5e+101) {
            		tmp = (x * y) / a;
            	} else {
            		tmp = t_1;
            	}
            	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-103:
            		tmp = t_1
            	elif (z * t) <= 5e+101:
            		tmp = (x * y) / a
            	else:
            		tmp = t_1
            	return tmp
            
            x, y, z, t, a = sort([x, y, z, t, a])
            function code(x, y, z, t, a)
            	t_1 = Float64(z * Float64(t / Float64(-a)))
            	tmp = 0.0
            	if (Float64(z * t) <= -1e-103)
            		tmp = t_1;
            	elseif (Float64(z * t) <= 5e+101)
            		tmp = Float64(Float64(x * y) / a);
            	else
            		tmp = t_1;
            	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-103)
            		tmp = t_1;
            	elseif ((z * t) <= 5e+101)
            		tmp = (x * y) / a;
            	else
            		tmp = t_1;
            	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[(z * N[(t / (-a)), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(z * t), $MachinePrecision], -1e-103], t$95$1, If[LessEqual[N[(z * t), $MachinePrecision], 5e+101], N[(N[(x * y), $MachinePrecision] / a), $MachinePrecision], t$95$1]]]
            
            \begin{array}{l}
            [x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
            \\
            \begin{array}{l}
            t_1 := z \cdot \frac{t}{-a}\\
            \mathbf{if}\;z \cdot t \leq -1 \cdot 10^{-103}:\\
            \;\;\;\;t\_1\\
            
            \mathbf{elif}\;z \cdot t \leq 5 \cdot 10^{+101}:\\
            \;\;\;\;\frac{x \cdot y}{a}\\
            
            \mathbf{else}:\\
            \;\;\;\;t\_1\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if (*.f64 z t) < -9.99999999999999958e-104 or 4.99999999999999989e101 < (*.f64 z t)

              1. Initial program 92.9%

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

                \[\leadsto \frac{\color{blue}{x \cdot y}}{a} \]
              4. Step-by-step derivation
                1. lower-*.f6425.1

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

                \[\leadsto \frac{\color{blue}{x \cdot y}}{a} \]
              6. Taylor expanded in x around 0

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

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

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

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

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

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

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

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

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

                  \[\leadsto z \cdot \frac{t}{\color{blue}{\mathsf{neg}\left(a\right)}} \]
                10. lower-neg.f6477.7

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

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

              if -9.99999999999999958e-104 < (*.f64 z t) < 4.99999999999999989e101

              1. Initial program 96.2%

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

                \[\leadsto \frac{\color{blue}{x \cdot y}}{a} \]
              4. Step-by-step derivation
                1. lower-*.f6476.0

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

                \[\leadsto \frac{\color{blue}{x \cdot y}}{a} \]
            3. Recombined 2 regimes into one program.
            4. Add Preprocessing

            Alternative 8: 93.3% 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 \leq 4 \cdot 10^{+303}:\\ \;\;\;\;\frac{x \cdot y - z \cdot t}{a}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(y \cdot \frac{1}{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) 4e+303) (/ (- (* x y) (* z t)) a) (* x (* y (/ 1.0 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) <= 4e+303) {
            		tmp = ((x * y) - (z * t)) / a;
            	} else {
            		tmp = x * (y * (1.0 / 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) <= 4d+303) then
                    tmp = ((x * y) - (z * t)) / a
                else
                    tmp = x * (y * (1.0d0 / 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) <= 4e+303) {
            		tmp = ((x * y) - (z * t)) / a;
            	} else {
            		tmp = x * (y * (1.0 / 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) <= 4e+303:
            		tmp = ((x * y) - (z * t)) / a
            	else:
            		tmp = x * (y * (1.0 / 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(x * y) <= 4e+303)
            		tmp = Float64(Float64(Float64(x * y) - Float64(z * t)) / a);
            	else
            		tmp = Float64(x * Float64(y * Float64(1.0 / 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) <= 4e+303)
            		tmp = ((x * y) - (z * t)) / a;
            	else
            		tmp = x * (y * (1.0 / 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[(x * y), $MachinePrecision], 4e+303], N[(N[(N[(x * y), $MachinePrecision] - N[(z * t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], N[(x * N[(y * N[(1.0 / 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 \leq 4 \cdot 10^{+303}:\\
            \;\;\;\;\frac{x \cdot y - z \cdot t}{a}\\
            
            \mathbf{else}:\\
            \;\;\;\;x \cdot \left(y \cdot \frac{1}{a}\right)\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if (*.f64 x y) < 4e303

              1. Initial program 96.3%

                \[\frac{x \cdot y - z \cdot t}{a} \]
              2. Add Preprocessing

              if 4e303 < (*.f64 x y)

              1. Initial program 57.7%

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

                \[\leadsto \frac{\color{blue}{x \cdot y}}{a} \]
              4. Step-by-step derivation
                1. lower-*.f6457.7

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

                \[\leadsto \frac{\color{blue}{x \cdot y}}{a} \]
              6. Taylor expanded in x around 0

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \color{blue}{z \cdot \frac{t}{-a}} \]
              9. Taylor expanded in x around inf

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

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

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

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

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

                  \[\leadsto x \cdot \left(\frac{1}{a} \cdot \color{blue}{y}\right) \]
              13. Recombined 2 regimes into one program.
              14. Final simplification96.5%

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

              Alternative 9: 51.7% 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 94.7%

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

                \[\leadsto \frac{\color{blue}{x \cdot y}}{a} \]
              4. Step-by-step derivation
                1. lower-*.f6452.2

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

                \[\leadsto \frac{\color{blue}{x \cdot y}}{a} \]
              6. Taylor expanded in x around 0

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \color{blue}{z \cdot \frac{t}{-a}} \]
              9. Taylor expanded in x around inf

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

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

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

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

                \[\leadsto \color{blue}{x \cdot \frac{y}{a}} \]
              12. Add Preprocessing

              Developer Target 1: 90.8% 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 2024238 
              (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))