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

Percentage Accurate: 90.9% → 94.8%
Time: 13.0s
Alternatives: 11
Speedup: 0.8×

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 11 alternatives:

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

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

\[\begin{array}{l} [z, t] = \mathsf{sort}([z, t])\\ \\ \begin{array}{l} t_1 := \left(z \cdot 9\right) \cdot t\\ \mathbf{if}\;t_1 \leq -\infty:\\ \;\;\;\;\frac{t}{a} \cdot \left(z \cdot -4.5\right)\\ \mathbf{elif}\;t_1 \leq 5 \cdot 10^{+280}:\\ \;\;\;\;\frac{x \cdot y - t_1}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;-4.5 \cdot \frac{t}{\frac{a}{z}}\\ \end{array} \end{array} \]
NOTE: z and t should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* (* z 9.0) t)))
   (if (<= t_1 (- INFINITY))
     (* (/ t a) (* z -4.5))
     (if (<= t_1 5e+280)
       (/ (- (* x y) t_1) (* a 2.0))
       (* -4.5 (/ t (/ a z)))))))
assert(z < t);
double code(double x, double y, double z, double t, double a) {
	double t_1 = (z * 9.0) * t;
	double tmp;
	if (t_1 <= -((double) INFINITY)) {
		tmp = (t / a) * (z * -4.5);
	} else if (t_1 <= 5e+280) {
		tmp = ((x * y) - t_1) / (a * 2.0);
	} else {
		tmp = -4.5 * (t / (a / z));
	}
	return tmp;
}
assert z < t;
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = (z * 9.0) * t;
	double tmp;
	if (t_1 <= -Double.POSITIVE_INFINITY) {
		tmp = (t / a) * (z * -4.5);
	} else if (t_1 <= 5e+280) {
		tmp = ((x * y) - t_1) / (a * 2.0);
	} else {
		tmp = -4.5 * (t / (a / z));
	}
	return tmp;
}
[z, t] = sort([z, t])
def code(x, y, z, t, a):
	t_1 = (z * 9.0) * t
	tmp = 0
	if t_1 <= -math.inf:
		tmp = (t / a) * (z * -4.5)
	elif t_1 <= 5e+280:
		tmp = ((x * y) - t_1) / (a * 2.0)
	else:
		tmp = -4.5 * (t / (a / z))
	return tmp
z, t = sort([z, t])
function code(x, y, z, t, a)
	t_1 = Float64(Float64(z * 9.0) * t)
	tmp = 0.0
	if (t_1 <= Float64(-Inf))
		tmp = Float64(Float64(t / a) * Float64(z * -4.5));
	elseif (t_1 <= 5e+280)
		tmp = Float64(Float64(Float64(x * y) - t_1) / Float64(a * 2.0));
	else
		tmp = Float64(-4.5 * Float64(t / Float64(a / z)));
	end
	return tmp
end
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t, a)
	t_1 = (z * 9.0) * t;
	tmp = 0.0;
	if (t_1 <= -Inf)
		tmp = (t / a) * (z * -4.5);
	elseif (t_1 <= 5e+280)
		tmp = ((x * y) - t_1) / (a * 2.0);
	else
		tmp = -4.5 * (t / (a / z));
	end
	tmp_2 = tmp;
