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

Percentage Accurate: 90.9% → 96.7%
Time: 7.4s
Alternatives: 10
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 10 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 90.9% 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: 96.7% accurate, 0.3× speedup?

\[\begin{array}{l} [x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\ \\ \begin{array}{l} t_1 := \left(-t\right) \cdot \frac{z}{a}\\ t_2 := x \cdot y - z \cdot t\\ \mathbf{if}\;t\_2 \leq -\infty:\\ \;\;\;\;\mathsf{fma}\left(\frac{y}{a}, x, t\_1\right)\\ \mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+185}:\\ \;\;\;\;\frac{t\_2}{a}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{x}{a}, y, t\_1\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 (* (- t) (/ z a))) (t_2 (- (* x y) (* z t))))
   (if (<= t_2 (- INFINITY))
     (fma (/ y a) x t_1)
     (if (<= t_2 2e+185) (/ t_2 a) (fma (/ x a) y 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 = -t * (z / a);
	double t_2 = (x * y) - (z * t);
	double tmp;
	if (t_2 <= -((double) INFINITY)) {
		tmp = fma((y / a), x, t_1);
	} else if (t_2 <= 2e+185) {
		tmp = t_2 / a;
	} else {
		tmp = fma((x / a), y, 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(Float64(-t) * Float64(z / a))
	t_2 = Float64(Float64(x * y) - Float64(z * t))
	tmp = 0.0
	if (t_2 <= Float64(-Inf))
		tmp = fma(Float64(y / a), x, t_1);
	elseif (t_2 <= 2e+185)
		tmp = Float64(t_2 / a);
	else
		tmp = fma(Float64(x / a), y, t_1);
	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[((-t) * N[(z / a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * y), $MachinePrecision] - N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(N[(y / a), $MachinePrecision] * x + t$95$1), $MachinePrecision], If[LessEqual[t$95$2, 2e+185], N[(t$95$2 / a), $MachinePrecision], N[(N[(x / a), $MachinePrecision] * y + t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\begin{array}{l}
t_1 := \left(-t\right) \cdot \frac{z}{a}\\
t_2 := x \cdot y - z \cdot t\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{a}, x, t\_1\right)\\

\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+185}:\\
\;\;\;\;\frac{t\_2}{a}\\

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


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

    1. Initial program 72.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. lift-*.f64N/A

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

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

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

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

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

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

    if -inf.0 < (-.f64 (*.f64 x y) (*.f64 z t)) < 2e185

    1. Initial program 98.5%

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

    if 2e185 < (-.f64 (*.f64 x y) (*.f64 z t))

    1. Initial program 85.1%

      \[\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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 96.7% accurate, 0.3× 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 -\infty \lor \neg \left(t\_1 \leq 2 \cdot 10^{+185}\right):\\ \;\;\;\;\mathsf{fma}\left(\frac{x}{a}, y, \left(-t\right) \cdot \frac{z}{a}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{t\_1}{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) (* z t))))
   (if (or (<= t_1 (- INFINITY)) (not (<= t_1 2e+185)))
     (fma (/ x a) y (* (- t) (/ z a)))
     (/ t_1 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 <= -((double) INFINITY)) || !(t_1 <= 2e+185)) {
		tmp = fma((x / a), y, (-t * (z / a)));
	} else {
		tmp = t_1 / 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 <= Float64(-Inf)) || !(t_1 <= 2e+185))
		tmp = fma(Float64(x / a), y, Float64(Float64(-t) * Float64(z / a)));
	else
		tmp = Float64(t_1 / 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[Or[LessEqual[t$95$1, (-Infinity)], N[Not[LessEqual[t$95$1, 2e+185]], $MachinePrecision]], N[(N[(x / a), $MachinePrecision] * y + N[((-t) * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 / a), $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 -\infty \lor \neg \left(t\_1 \leq 2 \cdot 10^{+185}\right):\\
\;\;\;\;\mathsf{fma}\left(\frac{x}{a}, y, \left(-t\right) \cdot \frac{z}{a}\right)\\

\mathbf{else}:\\
\;\;\;\;\frac{t\_1}{a}\\


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

    1. Initial program 81.1%

      \[\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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -inf.0 < (-.f64 (*.f64 x y) (*.f64 z t)) < 2e185

    1. Initial program 98.5%

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

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

Alternative 3: 94.5% accurate, 0.4× 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 -2 \cdot 10^{+246}:\\ \;\;\;\;\frac{y}{\frac{a}{x}}\\ \mathbf{elif}\;x \cdot y \leq 10^{+238}:\\ \;\;\;\;\frac{x \cdot y - z \cdot t}{a}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{-t}{a}, z, \frac{y}{a} \cdot x\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) -2e+246)
   (/ y (/ a x))
   (if (<= (* x y) 1e+238)
     (/ (- (* x y) (* z t)) a)
     (fma (/ (- t) a) z (* (/ y a) x)))))
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) <= -2e+246) {
		tmp = y / (a / x);
	} else if ((x * y) <= 1e+238) {
		tmp = ((x * y) - (z * t)) / a;
	} else {
		tmp = fma((-t / a), z, ((y / a) * x));
	}
	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) <= -2e+246)
		tmp = Float64(y / Float64(a / x));
	elseif (Float64(x * y) <= 1e+238)
		tmp = Float64(Float64(Float64(x * y) - Float64(z * t)) / a);
	else
		tmp = fma(Float64(Float64(-t) / a), z, Float64(Float64(y / a) * x));
	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[(x * y), $MachinePrecision], -2e+246], N[(y / N[(a / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1e+238], N[(N[(N[(x * y), $MachinePrecision] - N[(z * t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], N[(N[((-t) / a), $MachinePrecision] * z + N[(N[(y / a), $MachinePrecision] * x), $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 -2 \cdot 10^{+246}:\\
\;\;\;\;\frac{y}{\frac{a}{x}}\\

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

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


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

    1. Initial program 61.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. lower-/.f64N/A

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

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

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

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

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

      if -2.00000000000000014e246 < (*.f64 x y) < 1e238

      1. Initial program 97.5%

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

      if 1e238 < (*.f64 x y)

      1. Initial program 75.5%

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

          \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(\left(x \cdot y - z \cdot t\right)\right)}{\mathsf{neg}\left(a\right)}} \]
        3. div-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(-y, x, t \cdot z\right) \cdot \color{blue}{\frac{\frac{1}{-1}}{a}} \]
        19. metadata-evalN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(x, \frac{y}{a}, \color{blue}{\left(z \cdot t\right)} \cdot \frac{-1}{a}\right) \]
        18. lower-*.f6491.7

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    Alternative 4: 74.7% 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 -2 \cdot 10^{+40} \lor \neg \left(z \cdot t \leq 10^{+14}\right):\\ \;\;\;\;z \cdot \frac{-t}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{y \cdot 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 (or (<= (* z t) -2e+40) (not (<= (* z t) 1e+14)))
       (* z (/ (- t) 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 (((z * t) <= -2e+40) || !((z * t) <= 1e+14)) {
    		tmp = z * (-t / 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 (((z * t) <= (-2d+40)) .or. (.not. ((z * t) <= 1d+14))) then
            tmp = z * (-t / 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 (((z * t) <= -2e+40) || !((z * t) <= 1e+14)) {
    		tmp = z * (-t / 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 ((z * t) <= -2e+40) or not ((z * t) <= 1e+14):
    		tmp = z * (-t / 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(z * t) <= -2e+40) || !(Float64(z * t) <= 1e+14))
    		tmp = Float64(z * Float64(Float64(-t) / a));
    	else
    		tmp = Float64(Float64(y * 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 (((z * t) <= -2e+40) || ~(((z * t) <= 1e+14)))
    		tmp = z * (-t / 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[Or[LessEqual[N[(z * t), $MachinePrecision], -2e+40], N[Not[LessEqual[N[(z * t), $MachinePrecision], 1e+14]], $MachinePrecision]], N[(z * N[((-t) / a), $MachinePrecision]), $MachinePrecision], N[(N[(y * x), $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 -2 \cdot 10^{+40} \lor \neg \left(z \cdot t \leq 10^{+14}\right):\\
    \;\;\;\;z \cdot \frac{-t}{a}\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{y \cdot x}{a}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if (*.f64 z t) < -2.00000000000000006e40 or 1e14 < (*.f64 z t)

      1. Initial program 90.8%

        \[\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-/.f6482.8

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

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

      if -2.00000000000000006e40 < (*.f64 z t) < 1e14

      1. Initial program 95.5%

        \[\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. lower-/.f64N/A

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

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

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

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

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

    Alternative 5: 74.6% 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 -2 \cdot 10^{+40} \lor \neg \left(z \cdot t \leq 2 \cdot 10^{-22}\right):\\ \;\;\;\;\frac{-z}{a} \cdot t\\ \mathbf{else}:\\ \;\;\;\;\frac{y \cdot 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 (or (<= (* z t) -2e+40) (not (<= (* z t) 2e-22)))
       (* (/ (- z) a) t)
       (/ (* 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 (((z * t) <= -2e+40) || !((z * t) <= 2e-22)) {
    		tmp = (-z / a) * t;
    	} 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 (((z * t) <= (-2d+40)) .or. (.not. ((z * t) <= 2d-22))) then
            tmp = (-z / a) * t
        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 (((z * t) <= -2e+40) || !((z * t) <= 2e-22)) {
    		tmp = (-z / a) * t;
    	} 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 ((z * t) <= -2e+40) or not ((z * t) <= 2e-22):
    		tmp = (-z / a) * t
    	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(z * t) <= -2e+40) || !(Float64(z * t) <= 2e-22))
    		tmp = Float64(Float64(Float64(-z) / a) * t);
    	else
    		tmp = Float64(Float64(y * 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 (((z * t) <= -2e+40) || ~(((z * t) <= 2e-22)))
    		tmp = (-z / a) * t;
    	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[Or[LessEqual[N[(z * t), $MachinePrecision], -2e+40], N[Not[LessEqual[N[(z * t), $MachinePrecision], 2e-22]], $MachinePrecision]], N[(N[((-z) / a), $MachinePrecision] * t), $MachinePrecision], N[(N[(y * x), $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 -2 \cdot 10^{+40} \lor \neg \left(z \cdot t \leq 2 \cdot 10^{-22}\right):\\
    \;\;\;\;\frac{-z}{a} \cdot t\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{y \cdot x}{a}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if (*.f64 z t) < -2.00000000000000006e40 or 2.0000000000000001e-22 < (*.f64 z t)

      1. Initial program 91.4%

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

          \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(\left(x \cdot y - z \cdot t\right)\right)}{\mathsf{neg}\left(a\right)}} \]
        3. div-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(-y, x, t \cdot z\right) \cdot \color{blue}{\frac{\frac{1}{-1}}{a}} \]
        19. metadata-evalN/A

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(-y, x, t \cdot z\right) \cdot \frac{-1}{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.f6477.1

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

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

      if -2.00000000000000006e40 < (*.f64 z t) < 2.0000000000000001e-22

      1. Initial program 95.3%

        \[\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. lower-/.f64N/A

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

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

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

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

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

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

      1. Initial program 90.6%

        \[\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.f6479.3

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

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

      if -4.9999999999999998e-8 < (*.f64 z t) < 1e14

      1. Initial program 96.7%

        \[\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. lower-/.f64N/A

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

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

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

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

      if 1e14 < (*.f64 z t)

      1. Initial program 89.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-/.f6480.5

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

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

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

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

      1. Initial program 61.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. lower-/.f64N/A

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

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

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

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

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

        if -2.00000000000000014e246 < (*.f64 x y)

        1. Initial program 95.4%

          \[\frac{x \cdot y - z \cdot t}{a} \]
        2. Add Preprocessing
      7. Recombined 2 regimes into one program.
      8. Add Preprocessing

      Alternative 8: 50.8% accurate, 0.9× 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 2 \cdot 10^{+49}:\\ \;\;\;\;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 y) 2e+49) (* 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 * y) <= 2e+49) {
      		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 * y) <= 2d+49) 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 * y) <= 2e+49) {
      		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 * y) <= 2e+49:
      		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 (Float64(x * y) <= 2e+49)
      		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 * y) <= 2e+49)
      		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[N[(x * y), $MachinePrecision], 2e+49], 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 \cdot y \leq 2 \cdot 10^{+49}:\\
      \;\;\;\;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 (*.f64 x y) < 1.99999999999999989e49

        1. Initial program 94.9%

          \[\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. lower-/.f64N/A

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

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

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

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

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

          if 1.99999999999999989e49 < (*.f64 x y)

          1. Initial program 88.5%

            \[\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. lower-/.f64N/A

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

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

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

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

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

          Alternative 9: 50.8% accurate, 1.1× speedup?

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

            1. Initial program 93.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. lower-/.f64N/A

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

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

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

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

            if 1.90000000000000007e-7 < t

            1. Initial program 93.3%

              \[\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. lower-/.f64N/A

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

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

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

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

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

            Alternative 10: 50.8% 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.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. lower-/.f64N/A

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

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

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

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

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

              Developer Target 1: 90.9% 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 2024313 
              (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))