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

Percentage Accurate: 91.1% → 93.3%
Time: 11.4s
Alternatives: 11
Speedup: 0.7×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 11 alternatives:

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

Initial Program: 91.1% 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: 93.3% accurate, 0.1× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 a 2) < -9.99999999999999929e-40

    1. Initial program 76.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{z}{a} \cdot \color{blue}{\left(-4.5 \cdot t\right)} + 0.5 \cdot \left(\frac{x}{a} \cdot y\right) \]
      8. associate-*r*97.0%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y}{a} \cdot \left(x \cdot 0.5\right) + \frac{z}{a} \cdot \left(-4.5 \cdot t\right)} \]
      2. *-un-lft-identity95.2%

        \[\leadsto \frac{\color{blue}{1 \cdot y}}{a} \cdot \left(x \cdot 0.5\right) + \frac{z}{a} \cdot \left(-4.5 \cdot t\right) \]
      3. associate-*l/95.2%

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

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

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

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

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

    if -9.99999999999999929e-40 < (*.f64 a 2)

    1. Initial program 95.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 93.4% accurate, 0.1× speedup?

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

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


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

    1. Initial program 74.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{z}{a} \cdot \left(t \cdot -4.5\right)} + 0.5 \cdot \left(\frac{x}{a} \cdot y\right) \]
      7. *-commutative97.0%

        \[\leadsto \frac{z}{a} \cdot \color{blue}{\left(-4.5 \cdot t\right)} + 0.5 \cdot \left(\frac{x}{a} \cdot y\right) \]
      8. associate-*r*96.9%

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

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

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

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

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

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

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

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

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

    if -1e8 < (*.f64 a 2)

    1. Initial program 95.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 94.3% accurate, 0.6× speedup?

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

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

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


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

    1. Initial program 54.9%

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

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

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

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

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

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

    if -1.99999999999999992e275 < (*.f64 x y) < 9.9999999999999996e210

    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. associate-*l*95.4%

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

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

    if 9.9999999999999996e210 < (*.f64 x y)

    1. Initial program 70.4%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{1}{\frac{\frac{a}{y}}{0.5 \cdot x}}} \]
    8. Applied egg-rr99.4%

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

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

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

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

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

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

Alternative 4: 94.3% accurate, 0.6× speedup?

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

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

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


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

    1. Initial program 54.9%

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

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

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

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

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

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

    if -1.99999999999999992e275 < (*.f64 x y) < 9.9999999999999996e210

    1. Initial program 95.5%

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

    if 9.9999999999999996e210 < (*.f64 x y)

    1. Initial program 70.4%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{1}{\frac{\frac{a}{y}}{0.5 \cdot x}}} \]
    8. Applied egg-rr99.4%

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

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

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

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

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

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

Alternative 5: 66.8% accurate, 0.7× speedup?

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

\mathbf{elif}\;x \leq -9.4 \cdot 10^{+147}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;x \leq -9.8 \cdot 10^{+87}:\\
\;\;\;\;t_2\\

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

\mathbf{elif}\;x \leq -5.2 \cdot 10^{-55} \lor \neg \left(x \leq 2.7 \cdot 10^{-118}\right):\\
\;\;\;\;t_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -3e156 or -9.4000000000000006e147 < x < -9.79999999999999943e87 or -1.69999999999999992e-40 < x < -5.1999999999999998e-55 or 2.69999999999999994e-118 < x

    1. Initial program 87.4%

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

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

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

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

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

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

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

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

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

    if -3e156 < x < -9.4000000000000006e147 or -5.1999999999999998e-55 < x < 2.69999999999999994e-118

    1. Initial program 94.7%

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

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

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

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

    if -9.79999999999999943e87 < x < -1.69999999999999992e-40

    1. Initial program 77.8%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -3 \cdot 10^{+156}:\\ \;\;\;\;0.5 \cdot \left(\frac{y}{a} \cdot x\right)\\ \mathbf{elif}\;x \leq -9.4 \cdot 10^{+147}:\\ \;\;\;\;-4.5 \cdot \frac{z \cdot t}{a}\\ \mathbf{elif}\;x \leq -9.8 \cdot 10^{+87}:\\ \;\;\;\;0.5 \cdot \left(\frac{y}{a} \cdot x\right)\\ \mathbf{elif}\;x \leq -1.7 \cdot 10^{-40}:\\ \;\;\;\;-4.5 \cdot \frac{t}{\frac{a}{z}}\\ \mathbf{elif}\;x \leq -5.2 \cdot 10^{-55} \lor \neg \left(x \leq 2.7 \cdot 10^{-118}\right):\\ \;\;\;\;0.5 \cdot \left(\frac{y}{a} \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;-4.5 \cdot \frac{z \cdot t}{a}\\ \end{array} \]

