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

Percentage Accurate: 90.9% → 92.9%
Time: 9.3s
Alternatives: 8
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 8 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: 92.9% accurate, 0.8× speedup?

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

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


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

    1. Initial program 69.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.00000000000000013e294 < (*.f64 x y)

    1. Initial program 96.1%

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

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

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

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

Alternative 2: 91.3% accurate, 0.1× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \frac{\mathsf{fma}\left(z, t \cdot -9, x \cdot y\right)}{a \cdot 2} \end{array} \]
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
 :precision binary64
 (/ (fma z (* t -9.0) (* x y)) (* a 2.0)))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
	return fma(z, (t * -9.0), (x * y)) / (a * 2.0);
}
x, y = sort([x, y])
function code(x, y, z, t, a)
	return Float64(fma(z, Float64(t * -9.0), Float64(x * y)) / Float64(a * 2.0))
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_] := N[(N[(z * N[(t * -9.0), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{\mathsf{fma}\left(z, t \cdot -9, x \cdot y\right)}{a \cdot 2}
\end{array}
Derivation
  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. sub-neg93.8%

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

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

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

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

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

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

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

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

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

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

Alternative 3: 71.1% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{-43}:\\
\;\;\;\;0.5 \cdot \frac{x \cdot y}{a}\\

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

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


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

    1. Initial program 91.1%

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-\left(\left(z \cdot 9\right) \cdot t - x \cdot y\right)}}{a \cdot 2} \]
      6. neg-mul-191.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*91.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.99999999999999989e-114 < (*.f64 x y) < 1.00000000000000007e-152

    1. Initial program 97.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.00000000000000007e-152 < (*.f64 x y) < 5.00000000000000019e-43

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(x \cdot y - \left(z \cdot 9\right) \cdot t\right) \cdot \left(-\frac{-1}{a \cdot 2}\right)} \]
    3. Simplified99.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 79.0%

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

    if 5.00000000000000019e-43 < (*.f64 x y) < 5e3

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{-4.5 \cdot \left(t \cdot z\right)}{a}} \]
    9. Step-by-step derivation
      1. expm1-log1p-u23.1%

        \[\leadsto \frac{\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(-4.5 \cdot \left(t \cdot z\right)\right)\right)}}{a} \]
      2. expm1-udef22.6%

        \[\leadsto \frac{\color{blue}{e^{\mathsf{log1p}\left(-4.5 \cdot \left(t \cdot z\right)\right)} - 1}}{a} \]
      3. *-commutative22.6%

        \[\leadsto \frac{e^{\mathsf{log1p}\left(-4.5 \cdot \color{blue}{\left(z \cdot t\right)}\right)} - 1}{a} \]
    10. Applied egg-rr22.6%

      \[\leadsto \frac{\color{blue}{e^{\mathsf{log1p}\left(-4.5 \cdot \left(z \cdot t\right)\right)} - 1}}{a} \]
    11. Step-by-step derivation
      1. expm1-def23.1%

        \[\leadsto \frac{\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(-4.5 \cdot \left(z \cdot t\right)\right)\right)}}{a} \]
      2. expm1-log1p70.9%

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

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

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

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

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

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

    if 5e3 < (*.f64 x y)

    1. Initial program 90.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -5 \cdot 10^{-114}:\\ \;\;\;\;y \cdot \frac{x \cdot 0.5}{a}\\ \mathbf{elif}\;x \cdot y \leq 10^{-152}:\\ \;\;\;\;-4.5 \cdot \frac{z \cdot t}{a}\\ \mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{-43}:\\ \;\;\;\;0.5 \cdot \frac{x \cdot y}{a}\\ \mathbf{elif}\;x \cdot y \leq 5000:\\ \;\;\;\;\frac{t \cdot \left(z \cdot -4.5\right)}{a}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(0.5 \cdot \frac{y}{a}\right)\\ \end{array} \]

Alternative 4: 65.1% accurate, 0.7× speedup?

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

