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

Percentage Accurate: 91.2% → 96.5%
Time: 29.5s
Alternatives: 13
Speedup: 0.4×

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 13 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.2% accurate, 1.0× speedup?

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

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

Alternative 1: 96.5% accurate, 0.1× speedup?

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

\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+300}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, \frac{y}{2}, t \cdot \left(z \cdot -4.5\right)\right)}{a}\\

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


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

    1. Initial program 72.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 98.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 68.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -0.5 \cdot \left(t \cdot \frac{\color{blue}{z \cdot 9} - \frac{x \cdot y}{t}}{a}\right) \]
      3. associate-*r/91.7%

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

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

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

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

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

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

Alternative 2: 95.8% accurate, 0.1× speedup?

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

\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+292}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, \frac{y}{2}, t \cdot \left(z \cdot -4.5\right)\right)}{a}\\

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


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

    1. Initial program 91.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{x \cdot \left(y \cdot 0.5\right)}{a} - \left(\color{blue}{4.5} \cdot \frac{t}{a}\right) \cdot z \]
      6. cancel-sign-sub-inv91.8%

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

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

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

        \[\leadsto \frac{x \cdot \left(y \cdot 0.5\right)}{a} + \color{blue}{\left(-z\right) \cdot \left(4.5 \cdot \frac{t}{a}\right)} \]
      10. cancel-sign-sub-inv91.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 0.5 \cdot \left(x \cdot \color{blue}{\frac{1}{\frac{a}{y}}}\right) - t \cdot \left(4.5 \cdot \frac{z}{a}\right) \]
      2. inv-pow97.8%

        \[\leadsto 0.5 \cdot \left(x \cdot \color{blue}{{\left(\frac{a}{y}\right)}^{-1}}\right) - t \cdot \left(4.5 \cdot \frac{z}{a}\right) \]
    10. Applied egg-rr97.8%

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

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

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

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

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

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

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

    if -3.9999999999999998e304 < (/.f64 (-.f64 (*.f64 x y) (*.f64 (*.f64 z #s(literal 9 binary64)) t)) (*.f64 a #s(literal 2 binary64))) < 4.9999999999999996e292

    1. Initial program 98.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.9999999999999996e292 < (/.f64 (-.f64 (*.f64 x y) (*.f64 (*.f64 z #s(literal 9 binary64)) t)) (*.f64 a #s(literal 2 binary64)))

    1. Initial program 67.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -0.5 \cdot \left(t \cdot \frac{\color{blue}{z \cdot 9} - \frac{x \cdot y}{t}}{a}\right) \]
      3. associate-*r/92.2%

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

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

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

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

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

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

Alternative 3: 96.5% accurate, 0.1× speedup?

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

\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+264}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, \frac{y}{2}, t \cdot \left(z \cdot -4.5\right)\right)}{a}\\

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


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

    1. Initial program 72.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{x \cdot \left(y \cdot 0.5\right)}{a} + \color{blue}{\left(-z\right) \cdot \left(4.5 \cdot \frac{t}{a}\right)} \]
      10. cancel-sign-sub-inv84.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 98.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 71.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{x \cdot \left(y \cdot 0.5\right)}{a} + \color{blue}{\left(-z\right) \cdot \left(4.5 \cdot \frac{t}{a}\right)} \]
      10. cancel-sign-sub-inv86.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 0.5 \cdot \left(x \cdot \color{blue}{{\left(\frac{a}{y}\right)}^{-1}}\right) - t \cdot \left(4.5 \cdot \frac{z}{a}\right) \]
    10. Applied egg-rr94.7%

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

        \[\leadsto 0.5 \cdot \left(x \cdot \color{blue}{\frac{1}{\frac{a}{y}}}\right) - t \cdot \left(4.5 \cdot \frac{z}{a}\right) \]
    12. Simplified94.7%

      \[\leadsto 0.5 \cdot \left(x \cdot \color{blue}{\frac{1}{\frac{a}{y}}}\right) - t \cdot \left(4.5 \cdot \frac{z}{a}\right) \]
    13. Step-by-step derivation
      1. un-div-inv94.7%

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

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

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

Alternative 4: 96.2% accurate, 0.3× speedup?

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

\mathbf{else}:\\
\;\;\;\;\frac{t\_1}{a \cdot 2}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 (*.f64 x y) (*.f64 (*.f64 z #s(literal 9 binary64)) t)) < -4.9999999999999996e248 or 2.00000000000000009e264 < (-.f64 (*.f64 x y) (*.f64 (*.f64 z #s(literal 9 binary64)) t))

    1. Initial program 75.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{x \cdot \left(y \cdot 0.5\right)}{a} - \left(\color{blue}{4.5} \cdot \frac{t}{a}\right) \cdot z \]
      6. cancel-sign-sub-inv88.1%

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

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

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

        \[\leadsto \frac{x \cdot \left(y \cdot 0.5\right)}{a} + \color{blue}{\left(-z\right) \cdot \left(4.5 \cdot \frac{t}{a}\right)} \]
      10. cancel-sign-sub-inv88.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 99.0%

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

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

Alternative 5: 96.2% accurate, 0.3× speedup?

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

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

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


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

    1. Initial program 79.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{x \cdot \left(y \cdot 0.5\right)}{a} - \left(\color{blue}{4.5} \cdot \frac{t}{a}\right) \cdot z \]
      6. cancel-sign-sub-inv89.3%

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

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

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

        \[\leadsto \frac{x \cdot \left(y \cdot 0.5\right)}{a} + \color{blue}{\left(-z\right) \cdot \left(4.5 \cdot \frac{t}{a}\right)} \]
      10. cancel-sign-sub-inv89.3%

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

        \[\leadsto \frac{\color{blue}{\left(x \cdot y\right) \cdot 0.5}}{a} - z \cdot \left(4.5 \cdot \frac{t}{a}\right) \]
      12. *-commutative89.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 99.0%

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

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

    1. Initial program 71.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{x \cdot \left(y \cdot 0.5\right)}{a} + \color{blue}{\left(-z\right) \cdot \left(4.5 \cdot \frac{t}{a}\right)} \]
      10. cancel-sign-sub-inv86.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 0.5 \cdot \left(x \cdot \color{blue}{{\left(\frac{a}{y}\right)}^{-1}}\right) - t \cdot \left(4.5 \cdot \frac{z}{a}\right) \]
    10. Applied egg-rr94.7%

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

        \[\leadsto 0.5 \cdot \left(x \cdot \color{blue}{\frac{1}{\frac{a}{y}}}\right) - t \cdot \left(4.5 \cdot \frac{z}{a}\right) \]
    12. Simplified94.7%

      \[\leadsto 0.5 \cdot \left(x \cdot \color{blue}{\frac{1}{\frac{a}{y}}}\right) - t \cdot \left(4.5 \cdot \frac{z}{a}\right) \]
    13. Step-by-step derivation
      1. un-div-inv94.7%

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

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

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