Alternative 6: 93.1% accurate, 0.7× speedup?

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

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


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

    1. Initial program 74.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{z}{a} \cdot \left(t \cdot -4.5\right)} + 0.5 \cdot \left(\frac{x}{a} \cdot y\right) \]
      7. *-commutative97.0%

        \[\leadsto \frac{z}{a} \cdot \color{blue}{\left(-4.5 \cdot t\right)} + 0.5 \cdot \left(\frac{x}{a} \cdot y\right) \]
      8. associate-*r*96.9%

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

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

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

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

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

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

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

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

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

    if -1e8 < (*.f64 a 2)

    1. Initial program 95.4%

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

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

Alternative 7: 73.8% accurate, 0.8× speedup?

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

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

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


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

    1. Initial program 79.6%

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

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

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

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

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

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

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

    if -3.9999999999999998e-7 < (*.f64 x y) < 1.49999999999999992e33

    1. Initial program 96.0%

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

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

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

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

    if 1.49999999999999992e33 < (*.f64 x y)

    1. Initial program 83.5%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{1}{\frac{\frac{a}{y}}{0.5 \cdot x}}} \]
    8. Applied egg-rr72.0%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \cdot x \leq -4 \cdot 10^{-7}:\\ \;\;\;\;0.5 \cdot \left(y \cdot \frac{x}{a}\right)\\ \mathbf{elif}\;y \cdot x \leq 1.5 \cdot 10^{+33}:\\ \;\;\;\;-4.5 \cdot \frac{z \cdot t}{a}\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot 0.5\right) \cdot \frac{1}{\frac{a}{y}}\\ \end{array} \]

Alternative 8: 65.0% accurate, 0.9× speedup?

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

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

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

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

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


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

    1. Initial program 85.5%

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

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

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

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

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

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

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

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

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

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

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

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

    if -2e176 < z < -2e80

    1. Initial program 94.0%

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

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

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

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

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

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

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

    if -2e80 < z < -1.94999999999999997e-12

    1. Initial program 95.0%

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

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

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

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

    if -1.94999999999999997e-12 < z < 1.7999999999999999e-44

    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. associate-*l*90.1%

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

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

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

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

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

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

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

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

    if 1.7999999999999999e-44 < z

    1. Initial program 85.5%

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

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

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

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

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

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

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

Alternative 9: 73.8% accurate, 0.9× speedup?

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

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

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


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

    1. Initial program 79.6%

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

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

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

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

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

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

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

    if -3.9999999999999998e-7 < (*.f64 x y) < 1.49999999999999992e33

    1. Initial program 96.0%

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

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

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

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

    if 1.49999999999999992e33 < (*.f64 x y)

    1. Initial program 83.5%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \cdot x \leq -4 \cdot 10^{-7}:\\ \;\;\;\;0.5 \cdot \left(y \cdot \frac{x}{a}\right)\\ \mathbf{elif}\;y \cdot x \leq 1.5 \cdot 10^{+33}:\\ \;\;\;\;-4.5 \cdot \frac{z \cdot t}{a}\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \frac{x}{\frac{a}{y}}\\ \end{array} \]

Alternative 10: 51.2% accurate, 1.4× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -4.79999999999999982e-37

    1. Initial program 83.6%

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

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

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

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

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

      \[\leadsto \color{blue}{-4.5 \cdot \frac{t}{\frac{a}{z}}} \]
    7. Taylor expanded in t around 0 38.5%

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

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

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

    if -4.79999999999999982e-37 < x

    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. associate-*l*91.5%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -4.8 \cdot 10^{-37}:\\ \;\;\;\;-4.5 \cdot \left(\frac{z}{a} \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;-4.5 \cdot \frac{z \cdot t}{a}\\ \end{array} \]

Alternative 11: 51.2% accurate, 1.9× speedup?

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

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

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

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

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

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

    \[\leadsto \color{blue}{-4.5 \cdot \frac{t}{\frac{a}{z}}} \]
  7. Taylor expanded in t around 0 49.7%

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

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

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

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

Developer target: 93.7% accurate, 0.7× speedup?

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

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

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

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


\end{array}
\end{array}

Reproduce

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

  :herbie-target
  (if (< a -2.090464557976709e+86) (- (* 0.5 (/ (* y x) a)) (* 4.5 (/ t (/ a z)))) (if (< a 2.144030707833976e+99) (/ (- (* x y) (* z (* 9.0 t))) (* a 2.0)) (- (* (/ y a) (* x 0.5)) (* (/ t a) (* z 4.5)))))

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