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

Percentage Accurate: 91.4% → 96.7%
Time: 10.5s
Alternatives: 10
Speedup: 0.6×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 10 alternatives:

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

Initial Program: 91.4% accurate, 1.0× speedup?

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

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

Alternative 1: 96.7% accurate, 0.1× speedup?

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

\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+264}:\\
\;\;\;\;\frac{t\_1}{a \cdot 2}\\

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


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

    1. Initial program 56.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x, y, z \cdot \left(t \cdot -9\right)\right)}{a \cdot 2}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. *-un-lft-identity56.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -inf.0 < (-.f64 (*.f64 x y) (*.f64 (*.f64 z #s(literal 9 binary64)) t)) < 2.00000000000000009e264

    1. Initial program 98.6%

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

    if 2.00000000000000009e264 < (-.f64 (*.f64 x y) (*.f64 (*.f64 z #s(literal 9 binary64)) t))

    1. Initial program 66.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 47.5% accurate, 0.0× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 a #s(literal 2 binary64)) < 4.9999999999999996e-41

    1. Initial program 91.5%

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

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

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

        \[\leadsto \color{blue}{\frac{y \cdot x - \left(z \cdot 9\right) \cdot t}{a \cdot 2}} \]
      4. cancel-sign-sub-inv91.5%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x, y, z \cdot \left(t \cdot -9\right)\right)}{a \cdot 2}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. *-un-lft-identity92.1%

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

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

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

      \[\leadsto \color{blue}{\frac{1}{\sqrt{a \cdot 2}} \cdot \frac{\mathsf{fma}\left(x, y, z \cdot \left(t \cdot -9\right)\right)}{\sqrt{a \cdot 2}}} \]
    7. Step-by-step derivation
      1. associate-*l/28.8%

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

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

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

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

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

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

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

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

    if 4.9999999999999996e-41 < (*.f64 a #s(literal 2 binary64))

    1. Initial program 82.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x, y, z \cdot \left(t \cdot -9\right)\right)}{a \cdot 2}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. *-un-lft-identity82.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \cdot 2 \leq 5 \cdot 10^{-41}:\\ \;\;\;\;\frac{\frac{\mathsf{fma}\left(z, t \cdot -9, x \cdot y\right)}{\sqrt{a \cdot 2}}}{\sqrt{a \cdot 2}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{y}{a \cdot 2} - z \cdot \left(\frac{t}{a} \cdot 4.5\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 93.2% accurate, 0.1× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 a #s(literal 2 binary64)) < 1

    1. Initial program 91.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1 < (*.f64 a #s(literal 2 binary64))

    1. Initial program 80.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x, y, z \cdot \left(t \cdot -9\right)\right)}{a \cdot 2}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. *-un-lft-identity80.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 94.9% accurate, 0.5× speedup?

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

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

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


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

    1. Initial program 53.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{0.5}{\frac{a}{y \cdot x}}} \]
      5. metadata-eval57.1%

        \[\leadsto \frac{\color{blue}{\frac{1}{2}}}{\frac{a}{y \cdot x}} \]
      6. associate-/r*57.1%

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

        \[\leadsto \frac{1}{\color{blue}{\frac{a}{y \cdot x} \cdot 2}} \]
      8. associate-/r*57.1%

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{y \cdot 1}{a}} \cdot x}{2} \]
      15. associate-*l/86.4%

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

        \[\leadsto \frac{\color{blue}{\frac{y}{a}} \cdot x}{2} \]
      17. associate-*l/57.1%

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

        \[\leadsto \frac{\color{blue}{y \cdot \frac{x}{a}}}{2} \]
      19. associate-*l/86.3%

        \[\leadsto \color{blue}{\frac{y}{2} \cdot \frac{x}{a}} \]
      20. *-commutative86.3%

        \[\leadsto \color{blue}{\frac{x}{a} \cdot \frac{y}{2}} \]
    10. Simplified86.3%

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

    if -1.0000000000000001e209 < (*.f64 x y) < 2.00000000000000011e301

    1. Initial program 96.5%

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

    if 2.00000000000000011e301 < (*.f64 x y)

    1. Initial program 55.5%

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

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

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

        \[\leadsto \color{blue}{\frac{y \cdot x - \left(z \cdot 9\right) \cdot t}{a \cdot 2}} \]
      4. cancel-sign-sub-inv55.5%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x, y, z \cdot \left(t \cdot -9\right)\right)}{a \cdot 2}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. *-un-lft-identity55.5%

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

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

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

      \[\leadsto \color{blue}{\frac{1}{\sqrt{a \cdot 2}} \cdot \frac{\mathsf{fma}\left(x, y, z \cdot \left(t \cdot -9\right)\right)}{\sqrt{a \cdot 2}}} \]
    7. Step-by-step derivation
      1. associate-*l/25.7%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{x \cdot \frac{y}{a \cdot {\left(\sqrt{2}\right)}^{2}}} \]
      2. *-rgt-identity97.6%

        \[\leadsto x \cdot \frac{\color{blue}{y \cdot 1}}{a \cdot {\left(\sqrt{2}\right)}^{2}} \]
      3. *-commutative97.6%

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

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

        \[\leadsto x \cdot \frac{y \cdot 1}{\color{blue}{2} \cdot a} \]
      6. associate-*r/98.2%

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

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

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

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

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

