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

Percentage Accurate: 92.1% → 97.6%
Time: 11.0s
Alternatives: 11
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 11 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: 92.1% 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: 97.6% accurate, 0.3× speedup?

\[\begin{array}{l} [x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\ \\ \begin{array}{l} t_1 := \mathsf{fma}\left(\frac{x}{a}, y, -z \cdot \frac{t}{a}\right)\\ t_2 := x \cdot y - z \cdot t\\ \mathbf{if}\;t\_2 \leq -\infty:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+280}:\\ \;\;\;\;\frac{t\_2}{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 (fma (/ x a) y (- (* z (/ t a))))) (t_2 (- (* x y) (* z t))))
   (if (<= t_2 (- INFINITY)) t_1 (if (<= t_2 5e+280) (/ t_2 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 = fma((x / a), y, -(z * (t / a)));
	double t_2 = (x * y) - (z * t);
	double tmp;
	if (t_2 <= -((double) INFINITY)) {
		tmp = t_1;
	} else if (t_2 <= 5e+280) {
		tmp = t_2 / 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 = fma(Float64(x / a), y, Float64(-Float64(z * Float64(t / a))))
	t_2 = Float64(Float64(x * y) - Float64(z * t))
	tmp = 0.0
	if (t_2 <= Float64(-Inf))
		tmp = t_1;
	elseif (t_2 <= 5e+280)
		tmp = Float64(t_2 / a);
	else
		tmp = t_1;
	end
	return tmp
end
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x / a), $MachinePrecision] * y + (-N[(z * N[(t / a), $MachinePrecision]), $MachinePrecision])), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * y), $MachinePrecision] - N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], t$95$1, If[LessEqual[t$95$2, 5e+280], N[(t$95$2 / 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 := \mathsf{fma}\left(\frac{x}{a}, y, -z \cdot \frac{t}{a}\right)\\
t_2 := x \cdot y - z \cdot t\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;t\_1\\

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

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


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

    1. Initial program 74.0%

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

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

        \[\leadsto \frac{x \cdot y - \color{blue}{z \cdot t}}{a} \]
      3. 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. lower-neg.f64N/A

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

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

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

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

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

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

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

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

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

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

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

    if -inf.0 < (-.f64 (*.f64 x y) (*.f64 z t)) < 5.0000000000000002e280

    1. Initial program 98.3%

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

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

Alternative 2: 94.7% accurate, 0.4× speedup?

\[\begin{array}{l} [x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\ \\ \begin{array}{l} \mathbf{if}\;x \cdot y - z \cdot t \leq -1 \cdot 10^{+308}:\\ \;\;\;\;\mathsf{fma}\left(\frac{x}{a}, y, z \cdot \left(t \cdot \frac{-1}{a}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{a \cdot \frac{1}{\mathsf{fma}\left(x, y, z \cdot \left(-t\right)\right)}}\\ \end{array} \end{array} \]
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
 :precision binary64
 (if (<= (- (* x y) (* z t)) -1e+308)
   (fma (/ x a) y (* z (* t (/ -1.0 a))))
   (/ 1.0 (* a (/ 1.0 (fma x y (* z (- t))))))))
assert(x < y && y < z && z < t && t < a);
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (((x * y) - (z * t)) <= -1e+308) {
		tmp = fma((x / a), y, (z * (t * (-1.0 / a))));
	} else {
		tmp = 1.0 / (a * (1.0 / fma(x, y, (z * -t))));
	}
	return tmp;
}
x, y, z, t, a = sort([x, y, z, t, a])
function code(x, y, z, t, a)
	tmp = 0.0
	if (Float64(Float64(x * y) - Float64(z * t)) <= -1e+308)
		tmp = fma(Float64(x / a), y, Float64(z * Float64(t * Float64(-1.0 / a))));
	else
		tmp = Float64(1.0 / Float64(a * Float64(1.0 / fma(x, y, Float64(z * Float64(-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_] := If[LessEqual[N[(N[(x * y), $MachinePrecision] - N[(z * t), $MachinePrecision]), $MachinePrecision], -1e+308], N[(N[(x / a), $MachinePrecision] * y + N[(z * N[(t * N[(-1.0 / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(a * N[(1.0 / N[(x * y + N[(z * (-t)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y - z \cdot t \leq -1 \cdot 10^{+308}:\\
\;\;\;\;\mathsf{fma}\left(\frac{x}{a}, y, z \cdot \left(t \cdot \frac{-1}{a}\right)\right)\\

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


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

    1. Initial program 68.2%

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

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

        \[\leadsto \frac{x \cdot y - \color{blue}{z \cdot t}}{a} \]
      3. 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. lower-neg.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1e308 < (-.f64 (*.f64 x y) (*.f64 z t))

    1. Initial program 95.6%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{1}{\frac{a}{x \cdot y - z \cdot t}}} \]
      6. lower-/.f6495.5

        \[\leadsto \frac{1}{\color{blue}{\frac{a}{x \cdot y - z \cdot t}}} \]
    4. Applied rewrites95.5%

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

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

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

        \[\leadsto \frac{1}{\frac{a}{\color{blue}{x \cdot y - z \cdot t}}} \]
      4. clear-numN/A

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

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

        \[\leadsto \frac{1}{\color{blue}{\frac{1}{x \cdot y - z \cdot t} \cdot a}} \]
      7. lower-/.f6495.5

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 94.7% accurate, 0.4× speedup?

\[\begin{array}{l} [x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\ \\ \begin{array}{l} \mathbf{if}\;x \cdot y - z \cdot t \leq -1 \cdot 10^{+308}:\\ \;\;\;\;\mathsf{fma}\left(\frac{x}{a}, y, -z \cdot \frac{t}{a}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{a \cdot \frac{1}{\mathsf{fma}\left(x, y, z \cdot \left(-t\right)\right)}}\\ \end{array} \end{array} \]
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
 :precision binary64
 (if (<= (- (* x y) (* z t)) -1e+308)
   (fma (/ x a) y (- (* z (/ t a))))
   (/ 1.0 (* a (/ 1.0 (fma x y (* z (- t))))))))
assert(x < y && y < z && z < t && t < a);
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (((x * y) - (z * t)) <= -1e+308) {
		tmp = fma((x / a), y, -(z * (t / a)));
	} else {
		tmp = 1.0 / (a * (1.0 / fma(x, y, (z * -t))));
	}
	return tmp;
}
x, y, z, t, a = sort([x, y, z, t, a])
function code(x, y, z, t, a)
	tmp = 0.0
	if (Float64(Float64(x * y) - Float64(z * t)) <= -1e+308)
		tmp = fma(Float64(x / a), y, Float64(-Float64(z * Float64(t / a))));
	else
		tmp = Float64(1.0 / Float64(a * Float64(1.0 / fma(x, y, Float64(z * Float64(-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_] := If[LessEqual[N[(N[(x * y), $MachinePrecision] - N[(z * t), $MachinePrecision]), $MachinePrecision], -1e+308], N[(N[(x / a), $MachinePrecision] * y + (-N[(z * N[(t / a), $MachinePrecision]), $MachinePrecision])), $MachinePrecision], N[(1.0 / N[(a * N[(1.0 / N[(x * y + N[(z * (-t)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y - z \cdot t \leq -1 \cdot 10^{+308}:\\
\;\;\;\;\mathsf{fma}\left(\frac{x}{a}, y, -z \cdot \frac{t}{a}\right)\\

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


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

    1. Initial program 68.2%

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

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

        \[\leadsto \frac{x \cdot y - \color{blue}{z \cdot t}}{a} \]
      3. 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. lower-neg.f64N/A

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

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

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

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

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

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

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

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

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

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

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

    if -1e308 < (-.f64 (*.f64 x y) (*.f64 z t))

    1. Initial program 95.6%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{1}{\frac{a}{x \cdot y - z \cdot t}}} \]
      6. lower-/.f6495.5

        \[\leadsto \frac{1}{\color{blue}{\frac{a}{x \cdot y - z \cdot t}}} \]
    4. Applied rewrites95.5%

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

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

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

        \[\leadsto \frac{1}{\frac{a}{\color{blue}{x \cdot y - z \cdot t}}} \]
      4. clear-numN/A

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

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

        \[\leadsto \frac{1}{\color{blue}{\frac{1}{x \cdot y - z \cdot t} \cdot a}} \]
      7. lower-/.f6495.5

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 92.2% accurate, 0.6× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < 5.5e189

    1. Initial program 95.3%

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

    if 5.5e189 < a

    1. Initial program 68.2%

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

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

        \[\leadsto \frac{x \cdot y - \color{blue}{z \cdot t}}{a} \]
      3. 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. lower-neg.f64N/A

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

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 z t) < -4.00000000000000033e-5 or 5.00000000000000044e-112 < (*.f64 z t)

    1. Initial program 90.8%

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

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

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

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

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

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

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

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

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

    if -4.00000000000000033e-5 < (*.f64 z t) < 5.00000000000000044e-112

    1. Initial program 95.6%

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

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

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

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

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

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

Alternative 6: 73.8% accurate, 0.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 z t) < -4.00000000000000033e-5 or 5.00000000000000044e-112 < (*.f64 z t)

    1. Initial program 90.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{z \cdot -1}{a}} \cdot t \]
      12. *-commutativeN/A

        \[\leadsto \frac{\color{blue}{-1 \cdot z}}{a} \cdot t \]
      13. neg-mul-1N/A

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

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

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

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

    if -4.00000000000000033e-5 < (*.f64 z t) < 5.00000000000000044e-112

    1. Initial program 95.6%

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

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

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

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

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

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

Alternative 7: 74.7% accurate, 0.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 z t) < -1.99999999999999991e37 or 1.9999999999999999e-48 < (*.f64 z t)

    1. Initial program 90.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(t\right)}{a} \cdot z} \]
      9. *-lft-identityN/A

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

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

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

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

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

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

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

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

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

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

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

    if -1.99999999999999991e37 < (*.f64 z t) < 1.9999999999999999e-48

    1. Initial program 94.9%

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

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

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

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

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

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

Alternative 8: 93.6% accurate, 0.7× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 z t) < 4.9999999999999998e290

    1. Initial program 95.0%

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

    if 4.9999999999999998e290 < (*.f64 z t)

    1. Initial program 58.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{z \cdot -1}{a}} \cdot t \]
      12. *-commutativeN/A

        \[\leadsto \frac{\color{blue}{-1 \cdot z}}{a} \cdot t \]
      13. neg-mul-1N/A

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

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

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

      \[\leadsto \color{blue}{\frac{-z}{a} \cdot t} \]
    10. Step-by-step derivation
      1. neg-mul-1N/A

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

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

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

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

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

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

Alternative 9: 51.0% accurate, 1.1× speedup?

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

\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{a}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < 1.3e-24

    1. Initial program 92.9%

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

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

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

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

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

    if 1.3e-24 < t

    1. Initial program 93.4%

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

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

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

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

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

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

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

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

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

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

Alternative 10: 51.3% accurate, 1.1× speedup?

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

\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{a}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.50000000000000014e-280

    1. Initial program 92.8%

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

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

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

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

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

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

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

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

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

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

    if -2.50000000000000014e-280 < z

    1. Initial program 93.3%

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

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

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

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

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

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

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

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

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

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

Alternative 11: 51.1% accurate, 1.5× speedup?

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

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

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

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

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

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

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

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

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

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

    \[\leadsto y \cdot \frac{x}{a} \]
  9. 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 2024219 
(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))