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

Percentage Accurate: 91.2% → 93.7%
Time: 10.8s
Alternatives: 11
Speedup: 0.6×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 11 alternatives:

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

Initial Program: 91.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: 93.7% accurate, 0.5× speedup?

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

\mathbf{elif}\;t_1 \leq 5 \cdot 10^{+247}:\\
\;\;\;\;-4.5 \cdot \frac{z \cdot t}{a} + 0.5 \cdot \frac{x \cdot y}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 (*.f64 z 9) t) < -2.00000000000000013e265

    1. Initial program 74.4%

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

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

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

      \[\leadsto \color{blue}{-4.5 \cdot \frac{t \cdot z}{a} + 0.5 \cdot \frac{x \cdot y}{a}} \]
    5. Taylor expanded in t around inf 74.4%

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

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

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

    if -2.00000000000000013e265 < (*.f64 (*.f64 z 9) t) < 5.00000000000000023e247

    1. Initial program 96.7%

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

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

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

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

    if 5.00000000000000023e247 < (*.f64 (*.f64 z 9) t)

    1. Initial program 76.6%

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

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

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

      \[\leadsto \color{blue}{-4.5 \cdot \frac{t \cdot z}{a} + 0.5 \cdot \frac{x \cdot y}{a}} \]
    5. Taylor expanded in t around inf 76.8%

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

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

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

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

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

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

        \[\leadsto z \cdot \color{blue}{\frac{-4.5 \cdot t}{a}} \]
    7. Simplified99.7%

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

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

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

Alternative 2: 93.4% accurate, 0.1× speedup?

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

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


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

    1. Initial program 95.9%

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

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

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

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

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

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

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

    if 1.00000000000000006e-32 < (*.f64 a 2)

    1. Initial program 85.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 92.2% accurate, 0.1× speedup?

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

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


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

    1. Initial program 95.9%

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

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

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

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

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

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

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

    if 1.00000000000000006e-32 < (*.f64 a 2)

    1. Initial program 85.0%

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 94.1% accurate, 0.5× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 (*.f64 z 9) t) < -3.99999999999999984e217

    1. Initial program 77.0%

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

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

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

      \[\leadsto \color{blue}{-4.5 \cdot \frac{t \cdot z}{a} + 0.5 \cdot \frac{x \cdot y}{a}} \]
    5. Taylor expanded in t around inf 77.0%

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

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

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

    if -3.99999999999999984e217 < (*.f64 (*.f64 z 9) t) < 5.0000000000000002e205

    1. Initial program 97.1%

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

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

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

    if 5.0000000000000002e205 < (*.f64 (*.f64 z 9) t)

    1. Initial program 78.0%

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

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

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

      \[\leadsto \color{blue}{-4.5 \cdot \frac{t \cdot z}{a} + 0.5 \cdot \frac{x \cdot y}{a}} \]
    5. Taylor expanded in t around inf 81.5%

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

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

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

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

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

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

        \[\leadsto z \cdot \color{blue}{\frac{-4.5 \cdot t}{a}} \]
    7. Simplified99.7%

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

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

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

