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

Percentage Accurate: 91.6% → 96.4%
Time: 10.2s
Alternatives: 12
Speedup: 0.5×

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 12 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.6% 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: 96.4% accurate, 0.1× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ [z, t] = \mathsf{sort}([z, t])\\ \\ \begin{array}{l} t_1 := x \cdot y - \left(z \cdot 9\right) \cdot t\\ \mathbf{if}\;t_1 \leq -5 \cdot 10^{+293} \lor \neg \left(t_1 \leq 5 \cdot 10^{+192}\right):\\ \;\;\;\;\mathsf{fma}\left(0.5, x \cdot \frac{y}{a}, -4.5 \cdot \left(z \cdot \frac{t}{a}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot y - 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
 (let* ((t_1 (- (* x y) (* (* z 9.0) t))))
   (if (or (<= t_1 -5e+293) (not (<= t_1 5e+192)))
     (fma 0.5 (* x (/ y a)) (* -4.5 (* z (/ t a))))
     (/ (- (* x y) (* 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 t_1 = (x * y) - ((z * 9.0) * t);
	double tmp;
	if ((t_1 <= -5e+293) || !(t_1 <= 5e+192)) {
		tmp = fma(0.5, (x * (y / a)), (-4.5 * (z * (t / a))));
	} else {
		tmp = ((x * y) - (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)
	t_1 = Float64(Float64(x * y) - Float64(Float64(z * 9.0) * t))
	tmp = 0.0
	if ((t_1 <= -5e+293) || !(t_1 <= 5e+192))
		tmp = fma(0.5, Float64(x * Float64(y / a)), Float64(-4.5 * Float64(z * Float64(t / a))));
	else
		tmp = Float64(Float64(Float64(x * y) - Float64(z * Float64(9.0 * t))) / Float64(a * 2.0));
	end
	return 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[(x * y), $MachinePrecision] - N[(N[(z * 9.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -5e+293], N[Not[LessEqual[t$95$1, 5e+192]], $MachinePrecision]], N[(0.5 * N[(x * N[(y / a), $MachinePrecision]), $MachinePrecision] + N[(-4.5 * N[(z * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * y), $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}
t_1 := x \cdot y - \left(z \cdot 9\right) \cdot t\\
\mathbf{if}\;t_1 \leq -5 \cdot 10^{+293} \lor \neg \left(t_1 \leq 5 \cdot 10^{+192}\right):\\
\;\;\;\;\mathsf{fma}\left(0.5, x \cdot \frac{y}{a}, -4.5 \cdot \left(z \cdot \frac{t}{a}\right)\right)\\

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


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

    1. Initial program 78.5%

      \[\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2} \]
    2. Step-by-step derivation
      1. sub-neg78.5%

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

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

        \[\leadsto \frac{\color{blue}{\left(0 - \left(z \cdot 9\right) \cdot t\right)} + x \cdot y}{a \cdot 2} \]
      4. associate-+l-78.5%

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

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

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

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

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

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

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

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

        \[\leadsto \left(\color{blue}{\left(0 - x \cdot y\right)} + \left(z \cdot 9\right) \cdot t\right) \cdot \frac{-1}{a \cdot 2} \]
      13. associate-+l-78.5%

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

        \[\leadsto \color{blue}{\left(-\left(x \cdot y - \left(z \cdot 9\right) \cdot t\right)\right)} \cdot \frac{-1}{a \cdot 2} \]
      15. distribute-lft-neg-out78.5%

        \[\leadsto \color{blue}{-\left(x \cdot y - \left(z \cdot 9\right) \cdot t\right) \cdot \frac{-1}{a \cdot 2}} \]
      16. distribute-rgt-neg-in78.5%

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, z \cdot \left(t \cdot -9\right)\right) \cdot \frac{0.5}{a}} \]
    4. Step-by-step derivation
      1. fma-udef78.5%

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

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

        \[\leadsto \left(x \cdot y + z \cdot \left(\color{blue}{\left(-9\right)} \cdot t\right)\right) \cdot \frac{0.5}{a} \]
      4. distribute-lft-neg-in78.5%

        \[\leadsto \left(x \cdot y + z \cdot \color{blue}{\left(-9 \cdot t\right)}\right) \cdot \frac{0.5}{a} \]
      5. distribute-rgt-neg-in78.5%

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

        \[\leadsto \color{blue}{\left(\left(-z \cdot \left(9 \cdot t\right)\right) + x \cdot y\right)} \cdot \frac{0.5}{a} \]
      7. distribute-rgt-neg-in78.5%

        \[\leadsto \left(\color{blue}{z \cdot \left(-9 \cdot t\right)} + x \cdot y\right) \cdot \frac{0.5}{a} \]
      8. distribute-lft-neg-in78.5%

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

        \[\leadsto \left(z \cdot \left(\color{blue}{-9} \cdot t\right) + x \cdot y\right) \cdot \frac{0.5}{a} \]
      10. *-commutative78.5%

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

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

      \[\leadsto \color{blue}{-4.5 \cdot \frac{t \cdot z}{a} + 0.5 \cdot \frac{y \cdot x}{a}} \]
    7. Step-by-step derivation
      1. +-commutative74.5%

        \[\leadsto \color{blue}{0.5 \cdot \frac{y \cdot x}{a} + -4.5 \cdot \frac{t \cdot z}{a}} \]
      2. *-commutative74.5%

        \[\leadsto 0.5 \cdot \frac{y \cdot x}{a} + \color{blue}{\frac{t \cdot z}{a} \cdot -4.5} \]
      3. fma-def74.5%

        \[\leadsto \color{blue}{\mathsf{fma}\left(0.5, \frac{y \cdot x}{a}, \frac{t \cdot z}{a} \cdot -4.5\right)} \]
      4. associate-/l*83.6%

        \[\leadsto \mathsf{fma}\left(0.5, \color{blue}{\frac{y}{\frac{a}{x}}}, \frac{t \cdot z}{a} \cdot -4.5\right) \]
      5. associate-/r/83.6%

        \[\leadsto \mathsf{fma}\left(0.5, \color{blue}{\frac{y}{a} \cdot x}, \frac{t \cdot z}{a} \cdot -4.5\right) \]
      6. *-commutative83.6%

        \[\leadsto \mathsf{fma}\left(0.5, \frac{y}{a} \cdot x, \color{blue}{-4.5 \cdot \frac{t \cdot z}{a}}\right) \]
      7. associate-/l*93.0%

        \[\leadsto \mathsf{fma}\left(0.5, \frac{y}{a} \cdot x, -4.5 \cdot \color{blue}{\frac{t}{\frac{a}{z}}}\right) \]
      8. associate-/r/93.9%

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

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

    if -5.00000000000000033e293 < (-.f64 (*.f64 x y) (*.f64 (*.f64 z 9) t)) < 5.00000000000000033e192

    1. Initial program 98.9%

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

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

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

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

Alternative 2: 95.2% accurate, 0.5× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ [z, t] = \mathsf{sort}([z, t])\\ \\ \begin{array}{l} t_1 := \left(z \cdot 9\right) \cdot t\\ \mathbf{if}\;t_1 \leq -\infty:\\ \;\;\;\;-4.5 \cdot \left(z \cdot \frac{t}{a}\right)\\ \mathbf{elif}\;t_1 \leq 2 \cdot 10^{+224}:\\ \;\;\;\;\frac{x \cdot y - t_1}{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
 (let* ((t_1 (* (* z 9.0) t)))
   (if (<= t_1 (- INFINITY))
     (* -4.5 (* z (/ t a)))
     (if (<= t_1 2e+224)
       (/ (- (* x y) t_1) (* 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 t_1 = (z * 9.0) * t;
	double tmp;
	if (t_1 <= -((double) INFINITY)) {
		tmp = -4.5 * (z * (t / a));
	} else if (t_1 <= 2e+224) {
		tmp = ((x * y) - t_1) / (a * 2.0);
	} else {
		tmp = -4.5 * (t / (a / z));
	}
	return tmp;
}
assert x < y;
assert z < t;
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = (z * 9.0) * t;
	double tmp;
	if (t_1 <= -Double.POSITIVE_INFINITY) {
		tmp = -4.5 * (z * (t / a));
	} else if (t_1 <= 2e+224) {
		tmp = ((x * y) - t_1) / (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):
	t_1 = (z * 9.0) * t
	tmp = 0
	if t_1 <= -math.inf:
		tmp = -4.5 * (z * (t / a))
	elif t_1 <= 2e+224:
		tmp = ((x * y) - t_1) / (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)
	t_1 = Float64(Float64(z * 9.0) * t)
	tmp = 0.0
	if (t_1 <= Float64(-Inf))
		tmp = Float64(-4.5 * Float64(z * Float64(t / a)));
	elseif (t_1 <= 2e+224)
		tmp = Float64(Float64(Float64(x * y) - t_1) / 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)
	t_1 = (z * 9.0) * t;
	tmp = 0.0;
	if (t_1 <= -Inf)
		tmp = -4.5 * (z * (t / a));
	elseif (t_1 <= 2e+224)
		tmp = ((x * y) - t_1) / (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_] := Block[{t$95$1 = N[(N[(z * 9.0), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(-4.5 * N[(z * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+224], N[(N[(N[(x * y), $MachinePrecision] - t$95$1), $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}
t_1 := \left(z \cdot 9\right) \cdot t\\
\mathbf{if}\;t_1 \leq -\infty:\\
\;\;\;\;-4.5 \cdot \left(z \cdot \frac{t}{a}\right)\\

\mathbf{elif}\;t_1 \leq 2 \cdot 10^{+224}:\\
\;\;\;\;\frac{x \cdot y - t_1}{a \cdot 2}\\

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


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

    1. Initial program 60.9%

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

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

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

        \[\leadsto \frac{\color{blue}{\left(0 - \left(z \cdot 9\right) \cdot t\right)} + x \cdot y}{a \cdot 2} \]
      4. associate-+l-60.9%

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

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

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

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

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

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

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

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

        \[\leadsto \left(\color{blue}{\left(0 - x \cdot y\right)} + \left(z \cdot 9\right) \cdot t\right) \cdot \frac{-1}{a \cdot 2} \]
      13. associate-+l-60.9%

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

        \[\leadsto \color{blue}{\left(-\left(x \cdot y - \left(z \cdot 9\right) \cdot t\right)\right)} \cdot \frac{-1}{a \cdot 2} \]
      15. distribute-lft-neg-out60.9%

        \[\leadsto \color{blue}{-\left(x \cdot y - \left(z \cdot 9\right) \cdot t\right) \cdot \frac{-1}{a \cdot 2}} \]
      16. distribute-rgt-neg-in60.9%

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

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

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

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

      \[\leadsto \color{blue}{-4.5 \cdot \frac{t}{\frac{a}{z}}} \]
    7. Step-by-step derivation
      1. associate-/r/99.9%

        \[\leadsto -4.5 \cdot \color{blue}{\left(\frac{t}{a} \cdot z\right)} \]
    8. Applied egg-rr99.9%

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

    if -inf.0 < (*.f64 (*.f64 z 9) t) < 1.99999999999999994e224

    1. Initial program 94.5%

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

    if 1.99999999999999994e224 < (*.f64 (*.f64 z 9) t)

    1. Initial program 78.3%

      \[\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2} \]
    2. Step-by-step derivation
      1. sub-neg78.3%

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

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

        \[\leadsto \frac{\color{blue}{\left(0 - \left(z \cdot 9\right) \cdot t\right)} + x \cdot y}{a \cdot 2} \]
      4. associate-+l-78.3%

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

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

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

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

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

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

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

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

        \[\leadsto \left(\color{blue}{\left(0 - x \cdot y\right)} + \left(z \cdot 9\right) \cdot t\right) \cdot \frac{-1}{a \cdot 2} \]
      13. associate-+l-78.2%

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

        \[\leadsto \color{blue}{\left(-\left(x \cdot y - \left(z \cdot 9\right) \cdot t\right)\right)} \cdot \frac{-1}{a \cdot 2} \]
      15. distribute-lft-neg-out78.2%

        \[\leadsto \color{blue}{-\left(x \cdot y - \left(z \cdot 9\right) \cdot t\right) \cdot \frac{-1}{a \cdot 2}} \]
      16. distribute-rgt-neg-in78.2%

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

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

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

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

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

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

Alternative 3: 68.0% 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 \frac{y}{\frac{a}{x}}\\ \mathbf{if}\;y \leq -1.6 \cdot 10^{-90}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 7.5 \cdot 10^{-292}:\\ \;\;\;\;-4.5 \cdot \frac{z \cdot t}{a}\\ \mathbf{elif}\;y \leq 7.6 \cdot 10^{+65}:\\ \;\;\;\;-4.5 \cdot \left(z \cdot \frac{t}{a}\right)\\ \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 (/ a x)))))
   (if (<= y -1.6e-90)
     t_1
     (if (<= y 7.5e-292)
       (* -4.5 (/ (* z t) a))
       (if (<= y 7.6e+65) (* -4.5 (* z (/ t a))) 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 / (a / x));
	double tmp;
	if (y <= -1.6e-90) {
		tmp = t_1;
	} else if (y <= 7.5e-292) {
		tmp = -4.5 * ((z * t) / a);
	} else if (y <= 7.6e+65) {
		tmp = -4.5 * (z * (t / a));
	} 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 / (a / x))
    if (y <= (-1.6d-90)) then
        tmp = t_1
    else if (y <= 7.5d-292) then
        tmp = (-4.5d0) * ((z * t) / a)
    else if (y <= 7.6d+65) then
        tmp = (-4.5d0) * (z * (t / a))
    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 / (a / x));
	double tmp;
	if (y <= -1.6e-90) {
		tmp = t_1;
	} else if (y <= 7.5e-292) {
		tmp = -4.5 * ((z * t) / a);
	} else if (y <= 7.6e+65) {
		tmp = -4.5 * (z * (t / a));
	} 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 / (a / x))
	tmp = 0
	if y <= -1.6e-90:
		tmp = t_1
	elif y <= 7.5e-292:
		tmp = -4.5 * ((z * t) / a)
	elif y <= 7.6e+65:
		tmp = -4.5 * (z * (t / a))
	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(a / x)))
	tmp = 0.0
	if (y <= -1.6e-90)
		tmp = t_1;
	elseif (y <= 7.5e-292)
		tmp = Float64(-4.5 * Float64(Float64(z * t) / a));
	elseif (y <= 7.6e+65)
		tmp = Float64(-4.5 * Float64(z * Float64(t / a)));
	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 / (a / x));
	tmp = 0.0;
	if (y <= -1.6e-90)
		tmp = t_1;
	elseif (y <= 7.5e-292)
		tmp = -4.5 * ((z * t) / a);
	elseif (y <= 7.6e+65)
		tmp = -4.5 * (z * (t / a));
	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[(a / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.6e-90], t$95$1, If[LessEqual[y, 7.5e-292], N[(-4.5 * N[(N[(z * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7.6e+65], N[(-4.5 * N[(z * N[(t / a), $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 \frac{y}{\frac{a}{x}}\\
\mathbf{if}\;y \leq -1.6 \cdot 10^{-90}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;y \leq 7.6 \cdot 10^{+65}:\\
\;\;\;\;-4.5 \cdot \left(z \cdot \frac{t}{a}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.60000000000000004e-90 or 7.60000000000000022e65 < 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. sub-neg90.6%

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

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

        \[\leadsto \frac{\color{blue}{\left(0 - \left(z \cdot 9\right) \cdot t\right)} + x \cdot y}{a \cdot 2} \]
      4. associate-+l-90.6%

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

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

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

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

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

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

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

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

        \[\leadsto \left(\color{blue}{\left(0 - x \cdot y\right)} + \left(z \cdot 9\right) \cdot t\right) \cdot \frac{-1}{a \cdot 2} \]
      13. associate-+l-90.5%

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

        \[\leadsto \color{blue}{\left(-\left(x \cdot y - \left(z \cdot 9\right) \cdot t\right)\right)} \cdot \frac{-1}{a \cdot 2} \]
      15. distribute-lft-neg-out90.5%

        \[\leadsto \color{blue}{-\left(x \cdot y - \left(z \cdot 9\right) \cdot t\right) \cdot \frac{-1}{a \cdot 2}} \]
      16. distribute-rgt-neg-in90.5%

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, z \cdot \left(t \cdot -9\right)\right) \cdot \frac{0.5}{a}} \]
    4. Step-by-step derivation
      1. associate-*r/90.6%

        \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x, y, z \cdot \left(t \cdot -9\right)\right) \cdot 0.5}{a}} \]
      2. clear-num90.5%

        \[\leadsto \color{blue}{\frac{1}{\frac{a}{\mathsf{fma}\left(x, y, z \cdot \left(t \cdot -9\right)\right) \cdot 0.5}}} \]
      3. *-commutative90.5%

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

      \[\leadsto \color{blue}{\frac{1}{\frac{a}{0.5 \cdot \mathsf{fma}\left(x, y, z \cdot \left(t \cdot -9\right)\right)}}} \]
    6. Taylor expanded in x around inf 58.6%

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

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

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

    if -1.60000000000000004e-90 < y < 7.5000000000000002e-292

    1. Initial program 91.9%

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

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

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

        \[\leadsto \frac{\color{blue}{\left(0 - \left(z \cdot 9\right) \cdot t\right)} + x \cdot y}{a \cdot 2} \]
      4. associate-+l-91.9%

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

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

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

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

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

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

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

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

        \[\leadsto \left(\color{blue}{\left(0 - x \cdot y\right)} + \left(z \cdot 9\right) \cdot t\right) \cdot \frac{-1}{a \cdot 2} \]
      13. associate-+l-91.9%

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

        \[\leadsto \color{blue}{\left(-\left(x \cdot y - \left(z \cdot 9\right) \cdot t\right)\right)} \cdot \frac{-1}{a \cdot 2} \]
      15. distribute-lft-neg-out91.9%

        \[\leadsto \color{blue}{-\left(x \cdot y - \left(z \cdot 9\right) \cdot t\right) \cdot \frac{-1}{a \cdot 2}} \]
      16. distribute-rgt-neg-in91.9%

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

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

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

    if 7.5000000000000002e-292 < y < 7.60000000000000022e65

    1. Initial program 90.7%

      \[\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2} \]
    2. Step-by-step derivation
      1. sub-neg90.7%

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

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

        \[\leadsto \frac{\color{blue}{\left(0 - \left(z \cdot 9\right) \cdot t\right)} + x \cdot y}{a \cdot 2} \]
      4. associate-+l-90.7%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(\left(-x \cdot y\right) + \left(z \cdot 9\right) \cdot t\right)} \cdot \frac{-1}{a \cdot 2} \]
      12. neg-sub090.6%

        \[\leadsto \left(\color{blue}{\left(0 - x \cdot y\right)} + \left(z \cdot 9\right) \cdot t\right) \cdot \frac{-1}{a \cdot 2} \]
      13. associate-+l-90.6%

        \[\leadsto \color{blue}{\left(0 - \left(x \cdot y - \left(z \cdot 9\right) \cdot t\right)\right)} \cdot \frac{-1}{a \cdot 2} \]
      14. sub0-neg90.6%

        \[\leadsto \color{blue}{\left(-\left(x \cdot y - \left(z \cdot 9\right) \cdot t\right)\right)} \cdot \frac{-1}{a \cdot 2} \]
      15. distribute-lft-neg-out90.6%

        \[\leadsto \color{blue}{-\left(x \cdot y - \left(z \cdot 9\right) \cdot t\right) \cdot \frac{-1}{a \cdot 2}} \]
      16. distribute-rgt-neg-in90.6%

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

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

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

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

      \[\leadsto \color{blue}{-4.5 \cdot \frac{t}{\frac{a}{z}}} \]
    7. Step-by-step derivation
      1. associate-/r/66.7%

        \[\leadsto -4.5 \cdot \color{blue}{\left(\frac{t}{a} \cdot z\right)} \]
    8. Applied egg-rr66.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.6 \cdot 10^{-90}:\\ \;\;\;\;0.5 \cdot \frac{y}{\frac{a}{x}}\\ \mathbf{elif}\;y \leq 7.5 \cdot 10^{-292}:\\ \;\;\;\;-4.5 \cdot \frac{z \cdot t}{a}\\ \mathbf{elif}\;y \leq 7.6 \cdot 10^{+65}:\\ \;\;\;\;-4.5 \cdot \left(z \cdot \frac{t}{a}\right)\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \frac{y}{\frac{a}{x}}\\ \end{array} \]

Alternative 4: 68.0% accurate, 1.0× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ [z, t] = \mathsf{sort}([z, t])\\ \\ \begin{array}{l} t_1 := y \cdot \frac{x \cdot 0.5}{a}\\ \mathbf{if}\;y \leq -4.8 \cdot 10^{-66}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 10^{-291}:\\ \;\;\;\;-4.5 \cdot \frac{z \cdot t}{a}\\ \mathbf{elif}\;y \leq 7.5 \cdot 10^{+64}:\\ \;\;\;\;-4.5 \cdot \left(z \cdot \frac{t}{a}\right)\\ \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 (/ (* x 0.5) a))))
   (if (<= y -4.8e-66)
     t_1
     (if (<= y 1e-291)
       (* -4.5 (/ (* z t) a))
       (if (<= y 7.5e+64) (* -4.5 (* z (/ t a))) t_1)))))
assert(x < y);
assert(z < t);
double code(double x, double y, double z, double t, double a) {
	double t_1 = y * ((x * 0.5) / a);
	double tmp;
	if (y <= -4.8e-66) {
		tmp = t_1;
	} else if (y <= 1e-291) {
		tmp = -4.5 * ((z * t) / a);
	} else if (y <= 7.5e+64) {
		tmp = -4.5 * (z * (t / a));
	} 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 * ((x * 0.5d0) / a)
    if (y <= (-4.8d-66)) then
        tmp = t_1
    else if (y <= 1d-291) then
        tmp = (-4.5d0) * ((z * t) / a)
    else if (y <= 7.5d+64) then
        tmp = (-4.5d0) * (z * (t / a))
    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 * ((x * 0.5) / a);
	double tmp;
	if (y <= -4.8e-66) {
		tmp = t_1;
	} else if (y <= 1e-291) {
		tmp = -4.5 * ((z * t) / a);
	} else if (y <= 7.5e+64) {
		tmp = -4.5 * (z * (t / a));
	} 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 * ((x * 0.5) / a)
	tmp = 0
	if y <= -4.8e-66:
		tmp = t_1
	elif y <= 1e-291:
		tmp = -4.5 * ((z * t) / a)
	elif y <= 7.5e+64:
		tmp = -4.5 * (z * (t / a))
	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(y * Float64(Float64(x * 0.5) / a))
	tmp = 0.0
	if (y <= -4.8e-66)
		tmp = t_1;
	elseif (y <= 1e-291)
		tmp = Float64(-4.5 * Float64(Float64(z * t) / a));
	elseif (y <= 7.5e+64)
		tmp = Float64(-4.5 * Float64(z * Float64(t / a)));
	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 * ((x * 0.5) / a);
	tmp = 0.0;
	if (y <= -4.8e-66)
		tmp = t_1;
	elseif (y <= 1e-291)
		tmp = -4.5 * ((z * t) / a);
	elseif (y <= 7.5e+64)
		tmp = -4.5 * (z * (t / a));
	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[(y * N[(N[(x * 0.5), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -4.8e-66], t$95$1, If[LessEqual[y, 1e-291], N[(-4.5 * N[(N[(z * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7.5e+64], N[(-4.5 * N[(z * N[(t / a), $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 := y \cdot \frac{x \cdot 0.5}{a}\\
\mathbf{if}\;y \leq -4.8 \cdot 10^{-66}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;y \leq 7.5 \cdot 10^{+64}:\\
\;\;\;\;-4.5 \cdot \left(z \cdot \frac{t}{a}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -4.80000000000000052e-66 or 7.5000000000000005e64 < y

    1. Initial program 90.3%

      \[\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2} \]
    2. Step-by-step derivation
      1. sub-neg90.3%

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

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

        \[\leadsto \frac{\color{blue}{\left(0 - \left(z \cdot 9\right) \cdot t\right)} + x \cdot y}{a \cdot 2} \]
      4. associate-+l-90.3%

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

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

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

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

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

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

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

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

        \[\leadsto \left(\color{blue}{\left(0 - x \cdot y\right)} + \left(z \cdot 9\right) \cdot t\right) \cdot \frac{-1}{a \cdot 2} \]
      13. associate-+l-90.2%

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

        \[\leadsto \color{blue}{\left(-\left(x \cdot y - \left(z \cdot 9\right) \cdot t\right)\right)} \cdot \frac{-1}{a \cdot 2} \]
      15. distribute-lft-neg-out90.2%

        \[\leadsto \color{blue}{-\left(x \cdot y - \left(z \cdot 9\right) \cdot t\right) \cdot \frac{-1}{a \cdot 2}} \]
      16. distribute-rgt-neg-in90.2%

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

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

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

        \[\leadsto \color{blue}{\frac{0.5 \cdot \left(y \cdot x\right)}{a}} \]
      2. *-commutative57.8%

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

        \[\leadsto \color{blue}{\frac{0.5}{a} \cdot \left(x \cdot y\right)} \]
      4. associate-*r*62.4%

        \[\leadsto \color{blue}{\left(\frac{0.5}{a} \cdot x\right) \cdot y} \]
      5. *-commutative62.4%

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

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

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

    if -4.80000000000000052e-66 < y < 9.99999999999999962e-292

    1. Initial program 92.5%

      \[\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2} \]
    2. Step-by-step derivation
      1. sub-neg92.5%

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

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

        \[\leadsto \frac{\color{blue}{\left(0 - \left(z \cdot 9\right) \cdot t\right)} + x \cdot y}{a \cdot 2} \]
      4. associate-+l-92.5%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(\left(-x \cdot y\right) + \left(z \cdot 9\right) \cdot t\right)} \cdot \frac{-1}{a \cdot 2} \]
      12. neg-sub092.6%

        \[\leadsto \left(\color{blue}{\left(0 - x \cdot y\right)} + \left(z \cdot 9\right) \cdot t\right) \cdot \frac{-1}{a \cdot 2} \]
      13. associate-+l-92.6%

        \[\leadsto \color{blue}{\left(0 - \left(x \cdot y - \left(z \cdot 9\right) \cdot t\right)\right)} \cdot \frac{-1}{a \cdot 2} \]
      14. sub0-neg92.6%

        \[\leadsto \color{blue}{\left(-\left(x \cdot y - \left(z \cdot 9\right) \cdot t\right)\right)} \cdot \frac{-1}{a \cdot 2} \]
      15. distribute-lft-neg-out92.6%

        \[\leadsto \color{blue}{-\left(x \cdot y - \left(z \cdot 9\right) \cdot t\right) \cdot \frac{-1}{a \cdot 2}} \]
      16. distribute-rgt-neg-in92.6%

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

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

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

    if 9.99999999999999962e-292 < y < 7.5000000000000005e64

    1. Initial program 90.7%

      \[\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2} \]
    2. Step-by-step derivation
      1. sub-neg90.7%

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

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

        \[\leadsto \frac{\color{blue}{\left(0 - \left(z \cdot 9\right) \cdot t\right)} + x \cdot y}{a \cdot 2} \]
      4. associate-+l-90.7%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(\left(-x \cdot y\right) + \left(z \cdot 9\right) \cdot t\right)} \cdot \frac{-1}{a \cdot 2} \]
      12. neg-sub090.6%

        \[\leadsto \left(\color{blue}{\left(0 - x \cdot y\right)} + \left(z \cdot 9\right) \cdot t\right) \cdot \frac{-1}{a \cdot 2} \]
      13. associate-+l-90.6%

        \[\leadsto \color{blue}{\left(0 - \left(x \cdot y - \left(z \cdot 9\right) \cdot t\right)\right)} \cdot \frac{-1}{a \cdot 2} \]
      14. sub0-neg90.6%

        \[\leadsto \color{blue}{\left(-\left(x \cdot y - \left(z \cdot 9\right) \cdot t\right)\right)} \cdot \frac{-1}{a \cdot 2} \]
      15. distribute-lft-neg-out90.6%

        \[\leadsto \color{blue}{-\left(x \cdot y - \left(z \cdot 9\right) \cdot t\right) \cdot \frac{-1}{a \cdot 2}} \]
      16. distribute-rgt-neg-in90.6%

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

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

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

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

      \[\leadsto \color{blue}{-4.5 \cdot \frac{t}{\frac{a}{z}}} \]
    7. Step-by-step derivation
      1. associate-/r/66.7%

        \[\leadsto -4.5 \cdot \color{blue}{\left(\frac{t}{a} \cdot z\right)} \]
    8. Applied egg-rr66.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -4.8 \cdot 10^{-66}:\\ \;\;\;\;y \cdot \frac{x \cdot 0.5}{a}\\ \mathbf{elif}\;y \leq 10^{-291}:\\ \;\;\;\;-4.5 \cdot \frac{z \cdot t}{a}\\ \mathbf{elif}\;y \leq 7.5 \cdot 10^{+64}:\\ \;\;\;\;-4.5 \cdot \left(z \cdot \frac{t}{a}\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{x \cdot 0.5}{a}\\ \end{array} \]

Alternative 5: 68.0% 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 -3 \cdot 10^{-66}:\\ \;\;\;\;\frac{y}{a} \cdot \left(x \cdot 0.5\right)\\ \mathbf{elif}\;y \leq 1.35 \cdot 10^{-291}:\\ \;\;\;\;-4.5 \cdot \frac{z \cdot t}{a}\\ \mathbf{elif}\;y \leq 9.5 \cdot 10^{+63}:\\ \;\;\;\;-4.5 \cdot \left(z \cdot \frac{t}{a}\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{x \cdot 0.5}{a}\\ \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 -3e-66)
   (* (/ y a) (* x 0.5))
   (if (<= y 1.35e-291)
     (* -4.5 (/ (* z t) a))
     (if (<= y 9.5e+63) (* -4.5 (* z (/ t a))) (* y (/ (* x 0.5) a))))))
assert(x < y);
assert(z < t);
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (y <= -3e-66) {
		tmp = (y / a) * (x * 0.5);
	} else if (y <= 1.35e-291) {
		tmp = -4.5 * ((z * t) / a);
	} else if (y <= 9.5e+63) {
		tmp = -4.5 * (z * (t / a));
	} else {
		tmp = y * ((x * 0.5) / a);
	}
	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 <= (-3d-66)) then
        tmp = (y / a) * (x * 0.5d0)
    else if (y <= 1.35d-291) then
        tmp = (-4.5d0) * ((z * t) / a)
    else if (y <= 9.5d+63) then
        tmp = (-4.5d0) * (z * (t / a))
    else
        tmp = y * ((x * 0.5d0) / a)
    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 <= -3e-66) {
		tmp = (y / a) * (x * 0.5);
	} else if (y <= 1.35e-291) {
		tmp = -4.5 * ((z * t) / a);
	} else if (y <= 9.5e+63) {
		tmp = -4.5 * (z * (t / a));
	} else {
		tmp = y * ((x * 0.5) / a);
	}
	return tmp;
}
[x, y] = sort([x, y])
[z, t] = sort([z, t])
def code(x, y, z, t, a):
	tmp = 0
	if y <= -3e-66:
		tmp = (y / a) * (x * 0.5)
	elif y <= 1.35e-291:
		tmp = -4.5 * ((z * t) / a)
	elif y <= 9.5e+63:
		tmp = -4.5 * (z * (t / a))
	else:
		tmp = y * ((x * 0.5) / a)
	return tmp
x, y = sort([x, y])
z, t = sort([z, t])
function code(x, y, z, t, a)
	tmp = 0.0
	if (y <= -3e-66)
		tmp = Float64(Float64(y / a) * Float64(x * 0.5));
	elseif (y <= 1.35e-291)
		tmp = Float64(-4.5 * Float64(Float64(z * t) / a));
	elseif (y <= 9.5e+63)
		tmp = Float64(-4.5 * Float64(z * Float64(t / a)));
	else
		tmp = Float64(y * Float64(Float64(x * 0.5) / a));
	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 <= -3e-66)
		tmp = (y / a) * (x * 0.5);
	elseif (y <= 1.35e-291)
		tmp = -4.5 * ((z * t) / a);
	elseif (y <= 9.5e+63)
		tmp = -4.5 * (z * (t / a));
	else
		tmp = y * ((x * 0.5) / a);
	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, -3e-66], N[(N[(y / a), $MachinePrecision] * N[(x * 0.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.35e-291], N[(-4.5 * N[(N[(z * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 9.5e+63], N[(-4.5 * N[(z * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[(N[(x * 0.5), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3 \cdot 10^{-66}:\\
\;\;\;\;\frac{y}{a} \cdot \left(x \cdot 0.5\right)\\

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

\mathbf{elif}\;y \leq 9.5 \cdot 10^{+63}:\\
\;\;\;\;-4.5 \cdot \left(z \cdot \frac{t}{a}\right)\\

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


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

    1. Initial program 94.1%

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

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

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

        \[\leadsto \frac{\color{blue}{\left(0 - \left(z \cdot 9\right) \cdot t\right)} + x \cdot y}{a \cdot 2} \]
      4. associate-+l-94.1%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(\left(-x \cdot y\right) + \left(z \cdot 9\right) \cdot t\right)} \cdot \frac{-1}{a \cdot 2} \]
      12. neg-sub094.0%

        \[\leadsto \left(\color{blue}{\left(0 - x \cdot y\right)} + \left(z \cdot 9\right) \cdot t\right) \cdot \frac{-1}{a \cdot 2} \]
      13. associate-+l-94.0%

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

        \[\leadsto \color{blue}{\left(-\left(x \cdot y - \left(z \cdot 9\right) \cdot t\right)\right)} \cdot \frac{-1}{a \cdot 2} \]
      15. distribute-lft-neg-out94.0%

        \[\leadsto \color{blue}{-\left(x \cdot y - \left(z \cdot 9\right) \cdot t\right) \cdot \frac{-1}{a \cdot 2}} \]
      16. distribute-rgt-neg-in94.0%

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, z \cdot \left(t \cdot -9\right)\right) \cdot \frac{0.5}{a}} \]
    4. Step-by-step derivation
      1. associate-*r/94.1%

        \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x, y, z \cdot \left(t \cdot -9\right)\right) \cdot 0.5}{a}} \]
      2. clear-num94.1%

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

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

      \[\leadsto \color{blue}{\frac{1}{\frac{a}{0.5 \cdot \mathsf{fma}\left(x, y, z \cdot \left(t \cdot -9\right)\right)}}} \]
    6. Taylor expanded in x around inf 52.5%

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

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

        \[\leadsto \frac{\color{blue}{x \cdot y}}{a} \cdot 0.5 \]
      3. associate-/l*55.8%

        \[\leadsto \color{blue}{\frac{x}{\frac{a}{y}}} \cdot 0.5 \]
      4. associate-*l/55.8%

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

      \[\leadsto \color{blue}{\frac{x \cdot 0.5}{\frac{a}{y}}} \]
    9. Step-by-step derivation
      1. div-inv55.8%

        \[\leadsto \color{blue}{\left(x \cdot 0.5\right) \cdot \frac{1}{\frac{a}{y}}} \]
    10. Applied egg-rr55.8%

      \[\leadsto \color{blue}{\left(x \cdot 0.5\right) \cdot \frac{1}{\frac{a}{y}}} \]
    11. Taylor expanded in a around 0 56.6%

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

    if -3.0000000000000002e-66 < y < 1.34999999999999996e-291

    1. Initial program 92.5%

      \[\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2} \]
    2. Step-by-step derivation
      1. sub-neg92.5%

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

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

        \[\leadsto \frac{\color{blue}{\left(0 - \left(z \cdot 9\right) \cdot t\right)} + x \cdot y}{a \cdot 2} \]
      4. associate-+l-92.5%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(\left(-x \cdot y\right) + \left(z \cdot 9\right) \cdot t\right)} \cdot \frac{-1}{a \cdot 2} \]
      12. neg-sub092.6%

        \[\leadsto \left(\color{blue}{\left(0 - x \cdot y\right)} + \left(z \cdot 9\right) \cdot t\right) \cdot \frac{-1}{a \cdot 2} \]
      13. associate-+l-92.6%

        \[\leadsto \color{blue}{\left(0 - \left(x \cdot y - \left(z \cdot 9\right) \cdot t\right)\right)} \cdot \frac{-1}{a \cdot 2} \]
      14. sub0-neg92.6%

        \[\leadsto \color{blue}{\left(-\left(x \cdot y - \left(z \cdot 9\right) \cdot t\right)\right)} \cdot \frac{-1}{a \cdot 2} \]
      15. distribute-lft-neg-out92.6%

        \[\leadsto \color{blue}{-\left(x \cdot y - \left(z \cdot 9\right) \cdot t\right) \cdot \frac{-1}{a \cdot 2}} \]
      16. distribute-rgt-neg-in92.6%

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

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

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

    if 1.34999999999999996e-291 < y < 9.5000000000000003e63

    1. Initial program 90.7%

      \[\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2} \]
    2. Step-by-step derivation
      1. sub-neg90.7%

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

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

        \[\leadsto \frac{\color{blue}{\left(0 - \left(z \cdot 9\right) \cdot t\right)} + x \cdot y}{a \cdot 2} \]
      4. associate-+l-90.7%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(\left(-x \cdot y\right) + \left(z \cdot 9\right) \cdot t\right)} \cdot \frac{-1}{a \cdot 2} \]
      12. neg-sub090.6%

        \[\leadsto \left(\color{blue}{\left(0 - x \cdot y\right)} + \left(z \cdot 9\right) \cdot t\right) \cdot \frac{-1}{a \cdot 2} \]
      13. associate-+l-90.6%

        \[\leadsto \color{blue}{\left(0 - \left(x \cdot y - \left(z \cdot 9\right) \cdot t\right)\right)} \cdot \frac{-1}{a \cdot 2} \]
      14. sub0-neg90.6%

        \[\leadsto \color{blue}{\left(-\left(x \cdot y - \left(z \cdot 9\right) \cdot t\right)\right)} \cdot \frac{-1}{a \cdot 2} \]
      15. distribute-lft-neg-out90.6%

        \[\leadsto \color{blue}{-\left(x \cdot y - \left(z \cdot 9\right) \cdot t\right) \cdot \frac{-1}{a \cdot 2}} \]
      16. distribute-rgt-neg-in90.6%

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

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

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

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

      \[\leadsto \color{blue}{-4.5 \cdot \frac{t}{\frac{a}{z}}} \]
    7. Step-by-step derivation
      1. associate-/r/66.7%

        \[\leadsto -4.5 \cdot \color{blue}{\left(\frac{t}{a} \cdot z\right)} \]
    8. Applied egg-rr66.7%

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

    if 9.5000000000000003e63 < y

    1. Initial program 84.7%

      \[\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2} \]
    2. Step-by-step derivation
      1. sub-neg84.7%

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

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

        \[\leadsto \frac{\color{blue}{\left(0 - \left(z \cdot 9\right) \cdot t\right)} + x \cdot y}{a \cdot 2} \]
      4. associate-+l-84.7%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(\left(-x \cdot y\right) + \left(z \cdot 9\right) \cdot t\right)} \cdot \frac{-1}{a \cdot 2} \]
      12. neg-sub084.7%

        \[\leadsto \left(\color{blue}{\left(0 - x \cdot y\right)} + \left(z \cdot 9\right) \cdot t\right) \cdot \frac{-1}{a \cdot 2} \]
      13. associate-+l-84.7%

        \[\leadsto \color{blue}{\left(0 - \left(x \cdot y - \left(z \cdot 9\right) \cdot t\right)\right)} \cdot \frac{-1}{a \cdot 2} \]
      14. sub0-neg84.7%

        \[\leadsto \color{blue}{\left(-\left(x \cdot y - \left(z \cdot 9\right) \cdot t\right)\right)} \cdot \frac{-1}{a \cdot 2} \]
      15. distribute-lft-neg-out84.7%

        \[\leadsto \color{blue}{-\left(x \cdot y - \left(z \cdot 9\right) \cdot t\right) \cdot \frac{-1}{a \cdot 2}} \]
      16. distribute-rgt-neg-in84.7%

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

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

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

        \[\leadsto \color{blue}{\frac{0.5 \cdot \left(y \cdot x\right)}{a}} \]
      2. *-commutative65.6%

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

        \[\leadsto \color{blue}{\frac{0.5}{a} \cdot \left(x \cdot y\right)} \]
      4. associate-*r*73.5%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3 \cdot 10^{-66}:\\ \;\;\;\;\frac{y}{a} \cdot \left(x \cdot 0.5\right)\\ \mathbf{elif}\;y \leq 1.35 \cdot 10^{-291}:\\ \;\;\;\;-4.5 \cdot \frac{z \cdot t}{a}\\ \mathbf{elif}\;y \leq 9.5 \cdot 10^{+63}:\\ \;\;\;\;-4.5 \cdot \left(z \cdot \frac{t}{a}\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{x \cdot 0.5}{a}\\ \end{array} \]

Alternative 6: 68.0% 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 -3.7 \cdot 10^{-66}:\\ \;\;\;\;\frac{y}{a} \cdot \left(x \cdot 0.5\right)\\ \mathbf{elif}\;y \leq 4.5 \cdot 10^{-291}:\\ \;\;\;\;-4.5 \cdot \frac{z \cdot t}{a}\\ \mathbf{elif}\;y \leq 1.22 \cdot 10^{+64}:\\ \;\;\;\;-4.5 \cdot \left(z \cdot \frac{t}{a}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{a} \cdot \frac{y}{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 -3.7e-66)
   (* (/ y a) (* x 0.5))
   (if (<= y 4.5e-291)
     (* -4.5 (/ (* z t) a))
     (if (<= y 1.22e+64) (* -4.5 (* z (/ t a))) (* (/ x a) (/ y 2.0))))))
assert(x < y);
assert(z < t);
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (y <= -3.7e-66) {
		tmp = (y / a) * (x * 0.5);
	} else if (y <= 4.5e-291) {
		tmp = -4.5 * ((z * t) / a);
	} else if (y <= 1.22e+64) {
		tmp = -4.5 * (z * (t / a));
	} else {
		tmp = (x / a) * (y / 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 <= (-3.7d-66)) then
        tmp = (y / a) * (x * 0.5d0)
    else if (y <= 4.5d-291) then
        tmp = (-4.5d0) * ((z * t) / a)
    else if (y <= 1.22d+64) then
        tmp = (-4.5d0) * (z * (t / a))
    else
        tmp = (x / a) * (y / 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 <= -3.7e-66) {
		tmp = (y / a) * (x * 0.5);
	} else if (y <= 4.5e-291) {
		tmp = -4.5 * ((z * t) / a);
	} else if (y <= 1.22e+64) {
		tmp = -4.5 * (z * (t / a));
	} else {
		tmp = (x / a) * (y / 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 <= -3.7e-66:
		tmp = (y / a) * (x * 0.5)
	elif y <= 4.5e-291:
		tmp = -4.5 * ((z * t) / a)
	elif y <= 1.22e+64:
		tmp = -4.5 * (z * (t / a))
	else:
		tmp = (x / a) * (y / 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 <= -3.7e-66)
		tmp = Float64(Float64(y / a) * Float64(x * 0.5));
	elseif (y <= 4.5e-291)
		tmp = Float64(-4.5 * Float64(Float64(z * t) / a));
	elseif (y <= 1.22e+64)
		tmp = Float64(-4.5 * Float64(z * Float64(t / a)));
	else
		tmp = Float64(Float64(x / a) * Float64(y / 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 <= -3.7e-66)
		tmp = (y / a) * (x * 0.5);
	elseif (y <= 4.5e-291)
		tmp = -4.5 * ((z * t) / a);
	elseif (y <= 1.22e+64)
		tmp = -4.5 * (z * (t / a));
	else
		tmp = (x / a) * (y / 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, -3.7e-66], N[(N[(y / a), $MachinePrecision] * N[(x * 0.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.5e-291], N[(-4.5 * N[(N[(z * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.22e+64], N[(-4.5 * N[(z * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / a), $MachinePrecision] * N[(y / 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 -3.7 \cdot 10^{-66}:\\
\;\;\;\;\frac{y}{a} \cdot \left(x \cdot 0.5\right)\\

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

\mathbf{elif}\;y \leq 1.22 \cdot 10^{+64}:\\
\;\;\;\;-4.5 \cdot \left(z \cdot \frac{t}{a}\right)\\

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


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

    1. Initial program 94.1%

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

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

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

        \[\leadsto \frac{\color{blue}{\left(0 - \left(z \cdot 9\right) \cdot t\right)} + x \cdot y}{a \cdot 2} \]
      4. associate-+l-94.1%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(\left(-x \cdot y\right) + \left(z \cdot 9\right) \cdot t\right)} \cdot \frac{-1}{a \cdot 2} \]
      12. neg-sub094.0%

        \[\leadsto \left(\color{blue}{\left(0 - x \cdot y\right)} + \left(z \cdot 9\right) \cdot t\right) \cdot \frac{-1}{a \cdot 2} \]
      13. associate-+l-94.0%

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

        \[\leadsto \color{blue}{\left(-\left(x \cdot y - \left(z \cdot 9\right) \cdot t\right)\right)} \cdot \frac{-1}{a \cdot 2} \]
      15. distribute-lft-neg-out94.0%

        \[\leadsto \color{blue}{-\left(x \cdot y - \left(z \cdot 9\right) \cdot t\right) \cdot \frac{-1}{a \cdot 2}} \]
      16. distribute-rgt-neg-in94.0%

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, z \cdot \left(t \cdot -9\right)\right) \cdot \frac{0.5}{a}} \]
    4. Step-by-step derivation
      1. associate-*r/94.1%

        \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x, y, z \cdot \left(t \cdot -9\right)\right) \cdot 0.5}{a}} \]
      2. clear-num94.1%

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

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

      \[\leadsto \color{blue}{\frac{1}{\frac{a}{0.5 \cdot \mathsf{fma}\left(x, y, z \cdot \left(t \cdot -9\right)\right)}}} \]
    6. Taylor expanded in x around inf 52.5%

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

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

        \[\leadsto \frac{\color{blue}{x \cdot y}}{a} \cdot 0.5 \]
      3. associate-/l*55.8%

        \[\leadsto \color{blue}{\frac{x}{\frac{a}{y}}} \cdot 0.5 \]
      4. associate-*l/55.8%

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

      \[\leadsto \color{blue}{\frac{x \cdot 0.5}{\frac{a}{y}}} \]
    9. Step-by-step derivation
      1. div-inv55.8%

        \[\leadsto \color{blue}{\left(x \cdot 0.5\right) \cdot \frac{1}{\frac{a}{y}}} \]
    10. Applied egg-rr55.8%

      \[\leadsto \color{blue}{\left(x \cdot 0.5\right) \cdot \frac{1}{\frac{a}{y}}} \]
    11. Taylor expanded in a around 0 56.6%

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

    if -3.7000000000000002e-66 < y < 4.49999999999999974e-291

    1. Initial program 92.5%

      \[\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2} \]
    2. Step-by-step derivation
      1. sub-neg92.5%

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

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

        \[\leadsto \frac{\color{blue}{\left(0 - \left(z \cdot 9\right) \cdot t\right)} + x \cdot y}{a \cdot 2} \]
      4. associate-+l-92.5%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(\left(-x \cdot y\right) + \left(z \cdot 9\right) \cdot t\right)} \cdot \frac{-1}{a \cdot 2} \]
      12. neg-sub092.6%

        \[\leadsto \left(\color{blue}{\left(0 - x \cdot y\right)} + \left(z \cdot 9\right) \cdot t\right) \cdot \frac{-1}{a \cdot 2} \]
      13. associate-+l-92.6%

        \[\leadsto \color{blue}{\left(0 - \left(x \cdot y - \left(z \cdot 9\right) \cdot t\right)\right)} \cdot \frac{-1}{a \cdot 2} \]
      14. sub0-neg92.6%

        \[\leadsto \color{blue}{\left(-\left(x \cdot y - \left(z \cdot 9\right) \cdot t\right)\right)} \cdot \frac{-1}{a \cdot 2} \]
      15. distribute-lft-neg-out92.6%

        \[\leadsto \color{blue}{-\left(x \cdot y - \left(z \cdot 9\right) \cdot t\right) \cdot \frac{-1}{a \cdot 2}} \]
      16. distribute-rgt-neg-in92.6%

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

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

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

    if 4.49999999999999974e-291 < y < 1.21999999999999994e64

    1. Initial program 90.7%

      \[\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2} \]
    2. Step-by-step derivation
      1. sub-neg90.7%

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

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

        \[\leadsto \frac{\color{blue}{\left(0 - \left(z \cdot 9\right) \cdot t\right)} + x \cdot y}{a \cdot 2} \]
      4. associate-+l-90.7%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(\left(-x \cdot y\right) + \left(z \cdot 9\right) \cdot t\right)} \cdot \frac{-1}{a \cdot 2} \]
      12. neg-sub090.6%

        \[\leadsto \left(\color{blue}{\left(0 - x \cdot y\right)} + \left(z \cdot 9\right) \cdot t\right) \cdot \frac{-1}{a \cdot 2} \]
      13. associate-+l-90.6%

        \[\leadsto \color{blue}{\left(0 - \left(x \cdot y - \left(z \cdot 9\right) \cdot t\right)\right)} \cdot \frac{-1}{a \cdot 2} \]
      14. sub0-neg90.6%

        \[\leadsto \color{blue}{\left(-\left(x \cdot y - \left(z \cdot 9\right) \cdot t\right)\right)} \cdot \frac{-1}{a \cdot 2} \]
      15. distribute-lft-neg-out90.6%

        \[\leadsto \color{blue}{-\left(x \cdot y - \left(z \cdot 9\right) \cdot t\right) \cdot \frac{-1}{a \cdot 2}} \]
      16. distribute-rgt-neg-in90.6%

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

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

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

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

      \[\leadsto \color{blue}{-4.5 \cdot \frac{t}{\frac{a}{z}}} \]
    7. Step-by-step derivation
      1. associate-/r/66.7%

        \[\leadsto -4.5 \cdot \color{blue}{\left(\frac{t}{a} \cdot z\right)} \]
    8. Applied egg-rr66.7%

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

    if 1.21999999999999994e64 < y

    1. Initial program 84.7%

      \[\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2} \]
    2. Step-by-step derivation
      1. sub-neg84.7%

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

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

        \[\leadsto \frac{\color{blue}{\left(0 - \left(z \cdot 9\right) \cdot t\right)} + x \cdot y}{a \cdot 2} \]
      4. associate-+l-84.7%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(\left(-x \cdot y\right) + \left(z \cdot 9\right) \cdot t\right)} \cdot \frac{-1}{a \cdot 2} \]
      12. neg-sub084.7%

        \[\leadsto \left(\color{blue}{\left(0 - x \cdot y\right)} + \left(z \cdot 9\right) \cdot t\right) \cdot \frac{-1}{a \cdot 2} \]
      13. associate-+l-84.7%

        \[\leadsto \color{blue}{\left(0 - \left(x \cdot y - \left(z \cdot 9\right) \cdot t\right)\right)} \cdot \frac{-1}{a \cdot 2} \]
      14. sub0-neg84.7%

        \[\leadsto \color{blue}{\left(-\left(x \cdot y - \left(z \cdot 9\right) \cdot t\right)\right)} \cdot \frac{-1}{a \cdot 2} \]
      15. distribute-lft-neg-out84.7%

        \[\leadsto \color{blue}{-\left(x \cdot y - \left(z \cdot 9\right) \cdot t\right) \cdot \frac{-1}{a \cdot 2}} \]
      16. distribute-rgt-neg-in84.7%

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, z \cdot \left(t \cdot -9\right)\right) \cdot \frac{0.5}{a}} \]
    4. Step-by-step derivation
      1. associate-*r/84.8%

        \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x, y, z \cdot \left(t \cdot -9\right)\right) \cdot 0.5}{a}} \]
      2. associate-/l*84.8%

        \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x, y, z \cdot \left(t \cdot -9\right)\right)}{\frac{a}{0.5}}} \]
      3. div-inv84.8%

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

        \[\leadsto \frac{\mathsf{fma}\left(x, y, z \cdot \left(t \cdot -9\right)\right)}{a \cdot \color{blue}{2}} \]
      5. *-commutative84.8%

        \[\leadsto \frac{\mathsf{fma}\left(x, y, z \cdot \color{blue}{\left(-9 \cdot t\right)}\right)}{a \cdot 2} \]
      6. metadata-eval84.8%

        \[\leadsto \frac{\mathsf{fma}\left(x, y, z \cdot \left(\color{blue}{\left(-9\right)} \cdot t\right)\right)}{a \cdot 2} \]
      7. distribute-lft-neg-in84.8%

        \[\leadsto \frac{\mathsf{fma}\left(x, y, z \cdot \color{blue}{\left(-9 \cdot t\right)}\right)}{a \cdot 2} \]
      8. distribute-rgt-neg-in84.8%

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

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

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

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

        \[\leadsto \frac{\frac{\color{blue}{\mathsf{fma}\left(x, y, -z \cdot \left(9 \cdot t\right)\right)}}{\sqrt{a \cdot 2}}}{\sqrt{a \cdot 2}} \]
      13. distribute-rgt-neg-in36.0%

        \[\leadsto \frac{\frac{\mathsf{fma}\left(x, y, \color{blue}{z \cdot \left(-9 \cdot t\right)}\right)}{\sqrt{a \cdot 2}}}{\sqrt{a \cdot 2}} \]
      14. distribute-lft-neg-in36.0%

        \[\leadsto \frac{\frac{\mathsf{fma}\left(x, y, z \cdot \color{blue}{\left(\left(-9\right) \cdot t\right)}\right)}{\sqrt{a \cdot 2}}}{\sqrt{a \cdot 2}} \]
      15. metadata-eval36.0%

        \[\leadsto \frac{\frac{\mathsf{fma}\left(x, y, z \cdot \left(\color{blue}{-9} \cdot t\right)\right)}{\sqrt{a \cdot 2}}}{\sqrt{a \cdot 2}} \]
      16. *-commutative36.0%

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

      \[\leadsto \color{blue}{\frac{\frac{\mathsf{fma}\left(x, y, z \cdot \left(t \cdot -9\right)\right)}{\sqrt{a \cdot 2}}}{\sqrt{a \cdot 2}}} \]
    6. Taylor expanded in x around inf 65.2%

      \[\leadsto \color{blue}{\frac{y \cdot x}{{\left(\sqrt{2}\right)}^{2} \cdot a}} \]
    7. Step-by-step derivation
      1. *-commutative65.2%

        \[\leadsto \frac{y \cdot x}{\color{blue}{a \cdot {\left(\sqrt{2}\right)}^{2}}} \]
      2. unpow265.2%

        \[\leadsto \frac{y \cdot x}{a \cdot \color{blue}{\left(\sqrt{2} \cdot \sqrt{2}\right)}} \]
      3. rem-square-sqrt65.6%

        \[\leadsto \frac{y \cdot x}{a \cdot \color{blue}{2}} \]
      4. *-commutative65.6%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.7 \cdot 10^{-66}:\\ \;\;\;\;\frac{y}{a} \cdot \left(x \cdot 0.5\right)\\ \mathbf{elif}\;y \leq 4.5 \cdot 10^{-291}:\\ \;\;\;\;-4.5 \cdot \frac{z \cdot t}{a}\\ \mathbf{elif}\;y \leq 1.22 \cdot 10^{+64}:\\ \;\;\;\;-4.5 \cdot \left(z \cdot \frac{t}{a}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{a} \cdot \frac{y}{2}\\ \end{array} \]

