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

Percentage Accurate: 90.9% → 94.9%
Time: 12.0s
Alternatives: 12
Speedup: 0.6×

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: 90.9% 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: 94.9% accurate, 0.5× speedup?

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

\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{a\_m \cdot 2} - t \cdot \frac{z \cdot 9}{a\_m \cdot 2}\\


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

    1. Initial program 95.2%

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

    if 4e5 < (*.f64 a 2)

    1. Initial program 81.4%

      \[\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. div-sub81.4%

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

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

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

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

        \[\leadsto y \cdot \frac{x}{a \cdot 2} - \color{blue}{t \cdot \frac{z \cdot 9}{a \cdot 2}} \]
    4. Applied egg-rr92.9%

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

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

Alternative 2: 73.7% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;x \cdot y \leq 4 \cdot 10^{+55}:\\
\;\;\;\;\frac{0.5}{\frac{a\_m}{x \cdot y}}\\

\mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{+113}:\\
\;\;\;\;\frac{z}{a\_m} \cdot \left(t \cdot -4.5\right)\\

\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(x \cdot \frac{y}{a\_m}\right)\\


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

    1. Initial program 88.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x, \frac{y}{2}, t \cdot \left(z \cdot -4.5\right)\right)}{a}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf 77.5%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(y \cdot 0.5\right)} \cdot \frac{x}{a} \]
    9. Applied egg-rr80.3%

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

    if -1e3 < (*.f64 x y) < 4.00000000000000027e-63

    1. Initial program 98.6%

      \[\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0 84.8%

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

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

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

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

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

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

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

    if 4.00000000000000027e-63 < (*.f64 x y) < 4.00000000000000004e55

    1. Initial program 92.6%

      \[\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2} \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 55.5%

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

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

      \[\leadsto \color{blue}{0.5 \cdot \left(x \cdot \frac{y}{a}\right)} \]
    6. Step-by-step derivation
      1. associate-*r/55.5%

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

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

        \[\leadsto 0.5 \cdot \frac{1}{\color{blue}{\frac{\frac{a}{x}}{y}}} \]
      4. un-div-inv45.5%

        \[\leadsto \color{blue}{\frac{0.5}{\frac{\frac{a}{x}}{y}}} \]
      5. associate-/r*55.5%

        \[\leadsto \frac{0.5}{\color{blue}{\frac{a}{x \cdot y}}} \]
    7. Applied egg-rr55.5%

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

    if 4.00000000000000004e55 < (*.f64 x y) < 2e113

    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. associate-/l/90.7%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x, \frac{y}{2}, t \cdot \left(z \cdot -4.5\right)\right)}{a}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 0 59.6%

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

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

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

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

      \[\leadsto \frac{\color{blue}{t \cdot \left(-4.5 \cdot z\right)}}{a} \]
    8. Step-by-step derivation
      1. associate-*r*59.5%

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

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

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

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

    if 2e113 < (*.f64 x y)

    1. Initial program 86.1%

      \[\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2} \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 79.8%

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

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

      \[\leadsto \color{blue}{0.5 \cdot \left(x \cdot \frac{y}{a}\right)} \]
  3. Recombined 5 regimes into one program.
  4. Final simplification80.6%

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

Alternative 3: 73.6% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;x \cdot y \leq 4 \cdot 10^{+55}:\\
\;\;\;\;\frac{0.5}{\frac{a\_m}{x \cdot y}}\\

\mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{+113}:\\
\;\;\;\;\frac{z}{a\_m} \cdot \left(t \cdot -4.5\right)\\