end
NOTE: z and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z * 9.0), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(t / a), $MachinePrecision] * N[(z * -4.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+280], N[(N[(N[(x * y), $MachinePrecision] - t$95$1), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], N[(-4.5 * N[(t / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
t_1 := \left(z \cdot 9\right) \cdot t\\
\mathbf{if}\;t_1 \leq -\infty:\\
\;\;\;\;\frac{t}{a} \cdot \left(z \cdot -4.5\right)\\

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

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


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

    1. Initial program 63.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto {\left(\sqrt[3]{\color{blue}{-4.5 \cdot \frac{t \cdot z}{a}}}\right)}^{3} \]
    7. Step-by-step derivation
      1. *-commutative68.9%

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

        \[\leadsto {\left(\sqrt[3]{-4.5 \cdot \color{blue}{\left(z \cdot \frac{t}{a}\right)}}\right)}^{3} \]
    8. Simplified94.1%

      \[\leadsto {\left(\sqrt[3]{\color{blue}{-4.5 \cdot \left(z \cdot \frac{t}{a}\right)}}\right)}^{3} \]
    9. Step-by-step derivation
      1. rem-cube-cbrt94.6%

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

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

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

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

    1. Initial program 96.2%

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

    if 5.0000000000000002e280 < (*.f64 (*.f64 z 9) t)

    1. Initial program 52.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 94.0% accurate, 0.1× speedup?

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

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


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

    1. Initial program 63.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{{\left(\left(x \cdot y\right) \cdot \frac{0.5}{a}\right)}^{3} - {\left(0.5 \cdot \frac{t \cdot \left(z \cdot 9\right)}{a}\right)}^{3}}{\left(\left(x \cdot y\right) \cdot \frac{0.5}{a}\right) \cdot \left(\left(x \cdot y\right) \cdot \frac{0.5}{a}\right) + \left(\left(0.5 \cdot \frac{t \cdot \left(z \cdot 9\right)}{a}\right) \cdot \left(0.5 \cdot \frac{t \cdot \left(z \cdot 9\right)}{a}\right) + \left(\left(x \cdot y\right) \cdot \frac{0.5}{a}\right) \cdot \left(0.5 \cdot \frac{t \cdot \left(z \cdot 9\right)}{a}\right)\right)}} \]
    5. Taylor expanded in t around inf 19.8%

      \[\leadsto \color{blue}{-4.5 \cdot \frac{t \cdot z}{a} + \left(0.5 \cdot \frac{y \cdot x}{a} + -1 \cdot \frac{0.05555555555555555 \cdot \frac{{y}^{2} \cdot {x}^{2}}{a \cdot z} + -0.05555555555555555 \cdot \frac{{y}^{2} \cdot {x}^{2}}{a \cdot z}}{t}\right)} \]
    6. Step-by-step derivation
      1. fma-def19.8%

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

        \[\leadsto \mathsf{fma}\left(-4.5, \frac{\color{blue}{z \cdot t}}{a}, 0.5 \cdot \frac{y \cdot x}{a} + -1 \cdot \frac{0.05555555555555555 \cdot \frac{{y}^{2} \cdot {x}^{2}}{a \cdot z} + -0.05555555555555555 \cdot \frac{{y}^{2} \cdot {x}^{2}}{a \cdot z}}{t}\right) \]
      3. associate-*r/30.6%

        \[\leadsto \mathsf{fma}\left(-4.5, \color{blue}{z \cdot \frac{t}{a}}, 0.5 \cdot \frac{y \cdot x}{a} + -1 \cdot \frac{0.05555555555555555 \cdot \frac{{y}^{2} \cdot {x}^{2}}{a \cdot z} + -0.05555555555555555 \cdot \frac{{y}^{2} \cdot {x}^{2}}{a \cdot z}}{t}\right) \]
      4. fma-def30.6%

        \[\leadsto \mathsf{fma}\left(-4.5, z \cdot \frac{t}{a}, \color{blue}{\mathsf{fma}\left(0.5, \frac{y \cdot x}{a}, -1 \cdot \frac{0.05555555555555555 \cdot \frac{{y}^{2} \cdot {x}^{2}}{a \cdot z} + -0.05555555555555555 \cdot \frac{{y}^{2} \cdot {x}^{2}}{a \cdot z}}{t}\right)}\right) \]
      5. associate-/l*30.6%

        \[\leadsto \mathsf{fma}\left(-4.5, z \cdot \frac{t}{a}, \mathsf{fma}\left(0.5, \color{blue}{\frac{y}{\frac{a}{x}}}, -1 \cdot \frac{0.05555555555555555 \cdot \frac{{y}^{2} \cdot {x}^{2}}{a \cdot z} + -0.05555555555555555 \cdot \frac{{y}^{2} \cdot {x}^{2}}{a \cdot z}}{t}\right)\right) \]
      6. associate-*r/30.6%

        \[\leadsto \mathsf{fma}\left(-4.5, z \cdot \frac{t}{a}, \mathsf{fma}\left(0.5, \frac{y}{\frac{a}{x}}, \color{blue}{\frac{-1 \cdot \left(0.05555555555555555 \cdot \frac{{y}^{2} \cdot {x}^{2}}{a \cdot z} + -0.05555555555555555 \cdot \frac{{y}^{2} \cdot {x}^{2}}{a \cdot z}\right)}{t}}\right)\right) \]
      7. distribute-rgt-out30.6%

        \[\leadsto \mathsf{fma}\left(-4.5, z \cdot \frac{t}{a}, \mathsf{fma}\left(0.5, \frac{y}{\frac{a}{x}}, \frac{-1 \cdot \color{blue}{\left(\frac{{y}^{2} \cdot {x}^{2}}{a \cdot z} \cdot \left(0.05555555555555555 + -0.05555555555555555\right)\right)}}{t}\right)\right) \]
      8. metadata-eval30.6%

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

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

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

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

    if -4.00000000000000001e277 < (-.f64 (*.f64 x y) (*.f64 (*.f64 z 9) t))

    1. Initial program 94.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 94.0% accurate, 0.1× speedup?

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

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


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

    1. Initial program 63.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{{\left(\left(x \cdot y\right) \cdot \frac{0.5}{a}\right)}^{3} - {\left(0.5 \cdot \frac{t \cdot \left(z \cdot 9\right)}{a}\right)}^{3}}{\left(\left(x \cdot y\right) \cdot \frac{0.5}{a}\right) \cdot \left(\left(x \cdot y\right) \cdot \frac{0.5}{a}\right) + \left(\left(0.5 \cdot \frac{t \cdot \left(z \cdot 9\right)}{a}\right) \cdot \left(0.5 \cdot \frac{t \cdot \left(z \cdot 9\right)}{a}\right) + \left(\left(x \cdot y\right) \cdot \frac{0.5}{a}\right) \cdot \left(0.5 \cdot \frac{t \cdot \left(z \cdot 9\right)}{a}\right)\right)}} \]
    5. Taylor expanded in z around inf 19.8%

      \[\leadsto \color{blue}{-4.5 \cdot \frac{t \cdot z}{a} + \left(-1 \cdot \frac{-0.05555555555555555 \cdot \frac{{y}^{2} \cdot {x}^{2}}{a \cdot t} + 0.05555555555555555 \cdot \frac{{y}^{2} \cdot {x}^{2}}{a \cdot t}}{z} + 0.5 \cdot \frac{y \cdot x}{a}\right)} \]
    6. Step-by-step derivation
      1. +-commutative19.8%

        \[\leadsto -4.5 \cdot \frac{t \cdot z}{a} + \color{blue}{\left(0.5 \cdot \frac{y \cdot x}{a} + -1 \cdot \frac{-0.05555555555555555 \cdot \frac{{y}^{2} \cdot {x}^{2}}{a \cdot t} + 0.05555555555555555 \cdot \frac{{y}^{2} \cdot {x}^{2}}{a \cdot t}}{z}\right)} \]
      2. associate-+r+19.8%

        \[\leadsto \color{blue}{\left(-4.5 \cdot \frac{t \cdot z}{a} + 0.5 \cdot \frac{y \cdot x}{a}\right) + -1 \cdot \frac{-0.05555555555555555 \cdot \frac{{y}^{2} \cdot {x}^{2}}{a \cdot t} + 0.05555555555555555 \cdot \frac{{y}^{2} \cdot {x}^{2}}{a \cdot t}}{z}} \]
      3. fma-def19.8%

        \[\leadsto \color{blue}{\mathsf{fma}\left(-4.5, \frac{t \cdot z}{a}, 0.5 \cdot \frac{y \cdot x}{a}\right)} + -1 \cdot \frac{-0.05555555555555555 \cdot \frac{{y}^{2} \cdot {x}^{2}}{a \cdot t} + 0.05555555555555555 \cdot \frac{{y}^{2} \cdot {x}^{2}}{a \cdot t}}{z} \]
      4. *-commutative19.8%

        \[\leadsto \mathsf{fma}\left(-4.5, \frac{\color{blue}{z \cdot t}}{a}, 0.5 \cdot \frac{y \cdot x}{a}\right) + -1 \cdot \frac{-0.05555555555555555 \cdot \frac{{y}^{2} \cdot {x}^{2}}{a \cdot t} + 0.05555555555555555 \cdot \frac{{y}^{2} \cdot {x}^{2}}{a \cdot t}}{z} \]
      5. associate-*r/30.6%

        \[\leadsto \mathsf{fma}\left(-4.5, \color{blue}{z \cdot \frac{t}{a}}, 0.5 \cdot \frac{y \cdot x}{a}\right) + -1 \cdot \frac{-0.05555555555555555 \cdot \frac{{y}^{2} \cdot {x}^{2}}{a \cdot t} + 0.05555555555555555 \cdot \frac{{y}^{2} \cdot {x}^{2}}{a \cdot t}}{z} \]
      6. associate-*r/30.6%

        \[\leadsto \mathsf{fma}\left(-4.5, z \cdot \frac{t}{a}, \color{blue}{\frac{0.5 \cdot \left(y \cdot x\right)}{a}}\right) + -1 \cdot \frac{-0.05555555555555555 \cdot \frac{{y}^{2} \cdot {x}^{2}}{a \cdot t} + 0.05555555555555555 \cdot \frac{{y}^{2} \cdot {x}^{2}}{a \cdot t}}{z} \]
      7. *-commutative30.6%

        \[\leadsto \mathsf{fma}\left(-4.5, z \cdot \frac{t}{a}, \frac{0.5 \cdot \color{blue}{\left(x \cdot y\right)}}{a}\right) + -1 \cdot \frac{-0.05555555555555555 \cdot \frac{{y}^{2} \cdot {x}^{2}}{a \cdot t} + 0.05555555555555555 \cdot \frac{{y}^{2} \cdot {x}^{2}}{a \cdot t}}{z} \]
      8. associate-*l/30.6%

        \[\leadsto \mathsf{fma}\left(-4.5, z \cdot \frac{t}{a}, \color{blue}{\frac{0.5}{a} \cdot \left(x \cdot y\right)}\right) + -1 \cdot \frac{-0.05555555555555555 \cdot \frac{{y}^{2} \cdot {x}^{2}}{a \cdot t} + 0.05555555555555555 \cdot \frac{{y}^{2} \cdot {x}^{2}}{a \cdot t}}{z} \]
      9. associate-*r*30.6%

        \[\leadsto \mathsf{fma}\left(-4.5, z \cdot \frac{t}{a}, \color{blue}{\left(\frac{0.5}{a} \cdot x\right) \cdot y}\right) + -1 \cdot \frac{-0.05555555555555555 \cdot \frac{{y}^{2} \cdot {x}^{2}}{a \cdot t} + 0.05555555555555555 \cdot \frac{{y}^{2} \cdot {x}^{2}}{a \cdot t}}{z} \]
      10. associate-*r/30.6%

        \[\leadsto \mathsf{fma}\left(-4.5, z \cdot \frac{t}{a}, \left(\frac{0.5}{a} \cdot x\right) \cdot y\right) + \color{blue}{\frac{-1 \cdot \left(-0.05555555555555555 \cdot \frac{{y}^{2} \cdot {x}^{2}}{a \cdot t} + 0.05555555555555555 \cdot \frac{{y}^{2} \cdot {x}^{2}}{a \cdot t}\right)}{z}} \]
    7. Simplified92.1%

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

    if -4.00000000000000001e277 < (-.f64 (*.f64 x y) (*.f64 (*.f64 z 9) t))

    1. Initial program 94.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 69.1% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{+59} \lor \neg \left(x \cdot y \leq 10^{+130}\right):\\
\;\;\;\;\left(x \cdot y\right) \cdot \frac{0.5}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 x y) < -1.99999999999999991e-44

    1. Initial program 90.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.99999999999999991e-44 < (*.f64 x y) < 2.0000000000000001e-133

    1. Initial program 90.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.0000000000000001e-133 < (*.f64 x y) < 4.9999999999999997e59 or 1.0000000000000001e130 < (*.f64 x y)

    1. Initial program 94.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.9999999999999997e59 < (*.f64 x y) < 1.0000000000000001e130

    1. Initial program 88.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 70.8% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{+59}:\\
\;\;\;\;\left(x \cdot y\right) \cdot \frac{0.5}{a}\\

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

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


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

    1. Initial program 90.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.99999999999999991e-44 < (*.f64 x y) < 2.0000000000000001e-133

    1. Initial program 90.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.0000000000000001e-133 < (*.f64 x y) < 4.9999999999999997e59

    1. Initial program 96.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.9999999999999997e59 < (*.f64 x y) < 1.0000000000000001e130

    1. Initial program 88.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.0000000000000001e130 < (*.f64 x y)

    1. Initial program 92.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto {\color{blue}{\left(\sqrt[3]{\mathsf{fma}\left(z, t \cdot -9, x \cdot y\right)} \cdot \sqrt[3]{\frac{0.5}{a}}\right)}}^{3} \]
    7. Applied egg-rr93.3%

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

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

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

      \[\leadsto \color{blue}{0.5 \cdot \left({1}^{0.3333333333333333} \cdot \frac{y \cdot x}{a}\right)} \]
    11. Step-by-step derivation
      1. pow-base-182.7%

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

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

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

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

        \[\leadsto \frac{\color{blue}{\left(0.5 \cdot y\right) \cdot x}}{a} \]
      6. /-rgt-identity82.7%

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

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

        \[\leadsto \color{blue}{\frac{x}{a} \cdot \left(0.5 \cdot \frac{y}{1}\right)} \]
      9. /-rgt-identity84.5%

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

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

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

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