Alternative 6: 96.1% accurate, 0.3× speedup?

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

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

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


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

    1. Initial program 79.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{x \cdot \left(y \cdot 0.5\right)}{a} - \left(\color{blue}{4.5} \cdot \frac{t}{a}\right) \cdot z \]
      6. cancel-sign-sub-inv89.3%

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

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

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

        \[\leadsto \frac{x \cdot \left(y \cdot 0.5\right)}{a} + \color{blue}{\left(-z\right) \cdot \left(4.5 \cdot \frac{t}{a}\right)} \]
      10. cancel-sign-sub-inv89.3%

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

        \[\leadsto \frac{\color{blue}{\left(x \cdot y\right) \cdot 0.5}}{a} - z \cdot \left(4.5 \cdot \frac{t}{a}\right) \]
      12. *-commutative89.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 99.0%

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

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

    1. Initial program 71.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{x \cdot \left(y \cdot 0.5\right)}{a} + \color{blue}{\left(-z\right) \cdot \left(4.5 \cdot \frac{t}{a}\right)} \]
      10. cancel-sign-sub-inv86.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 94.7% accurate, 0.4× speedup?

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

\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+200}:\\
\;\;\;\;\frac{x \cdot y - t\_1}{a \cdot 2}\\

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


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

    1. Initial program 62.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -inf.0 < (*.f64 (*.f64 z #s(literal 9 binary64)) t) < 5.00000000000000019e200

    1. Initial program 97.8%

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

    if 5.00000000000000019e200 < (*.f64 (*.f64 z #s(literal 9 binary64)) t)

    1. Initial program 73.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-4.5 \cdot \frac{t \cdot z}{a}} \]
    10. Step-by-step derivation
      1. metadata-eval76.1%

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

        \[\leadsto \left(-4.5\right) \cdot \color{blue}{\left(t \cdot \frac{z}{a}\right)} \]
      3. distribute-lft-neg-in87.5%

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

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

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

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

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

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

        \[\leadsto -t \cdot \color{blue}{\left(\frac{z}{a} \cdot 4.5\right)} \]
      10. distribute-rgt-neg-in87.6%

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

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

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

        \[\leadsto t \cdot \color{blue}{\frac{-4.5 \cdot z}{a}} \]
      14. *-commutative87.6%

        \[\leadsto t \cdot \frac{-\color{blue}{z \cdot 4.5}}{a} \]
      15. distribute-rgt-neg-in87.6%

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

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

      \[\leadsto \color{blue}{t \cdot \frac{z \cdot -4.5}{a}} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 8: 73.4% accurate, 0.6× speedup?

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

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

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


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

    1. Initial program 86.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{0.5 \cdot \frac{x \cdot y}{a}} \]
      4. *-commutative70.5%

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

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

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

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

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

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

    if -2e18 < (*.f64 x y) < 1.0000000000000001e-15

    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/94.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.0000000000000001e-15 < (*.f64 x y)

    1. Initial program 93.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 65.7% accurate, 0.8× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -4.4999999999999997e106 or 1.25000000000000005e-90 < x

    1. Initial program 88.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{0.5 \cdot \frac{x \cdot y}{a}} \]
      4. *-commutative59.7%

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

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

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

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

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

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

    if -4.4999999999999997e106 < x < 1.25000000000000005e-90

    1. Initial program 94.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 65.7% accurate, 0.8× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.44999999999999994e107 or 8.99999999999999952e-91 < x

    1. Initial program 88.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{0.5 \cdot \frac{x \cdot y}{a}} \]
      4. *-commutative59.7%

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

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

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

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

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

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

    if -1.44999999999999994e107 < x < 8.99999999999999952e-91

    1. Initial program 94.5%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 64.5% accurate, 0.8× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.8000000000000001e138 or 1.25000000000000005e-90 < x

    1. Initial program 87.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.8000000000000001e138 < x < 1.25000000000000005e-90

    1. Initial program 94.8%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 51.0% accurate, 1.1× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < 1.70000000000000005e244

    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. cancel-sign-sub-inv93.2%

        \[\leadsto \frac{\color{blue}{x \cdot y + \left(-z \cdot 9\right) \cdot t}}{a \cdot 2} \]
      2. fma-define93.6%

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(x, y, \left(-z \cdot 9\right) \cdot t\right)}}{a \cdot 2} \]
      3. distribute-rgt-neg-in93.6%

        \[\leadsto \frac{\mathsf{fma}\left(x, y, \color{blue}{\left(z \cdot \left(-9\right)\right)} \cdot t\right)}{a \cdot 2} \]
      4. associate-*r*94.0%

        \[\leadsto \frac{\mathsf{fma}\left(x, y, \color{blue}{z \cdot \left(\left(-9\right) \cdot t\right)}\right)}{a \cdot 2} \]
      5. distribute-lft-neg-in94.0%

        \[\leadsto \frac{\mathsf{fma}\left(x, y, z \cdot \color{blue}{\left(-9 \cdot t\right)}\right)}{a \cdot 2} \]
      6. *-commutative94.0%

        \[\leadsto \frac{\mathsf{fma}\left(x, y, z \cdot \left(-\color{blue}{t \cdot 9}\right)\right)}{a \cdot 2} \]
      7. distribute-rgt-neg-in94.0%

        \[\leadsto \frac{\mathsf{fma}\left(x, y, z \cdot \color{blue}{\left(t \cdot \left(-9\right)\right)}\right)}{a \cdot 2} \]
      8. metadata-eval94.0%

        \[\leadsto \frac{\mathsf{fma}\left(x, y, z \cdot \left(t \cdot \color{blue}{-9}\right)\right)}{a \cdot 2} \]
    3. Simplified94.0%

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x, y, z \cdot \left(t \cdot -9\right)\right)}{a \cdot 2}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 0 57.6%

      \[\leadsto \color{blue}{-4.5 \cdot \frac{t \cdot z}{a}} \]

    if 1.70000000000000005e244 < a

    1. Initial program 72.3%

      \[\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2} \]
    2. Step-by-step derivation
      1. cancel-sign-sub-inv72.3%

        \[\leadsto \frac{\color{blue}{x \cdot y + \left(-z \cdot 9\right) \cdot t}}{a \cdot 2} \]
      2. fma-define72.3%

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(x, y, \left(-z \cdot 9\right) \cdot t\right)}}{a \cdot 2} \]
      3. distribute-rgt-neg-in72.3%

        \[\leadsto \frac{\mathsf{fma}\left(x, y, \color{blue}{\left(z \cdot \left(-9\right)\right)} \cdot t\right)}{a \cdot 2} \]
      4. associate-*r*72.3%

        \[\leadsto \frac{\mathsf{fma}\left(x, y, \color{blue}{z \cdot \left(\left(-9\right) \cdot t\right)}\right)}{a \cdot 2} \]
      5. distribute-lft-neg-in72.3%

        \[\leadsto \frac{\mathsf{fma}\left(x, y, z \cdot \color{blue}{\left(-9 \cdot t\right)}\right)}{a \cdot 2} \]
      6. *-commutative72.3%

        \[\leadsto \frac{\mathsf{fma}\left(x, y, z \cdot \left(-\color{blue}{t \cdot 9}\right)\right)}{a \cdot 2} \]
      7. distribute-rgt-neg-in72.3%

        \[\leadsto \frac{\mathsf{fma}\left(x, y, z \cdot \color{blue}{\left(t \cdot \left(-9\right)\right)}\right)}{a \cdot 2} \]
      8. metadata-eval72.3%

        \[\leadsto \frac{\mathsf{fma}\left(x, y, z \cdot \left(t \cdot \color{blue}{-9}\right)\right)}{a \cdot 2} \]
    3. Simplified72.3%

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x, y, z \cdot \left(t \cdot -9\right)\right)}{a \cdot 2}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 0 50.0%

      \[\leadsto \color{blue}{-4.5 \cdot \frac{t \cdot z}{a}} \]
    6. Step-by-step derivation
      1. associate-/l*45.7%

        \[\leadsto -4.5 \cdot \color{blue}{\left(t \cdot \frac{z}{a}\right)} \]
    7. Simplified45.7%

      \[\leadsto \color{blue}{-4.5 \cdot \left(t \cdot \frac{z}{a}\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification56.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq 1.7 \cdot 10^{+244}:\\ \;\;\;\;-4.5 \cdot \frac{z \cdot t}{a}\\ \mathbf{else}:\\ \;\;\;\;-4.5 \cdot \left(t \cdot \frac{z}{a}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 52.2% accurate, 1.9× speedup?

\[\begin{array}{l} [x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\ \\ -4.5 \cdot \left(t \cdot \frac{z}{a}\right) \end{array} \]
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a) :precision binary64 (* -4.5 (* t (/ z a))))
assert(x < y && y < z && z < t && t < a);
double code(double x, double y, double z, double t, double a) {
	return -4.5 * (t * (z / a));
}
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    code = (-4.5d0) * (t * (z / a))
end function
assert x < y && y < z && z < t && t < a;
public static double code(double x, double y, double z, double t, double a) {
	return -4.5 * (t * (z / a));
}
[x, y, z, t, a] = sort([x, y, z, t, a])
def code(x, y, z, t, a):
	return -4.5 * (t * (z / a))
x, y, z, t, a = sort([x, y, z, t, a])
function code(x, y, z, t, a)
	return Float64(-4.5 * Float64(t * Float64(z / a)))
end
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
function tmp = code(x, y, z, t, a)
	tmp = -4.5 * (t * (z / a));
end
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_] := N[(-4.5 * N[(t * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
-4.5 \cdot \left(t \cdot \frac{z}{a}\right)
\end{array}
Derivation
  1. Initial program 91.5%

    \[\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2} \]
  2. Step-by-step derivation
    1. cancel-sign-sub-inv91.5%

      \[\leadsto \frac{\color{blue}{x \cdot y + \left(-z \cdot 9\right) \cdot t}}{a \cdot 2} \]
    2. fma-define91.9%

      \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(x, y, \left(-z \cdot 9\right) \cdot t\right)}}{a \cdot 2} \]
    3. distribute-rgt-neg-in91.9%

      \[\leadsto \frac{\mathsf{fma}\left(x, y, \color{blue}{\left(z \cdot \left(-9\right)\right)} \cdot t\right)}{a \cdot 2} \]
    4. associate-*r*92.2%

      \[\leadsto \frac{\mathsf{fma}\left(x, y, \color{blue}{z \cdot \left(\left(-9\right) \cdot t\right)}\right)}{a \cdot 2} \]
    5. distribute-lft-neg-in92.2%

      \[\leadsto \frac{\mathsf{fma}\left(x, y, z \cdot \color{blue}{\left(-9 \cdot t\right)}\right)}{a \cdot 2} \]
    6. *-commutative92.2%

      \[\leadsto \frac{\mathsf{fma}\left(x, y, z \cdot \left(-\color{blue}{t \cdot 9}\right)\right)}{a \cdot 2} \]
    7. distribute-rgt-neg-in92.2%

      \[\leadsto \frac{\mathsf{fma}\left(x, y, z \cdot \color{blue}{\left(t \cdot \left(-9\right)\right)}\right)}{a \cdot 2} \]
    8. metadata-eval92.2%

      \[\leadsto \frac{\mathsf{fma}\left(x, y, z \cdot \left(t \cdot \color{blue}{-9}\right)\right)}{a \cdot 2} \]
  3. Simplified92.2%

    \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x, y, z \cdot \left(t \cdot -9\right)\right)}{a \cdot 2}} \]
  4. Add Preprocessing
  5. Taylor expanded in x around 0 57.0%

    \[\leadsto \color{blue}{-4.5 \cdot \frac{t \cdot z}{a}} \]
  6. Step-by-step derivation
    1. associate-/l*54.9%

      \[\leadsto -4.5 \cdot \color{blue}{\left(t \cdot \frac{z}{a}\right)} \]
  7. Simplified54.9%

    \[\leadsto \color{blue}{-4.5 \cdot \left(t \cdot \frac{z}{a}\right)} \]
  8. Add Preprocessing