Alternative 7: 91.6% accurate, 1.0× speedup?

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

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

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

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

      \[\leadsto \frac{\color{blue}{\left(0 - \left(z \cdot 9\right) \cdot t\right)} + x \cdot y}{a \cdot 2} \]
    4. associate-+l-90.9%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(\left(-x \cdot y\right) + \left(z \cdot 9\right) \cdot t\right)} \cdot \frac{-1}{a \cdot 2} \]
    12. neg-sub090.8%

      \[\leadsto \left(\color{blue}{\left(0 - x \cdot y\right)} + \left(z \cdot 9\right) \cdot t\right) \cdot \frac{-1}{a \cdot 2} \]
    13. associate-+l-90.8%

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

      \[\leadsto \color{blue}{\left(-\left(x \cdot y - \left(z \cdot 9\right) \cdot t\right)\right)} \cdot \frac{-1}{a \cdot 2} \]
    15. distribute-lft-neg-out90.8%

      \[\leadsto \color{blue}{-\left(x \cdot y - \left(z \cdot 9\right) \cdot t\right) \cdot \frac{-1}{a \cdot 2}} \]
    16. distribute-rgt-neg-in90.8%

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

    \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, z \cdot \left(t \cdot -9\right)\right) \cdot \frac{0.5}{a}} \]
  4. Step-by-step derivation
    1. fma-udef90.8%

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

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

      \[\leadsto \left(x \cdot y + z \cdot \left(\color{blue}{\left(-9\right)} \cdot t\right)\right) \cdot \frac{0.5}{a} \]
    4. distribute-lft-neg-in90.8%

      \[\leadsto \left(x \cdot y + z \cdot \color{blue}{\left(-9 \cdot t\right)}\right) \cdot \frac{0.5}{a} \]
    5. distribute-rgt-neg-in90.8%

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

      \[\leadsto \color{blue}{\left(\left(-z \cdot \left(9 \cdot t\right)\right) + x \cdot y\right)} \cdot \frac{0.5}{a} \]
    7. distribute-rgt-neg-in90.8%

      \[\leadsto \left(\color{blue}{z \cdot \left(-9 \cdot t\right)} + x \cdot y\right) \cdot \frac{0.5}{a} \]
    8. distribute-lft-neg-in90.8%

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

      \[\leadsto \left(z \cdot \left(\color{blue}{-9} \cdot t\right) + x \cdot y\right) \cdot \frac{0.5}{a} \]
    10. *-commutative90.8%

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

    \[\leadsto \color{blue}{\left(z \cdot \left(t \cdot -9\right) + x \cdot y\right)} \cdot \frac{0.5}{a} \]
  6. Final simplification90.8%

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