Alternative 6: 70.7% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{+59}:\\
\;\;\;\;\left(x \cdot y\right) \cdot \frac{0.5}{a}\\

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

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


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

    1. Initial program 90.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.99999999999999991e-44 < (*.f64 x y) < 2.0000000000000001e-133

    1. Initial program 90.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.0000000000000001e-133 < (*.f64 x y) < 4.9999999999999997e59

    1. Initial program 96.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.9999999999999997e59 < (*.f64 x y) < 1.0000000000000001e130

    1. Initial program 88.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.0000000000000001e130 < (*.f64 x y)

    1. Initial program 92.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto {\color{blue}{\left(\sqrt[3]{\mathsf{fma}\left(z, t \cdot -9, x \cdot y\right)} \cdot \sqrt[3]{\frac{0.5}{a}}\right)}}^{3} \]
    7. Applied egg-rr93.3%

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

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

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

      \[\leadsto \color{blue}{0.5 \cdot \left({1}^{0.3333333333333333} \cdot \frac{y \cdot x}{a}\right)} \]
    11. Step-by-step derivation
      1. pow-base-182.7%

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

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

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

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

        \[\leadsto \frac{\color{blue}{\left(0.5 \cdot y\right) \cdot x}}{a} \]
      6. /-rgt-identity82.7%

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

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

        \[\leadsto \color{blue}{\frac{x}{a} \cdot \left(0.5 \cdot \frac{y}{1}\right)} \]
      9. /-rgt-identity84.5%

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

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

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

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

