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

Percentage Accurate: 91.0% → 94.0%
Time: 9.6s
Alternatives: 8
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 8 alternatives:

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

Initial Program: 91.0% 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.0% accurate, 0.5× speedup?

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

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


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

    1. Initial program 95.8%

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

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

    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-/.f6497.8

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

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

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

Alternative 2: 93.9% accurate, 0.5× speedup?

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

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


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

    1. Initial program 95.8%

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

    if 1.0000000000000001e227 < (-.f64 (*.f64 x y) (*.f64 z t))

    1. Initial program 73.2%

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

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

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

        \[\leadsto \color{blue}{\frac{x \cdot y}{a} - \frac{z \cdot t}{a}} \]
      4. 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.1

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \cdot x - t \cdot z \leq 10^{+227}:\\ \;\;\;\;\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 3: 71.8% accurate, 0.6× speedup?

\[\begin{array}{l} [x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\ \\ \begin{array}{l} \mathbf{if}\;t \cdot z \leq -2 \cdot 10^{+68}:\\ \;\;\;\;\frac{-t}{\frac{a}{z}}\\ \mathbf{elif}\;t \cdot z \leq 2 \cdot 10^{+28}:\\ \;\;\;\;\frac{y \cdot x}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-t\right) \cdot z}{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 (<= (* t z) -2e+68)
   (/ (- t) (/ a z))
   (if (<= (* t z) 2e+28) (/ (* y x) a) (/ (* (- t) z) a))))
assert(x < y && y < z && z < t && t < a);
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if ((t * z) <= -2e+68) {
		tmp = -t / (a / z);
	} else if ((t * z) <= 2e+28) {
		tmp = (y * x) / a;
	} else {
		tmp = (-t * z) / 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 ((t * z) <= (-2d+68)) then
        tmp = -t / (a / z)
    else if ((t * z) <= 2d+28) then
        tmp = (y * x) / a
    else
        tmp = (-t * z) / 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 ((t * z) <= -2e+68) {
		tmp = -t / (a / z);
	} else if ((t * z) <= 2e+28) {
		tmp = (y * x) / a;
	} else {
		tmp = (-t * z) / a;
	}
	return tmp;
}
[x, y, z, t, a] = sort([x, y, z, t, a])
def code(x, y, z, t, a):
	tmp = 0
	if (t * z) <= -2e+68:
		tmp = -t / (a / z)
	elif (t * z) <= 2e+28:
		tmp = (y * x) / a
	else:
		tmp = (-t * z) / a
	return tmp