Alternative 8: 91.6% accurate, 1.0× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ [z, t] = \mathsf{sort}([z, t])\\ \\ \frac{x \cdot y - z \cdot \left(9 \cdot t\right)}{a \cdot 2} \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
 (/ (- (* x y) (* 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) {
	return ((x * y) - (z * (9.0 * t))) / (a * 2.0);
}
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 = ((x * y) - (z * (9.0d0 * t))) / (a * 2.0d0)
end function
assert x < y;
assert z < t;
public static double code(double x, double y, double z, double t, double a) {
	return ((x * y) - (z * (9.0 * t))) / (a * 2.0);
}
[x, y] = sort([x, y])
[z, t] = sort([z, t])
def code(x, y, z, t, a):
	return ((x * y) - (z * (9.0 * t))) / (a * 2.0)
x, y = sort([x, y])
z, t = sort([z, t])
function code(x, y, z, t, a)
	return Float64(Float64(Float64(x * y) - Float64(z * Float64(9.0 * t))) / Float64(a * 2.0))
end
x, y = num2cell(sort([x, y])){:}
z, t = num2cell(sort([z, t])){:}
function tmp = code(x, y, z, t, a)
	tmp = ((x * y) - (z * (9.0 * t))) / (a * 2.0);
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[(N[(N[(x * y), $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])\\
\\
\frac{x \cdot y - z \cdot \left(9 \cdot t\right)}{a \cdot 2}
\end{array}
Derivation
  1. Initial program 90.9%

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

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

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

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

Alternative 9: 67.5% accurate, 1.2× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ [z, t] = \mathsf{sort}([z, t])\\ \\ \begin{array}{l} \mathbf{if}\;y \leq -5 \cdot 10^{-66}:\\ \;\;\;\;\frac{y}{a} \cdot \left(x \cdot 0.5\right)\\ \mathbf{elif}\;y \leq 6.6 \cdot 10^{+63}:\\ \;\;\;\;-4.5 \cdot \frac{z}{\frac{a}{t}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{a} \cdot \frac{y}{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 -5e-66)
   (* (/ y a) (* x 0.5))
   (if (<= y 6.6e+63) (* -4.5 (/ z (/ a t))) (* (/ x a) (/ y 2.0)))))
assert(x < y);
assert(z < t);
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (y <= -5e-66) {
		tmp = (y / a) * (x * 0.5);
	} else if (y <= 6.6e+63) {
		tmp = -4.5 * (z / (a / t));
	} else {
		tmp = (x / a) * (y / 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 <= (-5d-66)) then
        tmp = (y / a) * (x * 0.5d0)
    else if (y <= 6.6d+63) then
        tmp = (-4.5d0) * (z / (a / t))
    else
        tmp = (x / a) * (y / 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 <= -5e-66) {
		tmp = (y / a) * (x * 0.5);
	} else if (y <= 6.6e+63) {
		tmp = -4.5 * (z / (a / t));
	} else {
		tmp = (x / a) * (y / 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 <= -5e-66:
		tmp = (y / a) * (x * 0.5)
	elif y <= 6.6e+63:
		tmp = -4.5 * (z / (a / t))
	else:
		tmp = (x / a) * (y / 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 <= -5e-66)
		tmp = Float64(Float64(y / a) * Float64(x * 0.5));
	elseif (y <= 6.6e+63)
		tmp = Float64(-4.5 * Float64(z / Float64(a / t)));
	else
		tmp = Float64(Float64(x / a) * Float64(y / 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 <= -5e-66)
		tmp = (y / a) * (x * 0.5);
	elseif (y <= 6.6e+63)
		tmp = -4.5 * (z / (a / t));
	else
		tmp = (x / a) * (y / 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, -5e-66], N[(N[(y / a), $MachinePrecision] * N[(x * 0.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.6e+63], N[(-4.5 * N[(z / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / a), $MachinePrecision] * N[(y / 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 -5 \cdot 10^{-66}:\\
\;\;\;\;\frac{y}{a} \cdot \left(x \cdot 0.5\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -4.99999999999999962e-66

    1. Initial program 94.1%

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

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

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

        \[\leadsto \frac{\color{blue}{\left(0 - \left(z \cdot 9\right) \cdot t\right)} + x \cdot y}{a \cdot 2} \]
      4. associate-+l-94.1%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(\left(-x \cdot y\right) + \left(z \cdot 9\right) \cdot t\right)} \cdot \frac{-1}{a \cdot 2} \]
      12. neg-sub094.0%

        \[\leadsto \left(\color{blue}{\left(0 - x \cdot y\right)} + \left(z \cdot 9\right) \cdot t\right) \cdot \frac{-1}{a \cdot 2} \]
      13. associate-+l-94.0%

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

        \[\leadsto \color{blue}{\left(-\left(x \cdot y - \left(z \cdot 9\right) \cdot t\right)\right)} \cdot \frac{-1}{a \cdot 2} \]
      15. distribute-lft-neg-out94.0%

        \[\leadsto \color{blue}{-\left(x \cdot y - \left(z \cdot 9\right) \cdot t\right) \cdot \frac{-1}{a \cdot 2}} \]
      16. distribute-rgt-neg-in94.0%

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, z \cdot \left(t \cdot -9\right)\right) \cdot \frac{0.5}{a}} \]
    4. Step-by-step derivation
      1. associate-*r/94.1%

        \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x, y, z \cdot \left(t \cdot -9\right)\right) \cdot 0.5}{a}} \]
      2. clear-num94.1%

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

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

      \[\leadsto \color{blue}{\frac{1}{\frac{a}{0.5 \cdot \mathsf{fma}\left(x, y, z \cdot \left(t \cdot -9\right)\right)}}} \]
    6. Taylor expanded in x around inf 52.5%

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

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

        \[\leadsto \frac{\color{blue}{x \cdot y}}{a} \cdot 0.5 \]
      3. associate-/l*55.8%

        \[\leadsto \color{blue}{\frac{x}{\frac{a}{y}}} \cdot 0.5 \]
      4. associate-*l/55.8%

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

      \[\leadsto \color{blue}{\frac{x \cdot 0.5}{\frac{a}{y}}} \]
    9. Step-by-step derivation
      1. div-inv55.8%

        \[\leadsto \color{blue}{\left(x \cdot 0.5\right) \cdot \frac{1}{\frac{a}{y}}} \]
    10. Applied egg-rr55.8%

      \[\leadsto \color{blue}{\left(x \cdot 0.5\right) \cdot \frac{1}{\frac{a}{y}}} \]
    11. Taylor expanded in a around 0 56.6%

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

    if -4.99999999999999962e-66 < y < 6.6000000000000003e63

    1. Initial program 91.6%

      \[\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2} \]
    2. Step-by-step derivation
      1. sub-neg91.6%

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

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

        \[\leadsto \frac{\color{blue}{\left(0 - \left(z \cdot 9\right) \cdot t\right)} + x \cdot y}{a \cdot 2} \]
      4. associate-+l-91.6%

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

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

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

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

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

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

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

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

        \[\leadsto \left(\color{blue}{\left(0 - x \cdot y\right)} + \left(z \cdot 9\right) \cdot t\right) \cdot \frac{-1}{a \cdot 2} \]
      13. associate-+l-91.5%

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

        \[\leadsto \color{blue}{\left(-\left(x \cdot y - \left(z \cdot 9\right) \cdot t\right)\right)} \cdot \frac{-1}{a \cdot 2} \]
      15. distribute-lft-neg-out91.5%

        \[\leadsto \color{blue}{-\left(x \cdot y - \left(z \cdot 9\right) \cdot t\right) \cdot \frac{-1}{a \cdot 2}} \]
      16. distribute-rgt-neg-in91.5%

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, z \cdot \left(t \cdot -9\right)\right) \cdot \frac{0.5}{a}} \]
    4. Step-by-step derivation
      1. fma-udef91.4%

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

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

        \[\leadsto \left(x \cdot y + z \cdot \left(\color{blue}{\left(-9\right)} \cdot t\right)\right) \cdot \frac{0.5}{a} \]
      4. distribute-lft-neg-in91.4%

        \[\leadsto \left(x \cdot y + z \cdot \color{blue}{\left(-9 \cdot t\right)}\right) \cdot \frac{0.5}{a} \]
      5. distribute-rgt-neg-in91.4%

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

        \[\leadsto \color{blue}{\left(\left(-z \cdot \left(9 \cdot t\right)\right) + x \cdot y\right)} \cdot \frac{0.5}{a} \]
      7. distribute-rgt-neg-in91.4%

        \[\leadsto \left(\color{blue}{z \cdot \left(-9 \cdot t\right)} + x \cdot y\right) \cdot \frac{0.5}{a} \]
      8. distribute-lft-neg-in91.4%

        \[\leadsto \left(z \cdot \color{blue}{\left(\left(-9\right) \cdot t\right)} + x \cdot y\right) \cdot \frac{0.5}{a} \]
      9. metadata-eval91.4%

        \[\leadsto \left(z \cdot \left(\color{blue}{-9} \cdot t\right) + x \cdot y\right) \cdot \frac{0.5}{a} \]
      10. *-commutative91.4%

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

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

      \[\leadsto \color{blue}{-4.5 \cdot \frac{t \cdot z}{a} + 0.5 \cdot \frac{y \cdot x}{a}} \]
    7. Step-by-step derivation
      1. +-commutative92.5%

        \[\leadsto \color{blue}{0.5 \cdot \frac{y \cdot x}{a} + -4.5 \cdot \frac{t \cdot z}{a}} \]
      2. *-commutative92.5%

        \[\leadsto 0.5 \cdot \frac{y \cdot x}{a} + \color{blue}{\frac{t \cdot z}{a} \cdot -4.5} \]
      3. fma-def92.5%

        \[\leadsto \color{blue}{\mathsf{fma}\left(0.5, \frac{y \cdot x}{a}, \frac{t \cdot z}{a} \cdot -4.5\right)} \]
      4. associate-/l*87.0%

        \[\leadsto \mathsf{fma}\left(0.5, \color{blue}{\frac{y}{\frac{a}{x}}}, \frac{t \cdot z}{a} \cdot -4.5\right) \]
      5. associate-/r/89.0%

        \[\leadsto \mathsf{fma}\left(0.5, \color{blue}{\frac{y}{a} \cdot x}, \frac{t \cdot z}{a} \cdot -4.5\right) \]
      6. *-commutative89.0%

        \[\leadsto \mathsf{fma}\left(0.5, \frac{y}{a} \cdot x, \color{blue}{-4.5 \cdot \frac{t \cdot z}{a}}\right) \]
      7. associate-/l*91.4%

        \[\leadsto \mathsf{fma}\left(0.5, \frac{y}{a} \cdot x, -4.5 \cdot \color{blue}{\frac{t}{\frac{a}{z}}}\right) \]
      8. associate-/r/91.2%

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

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

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

        \[\leadsto -4.5 \cdot \color{blue}{\left(\frac{t}{a} \cdot z\right)} \]
      2. *-commutative69.3%

        \[\leadsto \color{blue}{\left(\frac{t}{a} \cdot z\right) \cdot -4.5} \]
      3. *-commutative69.3%

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

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

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

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

    if 6.6000000000000003e63 < y

    1. Initial program 84.7%

      \[\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2} \]
    2. Step-by-step derivation
      1. sub-neg84.7%

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

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

        \[\leadsto \frac{\color{blue}{\left(0 - \left(z \cdot 9\right) \cdot t\right)} + x \cdot y}{a \cdot 2} \]
      4. associate-+l-84.7%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(\left(-x \cdot y\right) + \left(z \cdot 9\right) \cdot t\right)} \cdot \frac{-1}{a \cdot 2} \]
      12. neg-sub084.7%

        \[\leadsto \left(\color{blue}{\left(0 - x \cdot y\right)} + \left(z \cdot 9\right) \cdot t\right) \cdot \frac{-1}{a \cdot 2} \]
      13. associate-+l-84.7%

        \[\leadsto \color{blue}{\left(0 - \left(x \cdot y - \left(z \cdot 9\right) \cdot t\right)\right)} \cdot \frac{-1}{a \cdot 2} \]
      14. sub0-neg84.7%

        \[\leadsto \color{blue}{\left(-\left(x \cdot y - \left(z \cdot 9\right) \cdot t\right)\right)} \cdot \frac{-1}{a \cdot 2} \]
      15. distribute-lft-neg-out84.7%

        \[\leadsto \color{blue}{-\left(x \cdot y - \left(z \cdot 9\right) \cdot t\right) \cdot \frac{-1}{a \cdot 2}} \]
      16. distribute-rgt-neg-in84.7%

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, z \cdot \left(t \cdot -9\right)\right) \cdot \frac{0.5}{a}} \]
    4. Step-by-step derivation
      1. associate-*r/84.8%

        \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x, y, z \cdot \left(t \cdot -9\right)\right) \cdot 0.5}{a}} \]
      2. associate-/l*84.8%

        \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x, y, z \cdot \left(t \cdot -9\right)\right)}{\frac{a}{0.5}}} \]
      3. div-inv84.8%

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

        \[\leadsto \frac{\mathsf{fma}\left(x, y, z \cdot \left(t \cdot -9\right)\right)}{a \cdot \color{blue}{2}} \]
      5. *-commutative84.8%

        \[\leadsto \frac{\mathsf{fma}\left(x, y, z \cdot \color{blue}{\left(-9 \cdot t\right)}\right)}{a \cdot 2} \]
      6. metadata-eval84.8%

        \[\leadsto \frac{\mathsf{fma}\left(x, y, z \cdot \left(\color{blue}{\left(-9\right)} \cdot t\right)\right)}{a \cdot 2} \]
      7. distribute-lft-neg-in84.8%

        \[\leadsto \frac{\mathsf{fma}\left(x, y, z \cdot \color{blue}{\left(-9 \cdot t\right)}\right)}{a \cdot 2} \]
      8. distribute-rgt-neg-in84.8%

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

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

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

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

        \[\leadsto \frac{\frac{\color{blue}{\mathsf{fma}\left(x, y, -z \cdot \left(9 \cdot t\right)\right)}}{\sqrt{a \cdot 2}}}{\sqrt{a \cdot 2}} \]
      13. distribute-rgt-neg-in36.0%

        \[\leadsto \frac{\frac{\mathsf{fma}\left(x, y, \color{blue}{z \cdot \left(-9 \cdot t\right)}\right)}{\sqrt{a \cdot 2}}}{\sqrt{a \cdot 2}} \]
      14. distribute-lft-neg-in36.0%

        \[\leadsto \frac{\frac{\mathsf{fma}\left(x, y, z \cdot \color{blue}{\left(\left(-9\right) \cdot t\right)}\right)}{\sqrt{a \cdot 2}}}{\sqrt{a \cdot 2}} \]
      15. metadata-eval36.0%

        \[\leadsto \frac{\frac{\mathsf{fma}\left(x, y, z \cdot \left(\color{blue}{-9} \cdot t\right)\right)}{\sqrt{a \cdot 2}}}{\sqrt{a \cdot 2}} \]
      16. *-commutative36.0%

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

      \[\leadsto \color{blue}{\frac{\frac{\mathsf{fma}\left(x, y, z \cdot \left(t \cdot -9\right)\right)}{\sqrt{a \cdot 2}}}{\sqrt{a \cdot 2}}} \]
    6. Taylor expanded in x around inf 65.2%

      \[\leadsto \color{blue}{\frac{y \cdot x}{{\left(\sqrt{2}\right)}^{2} \cdot a}} \]
    7. Step-by-step derivation
      1. *-commutative65.2%

        \[\leadsto \frac{y \cdot x}{\color{blue}{a \cdot {\left(\sqrt{2}\right)}^{2}}} \]
      2. unpow265.2%

        \[\leadsto \frac{y \cdot x}{a \cdot \color{blue}{\left(\sqrt{2} \cdot \sqrt{2}\right)}} \]
      3. rem-square-sqrt65.6%

        \[\leadsto \frac{y \cdot x}{a \cdot \color{blue}{2}} \]
      4. *-commutative65.6%

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

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

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

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

