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

Percentage Accurate: 91.4% → 94.2%
Time: 8.2s
Alternatives: 9
Speedup: 0.6×

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.4% accurate, 1.0× speedup?

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

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

Alternative 1: 94.2% accurate, 0.5× speedup?

\[\begin{array}{l} a\_m = \left|a\right| \\ a\_s = \mathsf{copysign}\left(1, a\right) \\ [x, y, z, t, a_m] = \mathsf{sort}([x, y, z, t, a_m])\\ \\ a\_s \cdot \begin{array}{l} \mathbf{if}\;a\_m \leq 7.2 \cdot 10^{-60}:\\ \;\;\;\;\frac{y \cdot x - t \cdot z}{a\_m}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{x}{a\_m}, y, \frac{-t}{\frac{a\_m}{z}}\right)\\ \end{array} \end{array} \]
a\_m = (fabs.f64 a)
a\_s = (copysign.f64 #s(literal 1 binary64) a)
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
(FPCore (a_s x y z t a_m)
 :precision binary64
 (*
  a_s
  (if (<= a_m 7.2e-60)
    (/ (- (* y x) (* t z)) a_m)
    (fma (/ x a_m) y (/ (- t) (/ a_m z))))))
a\_m = fabs(a);
a\_s = copysign(1.0, a);
assert(x < y && y < z && z < t && t < a_m);
double code(double a_s, double x, double y, double z, double t, double a_m) {
	double tmp;
	if (a_m <= 7.2e-60) {
		tmp = ((y * x) - (t * z)) / a_m;
	} else {
		tmp = fma((x / a_m), y, (-t / (a_m / z)));
	}
	return a_s * tmp;
}
a\_m = abs(a)
a\_s = copysign(1.0, a)
x, y, z, t, a_m = sort([x, y, z, t, a_m])
function code(a_s, x, y, z, t, a_m)
	tmp = 0.0
	if (a_m <= 7.2e-60)
		tmp = Float64(Float64(Float64(y * x) - Float64(t * z)) / a_m);
	else
		tmp = fma(Float64(x / a_m), y, Float64(Float64(-t) / Float64(a_m / z)));
	end
	return Float64(a_s * tmp)
end
a\_m = N[Abs[a], $MachinePrecision]
a\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
code[a$95$s_, x_, y_, z_, t_, a$95$m_] := N[(a$95$s * If[LessEqual[a$95$m, 7.2e-60], N[(N[(N[(y * x), $MachinePrecision] - N[(t * z), $MachinePrecision]), $MachinePrecision] / a$95$m), $MachinePrecision], N[(N[(x / a$95$m), $MachinePrecision] * y + N[((-t) / N[(a$95$m / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
a\_m = \left|a\right|
\\
a\_s = \mathsf{copysign}\left(1, a\right)
\\
[x, y, z, t, a_m] = \mathsf{sort}([x, y, z, t, a_m])\\
\\
a\_s \cdot \begin{array}{l}
\mathbf{if}\;a\_m \leq 7.2 \cdot 10^{-60}:\\
\;\;\;\;\frac{y \cdot x - t \cdot z}{a\_m}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < 7.2e-60

    1. Initial program 90.2%

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

    if 7.2e-60 < a

    1. Initial program 83.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. 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.4

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

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

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

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

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

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

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

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

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

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

Alternative 2: 53.9% accurate, 0.5× speedup?

\[\begin{array}{l} a\_m = \left|a\right| \\ a\_s = \mathsf{copysign}\left(1, a\right) \\ [x, y, z, t, a_m] = \mathsf{sort}([x, y, z, t, a_m])\\ \\ \begin{array}{l} t_1 := \frac{y}{a\_m} \cdot x\\ t_2 := y \cdot x - t \cdot z\\ a\_s \cdot \begin{array}{l} \mathbf{if}\;t\_2 \leq -1 \cdot 10^{+140}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+135}:\\ \;\;\;\;\frac{y \cdot x}{a\_m}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \end{array} \]
a\_m = (fabs.f64 a)
a\_s = (copysign.f64 #s(literal 1 binary64) a)
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
(FPCore (a_s x y z t a_m)
 :precision binary64
 (let* ((t_1 (* (/ y a_m) x)) (t_2 (- (* y x) (* t z))))
   (* a_s (if (<= t_2 -1e+140) t_1 (if (<= t_2 5e+135) (/ (* y x) a_m) t_1)))))
a\_m = fabs(a);
a\_s = copysign(1.0, a);
assert(x < y && y < z && z < t && t < a_m);
double code(double a_s, double x, double y, double z, double t, double a_m) {
	double t_1 = (y / a_m) * x;
	double t_2 = (y * x) - (t * z);
	double tmp;
	if (t_2 <= -1e+140) {
		tmp = t_1;
	} else if (t_2 <= 5e+135) {
		tmp = (y * x) / a_m;
	} else {
		tmp = t_1;
	}
	return a_s * tmp;
}
a\_m = abs(a)
a\_s = copysign(1.0d0, a)
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
real(8) function code(a_s, x, y, z, t, a_m)
    real(8), intent (in) :: a_s
    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_m
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = (y / a_m) * x
    t_2 = (y * x) - (t * z)
    if (t_2 <= (-1d+140)) then
        tmp = t_1
    else if (t_2 <= 5d+135) then
        tmp = (y * x) / a_m
    else
        tmp = t_1
    end if
    code = a_s * tmp
end function
a\_m = Math.abs(a);
a\_s = Math.copySign(1.0, a);
assert x < y && y < z && z < t && t < a_m;
public static double code(double a_s, double x, double y, double z, double t, double a_m) {
	double t_1 = (y / a_m) * x;
	double t_2 = (y * x) - (t * z);
	double tmp;
	if (t_2 <= -1e+140) {
		tmp = t_1;
	} else if (t_2 <= 5e+135) {
		tmp = (y * x) / a_m;
	} else {
		tmp = t_1;
	}
	return a_s * tmp;
}
a\_m = math.fabs(a)
a\_s = math.copysign(1.0, a)
[x, y, z, t, a_m] = sort([x, y, z, t, a_m])
def code(a_s, x, y, z, t, a_m):
	t_1 = (y / a_m) * x
	t_2 = (y * x) - (t * z)
	tmp = 0
	if t_2 <= -1e+140:
		tmp = t_1
	elif t_2 <= 5e+135:
		tmp = (y * x) / a_m
	else:
		tmp = t_1
	return a_s * tmp
a\_m = abs(a)
a\_s = copysign(1.0, a)
x, y, z, t, a_m = sort([x, y, z, t, a_m])
function code(a_s, x, y, z, t, a_m)
	t_1 = Float64(Float64(y / a_m) * x)
	t_2 = Float64(Float64(y * x) - Float64(t * z))
	tmp = 0.0
	if (t_2 <= -1e+140)
		tmp = t_1;
	elseif (t_2 <= 5e+135)
		tmp = Float64(Float64(y * x) / a_m);
	else
		tmp = t_1;
	end
	return Float64(a_s * tmp)
end
a\_m = abs(a);
a\_s = sign(a) * abs(1.0);
x, y, z, t, a_m = num2cell(sort([x, y, z, t, a_m])){:}
function tmp_2 = code(a_s, x, y, z, t, a_m)
	t_1 = (y / a_m) * x;
	t_2 = (y * x) - (t * z);
	tmp = 0.0;
	if (t_2 <= -1e+140)
		tmp = t_1;
	elseif (t_2 <= 5e+135)
		tmp = (y * x) / a_m;
	else
		tmp = t_1;
	end
	tmp_2 = a_s * tmp;
end
a\_m = N[Abs[a], $MachinePrecision]
a\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
code[a$95$s_, x_, y_, z_, t_, a$95$m_] := Block[{t$95$1 = N[(N[(y / a$95$m), $MachinePrecision] * x), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y * x), $MachinePrecision] - N[(t * z), $MachinePrecision]), $MachinePrecision]}, N[(a$95$s * If[LessEqual[t$95$2, -1e+140], t$95$1, If[LessEqual[t$95$2, 5e+135], N[(N[(y * x), $MachinePrecision] / a$95$m), $MachinePrecision], t$95$1]]), $MachinePrecision]]]
\begin{array}{l}
a\_m = \left|a\right|
\\
a\_s = \mathsf{copysign}\left(1, a\right)
\\
[x, y, z, t, a_m] = \mathsf{sort}([x, y, z, t, a_m])\\
\\
\begin{array}{l}
t_1 := \frac{y}{a\_m} \cdot x\\
t_2 := y \cdot x - t \cdot z\\
a\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{+140}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+135}:\\
\;\;\;\;\frac{y \cdot x}{a\_m}\\

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


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 (*.f64 x y) (*.f64 z t)) < -1.00000000000000006e140 or 5.00000000000000029e135 < (-.f64 (*.f64 x y) (*.f64 z t))

    1. Initial program 79.8%

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

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

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

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

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

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

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

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

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

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

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

      if -1.00000000000000006e140 < (-.f64 (*.f64 x y) (*.f64 z t)) < 5.00000000000000029e135

      1. Initial program 99.5%

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

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

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

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

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

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

    Alternative 3: 95.1% accurate, 0.5× speedup?

    \[\begin{array}{l} a\_m = \left|a\right| \\ a\_s = \mathsf{copysign}\left(1, a\right) \\ [x, y, z, t, a_m] = \mathsf{sort}([x, y, z, t, a_m])\\ \\ \begin{array}{l} t_1 := \frac{-z}{a\_m} \cdot t\\ a\_s \cdot \begin{array}{l} \mathbf{if}\;t \cdot z \leq -1 \cdot 10^{+305}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \cdot z \leq 2 \cdot 10^{+294}:\\ \;\;\;\;\frac{y \cdot x - t \cdot z}{a\_m}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \end{array} \]
    a\_m = (fabs.f64 a)
    a\_s = (copysign.f64 #s(literal 1 binary64) a)
    NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
    (FPCore (a_s x y z t a_m)
     :precision binary64
     (let* ((t_1 (* (/ (- z) a_m) t)))
       (*
        a_s
        (if (<= (* t z) -1e+305)
          t_1
          (if (<= (* t z) 2e+294) (/ (- (* y x) (* t z)) a_m) t_1)))))
    a\_m = fabs(a);
    a\_s = copysign(1.0, a);
    assert(x < y && y < z && z < t && t < a_m);
    double code(double a_s, double x, double y, double z, double t, double a_m) {
    	double t_1 = (-z / a_m) * t;
    	double tmp;
    	if ((t * z) <= -1e+305) {
    		tmp = t_1;
    	} else if ((t * z) <= 2e+294) {
    		tmp = ((y * x) - (t * z)) / a_m;
    	} else {
    		tmp = t_1;
    	}
    	return a_s * tmp;
    }
    
    a\_m = abs(a)
    a\_s = copysign(1.0d0, a)
    NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
    real(8) function code(a_s, x, y, z, t, a_m)
        real(8), intent (in) :: a_s
        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_m
        real(8) :: t_1
        real(8) :: tmp
        t_1 = (-z / a_m) * t
        if ((t * z) <= (-1d+305)) then
            tmp = t_1
        else if ((t * z) <= 2d+294) then
            tmp = ((y * x) - (t * z)) / a_m
        else
            tmp = t_1
        end if
        code = a_s * tmp
    end function
    
    a\_m = Math.abs(a);
    a\_s = Math.copySign(1.0, a);
    assert x < y && y < z && z < t && t < a_m;
    public static double code(double a_s, double x, double y, double z, double t, double a_m) {
    	double t_1 = (-z / a_m) * t;
    	double tmp;
    	if ((t * z) <= -1e+305) {
    		tmp = t_1;
    	} else if ((t * z) <= 2e+294) {
    		tmp = ((y * x) - (t * z)) / a_m;
    	} else {
    		tmp = t_1;
    	}
    	return a_s * tmp;
    }
    
    a\_m = math.fabs(a)
    a\_s = math.copysign(1.0, a)
    [x, y, z, t, a_m] = sort([x, y, z, t, a_m])
    def code(a_s, x, y, z, t, a_m):
    	t_1 = (-z / a_m) * t
    	tmp = 0
    	if (t * z) <= -1e+305:
    		tmp = t_1
    	elif (t * z) <= 2e+294:
    		tmp = ((y * x) - (t * z)) / a_m
    	else:
    		tmp = t_1
    	return a_s * tmp
    
    a\_m = abs(a)
    a\_s = copysign(1.0, a)
    x, y, z, t, a_m = sort([x, y, z, t, a_m])
    function code(a_s, x, y, z, t, a_m)
    	t_1 = Float64(Float64(Float64(-z) / a_m) * t)
    	tmp = 0.0
    	if (Float64(t * z) <= -1e+305)
    		tmp = t_1;
    	elseif (Float64(t * z) <= 2e+294)
    		tmp = Float64(Float64(Float64(y * x) - Float64(t * z)) / a_m);
    	else
    		tmp = t_1;
    	end
    	return Float64(a_s * tmp)
    end
    
    a\_m = abs(a);
    a\_s = sign(a) * abs(1.0);
    x, y, z, t, a_m = num2cell(sort([x, y, z, t, a_m])){:}
    function tmp_2 = code(a_s, x, y, z, t, a_m)
    	t_1 = (-z / a_m) * t;
    	tmp = 0.0;
    	if ((t * z) <= -1e+305)
    		tmp = t_1;
    	elseif ((t * z) <= 2e+294)
    		tmp = ((y * x) - (t * z)) / a_m;
    	else
    		tmp = t_1;
    	end
    	tmp_2 = a_s * tmp;
    end
    
    a\_m = N[Abs[a], $MachinePrecision]
    a\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
    NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
    code[a$95$s_, x_, y_, z_, t_, a$95$m_] := Block[{t$95$1 = N[(N[((-z) / a$95$m), $MachinePrecision] * t), $MachinePrecision]}, N[(a$95$s * If[LessEqual[N[(t * z), $MachinePrecision], -1e+305], t$95$1, If[LessEqual[N[(t * z), $MachinePrecision], 2e+294], N[(N[(N[(y * x), $MachinePrecision] - N[(t * z), $MachinePrecision]), $MachinePrecision] / a$95$m), $MachinePrecision], t$95$1]]), $MachinePrecision]]
    
    \begin{array}{l}
    a\_m = \left|a\right|
    \\
    a\_s = \mathsf{copysign}\left(1, a\right)
    \\
    [x, y, z, t, a_m] = \mathsf{sort}([x, y, z, t, a_m])\\
    \\
    \begin{array}{l}
    t_1 := \frac{-z}{a\_m} \cdot t\\
    a\_s \cdot \begin{array}{l}
    \mathbf{if}\;t \cdot z \leq -1 \cdot 10^{+305}:\\
    \;\;\;\;t\_1\\
    
    \mathbf{elif}\;t \cdot z \leq 2 \cdot 10^{+294}:\\
    \;\;\;\;\frac{y \cdot x - t \cdot z}{a\_m}\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_1\\
    
    
    \end{array}
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if (*.f64 z t) < -9.9999999999999994e304 or 2.00000000000000013e294 < (*.f64 z t)

      1. Initial program 59.7%

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

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

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

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

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

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

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

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

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

      if -9.9999999999999994e304 < (*.f64 z t) < 2.00000000000000013e294

      1. Initial program 93.8%

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

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

    Alternative 4: 72.4% accurate, 0.5× speedup?

    \[\begin{array}{l} a\_m = \left|a\right| \\ a\_s = \mathsf{copysign}\left(1, a\right) \\ [x, y, z, t, a_m] = \mathsf{sort}([x, y, z, t, a_m])\\ \\ \begin{array}{l} t_1 := \frac{-t}{\frac{a\_m}{z}}\\ a\_s \cdot \begin{array}{l} \mathbf{if}\;t \cdot z \leq -1 \cdot 10^{+54}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \cdot z \leq 5 \cdot 10^{+29}:\\ \;\;\;\;\frac{y}{\frac{a\_m}{x}}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \end{array} \]
    a\_m = (fabs.f64 a)
    a\_s = (copysign.f64 #s(literal 1 binary64) a)
    NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
    (FPCore (a_s x y z t a_m)
     :precision binary64
     (let* ((t_1 (/ (- t) (/ a_m z))))
       (*
        a_s
        (if (<= (* t z) -1e+54) t_1 (if (<= (* t z) 5e+29) (/ y (/ a_m x)) t_1)))))
    a\_m = fabs(a);
    a\_s = copysign(1.0, a);
    assert(x < y && y < z && z < t && t < a_m);
    double code(double a_s, double x, double y, double z, double t, double a_m) {
    	double t_1 = -t / (a_m / z);
    	double tmp;
    	if ((t * z) <= -1e+54) {
    		tmp = t_1;
    	} else if ((t * z) <= 5e+29) {
    		tmp = y / (a_m / x);
    	} else {
    		tmp = t_1;
    	}
    	return a_s * tmp;
    }
    
    a\_m = abs(a)
    a\_s = copysign(1.0d0, a)
    NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
    real(8) function code(a_s, x, y, z, t, a_m)
        real(8), intent (in) :: a_s
        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_m
        real(8) :: t_1
        real(8) :: tmp
        t_1 = -t / (a_m / z)
        if ((t * z) <= (-1d+54)) then
            tmp = t_1
        else if ((t * z) <= 5d+29) then
            tmp = y / (a_m / x)
        else
            tmp = t_1
        end if
        code = a_s * tmp
    end function
    
    a\_m = Math.abs(a);
    a\_s = Math.copySign(1.0, a);
    assert x < y && y < z && z < t && t < a_m;
    public static double code(double a_s, double x, double y, double z, double t, double a_m) {
    	double t_1 = -t / (a_m / z);
    	double tmp;
    	if ((t * z) <= -1e+54) {
    		tmp = t_1;
    	} else if ((t * z) <= 5e+29) {
    		tmp = y / (a_m / x);
    	} else {
    		tmp = t_1;
    	}
    	return a_s * tmp;
    }
    
    a\_m = math.fabs(a)
    a\_s = math.copysign(1.0, a)
    [x, y, z, t, a_m] = sort([x, y, z, t, a_m])
    def code(a_s, x, y, z, t, a_m):
    	t_1 = -t / (a_m / z)
    	tmp = 0
    	if (t * z) <= -1e+54:
    		tmp = t_1
    	elif (t * z) <= 5e+29:
    		tmp = y / (a_m / x)
    	else:
    		tmp = t_1
    	return a_s * tmp
    
    a\_m = abs(a)
    a\_s = copysign(1.0, a)
    x, y, z, t, a_m = sort([x, y, z, t, a_m])
    function code(a_s, x, y, z, t, a_m)
    	t_1 = Float64(Float64(-t) / Float64(a_m / z))
    	tmp = 0.0
    	if (Float64(t * z) <= -1e+54)
    		tmp = t_1;
    	elseif (Float64(t * z) <= 5e+29)
    		tmp = Float64(y / Float64(a_m / x));
    	else
    		tmp = t_1;
    	end
    	return Float64(a_s * tmp)
    end
    
    a\_m = abs(a);
    a\_s = sign(a) * abs(1.0);
    x, y, z, t, a_m = num2cell(sort([x, y, z, t, a_m])){:}
    function tmp_2 = code(a_s, x, y, z, t, a_m)
    	t_1 = -t / (a_m / z);
    	tmp = 0.0;
    	if ((t * z) <= -1e+54)
    		tmp = t_1;
    	elseif ((t * z) <= 5e+29)
    		tmp = y / (a_m / x);
    	else
    		tmp = t_1;
    	end
    	tmp_2 = a_s * tmp;
    end
    
    a\_m = N[Abs[a], $MachinePrecision]
    a\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
    NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
    code[a$95$s_, x_, y_, z_, t_, a$95$m_] := Block[{t$95$1 = N[((-t) / N[(a$95$m / z), $MachinePrecision]), $MachinePrecision]}, N[(a$95$s * If[LessEqual[N[(t * z), $MachinePrecision], -1e+54], t$95$1, If[LessEqual[N[(t * z), $MachinePrecision], 5e+29], N[(y / N[(a$95$m / x), $MachinePrecision]), $MachinePrecision], t$95$1]]), $MachinePrecision]]
    
    \begin{array}{l}
    a\_m = \left|a\right|
    \\
    a\_s = \mathsf{copysign}\left(1, a\right)
    \\
    [x, y, z, t, a_m] = \mathsf{sort}([x, y, z, t, a_m])\\
    \\
    \begin{array}{l}
    t_1 := \frac{-t}{\frac{a\_m}{z}}\\
    a\_s \cdot \begin{array}{l}
    \mathbf{if}\;t \cdot z \leq -1 \cdot 10^{+54}:\\
    \;\;\;\;t\_1\\
    
    \mathbf{elif}\;t \cdot z \leq 5 \cdot 10^{+29}:\\
    \;\;\;\;\frac{y}{\frac{a\_m}{x}}\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_1\\
    
    
    \end{array}
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if (*.f64 z t) < -1.0000000000000001e54 or 5.0000000000000001e29 < (*.f64 z t)

      1. Initial program 82.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

        if -1.0000000000000001e54 < (*.f64 z t) < 5.0000000000000001e29

        1. Initial program 92.6%

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \frac{y}{\color{blue}{\frac{a}{x}}} \]
        10. Recombined 2 regimes into one program.
        11. Final simplification78.1%

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

        Alternative 5: 51.0% accurate, 0.5× speedup?

        \[\begin{array}{l} a\_m = \left|a\right| \\ a\_s = \mathsf{copysign}\left(1, a\right) \\ [x, y, z, t, a_m] = \mathsf{sort}([x, y, z, t, a_m])\\ \\ a\_s \cdot \begin{array}{l} \mathbf{if}\;\frac{y \cdot x - t \cdot z}{a\_m} \leq 2 \cdot 10^{+39}:\\ \;\;\;\;\frac{x}{a\_m} \cdot y\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a\_m} \cdot x\\ \end{array} \end{array} \]
        a\_m = (fabs.f64 a)
        a\_s = (copysign.f64 #s(literal 1 binary64) a)
        NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
        (FPCore (a_s x y z t a_m)
         :precision binary64
         (*
          a_s
          (if (<= (/ (- (* y x) (* t z)) a_m) 2e+39) (* (/ x a_m) y) (* (/ y a_m) x))))
        a\_m = fabs(a);
        a\_s = copysign(1.0, a);
        assert(x < y && y < z && z < t && t < a_m);
        double code(double a_s, double x, double y, double z, double t, double a_m) {
        	double tmp;
        	if ((((y * x) - (t * z)) / a_m) <= 2e+39) {
        		tmp = (x / a_m) * y;
        	} else {
        		tmp = (y / a_m) * x;
        	}
        	return a_s * tmp;
        }
        
        a\_m = abs(a)
        a\_s = copysign(1.0d0, a)
        NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
        real(8) function code(a_s, x, y, z, t, a_m)
            real(8), intent (in) :: a_s
            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_m
            real(8) :: tmp
            if ((((y * x) - (t * z)) / a_m) <= 2d+39) then
                tmp = (x / a_m) * y
            else
                tmp = (y / a_m) * x
            end if
            code = a_s * tmp
        end function
        
        a\_m = Math.abs(a);
        a\_s = Math.copySign(1.0, a);
        assert x < y && y < z && z < t && t < a_m;
        public static double code(double a_s, double x, double y, double z, double t, double a_m) {
        	double tmp;
        	if ((((y * x) - (t * z)) / a_m) <= 2e+39) {
        		tmp = (x / a_m) * y;
        	} else {
        		tmp = (y / a_m) * x;
        	}
        	return a_s * tmp;
        }
        
        a\_m = math.fabs(a)
        a\_s = math.copysign(1.0, a)
        [x, y, z, t, a_m] = sort([x, y, z, t, a_m])
        def code(a_s, x, y, z, t, a_m):
        	tmp = 0
        	if (((y * x) - (t * z)) / a_m) <= 2e+39:
        		tmp = (x / a_m) * y
        	else:
        		tmp = (y / a_m) * x
        	return a_s * tmp
        
        a\_m = abs(a)
        a\_s = copysign(1.0, a)
        x, y, z, t, a_m = sort([x, y, z, t, a_m])
        function code(a_s, x, y, z, t, a_m)
        	tmp = 0.0
        	if (Float64(Float64(Float64(y * x) - Float64(t * z)) / a_m) <= 2e+39)
        		tmp = Float64(Float64(x / a_m) * y);
        	else
        		tmp = Float64(Float64(y / a_m) * x);
        	end
        	return Float64(a_s * tmp)
        end
        
        a\_m = abs(a);
        a\_s = sign(a) * abs(1.0);
        x, y, z, t, a_m = num2cell(sort([x, y, z, t, a_m])){:}
        function tmp_2 = code(a_s, x, y, z, t, a_m)
        	tmp = 0.0;
        	if ((((y * x) - (t * z)) / a_m) <= 2e+39)
        		tmp = (x / a_m) * y;
        	else
        		tmp = (y / a_m) * x;
        	end
        	tmp_2 = a_s * tmp;
        end
        
        a\_m = N[Abs[a], $MachinePrecision]
        a\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
        NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
        code[a$95$s_, x_, y_, z_, t_, a$95$m_] := N[(a$95$s * If[LessEqual[N[(N[(N[(y * x), $MachinePrecision] - N[(t * z), $MachinePrecision]), $MachinePrecision] / a$95$m), $MachinePrecision], 2e+39], N[(N[(x / a$95$m), $MachinePrecision] * y), $MachinePrecision], N[(N[(y / a$95$m), $MachinePrecision] * x), $MachinePrecision]]), $MachinePrecision]
        
        \begin{array}{l}
        a\_m = \left|a\right|
        \\
        a\_s = \mathsf{copysign}\left(1, a\right)
        \\
        [x, y, z, t, a_m] = \mathsf{sort}([x, y, z, t, a_m])\\
        \\
        a\_s \cdot \begin{array}{l}
        \mathbf{if}\;\frac{y \cdot x - t \cdot z}{a\_m} \leq 2 \cdot 10^{+39}:\\
        \;\;\;\;\frac{x}{a\_m} \cdot y\\
        
        \mathbf{else}:\\
        \;\;\;\;\frac{y}{a\_m} \cdot x\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if (/.f64 (-.f64 (*.f64 x y) (*.f64 z t)) a) < 1.99999999999999988e39

          1. Initial program 91.4%

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

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

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

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

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

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

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

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

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

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

          if 1.99999999999999988e39 < (/.f64 (-.f64 (*.f64 x y) (*.f64 z t)) a)

          1. Initial program 80.4%

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

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

              \[\leadsto \frac{\color{blue}{y \cdot x}}{a} \]
            2. lower-*.f6439.7

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

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

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

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

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

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

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

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

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

          Alternative 6: 72.5% accurate, 0.6× speedup?

          \[\begin{array}{l} a\_m = \left|a\right| \\ a\_s = \mathsf{copysign}\left(1, a\right) \\ [x, y, z, t, a_m] = \mathsf{sort}([x, y, z, t, a_m])\\ \\ \begin{array}{l} t_1 := \frac{-z}{a\_m} \cdot t\\ a\_s \cdot \begin{array}{l} \mathbf{if}\;t \cdot z \leq -1 \cdot 10^{+54}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \cdot z \leq 5 \cdot 10^{+29}:\\ \;\;\;\;\frac{y}{\frac{a\_m}{x}}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \end{array} \]
          a\_m = (fabs.f64 a)
          a\_s = (copysign.f64 #s(literal 1 binary64) a)
          NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
          (FPCore (a_s x y z t a_m)
           :precision binary64
           (let* ((t_1 (* (/ (- z) a_m) t)))
             (*
              a_s
              (if (<= (* t z) -1e+54) t_1 (if (<= (* t z) 5e+29) (/ y (/ a_m x)) t_1)))))
          a\_m = fabs(a);
          a\_s = copysign(1.0, a);
          assert(x < y && y < z && z < t && t < a_m);
          double code(double a_s, double x, double y, double z, double t, double a_m) {
          	double t_1 = (-z / a_m) * t;
          	double tmp;
          	if ((t * z) <= -1e+54) {
          		tmp = t_1;
          	} else if ((t * z) <= 5e+29) {
          		tmp = y / (a_m / x);
          	} else {
          		tmp = t_1;
          	}
          	return a_s * tmp;
          }
          
          a\_m = abs(a)
          a\_s = copysign(1.0d0, a)
          NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
          real(8) function code(a_s, x, y, z, t, a_m)
              real(8), intent (in) :: a_s
              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_m
              real(8) :: t_1
              real(8) :: tmp
              t_1 = (-z / a_m) * t
              if ((t * z) <= (-1d+54)) then
                  tmp = t_1
              else if ((t * z) <= 5d+29) then
                  tmp = y / (a_m / x)
              else
                  tmp = t_1
              end if
              code = a_s * tmp
          end function
          
          a\_m = Math.abs(a);
          a\_s = Math.copySign(1.0, a);
          assert x < y && y < z && z < t && t < a_m;
          public static double code(double a_s, double x, double y, double z, double t, double a_m) {
          	double t_1 = (-z / a_m) * t;
          	double tmp;
          	if ((t * z) <= -1e+54) {
          		tmp = t_1;
          	} else if ((t * z) <= 5e+29) {
          		tmp = y / (a_m / x);
          	} else {
          		tmp = t_1;
          	}
          	return a_s * tmp;
          }
          
          a\_m = math.fabs(a)
          a\_s = math.copysign(1.0, a)
          [x, y, z, t, a_m] = sort([x, y, z, t, a_m])
          def code(a_s, x, y, z, t, a_m):
          	t_1 = (-z / a_m) * t
          	tmp = 0
          	if (t * z) <= -1e+54:
          		tmp = t_1
          	elif (t * z) <= 5e+29:
          		tmp = y / (a_m / x)
          	else:
          		tmp = t_1
          	return a_s * tmp
          
          a\_m = abs(a)
          a\_s = copysign(1.0, a)
          x, y, z, t, a_m = sort([x, y, z, t, a_m])
          function code(a_s, x, y, z, t, a_m)
          	t_1 = Float64(Float64(Float64(-z) / a_m) * t)
          	tmp = 0.0
          	if (Float64(t * z) <= -1e+54)
          		tmp = t_1;
          	elseif (Float64(t * z) <= 5e+29)
          		tmp = Float64(y / Float64(a_m / x));
          	else
          		tmp = t_1;
          	end
          	return Float64(a_s * tmp)
          end
          
          a\_m = abs(a);
          a\_s = sign(a) * abs(1.0);
          x, y, z, t, a_m = num2cell(sort([x, y, z, t, a_m])){:}
          function tmp_2 = code(a_s, x, y, z, t, a_m)
          	t_1 = (-z / a_m) * t;
          	tmp = 0.0;
          	if ((t * z) <= -1e+54)
          		tmp = t_1;
          	elseif ((t * z) <= 5e+29)
          		tmp = y / (a_m / x);
          	else
          		tmp = t_1;
          	end
          	tmp_2 = a_s * tmp;
          end
          
          a\_m = N[Abs[a], $MachinePrecision]
          a\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
          NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
          code[a$95$s_, x_, y_, z_, t_, a$95$m_] := Block[{t$95$1 = N[(N[((-z) / a$95$m), $MachinePrecision] * t), $MachinePrecision]}, N[(a$95$s * If[LessEqual[N[(t * z), $MachinePrecision], -1e+54], t$95$1, If[LessEqual[N[(t * z), $MachinePrecision], 5e+29], N[(y / N[(a$95$m / x), $MachinePrecision]), $MachinePrecision], t$95$1]]), $MachinePrecision]]
          
          \begin{array}{l}
          a\_m = \left|a\right|
          \\
          a\_s = \mathsf{copysign}\left(1, a\right)
          \\
          [x, y, z, t, a_m] = \mathsf{sort}([x, y, z, t, a_m])\\
          \\
          \begin{array}{l}
          t_1 := \frac{-z}{a\_m} \cdot t\\
          a\_s \cdot \begin{array}{l}
          \mathbf{if}\;t \cdot z \leq -1 \cdot 10^{+54}:\\
          \;\;\;\;t\_1\\
          
          \mathbf{elif}\;t \cdot z \leq 5 \cdot 10^{+29}:\\
          \;\;\;\;\frac{y}{\frac{a\_m}{x}}\\
          
          \mathbf{else}:\\
          \;\;\;\;t\_1\\
          
          
          \end{array}
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if (*.f64 z t) < -1.0000000000000001e54 or 5.0000000000000001e29 < (*.f64 z t)

            1. Initial program 82.5%

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

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

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

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

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

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

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

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

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

            if -1.0000000000000001e54 < (*.f64 z t) < 5.0000000000000001e29

            1. Initial program 92.6%

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \frac{y}{\color{blue}{\frac{a}{x}}} \]
            10. Recombined 2 regimes into one program.
            11. Final simplification77.8%

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

            Alternative 7: 94.4% accurate, 0.6× speedup?

            \[\begin{array}{l} a\_m = \left|a\right| \\ a\_s = \mathsf{copysign}\left(1, a\right) \\ [x, y, z, t, a_m] = \mathsf{sort}([x, y, z, t, a_m])\\ \\ a\_s \cdot \begin{array}{l} \mathbf{if}\;a\_m \leq 4 \cdot 10^{-60}:\\ \;\;\;\;\frac{y \cdot x - t \cdot z}{a\_m}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{x}{a\_m}, y, \frac{-z}{a\_m} \cdot t\right)\\ \end{array} \end{array} \]
            a\_m = (fabs.f64 a)
            a\_s = (copysign.f64 #s(literal 1 binary64) a)
            NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
            (FPCore (a_s x y z t a_m)
             :precision binary64
             (*
              a_s
              (if (<= a_m 4e-60)
                (/ (- (* y x) (* t z)) a_m)
                (fma (/ x a_m) y (* (/ (- z) a_m) t)))))
            a\_m = fabs(a);
            a\_s = copysign(1.0, a);
            assert(x < y && y < z && z < t && t < a_m);
            double code(double a_s, double x, double y, double z, double t, double a_m) {
            	double tmp;
            	if (a_m <= 4e-60) {
            		tmp = ((y * x) - (t * z)) / a_m;
            	} else {
            		tmp = fma((x / a_m), y, ((-z / a_m) * t));
            	}
            	return a_s * tmp;
            }
            
            a\_m = abs(a)
            a\_s = copysign(1.0, a)
            x, y, z, t, a_m = sort([x, y, z, t, a_m])
            function code(a_s, x, y, z, t, a_m)
            	tmp = 0.0
            	if (a_m <= 4e-60)
            		tmp = Float64(Float64(Float64(y * x) - Float64(t * z)) / a_m);
            	else
            		tmp = fma(Float64(x / a_m), y, Float64(Float64(Float64(-z) / a_m) * t));
            	end
            	return Float64(a_s * tmp)
            end
            
            a\_m = N[Abs[a], $MachinePrecision]
            a\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
            NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
            code[a$95$s_, x_, y_, z_, t_, a$95$m_] := N[(a$95$s * If[LessEqual[a$95$m, 4e-60], N[(N[(N[(y * x), $MachinePrecision] - N[(t * z), $MachinePrecision]), $MachinePrecision] / a$95$m), $MachinePrecision], N[(N[(x / a$95$m), $MachinePrecision] * y + N[(N[((-z) / a$95$m), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
            
            \begin{array}{l}
            a\_m = \left|a\right|
            \\
            a\_s = \mathsf{copysign}\left(1, a\right)
            \\
            [x, y, z, t, a_m] = \mathsf{sort}([x, y, z, t, a_m])\\
            \\
            a\_s \cdot \begin{array}{l}
            \mathbf{if}\;a\_m \leq 4 \cdot 10^{-60}:\\
            \;\;\;\;\frac{y \cdot x - t \cdot z}{a\_m}\\
            
            \mathbf{else}:\\
            \;\;\;\;\mathsf{fma}\left(\frac{x}{a\_m}, y, \frac{-z}{a\_m} \cdot t\right)\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if a < 3.9999999999999999e-60

              1. Initial program 90.2%

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

              if 3.9999999999999999e-60 < a

              1. Initial program 83.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. 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.4

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

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

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

            Alternative 8: 72.5% accurate, 0.6× speedup?

            \[\begin{array}{l} a\_m = \left|a\right| \\ a\_s = \mathsf{copysign}\left(1, a\right) \\ [x, y, z, t, a_m] = \mathsf{sort}([x, y, z, t, a_m])\\ \\ \begin{array}{l} t_1 := \frac{-z}{a\_m} \cdot t\\ a\_s \cdot \begin{array}{l} \mathbf{if}\;t \cdot z \leq -5 \cdot 10^{+48}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \cdot z \leq 5 \cdot 10^{+29}:\\ \;\;\;\;\frac{x}{a\_m} \cdot y\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \end{array} \]
            a\_m = (fabs.f64 a)
            a\_s = (copysign.f64 #s(literal 1 binary64) a)
            NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
            (FPCore (a_s x y z t a_m)
             :precision binary64
             (let* ((t_1 (* (/ (- z) a_m) t)))
               (*
                a_s
                (if (<= (* t z) -5e+48) t_1 (if (<= (* t z) 5e+29) (* (/ x a_m) y) t_1)))))
            a\_m = fabs(a);
            a\_s = copysign(1.0, a);
            assert(x < y && y < z && z < t && t < a_m);
            double code(double a_s, double x, double y, double z, double t, double a_m) {
            	double t_1 = (-z / a_m) * t;
            	double tmp;
            	if ((t * z) <= -5e+48) {
            		tmp = t_1;
            	} else if ((t * z) <= 5e+29) {
            		tmp = (x / a_m) * y;
            	} else {
            		tmp = t_1;
            	}
            	return a_s * tmp;
            }
            
            a\_m = abs(a)
            a\_s = copysign(1.0d0, a)
            NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
            real(8) function code(a_s, x, y, z, t, a_m)
                real(8), intent (in) :: a_s
                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_m
                real(8) :: t_1
                real(8) :: tmp
                t_1 = (-z / a_m) * t
                if ((t * z) <= (-5d+48)) then
                    tmp = t_1
                else if ((t * z) <= 5d+29) then
                    tmp = (x / a_m) * y
                else
                    tmp = t_1
                end if
                code = a_s * tmp
            end function
            
            a\_m = Math.abs(a);
            a\_s = Math.copySign(1.0, a);
            assert x < y && y < z && z < t && t < a_m;
            public static double code(double a_s, double x, double y, double z, double t, double a_m) {
            	double t_1 = (-z / a_m) * t;
            	double tmp;
            	if ((t * z) <= -5e+48) {
            		tmp = t_1;
            	} else if ((t * z) <= 5e+29) {
            		tmp = (x / a_m) * y;
            	} else {
            		tmp = t_1;
            	}
            	return a_s * tmp;
            }
            
            a\_m = math.fabs(a)
            a\_s = math.copysign(1.0, a)
            [x, y, z, t, a_m] = sort([x, y, z, t, a_m])
            def code(a_s, x, y, z, t, a_m):
            	t_1 = (-z / a_m) * t
            	tmp = 0
            	if (t * z) <= -5e+48:
            		tmp = t_1
            	elif (t * z) <= 5e+29:
            		tmp = (x / a_m) * y
            	else:
            		tmp = t_1
            	return a_s * tmp
            
            a\_m = abs(a)
            a\_s = copysign(1.0, a)
            x, y, z, t, a_m = sort([x, y, z, t, a_m])
            function code(a_s, x, y, z, t, a_m)
            	t_1 = Float64(Float64(Float64(-z) / a_m) * t)
            	tmp = 0.0
            	if (Float64(t * z) <= -5e+48)
            		tmp = t_1;
            	elseif (Float64(t * z) <= 5e+29)
            		tmp = Float64(Float64(x / a_m) * y);
            	else
            		tmp = t_1;
            	end
            	return Float64(a_s * tmp)
            end
            
            a\_m = abs(a);
            a\_s = sign(a) * abs(1.0);
            x, y, z, t, a_m = num2cell(sort([x, y, z, t, a_m])){:}
            function tmp_2 = code(a_s, x, y, z, t, a_m)
            	t_1 = (-z / a_m) * t;
            	tmp = 0.0;
            	if ((t * z) <= -5e+48)
            		tmp = t_1;
            	elseif ((t * z) <= 5e+29)
            		tmp = (x / a_m) * y;
            	else
            		tmp = t_1;
            	end
            	tmp_2 = a_s * tmp;
            end
            
            a\_m = N[Abs[a], $MachinePrecision]
            a\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
            NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
            code[a$95$s_, x_, y_, z_, t_, a$95$m_] := Block[{t$95$1 = N[(N[((-z) / a$95$m), $MachinePrecision] * t), $MachinePrecision]}, N[(a$95$s * If[LessEqual[N[(t * z), $MachinePrecision], -5e+48], t$95$1, If[LessEqual[N[(t * z), $MachinePrecision], 5e+29], N[(N[(x / a$95$m), $MachinePrecision] * y), $MachinePrecision], t$95$1]]), $MachinePrecision]]
            
            \begin{array}{l}
            a\_m = \left|a\right|
            \\
            a\_s = \mathsf{copysign}\left(1, a\right)
            \\
            [x, y, z, t, a_m] = \mathsf{sort}([x, y, z, t, a_m])\\
            \\
            \begin{array}{l}
            t_1 := \frac{-z}{a\_m} \cdot t\\
            a\_s \cdot \begin{array}{l}
            \mathbf{if}\;t \cdot z \leq -5 \cdot 10^{+48}:\\
            \;\;\;\;t\_1\\
            
            \mathbf{elif}\;t \cdot z \leq 5 \cdot 10^{+29}:\\
            \;\;\;\;\frac{x}{a\_m} \cdot y\\
            
            \mathbf{else}:\\
            \;\;\;\;t\_1\\
            
            
            \end{array}
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if (*.f64 z t) < -4.99999999999999973e48 or 5.0000000000000001e29 < (*.f64 z t)

              1. Initial program 82.8%

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

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

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

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

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

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

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

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

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

              if -4.99999999999999973e48 < (*.f64 z t) < 5.0000000000000001e29

              1. Initial program 92.5%

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

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

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

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

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

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

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

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

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

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

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

            Alternative 9: 50.9% accurate, 1.5× speedup?

            \[\begin{array}{l} a\_m = \left|a\right| \\ a\_s = \mathsf{copysign}\left(1, a\right) \\ [x, y, z, t, a_m] = \mathsf{sort}([x, y, z, t, a_m])\\ \\ a\_s \cdot \left(\frac{y}{a\_m} \cdot x\right) \end{array} \]
            a\_m = (fabs.f64 a)
            a\_s = (copysign.f64 #s(literal 1 binary64) a)
            NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
            (FPCore (a_s x y z t a_m) :precision binary64 (* a_s (* (/ y a_m) x)))
            a\_m = fabs(a);
            a\_s = copysign(1.0, a);
            assert(x < y && y < z && z < t && t < a_m);
            double code(double a_s, double x, double y, double z, double t, double a_m) {
            	return a_s * ((y / a_m) * x);
            }
            
            a\_m = abs(a)
            a\_s = copysign(1.0d0, a)
            NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
            real(8) function code(a_s, x, y, z, t, a_m)
                real(8), intent (in) :: a_s
                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_m
                code = a_s * ((y / a_m) * x)
            end function
            
            a\_m = Math.abs(a);
            a\_s = Math.copySign(1.0, a);
            assert x < y && y < z && z < t && t < a_m;
            public static double code(double a_s, double x, double y, double z, double t, double a_m) {
            	return a_s * ((y / a_m) * x);
            }
            
            a\_m = math.fabs(a)
            a\_s = math.copysign(1.0, a)
            [x, y, z, t, a_m] = sort([x, y, z, t, a_m])
            def code(a_s, x, y, z, t, a_m):
            	return a_s * ((y / a_m) * x)
            
            a\_m = abs(a)
            a\_s = copysign(1.0, a)
            x, y, z, t, a_m = sort([x, y, z, t, a_m])
            function code(a_s, x, y, z, t, a_m)
            	return Float64(a_s * Float64(Float64(y / a_m) * x))
            end
            
            a\_m = abs(a);
            a\_s = sign(a) * abs(1.0);
            x, y, z, t, a_m = num2cell(sort([x, y, z, t, a_m])){:}
            function tmp = code(a_s, x, y, z, t, a_m)
            	tmp = a_s * ((y / a_m) * x);
            end
            
            a\_m = N[Abs[a], $MachinePrecision]
            a\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
            NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
            code[a$95$s_, x_, y_, z_, t_, a$95$m_] := N[(a$95$s * N[(N[(y / a$95$m), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]
            
            \begin{array}{l}
            a\_m = \left|a\right|
            \\
            a\_s = \mathsf{copysign}\left(1, a\right)
            \\
            [x, y, z, t, a_m] = \mathsf{sort}([x, y, z, t, a_m])\\
            \\
            a\_s \cdot \left(\frac{y}{a\_m} \cdot x\right)
            \end{array}
            
            Derivation
            1. Initial program 87.8%

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

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

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

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

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

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

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

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

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

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

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

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

              Developer Target 1: 91.4% 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 2024244 
              (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))