\mathbf{elif}\;y \leq 1.8 \cdot 10^{-134}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq 5.2 \cdot 10^{-120}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;y \leq 0.0105:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq 9.8 \cdot 10^{+73} \lor \neg \left(y \leq 1.35 \cdot 10^{+102}\right):\\
\;\;\;\;t_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -6.7999999999999997e-153 or 1.79999999999999995e-134 < y < 5.2000000000000002e-120 or 0.0105000000000000007 < y < 9.7999999999999998e73 or 1.3500000000000001e102 < y

    1. Initial program 92.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -6.7999999999999997e-153 < y < 1.79999999999999995e-134 or 5.2000000000000002e-120 < y < 0.0105000000000000007

    1. Initial program 97.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(x \cdot y - \left(z \cdot 9\right) \cdot t\right) \cdot \left(-\frac{-1}{a \cdot 2}\right)} \]
    3. Simplified97.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 0 73.1%

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

    if 9.7999999999999998e73 < y < 1.3500000000000001e102

    1. Initial program 80.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(x \cdot y - \left(z \cdot 9\right) \cdot t\right) \cdot \left(-\frac{-1}{a \cdot 2}\right)} \]
    3. Simplified81.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 0 61.4%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -6.8 \cdot 10^{-153}:\\ \;\;\;\;0.5 \cdot \frac{x \cdot y}{a}\\ \mathbf{elif}\;y \leq 1.8 \cdot 10^{-134}:\\ \;\;\;\;-4.5 \cdot \frac{z \cdot t}{a}\\ \mathbf{elif}\;y \leq 5.2 \cdot 10^{-120}:\\ \;\;\;\;0.5 \cdot \frac{x \cdot y}{a}\\ \mathbf{elif}\;y \leq 0.0105:\\ \;\;\;\;-4.5 \cdot \frac{z \cdot t}{a}\\ \mathbf{elif}\;y \leq 9.8 \cdot 10^{+73} \lor \neg \left(y \leq 1.35 \cdot 10^{+102}\right):\\ \;\;\;\;0.5 \cdot \frac{x \cdot y}{a}\\ \mathbf{else}:\\ \;\;\;\;-4.5 \cdot \left(z \cdot \frac{t}{a}\right)\\ \end{array} \]

Alternative 5: 66.1% accurate, 0.7× speedup?

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

\mathbf{elif}\;y \leq 1.8 \cdot 10^{-134}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq 5.2 \cdot 10^{-120}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;y \leq 0.0006:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq 9.8 \cdot 10^{+73}:\\
\;\;\;\;t_2\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -6.99999999999999961e-153 or 1.79999999999999995e-134 < y < 5.2000000000000002e-120 or 5.99999999999999947e-4 < y < 9.7999999999999998e73

    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. sub-neg93.8%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(\left(z \cdot 9\right) \cdot t - x \cdot y\right) \cdot \frac{-1}{a \cdot 2}} \]
      10. sub-neg93.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. +-commutative93.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-sub093.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-93.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-neg93.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-out93.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-in93.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. Simplified93.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -6.99999999999999961e-153 < y < 1.79999999999999995e-134 or 5.2000000000000002e-120 < y < 5.99999999999999947e-4

    1. Initial program 97.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(x \cdot y - \left(z \cdot 9\right) \cdot t\right) \cdot \left(-\frac{-1}{a \cdot 2}\right)} \]
    3. Simplified97.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 0 72.7%

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

    if 9.7999999999999998e73 < y < 4.5000000000000002e101

    1. Initial program 80.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(x \cdot y - \left(z \cdot 9\right) \cdot t\right) \cdot \left(-\frac{-1}{a \cdot 2}\right)} \]
    3. Simplified81.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 0 61.4%

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

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

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

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

    if 4.5000000000000002e101 < y

    1. Initial program 89.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -7 \cdot 10^{-153}:\\ \;\;\;\;x \cdot \left(0.5 \cdot \frac{y}{a}\right)\\ \mathbf{elif}\;y \leq 1.8 \cdot 10^{-134}:\\ \;\;\;\;-4.5 \cdot \frac{z \cdot t}{a}\\ \mathbf{elif}\;y \leq 5.2 \cdot 10^{-120}:\\ \;\;\;\;x \cdot \left(0.5 \cdot \frac{y}{a}\right)\\ \mathbf{elif}\;y \leq 0.0006:\\ \;\;\;\;-4.5 \cdot \frac{z \cdot t}{a}\\ \mathbf{elif}\;y \leq 9.8 \cdot 10^{+73}:\\ \;\;\;\;x \cdot \left(0.5 \cdot \frac{y}{a}\right)\\ \mathbf{elif}\;y \leq 4.5 \cdot 10^{+101}:\\ \;\;\;\;-4.5 \cdot \left(z \cdot \frac{t}{a}\right)\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \frac{x \cdot y}{a}\\ \end{array} \]