Alternative 10: 67.6% accurate, 1.2× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ [z, t] = \mathsf{sort}([z, t])\\ \\ \begin{array}{l} \mathbf{if}\;y \leq -1.7 \cdot 10^{-90}:\\ \;\;\;\;\frac{x \cdot 0.5}{\frac{a}{y}}\\ \mathbf{elif}\;y \leq 7 \cdot 10^{+63}:\\ \;\;\;\;-4.5 \cdot \frac{z}{\frac{a}{t}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{a} \cdot \frac{y}{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.7e-90)
   (/ (* x 0.5) (/ a y))
   (if (<= y 7e+63) (* -4.5 (/ z (/ a t))) (* (/ x a) (/ y 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.7e-90) {
		tmp = (x * 0.5) / (a / y);
	} else if (y <= 7e+63) {
		tmp = -4.5 * (z / (a / t));
	} else {
		tmp = (x / a) * (y / 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.7d-90)) then
        tmp = (x * 0.5d0) / (a / y)
    else if (y <= 7d+63) then
        tmp = (-4.5d0) * (z / (a / t))
    else
        tmp = (x / a) * (y / 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.7e-90) {
		tmp = (x * 0.5) / (a / y);
	} else if (y <= 7e+63) {
		tmp = -4.5 * (z / (a / t));
	} else {
		tmp = (x / a) * (y / 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.7e-90:
		tmp = (x * 0.5) / (a / y)
	elif y <= 7e+63:
		tmp = -4.5 * (z / (a / t))
	else:
		tmp = (x / a) * (y / 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.7e-90)
		tmp = Float64(Float64(x * 0.5) / Float64(a / y));
	elseif (y <= 7e+63)
		tmp = Float64(-4.5 * Float64(z / Float64(a / t)));
	else
		tmp = Float64(Float64(x / a) * Float64(y / 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.7e-90)
		tmp = (x * 0.5) / (a / y);
	elseif (y <= 7e+63)
		tmp = -4.5 * (z / (a / t));
	else
		tmp = (x / a) * (y / 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.7e-90], N[(N[(x * 0.5), $MachinePrecision] / N[(a / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7e+63], N[(-4.5 * N[(z / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / a), $MachinePrecision] * N[(y / 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.7 \cdot 10^{-90}:\\
\;\;\;\;\frac{x \cdot 0.5}{\frac{a}{y}}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.69999999999999997e-90

    1. Initial program 94.4%

      \[\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2} \]
    2. Step-by-step derivation
      1. sub-neg94.4%

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

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

        \[\leadsto \frac{\color{blue}{\left(0 - \left(z \cdot 9\right) \cdot t\right)} + x \cdot y}{a \cdot 2} \]
      4. associate-+l-94.4%

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

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

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

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

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

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

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

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

        \[\leadsto \left(\color{blue}{\left(0 - x \cdot y\right)} + \left(z \cdot 9\right) \cdot t\right) \cdot \frac{-1}{a \cdot 2} \]
      13. associate-+l-94.3%

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, z \cdot \left(t \cdot -9\right)\right) \cdot \frac{0.5}{a}} \]
    4. Step-by-step derivation
      1. associate-*r/94.4%

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

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

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

      \[\leadsto \color{blue}{\frac{1}{\frac{a}{0.5 \cdot \mathsf{fma}\left(x, y, z \cdot \left(t \cdot -9\right)\right)}}} \]
    6. Taylor expanded in x around inf 54.1%

      \[\leadsto \color{blue}{0.5 \cdot \frac{y \cdot x}{a}} \]
    7. Step-by-step derivation
      1. *-commutative54.1%

        \[\leadsto \color{blue}{\frac{y \cdot x}{a} \cdot 0.5} \]
      2. *-commutative54.1%

        \[\leadsto \frac{\color{blue}{x \cdot y}}{a} \cdot 0.5 \]
      3. associate-/l*56.1%

        \[\leadsto \color{blue}{\frac{x}{\frac{a}{y}}} \cdot 0.5 \]
      4. associate-*l/56.1%

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

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

    if -1.69999999999999997e-90 < y < 7.00000000000000059e63

    1. Initial program 91.2%

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

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

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

        \[\leadsto \frac{\color{blue}{\left(0 - \left(z \cdot 9\right) \cdot t\right)} + x \cdot y}{a \cdot 2} \]
      4. associate-+l-91.2%

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

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

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

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

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

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

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

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

        \[\leadsto \left(\color{blue}{\left(0 - x \cdot y\right)} + \left(z \cdot 9\right) \cdot t\right) \cdot \frac{-1}{a \cdot 2} \]
      13. associate-+l-91.2%

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

        \[\leadsto \color{blue}{\left(-\left(x \cdot y - \left(z \cdot 9\right) \cdot t\right)\right)} \cdot \frac{-1}{a \cdot 2} \]
      15. distribute-lft-neg-out91.2%

        \[\leadsto \color{blue}{-\left(x \cdot y - \left(z \cdot 9\right) \cdot t\right) \cdot \frac{-1}{a \cdot 2}} \]
      16. distribute-rgt-neg-in91.2%

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, z \cdot \left(t \cdot -9\right)\right) \cdot \frac{0.5}{a}} \]
    4. Step-by-step derivation
      1. fma-udef91.1%

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

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

        \[\leadsto \left(x \cdot y + z \cdot \left(\color{blue}{\left(-9\right)} \cdot t\right)\right) \cdot \frac{0.5}{a} \]
      4. distribute-lft-neg-in91.1%

        \[\leadsto \left(x \cdot y + z \cdot \color{blue}{\left(-9 \cdot t\right)}\right) \cdot \frac{0.5}{a} \]
      5. distribute-rgt-neg-in91.1%

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

        \[\leadsto \color{blue}{\left(\left(-z \cdot \left(9 \cdot t\right)\right) + x \cdot y\right)} \cdot \frac{0.5}{a} \]
      7. distribute-rgt-neg-in91.1%

        \[\leadsto \left(\color{blue}{z \cdot \left(-9 \cdot t\right)} + x \cdot y\right) \cdot \frac{0.5}{a} \]
      8. distribute-lft-neg-in91.1%

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

        \[\leadsto \left(z \cdot \left(\color{blue}{-9} \cdot t\right) + x \cdot y\right) \cdot \frac{0.5}{a} \]
      10. *-commutative91.1%

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

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

      \[\leadsto \color{blue}{-4.5 \cdot \frac{t \cdot z}{a} + 0.5 \cdot \frac{y \cdot x}{a}} \]
    7. Step-by-step derivation
      1. +-commutative92.2%

        \[\leadsto \color{blue}{0.5 \cdot \frac{y \cdot x}{a} + -4.5 \cdot \frac{t \cdot z}{a}} \]
      2. *-commutative92.2%

        \[\leadsto 0.5 \cdot \frac{y \cdot x}{a} + \color{blue}{\frac{t \cdot z}{a} \cdot -4.5} \]
      3. fma-def92.2%

        \[\leadsto \color{blue}{\mathsf{fma}\left(0.5, \frac{y \cdot x}{a}, \frac{t \cdot z}{a} \cdot -4.5\right)} \]
      4. associate-/l*86.4%

        \[\leadsto \mathsf{fma}\left(0.5, \color{blue}{\frac{y}{\frac{a}{x}}}, \frac{t \cdot z}{a} \cdot -4.5\right) \]
      5. associate-/r/89.4%

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

        \[\leadsto \mathsf{fma}\left(0.5, \frac{y}{a} \cdot x, \color{blue}{-4.5 \cdot \frac{t \cdot z}{a}}\right) \]
      7. associate-/l*92.7%

        \[\leadsto \mathsf{fma}\left(0.5, \frac{y}{a} \cdot x, -4.5 \cdot \color{blue}{\frac{t}{\frac{a}{z}}}\right) \]
      8. associate-/r/91.7%

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

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

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

        \[\leadsto -4.5 \cdot \color{blue}{\left(\frac{t}{a} \cdot z\right)} \]
      2. *-commutative71.3%

        \[\leadsto \color{blue}{\left(\frac{t}{a} \cdot z\right) \cdot -4.5} \]
      3. *-commutative71.3%

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

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

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

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

    if 7.00000000000000059e63 < y

    1. Initial program 84.7%

      \[\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2} \]
    2. Step-by-step derivation
      1. sub-neg84.7%

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

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

        \[\leadsto \frac{\color{blue}{\left(0 - \left(z \cdot 9\right) \cdot t\right)} + x \cdot y}{a \cdot 2} \]
      4. associate-+l-84.7%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(\left(-x \cdot y\right) + \left(z \cdot 9\right) \cdot t\right)} \cdot \frac{-1}{a \cdot 2} \]
      12. neg-sub084.7%

        \[\leadsto \left(\color{blue}{\left(0 - x \cdot y\right)} + \left(z \cdot 9\right) \cdot t\right) \cdot \frac{-1}{a \cdot 2} \]
      13. associate-+l-84.7%

        \[\leadsto \color{blue}{\left(0 - \left(x \cdot y - \left(z \cdot 9\right) \cdot t\right)\right)} \cdot \frac{-1}{a \cdot 2} \]
      14. sub0-neg84.7%

        \[\leadsto \color{blue}{\left(-\left(x \cdot y - \left(z \cdot 9\right) \cdot t\right)\right)} \cdot \frac{-1}{a \cdot 2} \]
      15. distribute-lft-neg-out84.7%

        \[\leadsto \color{blue}{-\left(x \cdot y - \left(z \cdot 9\right) \cdot t\right) \cdot \frac{-1}{a \cdot 2}} \]
      16. distribute-rgt-neg-in84.7%

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, z \cdot \left(t \cdot -9\right)\right) \cdot \frac{0.5}{a}} \]
    4. Step-by-step derivation
      1. associate-*r/84.8%

        \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x, y, z \cdot \left(t \cdot -9\right)\right) \cdot 0.5}{a}} \]
      2. associate-/l*84.8%

        \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x, y, z \cdot \left(t \cdot -9\right)\right)}{\frac{a}{0.5}}} \]
      3. div-inv84.8%

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

        \[\leadsto \frac{\mathsf{fma}\left(x, y, z \cdot \left(t \cdot -9\right)\right)}{a \cdot \color{blue}{2}} \]
      5. *-commutative84.8%

        \[\leadsto \frac{\mathsf{fma}\left(x, y, z \cdot \color{blue}{\left(-9 \cdot t\right)}\right)}{a \cdot 2} \]
      6. metadata-eval84.8%

        \[\leadsto \frac{\mathsf{fma}\left(x, y, z \cdot \left(\color{blue}{\left(-9\right)} \cdot t\right)\right)}{a \cdot 2} \]
      7. distribute-lft-neg-in84.8%

        \[\leadsto \frac{\mathsf{fma}\left(x, y, z \cdot \color{blue}{\left(-9 \cdot t\right)}\right)}{a \cdot 2} \]
      8. distribute-rgt-neg-in84.8%

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

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

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

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

        \[\leadsto \frac{\frac{\color{blue}{\mathsf{fma}\left(x, y, -z \cdot \left(9 \cdot t\right)\right)}}{\sqrt{a \cdot 2}}}{\sqrt{a \cdot 2}} \]
      13. distribute-rgt-neg-in36.0%

        \[\leadsto \frac{\frac{\mathsf{fma}\left(x, y, \color{blue}{z \cdot \left(-9 \cdot t\right)}\right)}{\sqrt{a \cdot 2}}}{\sqrt{a \cdot 2}} \]
      14. distribute-lft-neg-in36.0%

        \[\leadsto \frac{\frac{\mathsf{fma}\left(x, y, z \cdot \color{blue}{\left(\left(-9\right) \cdot t\right)}\right)}{\sqrt{a \cdot 2}}}{\sqrt{a \cdot 2}} \]
      15. metadata-eval36.0%

        \[\leadsto \frac{\frac{\mathsf{fma}\left(x, y, z \cdot \left(\color{blue}{-9} \cdot t\right)\right)}{\sqrt{a \cdot 2}}}{\sqrt{a \cdot 2}} \]
      16. *-commutative36.0%

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

      \[\leadsto \color{blue}{\frac{\frac{\mathsf{fma}\left(x, y, z \cdot \left(t \cdot -9\right)\right)}{\sqrt{a \cdot 2}}}{\sqrt{a \cdot 2}}} \]
    6. Taylor expanded in x around inf 65.2%

      \[\leadsto \color{blue}{\frac{y \cdot x}{{\left(\sqrt{2}\right)}^{2} \cdot a}} \]
    7. Step-by-step derivation
      1. *-commutative65.2%

        \[\leadsto \frac{y \cdot x}{\color{blue}{a \cdot {\left(\sqrt{2}\right)}^{2}}} \]
      2. unpow265.2%

        \[\leadsto \frac{y \cdot x}{a \cdot \color{blue}{\left(\sqrt{2} \cdot \sqrt{2}\right)}} \]
      3. rem-square-sqrt65.6%

        \[\leadsto \frac{y \cdot x}{a \cdot \color{blue}{2}} \]
      4. *-commutative65.6%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.7 \cdot 10^{-90}:\\ \;\;\;\;\frac{x \cdot 0.5}{\frac{a}{y}}\\ \mathbf{elif}\;y \leq 7 \cdot 10^{+63}:\\ \;\;\;\;-4.5 \cdot \frac{z}{\frac{a}{t}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{a} \cdot \frac{y}{2}\\ \end{array} \]

