Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, I

Percentage Accurate: 91.1% → 93.0%
Time: 7.0s
Alternatives: 10
Speedup: 0.7×

Specification

?
\[\begin{array}{l} \\ \frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (/ (- (* x y) (* (* z 9.0) t)) (* a 2.0)))
double code(double x, double y, double z, double t, double a) {
	return ((x * y) - ((z * 9.0) * t)) / (a * 2.0);
}
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 * 9.0d0) * t)) / (a * 2.0d0)
end function
public static double code(double x, double y, double z, double t, double a) {
	return ((x * y) - ((z * 9.0) * t)) / (a * 2.0);
}
def code(x, y, z, t, a):
	return ((x * y) - ((z * 9.0) * t)) / (a * 2.0)
function code(x, y, z, t, a)
	return Float64(Float64(Float64(x * y) - Float64(Float64(z * 9.0) * t)) / Float64(a * 2.0))
end
function tmp = code(x, y, z, t, a)
	tmp = ((x * y) - ((z * 9.0) * t)) / (a * 2.0);
end
code[x_, y_, z_, t_, a_] := N[(N[(N[(x * y), $MachinePrecision] - N[(N[(z * 9.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2}
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 10 alternatives:

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

Initial Program: 91.1% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (/ (- (* x y) (* (* z 9.0) t)) (* a 2.0)))
double code(double x, double y, double z, double t, double a) {
	return ((x * y) - ((z * 9.0) * t)) / (a * 2.0);
}
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 * 9.0d0) * t)) / (a * 2.0d0)
end function
public static double code(double x, double y, double z, double t, double a) {
	return ((x * y) - ((z * 9.0) * t)) / (a * 2.0);
}
def code(x, y, z, t, a):
	return ((x * y) - ((z * 9.0) * t)) / (a * 2.0)
function code(x, y, z, t, a)
	return Float64(Float64(Float64(x * y) - Float64(Float64(z * 9.0) * t)) / Float64(a * 2.0))
end
function tmp = code(x, y, z, t, a)
	tmp = ((x * y) - ((z * 9.0) * t)) / (a * 2.0);
end
code[x_, y_, z_, t_, a_] := N[(N[(N[(x * y), $MachinePrecision] - N[(N[(z * 9.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2}
\end{array}

Alternative 1: 93.0% accurate, 0.6× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ [z, t] = \mathsf{sort}([z, t])\\ \\ \begin{array}{l} \mathbf{if}\;a \cdot 2 \leq -2 \cdot 10^{-20}:\\ \;\;\;\;0.5 \cdot \left(y \cdot \frac{x}{a}\right) - \frac{z}{a} \cdot \frac{9 \cdot t}{2}\\ \mathbf{else}:\\ \;\;\;\;\frac{y \cdot x - z \cdot \left(9 \cdot t\right)}{a \cdot 2}\\ \end{array} \end{array} \]
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: z and t should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
 :precision binary64
 (if (<= (* a 2.0) -2e-20)
   (- (* 0.5 (* y (/ x a))) (* (/ z a) (/ (* 9.0 t) 2.0)))
   (/ (- (* y x) (* z (* 9.0 t))) (* a 2.0))))
assert(x < y);
assert(z < t);
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if ((a * 2.0) <= -2e-20) {
		tmp = (0.5 * (y * (x / a))) - ((z / a) * ((9.0 * t) / 2.0));
	} else {
		tmp = ((y * x) - (z * (9.0 * t))) / (a * 2.0);
	}
	return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: z and t 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 ((a * 2.0d0) <= (-2d-20)) then
        tmp = (0.5d0 * (y * (x / a))) - ((z / a) * ((9.0d0 * t) / 2.0d0))
    else
        tmp = ((y * x) - (z * (9.0d0 * t))) / (a * 2.0d0)
    end if
    code = tmp
end function
assert x < y;
assert z < t;
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if ((a * 2.0) <= -2e-20) {
		tmp = (0.5 * (y * (x / a))) - ((z / a) * ((9.0 * t) / 2.0));
	} else {
		tmp = ((y * x) - (z * (9.0 * t))) / (a * 2.0);
	}
	return tmp;
}
[x, y] = sort([x, y])
[z, t] = sort([z, t])
def code(x, y, z, t, a):
	tmp = 0
	if (a * 2.0) <= -2e-20:
		tmp = (0.5 * (y * (x / a))) - ((z / a) * ((9.0 * t) / 2.0))
	else:
		tmp = ((y * x) - (z * (9.0 * t))) / (a * 2.0)
	return tmp
x, y = sort([x, y])
z, t = sort([z, t])
function code(x, y, z, t, a)
	tmp = 0.0
	if (Float64(a * 2.0) <= -2e-20)
		tmp = Float64(Float64(0.5 * Float64(y * Float64(x / a))) - Float64(Float64(z / a) * Float64(Float64(9.0 * t) / 2.0)));
	else
		tmp = Float64(Float64(Float64(y * x) - Float64(z * Float64(9.0 * t))) / Float64(a * 2.0));
	end
	return tmp
end
x, y = num2cell(sort([x, y])){:}
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if ((a * 2.0) <= -2e-20)
		tmp = (0.5 * (y * (x / a))) - ((z / a) * ((9.0 * t) / 2.0));
	else
		tmp = ((y * x) - (z * (9.0 * t))) / (a * 2.0);
	end
	tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: z and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_] := If[LessEqual[N[(a * 2.0), $MachinePrecision], -2e-20], N[(N[(0.5 * N[(y * N[(x / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(z / a), $MachinePrecision] * N[(N[(9.0 * t), $MachinePrecision] / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y * x), $MachinePrecision] - N[(z * N[(9.0 * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;a \cdot 2 \leq -2 \cdot 10^{-20}:\\
\;\;\;\;0.5 \cdot \left(y \cdot \frac{x}{a}\right) - \frac{z}{a} \cdot \frac{9 \cdot t}{2}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 a 2) < -1.99999999999999989e-20

    1. Initial program 82.6%

      \[\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2} \]
    2. Step-by-step derivation
      1. associate-*l*82.6%

        \[\leadsto \frac{x \cdot y - \color{blue}{z \cdot \left(9 \cdot t\right)}}{a \cdot 2} \]
    3. Simplified82.6%

      \[\leadsto \color{blue}{\frac{x \cdot y - z \cdot \left(9 \cdot t\right)}{a \cdot 2}} \]
    4. Step-by-step derivation
      1. div-sub82.6%

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

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

        \[\leadsto \left(x \cdot y\right) \cdot \frac{1}{\color{blue}{2 \cdot a}} - \frac{z \cdot \left(9 \cdot t\right)}{a \cdot 2} \]
      4. associate-/r*82.4%

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

        \[\leadsto \left(x \cdot y\right) \cdot \frac{\color{blue}{0.5}}{a} - \frac{z \cdot \left(9 \cdot t\right)}{a \cdot 2} \]
      6. times-frac88.2%

        \[\leadsto \left(x \cdot y\right) \cdot \frac{0.5}{a} - \color{blue}{\frac{z}{a} \cdot \frac{9 \cdot t}{2}} \]
    5. Applied egg-rr88.2%

      \[\leadsto \color{blue}{\left(x \cdot y\right) \cdot \frac{0.5}{a} - \frac{z}{a} \cdot \frac{9 \cdot t}{2}} \]
    6. Taylor expanded in x around 0 88.3%

      \[\leadsto \color{blue}{0.5 \cdot \frac{x \cdot y}{a}} - \frac{z}{a} \cdot \frac{9 \cdot t}{2} \]
    7. Step-by-step derivation
      1. *-commutative88.3%

        \[\leadsto 0.5 \cdot \frac{\color{blue}{y \cdot x}}{a} - \frac{z}{a} \cdot \frac{9 \cdot t}{2} \]
      2. associate-*r/94.7%

        \[\leadsto 0.5 \cdot \color{blue}{\left(y \cdot \frac{x}{a}\right)} - \frac{z}{a} \cdot \frac{9 \cdot t}{2} \]
    8. Simplified94.7%

      \[\leadsto \color{blue}{0.5 \cdot \left(y \cdot \frac{x}{a}\right)} - \frac{z}{a} \cdot \frac{9 \cdot t}{2} \]

    if -1.99999999999999989e-20 < (*.f64 a 2)

    1. Initial program 97.0%

      \[\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2} \]
    2. Step-by-step derivation
      1. associate-*l*97.0%

        \[\leadsto \frac{x \cdot y - \color{blue}{z \cdot \left(9 \cdot t\right)}}{a \cdot 2} \]
    3. Simplified97.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \cdot 2 \leq -2 \cdot 10^{-20}:\\ \;\;\;\;0.5 \cdot \left(y \cdot \frac{x}{a}\right) - \frac{z}{a} \cdot \frac{9 \cdot t}{2}\\ \mathbf{else}:\\ \;\;\;\;\frac{y \cdot x - z \cdot \left(9 \cdot t\right)}{a \cdot 2}\\ \end{array} \]

Alternative 2: 72.7% accurate, 0.6× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ [z, t] = \mathsf{sort}([z, t])\\ \\ \begin{array}{l} \mathbf{if}\;y \cdot x \leq -1 \cdot 10^{+47}:\\ \;\;\;\;0.5 \cdot \frac{x}{\frac{a}{y}}\\ \mathbf{elif}\;y \cdot x \leq 5 \cdot 10^{-34}:\\ \;\;\;\;-4.5 \cdot \frac{z}{\frac{a}{t}}\\ \mathbf{elif}\;y \cdot x \leq 0.05:\\ \;\;\;\;\frac{y \cdot x}{a \cdot 2}\\ \mathbf{elif}\;y \cdot x \leq 10^{+53}:\\ \;\;\;\;-4.5 \cdot \frac{t}{\frac{a}{z}}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{2 \cdot \frac{a}{x}}\\ \end{array} \end{array} \]
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: z and t should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
 :precision binary64
 (if (<= (* y x) -1e+47)
   (* 0.5 (/ x (/ a y)))
   (if (<= (* y x) 5e-34)
     (* -4.5 (/ z (/ a t)))
     (if (<= (* y x) 0.05)
       (/ (* y x) (* a 2.0))
       (if (<= (* y x) 1e+53) (* -4.5 (/ t (/ a z))) (/ y (* 2.0 (/ a x))))))))
assert(x < y);
assert(z < t);
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if ((y * x) <= -1e+47) {
		tmp = 0.5 * (x / (a / y));
	} else if ((y * x) <= 5e-34) {
		tmp = -4.5 * (z / (a / t));
	} else if ((y * x) <= 0.05) {
		tmp = (y * x) / (a * 2.0);
	} else if ((y * x) <= 1e+53) {
		tmp = -4.5 * (t / (a / z));
	} else {
		tmp = y / (2.0 * (a / x));
	}
	return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: z and t 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) <= (-1d+47)) then
        tmp = 0.5d0 * (x / (a / y))
    else if ((y * x) <= 5d-34) then
        tmp = (-4.5d0) * (z / (a / t))
    else if ((y * x) <= 0.05d0) then
        tmp = (y * x) / (a * 2.0d0)
    else if ((y * x) <= 1d+53) then
        tmp = (-4.5d0) * (t / (a / z))
    else
        tmp = y / (2.0d0 * (a / x))
    end if
    code = tmp
end function
assert x < y;
assert z < t;
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if ((y * x) <= -1e+47) {
		tmp = 0.5 * (x / (a / y));
	} else if ((y * x) <= 5e-34) {
		tmp = -4.5 * (z / (a / t));
	} else if ((y * x) <= 0.05) {
		tmp = (y * x) / (a * 2.0);
	} else if ((y * x) <= 1e+53) {
		tmp = -4.5 * (t / (a / z));
	} else {
		tmp = y / (2.0 * (a / x));
	}
	return tmp;
}
[x, y] = sort([x, y])
[z, t] = sort([z, t])
def code(x, y, z, t, a):
	tmp = 0
	if (y * x) <= -1e+47:
		tmp = 0.5 * (x / (a / y))
	elif (y * x) <= 5e-34:
		tmp = -4.5 * (z / (a / t))
	elif (y * x) <= 0.05:
		tmp = (y * x) / (a * 2.0)
	elif (y * x) <= 1e+53:
		tmp = -4.5 * (t / (a / z))
	else:
		tmp = y / (2.0 * (a / x))
	return tmp
x, y = sort([x, y])
z, t = sort([z, t])
function code(x, y, z, t, a)
	tmp = 0.0
	if (Float64(y * x) <= -1e+47)
		tmp = Float64(0.5 * Float64(x / Float64(a / y)));
	elseif (Float64(y * x) <= 5e-34)
		tmp = Float64(-4.5 * Float64(z / Float64(a / t)));
	elseif (Float64(y * x) <= 0.05)
		tmp = Float64(Float64(y * x) / Float64(a * 2.0));
	elseif (Float64(y * x) <= 1e+53)
		tmp = Float64(-4.5 * Float64(t / Float64(a / z)));
	else
		tmp = Float64(y / Float64(2.0 * Float64(a / x)));
	end
	return tmp
end
x, y = num2cell(sort([x, y])){:}
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if ((y * x) <= -1e+47)
		tmp = 0.5 * (x / (a / y));
	elseif ((y * x) <= 5e-34)
		tmp = -4.5 * (z / (a / t));
	elseif ((y * x) <= 0.05)
		tmp = (y * x) / (a * 2.0);
	elseif ((y * x) <= 1e+53)
		tmp = -4.5 * (t / (a / z));
	else
		tmp = y / (2.0 * (a / x));
	end
	tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: z and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_] := If[LessEqual[N[(y * x), $MachinePrecision], -1e+47], N[(0.5 * N[(x / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(y * x), $MachinePrecision], 5e-34], N[(-4.5 * N[(z / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(y * x), $MachinePrecision], 0.05], N[(N[(y * x), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(y * x), $MachinePrecision], 1e+53], N[(-4.5 * N[(t / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y / N[(2.0 * N[(a / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \cdot x \leq -1 \cdot 10^{+47}:\\
\;\;\;\;0.5 \cdot \frac{x}{\frac{a}{y}}\\

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

\mathbf{elif}\;y \cdot x \leq 0.05:\\
\;\;\;\;\frac{y \cdot x}{a \cdot 2}\\

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

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


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

    1. Initial program 89.4%

      \[\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2} \]
    2. Step-by-step derivation
      1. associate-*l*89.3%

        \[\leadsto \frac{x \cdot y - \color{blue}{z \cdot \left(9 \cdot t\right)}}{a \cdot 2} \]
    3. Simplified89.3%

      \[\leadsto \color{blue}{\frac{x \cdot y - z \cdot \left(9 \cdot t\right)}{a \cdot 2}} \]
    4. Taylor expanded in x around inf 77.0%

      \[\leadsto \color{blue}{0.5 \cdot \frac{x \cdot y}{a}} \]
    5. Step-by-step derivation
      1. associate-/l*80.6%

        \[\leadsto 0.5 \cdot \color{blue}{\frac{x}{\frac{a}{y}}} \]
    6. Simplified80.6%

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

    if -1e47 < (*.f64 x y) < 5.0000000000000003e-34

    1. Initial program 94.5%

      \[\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2} \]
    2. Step-by-step derivation
      1. associate-*l*94.5%

        \[\leadsto \frac{x \cdot y - \color{blue}{z \cdot \left(9 \cdot t\right)}}{a \cdot 2} \]
    3. Simplified94.5%

      \[\leadsto \color{blue}{\frac{x \cdot y - z \cdot \left(9 \cdot t\right)}{a \cdot 2}} \]
    4. Step-by-step derivation
      1. div-sub94.5%

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

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

        \[\leadsto \left(x \cdot y\right) \cdot \frac{1}{\color{blue}{2 \cdot a}} - \frac{z \cdot \left(9 \cdot t\right)}{a \cdot 2} \]
      4. associate-/r*94.4%

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

        \[\leadsto \left(x \cdot y\right) \cdot \frac{\color{blue}{0.5}}{a} - \frac{z \cdot \left(9 \cdot t\right)}{a \cdot 2} \]
      6. times-frac95.0%

        \[\leadsto \left(x \cdot y\right) \cdot \frac{0.5}{a} - \color{blue}{\frac{z}{a} \cdot \frac{9 \cdot t}{2}} \]
    5. Applied egg-rr95.0%

      \[\leadsto \color{blue}{\left(x \cdot y\right) \cdot \frac{0.5}{a} - \frac{z}{a} \cdot \frac{9 \cdot t}{2}} \]
    6. Taylor expanded in x around 0 75.0%

      \[\leadsto \color{blue}{-4.5 \cdot \frac{t \cdot z}{a}} \]
    7. Step-by-step derivation
      1. *-commutative75.0%

        \[\leadsto -4.5 \cdot \frac{\color{blue}{z \cdot t}}{a} \]
      2. associate-/l*73.8%

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

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

    if 5.0000000000000003e-34 < (*.f64 x y) < 0.050000000000000003

    1. Initial program 99.4%

      \[\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2} \]
    2. Step-by-step derivation
      1. associate-*l*99.4%

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

      \[\leadsto \color{blue}{\frac{x \cdot y - z \cdot \left(9 \cdot t\right)}{a \cdot 2}} \]
    4. Taylor expanded in x around inf 76.6%

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

    if 0.050000000000000003 < (*.f64 x y) < 9.9999999999999999e52

    1. Initial program 99.8%

      \[\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2} \]
    2. Step-by-step derivation
      1. associate-*l*99.5%

        \[\leadsto \frac{x \cdot y - \color{blue}{z \cdot \left(9 \cdot t\right)}}{a \cdot 2} \]
    3. Simplified99.5%

      \[\leadsto \color{blue}{\frac{x \cdot y - z \cdot \left(9 \cdot t\right)}{a \cdot 2}} \]
    4. Taylor expanded in x around 0 68.2%

      \[\leadsto \color{blue}{-4.5 \cdot \frac{t \cdot z}{a}} \]
    5. Step-by-step derivation
      1. associate-/l*68.2%

        \[\leadsto -4.5 \cdot \color{blue}{\frac{t}{\frac{a}{z}}} \]
    6. Simplified68.2%

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

    if 9.9999999999999999e52 < (*.f64 x y)

    1. Initial program 88.1%

      \[\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2} \]
    2. Step-by-step derivation
      1. associate-*l*88.1%

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

      \[\leadsto \color{blue}{\frac{x \cdot y - z \cdot \left(9 \cdot t\right)}{a \cdot 2}} \]
    4. Taylor expanded in x around inf 79.2%

      \[\leadsto \color{blue}{0.5 \cdot \frac{x \cdot y}{a}} \]
    5. Step-by-step derivation
      1. associate-/l*84.1%

        \[\leadsto 0.5 \cdot \color{blue}{\frac{x}{\frac{a}{y}}} \]
      2. associate-/r/84.5%

        \[\leadsto 0.5 \cdot \color{blue}{\left(\frac{x}{a} \cdot y\right)} \]
    6. Simplified84.5%

      \[\leadsto \color{blue}{0.5 \cdot \left(\frac{x}{a} \cdot y\right)} \]
    7. Step-by-step derivation
      1. metadata-eval84.5%

        \[\leadsto \color{blue}{\frac{1}{2}} \cdot \left(\frac{x}{a} \cdot y\right) \]
      2. associate-*l/79.2%

        \[\leadsto \frac{1}{2} \cdot \color{blue}{\frac{x \cdot y}{a}} \]
      3. times-frac79.2%

        \[\leadsto \color{blue}{\frac{1 \cdot \left(x \cdot y\right)}{2 \cdot a}} \]
      4. *-un-lft-identity79.2%

        \[\leadsto \frac{\color{blue}{x \cdot y}}{2 \cdot a} \]
      5. *-commutative79.2%

        \[\leadsto \frac{x \cdot y}{\color{blue}{a \cdot 2}} \]
      6. times-frac84.5%

        \[\leadsto \color{blue}{\frac{x}{a} \cdot \frac{y}{2}} \]
      7. clear-num84.0%

        \[\leadsto \color{blue}{\frac{1}{\frac{a}{x}}} \cdot \frac{y}{2} \]
      8. frac-times85.3%

        \[\leadsto \color{blue}{\frac{1 \cdot y}{\frac{a}{x} \cdot 2}} \]
      9. *-un-lft-identity85.3%

        \[\leadsto \frac{\color{blue}{y}}{\frac{a}{x} \cdot 2} \]
    8. Applied egg-rr85.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \cdot x \leq -1 \cdot 10^{+47}:\\ \;\;\;\;0.5 \cdot \frac{x}{\frac{a}{y}}\\ \mathbf{elif}\;y \cdot x \leq 5 \cdot 10^{-34}:\\ \;\;\;\;-4.5 \cdot \frac{z}{\frac{a}{t}}\\ \mathbf{elif}\;y \cdot x \leq 0.05:\\ \;\;\;\;\frac{y \cdot x}{a \cdot 2}\\ \mathbf{elif}\;y \cdot x \leq 10^{+53}:\\ \;\;\;\;-4.5 \cdot \frac{t}{\frac{a}{z}}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{2 \cdot \frac{a}{x}}\\ \end{array} \]

Alternative 3: 92.6% accurate, 0.7× speedup?

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

\mathbf{else}:\\
\;\;\;\;-4.5 \cdot \frac{t}{\frac{a}{z}}\\


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

    1. Initial program 94.9%

      \[\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2} \]
    2. Step-by-step derivation
      1. associate-*l*94.9%

        \[\leadsto \frac{x \cdot y - \color{blue}{z \cdot \left(9 \cdot t\right)}}{a \cdot 2} \]
    3. Simplified94.9%

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

    if 1e281 < (*.f64 (*.f64 z 9) t)

    1. Initial program 57.8%

      \[\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2} \]
    2. Step-by-step derivation
      1. associate-*l*57.8%

        \[\leadsto \frac{x \cdot y - \color{blue}{z \cdot \left(9 \cdot t\right)}}{a \cdot 2} \]
    3. Simplified57.8%

      \[\leadsto \color{blue}{\frac{x \cdot y - z \cdot \left(9 \cdot t\right)}{a \cdot 2}} \]
    4. Taylor expanded in x around 0 57.9%

      \[\leadsto \color{blue}{-4.5 \cdot \frac{t \cdot z}{a}} \]
    5. Step-by-step derivation
      1. associate-/l*94.4%

        \[\leadsto -4.5 \cdot \color{blue}{\frac{t}{\frac{a}{z}}} \]
    6. Simplified94.4%

      \[\leadsto \color{blue}{-4.5 \cdot \frac{t}{\frac{a}{z}}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification94.9%

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

Alternative 4: 92.9% accurate, 0.7× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 a 2) < -4.9999999999999998e34

    1. Initial program 80.2%

      \[\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2} \]
    2. Step-by-step derivation
      1. associate-*l*80.2%

        \[\leadsto \frac{x \cdot y - \color{blue}{z \cdot \left(9 \cdot t\right)}}{a \cdot 2} \]
    3. Simplified80.2%

      \[\leadsto \color{blue}{\frac{x \cdot y - z \cdot \left(9 \cdot t\right)}{a \cdot 2}} \]
    4. Step-by-step derivation
      1. div-sub80.2%

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

        \[\leadsto \color{blue}{\left(x \cdot y\right) \cdot \frac{1}{a \cdot 2}} - \frac{z \cdot \left(9 \cdot t\right)}{a \cdot 2} \]
      3. *-commutative80.1%

        \[\leadsto \left(x \cdot y\right) \cdot \frac{1}{\color{blue}{2 \cdot a}} - \frac{z \cdot \left(9 \cdot t\right)}{a \cdot 2} \]
      4. associate-/r*80.1%

        \[\leadsto \left(x \cdot y\right) \cdot \color{blue}{\frac{\frac{1}{2}}{a}} - \frac{z \cdot \left(9 \cdot t\right)}{a \cdot 2} \]
      5. metadata-eval80.1%

        \[\leadsto \left(x \cdot y\right) \cdot \frac{\color{blue}{0.5}}{a} - \frac{z \cdot \left(9 \cdot t\right)}{a \cdot 2} \]
      6. times-frac86.6%

        \[\leadsto \left(x \cdot y\right) \cdot \frac{0.5}{a} - \color{blue}{\frac{z}{a} \cdot \frac{9 \cdot t}{2}} \]
    5. Applied egg-rr86.6%

      \[\leadsto \color{blue}{\left(x \cdot y\right) \cdot \frac{0.5}{a} - \frac{z}{a} \cdot \frac{9 \cdot t}{2}} \]
    6. Taylor expanded in x around 0 86.8%

      \[\leadsto \color{blue}{0.5 \cdot \frac{x \cdot y}{a}} - \frac{z}{a} \cdot \frac{9 \cdot t}{2} \]
    7. Step-by-step derivation
      1. *-commutative86.8%

        \[\leadsto 0.5 \cdot \frac{\color{blue}{y \cdot x}}{a} - \frac{z}{a} \cdot \frac{9 \cdot t}{2} \]
      2. associate-*r/94.0%

        \[\leadsto 0.5 \cdot \color{blue}{\left(y \cdot \frac{x}{a}\right)} - \frac{z}{a} \cdot \frac{9 \cdot t}{2} \]
    8. Simplified94.0%

      \[\leadsto \color{blue}{0.5 \cdot \left(y \cdot \frac{x}{a}\right)} - \frac{z}{a} \cdot \frac{9 \cdot t}{2} \]
    9. Taylor expanded in z around 0 84.9%

      \[\leadsto 0.5 \cdot \left(y \cdot \frac{x}{a}\right) - \color{blue}{4.5 \cdot \frac{t \cdot z}{a}} \]
    10. Step-by-step derivation
      1. associate-*l/94.0%

        \[\leadsto 0.5 \cdot \left(y \cdot \frac{x}{a}\right) - 4.5 \cdot \color{blue}{\left(\frac{t}{a} \cdot z\right)} \]
      2. *-commutative94.0%

        \[\leadsto 0.5 \cdot \left(y \cdot \frac{x}{a}\right) - \color{blue}{\left(\frac{t}{a} \cdot z\right) \cdot 4.5} \]
      3. associate-*l*93.9%

        \[\leadsto 0.5 \cdot \left(y \cdot \frac{x}{a}\right) - \color{blue}{\frac{t}{a} \cdot \left(z \cdot 4.5\right)} \]
    11. Simplified93.9%

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

    if -4.9999999999999998e34 < (*.f64 a 2)

    1. Initial program 97.1%

      \[\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2} \]
    2. Step-by-step derivation
      1. associate-*l*97.1%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \cdot 2 \leq -5 \cdot 10^{+34}:\\ \;\;\;\;0.5 \cdot \left(y \cdot \frac{x}{a}\right) - \frac{t}{a} \cdot \left(z \cdot 4.5\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{y \cdot x - z \cdot \left(9 \cdot t\right)}{a \cdot 2}\\ \end{array} \]

Alternative 5: 67.7% accurate, 1.0× speedup?

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

\mathbf{elif}\;y \leq 3.3 \cdot 10^{-231}:\\
\;\;\;\;-4.5 \cdot \frac{z \cdot t}{a}\\

\mathbf{elif}\;y \leq 5.8 \cdot 10^{+14}:\\
\;\;\;\;-4.5 \cdot \frac{z}{\frac{a}{t}}\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.3999999999999999e-149 or 5.8e14 < y

    1. Initial program 90.5%

      \[\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2} \]
    2. Step-by-step derivation
      1. associate-*l*90.6%

        \[\leadsto \frac{x \cdot y - \color{blue}{z \cdot \left(9 \cdot t\right)}}{a \cdot 2} \]
    3. Simplified90.6%

      \[\leadsto \color{blue}{\frac{x \cdot y - z \cdot \left(9 \cdot t\right)}{a \cdot 2}} \]
    4. Taylor expanded in x around inf 65.9%

      \[\leadsto \color{blue}{0.5 \cdot \frac{x \cdot y}{a}} \]
    5. Step-by-step derivation
      1. associate-/l*67.9%

        \[\leadsto 0.5 \cdot \color{blue}{\frac{x}{\frac{a}{y}}} \]
      2. associate-/r/66.9%

        \[\leadsto 0.5 \cdot \color{blue}{\left(\frac{x}{a} \cdot y\right)} \]
    6. Simplified66.9%

      \[\leadsto \color{blue}{0.5 \cdot \left(\frac{x}{a} \cdot y\right)} \]

    if -1.3999999999999999e-149 < y < 3.30000000000000028e-231

    1. Initial program 96.2%

      \[\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2} \]
    2. Step-by-step derivation
      1. associate-*l*96.2%

        \[\leadsto \frac{x \cdot y - \color{blue}{z \cdot \left(9 \cdot t\right)}}{a \cdot 2} \]
    3. Simplified96.2%

      \[\leadsto \color{blue}{\frac{x \cdot y - z \cdot \left(9 \cdot t\right)}{a \cdot 2}} \]
    4. Taylor expanded in x around 0 79.9%

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

    if 3.30000000000000028e-231 < y < 5.8e14

    1. Initial program 93.5%

      \[\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2} \]
    2. Step-by-step derivation
      1. associate-*l*93.5%

        \[\leadsto \frac{x \cdot y - \color{blue}{z \cdot \left(9 \cdot t\right)}}{a \cdot 2} \]
    3. Simplified93.5%

      \[\leadsto \color{blue}{\frac{x \cdot y - z \cdot \left(9 \cdot t\right)}{a \cdot 2}} \]
    4. Step-by-step derivation
      1. div-sub93.5%

        \[\leadsto \color{blue}{\frac{x \cdot y}{a \cdot 2} - \frac{z \cdot \left(9 \cdot t\right)}{a \cdot 2}} \]
      2. div-inv93.6%

        \[\leadsto \color{blue}{\left(x \cdot y\right) \cdot \frac{1}{a \cdot 2}} - \frac{z \cdot \left(9 \cdot t\right)}{a \cdot 2} \]
      3. *-commutative93.6%

        \[\leadsto \left(x \cdot y\right) \cdot \frac{1}{\color{blue}{2 \cdot a}} - \frac{z \cdot \left(9 \cdot t\right)}{a \cdot 2} \]
      4. associate-/r*93.6%

        \[\leadsto \left(x \cdot y\right) \cdot \color{blue}{\frac{\frac{1}{2}}{a}} - \frac{z \cdot \left(9 \cdot t\right)}{a \cdot 2} \]
      5. metadata-eval93.6%

        \[\leadsto \left(x \cdot y\right) \cdot \frac{\color{blue}{0.5}}{a} - \frac{z \cdot \left(9 \cdot t\right)}{a \cdot 2} \]
      6. times-frac99.6%

        \[\leadsto \left(x \cdot y\right) \cdot \frac{0.5}{a} - \color{blue}{\frac{z}{a} \cdot \frac{9 \cdot t}{2}} \]
    5. Applied egg-rr99.6%

      \[\leadsto \color{blue}{\left(x \cdot y\right) \cdot \frac{0.5}{a} - \frac{z}{a} \cdot \frac{9 \cdot t}{2}} \]
    6. Taylor expanded in x around 0 69.6%

      \[\leadsto \color{blue}{-4.5 \cdot \frac{t \cdot z}{a}} \]
    7. Step-by-step derivation
      1. *-commutative69.6%

        \[\leadsto -4.5 \cdot \frac{\color{blue}{z \cdot t}}{a} \]
      2. associate-/l*70.8%

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

      \[\leadsto \color{blue}{-4.5 \cdot \frac{z}{\frac{a}{t}}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification70.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.4 \cdot 10^{-149}:\\ \;\;\;\;0.5 \cdot \left(y \cdot \frac{x}{a}\right)\\ \mathbf{elif}\;y \leq 3.3 \cdot 10^{-231}:\\ \;\;\;\;-4.5 \cdot \frac{z \cdot t}{a}\\ \mathbf{elif}\;y \leq 5.8 \cdot 10^{+14}:\\ \;\;\;\;-4.5 \cdot \frac{z}{\frac{a}{t}}\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \left(y \cdot \frac{x}{a}\right)\\ \end{array} \]

Alternative 6: 67.8% accurate, 1.0× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ [z, t] = \mathsf{sort}([z, t])\\ \\ \begin{array}{l} \mathbf{if}\;y \leq -1.85 \cdot 10^{-149}:\\ \;\;\;\;0.5 \cdot \left(y \cdot \frac{x}{a}\right)\\ \mathbf{elif}\;y \leq 2.9 \cdot 10^{-231}:\\ \;\;\;\;-4.5 \cdot \frac{z \cdot t}{a}\\ \mathbf{elif}\;y \leq 2800000000:\\ \;\;\;\;-4.5 \cdot \frac{z}{\frac{a}{t}}\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \frac{x}{\frac{a}{y}}\\ \end{array} \end{array} \]
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: z and t should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
 :precision binary64
 (if (<= y -1.85e-149)
   (* 0.5 (* y (/ x a)))
   (if (<= y 2.9e-231)
     (* -4.5 (/ (* z t) a))
     (if (<= y 2800000000.0) (* -4.5 (/ z (/ a t))) (* 0.5 (/ x (/ a y)))))))
assert(x < y);
assert(z < t);
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (y <= -1.85e-149) {
		tmp = 0.5 * (y * (x / a));
	} else if (y <= 2.9e-231) {
		tmp = -4.5 * ((z * t) / a);
	} else if (y <= 2800000000.0) {
		tmp = -4.5 * (z / (a / t));
	} else {
		tmp = 0.5 * (x / (a / y));
	}
	return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: z and t 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 <= (-1.85d-149)) then
        tmp = 0.5d0 * (y * (x / a))
    else if (y <= 2.9d-231) then
        tmp = (-4.5d0) * ((z * t) / a)
    else if (y <= 2800000000.0d0) then
        tmp = (-4.5d0) * (z / (a / t))
    else
        tmp = 0.5d0 * (x / (a / y))
    end if
    code = tmp
end function
assert x < y;
assert z < t;
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (y <= -1.85e-149) {
		tmp = 0.5 * (y * (x / a));
	} else if (y <= 2.9e-231) {
		tmp = -4.5 * ((z * t) / a);
	} else if (y <= 2800000000.0) {
		tmp = -4.5 * (z / (a / t));
	} else {
		tmp = 0.5 * (x / (a / y));
	}
	return tmp;
}
[x, y] = sort([x, y])
[z, t] = sort([z, t])
def code(x, y, z, t, a):
	tmp = 0
	if y <= -1.85e-149:
		tmp = 0.5 * (y * (x / a))
	elif y <= 2.9e-231:
		tmp = -4.5 * ((z * t) / a)
	elif y <= 2800000000.0:
		tmp = -4.5 * (z / (a / t))
	else:
		tmp = 0.5 * (x / (a / y))
	return tmp
x, y = sort([x, y])
z, t = sort([z, t])
function code(x, y, z, t, a)
	tmp = 0.0
	if (y <= -1.85e-149)
		tmp = Float64(0.5 * Float64(y * Float64(x / a)));
	elseif (y <= 2.9e-231)
		tmp = Float64(-4.5 * Float64(Float64(z * t) / a));
	elseif (y <= 2800000000.0)
		tmp = Float64(-4.5 * Float64(z / Float64(a / t)));
	else
		tmp = Float64(0.5 * Float64(x / Float64(a / y)));
	end
	return tmp
end
x, y = num2cell(sort([x, y])){:}
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (y <= -1.85e-149)
		tmp = 0.5 * (y * (x / a));
	elseif (y <= 2.9e-231)
		tmp = -4.5 * ((z * t) / a);
	elseif (y <= 2800000000.0)
		tmp = -4.5 * (z / (a / t));
	else
		tmp = 0.5 * (x / (a / y));
	end
	tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: z and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -1.85e-149], N[(0.5 * N[(y * N[(x / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.9e-231], N[(-4.5 * N[(N[(z * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2800000000.0], N[(-4.5 * N[(z / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(x / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.85 \cdot 10^{-149}:\\
\;\;\;\;0.5 \cdot \left(y \cdot \frac{x}{a}\right)\\

\mathbf{elif}\;y \leq 2.9 \cdot 10^{-231}:\\
\;\;\;\;-4.5 \cdot \frac{z \cdot t}{a}\\

\mathbf{elif}\;y \leq 2800000000:\\
\;\;\;\;-4.5 \cdot \frac{z}{\frac{a}{t}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -1.84999999999999995e-149

    1. Initial program 92.6%

      \[\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2} \]
    2. Step-by-step derivation
      1. associate-*l*92.7%

        \[\leadsto \frac{x \cdot y - \color{blue}{z \cdot \left(9 \cdot t\right)}}{a \cdot 2} \]
    3. Simplified92.7%

      \[\leadsto \color{blue}{\frac{x \cdot y - z \cdot \left(9 \cdot t\right)}{a \cdot 2}} \]
    4. Taylor expanded in x around inf 68.7%

      \[\leadsto \color{blue}{0.5 \cdot \frac{x \cdot y}{a}} \]
    5. Step-by-step derivation
      1. associate-/l*68.0%

        \[\leadsto 0.5 \cdot \color{blue}{\frac{x}{\frac{a}{y}}} \]
      2. associate-/r/66.3%

        \[\leadsto 0.5 \cdot \color{blue}{\left(\frac{x}{a} \cdot y\right)} \]
    6. Simplified66.3%

      \[\leadsto \color{blue}{0.5 \cdot \left(\frac{x}{a} \cdot y\right)} \]

    if -1.84999999999999995e-149 < y < 2.9000000000000001e-231

    1. Initial program 96.2%

      \[\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2} \]
    2. Step-by-step derivation
      1. associate-*l*96.2%

        \[\leadsto \frac{x \cdot y - \color{blue}{z \cdot \left(9 \cdot t\right)}}{a \cdot 2} \]
    3. Simplified96.2%

      \[\leadsto \color{blue}{\frac{x \cdot y - z \cdot \left(9 \cdot t\right)}{a \cdot 2}} \]
    4. Taylor expanded in x around 0 79.9%

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

    if 2.9000000000000001e-231 < y < 2.8e9

    1. Initial program 93.4%

      \[\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2} \]
    2. Step-by-step derivation
      1. associate-*l*93.4%

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

      \[\leadsto \color{blue}{\frac{x \cdot y - z \cdot \left(9 \cdot t\right)}{a \cdot 2}} \]
    4. Step-by-step derivation
      1. div-sub93.4%

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

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

        \[\leadsto \left(x \cdot y\right) \cdot \frac{1}{\color{blue}{2 \cdot a}} - \frac{z \cdot \left(9 \cdot t\right)}{a \cdot 2} \]
      4. associate-/r*93.4%

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

        \[\leadsto \left(x \cdot y\right) \cdot \frac{\color{blue}{0.5}}{a} - \frac{z \cdot \left(9 \cdot t\right)}{a \cdot 2} \]
      6. times-frac99.6%

        \[\leadsto \left(x \cdot y\right) \cdot \frac{0.5}{a} - \color{blue}{\frac{z}{a} \cdot \frac{9 \cdot t}{2}} \]
    5. Applied egg-rr99.6%

      \[\leadsto \color{blue}{\left(x \cdot y\right) \cdot \frac{0.5}{a} - \frac{z}{a} \cdot \frac{9 \cdot t}{2}} \]
    6. Taylor expanded in x around 0 71.0%

      \[\leadsto \color{blue}{-4.5 \cdot \frac{t \cdot z}{a}} \]
    7. Step-by-step derivation
      1. *-commutative71.0%

        \[\leadsto -4.5 \cdot \frac{\color{blue}{z \cdot t}}{a} \]
      2. associate-/l*72.2%

        \[\leadsto -4.5 \cdot \color{blue}{\frac{z}{\frac{a}{t}}} \]
    8. Simplified72.2%

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

    if 2.8e9 < y

    1. Initial program 87.6%

      \[\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2} \]
    2. Step-by-step derivation
      1. associate-*l*87.6%

        \[\leadsto \frac{x \cdot y - \color{blue}{z \cdot \left(9 \cdot t\right)}}{a \cdot 2} \]
    3. Simplified87.6%

      \[\leadsto \color{blue}{\frac{x \cdot y - z \cdot \left(9 \cdot t\right)}{a \cdot 2}} \]
    4. Taylor expanded in x around inf 62.3%

      \[\leadsto \color{blue}{0.5 \cdot \frac{x \cdot y}{a}} \]
    5. Step-by-step derivation
      1. associate-/l*68.2%

        \[\leadsto 0.5 \cdot \color{blue}{\frac{x}{\frac{a}{y}}} \]
    6. Simplified68.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.85 \cdot 10^{-149}:\\ \;\;\;\;0.5 \cdot \left(y \cdot \frac{x}{a}\right)\\ \mathbf{elif}\;y \leq 2.9 \cdot 10^{-231}:\\ \;\;\;\;-4.5 \cdot \frac{z \cdot t}{a}\\ \mathbf{elif}\;y \leq 2800000000:\\ \;\;\;\;-4.5 \cdot \frac{z}{\frac{a}{t}}\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \frac{x}{\frac{a}{y}}\\ \end{array} \]

Alternative 7: 67.7% accurate, 1.0× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ [z, t] = \mathsf{sort}([z, t])\\ \\ \begin{array}{l} t_1 := \frac{y}{a} \cdot \frac{x}{2}\\ \mathbf{if}\;y \leq -1.2 \cdot 10^{-150}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 3 \cdot 10^{-231}:\\ \;\;\;\;-4.5 \cdot \frac{z \cdot t}{a}\\ \mathbf{elif}\;y \leq 19000000000:\\ \;\;\;\;-4.5 \cdot \frac{z}{\frac{a}{t}}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: z and t should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* (/ y a) (/ x 2.0))))
   (if (<= y -1.2e-150)
     t_1
     (if (<= y 3e-231)
       (* -4.5 (/ (* z t) a))
       (if (<= y 19000000000.0) (* -4.5 (/ z (/ a t))) t_1)))))
assert(x < y);
assert(z < t);
double code(double x, double y, double z, double t, double a) {
	double t_1 = (y / a) * (x / 2.0);
	double tmp;
	if (y <= -1.2e-150) {
		tmp = t_1;
	} else if (y <= 3e-231) {
		tmp = -4.5 * ((z * t) / a);
	} else if (y <= 19000000000.0) {
		tmp = -4.5 * (z / (a / t));
	} else {
		tmp = t_1;
	}
	return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: z and t 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 = (y / a) * (x / 2.0d0)
    if (y <= (-1.2d-150)) then
        tmp = t_1
    else if (y <= 3d-231) then
        tmp = (-4.5d0) * ((z * t) / a)
    else if (y <= 19000000000.0d0) then
        tmp = (-4.5d0) * (z / (a / t))
    else
        tmp = t_1
    end if
    code = tmp
end function
assert x < y;
assert z < t;
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = (y / a) * (x / 2.0);
	double tmp;
	if (y <= -1.2e-150) {
		tmp = t_1;
	} else if (y <= 3e-231) {
		tmp = -4.5 * ((z * t) / a);
	} else if (y <= 19000000000.0) {
		tmp = -4.5 * (z / (a / t));
	} else {
		tmp = t_1;
	}
	return tmp;
}
[x, y] = sort([x, y])
[z, t] = sort([z, t])
def code(x, y, z, t, a):
	t_1 = (y / a) * (x / 2.0)
	tmp = 0
	if y <= -1.2e-150:
		tmp = t_1
	elif y <= 3e-231:
		tmp = -4.5 * ((z * t) / a)
	elif y <= 19000000000.0:
		tmp = -4.5 * (z / (a / t))
	else:
		tmp = t_1
	return tmp
x, y = sort([x, y])
z, t = sort([z, t])
function code(x, y, z, t, a)
	t_1 = Float64(Float64(y / a) * Float64(x / 2.0))
	tmp = 0.0
	if (y <= -1.2e-150)
		tmp = t_1;
	elseif (y <= 3e-231)
		tmp = Float64(-4.5 * Float64(Float64(z * t) / a));
	elseif (y <= 19000000000.0)
		tmp = Float64(-4.5 * Float64(z / Float64(a / t)));
	else
		tmp = t_1;
	end
	return tmp
end
x, y = num2cell(sort([x, y])){:}
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t, a)
	t_1 = (y / a) * (x / 2.0);
	tmp = 0.0;
	if (y <= -1.2e-150)
		tmp = t_1;
	elseif (y <= 3e-231)
		tmp = -4.5 * ((z * t) / a);
	elseif (y <= 19000000000.0)
		tmp = -4.5 * (z / (a / t));
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: z and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y / a), $MachinePrecision] * N[(x / 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.2e-150], t$95$1, If[LessEqual[y, 3e-231], N[(-4.5 * N[(N[(z * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 19000000000.0], N[(-4.5 * N[(z / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
t_1 := \frac{y}{a} \cdot \frac{x}{2}\\
\mathbf{if}\;y \leq -1.2 \cdot 10^{-150}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq 3 \cdot 10^{-231}:\\
\;\;\;\;-4.5 \cdot \frac{z \cdot t}{a}\\

\mathbf{elif}\;y \leq 19000000000:\\
\;\;\;\;-4.5 \cdot \frac{z}{\frac{a}{t}}\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.2e-150 or 1.9e10 < y

    1. Initial program 90.6%

      \[\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2} \]
    2. Step-by-step derivation
      1. associate-*l*90.6%

        \[\leadsto \frac{x \cdot y - \color{blue}{z \cdot \left(9 \cdot t\right)}}{a \cdot 2} \]
    3. Simplified90.6%

      \[\leadsto \color{blue}{\frac{x \cdot y - z \cdot \left(9 \cdot t\right)}{a \cdot 2}} \]
    4. Taylor expanded in x around inf 66.1%

      \[\leadsto \frac{\color{blue}{x \cdot y}}{a \cdot 2} \]
    5. Step-by-step derivation
      1. *-commutative66.1%

        \[\leadsto \frac{\color{blue}{y \cdot x}}{a \cdot 2} \]
      2. times-frac68.3%

        \[\leadsto \color{blue}{\frac{y}{a} \cdot \frac{x}{2}} \]
    6. Applied egg-rr68.3%

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

    if -1.2e-150 < y < 3.0000000000000003e-231

    1. Initial program 96.2%

      \[\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2} \]
    2. Step-by-step derivation
      1. associate-*l*96.2%

        \[\leadsto \frac{x \cdot y - \color{blue}{z \cdot \left(9 \cdot t\right)}}{a \cdot 2} \]
    3. Simplified96.2%

      \[\leadsto \color{blue}{\frac{x \cdot y - z \cdot \left(9 \cdot t\right)}{a \cdot 2}} \]
    4. Taylor expanded in x around 0 79.9%

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

    if 3.0000000000000003e-231 < y < 1.9e10

    1. Initial program 93.4%

      \[\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2} \]
    2. Step-by-step derivation
      1. associate-*l*93.4%

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

      \[\leadsto \color{blue}{\frac{x \cdot y - z \cdot \left(9 \cdot t\right)}{a \cdot 2}} \]
    4. Step-by-step derivation
      1. div-sub93.4%

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

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

        \[\leadsto \left(x \cdot y\right) \cdot \frac{1}{\color{blue}{2 \cdot a}} - \frac{z \cdot \left(9 \cdot t\right)}{a \cdot 2} \]
      4. associate-/r*93.4%

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

        \[\leadsto \left(x \cdot y\right) \cdot \frac{\color{blue}{0.5}}{a} - \frac{z \cdot \left(9 \cdot t\right)}{a \cdot 2} \]
      6. times-frac99.6%

        \[\leadsto \left(x \cdot y\right) \cdot \frac{0.5}{a} - \color{blue}{\frac{z}{a} \cdot \frac{9 \cdot t}{2}} \]
    5. Applied egg-rr99.6%

      \[\leadsto \color{blue}{\left(x \cdot y\right) \cdot \frac{0.5}{a} - \frac{z}{a} \cdot \frac{9 \cdot t}{2}} \]
    6. Taylor expanded in x around 0 71.0%

      \[\leadsto \color{blue}{-4.5 \cdot \frac{t \cdot z}{a}} \]
    7. Step-by-step derivation
      1. *-commutative71.0%

        \[\leadsto -4.5 \cdot \frac{\color{blue}{z \cdot t}}{a} \]
      2. associate-/l*72.2%

        \[\leadsto -4.5 \cdot \color{blue}{\frac{z}{\frac{a}{t}}} \]
    8. Simplified72.2%

      \[\leadsto \color{blue}{-4.5 \cdot \frac{z}{\frac{a}{t}}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification71.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.2 \cdot 10^{-150}:\\ \;\;\;\;\frac{y}{a} \cdot \frac{x}{2}\\ \mathbf{elif}\;y \leq 3 \cdot 10^{-231}:\\ \;\;\;\;-4.5 \cdot \frac{z \cdot t}{a}\\ \mathbf{elif}\;y \leq 19000000000:\\ \;\;\;\;-4.5 \cdot \frac{z}{\frac{a}{t}}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a} \cdot \frac{x}{2}\\ \end{array} \]

Alternative 8: 67.8% accurate, 1.0× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ [z, t] = \mathsf{sort}([z, t])\\ \\ \begin{array}{l} \mathbf{if}\;y \leq -1.85 \cdot 10^{-149}:\\ \;\;\;\;\frac{y}{2 \cdot \frac{a}{x}}\\ \mathbf{elif}\;y \leq 3.5 \cdot 10^{-231}:\\ \;\;\;\;-4.5 \cdot \frac{z \cdot t}{a}\\ \mathbf{elif}\;y \leq 18000000000:\\ \;\;\;\;-4.5 \cdot \frac{z}{\frac{a}{t}}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a} \cdot \frac{x}{2}\\ \end{array} \end{array} \]
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: z and t should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
 :precision binary64
 (if (<= y -1.85e-149)
   (/ y (* 2.0 (/ a x)))
   (if (<= y 3.5e-231)
     (* -4.5 (/ (* z t) a))
     (if (<= y 18000000000.0) (* -4.5 (/ z (/ a t))) (* (/ y a) (/ x 2.0))))))
assert(x < y);
assert(z < t);
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (y <= -1.85e-149) {
		tmp = y / (2.0 * (a / x));
	} else if (y <= 3.5e-231) {
		tmp = -4.5 * ((z * t) / a);
	} else if (y <= 18000000000.0) {
		tmp = -4.5 * (z / (a / t));
	} else {
		tmp = (y / a) * (x / 2.0);
	}
	return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: z and t 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 <= (-1.85d-149)) then
        tmp = y / (2.0d0 * (a / x))
    else if (y <= 3.5d-231) then
        tmp = (-4.5d0) * ((z * t) / a)
    else if (y <= 18000000000.0d0) then
        tmp = (-4.5d0) * (z / (a / t))
    else
        tmp = (y / a) * (x / 2.0d0)
    end if
    code = tmp
end function
assert x < y;
assert z < t;
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (y <= -1.85e-149) {
		tmp = y / (2.0 * (a / x));
	} else if (y <= 3.5e-231) {
		tmp = -4.5 * ((z * t) / a);
	} else if (y <= 18000000000.0) {
		tmp = -4.5 * (z / (a / t));
	} else {
		tmp = (y / a) * (x / 2.0);
	}
	return tmp;
}
[x, y] = sort([x, y])
[z, t] = sort([z, t])
def code(x, y, z, t, a):
	tmp = 0
	if y <= -1.85e-149:
		tmp = y / (2.0 * (a / x))
	elif y <= 3.5e-231:
		tmp = -4.5 * ((z * t) / a)
	elif y <= 18000000000.0:
		tmp = -4.5 * (z / (a / t))
	else:
		tmp = (y / a) * (x / 2.0)
	return tmp
x, y = sort([x, y])
z, t = sort([z, t])
function code(x, y, z, t, a)
	tmp = 0.0
	if (y <= -1.85e-149)
		tmp = Float64(y / Float64(2.0 * Float64(a / x)));
	elseif (y <= 3.5e-231)
		tmp = Float64(-4.5 * Float64(Float64(z * t) / a));
	elseif (y <= 18000000000.0)
		tmp = Float64(-4.5 * Float64(z / Float64(a / t)));
	else
		tmp = Float64(Float64(y / a) * Float64(x / 2.0));
	end
	return tmp
end
x, y = num2cell(sort([x, y])){:}
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (y <= -1.85e-149)
		tmp = y / (2.0 * (a / x));
	elseif (y <= 3.5e-231)
		tmp = -4.5 * ((z * t) / a);
	elseif (y <= 18000000000.0)
		tmp = -4.5 * (z / (a / t));
	else
		tmp = (y / a) * (x / 2.0);
	end
	tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: z and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -1.85e-149], N[(y / N[(2.0 * N[(a / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.5e-231], N[(-4.5 * N[(N[(z * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 18000000000.0], N[(-4.5 * N[(z / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y / a), $MachinePrecision] * N[(x / 2.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.85 \cdot 10^{-149}:\\
\;\;\;\;\frac{y}{2 \cdot \frac{a}{x}}\\

\mathbf{elif}\;y \leq 3.5 \cdot 10^{-231}:\\
\;\;\;\;-4.5 \cdot \frac{z \cdot t}{a}\\

\mathbf{elif}\;y \leq 18000000000:\\
\;\;\;\;-4.5 \cdot \frac{z}{\frac{a}{t}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -1.84999999999999995e-149

    1. Initial program 92.6%

      \[\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2} \]
    2. Step-by-step derivation
      1. associate-*l*92.7%

        \[\leadsto \frac{x \cdot y - \color{blue}{z \cdot \left(9 \cdot t\right)}}{a \cdot 2} \]
    3. Simplified92.7%

      \[\leadsto \color{blue}{\frac{x \cdot y - z \cdot \left(9 \cdot t\right)}{a \cdot 2}} \]
    4. Taylor expanded in x around inf 68.7%

      \[\leadsto \color{blue}{0.5 \cdot \frac{x \cdot y}{a}} \]
    5. Step-by-step derivation
      1. associate-/l*68.0%

        \[\leadsto 0.5 \cdot \color{blue}{\frac{x}{\frac{a}{y}}} \]
      2. associate-/r/66.3%

        \[\leadsto 0.5 \cdot \color{blue}{\left(\frac{x}{a} \cdot y\right)} \]
    6. Simplified66.3%

      \[\leadsto \color{blue}{0.5 \cdot \left(\frac{x}{a} \cdot y\right)} \]
    7. Step-by-step derivation
      1. metadata-eval66.3%

        \[\leadsto \color{blue}{\frac{1}{2}} \cdot \left(\frac{x}{a} \cdot y\right) \]
      2. associate-*l/68.7%

        \[\leadsto \frac{1}{2} \cdot \color{blue}{\frac{x \cdot y}{a}} \]
      3. times-frac68.7%

        \[\leadsto \color{blue}{\frac{1 \cdot \left(x \cdot y\right)}{2 \cdot a}} \]
      4. *-un-lft-identity68.7%

        \[\leadsto \frac{\color{blue}{x \cdot y}}{2 \cdot a} \]
      5. *-commutative68.7%

        \[\leadsto \frac{x \cdot y}{\color{blue}{a \cdot 2}} \]
      6. times-frac66.3%

        \[\leadsto \color{blue}{\frac{x}{a} \cdot \frac{y}{2}} \]
      7. clear-num65.6%

        \[\leadsto \color{blue}{\frac{1}{\frac{a}{x}}} \cdot \frac{y}{2} \]
      8. frac-times66.4%

        \[\leadsto \color{blue}{\frac{1 \cdot y}{\frac{a}{x} \cdot 2}} \]
      9. *-un-lft-identity66.4%

        \[\leadsto \frac{\color{blue}{y}}{\frac{a}{x} \cdot 2} \]
    8. Applied egg-rr66.4%

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

    if -1.84999999999999995e-149 < y < 3.5000000000000001e-231

    1. Initial program 96.2%

      \[\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2} \]
    2. Step-by-step derivation
      1. associate-*l*96.2%

        \[\leadsto \frac{x \cdot y - \color{blue}{z \cdot \left(9 \cdot t\right)}}{a \cdot 2} \]
    3. Simplified96.2%

      \[\leadsto \color{blue}{\frac{x \cdot y - z \cdot \left(9 \cdot t\right)}{a \cdot 2}} \]
    4. Taylor expanded in x around 0 79.9%

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

    if 3.5000000000000001e-231 < y < 1.8e10

    1. Initial program 93.4%

      \[\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2} \]
    2. Step-by-step derivation
      1. associate-*l*93.4%

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

      \[\leadsto \color{blue}{\frac{x \cdot y - z \cdot \left(9 \cdot t\right)}{a \cdot 2}} \]
    4. Step-by-step derivation
      1. div-sub93.4%

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

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

        \[\leadsto \left(x \cdot y\right) \cdot \frac{1}{\color{blue}{2 \cdot a}} - \frac{z \cdot \left(9 \cdot t\right)}{a \cdot 2} \]
      4. associate-/r*93.4%

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

        \[\leadsto \left(x \cdot y\right) \cdot \frac{\color{blue}{0.5}}{a} - \frac{z \cdot \left(9 \cdot t\right)}{a \cdot 2} \]
      6. times-frac99.6%

        \[\leadsto \left(x \cdot y\right) \cdot \frac{0.5}{a} - \color{blue}{\frac{z}{a} \cdot \frac{9 \cdot t}{2}} \]
    5. Applied egg-rr99.6%

      \[\leadsto \color{blue}{\left(x \cdot y\right) \cdot \frac{0.5}{a} - \frac{z}{a} \cdot \frac{9 \cdot t}{2}} \]
    6. Taylor expanded in x around 0 71.0%

      \[\leadsto \color{blue}{-4.5 \cdot \frac{t \cdot z}{a}} \]
    7. Step-by-step derivation
      1. *-commutative71.0%

        \[\leadsto -4.5 \cdot \frac{\color{blue}{z \cdot t}}{a} \]
      2. associate-/l*72.2%

        \[\leadsto -4.5 \cdot \color{blue}{\frac{z}{\frac{a}{t}}} \]
    8. Simplified72.2%

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

    if 1.8e10 < y

    1. Initial program 87.6%

      \[\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2} \]
    2. Step-by-step derivation
      1. associate-*l*87.6%

        \[\leadsto \frac{x \cdot y - \color{blue}{z \cdot \left(9 \cdot t\right)}}{a \cdot 2} \]
    3. Simplified87.6%

      \[\leadsto \color{blue}{\frac{x \cdot y - z \cdot \left(9 \cdot t\right)}{a \cdot 2}} \]
    4. Taylor expanded in x around inf 62.3%

      \[\leadsto \frac{\color{blue}{x \cdot y}}{a \cdot 2} \]
    5. Step-by-step derivation
      1. *-commutative62.3%

        \[\leadsto \frac{\color{blue}{y \cdot x}}{a \cdot 2} \]
      2. times-frac68.3%

        \[\leadsto \color{blue}{\frac{y}{a} \cdot \frac{x}{2}} \]
    6. Applied egg-rr68.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.85 \cdot 10^{-149}:\\ \;\;\;\;\frac{y}{2 \cdot \frac{a}{x}}\\ \mathbf{elif}\;y \leq 3.5 \cdot 10^{-231}:\\ \;\;\;\;-4.5 \cdot \frac{z \cdot t}{a}\\ \mathbf{elif}\;y \leq 18000000000:\\ \;\;\;\;-4.5 \cdot \frac{z}{\frac{a}{t}}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a} \cdot \frac{x}{2}\\ \end{array} \]

Alternative 9: 51.0% accurate, 1.9× speedup?

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

    \[\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2} \]
  2. Step-by-step derivation
    1. associate-*l*92.3%

      \[\leadsto \frac{x \cdot y - \color{blue}{z \cdot \left(9 \cdot t\right)}}{a \cdot 2} \]
  3. Simplified92.3%

    \[\leadsto \color{blue}{\frac{x \cdot y - z \cdot \left(9 \cdot t\right)}{a \cdot 2}} \]
  4. Taylor expanded in x around 0 49.7%

    \[\leadsto \color{blue}{-4.5 \cdot \frac{t \cdot z}{a}} \]
  5. Step-by-step derivation
    1. associate-/l*50.8%

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

    \[\leadsto \color{blue}{-4.5 \cdot \frac{t}{\frac{a}{z}}} \]
  7. Final simplification50.8%

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

Alternative 10: 50.7% accurate, 1.9× speedup?

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

    \[\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2} \]
  2. Step-by-step derivation
    1. associate-*l*92.3%

      \[\leadsto \frac{x \cdot y - \color{blue}{z \cdot \left(9 \cdot t\right)}}{a \cdot 2} \]
  3. Simplified92.3%

    \[\leadsto \color{blue}{\frac{x \cdot y - z \cdot \left(9 \cdot t\right)}{a \cdot 2}} \]
  4. Step-by-step derivation
    1. div-sub90.0%

      \[\leadsto \color{blue}{\frac{x \cdot y}{a \cdot 2} - \frac{z \cdot \left(9 \cdot t\right)}{a \cdot 2}} \]
    2. div-inv89.9%

      \[\leadsto \color{blue}{\left(x \cdot y\right) \cdot \frac{1}{a \cdot 2}} - \frac{z \cdot \left(9 \cdot t\right)}{a \cdot 2} \]
    3. *-commutative89.9%

      \[\leadsto \left(x \cdot y\right) \cdot \frac{1}{\color{blue}{2 \cdot a}} - \frac{z \cdot \left(9 \cdot t\right)}{a \cdot 2} \]
    4. associate-/r*89.9%

      \[\leadsto \left(x \cdot y\right) \cdot \color{blue}{\frac{\frac{1}{2}}{a}} - \frac{z \cdot \left(9 \cdot t\right)}{a \cdot 2} \]
    5. metadata-eval89.9%

      \[\leadsto \left(x \cdot y\right) \cdot \frac{\color{blue}{0.5}}{a} - \frac{z \cdot \left(9 \cdot t\right)}{a \cdot 2} \]
    6. times-frac89.4%

      \[\leadsto \left(x \cdot y\right) \cdot \frac{0.5}{a} - \color{blue}{\frac{z}{a} \cdot \frac{9 \cdot t}{2}} \]
  5. Applied egg-rr89.4%

    \[\leadsto \color{blue}{\left(x \cdot y\right) \cdot \frac{0.5}{a} - \frac{z}{a} \cdot \frac{9 \cdot t}{2}} \]
  6. Taylor expanded in x around 0 49.7%

    \[\leadsto \color{blue}{-4.5 \cdot \frac{t \cdot z}{a}} \]
  7. Step-by-step derivation
    1. *-commutative49.7%

      \[\leadsto -4.5 \cdot \frac{\color{blue}{z \cdot t}}{a} \]
    2. associate-/l*51.1%

      \[\leadsto -4.5 \cdot \color{blue}{\frac{z}{\frac{a}{t}}} \]
  8. Simplified51.1%

    \[\leadsto \color{blue}{-4.5 \cdot \frac{z}{\frac{a}{t}}} \]
  9. Final simplification51.1%

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

Developer target: 93.4% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a < -2.090464557976709 \cdot 10^{+86}:\\ \;\;\;\;0.5 \cdot \frac{y \cdot x}{a} - 4.5 \cdot \frac{t}{\frac{a}{z}}\\ \mathbf{elif}\;a < 2.144030707833976 \cdot 10^{+99}:\\ \;\;\;\;\frac{x \cdot y - z \cdot \left(9 \cdot t\right)}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a} \cdot \left(x \cdot 0.5\right) - \frac{t}{a} \cdot \left(z \cdot 4.5\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (< a -2.090464557976709e+86)
   (- (* 0.5 (/ (* y x) a)) (* 4.5 (/ t (/ a z))))
   (if (< a 2.144030707833976e+99)
     (/ (- (* x y) (* z (* 9.0 t))) (* a 2.0))
     (- (* (/ y a) (* x 0.5)) (* (/ t a) (* z 4.5))))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (a < -2.090464557976709e+86) {
		tmp = (0.5 * ((y * x) / a)) - (4.5 * (t / (a / z)));
	} else if (a < 2.144030707833976e+99) {
		tmp = ((x * y) - (z * (9.0 * t))) / (a * 2.0);
	} else {
		tmp = ((y / a) * (x * 0.5)) - ((t / a) * (z * 4.5));
	}
	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) :: tmp
    if (a < (-2.090464557976709d+86)) then
        tmp = (0.5d0 * ((y * x) / a)) - (4.5d0 * (t / (a / z)))
    else if (a < 2.144030707833976d+99) then
        tmp = ((x * y) - (z * (9.0d0 * t))) / (a * 2.0d0)
    else
        tmp = ((y / a) * (x * 0.5d0)) - ((t / a) * (z * 4.5d0))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (a < -2.090464557976709e+86) {
		tmp = (0.5 * ((y * x) / a)) - (4.5 * (t / (a / z)));
	} else if (a < 2.144030707833976e+99) {
		tmp = ((x * y) - (z * (9.0 * t))) / (a * 2.0);
	} else {
		tmp = ((y / a) * (x * 0.5)) - ((t / a) * (z * 4.5));
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if a < -2.090464557976709e+86:
		tmp = (0.5 * ((y * x) / a)) - (4.5 * (t / (a / z)))
	elif a < 2.144030707833976e+99:
		tmp = ((x * y) - (z * (9.0 * t))) / (a * 2.0)
	else:
		tmp = ((y / a) * (x * 0.5)) - ((t / a) * (z * 4.5))
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (a < -2.090464557976709e+86)
		tmp = Float64(Float64(0.5 * Float64(Float64(y * x) / a)) - Float64(4.5 * Float64(t / Float64(a / z))));
	elseif (a < 2.144030707833976e+99)
		tmp = Float64(Float64(Float64(x * y) - Float64(z * Float64(9.0 * t))) / Float64(a * 2.0));
	else
		tmp = Float64(Float64(Float64(y / a) * Float64(x * 0.5)) - Float64(Float64(t / a) * Float64(z * 4.5)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (a < -2.090464557976709e+86)
		tmp = (0.5 * ((y * x) / a)) - (4.5 * (t / (a / z)));
	elseif (a < 2.144030707833976e+99)
		tmp = ((x * y) - (z * (9.0 * t))) / (a * 2.0);
	else
		tmp = ((y / a) * (x * 0.5)) - ((t / a) * (z * 4.5));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[Less[a, -2.090464557976709e+86], N[(N[(0.5 * N[(N[(y * x), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision] - N[(4.5 * N[(t / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Less[a, 2.144030707833976e+99], N[(N[(N[(x * y), $MachinePrecision] - N[(z * N[(9.0 * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y / a), $MachinePrecision] * N[(x * 0.5), $MachinePrecision]), $MachinePrecision] - N[(N[(t / a), $MachinePrecision] * N[(z * 4.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;a < -2.090464557976709 \cdot 10^{+86}:\\
\;\;\;\;0.5 \cdot \frac{y \cdot x}{a} - 4.5 \cdot \frac{t}{\frac{a}{z}}\\

\mathbf{elif}\;a < 2.144030707833976 \cdot 10^{+99}:\\
\;\;\;\;\frac{x \cdot y - z \cdot \left(9 \cdot t\right)}{a \cdot 2}\\

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


\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2023290 
(FPCore (x y z t a)
  :name "Diagrams.Solve.Polynomial:cubForm  from diagrams-solve-0.1, I"
  :precision binary64

  :herbie-target
  (if (< a -2.090464557976709e+86) (- (* 0.5 (/ (* y x) a)) (* 4.5 (/ t (/ a z)))) (if (< a 2.144030707833976e+99) (/ (- (* x y) (* z (* 9.0 t))) (* a 2.0)) (- (* (/ y a) (* x 0.5)) (* (/ t a) (* z 4.5)))))

  (/ (- (* x y) (* (* z 9.0) t)) (* a 2.0)))