Alternative 5: 72.4% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{-52}:\\
\;\;\;\;t_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 x y) < -2.00000000000000006e40 or 4.00000000000000005e-119 < (*.f64 x y) < 2e-52

    1. Initial program 93.6%

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

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

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

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

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

        \[\leadsto -4.5 \cdot \frac{t \cdot z}{a} + 0.5 \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(\frac{x \cdot y}{a}\right)} - 1\right)} \]
    6. Applied egg-rr40.2%

      \[\leadsto -4.5 \cdot \frac{t \cdot z}{a} + 0.5 \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(\frac{x \cdot y}{a}\right)} - 1\right)} \]
    7. Step-by-step derivation
      1. expm1-def56.9%

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

        \[\leadsto -4.5 \cdot \frac{t \cdot z}{a} + 0.5 \cdot \color{blue}{\frac{x \cdot y}{a}} \]
      3. associate-/l*93.2%

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

      \[\leadsto -4.5 \cdot \frac{t \cdot z}{a} + 0.5 \cdot \color{blue}{\frac{x}{\frac{a}{y}}} \]
    9. Applied egg-rr91.3%

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

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

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

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

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

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

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

    if -2.00000000000000006e40 < (*.f64 x y) < 4.00000000000000005e-119

    1. Initial program 91.5%

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

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

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

      \[\leadsto \color{blue}{-4.5 \cdot \frac{t \cdot z}{a} + 0.5 \cdot \frac{x \cdot y}{a}} \]
    5. Taylor expanded in t around inf 77.6%

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

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

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

    if 2e-52 < (*.f64 x y) < 2.0000000000000001e26

    1. Initial program 99.8%

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

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

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

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

    if 2.0000000000000001e26 < (*.f64 x y)

    1. Initial program 91.5%

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

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

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

      \[\leadsto \color{blue}{-4.5 \cdot \frac{t \cdot z}{a} + 0.5 \cdot \frac{x \cdot y}{a}} \]
    5. Step-by-step derivation
      1. expm1-log1p-u49.6%

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

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

      \[\leadsto -4.5 \cdot \frac{t \cdot z}{a} + 0.5 \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(\frac{x \cdot y}{a}\right)} - 1\right)} \]
    7. Step-by-step derivation
      1. expm1-def49.6%

        \[\leadsto -4.5 \cdot \frac{t \cdot z}{a} + 0.5 \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{x \cdot y}{a}\right)\right)} \]
      2. expm1-log1p88.1%

        \[\leadsto -4.5 \cdot \frac{t \cdot z}{a} + 0.5 \cdot \color{blue}{\frac{x \cdot y}{a}} \]
      3. associate-/l*89.7%

        \[\leadsto -4.5 \cdot \frac{t \cdot z}{a} + 0.5 \cdot \color{blue}{\frac{x}{\frac{a}{y}}} \]
    8. Simplified89.7%

      \[\leadsto -4.5 \cdot \frac{t \cdot z}{a} + 0.5 \cdot \color{blue}{\frac{x}{\frac{a}{y}}} \]
    9. Taylor expanded in t around 0 82.9%

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

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

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

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

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

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

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

Alternative 6: 71.8% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{-52}:\\
\;\;\;\;t_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 x y) < -2.00000000000000006e40 or 4.00000000000000005e-119 < (*.f64 x y) < 2e-52

    1. Initial program 93.6%

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

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

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

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

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

        \[\leadsto -4.5 \cdot \frac{t \cdot z}{a} + 0.5 \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(\frac{x \cdot y}{a}\right)} - 1\right)} \]
    6. Applied egg-rr40.2%

      \[\leadsto -4.5 \cdot \frac{t \cdot z}{a} + 0.5 \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(\frac{x \cdot y}{a}\right)} - 1\right)} \]
    7. Step-by-step derivation
      1. expm1-def56.9%

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

        \[\leadsto -4.5 \cdot \frac{t \cdot z}{a} + 0.5 \cdot \color{blue}{\frac{x \cdot y}{a}} \]
      3. associate-/l*93.2%

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

      \[\leadsto -4.5 \cdot \frac{t \cdot z}{a} + 0.5 \cdot \color{blue}{\frac{x}{\frac{a}{y}}} \]
    9. Applied egg-rr91.3%

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

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

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

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

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

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

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

    if -2.00000000000000006e40 < (*.f64 x y) < 4.00000000000000005e-119

    1. Initial program 91.5%

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

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

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

      \[\leadsto \color{blue}{-4.5 \cdot \frac{t \cdot z}{a} + 0.5 \cdot \frac{x \cdot y}{a}} \]
    5. Taylor expanded in t around inf 77.6%

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

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

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

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

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

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

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

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

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

    if 2e-52 < (*.f64 x y) < 2.0000000000000001e26

    1. Initial program 99.8%

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

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

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

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

    if 2.0000000000000001e26 < (*.f64 x y)

    1. Initial program 91.5%

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

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

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

      \[\leadsto \color{blue}{-4.5 \cdot \frac{t \cdot z}{a} + 0.5 \cdot \frac{x \cdot y}{a}} \]
    5. Step-by-step derivation
      1. expm1-log1p-u49.6%

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

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

      \[\leadsto -4.5 \cdot \frac{t \cdot z}{a} + 0.5 \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(\frac{x \cdot y}{a}\right)} - 1\right)} \]
    7. Step-by-step derivation
      1. expm1-def49.6%

        \[\leadsto -4.5 \cdot \frac{t \cdot z}{a} + 0.5 \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{x \cdot y}{a}\right)\right)} \]
      2. expm1-log1p88.1%

        \[\leadsto -4.5 \cdot \frac{t \cdot z}{a} + 0.5 \cdot \color{blue}{\frac{x \cdot y}{a}} \]
      3. associate-/l*89.7%

        \[\leadsto -4.5 \cdot \frac{t \cdot z}{a} + 0.5 \cdot \color{blue}{\frac{x}{\frac{a}{y}}} \]
    8. Simplified89.7%

      \[\leadsto -4.5 \cdot \frac{t \cdot z}{a} + 0.5 \cdot \color{blue}{\frac{x}{\frac{a}{y}}} \]
    9. Taylor expanded in t around 0 82.9%

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

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

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

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

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

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

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