Alternative 11: 67.5% accurate, 1.2× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ [z, t] = \mathsf{sort}([z, t])\\ \\ \begin{array}{l} \mathbf{if}\;y \leq -4.6 \cdot 10^{-66}:\\ \;\;\;\;\left(x \cdot 0.5\right) \cdot \frac{1}{\frac{a}{y}}\\ \mathbf{elif}\;y \leq 3 \cdot 10^{+64}:\\ \;\;\;\;-4.5 \cdot \frac{z}{\frac{a}{t}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{a} \cdot \frac{y}{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 -4.6e-66)
   (* (* x 0.5) (/ 1.0 (/ a y)))
   (if (<= y 3e+64) (* -4.5 (/ z (/ a t))) (* (/ x a) (/ y 2.0)))))
assert(x < y);
assert(z < t);
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (y <= -4.6e-66) {
		tmp = (x * 0.5) * (1.0 / (a / y));
	} else if (y <= 3e+64) {
		tmp = -4.5 * (z / (a / t));
	} else {
		tmp = (x / a) * (y / 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 <= (-4.6d-66)) then
        tmp = (x * 0.5d0) * (1.0d0 / (a / y))
    else if (y <= 3d+64) then
        tmp = (-4.5d0) * (z / (a / t))
    else
        tmp = (x / a) * (y / 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 <= -4.6e-66) {
		tmp = (x * 0.5) * (1.0 / (a / y));
	} else if (y <= 3e+64) {
		tmp = -4.5 * (z / (a / t));
	} else {
		tmp = (x / a) * (y / 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 <= -4.6e-66:
		tmp = (x * 0.5) * (1.0 / (a / y))
	elif y <= 3e+64:
		tmp = -4.5 * (z / (a / t))
	else:
		tmp = (x / a) * (y / 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 <= -4.6e-66)
		tmp = Float64(Float64(x * 0.5) * Float64(1.0 / Float64(a / y)));
	elseif (y <= 3e+64)
		tmp = Float64(-4.5 * Float64(z / Float64(a / t)));
	else
		tmp = Float64(Float64(x / a) * Float64(y / 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 <= -4.6e-66)
		tmp = (x * 0.5) * (1.0 / (a / y));
	elseif (y <= 3e+64)
		tmp = -4.5 * (z / (a / t));
	else
		tmp = (x / a) * (y / 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, -4.6e-66], N[(N[(x * 0.5), $MachinePrecision] * N[(1.0 / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3e+64], N[(-4.5 * N[(z / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / a), $MachinePrecision] * N[(y / 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 -4.6 \cdot 10^{-66}:\\
\;\;\;\;\left(x \cdot 0.5\right) \cdot \frac{1}{\frac{a}{y}}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -4.59999999999999984e-66

    1. Initial program 94.1%

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

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

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

        \[\leadsto \frac{\color{blue}{\left(0 - \left(z \cdot 9\right) \cdot t\right)} + x \cdot y}{a \cdot 2} \]
      4. associate-+l-94.1%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(\left(-x \cdot y\right) + \left(z \cdot 9\right) \cdot t\right)} \cdot \frac{-1}{a \cdot 2} \]
      12. neg-sub094.0%

        \[\leadsto \left(\color{blue}{\left(0 - x \cdot y\right)} + \left(z \cdot 9\right) \cdot t\right) \cdot \frac{-1}{a \cdot 2} \]
      13. associate-+l-94.0%

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

        \[\leadsto \color{blue}{\left(-\left(x \cdot y - \left(z \cdot 9\right) \cdot t\right)\right)} \cdot \frac{-1}{a \cdot 2} \]
      15. distribute-lft-neg-out94.0%

        \[\leadsto \color{blue}{-\left(x \cdot y - \left(z \cdot 9\right) \cdot t\right) \cdot \frac{-1}{a \cdot 2}} \]
      16. distribute-rgt-neg-in94.0%

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, z \cdot \left(t \cdot -9\right)\right) \cdot \frac{0.5}{a}} \]
    4. Step-by-step derivation
      1. associate-*r/94.1%

        \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x, y, z \cdot \left(t \cdot -9\right)\right) \cdot 0.5}{a}} \]
      2. clear-num94.1%

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

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

      \[\leadsto \color{blue}{\frac{1}{\frac{a}{0.5 \cdot \mathsf{fma}\left(x, y, z \cdot \left(t \cdot -9\right)\right)}}} \]
    6. Taylor expanded in x around inf 52.5%

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

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

        \[\leadsto \frac{\color{blue}{x \cdot y}}{a} \cdot 0.5 \]
      3. associate-/l*55.8%

        \[\leadsto \color{blue}{\frac{x}{\frac{a}{y}}} \cdot 0.5 \]
      4. associate-*l/55.8%

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

      \[\leadsto \color{blue}{\frac{x \cdot 0.5}{\frac{a}{y}}} \]
    9. Step-by-step derivation
      1. div-inv55.8%

        \[\leadsto \color{blue}{\left(x \cdot 0.5\right) \cdot \frac{1}{\frac{a}{y}}} \]
    10. Applied egg-rr55.8%

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

    if -4.59999999999999984e-66 < y < 3.0000000000000002e64

    1. Initial program 91.6%

      \[\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2} \]
    2. Step-by-step derivation
      1. sub-neg91.6%

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

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

        \[\leadsto \frac{\color{blue}{\left(0 - \left(z \cdot 9\right) \cdot t\right)} + x \cdot y}{a \cdot 2} \]
      4. associate-+l-91.6%

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

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

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

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

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

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

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

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

        \[\leadsto \left(\color{blue}{\left(0 - x \cdot y\right)} + \left(z \cdot 9\right) \cdot t\right) \cdot \frac{-1}{a \cdot 2} \]
      13. associate-+l-91.5%

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

        \[\leadsto \color{blue}{\left(-\left(x \cdot y - \left(z \cdot 9\right) \cdot t\right)\right)} \cdot \frac{-1}{a \cdot 2} \]
      15. distribute-lft-neg-out91.5%

        \[\leadsto \color{blue}{-\left(x \cdot y - \left(z \cdot 9\right) \cdot t\right) \cdot \frac{-1}{a \cdot 2}} \]
      16. distribute-rgt-neg-in91.5%

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, z \cdot \left(t \cdot -9\right)\right) \cdot \frac{0.5}{a}} \]
    4. Step-by-step derivation
      1. fma-udef91.4%

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

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

        \[\leadsto \left(x \cdot y + z \cdot \left(\color{blue}{\left(-9\right)} \cdot t\right)\right) \cdot \frac{0.5}{a} \]
      4. distribute-lft-neg-in91.4%

        \[\leadsto \left(x \cdot y + z \cdot \color{blue}{\left(-9 \cdot t\right)}\right) \cdot \frac{0.5}{a} \]
      5. distribute-rgt-neg-in91.4%

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

        \[\leadsto \color{blue}{\left(\left(-z \cdot \left(9 \cdot t\right)\right) + x \cdot y\right)} \cdot \frac{0.5}{a} \]
      7. distribute-rgt-neg-in91.4%

        \[\leadsto \left(\color{blue}{z \cdot \left(-9 \cdot t\right)} + x \cdot y\right) \cdot \frac{0.5}{a} \]
      8. distribute-lft-neg-in91.4%

        \[\leadsto \left(z \cdot \color{blue}{\left(\left(-9\right) \cdot t\right)} + x \cdot y\right) \cdot \frac{0.5}{a} \]
      9. metadata-eval91.4%

        \[\leadsto \left(z \cdot \left(\color{blue}{-9} \cdot t\right) + x \cdot y\right) \cdot \frac{0.5}{a} \]
      10. *-commutative91.4%

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

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

      \[\leadsto \color{blue}{-4.5 \cdot \frac{t \cdot z}{a} + 0.5 \cdot \frac{y \cdot x}{a}} \]
    7. Step-by-step derivation
      1. +-commutative92.5%

        \[\leadsto \color{blue}{0.5 \cdot \frac{y \cdot x}{a} + -4.5 \cdot \frac{t \cdot z}{a}} \]
      2. *-commutative92.5%

        \[\leadsto 0.5 \cdot \frac{y \cdot x}{a} + \color{blue}{\frac{t \cdot z}{a} \cdot -4.5} \]
      3. fma-def92.5%

        \[\leadsto \color{blue}{\mathsf{fma}\left(0.5, \frac{y \cdot x}{a}, \frac{t \cdot z}{a} \cdot -4.5\right)} \]
      4. associate-/l*87.0%

        \[\leadsto \mathsf{fma}\left(0.5, \color{blue}{\frac{y}{\frac{a}{x}}}, \frac{t \cdot z}{a} \cdot -4.5\right) \]
      5. associate-/r/89.0%

        \[\leadsto \mathsf{fma}\left(0.5, \color{blue}{\frac{y}{a} \cdot x}, \frac{t \cdot z}{a} \cdot -4.5\right) \]
      6. *-commutative89.0%

        \[\leadsto \mathsf{fma}\left(0.5, \frac{y}{a} \cdot x, \color{blue}{-4.5 \cdot \frac{t \cdot z}{a}}\right) \]
      7. associate-/l*91.4%

        \[\leadsto \mathsf{fma}\left(0.5, \frac{y}{a} \cdot x, -4.5 \cdot \color{blue}{\frac{t}{\frac{a}{z}}}\right) \]
      8. associate-/r/91.2%

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

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

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

        \[\leadsto -4.5 \cdot \color{blue}{\left(\frac{t}{a} \cdot z\right)} \]
      2. *-commutative69.3%

        \[\leadsto \color{blue}{\left(\frac{t}{a} \cdot z\right) \cdot -4.5} \]
      3. *-commutative69.3%

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

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

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

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

    if 3.0000000000000002e64 < y

    1. Initial program 84.7%

      \[\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2} \]
    2. Step-by-step derivation
      1. sub-neg84.7%

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

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

        \[\leadsto \frac{\color{blue}{\left(0 - \left(z \cdot 9\right) \cdot t\right)} + x \cdot y}{a \cdot 2} \]
      4. associate-+l-84.7%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(\left(-x \cdot y\right) + \left(z \cdot 9\right) \cdot t\right)} \cdot \frac{-1}{a \cdot 2} \]
      12. neg-sub084.7%

        \[\leadsto \left(\color{blue}{\left(0 - x \cdot y\right)} + \left(z \cdot 9\right) \cdot t\right) \cdot \frac{-1}{a \cdot 2} \]
      13. associate-+l-84.7%

        \[\leadsto \color{blue}{\left(0 - \left(x \cdot y - \left(z \cdot 9\right) \cdot t\right)\right)} \cdot \frac{-1}{a \cdot 2} \]
      14. sub0-neg84.7%

        \[\leadsto \color{blue}{\left(-\left(x \cdot y - \left(z \cdot 9\right) \cdot t\right)\right)} \cdot \frac{-1}{a \cdot 2} \]
      15. distribute-lft-neg-out84.7%

        \[\leadsto \color{blue}{-\left(x \cdot y - \left(z \cdot 9\right) \cdot t\right) \cdot \frac{-1}{a \cdot 2}} \]
      16. distribute-rgt-neg-in84.7%

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, z \cdot \left(t \cdot -9\right)\right) \cdot \frac{0.5}{a}} \]
    4. Step-by-step derivation
      1. associate-*r/84.8%

        \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x, y, z \cdot \left(t \cdot -9\right)\right) \cdot 0.5}{a}} \]
      2. associate-/l*84.8%

        \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x, y, z \cdot \left(t \cdot -9\right)\right)}{\frac{a}{0.5}}} \]
      3. div-inv84.8%

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

        \[\leadsto \frac{\mathsf{fma}\left(x, y, z \cdot \left(t \cdot -9\right)\right)}{a \cdot \color{blue}{2}} \]
      5. *-commutative84.8%

        \[\leadsto \frac{\mathsf{fma}\left(x, y, z \cdot \color{blue}{\left(-9 \cdot t\right)}\right)}{a \cdot 2} \]
      6. metadata-eval84.8%

        \[\leadsto \frac{\mathsf{fma}\left(x, y, z \cdot \left(\color{blue}{\left(-9\right)} \cdot t\right)\right)}{a \cdot 2} \]
      7. distribute-lft-neg-in84.8%

        \[\leadsto \frac{\mathsf{fma}\left(x, y, z \cdot \color{blue}{\left(-9 \cdot t\right)}\right)}{a \cdot 2} \]
      8. distribute-rgt-neg-in84.8%

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

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

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

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

        \[\leadsto \frac{\frac{\color{blue}{\mathsf{fma}\left(x, y, -z \cdot \left(9 \cdot t\right)\right)}}{\sqrt{a \cdot 2}}}{\sqrt{a \cdot 2}} \]
      13. distribute-rgt-neg-in36.0%

        \[\leadsto \frac{\frac{\mathsf{fma}\left(x, y, \color{blue}{z \cdot \left(-9 \cdot t\right)}\right)}{\sqrt{a \cdot 2}}}{\sqrt{a \cdot 2}} \]
      14. distribute-lft-neg-in36.0%

        \[\leadsto \frac{\frac{\mathsf{fma}\left(x, y, z \cdot \color{blue}{\left(\left(-9\right) \cdot t\right)}\right)}{\sqrt{a \cdot 2}}}{\sqrt{a \cdot 2}} \]
      15. metadata-eval36.0%

        \[\leadsto \frac{\frac{\mathsf{fma}\left(x, y, z \cdot \left(\color{blue}{-9} \cdot t\right)\right)}{\sqrt{a \cdot 2}}}{\sqrt{a \cdot 2}} \]
      16. *-commutative36.0%

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

      \[\leadsto \color{blue}{\frac{\frac{\mathsf{fma}\left(x, y, z \cdot \left(t \cdot -9\right)\right)}{\sqrt{a \cdot 2}}}{\sqrt{a \cdot 2}}} \]
    6. Taylor expanded in x around inf 65.2%

      \[\leadsto \color{blue}{\frac{y \cdot x}{{\left(\sqrt{2}\right)}^{2} \cdot a}} \]
    7. Step-by-step derivation
      1. *-commutative65.2%

        \[\leadsto \frac{y \cdot x}{\color{blue}{a \cdot {\left(\sqrt{2}\right)}^{2}}} \]
      2. unpow265.2%

        \[\leadsto \frac{y \cdot x}{a \cdot \color{blue}{\left(\sqrt{2} \cdot \sqrt{2}\right)}} \]
      3. rem-square-sqrt65.6%

        \[\leadsto \frac{y \cdot x}{a \cdot \color{blue}{2}} \]
      4. *-commutative65.6%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -4.6 \cdot 10^{-66}:\\ \;\;\;\;\left(x \cdot 0.5\right) \cdot \frac{1}{\frac{a}{y}}\\ \mathbf{elif}\;y \leq 3 \cdot 10^{+64}:\\ \;\;\;\;-4.5 \cdot \frac{z}{\frac{a}{t}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{a} \cdot \frac{y}{2}\\ \end{array} \]