\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(x \cdot \frac{y}{a\_m}\right)\\


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

    1. Initial program 88.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x, \frac{y}{2}, t \cdot \left(z \cdot -4.5\right)\right)}{a}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf 77.5%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(y \cdot 0.5\right)} \cdot \frac{x}{a} \]
    9. Applied egg-rr80.3%

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

    if -1e3 < (*.f64 x y) < 4.00000000000000027e-63

    1. Initial program 98.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x, \frac{y}{2}, t \cdot \left(z \cdot -4.5\right)\right)}{a}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 0 84.9%

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

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

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

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

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

    if 4.00000000000000027e-63 < (*.f64 x y) < 4.00000000000000004e55

    1. Initial program 92.6%

      \[\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2} \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 55.5%

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

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

      \[\leadsto \color{blue}{0.5 \cdot \left(x \cdot \frac{y}{a}\right)} \]
    6. Step-by-step derivation
      1. associate-*r/55.5%

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

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

        \[\leadsto 0.5 \cdot \frac{1}{\color{blue}{\frac{\frac{a}{x}}{y}}} \]
      4. un-div-inv45.5%

        \[\leadsto \color{blue}{\frac{0.5}{\frac{\frac{a}{x}}{y}}} \]
      5. associate-/r*55.5%

        \[\leadsto \frac{0.5}{\color{blue}{\frac{a}{x \cdot y}}} \]
    7. Applied egg-rr55.5%

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

    if 4.00000000000000004e55 < (*.f64 x y) < 2e113

    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. associate-/l/90.7%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x, \frac{y}{2}, t \cdot \left(z \cdot -4.5\right)\right)}{a}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 0 59.6%

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

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

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

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

      \[\leadsto \frac{\color{blue}{t \cdot \left(-4.5 \cdot z\right)}}{a} \]
    8. Step-by-step derivation
      1. associate-*r*59.5%

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

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

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

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

    if 2e113 < (*.f64 x y)

    1. Initial program 86.1%

      \[\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2} \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 79.8%

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

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

      \[\leadsto \color{blue}{0.5 \cdot \left(x \cdot \frac{y}{a}\right)} \]
  3. Recombined 5 regimes into one program.
  4. Final simplification80.6%

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

Alternative 4: 66.7% accurate, 0.4× speedup?

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

\mathbf{elif}\;z \leq -5.9 \cdot 10^{+50}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq -8.4 \cdot 10^{+40}:\\
\;\;\;\;\left(z \cdot t\right) \cdot \frac{-4.5}{a\_m}\\

\mathbf{elif}\;z \leq -1.3 \cdot 10^{-113}:\\
\;\;\;\;0.5 \cdot \left(x \cdot \frac{y}{a\_m}\right)\\