x, y, z, t, a = sort([x, y, z, t, a])
function code(x, y, z, t, a)
	tmp = 0.0
	if (Float64(t * z) <= -2e+68)
		tmp = Float64(Float64(-t) / Float64(a / z));
	elseif (Float64(t * z) <= 2e+28)
		tmp = Float64(Float64(y * x) / a);
	else
		tmp = Float64(Float64(Float64(-t) * z) / 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 ((t * z) <= -2e+68)
		tmp = -t / (a / z);
	elseif ((t * z) <= 2e+28)
		tmp = (y * x) / a;
	else
		tmp = (-t * z) / 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[(t * z), $MachinePrecision], -2e+68], N[((-t) / N[(a / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(t * z), $MachinePrecision], 2e+28], N[(N[(y * x), $MachinePrecision] / a), $MachinePrecision], N[(N[((-t) * z), $MachinePrecision] / a), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;t \cdot z \leq -2 \cdot 10^{+68}:\\
\;\;\;\;\frac{-t}{\frac{a}{z}}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 z t) < -1.99999999999999991e68

    1. Initial program 84.0%

      \[\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.9

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

      \[\leadsto \color{blue}{\left(-t\right) \cdot \frac{z}{a}} \]
    6. Step-by-step derivation
      1. Applied rewrites81.4%

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

      if -1.99999999999999991e68 < (*.f64 z t) < 1.99999999999999992e28

      1. Initial program 95.0%

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

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

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

      if 1.99999999999999992e28 < (*.f64 z t)

      1. Initial program 87.1%

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

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

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

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

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

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

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

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

    Alternative 4: 73.1% accurate, 0.6× speedup?

    \[\begin{array}{l} [x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\ \\ \begin{array}{l} \mathbf{if}\;y \cdot x \leq -2 \cdot 10^{-9}:\\ \;\;\;\;\frac{y \cdot x}{a}\\ \mathbf{elif}\;y \cdot x \leq 4 \cdot 10^{-74}:\\ \;\;\;\;\frac{\left(-t\right) \cdot z}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a} \cdot x\\ \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 (<= (* y x) -2e-9)
       (/ (* y x) a)
       (if (<= (* y x) 4e-74) (/ (* (- t) z) a) (* (/ 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 ((y * x) <= -2e-9) {
    		tmp = (y * x) / a;
    	} else if ((y * x) <= 4e-74) {
    		tmp = (-t * z) / a;
    	} else {
    		tmp = (y / a) * x;
    	}
    	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 ((y * x) <= (-2d-9)) then
            tmp = (y * x) / a
        else if ((y * x) <= 4d-74) then
            tmp = (-t * z) / a
        else
            tmp = (y / a) * x
        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 ((y * x) <= -2e-9) {
    		tmp = (y * x) / a;
    	} else if ((y * x) <= 4e-74) {
    		tmp = (-t * z) / a;
    	} else {
    		tmp = (y / a) * x;
    	}
    	return tmp;
    }
    
    [x, y, z, t, a] = sort([x, y, z, t, a])
    def code(x, y, z, t, a):
    	tmp = 0
    	if (y * x) <= -2e-9:
    		tmp = (y * x) / a
    	elif (y * x) <= 4e-74:
    		tmp = (-t * z) / a
    	else:
    		tmp = (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(y * x) <= -2e-9)
    		tmp = Float64(Float64(y * x) / a);
    	elseif (Float64(y * x) <= 4e-74)
    		tmp = Float64(Float64(Float64(-t) * z) / a);
    	else
    		tmp = Float64(Float64(y / a) * x);
    	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 ((y * x) <= -2e-9)
    		tmp = (y * x) / a;
    	elseif ((y * x) <= 4e-74)
    		tmp = (-t * z) / a;
    	else
    		tmp = (y / a) * x;
    	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[(y * x), $MachinePrecision], -2e-9], N[(N[(y * x), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[N[(y * x), $MachinePrecision], 4e-74], N[(N[((-t) * z), $MachinePrecision] / a), $MachinePrecision], N[(N[(y / a), $MachinePrecision] * x), $MachinePrecision]]]
    
    \begin{array}{l}
    [x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
    \\
    \begin{array}{l}
    \mathbf{if}\;y \cdot x \leq -2 \cdot 10^{-9}:\\
    \;\;\;\;\frac{y \cdot x}{a}\\
    
    \mathbf{elif}\;y \cdot x \leq 4 \cdot 10^{-74}:\\
    \;\;\;\;\frac{\left(-t\right) \cdot z}{a}\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{y}{a} \cdot x\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if (*.f64 x y) < -2.00000000000000012e-9

      1. Initial program 95.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-*.f6477.4

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

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

      if -2.00000000000000012e-9 < (*.f64 x y) < 3.99999999999999983e-74

      1. Initial program 92.6%

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

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

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

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

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

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

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

      if 3.99999999999999983e-74 < (*.f64 x y)

      1. Initial program 85.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-/.f6430.5

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

        \[\leadsto \color{blue}{\left(-t\right) \cdot \frac{z}{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.0

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

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

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

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

      Alternative 5: 72.9% accurate, 0.6× speedup?

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

        1. Initial program 85.4%

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

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

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

        if -1.99999999999999993e90 < (*.f64 z t) < 1.99999999999999992e28

        1. Initial program 95.1%

          \[\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-*.f6475.8

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

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

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

      Alternative 6: 92.0% accurate, 0.7× speedup?

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

        1. Initial program 93.6%

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

        if 5e152 < (*.f64 x y)

        1. Initial program 76.1%

          \[\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-/.f647.9

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

          \[\leadsto \color{blue}{\left(-t\right) \cdot \frac{z}{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-/.f6497.1

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

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

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

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

        Alternative 7: 51.9% accurate, 1.5× speedup?

        \[\begin{array}{l} [x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\ \\ \frac{y}{a} \cdot x \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 (* (/ y a) x))
        assert(x < y && y < z && z < t && t < a);
        double code(double x, double y, double z, double t, double a) {
        	return (y / a) * x;
        }
        
        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 = (y / a) * x
        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 (y / a) * x;
        }
        
        [x, y, z, t, a] = sort([x, y, z, t, a])
        def code(x, y, z, t, a):
        	return (y / a) * x
        
        x, y, z, t, a = sort([x, y, z, t, a])
        function code(x, y, z, t, a)
        	return Float64(Float64(y / a) * x)
        end
        
        x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
        function tmp = code(x, y, z, t, a)
        	tmp = (y / a) * x;
        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[(N[(y / a), $MachinePrecision] * x), $MachinePrecision]
        
        \begin{array}{l}
        [x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
        \\
        \frac{y}{a} \cdot x
        \end{array}
        
        Derivation
        1. Initial program 91.1%

          \[\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-/.f6449.1

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

          \[\leadsto \color{blue}{\left(-t\right) \cdot \frac{z}{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-/.f6454.4

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

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

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

          Alternative 8: 52.0% accurate, 1.5× speedup?

          \[\begin{array}{l} [x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\ \\ \frac{x}{a} \cdot y \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 a) y))
          assert(x < y && y < z && z < t && t < a);
          double code(double x, double y, double z, double t, double a) {
          	return (x / a) * y;
          }
          
          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 / a) * y
          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 / a) * y;
          }
          
          [x, y, z, t, a] = sort([x, y, z, t, a])
          def code(x, y, z, t, a):
          	return (x / a) * y
          
          x, y, z, t, a = sort([x, y, z, t, a])
          function code(x, y, z, t, a)
          	return Float64(Float64(x / a) * y)
          end
          
          x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
          function tmp = code(x, y, z, t, a)
          	tmp = (x / a) * y;
          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[(N[(x / a), $MachinePrecision] * y), $MachinePrecision]
          
          \begin{array}{l}
          [x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
          \\
          \frac{x}{a} \cdot y
          \end{array}
          
          Derivation
          1. Initial program 91.1%

            \[\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-/.f6449.1

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

            \[\leadsto \color{blue}{\left(-t\right) \cdot \frac{z}{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-/.f6454.4

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

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

          Developer Target 1: 91.1% 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 2024248 
          (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))