Developer Target 1: 93.8% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a < -2.090464557976709 \cdot 10^{+86}:\\ \;\;\;\;0.5 \cdot \frac{y \cdot x}{a} - 4.5 \cdot \frac{t}{\frac{a}{z}}\\ \mathbf{elif}\;a < 2.144030707833976 \cdot 10^{+99}:\\ \;\;\;\;\frac{x \cdot y - z \cdot \left(9 \cdot t\right)}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a} \cdot \left(x \cdot 0.5\right) - \frac{t}{a} \cdot \left(z \cdot 4.5\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (< a -2.090464557976709e+86)
   (- (* 0.5 (/ (* y x) a)) (* 4.5 (/ t (/ a z))))
   (if (< a 2.144030707833976e+99)
     (/ (- (* x y) (* z (* 9.0 t))) (* a 2.0))
     (- (* (/ y a) (* x 0.5)) (* (/ t a) (* z 4.5))))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (a < -2.090464557976709e+86) {
		tmp = (0.5 * ((y * x) / a)) - (4.5 * (t / (a / z)));
	} else if (a < 2.144030707833976e+99) {
		tmp = ((x * y) - (z * (9.0 * t))) / (a * 2.0);
	} else {
		tmp = ((y / a) * (x * 0.5)) - ((t / a) * (z * 4.5));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: tmp
    if (a < (-2.090464557976709d+86)) then
        tmp = (0.5d0 * ((y * x) / a)) - (4.5d0 * (t / (a / z)))
    else if (a < 2.144030707833976d+99) then
        tmp = ((x * y) - (z * (9.0d0 * t))) / (a * 2.0d0)
    else
        tmp = ((y / a) * (x * 0.5d0)) - ((t / a) * (z * 4.5d0))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (a < -2.090464557976709e+86) {
		tmp = (0.5 * ((y * x) / a)) - (4.5 * (t / (a / z)));
	} else if (a < 2.144030707833976e+99) {
		tmp = ((x * y) - (z * (9.0 * t))) / (a * 2.0);
	} else {
		tmp = ((y / a) * (x * 0.5)) - ((t / a) * (z * 4.5));
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if a < -2.090464557976709e+86:
		tmp = (0.5 * ((y * x) / a)) - (4.5 * (t / (a / z)))
	elif a < 2.144030707833976e+99:
		tmp = ((x * y) - (z * (9.0 * t))) / (a * 2.0)
	else:
		tmp = ((y / a) * (x * 0.5)) - ((t / a) * (z * 4.5))
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (a < -2.090464557976709e+86)
		tmp = Float64(Float64(0.5 * Float64(Float64(y * x) / a)) - Float64(4.5 * Float64(t / Float64(a / z))));
	elseif (a < 2.144030707833976e+99)
		tmp = Float64(Float64(Float64(x * y) - Float64(z * Float64(9.0 * t))) / Float64(a * 2.0));
	else
		tmp = Float64(Float64(Float64(y / a) * Float64(x * 0.5)) - Float64(Float64(t / a) * Float64(z * 4.5)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (a < -2.090464557976709e+86)
		tmp = (0.5 * ((y * x) / a)) - (4.5 * (t / (a / z)));
	elseif (a < 2.144030707833976e+99)
		tmp = ((x * y) - (z * (9.0 * t))) / (a * 2.0);
	else
		tmp = ((y / a) * (x * 0.5)) - ((t / a) * (z * 4.5));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[Less[a, -2.090464557976709e+86], N[(N[(0.5 * N[(N[(y * x), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision] - N[(4.5 * N[(t / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Less[a, 2.144030707833976e+99], N[(N[(N[(x * y), $MachinePrecision] - N[(z * N[(9.0 * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y / a), $MachinePrecision] * N[(x * 0.5), $MachinePrecision]), $MachinePrecision] - N[(N[(t / a), $MachinePrecision] * N[(z * 4.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;a < -2.090464557976709 \cdot 10^{+86}:\\
\;\;\;\;0.5 \cdot \frac{y \cdot x}{a} - 4.5 \cdot \frac{t}{\frac{a}{z}}\\

\mathbf{elif}\;a < 2.144030707833976 \cdot 10^{+99}:\\
\;\;\;\;\frac{x \cdot y - z \cdot \left(9 \cdot t\right)}{a \cdot 2}\\

\mathbf{else}:\\
\;\;\;\;\frac{y}{a} \cdot \left(x \cdot 0.5\right) - \frac{t}{a} \cdot \left(z \cdot 4.5\right)\\


\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2024143 
(FPCore (x y z t a)
  :name "Diagrams.Solve.Polynomial:cubForm  from diagrams-solve-0.1, I"
  :precision binary64

  :alt
  (! :herbie-platform default (if (< a -209046455797670900000000000000000000000000000000000000000000000000000000000000000000000) (- (* 1/2 (/ (* y x) a)) (* 9/2 (/ t (/ a z)))) (if (< a 2144030707833976000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (/ (- (* x y) (* z (* 9 t))) (* a 2)) (- (* (/ y a) (* x 1/2)) (* (/ t a) (* z 9/2))))))

  (/ (- (* x y) (* (* z 9.0) t)) (* a 2.0)))