\mathbf{elif}\;z \leq 3.6 \cdot 10^{-17}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if z < -1.5500000000000001e95

    1. Initial program 86.7%

      \[\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0 66.0%

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

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

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

    if -1.5500000000000001e95 < z < -5.8999999999999998e50 or -1.3e-113 < z < 3.59999999999999995e-17

    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. associate-/l/94.1%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x, \frac{y}{2}, t \cdot \left(z \cdot -4.5\right)\right)}{a}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf 72.5%

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

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

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

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

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

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

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

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

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

    if -5.8999999999999998e50 < z < -8.4000000000000004e40

    1. Initial program 99.6%

      \[\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0 99.6%

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

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

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

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

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

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

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

    if -8.4000000000000004e40 < z < -1.3e-113

    1. Initial program 94.0%

      \[\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2} \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 62.1%

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

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

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

    if 3.59999999999999995e-17 < z

    1. Initial program 93.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x, \frac{y}{2}, t \cdot \left(z \cdot -4.5\right)\right)}{a}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 0 61.0%

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

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

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

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

      \[\leadsto \frac{\color{blue}{t \cdot \left(-4.5 \cdot z\right)}}{a} \]
    8. Step-by-step derivation
      1. associate-*r*61.1%

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

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

        \[\leadsto \color{blue}{\frac{z}{a} \cdot \left(t \cdot -4.5\right)} \]
      4. metadata-eval64.8%

        \[\leadsto \frac{z}{a} \cdot \left(t \cdot \color{blue}{\frac{-9}{2}}\right) \]
      5. associate-/l*64.8%

        \[\leadsto \frac{z}{a} \cdot \color{blue}{\frac{t \cdot -9}{2}} \]
      6. times-frac61.1%

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

        \[\leadsto \color{blue}{z \cdot \frac{t \cdot -9}{a \cdot 2}} \]
      8. *-commutative62.3%

        \[\leadsto \color{blue}{\frac{t \cdot -9}{a \cdot 2} \cdot z} \]
      9. *-commutative62.3%

        \[\leadsto \frac{\color{blue}{-9 \cdot t}}{a \cdot 2} \cdot z \]
      10. *-commutative62.3%

        \[\leadsto \frac{-9 \cdot t}{\color{blue}{2 \cdot a}} \cdot z \]
      11. times-frac62.3%

        \[\leadsto \color{blue}{\left(\frac{-9}{2} \cdot \frac{t}{a}\right)} \cdot z \]
      12. metadata-eval62.3%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.55 \cdot 10^{+95}:\\ \;\;\;\;-4.5 \cdot \left(t \cdot \frac{z}{a}\right)\\ \mathbf{elif}\;z \leq -5.9 \cdot 10^{+50}:\\ \;\;\;\;\frac{x}{a} \cdot \left(y \cdot 0.5\right)\\ \mathbf{elif}\;z \leq -8.4 \cdot 10^{+40}:\\ \;\;\;\;\left(z \cdot t\right) \cdot \frac{-4.5}{a}\\ \mathbf{elif}\;z \leq -1.3 \cdot 10^{-113}:\\ \;\;\;\;0.5 \cdot \left(x \cdot \frac{y}{a}\right)\\ \mathbf{elif}\;z \leq 3.6 \cdot 10^{-17}:\\ \;\;\;\;\frac{x}{a} \cdot \left(y \cdot 0.5\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(-4.5 \cdot \frac{t}{a}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 67.0% accurate, 0.4× speedup?

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

\mathbf{elif}\;z \leq -4.1 \cdot 10^{+50}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq -7.7 \cdot 10^{+40}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;z \leq -1.02 \cdot 10^{-112}:\\
\;\;\;\;0.5 \cdot \left(x \cdot \frac{y}{a\_m}\right)\\

\mathbf{elif}\;z \leq 1.15 \cdot 10^{-29}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -6.2000000000000006e95

    1. Initial program 86.7%

      \[\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0 66.0%

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

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

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

    if -6.2000000000000006e95 < z < -4.1000000000000001e50 or -1.01999999999999996e-112 < z < 1.14999999999999996e-29

    1. Initial program 94.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x, \frac{y}{2}, t \cdot \left(z \cdot -4.5\right)\right)}{a}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf 72.3%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(y \cdot 0.5\right)} \cdot \frac{x}{a} \]
    9. Applied egg-rr71.3%

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

    if -4.1000000000000001e50 < z < -7.69999999999999964e40 or 1.14999999999999996e-29 < z

    1. Initial program 93.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x, \frac{y}{2}, t \cdot \left(z \cdot -4.5\right)\right)}{a}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 0 62.2%

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

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

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

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

      \[\leadsto \frac{\color{blue}{t \cdot \left(-4.5 \cdot z\right)}}{a} \]
    8. Step-by-step derivation
      1. associate-*r*62.3%

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

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

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

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

    if -7.69999999999999964e40 < z < -1.01999999999999996e-112

    1. Initial program 94.0%

      \[\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2} \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 62.1%

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

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

      \[\leadsto \color{blue}{0.5 \cdot \left(x \cdot \frac{y}{a}\right)} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification68.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -6.2 \cdot 10^{+95}:\\ \;\;\;\;-4.5 \cdot \left(t \cdot \frac{z}{a}\right)\\ \mathbf{elif}\;z \leq -4.1 \cdot 10^{+50}:\\ \;\;\;\;\frac{x}{a} \cdot \left(y \cdot 0.5\right)\\ \mathbf{elif}\;z \leq -7.7 \cdot 10^{+40}:\\ \;\;\;\;\frac{z}{a} \cdot \left(t \cdot -4.5\right)\\ \mathbf{elif}\;z \leq -1.02 \cdot 10^{-112}:\\ \;\;\;\;0.5 \cdot \left(x \cdot \frac{y}{a}\right)\\ \mathbf{elif}\;z \leq 1.15 \cdot 10^{-29}:\\ \;\;\;\;\frac{x}{a} \cdot \left(y \cdot 0.5\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{z}{a} \cdot \left(t \cdot -4.5\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 92.8% accurate, 0.6× speedup?

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

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


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

    1. Initial program 95.2%

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

    if 4e5 < (*.f64 a 2)

    1. Initial program 81.4%

      \[\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0 81.3%

      \[\leadsto \color{blue}{-4.5 \cdot \frac{t \cdot z}{a} + 0.5 \cdot \frac{x \cdot y}{a}} \]
    4. Step-by-step derivation
      1. clear-num81.3%

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

        \[\leadsto -4.5 \cdot \frac{t \cdot z}{a} + 0.5 \cdot \frac{1}{\color{blue}{\frac{\frac{a}{x}}{y}}} \]
      3. associate-/r/84.8%

        \[\leadsto -4.5 \cdot \frac{t \cdot z}{a} + 0.5 \cdot \color{blue}{\left(\frac{1}{\frac{a}{x}} \cdot y\right)} \]
      4. clear-num86.7%

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

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

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

Alternative 7: 95.1% accurate, 0.6× speedup?

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

\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{a\_m \cdot 2} - z \cdot \frac{t}{a\_m \cdot 0.2222222222222222}\\


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

    1. Initial program 95.2%

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

    if 4e5 < (*.f64 a 2)

    1. Initial program 81.4%

      \[\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. div-sub81.4%

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

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

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

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

        \[\leadsto y \cdot \frac{x}{a \cdot 2} - \color{blue}{t \cdot \frac{z \cdot 9}{a \cdot 2}} \]
    4. Applied egg-rr92.9%

      \[\leadsto \color{blue}{y \cdot \frac{x}{a \cdot 2} - t \cdot \frac{z \cdot 9}{a \cdot 2}} \]
    5. Step-by-step derivation
      1. clear-num92.9%

        \[\leadsto y \cdot \frac{x}{a \cdot 2} - t \cdot \color{blue}{\frac{1}{\frac{a \cdot 2}{z \cdot 9}}} \]
      2. un-div-inv92.8%

        \[\leadsto y \cdot \frac{x}{a \cdot 2} - \color{blue}{\frac{t}{\frac{a \cdot 2}{z \cdot 9}}} \]
      3. *-commutative92.8%

        \[\leadsto y \cdot \frac{x}{a \cdot 2} - \frac{t}{\frac{\color{blue}{2 \cdot a}}{z \cdot 9}} \]
      4. *-commutative92.8%

        \[\leadsto y \cdot \frac{x}{a \cdot 2} - \frac{t}{\frac{2 \cdot a}{\color{blue}{9 \cdot z}}} \]
      5. times-frac92.8%

        \[\leadsto y \cdot \frac{x}{a \cdot 2} - \frac{t}{\color{blue}{\frac{2}{9} \cdot \frac{a}{z}}} \]
      6. metadata-eval92.8%

        \[\leadsto y \cdot \frac{x}{a \cdot 2} - \frac{t}{\color{blue}{0.2222222222222222} \cdot \frac{a}{z}} \]
    6. Applied egg-rr92.8%

      \[\leadsto y \cdot \frac{x}{a \cdot 2} - \color{blue}{\frac{t}{0.2222222222222222 \cdot \frac{a}{z}}} \]
    7. Step-by-step derivation
      1. associate-*r/92.9%

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

        \[\leadsto y \cdot \frac{x}{a \cdot 2} - \frac{t}{\frac{\color{blue}{a \cdot 0.2222222222222222}}{z}} \]
      3. associate-/r/90.2%

        \[\leadsto y \cdot \frac{x}{a \cdot 2} - \color{blue}{\frac{t}{a \cdot 0.2222222222222222} \cdot z} \]
    8. Simplified90.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \cdot 2 \leq 400000:\\ \;\;\;\;\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{x}{a \cdot 2} - z \cdot \frac{t}{a \cdot 0.2222222222222222}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 94.8% accurate, 0.6× speedup?

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

\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{a\_m \cdot 2} - \frac{t}{\frac{a\_m \cdot 0.2222222222222222}{z}}\\


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

    1. Initial program 95.2%

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

    if 4e5 < (*.f64 a 2)

    1. Initial program 81.4%

      \[\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. div-sub81.4%

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

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

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

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

        \[\leadsto y \cdot \frac{x}{a \cdot 2} - \color{blue}{t \cdot \frac{z \cdot 9}{a \cdot 2}} \]
    4. Applied egg-rr92.9%

      \[\leadsto \color{blue}{y \cdot \frac{x}{a \cdot 2} - t \cdot \frac{z \cdot 9}{a \cdot 2}} \]
    5. Step-by-step derivation
      1. clear-num92.9%

        \[\leadsto y \cdot \frac{x}{a \cdot 2} - t \cdot \color{blue}{\frac{1}{\frac{a \cdot 2}{z \cdot 9}}} \]
      2. un-div-inv92.8%

        \[\leadsto y \cdot \frac{x}{a \cdot 2} - \color{blue}{\frac{t}{\frac{a \cdot 2}{z \cdot 9}}} \]
      3. *-commutative92.8%

        \[\leadsto y \cdot \frac{x}{a \cdot 2} - \frac{t}{\frac{\color{blue}{2 \cdot a}}{z \cdot 9}} \]
      4. *-commutative92.8%

        \[\leadsto y \cdot \frac{x}{a \cdot 2} - \frac{t}{\frac{2 \cdot a}{\color{blue}{9 \cdot z}}} \]
      5. times-frac92.8%

        \[\leadsto y \cdot \frac{x}{a \cdot 2} - \frac{t}{\color{blue}{\frac{2}{9} \cdot \frac{a}{z}}} \]
      6. metadata-eval92.8%

        \[\leadsto y \cdot \frac{x}{a \cdot 2} - \frac{t}{\color{blue}{0.2222222222222222} \cdot \frac{a}{z}} \]
    6. Applied egg-rr92.8%

      \[\leadsto y \cdot \frac{x}{a \cdot 2} - \color{blue}{\frac{t}{0.2222222222222222 \cdot \frac{a}{z}}} \]
    7. Step-by-step derivation
      1. associate-*r/92.9%

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

        \[\leadsto y \cdot \frac{x}{a \cdot 2} - \frac{t}{\frac{\color{blue}{a \cdot 0.2222222222222222}}{z}} \]
    8. Simplified92.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \cdot 2 \leq 400000:\\ \;\;\;\;\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{x}{a \cdot 2} - \frac{t}{\frac{a \cdot 0.2222222222222222}{z}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 92.9% accurate, 0.6× speedup?

\[\begin{array}{l} a_m = \left|a\right| \\ a_s = \mathsf{copysign}\left(1, a\right) \\ [x, y, z, t, a_m] = \mathsf{sort}([x, y, z, t, a_m])\\\\ [x, y, z, t, a_m] = \mathsf{sort}([x, y, z, t, a_m])\\ \\ a\_s \cdot \begin{array}{l} \mathbf{if}\;x \cdot y \leq -\infty:\\ \;\;\;\;0.5 \cdot \left(x \cdot \frac{y}{a\_m}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a\_m \cdot 2}\\ \end{array} \end{array} \]
a_m = (fabs.f64 a)
a_s = (copysign.f64 1 a)
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
(FPCore (a_s x y z t a_m)
 :precision binary64
 (*
  a_s
  (if (<= (* x y) (- INFINITY))
    (* 0.5 (* x (/ y a_m)))
    (/ (- (* x y) (* (* z 9.0) t)) (* a_m 2.0)))))
a_m = fabs(a);
a_s = copysign(1.0, a);
assert(x < y && y < z && z < t && t < a_m);
assert(x < y && y < z && z < t && t < a_m);
double code(double a_s, double x, double y, double z, double t, double a_m) {
	double tmp;
	if ((x * y) <= -((double) INFINITY)) {
		tmp = 0.5 * (x * (y / a_m));
	} else {
		tmp = ((x * y) - ((z * 9.0) * t)) / (a_m * 2.0);
	}
	return a_s * tmp;
}
a_m = Math.abs(a);
a_s = Math.copySign(1.0, a);
assert x < y && y < z && z < t && t < a_m;
assert x < y && y < z && z < t && t < a_m;
public static double code(double a_s, double x, double y, double z, double t, double a_m) {
	double tmp;
	if ((x * y) <= -Double.POSITIVE_INFINITY) {
		tmp = 0.5 * (x * (y / a_m));
	} else {
		tmp = ((x * y) - ((z * 9.0) * t)) / (a_m * 2.0);
	}
	return a_s * tmp;
}
a_m = math.fabs(a)
a_s = math.copysign(1.0, a)
[x, y, z, t, a_m] = sort([x, y, z, t, a_m])
[x, y, z, t, a_m] = sort([x, y, z, t, a_m])
def code(a_s, x, y, z, t, a_m):
	tmp = 0
	if (x * y) <= -math.inf:
		tmp = 0.5 * (x * (y / a_m))
	else:
		tmp = ((x * y) - ((z * 9.0) * t)) / (a_m * 2.0)
	return a_s * tmp
a_m = abs(a)
a_s = copysign(1.0, a)
x, y, z, t, a_m = sort([x, y, z, t, a_m])
x, y, z, t, a_m = sort([x, y, z, t, a_m])
function code(a_s, x, y, z, t, a_m)
	tmp = 0.0
	if (Float64(x * y) <= Float64(-Inf))
		tmp = Float64(0.5 * Float64(x * Float64(y / a_m)));
	else
		tmp = Float64(Float64(Float64(x * y) - Float64(Float64(z * 9.0) * t)) / Float64(a_m * 2.0));
	end
	return Float64(a_s * tmp)
end
a_m = abs(a);
a_s = sign(a) * abs(1.0);
x, y, z, t, a_m = num2cell(sort([x, y, z, t, a_m])){:}
x, y, z, t, a_m = num2cell(sort([x, y, z, t, a_m])){:}
function tmp_2 = code(a_s, x, y, z, t, a_m)
	tmp = 0.0;
	if ((x * y) <= -Inf)
		tmp = 0.5 * (x * (y / a_m));
	else
		tmp = ((x * y) - ((z * 9.0) * t)) / (a_m * 2.0);
	end
	tmp_2 = a_s * tmp;
end
a_m = N[Abs[a], $MachinePrecision]
a_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
code[a$95$s_, x_, y_, z_, t_, a$95$m_] := N[(a$95$s * If[LessEqual[N[(x * y), $MachinePrecision], (-Infinity)], N[(0.5 * N[(x * N[(y / a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * y), $MachinePrecision] - N[(N[(z * 9.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] / N[(a$95$m * 2.0), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
a_s = \mathsf{copysign}\left(1, a\right)
\\
[x, y, z, t, a_m] = \mathsf{sort}([x, y, z, t, a_m])\\\\
[x, y, z, t, a_m] = \mathsf{sort}([x, y, z, t, a_m])\\
\\
a\_s \cdot \begin{array}{l}
\mathbf{if}\;x \cdot y \leq -\infty:\\
\;\;\;\;0.5 \cdot \left(x \cdot \frac{y}{a\_m}\right)\\

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


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

    1. Initial program 49.4%

      \[\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2} \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 49.9%

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

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

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

    if -inf.0 < (*.f64 x y)

    1. Initial program 95.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -\infty:\\ \;\;\;\;0.5 \cdot \left(x \cdot \frac{y}{a}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2}\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 67.2% accurate, 0.8× speedup?

\[\begin{array}{l} a_m = \left|a\right| \\ a_s = \mathsf{copysign}\left(1, a\right) \\ [x, y, z, t, a_m] = \mathsf{sort}([x, y, z, t, a_m])\\\\ [x, y, z, t, a_m] = \mathsf{sort}([x, y, z, t, a_m])\\ \\ a\_s \cdot \begin{array}{l} \mathbf{if}\;t \leq -3 \cdot 10^{-149} \lor \neg \left(t \leq 1.2 \cdot 10^{+90}\right):\\ \;\;\;\;-4.5 \cdot \left(t \cdot \frac{z}{a\_m}\right)\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \left(x \cdot \frac{y}{a\_m}\right)\\ \end{array} \end{array} \]
a_m = (fabs.f64 a)
a_s = (copysign.f64 1 a)
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
(FPCore (a_s x y z t a_m)
 :precision binary64
 (*
  a_s
  (if (or (<= t -3e-149) (not (<= t 1.2e+90)))
    (* -4.5 (* t (/ z a_m)))
    (* 0.5 (* x (/ y a_m))))))
a_m = fabs(a);
a_s = copysign(1.0, a);
assert(x < y && y < z && z < t && t < a_m);
assert(x < y && y < z && z < t && t < a_m);
double code(double a_s, double x, double y, double z, double t, double a_m) {
	double tmp;
	if ((t <= -3e-149) || !(t <= 1.2e+90)) {
		tmp = -4.5 * (t * (z / a_m));
	} else {
		tmp = 0.5 * (x * (y / a_m));
	}
	return a_s * tmp;
}
a_m = abs(a)
a_s = copysign(1.0d0, a)
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
real(8) function code(a_s, x, y, z, t, a_m)
    real(8), intent (in) :: a_s
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a_m
    real(8) :: tmp
    if ((t <= (-3d-149)) .or. (.not. (t <= 1.2d+90))) then
        tmp = (-4.5d0) * (t * (z / a_m))
    else
        tmp = 0.5d0 * (x * (y / a_m))
    end if
    code = a_s * tmp
end function
a_m = Math.abs(a);
a_s = Math.copySign(1.0, a);
assert x < y && y < z && z < t && t < a_m;
assert x < y && y < z && z < t && t < a_m;
public static double code(double a_s, double x, double y, double z, double t, double a_m) {
	double tmp;
	if ((t <= -3e-149) || !(t <= 1.2e+90)) {
		tmp = -4.5 * (t * (z / a_m));
	} else {
		tmp = 0.5 * (x * (y / a_m));
	}
	return a_s * tmp;
}
a_m = math.fabs(a)
a_s = math.copysign(1.0, a)
[x, y, z, t, a_m] = sort([x, y, z, t, a_m])
[x, y, z, t, a_m] = sort([x, y, z, t, a_m])
def code(a_s, x, y, z, t, a_m):
	tmp = 0
	if (t <= -3e-149) or not (t <= 1.2e+90):
		tmp = -4.5 * (t * (z / a_m))
	else:
		tmp = 0.5 * (x * (y / a_m))
	return a_s * tmp
a_m = abs(a)
a_s = copysign(1.0, a)
x, y, z, t, a_m = sort([x, y, z, t, a_m])
x, y, z, t, a_m = sort([x, y, z, t, a_m])
function code(a_s, x, y, z, t, a_m)
	tmp = 0.0
	if ((t <= -3e-149) || !(t <= 1.2e+90))
		tmp = Float64(-4.5 * Float64(t * Float64(z / a_m)));
	else
		tmp = Float64(0.5 * Float64(x * Float64(y / a_m)));
	end
	return Float64(a_s * tmp)
end
a_m = abs(a);
a_s = sign(a) * abs(1.0);
x, y, z, t, a_m = num2cell(sort([x, y, z, t, a_m])){:}
x, y, z, t, a_m = num2cell(sort([x, y, z, t, a_m])){:}
function tmp_2 = code(a_s, x, y, z, t, a_m)
	tmp = 0.0;
	if ((t <= -3e-149) || ~((t <= 1.2e+90)))
		tmp = -4.5 * (t * (z / a_m));
	else
		tmp = 0.5 * (x * (y / a_m));
	end
	tmp_2 = a_s * tmp;
end
a_m = N[Abs[a], $MachinePrecision]
a_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
code[a$95$s_, x_, y_, z_, t_, a$95$m_] := N[(a$95$s * If[Or[LessEqual[t, -3e-149], N[Not[LessEqual[t, 1.2e+90]], $MachinePrecision]], N[(-4.5 * N[(t * N[(z / a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(x * N[(y / a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
a_s = \mathsf{copysign}\left(1, a\right)
\\
[x, y, z, t, a_m] = \mathsf{sort}([x, y, z, t, a_m])\\\\
[x, y, z, t, a_m] = \mathsf{sort}([x, y, z, t, a_m])\\
\\
a\_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq -3 \cdot 10^{-149} \lor \neg \left(t \leq 1.2 \cdot 10^{+90}\right):\\
\;\;\;\;-4.5 \cdot \left(t \cdot \frac{z}{a\_m}\right)\\

\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(x \cdot \frac{y}{a\_m}\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -3.0000000000000002e-149 or 1.20000000000000005e90 < t

    1. Initial program 90.7%

      \[\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0 62.1%

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

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

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

    if -3.0000000000000002e-149 < t < 1.20000000000000005e90

    1. Initial program 95.1%

      \[\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2} \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 77.2%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -3 \cdot 10^{-149} \lor \neg \left(t \leq 1.2 \cdot 10^{+90}\right):\\ \;\;\;\;-4.5 \cdot \left(t \cdot \frac{z}{a}\right)\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \left(x \cdot \frac{y}{a}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 67.3% accurate, 0.8× speedup?

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

\mathbf{elif}\;t \leq 1.36 \cdot 10^{+90}:\\
\;\;\;\;0.5 \cdot \left(x \cdot \frac{y}{a\_m}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -2.3e-149

    1. Initial program 91.7%

      \[\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0 53.8%

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

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

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

    if -2.3e-149 < t < 1.3600000000000001e90

    1. Initial program 95.1%

      \[\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2} \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 77.2%

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

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

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

    if 1.3600000000000001e90 < t

    1. Initial program 89.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x, \frac{y}{2}, t \cdot \left(z \cdot -4.5\right)\right)}{a}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 0 75.8%

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

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

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

        \[\leadsto \frac{\color{blue}{t \cdot \left(-4.5 \cdot z\right)}}{a} \]
    7. Simplified75.9%

      \[\leadsto \frac{\color{blue}{t \cdot \left(-4.5 \cdot z\right)}}{a} \]
    8. Step-by-step derivation
      1. associate-*r*75.9%

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

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

        \[\leadsto \color{blue}{\frac{z}{a} \cdot \left(t \cdot -4.5\right)} \]
      4. metadata-eval75.8%

        \[\leadsto \frac{z}{a} \cdot \left(t \cdot \color{blue}{\frac{-9}{2}}\right) \]
      5. associate-/l*75.8%

        \[\leadsto \frac{z}{a} \cdot \color{blue}{\frac{t \cdot -9}{2}} \]
      6. times-frac74.2%

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

        \[\leadsto \color{blue}{z \cdot \frac{t \cdot -9}{a \cdot 2}} \]
      8. *-commutative75.8%

        \[\leadsto \color{blue}{\frac{t \cdot -9}{a \cdot 2} \cdot z} \]
      9. *-commutative75.8%

        \[\leadsto \frac{\color{blue}{-9 \cdot t}}{a \cdot 2} \cdot z \]
      10. *-commutative75.8%

        \[\leadsto \frac{-9 \cdot t}{\color{blue}{2 \cdot a}} \cdot z \]
      11. times-frac75.8%

        \[\leadsto \color{blue}{\left(\frac{-9}{2} \cdot \frac{t}{a}\right)} \cdot z \]
      12. metadata-eval75.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -2.3 \cdot 10^{-149}:\\ \;\;\;\;-4.5 \cdot \left(t \cdot \frac{z}{a}\right)\\ \mathbf{elif}\;t \leq 1.36 \cdot 10^{+90}:\\ \;\;\;\;0.5 \cdot \left(x \cdot \frac{y}{a}\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(-4.5 \cdot \frac{t}{a}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 51.4% accurate, 1.9× speedup?

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

    \[\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2} \]
  2. Add Preprocessing
  3. Taylor expanded in x around 0 48.7%

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

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

    \[\leadsto \color{blue}{-4.5 \cdot \left(t \cdot \frac{z}{a}\right)} \]
  6. Final simplification49.2%

    \[\leadsto -4.5 \cdot \left(t \cdot \frac{z}{a}\right) \]
  7. Add Preprocessing

Developer target: 94.4% accurate, 0.5× 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 2024039 
(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)))