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

Percentage Accurate: 91.1% → 94.1%
Time: 8.6s
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.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: 94.1% accurate, 0.1× speedup?

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

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

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


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

    1. Initial program 58.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{0.5}{a} \cdot \left(x \cdot y + \color{blue}{\left(-z \cdot \left(9 \cdot t\right)\right)}\right) \]
      7. distribute-lft-in58.6%

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

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

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

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

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

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

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

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

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

    if -2.0000000000000001e300 < (*.f64 x y) < 1.00000000000000004e245

    1. Initial program 93.2%

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

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

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

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

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

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

    if 1.00000000000000004e245 < (*.f64 x y)

    1. Initial program 73.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{1}{\frac{\frac{a}{x}}{y \cdot 0.5}}} \]
      2. inv-pow99.6%

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

      \[\leadsto \color{blue}{{\left(\frac{\frac{a}{x}}{y \cdot 0.5}\right)}^{-1}} \]
    9. Step-by-step derivation
      1. unpow-199.6%

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

        \[\leadsto \frac{1}{\frac{\color{blue}{1 \cdot \frac{a}{x}}}{y \cdot 0.5}} \]
      3. *-commutative99.6%

        \[\leadsto \frac{1}{\frac{1 \cdot \frac{a}{x}}{\color{blue}{0.5 \cdot y}}} \]
      4. times-frac99.6%

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

        \[\leadsto \frac{1}{\color{blue}{2} \cdot \frac{\frac{a}{x}}{y}} \]
    10. Applied egg-rr99.6%

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

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

Alternative 2: 94.6% accurate, 0.6× speedup?

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

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

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


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

    1. Initial program 55.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 93.3%

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

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

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

    if 1.00000000000000004e245 < (*.f64 x y)

    1. Initial program 73.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{1}{\frac{\frac{a}{x}}{y \cdot 0.5}}} \]
      2. inv-pow99.6%

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

      \[\leadsto \color{blue}{{\left(\frac{\frac{a}{x}}{y \cdot 0.5}\right)}^{-1}} \]
    9. Step-by-step derivation
      1. unpow-199.6%

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

        \[\leadsto \frac{1}{\frac{\color{blue}{1 \cdot \frac{a}{x}}}{y \cdot 0.5}} \]
      3. *-commutative99.6%

        \[\leadsto \frac{1}{\frac{1 \cdot \frac{a}{x}}{\color{blue}{0.5 \cdot y}}} \]
      4. times-frac99.6%

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

        \[\leadsto \frac{1}{\color{blue}{2} \cdot \frac{\frac{a}{x}}{y}} \]
    10. Applied egg-rr99.6%

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

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

Alternative 3: 94.7% accurate, 0.6× speedup?

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

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

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


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

    1. Initial program 55.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 93.3%

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

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

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

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

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

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

    if 1.00000000000000004e245 < (*.f64 x y)

    1. Initial program 73.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{1}{\frac{\frac{a}{x}}{y \cdot 0.5}}} \]
      2. inv-pow99.6%

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

      \[\leadsto \color{blue}{{\left(\frac{\frac{a}{x}}{y \cdot 0.5}\right)}^{-1}} \]
    9. Step-by-step derivation
      1. unpow-199.6%

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

        \[\leadsto \frac{1}{\frac{\color{blue}{1 \cdot \frac{a}{x}}}{y \cdot 0.5}} \]
      3. *-commutative99.6%

        \[\leadsto \frac{1}{\frac{1 \cdot \frac{a}{x}}{\color{blue}{0.5 \cdot y}}} \]
      4. times-frac99.6%

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

        \[\leadsto \frac{1}{\color{blue}{2} \cdot \frac{\frac{a}{x}}{y}} \]
    10. Applied egg-rr99.6%

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

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

Alternative 4: 65.3% accurate, 0.9× speedup?

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

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

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