Alternative 7: 70.7% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{+59}:\\
\;\;\;\;\frac{\left(x \cdot y\right) \cdot 0.5}{a}\\

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

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


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

    1. Initial program 90.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.99999999999999991e-44 < (*.f64 x y) < 2.0000000000000001e-133

    1. Initial program 90.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.0000000000000001e-133 < (*.f64 x y) < 4.9999999999999997e59

    1. Initial program 96.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.9999999999999997e59 < (*.f64 x y) < 1.0000000000000001e130

    1. Initial program 88.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.0000000000000001e130 < (*.f64 x y)

    1. Initial program 92.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto {\color{blue}{\left(\sqrt[3]{\mathsf{fma}\left(z, t \cdot -9, x \cdot y\right)} \cdot \sqrt[3]{\frac{0.5}{a}}\right)}}^{3} \]
    7. Applied egg-rr93.3%

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

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

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

      \[\leadsto \color{blue}{0.5 \cdot \left({1}^{0.3333333333333333} \cdot \frac{y \cdot x}{a}\right)} \]
    11. Step-by-step derivation
      1. pow-base-182.7%

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

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

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

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

        \[\leadsto \frac{\color{blue}{\left(0.5 \cdot y\right) \cdot x}}{a} \]
      6. /-rgt-identity82.7%

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

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

        \[\leadsto \color{blue}{\frac{x}{a} \cdot \left(0.5 \cdot \frac{y}{1}\right)} \]
      9. /-rgt-identity84.5%

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

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

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

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