Alternative 7: 91.9% accurate, 0.6× speedup?

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

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


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

    1. Initial program 95.8%

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

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

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

    if 2.00000000000000006e-53 < (*.f64 a 2)

    1. Initial program 85.4%

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 71.1% accurate, 0.9× speedup?

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

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

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


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

    1. Initial program 92.2%

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

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

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

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

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

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

    if -2.00000000000000006e40 < (*.f64 x y) < 5.00000000000000006e-126

    1. Initial program 92.2%

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

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

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

      \[\leadsto \color{blue}{-4.5 \cdot \frac{t \cdot z}{a} + 0.5 \cdot \frac{x \cdot y}{a}} \]
    5. Taylor expanded in t around inf 78.9%

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

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

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

    if 5.00000000000000006e-126 < (*.f64 x y)

    1. Initial program 93.4%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+40}:\\ \;\;\;\;0.5 \cdot \frac{x}{\frac{a}{y}}\\ \mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{-126}:\\ \;\;\;\;-4.5 \cdot \frac{t}{\frac{a}{z}}\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \frac{x \cdot y}{a}\\ \end{array} \]

Alternative 9: 71.1% accurate, 0.9× speedup?

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

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

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


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

    1. Initial program 92.2%

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

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

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

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

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

        \[\leadsto -4.5 \cdot \frac{t \cdot z}{a} + 0.5 \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(\frac{x \cdot y}{a}\right)} - 1\right)} \]
    6. Applied egg-rr42.7%

      \[\leadsto -4.5 \cdot \frac{t \cdot z}{a} + 0.5 \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(\frac{x \cdot y}{a}\right)} - 1\right)} \]
    7. Step-by-step derivation
      1. expm1-def52.8%

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

        \[\leadsto -4.5 \cdot \frac{t \cdot z}{a} + 0.5 \cdot \color{blue}{\frac{x \cdot y}{a}} \]
      3. associate-/l*94.0%

        \[\leadsto -4.5 \cdot \frac{t \cdot z}{a} + 0.5 \cdot \color{blue}{\frac{x}{\frac{a}{y}}} \]
    8. Simplified94.0%

      \[\leadsto -4.5 \cdot \frac{t \cdot z}{a} + 0.5 \cdot \color{blue}{\frac{x}{\frac{a}{y}}} \]
    9. Applied egg-rr92.4%

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

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

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

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

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

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

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

    if -2.00000000000000006e40 < (*.f64 x y) < 5.00000000000000006e-126

    1. Initial program 92.2%

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

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

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

      \[\leadsto \color{blue}{-4.5 \cdot \frac{t \cdot z}{a} + 0.5 \cdot \frac{x \cdot y}{a}} \]
    5. Taylor expanded in t around inf 78.9%

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

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

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

    if 5.00000000000000006e-126 < (*.f64 x y)

    1. Initial program 93.4%

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

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

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

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

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

Alternative 10: 68.6% accurate, 1.2× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -6.6e78

    1. Initial program 83.2%

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

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

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

      \[\leadsto \color{blue}{-4.5 \cdot \frac{t \cdot z}{a} + 0.5 \cdot \frac{x \cdot y}{a}} \]
    5. Taylor expanded in t around inf 61.9%

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

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

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

    if -6.6e78 < z < 3.5000000000000001e-146

    1. Initial program 96.4%

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

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

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

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

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

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

    if 3.5000000000000001e-146 < z

    1. Initial program 92.3%

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

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

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

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

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

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

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

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

Alternative 11: 51.6% accurate, 1.9× speedup?

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

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

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

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

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

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

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

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

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

Developer target: 93.6% accurate, 0.7× speedup?

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

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

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

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


\end{array}
\end{array}

Reproduce

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

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

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