\mathbf{elif}\;z \leq 1.3 \cdot 10^{-130}:\\
\;\;\;\;x \cdot \frac{y \cdot 0.5}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -4.19999999999999982e57 or 1.3e-130 < z

    1. Initial program 86.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.19999999999999982e57 < z < -4.4500000000000002e-17

    1. Initial program 92.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.4500000000000002e-17 < z < -1.19999999999999996e-40

    1. Initial program 99.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.19999999999999996e-40 < z < 1.3e-130

    1. Initial program 93.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.2 \cdot 10^{+57}:\\ \;\;\;\;-4.5 \cdot \frac{t}{\frac{a}{z}}\\ \mathbf{elif}\;z \leq -4.45 \cdot 10^{-17}:\\ \;\;\;\;\left(y \cdot 0.5\right) \cdot \frac{x}{a}\\ \mathbf{elif}\;z \leq -1.2 \cdot 10^{-40}:\\ \;\;\;\;-4.5 \cdot \left(t \cdot \frac{z}{a}\right)\\ \mathbf{elif}\;z \leq 1.3 \cdot 10^{-130}:\\ \;\;\;\;x \cdot \frac{y \cdot 0.5}{a}\\ \mathbf{else}:\\ \;\;\;\;-4.5 \cdot \frac{t}{\frac{a}{z}}\\ \end{array} \]

Alternative 5: 65.5% accurate, 0.9× speedup?

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

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

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

\mathbf{elif}\;z \leq 6.8 \cdot 10^{-130}:\\
\;\;\;\;\frac{x \cdot y}{a \cdot 2}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -3e57 or 6.8000000000000001e-130 < z

    1. Initial program 86.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3e57 < z < -3.70000000000000001e-14

    1. Initial program 92.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.70000000000000001e-14 < z < -1.19999999999999995e-37

    1. Initial program 99.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.19999999999999995e-37 < z < 6.8000000000000001e-130

    1. Initial program 93.2%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3 \cdot 10^{+57}:\\ \;\;\;\;-4.5 \cdot \frac{t}{\frac{a}{z}}\\ \mathbf{elif}\;z \leq -3.7 \cdot 10^{-14}:\\ \;\;\;\;\left(y \cdot 0.5\right) \cdot \frac{x}{a}\\ \mathbf{elif}\;z \leq -1.2 \cdot 10^{-37}:\\ \;\;\;\;-4.5 \cdot \left(t \cdot \frac{z}{a}\right)\\ \mathbf{elif}\;z \leq 6.8 \cdot 10^{-130}:\\ \;\;\;\;\frac{x \cdot y}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;-4.5 \cdot \frac{t}{\frac{a}{z}}\\ \end{array} \]

Alternative 6: 65.3% accurate, 1.2× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -4.30000000000000033e57 or 6.8000000000000001e-130 < z

    1. Initial program 86.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.30000000000000033e57 < z < 6.8000000000000001e-130

    1. Initial program 93.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 52.0% accurate, 1.4× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < 1.3500000000000001e133

    1. Initial program 90.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.3500000000000001e133 < t

    1. Initial program 86.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 51.9% accurate, 1.4× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < 5.2000000000000003e134

    1. Initial program 90.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.2000000000000003e134 < t

    1. Initial program 86.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 52.0% accurate, 1.4× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < 5.40000000000000008e131

    1. Initial program 90.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.40000000000000008e131 < t

    1. Initial program 86.9%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 5.4 \cdot 10^{+131}:\\ \;\;\;\;-4.5 \cdot \frac{t}{\frac{a}{z}}\\ \mathbf{else}:\\ \;\;\;\;-4.5 \cdot \frac{z}{\frac{a}{t}}\\ \end{array} \]

Alternative 10: 52.3% accurate, 1.9× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\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}}} \]
    2. associate-/r/52.4%

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

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

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

Developer target: 93.2% accurate, 0.7× speedup?

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

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

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

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


\end{array}
\end{array}

Reproduce

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