Alternative 8: 92.9% accurate, 0.8× speedup?

\[\begin{array}{l} [z, t] = \mathsf{sort}([z, t])\\ \\ \begin{array}{l} \mathbf{if}\;x \cdot y \leq -\infty:\\ \;\;\;\;\frac{y \cdot 0.5}{\frac{a}{x}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot y - z \cdot \left(9 \cdot t\right)}{a \cdot 2}\\ \end{array} \end{array} \]
NOTE: z and t should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
 :precision binary64
 (if (<= (* x y) (- INFINITY))
   (/ (* y 0.5) (/ a x))
   (/ (- (* x y) (* z (* 9.0 t))) (* a 2.0))))
assert(z < t);
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if ((x * y) <= -((double) INFINITY)) {
		tmp = (y * 0.5) / (a / x);
	} else {
		tmp = ((x * y) - (z * (9.0 * t))) / (a * 2.0);
	}
	return tmp;
}
assert z < t;
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if ((x * y) <= -Double.POSITIVE_INFINITY) {
		tmp = (y * 0.5) / (a / x);
	} else {
		tmp = ((x * y) - (z * (9.0 * t))) / (a * 2.0);
	}
	return tmp;
}
[z, t] = sort([z, t])
def code(x, y, z, t, a):
	tmp = 0
	if (x * y) <= -math.inf:
		tmp = (y * 0.5) / (a / x)
	else:
		tmp = ((x * y) - (z * (9.0 * t))) / (a * 2.0)
	return tmp