Alternative 5: 93.0% accurate, 0.6× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 a #s(literal 2 binary64)) < 1

    1. Initial program 91.9%

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

    if 1 < (*.f64 a #s(literal 2 binary64))

    1. Initial program 80.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x, y, z \cdot \left(t \cdot -9\right)\right)}{a \cdot 2}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. *-un-lft-identity80.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 72.3% accurate, 0.6× speedup?

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

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


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

    1. Initial program 82.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{1}{2}}}{\frac{a}{y \cdot x}} \]
      6. associate-/r*65.2%

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

        \[\leadsto \frac{1}{\color{blue}{\frac{a}{y \cdot x} \cdot 2}} \]
      8. associate-/r*65.2%

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{y \cdot 1}{a}} \cdot x}{2} \]
      15. associate-*l/72.9%

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

        \[\leadsto \frac{\color{blue}{\frac{y}{a}} \cdot x}{2} \]
      17. associate-*l/65.3%

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

        \[\leadsto \frac{\color{blue}{y \cdot \frac{x}{a}}}{2} \]
      19. associate-*l/72.8%

        \[\leadsto \color{blue}{\frac{y}{2} \cdot \frac{x}{a}} \]
      20. *-commutative72.8%

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

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

    if -1e47 < (*.f64 x y) < 4.99999999999999963e-77

    1. Initial program 95.5%

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

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

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

        \[\leadsto \color{blue}{\frac{y \cdot x - \left(z \cdot 9\right) \cdot t}{a \cdot 2}} \]
      4. cancel-sign-sub-inv95.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-4.5 \cdot z}{a} \cdot t} \]
      4. clear-num78.1%

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

        \[\leadsto \color{blue}{\frac{1 \cdot t}{\frac{a}{-4.5 \cdot z}}} \]
      6. *-un-lft-identity79.2%

        \[\leadsto \frac{\color{blue}{t}}{\frac{a}{-4.5 \cdot z}} \]
      7. *-un-lft-identity79.2%

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

        \[\leadsto \frac{t}{\color{blue}{\frac{1}{-4.5} \cdot \frac{a}{z}}} \]
      9. metadata-eval79.2%

        \[\leadsto \frac{t}{\color{blue}{-0.2222222222222222} \cdot \frac{a}{z}} \]
    11. Applied egg-rr79.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -1 \cdot 10^{+47} \lor \neg \left(x \cdot y \leq 5 \cdot 10^{-77}\right):\\ \;\;\;\;\frac{x}{a} \cdot \frac{y}{2}\\ \mathbf{else}:\\ \;\;\;\;\frac{t}{-0.2222222222222222 \cdot \frac{a}{z}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 66.4% accurate, 0.8× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -9e9 or 41000 < t

    1. Initial program 86.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -9e9 < t < 41000

    1. Initial program 90.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{1}{2}}}{\frac{a}{y \cdot x}} \]
      6. associate-/r*67.8%

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

        \[\leadsto \frac{1}{\color{blue}{\frac{a}{y \cdot x} \cdot 2}} \]
      8. associate-/r*67.8%

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{y \cdot 1}{a}} \cdot x}{2} \]
      15. associate-*l/68.5%

        \[\leadsto \frac{\color{blue}{\left(\frac{y}{a} \cdot 1\right)} \cdot x}{2} \]
      16. *-rgt-identity68.5%

        \[\leadsto \frac{\color{blue}{\frac{y}{a}} \cdot x}{2} \]
      17. associate-*l/67.9%

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

        \[\leadsto \frac{\color{blue}{y \cdot \frac{x}{a}}}{2} \]
      19. associate-*l/71.2%

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

        \[\leadsto \color{blue}{\frac{x}{a} \cdot \frac{y}{2}} \]
    10. Simplified71.2%

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

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

Alternative 8: 66.9% accurate, 0.8× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -0.73999999999999999 or 13500 < t

    1. Initial program 86.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -0.73999999999999999 < t < 13500

    1. Initial program 89.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 66.7% accurate, 0.8× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -9e8 or 38000 < t

    1. Initial program 86.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -9e8 < t < 38000

    1. Initial program 90.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 50.8% accurate, 1.9× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Developer Target 1: 93.4% accurate, 0.5× speedup?

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

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

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

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


\end{array}
\end{array}

Reproduce

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

  :alt
  (! :herbie-platform default (if (< a -209046455797670900000000000000000000000000000000000000000000000000000000000000000000000) (- (* 1/2 (/ (* y x) a)) (* 9/2 (/ t (/ a z)))) (if (< a 2144030707833976000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (/ (- (* x y) (* z (* 9 t))) (* a 2)) (- (* (/ y a) (* x 1/2)) (* (/ t a) (* z 9/2))))))

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