Alternative 6: 65.9% accurate, 0.7× speedup?

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

\mathbf{elif}\;y \leq 10^{-134}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq 3.8 \cdot 10^{-120}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;y \leq 6.2 \cdot 10^{-12}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq 1.02 \cdot 10^{+74}:\\
\;\;\;\;y \cdot \frac{x \cdot 0.5}{a}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if y < -6.99999999999999961e-153 or 1.00000000000000004e-134 < y < 3.7999999999999997e-120

    1. Initial program 93.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -6.99999999999999961e-153 < y < 1.00000000000000004e-134 or 3.7999999999999997e-120 < y < 6.2000000000000002e-12

    1. Initial program 97.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(x \cdot y - \left(z \cdot 9\right) \cdot t\right) \cdot \left(-\frac{-1}{a \cdot 2}\right)} \]
    3. Simplified97.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 0 72.7%

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

    if 6.2000000000000002e-12 < y < 1.02000000000000005e74

    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. sub-neg95.6%

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

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

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

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

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

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

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

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

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

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

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

        \[\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-95.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.02000000000000005e74 < y < 4.5000000000000002e101

    1. Initial program 80.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(x \cdot y - \left(z \cdot 9\right) \cdot t\right) \cdot \left(-\frac{-1}{a \cdot 2}\right)} \]
    3. Simplified81.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 0 61.4%

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

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

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

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

    if 4.5000000000000002e101 < y

    1. Initial program 89.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -7 \cdot 10^{-153}:\\ \;\;\;\;x \cdot \left(0.5 \cdot \frac{y}{a}\right)\\ \mathbf{elif}\;y \leq 10^{-134}:\\ \;\;\;\;-4.5 \cdot \frac{z \cdot t}{a}\\ \mathbf{elif}\;y \leq 3.8 \cdot 10^{-120}:\\ \;\;\;\;x \cdot \left(0.5 \cdot \frac{y}{a}\right)\\ \mathbf{elif}\;y \leq 6.2 \cdot 10^{-12}:\\ \;\;\;\;-4.5 \cdot \frac{z \cdot t}{a}\\ \mathbf{elif}\;y \leq 1.02 \cdot 10^{+74}:\\ \;\;\;\;y \cdot \frac{x \cdot 0.5}{a}\\ \mathbf{elif}\;y \leq 4.5 \cdot 10^{+101}:\\ \;\;\;\;-4.5 \cdot \left(z \cdot \frac{t}{a}\right)\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \frac{x \cdot y}{a}\\ \end{array} \]

Alternative 7: 51.7% accurate, 1.4× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 950

    1. Initial program 95.1%

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-\left(\left(z \cdot 9\right) \cdot t - x \cdot y\right)}}{a \cdot 2} \]
      6. neg-mul-195.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*95.0%

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

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

        \[\leadsto \color{blue}{\left(\left(z \cdot 9\right) \cdot t - x \cdot y\right) \cdot \frac{-1}{a \cdot 2}} \]
      10. sub-neg94.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. +-commutative94.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-sub094.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-94.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-neg94.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-out94.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-in94.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.0%

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

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

    if 950 < y

    1. Initial program 90.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 950:\\ \;\;\;\;-4.5 \cdot \frac{z \cdot t}{a}\\ \mathbf{else}:\\ \;\;\;\;-4.5 \cdot \left(z \cdot \frac{t}{a}\right)\\ \end{array} \]

Alternative 8: 51.8% accurate, 1.9× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(x \cdot y - \left(z \cdot 9\right) \cdot t\right) \cdot \left(-\frac{-1}{a \cdot 2}\right)} \]
  3. Simplified93.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 0 49.1%

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

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

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

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

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

Developer target: 93.4% accurate, 0.7× speedup?

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

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

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

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


\end{array}
\end{array}

Reproduce

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