z, t = sort([z, t])
function code(x, y, z, t, a)
	tmp = 0.0
	if (Float64(x * y) <= Float64(-Inf))
		tmp = Float64(Float64(y * 0.5) / Float64(a / x));
	else
		tmp = Float64(Float64(Float64(x * y) - Float64(z * Float64(9.0 * t))) / Float64(a * 2.0));
	end
	return tmp
end
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if ((x * y) <= -Inf)
		tmp = (y * 0.5) / (a / x);
	else
		tmp = ((x * y) - (z * (9.0 * t))) / (a * 2.0);
	end
	tmp_2 = tmp;
end
NOTE: z and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_] := If[LessEqual[N[(x * y), $MachinePrecision], (-Infinity)], N[(N[(y * 0.5), $MachinePrecision] / N[(a / x), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * y), $MachinePrecision] - N[(z * N[(9.0 * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -\infty:\\
\;\;\;\;\frac{y \cdot 0.5}{\frac{a}{x}}\\

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


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

    1. Initial program 48.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto {\left(\sqrt[3]{\mathsf{fma}\left(z, t \cdot -9, x \cdot y\right) \cdot \frac{1}{\color{blue}{\frac{a}{0.5}}}}\right)}^{3} \]
      6. clear-num48.8%

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

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

        \[\leadsto {\color{blue}{\left(\sqrt[3]{\mathsf{fma}\left(z, t \cdot -9, x \cdot y\right)} \cdot \sqrt[3]{\frac{0.5}{a}}\right)}}^{3} \]
    7. Applied egg-rr48.8%

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

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

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

      \[\leadsto \color{blue}{0.5 \cdot \left({1}^{0.3333333333333333} \cdot \frac{y \cdot x}{a}\right)} \]
    11. Step-by-step derivation
      1. pow-base-148.8%

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

        \[\leadsto \color{blue}{\left(0.5 \cdot 1\right) \cdot \frac{y \cdot x}{a}} \]
      3. metadata-eval48.8%

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

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

        \[\leadsto \frac{\color{blue}{\left(0.5 \cdot y\right) \cdot x}}{a} \]
      6. /-rgt-identity48.8%

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

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

        \[\leadsto \color{blue}{\frac{x}{a} \cdot \left(0.5 \cdot \frac{y}{1}\right)} \]
      9. /-rgt-identity84.8%

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

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

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

        \[\leadsto \color{blue}{\left(y \cdot 0.5\right) \cdot \frac{x}{a}} \]
      2. clear-num84.9%

        \[\leadsto \left(y \cdot 0.5\right) \cdot \color{blue}{\frac{1}{\frac{a}{x}}} \]
      3. un-div-inv84.9%

        \[\leadsto \color{blue}{\frac{y \cdot 0.5}{\frac{a}{x}}} \]
    14. Applied egg-rr84.9%

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

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

    1. Initial program 93.8%

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

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

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

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

Alternative 9: 68.0% accurate, 1.2× speedup?

\[\begin{array}{l} [z, t] = \mathsf{sort}([z, t])\\ \\ \begin{array}{l} \mathbf{if}\;z \leq -150000000 \lor \neg \left(z \leq 1.75 \cdot 10^{-131}\right):\\ \;\;\;\;-4.5 \cdot \frac{t}{\frac{a}{z}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(y \cdot \frac{0.5}{a}\right)\\ \end{array} \end{array} \]
NOTE: z and t should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
 :precision binary64
 (if (or (<= z -150000000.0) (not (<= z 1.75e-131)))
   (* -4.5 (/ t (/ a z)))
   (* x (* y (/ 0.5 a)))))
assert(z < t);
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if ((z <= -150000000.0) || !(z <= 1.75e-131)) {
		tmp = -4.5 * (t / (a / z));
	} else {
		tmp = x * (y * (0.5 / a));
	}
	return tmp;
}
NOTE: z and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: tmp
    if ((z <= (-150000000.0d0)) .or. (.not. (z <= 1.75d-131))) then
        tmp = (-4.5d0) * (t / (a / z))
    else
        tmp = x * (y * (0.5d0 / a))
    end if
    code = tmp
end function
assert z < t;
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if ((z <= -150000000.0) || !(z <= 1.75e-131)) {
		tmp = -4.5 * (t / (a / z));
	} else {
		tmp = x * (y * (0.5 / a));
	}
	return tmp;
}
[z, t] = sort([z, t])
def code(x, y, z, t, a):
	tmp = 0
	if (z <= -150000000.0) or not (z <= 1.75e-131):
		tmp = -4.5 * (t / (a / z))
	else:
		tmp = x * (y * (0.5 / a))
	return tmp
z, t = sort([z, t])
function code(x, y, z, t, a)
	tmp = 0.0
	if ((z <= -150000000.0) || !(z <= 1.75e-131))
		tmp = Float64(-4.5 * Float64(t / Float64(a / z)));
	else
		tmp = Float64(x * Float64(y * Float64(0.5 / a)));
	end
	return tmp
end
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if ((z <= -150000000.0) || ~((z <= 1.75e-131)))
		tmp = -4.5 * (t / (a / z));
	else
		tmp = x * (y * (0.5 / a));
	end
	tmp_2 = tmp;
end
NOTE: z and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -150000000.0], N[Not[LessEqual[z, 1.75e-131]], $MachinePrecision]], N[(-4.5 * N[(t / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(y * N[(0.5 / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -150000000 \lor \neg \left(z \leq 1.75 \cdot 10^{-131}\right):\\
\;\;\;\;-4.5 \cdot \frac{t}{\frac{a}{z}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.5e8 or 1.7500000000000001e-131 < z

    1. Initial program 89.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.5e8 < z < 1.7500000000000001e-131

    1. Initial program 95.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -150000000 \lor \neg \left(z \leq 1.75 \cdot 10^{-131}\right):\\ \;\;\;\;-4.5 \cdot \frac{t}{\frac{a}{z}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(y \cdot \frac{0.5}{a}\right)\\ \end{array} \]

Alternative 10: 51.0% accurate, 1.9× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 50.9% accurate, 1.9× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Developer target: 93.2% accurate, 0.7× speedup?

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

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

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

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


\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2023240 
(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)))