Alternative 12: 51.3% accurate, 1.9× speedup?

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

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

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

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

      \[\leadsto \frac{\color{blue}{\left(0 - \left(z \cdot 9\right) \cdot t\right)} + x \cdot y}{a \cdot 2} \]
    4. associate-+l-90.9%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(\left(-x \cdot y\right) + \left(z \cdot 9\right) \cdot t\right)} \cdot \frac{-1}{a \cdot 2} \]
    12. neg-sub090.8%

      \[\leadsto \left(\color{blue}{\left(0 - x \cdot y\right)} + \left(z \cdot 9\right) \cdot t\right) \cdot \frac{-1}{a \cdot 2} \]
    13. associate-+l-90.8%

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

      \[\leadsto \color{blue}{\left(-\left(x \cdot y - \left(z \cdot 9\right) \cdot t\right)\right)} \cdot \frac{-1}{a \cdot 2} \]
    15. distribute-lft-neg-out90.8%

      \[\leadsto \color{blue}{-\left(x \cdot y - \left(z \cdot 9\right) \cdot t\right) \cdot \frac{-1}{a \cdot 2}} \]
    16. distribute-rgt-neg-in90.8%

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

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

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

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

    \[\leadsto \color{blue}{-4.5 \cdot \frac{t}{\frac{a}{z}}} \]
  7. Step-by-step derivation
    1. associate-/r/53.4%

      \[\leadsto -4.5 \cdot \color{blue}{\left(\frac{t}{a} \cdot z\right)} \]
  8. Applied egg-rr53.4%

    \[\leadsto -4.5 \cdot \color{blue}{\left(\frac{t}{a} \cdot z\right)} \]
  9. Final simplification53.4%

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

Developer target: 93.6% 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 2023185 
(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)))