Statistics.Math.RootFinding:ridders from math-functions-0.1.5.2

Percentage Accurate: 61.0% → 89.9%
Time: 23.0s
Alternatives: 18
Speedup: 18.6×

Specification

?
\[\begin{array}{l} \\ \frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (/ (* (* x y) z) (sqrt (- (* z z) (* t a)))))
double code(double x, double y, double z, double t, double a) {
	return ((x * y) * z) / sqrt(((z * z) - (t * a)));
}
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) / sqrt(((z * z) - (t * a)))
end function
public static double code(double x, double y, double z, double t, double a) {
	return ((x * y) * z) / Math.sqrt(((z * z) - (t * a)));
}
def code(x, y, z, t, a):
	return ((x * y) * z) / math.sqrt(((z * z) - (t * a)))
function code(x, y, z, t, a)
	return Float64(Float64(Float64(x * y) * z) / sqrt(Float64(Float64(z * z) - Float64(t * a))))
end
function tmp = code(x, y, z, t, a)
	tmp = ((x * y) * z) / sqrt(((z * z) - (t * a)));
end
code[x_, y_, z_, t_, a_] := N[(N[(N[(x * y), $MachinePrecision] * z), $MachinePrecision] / N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}
\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 18 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: 61.0% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (/ (* (* x y) z) (sqrt (- (* z z) (* t a)))))
double code(double x, double y, double z, double t, double a) {
	return ((x * y) * z) / sqrt(((z * z) - (t * a)));
}
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) / sqrt(((z * z) - (t * a)))
end function
public static double code(double x, double y, double z, double t, double a) {
	return ((x * y) * z) / Math.sqrt(((z * z) - (t * a)));
}
def code(x, y, z, t, a):
	return ((x * y) * z) / math.sqrt(((z * z) - (t * a)))
function code(x, y, z, t, a)
	return Float64(Float64(Float64(x * y) * z) / sqrt(Float64(Float64(z * z) - Float64(t * a))))
end
function tmp = code(x, y, z, t, a)
	tmp = ((x * y) * z) / sqrt(((z * z) - (t * a)));
end
code[x_, y_, z_, t_, a_] := N[(N[(N[(x * y), $MachinePrecision] * z), $MachinePrecision] / N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

Alternative 1: 89.9% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -6 \cdot 10^{+72}:\\ \;\;\;\;\frac{x \cdot y}{\mathsf{fma}\left(0.5, \frac{a}{\frac{{z}^{2}}{t}}, -1\right)}\\ \mathbf{elif}\;z \leq 1.35 \cdot 10^{+37}:\\ \;\;\;\;\frac{z \cdot \left(x \cdot y\right)}{\sqrt{z \cdot z - a \cdot t}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= z -6e+72)
   (/ (* x y) (fma 0.5 (/ a (/ (pow z 2.0) t)) -1.0))
   (if (<= z 1.35e+37) (/ (* z (* x y)) (sqrt (- (* z z) (* a t)))) (* x y))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -6e+72) {
		tmp = (x * y) / fma(0.5, (a / (pow(z, 2.0) / t)), -1.0);
	} else if (z <= 1.35e+37) {
		tmp = (z * (x * y)) / sqrt(((z * z) - (a * t)));
	} else {
		tmp = x * y;
	}
	return tmp;
}
function code(x, y, z, t, a)
	tmp = 0.0
	if (z <= -6e+72)
		tmp = Float64(Float64(x * y) / fma(0.5, Float64(a / Float64((z ^ 2.0) / t)), -1.0));
	elseif (z <= 1.35e+37)
		tmp = Float64(Float64(z * Float64(x * y)) / sqrt(Float64(Float64(z * z) - Float64(a * t))));
	else
		tmp = Float64(x * y);
	end
	return tmp
end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -6e+72], N[(N[(x * y), $MachinePrecision] / N[(0.5 * N[(a / N[(N[Power[z, 2.0], $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.35e+37], N[(N[(z * N[(x * y), $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -6 \cdot 10^{+72}:\\
\;\;\;\;\frac{x \cdot y}{\mathsf{fma}\left(0.5, \frac{a}{\frac{{z}^{2}}{t}}, -1\right)}\\

\mathbf{elif}\;z \leq 1.35 \cdot 10^{+37}:\\
\;\;\;\;\frac{z \cdot \left(x \cdot y\right)}{\sqrt{z \cdot z - a \cdot t}}\\

\mathbf{else}:\\
\;\;\;\;x \cdot y\\


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

    1. Initial program 27.7%

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

        \[\leadsto \color{blue}{\frac{x \cdot y}{\frac{\sqrt{z \cdot z - t \cdot a}}{z}}} \]
    3. Simplified36.7%

      \[\leadsto \color{blue}{\frac{x \cdot y}{\frac{\sqrt{z \cdot z - t \cdot a}}{z}}} \]
    4. Taylor expanded in z around -inf 92.7%

      \[\leadsto \frac{x \cdot y}{\color{blue}{0.5 \cdot \frac{a \cdot t}{{z}^{2}} - 1}} \]
    5. Step-by-step derivation
      1. fma-neg92.7%

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

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

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

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

    if -6.00000000000000006e72 < z < 1.34999999999999993e37

    1. Initial program 91.2%

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

    if 1.34999999999999993e37 < z

    1. Initial program 53.4%

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

        \[\leadsto \color{blue}{\frac{x \cdot y}{\sqrt{z \cdot z - t \cdot a}} \cdot z} \]
      2. *-commutative53.5%

        \[\leadsto \frac{\color{blue}{y \cdot x}}{\sqrt{z \cdot z - t \cdot a}} \cdot z \]
      3. associate-*l/52.3%

        \[\leadsto \color{blue}{\left(\frac{y}{\sqrt{z \cdot z - t \cdot a}} \cdot x\right)} \cdot z \]
      4. associate-*r*51.4%

        \[\leadsto \color{blue}{\frac{y}{\sqrt{z \cdot z - t \cdot a}} \cdot \left(x \cdot z\right)} \]
      5. sub-neg51.4%

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

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

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

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

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

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

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

Alternative 2: 90.0% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -2 \cdot 10^{+83}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{elif}\;z \leq 1.35 \cdot 10^{+37}:\\ \;\;\;\;z \cdot \frac{x \cdot y}{\sqrt{z \cdot z - a \cdot t}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= z -2e+83)
   (* y (- x))
   (if (<= z 1.35e+37) (* z (/ (* x y) (sqrt (- (* z z) (* a t))))) (* x y))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -2e+83) {
		tmp = y * -x;
	} else if (z <= 1.35e+37) {
		tmp = z * ((x * y) / sqrt(((z * z) - (a * t))));
	} else {
		tmp = x * y;
	}
	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 (z <= (-2d+83)) then
        tmp = y * -x
    else if (z <= 1.35d+37) then
        tmp = z * ((x * y) / sqrt(((z * z) - (a * t))))
    else
        tmp = x * y
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -2e+83) {
		tmp = y * -x;
	} else if (z <= 1.35e+37) {
		tmp = z * ((x * y) / Math.sqrt(((z * z) - (a * t))));
	} else {
		tmp = x * y;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if z <= -2e+83:
		tmp = y * -x
	elif z <= 1.35e+37:
		tmp = z * ((x * y) / math.sqrt(((z * z) - (a * t))))
	else:
		tmp = x * y
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (z <= -2e+83)
		tmp = Float64(y * Float64(-x));
	elseif (z <= 1.35e+37)
		tmp = Float64(z * Float64(Float64(x * y) / sqrt(Float64(Float64(z * z) - Float64(a * t)))));
	else
		tmp = Float64(x * y);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (z <= -2e+83)
		tmp = y * -x;
	elseif (z <= 1.35e+37)
		tmp = z * ((x * y) / sqrt(((z * z) - (a * t))));
	else
		tmp = x * y;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2e+83], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 1.35e+37], N[(z * N[(N[(x * y), $MachinePrecision] / N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2 \cdot 10^{+83}:\\
\;\;\;\;y \cdot \left(-x\right)\\

\mathbf{elif}\;z \leq 1.35 \cdot 10^{+37}:\\
\;\;\;\;z \cdot \frac{x \cdot y}{\sqrt{z \cdot z - a \cdot t}}\\

\mathbf{else}:\\
\;\;\;\;x \cdot y\\


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

    1. Initial program 26.6%

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

        \[\leadsto \color{blue}{\frac{x \cdot y}{\sqrt{z \cdot z - t \cdot a}} \cdot z} \]
      2. *-commutative30.6%

        \[\leadsto \frac{\color{blue}{y \cdot x}}{\sqrt{z \cdot z - t \cdot a}} \cdot z \]
      3. associate-*l/29.0%

        \[\leadsto \color{blue}{\left(\frac{y}{\sqrt{z \cdot z - t \cdot a}} \cdot x\right)} \cdot z \]
      4. associate-*r*24.8%

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \left(x \cdot y\right)} \]
    5. Step-by-step derivation
      1. *-commutative96.4%

        \[\leadsto -1 \cdot \color{blue}{\left(y \cdot x\right)} \]
      2. mul-1-neg96.4%

        \[\leadsto \color{blue}{-y \cdot x} \]
      3. *-commutative96.4%

        \[\leadsto -\color{blue}{x \cdot y} \]
    6. Simplified96.4%

      \[\leadsto \color{blue}{-x \cdot y} \]

    if -2.00000000000000006e83 < z < 1.34999999999999993e37

    1. Initial program 90.7%

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

        \[\leadsto \color{blue}{\frac{x \cdot y}{\sqrt{z \cdot z - t \cdot a}} \cdot z} \]
    3. Simplified90.1%

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

    if 1.34999999999999993e37 < z

    1. Initial program 53.4%

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

        \[\leadsto \color{blue}{\frac{x \cdot y}{\sqrt{z \cdot z - t \cdot a}} \cdot z} \]
      2. *-commutative53.5%

        \[\leadsto \frac{\color{blue}{y \cdot x}}{\sqrt{z \cdot z - t \cdot a}} \cdot z \]
      3. associate-*l/52.3%

        \[\leadsto \color{blue}{\left(\frac{y}{\sqrt{z \cdot z - t \cdot a}} \cdot x\right)} \cdot z \]
      4. associate-*r*51.4%

        \[\leadsto \color{blue}{\frac{y}{\sqrt{z \cdot z - t \cdot a}} \cdot \left(x \cdot z\right)} \]
      5. sub-neg51.4%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2 \cdot 10^{+83}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{elif}\;z \leq 1.35 \cdot 10^{+37}:\\ \;\;\;\;z \cdot \frac{x \cdot y}{\sqrt{z \cdot z - a \cdot t}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \]

Alternative 3: 89.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -2.15 \cdot 10^{+74}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{elif}\;z \leq 1.25 \cdot 10^{+37}:\\ \;\;\;\;\frac{z \cdot \left(x \cdot y\right)}{\sqrt{z \cdot z - a \cdot t}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= z -2.15e+74)
   (* y (- x))
   (if (<= z 1.25e+37) (/ (* z (* x y)) (sqrt (- (* z z) (* a t)))) (* x y))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -2.15e+74) {
		tmp = y * -x;
	} else if (z <= 1.25e+37) {
		tmp = (z * (x * y)) / sqrt(((z * z) - (a * t)));
	} else {
		tmp = x * y;
	}
	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 (z <= (-2.15d+74)) then
        tmp = y * -x
    else if (z <= 1.25d+37) then
        tmp = (z * (x * y)) / sqrt(((z * z) - (a * t)))
    else
        tmp = x * y
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -2.15e+74) {
		tmp = y * -x;
	} else if (z <= 1.25e+37) {
		tmp = (z * (x * y)) / Math.sqrt(((z * z) - (a * t)));
	} else {
		tmp = x * y;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if z <= -2.15e+74:
		tmp = y * -x
	elif z <= 1.25e+37:
		tmp = (z * (x * y)) / math.sqrt(((z * z) - (a * t)))
	else:
		tmp = x * y
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (z <= -2.15e+74)
		tmp = Float64(y * Float64(-x));
	elseif (z <= 1.25e+37)
		tmp = Float64(Float64(z * Float64(x * y)) / sqrt(Float64(Float64(z * z) - Float64(a * t))));
	else
		tmp = Float64(x * y);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (z <= -2.15e+74)
		tmp = y * -x;
	elseif (z <= 1.25e+37)
		tmp = (z * (x * y)) / sqrt(((z * z) - (a * t)));
	else
		tmp = x * y;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.15e+74], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 1.25e+37], N[(N[(z * N[(x * y), $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.15 \cdot 10^{+74}:\\
\;\;\;\;y \cdot \left(-x\right)\\

\mathbf{elif}\;z \leq 1.25 \cdot 10^{+37}:\\
\;\;\;\;\frac{z \cdot \left(x \cdot y\right)}{\sqrt{z \cdot z - a \cdot t}}\\

\mathbf{else}:\\
\;\;\;\;x \cdot y\\


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

    1. Initial program 27.7%

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

        \[\leadsto \color{blue}{\frac{x \cdot y}{\sqrt{z \cdot z - t \cdot a}} \cdot z} \]
      2. *-commutative33.2%

        \[\leadsto \frac{\color{blue}{y \cdot x}}{\sqrt{z \cdot z - t \cdot a}} \cdot z \]
      3. associate-*l/31.6%

        \[\leadsto \color{blue}{\left(\frac{y}{\sqrt{z \cdot z - t \cdot a}} \cdot x\right)} \cdot z \]
      4. associate-*r*27.5%

        \[\leadsto \color{blue}{\frac{y}{\sqrt{z \cdot z - t \cdot a}} \cdot \left(x \cdot z\right)} \]
      5. sub-neg27.5%

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

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

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

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

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

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

        \[\leadsto -1 \cdot \color{blue}{\left(y \cdot x\right)} \]
      2. mul-1-neg96.5%

        \[\leadsto \color{blue}{-y \cdot x} \]
      3. *-commutative96.5%

        \[\leadsto -\color{blue}{x \cdot y} \]
    6. Simplified96.5%

      \[\leadsto \color{blue}{-x \cdot y} \]

    if -2.15e74 < z < 1.24999999999999997e37

    1. Initial program 91.2%

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

    if 1.24999999999999997e37 < z

    1. Initial program 53.4%

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

        \[\leadsto \color{blue}{\frac{x \cdot y}{\sqrt{z \cdot z - t \cdot a}} \cdot z} \]
      2. *-commutative53.5%

        \[\leadsto \frac{\color{blue}{y \cdot x}}{\sqrt{z \cdot z - t \cdot a}} \cdot z \]
      3. associate-*l/52.3%

        \[\leadsto \color{blue}{\left(\frac{y}{\sqrt{z \cdot z - t \cdot a}} \cdot x\right)} \cdot z \]
      4. associate-*r*51.4%

        \[\leadsto \color{blue}{\frac{y}{\sqrt{z \cdot z - t \cdot a}} \cdot \left(x \cdot z\right)} \]
      5. sub-neg51.4%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.15 \cdot 10^{+74}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{elif}\;z \leq 1.25 \cdot 10^{+37}:\\ \;\;\;\;\frac{z \cdot \left(x \cdot y\right)}{\sqrt{z \cdot z - a \cdot t}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \]

Alternative 4: 81.1% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -4.3 \cdot 10^{-32}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{elif}\;z \leq 8.2 \cdot 10^{+20}:\\ \;\;\;\;{\left(a \cdot \left(-t\right)\right)}^{-0.5} \cdot \left(x \cdot \left(z \cdot y\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= z -4.3e-32)
   (* y (- x))
   (if (<= z 8.2e+20) (* (pow (* a (- t)) -0.5) (* x (* z y))) (* x y))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -4.3e-32) {
		tmp = y * -x;
	} else if (z <= 8.2e+20) {
		tmp = pow((a * -t), -0.5) * (x * (z * y));
	} else {
		tmp = x * y;
	}
	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 (z <= (-4.3d-32)) then
        tmp = y * -x
    else if (z <= 8.2d+20) then
        tmp = ((a * -t) ** (-0.5d0)) * (x * (z * y))
    else
        tmp = x * y
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -4.3e-32) {
		tmp = y * -x;
	} else if (z <= 8.2e+20) {
		tmp = Math.pow((a * -t), -0.5) * (x * (z * y));
	} else {
		tmp = x * y;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if z <= -4.3e-32:
		tmp = y * -x
	elif z <= 8.2e+20:
		tmp = math.pow((a * -t), -0.5) * (x * (z * y))
	else:
		tmp = x * y
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (z <= -4.3e-32)
		tmp = Float64(y * Float64(-x));
	elseif (z <= 8.2e+20)
		tmp = Float64((Float64(a * Float64(-t)) ^ -0.5) * Float64(x * Float64(z * y)));
	else
		tmp = Float64(x * y);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (z <= -4.3e-32)
		tmp = y * -x;
	elseif (z <= 8.2e+20)
		tmp = ((a * -t) ^ -0.5) * (x * (z * y));
	else
		tmp = x * y;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -4.3e-32], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 8.2e+20], N[(N[Power[N[(a * (-t)), $MachinePrecision], -0.5], $MachinePrecision] * N[(x * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.3 \cdot 10^{-32}:\\
\;\;\;\;y \cdot \left(-x\right)\\

\mathbf{elif}\;z \leq 8.2 \cdot 10^{+20}:\\
\;\;\;\;{\left(a \cdot \left(-t\right)\right)}^{-0.5} \cdot \left(x \cdot \left(z \cdot y\right)\right)\\

\mathbf{else}:\\
\;\;\;\;x \cdot y\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -4.2999999999999999e-32

    1. Initial program 50.6%

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

        \[\leadsto \color{blue}{\frac{x \cdot y}{\sqrt{z \cdot z - t \cdot a}} \cdot z} \]
      2. *-commutative54.2%

        \[\leadsto \frac{\color{blue}{y \cdot x}}{\sqrt{z \cdot z - t \cdot a}} \cdot z \]
      3. associate-*l/53.1%

        \[\leadsto \color{blue}{\left(\frac{y}{\sqrt{z \cdot z - t \cdot a}} \cdot x\right)} \cdot z \]
      4. associate-*r*50.3%

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \left(x \cdot y\right)} \]
    5. Step-by-step derivation
      1. *-commutative93.6%

        \[\leadsto -1 \cdot \color{blue}{\left(y \cdot x\right)} \]
      2. mul-1-neg93.6%

        \[\leadsto \color{blue}{-y \cdot x} \]
      3. *-commutative93.6%

        \[\leadsto -\color{blue}{x \cdot y} \]
    6. Simplified93.6%

      \[\leadsto \color{blue}{-x \cdot y} \]

    if -4.2999999999999999e-32 < z < 8.2e20

    1. Initial program 89.2%

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

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

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

        \[\leadsto \color{blue}{\frac{1}{\sqrt{z \cdot z - t \cdot a}} \cdot \left(x \cdot \left(y \cdot z\right)\right)} \]
      3. pow1/286.9%

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

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

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

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

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

      \[\leadsto \color{blue}{{\left({z}^{2} - t \cdot a\right)}^{-0.5} \cdot \left(x \cdot \left(z \cdot y\right)\right)} \]
    5. Taylor expanded in z around 0 75.5%

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

        \[\leadsto {\color{blue}{\left(\left(-1 \cdot a\right) \cdot t\right)}}^{-0.5} \cdot \left(x \cdot \left(z \cdot y\right)\right) \]
      2. mul-1-neg75.5%

        \[\leadsto {\left(\color{blue}{\left(-a\right)} \cdot t\right)}^{-0.5} \cdot \left(x \cdot \left(z \cdot y\right)\right) \]
      3. *-commutative75.5%

        \[\leadsto {\color{blue}{\left(t \cdot \left(-a\right)\right)}}^{-0.5} \cdot \left(x \cdot \left(z \cdot y\right)\right) \]
    7. Simplified75.5%

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

    if 8.2e20 < z

    1. Initial program 56.7%

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

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

        \[\leadsto \frac{\color{blue}{y \cdot x}}{\sqrt{z \cdot z - t \cdot a}} \cdot z \]
      3. associate-*l/55.7%

        \[\leadsto \color{blue}{\left(\frac{y}{\sqrt{z \cdot z - t \cdot a}} \cdot x\right)} \cdot z \]
      4. associate-*r*53.7%

        \[\leadsto \color{blue}{\frac{y}{\sqrt{z \cdot z - t \cdot a}} \cdot \left(x \cdot z\right)} \]
      5. sub-neg53.7%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.3 \cdot 10^{-32}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{elif}\;z \leq 8.2 \cdot 10^{+20}:\\ \;\;\;\;{\left(a \cdot \left(-t\right)\right)}^{-0.5} \cdot \left(x \cdot \left(z \cdot y\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \]

Alternative 5: 80.7% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -6.8 \cdot 10^{-31}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{elif}\;z \leq 8 \cdot 10^{+20}:\\ \;\;\;\;\frac{y}{\sqrt{a \cdot \left(-t\right)}} \cdot \left(z \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= z -6.8e-31)
   (* y (- x))
   (if (<= z 8e+20) (* (/ y (sqrt (* a (- t)))) (* z x)) (* x y))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -6.8e-31) {
		tmp = y * -x;
	} else if (z <= 8e+20) {
		tmp = (y / sqrt((a * -t))) * (z * x);
	} else {
		tmp = x * y;
	}
	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 (z <= (-6.8d-31)) then
        tmp = y * -x
    else if (z <= 8d+20) then
        tmp = (y / sqrt((a * -t))) * (z * x)
    else
        tmp = x * y
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -6.8e-31) {
		tmp = y * -x;
	} else if (z <= 8e+20) {
		tmp = (y / Math.sqrt((a * -t))) * (z * x);
	} else {
		tmp = x * y;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if z <= -6.8e-31:
		tmp = y * -x
	elif z <= 8e+20:
		tmp = (y / math.sqrt((a * -t))) * (z * x)
	else:
		tmp = x * y
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (z <= -6.8e-31)
		tmp = Float64(y * Float64(-x));
	elseif (z <= 8e+20)
		tmp = Float64(Float64(y / sqrt(Float64(a * Float64(-t)))) * Float64(z * x));
	else
		tmp = Float64(x * y);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (z <= -6.8e-31)
		tmp = y * -x;
	elseif (z <= 8e+20)
		tmp = (y / sqrt((a * -t))) * (z * x);
	else
		tmp = x * y;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -6.8e-31], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 8e+20], N[(N[(y / N[Sqrt[N[(a * (-t)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(z * x), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.8 \cdot 10^{-31}:\\
\;\;\;\;y \cdot \left(-x\right)\\

\mathbf{elif}\;z \leq 8 \cdot 10^{+20}:\\
\;\;\;\;\frac{y}{\sqrt{a \cdot \left(-t\right)}} \cdot \left(z \cdot x\right)\\

\mathbf{else}:\\
\;\;\;\;x \cdot y\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -6.8000000000000002e-31

    1. Initial program 50.6%

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

        \[\leadsto \color{blue}{\frac{x \cdot y}{\sqrt{z \cdot z - t \cdot a}} \cdot z} \]
      2. *-commutative54.2%

        \[\leadsto \frac{\color{blue}{y \cdot x}}{\sqrt{z \cdot z - t \cdot a}} \cdot z \]
      3. associate-*l/53.1%

        \[\leadsto \color{blue}{\left(\frac{y}{\sqrt{z \cdot z - t \cdot a}} \cdot x\right)} \cdot z \]
      4. associate-*r*50.3%

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \left(x \cdot y\right)} \]
    5. Step-by-step derivation
      1. *-commutative93.6%

        \[\leadsto -1 \cdot \color{blue}{\left(y \cdot x\right)} \]
      2. mul-1-neg93.6%

        \[\leadsto \color{blue}{-y \cdot x} \]
      3. *-commutative93.6%

        \[\leadsto -\color{blue}{x \cdot y} \]
    6. Simplified93.6%

      \[\leadsto \color{blue}{-x \cdot y} \]

    if -6.8000000000000002e-31 < z < 8e20

    1. Initial program 89.2%

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

        \[\leadsto \color{blue}{\frac{x \cdot y}{\sqrt{z \cdot z - t \cdot a}} \cdot z} \]
      2. *-commutative87.4%

        \[\leadsto \frac{\color{blue}{y \cdot x}}{\sqrt{z \cdot z - t \cdot a}} \cdot z \]
      3. associate-*l/87.4%

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

        \[\leadsto \color{blue}{\frac{y}{\sqrt{z \cdot z - t \cdot a}} \cdot \left(x \cdot z\right)} \]
      5. sub-neg85.4%

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

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

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

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

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

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

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

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

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

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

    if 8e20 < z

    1. Initial program 56.7%

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

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

        \[\leadsto \frac{\color{blue}{y \cdot x}}{\sqrt{z \cdot z - t \cdot a}} \cdot z \]
      3. associate-*l/55.7%

        \[\leadsto \color{blue}{\left(\frac{y}{\sqrt{z \cdot z - t \cdot a}} \cdot x\right)} \cdot z \]
      4. associate-*r*53.7%

        \[\leadsto \color{blue}{\frac{y}{\sqrt{z \cdot z - t \cdot a}} \cdot \left(x \cdot z\right)} \]
      5. sub-neg53.7%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -6.8 \cdot 10^{-31}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{elif}\;z \leq 8 \cdot 10^{+20}:\\ \;\;\;\;\frac{y}{\sqrt{a \cdot \left(-t\right)}} \cdot \left(z \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \]

Alternative 6: 77.5% accurate, 5.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.9 \cdot 10^{+48}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{elif}\;z \leq 4.8 \cdot 10^{-172}:\\ \;\;\;\;\frac{y}{z - 0.5 \cdot \frac{t}{\frac{z}{a}}} \cdot \left(z \cdot \left(-x\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= z -1.9e+48)
   (* y (- x))
   (if (<= z 4.8e-172)
     (* (/ y (- z (* 0.5 (/ t (/ z a))))) (* z (- x)))
     (* x y))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -1.9e+48) {
		tmp = y * -x;
	} else if (z <= 4.8e-172) {
		tmp = (y / (z - (0.5 * (t / (z / a))))) * (z * -x);
	} else {
		tmp = x * y;
	}
	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 (z <= (-1.9d+48)) then
        tmp = y * -x
    else if (z <= 4.8d-172) then
        tmp = (y / (z - (0.5d0 * (t / (z / a))))) * (z * -x)
    else
        tmp = x * y
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -1.9e+48) {
		tmp = y * -x;
	} else if (z <= 4.8e-172) {
		tmp = (y / (z - (0.5 * (t / (z / a))))) * (z * -x);
	} else {
		tmp = x * y;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if z <= -1.9e+48:
		tmp = y * -x
	elif z <= 4.8e-172:
		tmp = (y / (z - (0.5 * (t / (z / a))))) * (z * -x)
	else:
		tmp = x * y
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (z <= -1.9e+48)
		tmp = Float64(y * Float64(-x));
	elseif (z <= 4.8e-172)
		tmp = Float64(Float64(y / Float64(z - Float64(0.5 * Float64(t / Float64(z / a))))) * Float64(z * Float64(-x)));
	else
		tmp = Float64(x * y);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (z <= -1.9e+48)
		tmp = y * -x;
	elseif (z <= 4.8e-172)
		tmp = (y / (z - (0.5 * (t / (z / a))))) * (z * -x);
	else
		tmp = x * y;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.9e+48], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 4.8e-172], N[(N[(y / N[(z - N[(0.5 * N[(t / N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(z * (-x)), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.9 \cdot 10^{+48}:\\
\;\;\;\;y \cdot \left(-x\right)\\

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

\mathbf{else}:\\
\;\;\;\;x \cdot y\\


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

    1. Initial program 31.5%

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

        \[\leadsto \color{blue}{\frac{x \cdot y}{\sqrt{z \cdot z - t \cdot a}} \cdot z} \]
      2. *-commutative36.7%

        \[\leadsto \frac{\color{blue}{y \cdot x}}{\sqrt{z \cdot z - t \cdot a}} \cdot z \]
      3. associate-*l/35.1%

        \[\leadsto \color{blue}{\left(\frac{y}{\sqrt{z \cdot z - t \cdot a}} \cdot x\right)} \cdot z \]
      4. associate-*r*31.3%

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \left(x \cdot y\right)} \]
    5. Step-by-step derivation
      1. *-commutative96.7%

        \[\leadsto -1 \cdot \color{blue}{\left(y \cdot x\right)} \]
      2. mul-1-neg96.7%

        \[\leadsto \color{blue}{-y \cdot x} \]
      3. *-commutative96.7%

        \[\leadsto -\color{blue}{x \cdot y} \]
    6. Simplified96.7%

      \[\leadsto \color{blue}{-x \cdot y} \]

    if -1.9e48 < z < 4.8000000000000002e-172

    1. Initial program 89.1%

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

        \[\leadsto \color{blue}{\frac{x \cdot y}{\sqrt{z \cdot z - t \cdot a}} \cdot z} \]
      2. *-commutative89.3%

        \[\leadsto \frac{\color{blue}{y \cdot x}}{\sqrt{z \cdot z - t \cdot a}} \cdot z \]
      3. associate-*l/89.4%

        \[\leadsto \color{blue}{\left(\frac{y}{\sqrt{z \cdot z - t \cdot a}} \cdot x\right)} \cdot z \]
      4. associate-*r*84.5%

        \[\leadsto \color{blue}{\frac{y}{\sqrt{z \cdot z - t \cdot a}} \cdot \left(x \cdot z\right)} \]
      5. sub-neg84.5%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{y}{-1 \cdot z + 0.5 \cdot \left(t \cdot \left(a \cdot \frac{-1}{\color{blue}{-1 \cdot z}}\right)\right)} \cdot \left(x \cdot z\right) \]
      7. add-sqr-sqrt45.0%

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

        \[\leadsto \frac{y}{-1 \cdot z + 0.5 \cdot \left(t \cdot \left(a \cdot \frac{-1}{\color{blue}{\sqrt{\left(-1 \cdot z\right) \cdot \left(-1 \cdot z\right)}}}\right)\right)} \cdot \left(x \cdot z\right) \]
      9. mul-1-neg53.3%

        \[\leadsto \frac{y}{-1 \cdot z + 0.5 \cdot \left(t \cdot \left(a \cdot \frac{-1}{\sqrt{\color{blue}{\left(-z\right)} \cdot \left(-1 \cdot z\right)}}\right)\right)} \cdot \left(x \cdot z\right) \]
      10. mul-1-neg53.3%

        \[\leadsto \frac{y}{-1 \cdot z + 0.5 \cdot \left(t \cdot \left(a \cdot \frac{-1}{\sqrt{\left(-z\right) \cdot \color{blue}{\left(-z\right)}}}\right)\right)} \cdot \left(x \cdot z\right) \]
      11. sqr-neg53.3%

        \[\leadsto \frac{y}{-1 \cdot z + 0.5 \cdot \left(t \cdot \left(a \cdot \frac{-1}{\sqrt{\color{blue}{z \cdot z}}}\right)\right)} \cdot \left(x \cdot z\right) \]
      12. sqrt-prod11.6%

        \[\leadsto \frac{y}{-1 \cdot z + 0.5 \cdot \left(t \cdot \left(a \cdot \frac{-1}{\color{blue}{\sqrt{z} \cdot \sqrt{z}}}\right)\right)} \cdot \left(x \cdot z\right) \]
      13. add-sqr-sqrt54.4%

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

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

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

        \[\leadsto \frac{\color{blue}{0 - y}}{-\left(-1 \cdot z + 0.5 \cdot \left(t \cdot \left(a \cdot \frac{-1}{z}\right)\right)\right)} \cdot \left(x \cdot z\right) \]
      3. div-sub54.4%

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

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

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

        \[\leadsto \color{blue}{\left(-\frac{y}{z - \frac{a}{z} \cdot \left(t \cdot 0.5\right)}\right)} \cdot \left(x \cdot z\right) \]
      3. distribute-neg-frac55.4%

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

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

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

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

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

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

    if 4.8000000000000002e-172 < z

    1. Initial program 65.5%

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

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

        \[\leadsto \frac{\color{blue}{y \cdot x}}{\sqrt{z \cdot z - t \cdot a}} \cdot z \]
      3. associate-*l/63.0%

        \[\leadsto \color{blue}{\left(\frac{y}{\sqrt{z \cdot z - t \cdot a}} \cdot x\right)} \cdot z \]
      4. associate-*r*63.9%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.9 \cdot 10^{+48}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{elif}\;z \leq 4.8 \cdot 10^{-172}:\\ \;\;\;\;\frac{y}{z - 0.5 \cdot \frac{t}{\frac{z}{a}}} \cdot \left(z \cdot \left(-x\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \]

Alternative 7: 76.3% accurate, 5.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -3 \cdot 10^{-91}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{elif}\;z \leq 2.2 \cdot 10^{-58}:\\ \;\;\;\;\left(z \cdot x\right) \cdot \frac{y}{z + -0.5 \cdot \frac{a}{\frac{z}{t}}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= z -3e-91)
   (* y (- x))
   (if (<= z 2.2e-58) (* (* z x) (/ y (+ z (* -0.5 (/ a (/ z t)))))) (* x y))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -3e-91) {
		tmp = y * -x;
	} else if (z <= 2.2e-58) {
		tmp = (z * x) * (y / (z + (-0.5 * (a / (z / t)))));
	} else {
		tmp = x * y;
	}
	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 (z <= (-3d-91)) then
        tmp = y * -x
    else if (z <= 2.2d-58) then
        tmp = (z * x) * (y / (z + ((-0.5d0) * (a / (z / t)))))
    else
        tmp = x * y
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -3e-91) {
		tmp = y * -x;
	} else if (z <= 2.2e-58) {
		tmp = (z * x) * (y / (z + (-0.5 * (a / (z / t)))));
	} else {
		tmp = x * y;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if z <= -3e-91:
		tmp = y * -x
	elif z <= 2.2e-58:
		tmp = (z * x) * (y / (z + (-0.5 * (a / (z / t)))))
	else:
		tmp = x * y
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (z <= -3e-91)
		tmp = Float64(y * Float64(-x));
	elseif (z <= 2.2e-58)
		tmp = Float64(Float64(z * x) * Float64(y / Float64(z + Float64(-0.5 * Float64(a / Float64(z / t))))));
	else
		tmp = Float64(x * y);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (z <= -3e-91)
		tmp = y * -x;
	elseif (z <= 2.2e-58)
		tmp = (z * x) * (y / (z + (-0.5 * (a / (z / t)))));
	else
		tmp = x * y;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3e-91], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 2.2e-58], N[(N[(z * x), $MachinePrecision] * N[(y / N[(z + N[(-0.5 * N[(a / N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -3 \cdot 10^{-91}:\\
\;\;\;\;y \cdot \left(-x\right)\\

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

\mathbf{else}:\\
\;\;\;\;x \cdot y\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -3.0000000000000002e-91

    1. Initial program 53.4%

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

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

        \[\leadsto \frac{\color{blue}{y \cdot x}}{\sqrt{z \cdot z - t \cdot a}} \cdot z \]
      3. associate-*l/56.1%

        \[\leadsto \color{blue}{\left(\frac{y}{\sqrt{z \cdot z - t \cdot a}} \cdot x\right)} \cdot z \]
      4. associate-*r*54.0%

        \[\leadsto \color{blue}{\frac{y}{\sqrt{z \cdot z - t \cdot a}} \cdot \left(x \cdot z\right)} \]
      5. sub-neg54.0%

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \left(x \cdot y\right)} \]
    5. Step-by-step derivation
      1. *-commutative85.4%

        \[\leadsto -1 \cdot \color{blue}{\left(y \cdot x\right)} \]
      2. mul-1-neg85.4%

        \[\leadsto \color{blue}{-y \cdot x} \]
      3. *-commutative85.4%

        \[\leadsto -\color{blue}{x \cdot y} \]
    6. Simplified85.4%

      \[\leadsto \color{blue}{-x \cdot y} \]

    if -3.0000000000000002e-91 < z < 2.20000000000000006e-58

    1. Initial program 90.5%

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

        \[\leadsto \color{blue}{\frac{x \cdot y}{\sqrt{z \cdot z - t \cdot a}} \cdot z} \]
      2. *-commutative87.4%

        \[\leadsto \frac{\color{blue}{y \cdot x}}{\sqrt{z \cdot z - t \cdot a}} \cdot z \]
      3. associate-*l/87.4%

        \[\leadsto \color{blue}{\left(\frac{y}{\sqrt{z \cdot z - t \cdot a}} \cdot x\right)} \cdot z \]
      4. associate-*r*84.5%

        \[\leadsto \color{blue}{\frac{y}{\sqrt{z \cdot z - t \cdot a}} \cdot \left(x \cdot z\right)} \]
      5. sub-neg84.5%

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

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

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

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

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

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

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

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

    if 2.20000000000000006e-58 < z

    1. Initial program 61.7%

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

        \[\leadsto \color{blue}{\frac{x \cdot y}{\sqrt{z \cdot z - t \cdot a}} \cdot z} \]
      2. *-commutative61.8%

        \[\leadsto \frac{\color{blue}{y \cdot x}}{\sqrt{z \cdot z - t \cdot a}} \cdot z \]
      3. associate-*l/60.9%

        \[\leadsto \color{blue}{\left(\frac{y}{\sqrt{z \cdot z - t \cdot a}} \cdot x\right)} \cdot z \]
      4. associate-*r*58.9%

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

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

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

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

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

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

      \[\leadsto \color{blue}{x \cdot y} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification77.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3 \cdot 10^{-91}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{elif}\;z \leq 2.2 \cdot 10^{-58}:\\ \;\;\;\;\left(z \cdot x\right) \cdot \frac{y}{z + -0.5 \cdot \frac{a}{\frac{z}{t}}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \]

Alternative 8: 76.5% accurate, 5.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -3 \cdot 10^{-91}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{elif}\;z \leq 3.7 \cdot 10^{+21}:\\ \;\;\;\;\frac{x \cdot \left(z \cdot y\right)}{z + -0.5 \cdot \left(t \cdot \frac{a}{z}\right)}\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= z -3e-91)
   (* y (- x))
   (if (<= z 3.7e+21) (/ (* x (* z y)) (+ z (* -0.5 (* t (/ a z))))) (* x y))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -3e-91) {
		tmp = y * -x;
	} else if (z <= 3.7e+21) {
		tmp = (x * (z * y)) / (z + (-0.5 * (t * (a / z))));
	} else {
		tmp = x * y;
	}
	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 (z <= (-3d-91)) then
        tmp = y * -x
    else if (z <= 3.7d+21) then
        tmp = (x * (z * y)) / (z + ((-0.5d0) * (t * (a / z))))
    else
        tmp = x * y
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -3e-91) {
		tmp = y * -x;
	} else if (z <= 3.7e+21) {
		tmp = (x * (z * y)) / (z + (-0.5 * (t * (a / z))));
	} else {
		tmp = x * y;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if z <= -3e-91:
		tmp = y * -x
	elif z <= 3.7e+21:
		tmp = (x * (z * y)) / (z + (-0.5 * (t * (a / z))))
	else:
		tmp = x * y
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (z <= -3e-91)
		tmp = Float64(y * Float64(-x));
	elseif (z <= 3.7e+21)
		tmp = Float64(Float64(x * Float64(z * y)) / Float64(z + Float64(-0.5 * Float64(t * Float64(a / z)))));
	else
		tmp = Float64(x * y);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (z <= -3e-91)
		tmp = y * -x;
	elseif (z <= 3.7e+21)
		tmp = (x * (z * y)) / (z + (-0.5 * (t * (a / z))));
	else
		tmp = x * y;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3e-91], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 3.7e+21], N[(N[(x * N[(z * y), $MachinePrecision]), $MachinePrecision] / N[(z + N[(-0.5 * N[(t * N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -3 \cdot 10^{-91}:\\
\;\;\;\;y \cdot \left(-x\right)\\

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

\mathbf{else}:\\
\;\;\;\;x \cdot y\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -3.0000000000000002e-91

    1. Initial program 53.4%

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

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

        \[\leadsto \frac{\color{blue}{y \cdot x}}{\sqrt{z \cdot z - t \cdot a}} \cdot z \]
      3. associate-*l/56.1%

        \[\leadsto \color{blue}{\left(\frac{y}{\sqrt{z \cdot z - t \cdot a}} \cdot x\right)} \cdot z \]
      4. associate-*r*54.0%

        \[\leadsto \color{blue}{\frac{y}{\sqrt{z \cdot z - t \cdot a}} \cdot \left(x \cdot z\right)} \]
      5. sub-neg54.0%

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \left(x \cdot y\right)} \]
    5. Step-by-step derivation
      1. *-commutative85.4%

        \[\leadsto -1 \cdot \color{blue}{\left(y \cdot x\right)} \]
      2. mul-1-neg85.4%

        \[\leadsto \color{blue}{-y \cdot x} \]
      3. *-commutative85.4%

        \[\leadsto -\color{blue}{x \cdot y} \]
    6. Simplified85.4%

      \[\leadsto \color{blue}{-x \cdot y} \]

    if -3.0000000000000002e-91 < z < 3.7e21

    1. Initial program 91.7%

      \[\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}} \]
    2. Taylor expanded in x around 0 89.0%

      \[\leadsto \frac{\color{blue}{x \cdot \left(y \cdot z\right)}}{\sqrt{z \cdot z - t \cdot a}} \]
    3. Taylor expanded in z around inf 47.0%

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

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

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

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

    if 3.7e21 < z

    1. Initial program 56.7%

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

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

        \[\leadsto \frac{\color{blue}{y \cdot x}}{\sqrt{z \cdot z - t \cdot a}} \cdot z \]
      3. associate-*l/55.7%

        \[\leadsto \color{blue}{\left(\frac{y}{\sqrt{z \cdot z - t \cdot a}} \cdot x\right)} \cdot z \]
      4. associate-*r*53.7%

        \[\leadsto \color{blue}{\frac{y}{\sqrt{z \cdot z - t \cdot a}} \cdot \left(x \cdot z\right)} \]
      5. sub-neg53.7%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3 \cdot 10^{-91}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{elif}\;z \leq 3.7 \cdot 10^{+21}:\\ \;\;\;\;\frac{x \cdot \left(z \cdot y\right)}{z + -0.5 \cdot \left(t \cdot \frac{a}{z}\right)}\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \]

Alternative 9: 77.6% accurate, 5.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.22 \cdot 10^{+48}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{elif}\;z \leq 3.7 \cdot 10^{-177}:\\ \;\;\;\;\left(z \cdot x\right) \cdot \frac{y}{0.5 \cdot \frac{a \cdot t}{z} - z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= z -1.22e+48)
   (* y (- x))
   (if (<= z 3.7e-177) (* (* z x) (/ y (- (* 0.5 (/ (* a t) z)) z))) (* x y))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -1.22e+48) {
		tmp = y * -x;
	} else if (z <= 3.7e-177) {
		tmp = (z * x) * (y / ((0.5 * ((a * t) / z)) - z));
	} else {
		tmp = x * y;
	}
	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 (z <= (-1.22d+48)) then
        tmp = y * -x
    else if (z <= 3.7d-177) then
        tmp = (z * x) * (y / ((0.5d0 * ((a * t) / z)) - z))
    else
        tmp = x * y
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -1.22e+48) {
		tmp = y * -x;
	} else if (z <= 3.7e-177) {
		tmp = (z * x) * (y / ((0.5 * ((a * t) / z)) - z));
	} else {
		tmp = x * y;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if z <= -1.22e+48:
		tmp = y * -x
	elif z <= 3.7e-177:
		tmp = (z * x) * (y / ((0.5 * ((a * t) / z)) - z))
	else:
		tmp = x * y
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (z <= -1.22e+48)
		tmp = Float64(y * Float64(-x));
	elseif (z <= 3.7e-177)
		tmp = Float64(Float64(z * x) * Float64(y / Float64(Float64(0.5 * Float64(Float64(a * t) / z)) - z)));
	else
		tmp = Float64(x * y);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (z <= -1.22e+48)
		tmp = y * -x;
	elseif (z <= 3.7e-177)
		tmp = (z * x) * (y / ((0.5 * ((a * t) / z)) - z));
	else
		tmp = x * y;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.22e+48], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 3.7e-177], N[(N[(z * x), $MachinePrecision] * N[(y / N[(N[(0.5 * N[(N[(a * t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.22 \cdot 10^{+48}:\\
\;\;\;\;y \cdot \left(-x\right)\\

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

\mathbf{else}:\\
\;\;\;\;x \cdot y\\


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

    1. Initial program 31.5%

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

        \[\leadsto \color{blue}{\frac{x \cdot y}{\sqrt{z \cdot z - t \cdot a}} \cdot z} \]
      2. *-commutative36.7%

        \[\leadsto \frac{\color{blue}{y \cdot x}}{\sqrt{z \cdot z - t \cdot a}} \cdot z \]
      3. associate-*l/35.1%

        \[\leadsto \color{blue}{\left(\frac{y}{\sqrt{z \cdot z - t \cdot a}} \cdot x\right)} \cdot z \]
      4. associate-*r*31.3%

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \left(x \cdot y\right)} \]
    5. Step-by-step derivation
      1. *-commutative96.7%

        \[\leadsto -1 \cdot \color{blue}{\left(y \cdot x\right)} \]
      2. mul-1-neg96.7%

        \[\leadsto \color{blue}{-y \cdot x} \]
      3. *-commutative96.7%

        \[\leadsto -\color{blue}{x \cdot y} \]
    6. Simplified96.7%

      \[\leadsto \color{blue}{-x \cdot y} \]

    if -1.22000000000000004e48 < z < 3.69999999999999993e-177

    1. Initial program 89.1%

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

        \[\leadsto \color{blue}{\frac{x \cdot y}{\sqrt{z \cdot z - t \cdot a}} \cdot z} \]
      2. *-commutative89.3%

        \[\leadsto \frac{\color{blue}{y \cdot x}}{\sqrt{z \cdot z - t \cdot a}} \cdot z \]
      3. associate-*l/89.4%

        \[\leadsto \color{blue}{\left(\frac{y}{\sqrt{z \cdot z - t \cdot a}} \cdot x\right)} \cdot z \]
      4. associate-*r*84.5%

        \[\leadsto \color{blue}{\frac{y}{\sqrt{z \cdot z - t \cdot a}} \cdot \left(x \cdot z\right)} \]
      5. sub-neg84.5%

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

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

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

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

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

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

    if 3.69999999999999993e-177 < z

    1. Initial program 65.5%

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

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

        \[\leadsto \frac{\color{blue}{y \cdot x}}{\sqrt{z \cdot z - t \cdot a}} \cdot z \]
      3. associate-*l/63.0%

        \[\leadsto \color{blue}{\left(\frac{y}{\sqrt{z \cdot z - t \cdot a}} \cdot x\right)} \cdot z \]
      4. associate-*r*63.9%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.22 \cdot 10^{+48}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{elif}\;z \leq 3.7 \cdot 10^{-177}:\\ \;\;\;\;\left(z \cdot x\right) \cdot \frac{y}{0.5 \cdot \frac{a \cdot t}{z} - z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \]

Alternative 10: 77.6% accurate, 5.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -2.25 \cdot 10^{+52}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{elif}\;z \leq 7.3 \cdot 10^{-177}:\\ \;\;\;\;\frac{x \cdot \left(z \cdot y\right)}{0.5 \cdot \frac{a \cdot t}{z} - z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= z -2.25e+52)
   (* y (- x))
   (if (<= z 7.3e-177) (/ (* x (* z y)) (- (* 0.5 (/ (* a t) z)) z)) (* x y))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -2.25e+52) {
		tmp = y * -x;
	} else if (z <= 7.3e-177) {
		tmp = (x * (z * y)) / ((0.5 * ((a * t) / z)) - z);
	} else {
		tmp = x * y;
	}
	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 (z <= (-2.25d+52)) then
        tmp = y * -x
    else if (z <= 7.3d-177) then
        tmp = (x * (z * y)) / ((0.5d0 * ((a * t) / z)) - z)
    else
        tmp = x * y
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -2.25e+52) {
		tmp = y * -x;
	} else if (z <= 7.3e-177) {
		tmp = (x * (z * y)) / ((0.5 * ((a * t) / z)) - z);
	} else {
		tmp = x * y;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if z <= -2.25e+52:
		tmp = y * -x
	elif z <= 7.3e-177:
		tmp = (x * (z * y)) / ((0.5 * ((a * t) / z)) - z)
	else:
		tmp = x * y
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (z <= -2.25e+52)
		tmp = Float64(y * Float64(-x));
	elseif (z <= 7.3e-177)
		tmp = Float64(Float64(x * Float64(z * y)) / Float64(Float64(0.5 * Float64(Float64(a * t) / z)) - z));
	else
		tmp = Float64(x * y);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (z <= -2.25e+52)
		tmp = y * -x;
	elseif (z <= 7.3e-177)
		tmp = (x * (z * y)) / ((0.5 * ((a * t) / z)) - z);
	else
		tmp = x * y;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.25e+52], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 7.3e-177], N[(N[(x * N[(z * y), $MachinePrecision]), $MachinePrecision] / N[(N[(0.5 * N[(N[(a * t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.25 \cdot 10^{+52}:\\
\;\;\;\;y \cdot \left(-x\right)\\

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

\mathbf{else}:\\
\;\;\;\;x \cdot y\\


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

    1. Initial program 31.5%

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

        \[\leadsto \color{blue}{\frac{x \cdot y}{\sqrt{z \cdot z - t \cdot a}} \cdot z} \]
      2. *-commutative36.7%

        \[\leadsto \frac{\color{blue}{y \cdot x}}{\sqrt{z \cdot z - t \cdot a}} \cdot z \]
      3. associate-*l/35.1%

        \[\leadsto \color{blue}{\left(\frac{y}{\sqrt{z \cdot z - t \cdot a}} \cdot x\right)} \cdot z \]
      4. associate-*r*31.3%

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \left(x \cdot y\right)} \]
    5. Step-by-step derivation
      1. *-commutative96.7%

        \[\leadsto -1 \cdot \color{blue}{\left(y \cdot x\right)} \]
      2. mul-1-neg96.7%

        \[\leadsto \color{blue}{-y \cdot x} \]
      3. *-commutative96.7%

        \[\leadsto -\color{blue}{x \cdot y} \]
    6. Simplified96.7%

      \[\leadsto \color{blue}{-x \cdot y} \]

    if -2.25e52 < z < 7.2999999999999998e-177

    1. Initial program 89.1%

      \[\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}} \]
    2. Taylor expanded in x around 0 85.9%

      \[\leadsto \frac{\color{blue}{x \cdot \left(y \cdot z\right)}}{\sqrt{z \cdot z - t \cdot a}} \]
    3. Taylor expanded in z around -inf 55.6%

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

    if 7.2999999999999998e-177 < z

    1. Initial program 65.5%

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

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

        \[\leadsto \frac{\color{blue}{y \cdot x}}{\sqrt{z \cdot z - t \cdot a}} \cdot z \]
      3. associate-*l/63.0%

        \[\leadsto \color{blue}{\left(\frac{y}{\sqrt{z \cdot z - t \cdot a}} \cdot x\right)} \cdot z \]
      4. associate-*r*63.9%

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

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

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

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

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

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

      \[\leadsto \color{blue}{x \cdot y} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification77.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.25 \cdot 10^{+52}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{elif}\;z \leq 7.3 \cdot 10^{-177}:\\ \;\;\;\;\frac{x \cdot \left(z \cdot y\right)}{0.5 \cdot \frac{a \cdot t}{z} - z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \]

Alternative 11: 75.7% accurate, 6.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -3.5 \cdot 10^{-91}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{elif}\;z \leq 9 \cdot 10^{-173}:\\ \;\;\;\;\left(z \cdot x\right) \cdot \left(2 \cdot \frac{z}{\frac{a \cdot t}{-y}}\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= z -3.5e-91)
   (* y (- x))
   (if (<= z 9e-173) (* (* z x) (* 2.0 (/ z (/ (* a t) (- y))))) (* x y))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -3.5e-91) {
		tmp = y * -x;
	} else if (z <= 9e-173) {
		tmp = (z * x) * (2.0 * (z / ((a * t) / -y)));
	} else {
		tmp = x * y;
	}
	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 (z <= (-3.5d-91)) then
        tmp = y * -x
    else if (z <= 9d-173) then
        tmp = (z * x) * (2.0d0 * (z / ((a * t) / -y)))
    else
        tmp = x * y
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -3.5e-91) {
		tmp = y * -x;
	} else if (z <= 9e-173) {
		tmp = (z * x) * (2.0 * (z / ((a * t) / -y)));
	} else {
		tmp = x * y;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if z <= -3.5e-91:
		tmp = y * -x
	elif z <= 9e-173:
		tmp = (z * x) * (2.0 * (z / ((a * t) / -y)))
	else:
		tmp = x * y
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (z <= -3.5e-91)
		tmp = Float64(y * Float64(-x));
	elseif (z <= 9e-173)
		tmp = Float64(Float64(z * x) * Float64(2.0 * Float64(z / Float64(Float64(a * t) / Float64(-y)))));
	else
		tmp = Float64(x * y);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (z <= -3.5e-91)
		tmp = y * -x;
	elseif (z <= 9e-173)
		tmp = (z * x) * (2.0 * (z / ((a * t) / -y)));
	else
		tmp = x * y;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.5e-91], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 9e-173], N[(N[(z * x), $MachinePrecision] * N[(2.0 * N[(z / N[(N[(a * t), $MachinePrecision] / (-y)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.5 \cdot 10^{-91}:\\
\;\;\;\;y \cdot \left(-x\right)\\

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

\mathbf{else}:\\
\;\;\;\;x \cdot y\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -3.4999999999999999e-91

    1. Initial program 53.4%

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

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

        \[\leadsto \frac{\color{blue}{y \cdot x}}{\sqrt{z \cdot z - t \cdot a}} \cdot z \]
      3. associate-*l/56.1%

        \[\leadsto \color{blue}{\left(\frac{y}{\sqrt{z \cdot z - t \cdot a}} \cdot x\right)} \cdot z \]
      4. associate-*r*54.0%

        \[\leadsto \color{blue}{\frac{y}{\sqrt{z \cdot z - t \cdot a}} \cdot \left(x \cdot z\right)} \]
      5. sub-neg54.0%

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \left(x \cdot y\right)} \]
    5. Step-by-step derivation
      1. *-commutative85.4%

        \[\leadsto -1 \cdot \color{blue}{\left(y \cdot x\right)} \]
      2. mul-1-neg85.4%

        \[\leadsto \color{blue}{-y \cdot x} \]
      3. *-commutative85.4%

        \[\leadsto -\color{blue}{x \cdot y} \]
    6. Simplified85.4%

      \[\leadsto \color{blue}{-x \cdot y} \]

    if -3.4999999999999999e-91 < z < 9.00000000000000037e-173

    1. Initial program 89.9%

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

        \[\leadsto \color{blue}{\frac{x \cdot y}{\sqrt{z \cdot z - t \cdot a}} \cdot z} \]
      2. *-commutative89.4%

        \[\leadsto \frac{\color{blue}{y \cdot x}}{\sqrt{z \cdot z - t \cdot a}} \cdot z \]
      3. associate-*l/89.5%

        \[\leadsto \color{blue}{\left(\frac{y}{\sqrt{z \cdot z - t \cdot a}} \cdot x\right)} \cdot z \]
      4. associate-*r*81.0%

        \[\leadsto \color{blue}{\frac{y}{\sqrt{z \cdot z - t \cdot a}} \cdot \left(x \cdot z\right)} \]
      5. sub-neg81.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(2 \cdot \frac{\sqrt{1 \cdot \color{blue}{{z}^{2}}}}{\frac{a}{y} \cdot \left(-t\right)}\right) \cdot \left(x \cdot z\right) \]
      13. *-un-lft-identity37.8%

        \[\leadsto \left(2 \cdot \frac{\sqrt{\color{blue}{{z}^{2}}}}{\frac{a}{y} \cdot \left(-t\right)}\right) \cdot \left(x \cdot z\right) \]
      14. unpow237.8%

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

        \[\leadsto \left(2 \cdot \frac{\color{blue}{\sqrt{z} \cdot \sqrt{z}}}{\frac{a}{y} \cdot \left(-t\right)}\right) \cdot \left(x \cdot z\right) \]
      16. add-sqr-sqrt41.4%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(2 \cdot \frac{z}{\frac{\color{blue}{a \cdot \left(-t\right)}}{-y}}\right) \cdot \left(x \cdot z\right) \]
      10. add-sqr-sqrt22.2%

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

        \[\leadsto \left(2 \cdot \frac{z}{\frac{a \cdot \color{blue}{\sqrt{\left(-t\right) \cdot \left(-t\right)}}}{-y}}\right) \cdot \left(x \cdot z\right) \]
      12. sqr-neg33.8%

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

        \[\leadsto \left(2 \cdot \frac{z}{\frac{a \cdot \color{blue}{\left(\sqrt{t} \cdot \sqrt{t}\right)}}{-y}}\right) \cdot \left(x \cdot z\right) \]
      14. add-sqr-sqrt41.8%

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

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

    if 9.00000000000000037e-173 < z

    1. Initial program 65.5%

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

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

        \[\leadsto \frac{\color{blue}{y \cdot x}}{\sqrt{z \cdot z - t \cdot a}} \cdot z \]
      3. associate-*l/63.0%

        \[\leadsto \color{blue}{\left(\frac{y}{\sqrt{z \cdot z - t \cdot a}} \cdot x\right)} \cdot z \]
      4. associate-*r*63.9%

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

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

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

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

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

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

      \[\leadsto \color{blue}{x \cdot y} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification76.5%

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

Alternative 12: 75.7% accurate, 6.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.5 \cdot 10^{-66}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{elif}\;z \leq 2.3 \cdot 10^{-181}:\\ \;\;\;\;z \cdot \left(x \cdot \left(2 \cdot \left(\frac{z}{a} \cdot \frac{y}{t}\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= z -1.5e-66)
   (* y (- x))
   (if (<= z 2.3e-181) (* z (* x (* 2.0 (* (/ z a) (/ y t))))) (* x y))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -1.5e-66) {
		tmp = y * -x;
	} else if (z <= 2.3e-181) {
		tmp = z * (x * (2.0 * ((z / a) * (y / t))));
	} else {
		tmp = x * y;
	}
	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 (z <= (-1.5d-66)) then
        tmp = y * -x
    else if (z <= 2.3d-181) then
        tmp = z * (x * (2.0d0 * ((z / a) * (y / t))))
    else
        tmp = x * y
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -1.5e-66) {
		tmp = y * -x;
	} else if (z <= 2.3e-181) {
		tmp = z * (x * (2.0 * ((z / a) * (y / t))));
	} else {
		tmp = x * y;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if z <= -1.5e-66:
		tmp = y * -x
	elif z <= 2.3e-181:
		tmp = z * (x * (2.0 * ((z / a) * (y / t))))
	else:
		tmp = x * y
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (z <= -1.5e-66)
		tmp = Float64(y * Float64(-x));
	elseif (z <= 2.3e-181)
		tmp = Float64(z * Float64(x * Float64(2.0 * Float64(Float64(z / a) * Float64(y / t)))));
	else
		tmp = Float64(x * y);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (z <= -1.5e-66)
		tmp = y * -x;
	elseif (z <= 2.3e-181)
		tmp = z * (x * (2.0 * ((z / a) * (y / t))));
	else
		tmp = x * y;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.5e-66], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 2.3e-181], N[(z * N[(x * N[(2.0 * N[(N[(z / a), $MachinePrecision] * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.5 \cdot 10^{-66}:\\
\;\;\;\;y \cdot \left(-x\right)\\

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

\mathbf{else}:\\
\;\;\;\;x \cdot y\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.5000000000000001e-66

    1. Initial program 52.3%

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

        \[\leadsto \color{blue}{\frac{x \cdot y}{\sqrt{z \cdot z - t \cdot a}} \cdot z} \]
      2. *-commutative55.6%

        \[\leadsto \frac{\color{blue}{y \cdot x}}{\sqrt{z \cdot z - t \cdot a}} \cdot z \]
      3. associate-*l/54.6%

        \[\leadsto \color{blue}{\left(\frac{y}{\sqrt{z \cdot z - t \cdot a}} \cdot x\right)} \cdot z \]
      4. associate-*r*53.1%

        \[\leadsto \color{blue}{\frac{y}{\sqrt{z \cdot z - t \cdot a}} \cdot \left(x \cdot z\right)} \]
      5. sub-neg53.1%

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \left(x \cdot y\right)} \]
    5. Step-by-step derivation
      1. *-commutative87.0%

        \[\leadsto -1 \cdot \color{blue}{\left(y \cdot x\right)} \]
      2. mul-1-neg87.0%

        \[\leadsto \color{blue}{-y \cdot x} \]
      3. *-commutative87.0%

        \[\leadsto -\color{blue}{x \cdot y} \]
    6. Simplified87.0%

      \[\leadsto \color{blue}{-x \cdot y} \]

    if -1.5000000000000001e-66 < z < 2.29999999999999991e-181

    1. Initial program 89.6%

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

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

        \[\leadsto \frac{\color{blue}{y \cdot x}}{\sqrt{z \cdot z - t \cdot a}} \cdot z \]
      3. associate-*l/90.0%

        \[\leadsto \color{blue}{\left(\frac{y}{\sqrt{z \cdot z - t \cdot a}} \cdot x\right)} \cdot z \]
      4. associate-*r*81.0%

        \[\leadsto \color{blue}{\frac{y}{\sqrt{z \cdot z - t \cdot a}} \cdot \left(x \cdot z\right)} \]
      5. sub-neg81.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.29999999999999991e-181 < z

    1. Initial program 65.5%

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

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

        \[\leadsto \frac{\color{blue}{y \cdot x}}{\sqrt{z \cdot z - t \cdot a}} \cdot z \]
      3. associate-*l/63.0%

        \[\leadsto \color{blue}{\left(\frac{y}{\sqrt{z \cdot z - t \cdot a}} \cdot x\right)} \cdot z \]
      4. associate-*r*63.9%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.5 \cdot 10^{-66}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{elif}\;z \leq 2.3 \cdot 10^{-181}:\\ \;\;\;\;z \cdot \left(x \cdot \left(2 \cdot \left(\frac{z}{a} \cdot \frac{y}{t}\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \]

Alternative 13: 76.0% accurate, 6.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -3 \cdot 10^{-91}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{elif}\;z \leq 1.65 \cdot 10^{-177}:\\ \;\;\;\;\left(z \cdot x\right) \cdot \left(-2 \cdot \frac{z}{t \cdot \frac{a}{y}}\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= z -3e-91)
   (* y (- x))
   (if (<= z 1.65e-177) (* (* z x) (* -2.0 (/ z (* t (/ a y))))) (* x y))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -3e-91) {
		tmp = y * -x;
	} else if (z <= 1.65e-177) {
		tmp = (z * x) * (-2.0 * (z / (t * (a / y))));
	} else {
		tmp = x * y;
	}
	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 (z <= (-3d-91)) then
        tmp = y * -x
    else if (z <= 1.65d-177) then
        tmp = (z * x) * ((-2.0d0) * (z / (t * (a / y))))
    else
        tmp = x * y
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -3e-91) {
		tmp = y * -x;
	} else if (z <= 1.65e-177) {
		tmp = (z * x) * (-2.0 * (z / (t * (a / y))));
	} else {
		tmp = x * y;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if z <= -3e-91:
		tmp = y * -x
	elif z <= 1.65e-177:
		tmp = (z * x) * (-2.0 * (z / (t * (a / y))))
	else:
		tmp = x * y
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (z <= -3e-91)
		tmp = Float64(y * Float64(-x));
	elseif (z <= 1.65e-177)
		tmp = Float64(Float64(z * x) * Float64(-2.0 * Float64(z / Float64(t * Float64(a / y)))));
	else
		tmp = Float64(x * y);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (z <= -3e-91)
		tmp = y * -x;
	elseif (z <= 1.65e-177)
		tmp = (z * x) * (-2.0 * (z / (t * (a / y))));
	else
		tmp = x * y;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3e-91], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 1.65e-177], N[(N[(z * x), $MachinePrecision] * N[(-2.0 * N[(z / N[(t * N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -3 \cdot 10^{-91}:\\
\;\;\;\;y \cdot \left(-x\right)\\

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

\mathbf{else}:\\
\;\;\;\;x \cdot y\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -3.0000000000000002e-91

    1. Initial program 53.4%

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

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

        \[\leadsto \frac{\color{blue}{y \cdot x}}{\sqrt{z \cdot z - t \cdot a}} \cdot z \]
      3. associate-*l/56.1%

        \[\leadsto \color{blue}{\left(\frac{y}{\sqrt{z \cdot z - t \cdot a}} \cdot x\right)} \cdot z \]
      4. associate-*r*54.0%

        \[\leadsto \color{blue}{\frac{y}{\sqrt{z \cdot z - t \cdot a}} \cdot \left(x \cdot z\right)} \]
      5. sub-neg54.0%

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \left(x \cdot y\right)} \]
    5. Step-by-step derivation
      1. *-commutative85.4%

        \[\leadsto -1 \cdot \color{blue}{\left(y \cdot x\right)} \]
      2. mul-1-neg85.4%

        \[\leadsto \color{blue}{-y \cdot x} \]
      3. *-commutative85.4%

        \[\leadsto -\color{blue}{x \cdot y} \]
    6. Simplified85.4%

      \[\leadsto \color{blue}{-x \cdot y} \]

    if -3.0000000000000002e-91 < z < 1.65e-177

    1. Initial program 89.9%

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

        \[\leadsto \color{blue}{\frac{x \cdot y}{\sqrt{z \cdot z - t \cdot a}} \cdot z} \]
      2. *-commutative89.4%

        \[\leadsto \frac{\color{blue}{y \cdot x}}{\sqrt{z \cdot z - t \cdot a}} \cdot z \]
      3. associate-*l/89.5%

        \[\leadsto \color{blue}{\left(\frac{y}{\sqrt{z \cdot z - t \cdot a}} \cdot x\right)} \cdot z \]
      4. associate-*r*81.0%

        \[\leadsto \color{blue}{\frac{y}{\sqrt{z \cdot z - t \cdot a}} \cdot \left(x \cdot z\right)} \]
      5. sub-neg81.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(2 \cdot \frac{\sqrt{1 \cdot \color{blue}{{z}^{2}}}}{\frac{a}{y} \cdot \left(-t\right)}\right) \cdot \left(x \cdot z\right) \]
      13. *-un-lft-identity37.8%

        \[\leadsto \left(2 \cdot \frac{\sqrt{\color{blue}{{z}^{2}}}}{\frac{a}{y} \cdot \left(-t\right)}\right) \cdot \left(x \cdot z\right) \]
      14. unpow237.8%

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

        \[\leadsto \left(2 \cdot \frac{\color{blue}{\sqrt{z} \cdot \sqrt{z}}}{\frac{a}{y} \cdot \left(-t\right)}\right) \cdot \left(x \cdot z\right) \]
      16. add-sqr-sqrt41.4%

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

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

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

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

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

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

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

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

    if 1.65e-177 < z

    1. Initial program 65.5%

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

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

        \[\leadsto \frac{\color{blue}{y \cdot x}}{\sqrt{z \cdot z - t \cdot a}} \cdot z \]
      3. associate-*l/63.0%

        \[\leadsto \color{blue}{\left(\frac{y}{\sqrt{z \cdot z - t \cdot a}} \cdot x\right)} \cdot z \]
      4. associate-*r*63.9%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3 \cdot 10^{-91}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{elif}\;z \leq 1.65 \cdot 10^{-177}:\\ \;\;\;\;\left(z \cdot x\right) \cdot \left(-2 \cdot \frac{z}{t \cdot \frac{a}{y}}\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \]

Alternative 14: 76.1% accurate, 9.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.45 \cdot 10^{-58}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{elif}\;z \leq 1.05 \cdot 10^{-239}:\\ \;\;\;\;\frac{y \cdot \left(z \cdot \left(-x\right)\right)}{z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= z -1.45e-58)
   (* y (- x))
   (if (<= z 1.05e-239) (/ (* y (* z (- x))) z) (* x y))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -1.45e-58) {
		tmp = y * -x;
	} else if (z <= 1.05e-239) {
		tmp = (y * (z * -x)) / z;
	} else {
		tmp = x * y;
	}
	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 (z <= (-1.45d-58)) then
        tmp = y * -x
    else if (z <= 1.05d-239) then
        tmp = (y * (z * -x)) / z
    else
        tmp = x * y
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -1.45e-58) {
		tmp = y * -x;
	} else if (z <= 1.05e-239) {
		tmp = (y * (z * -x)) / z;
	} else {
		tmp = x * y;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if z <= -1.45e-58:
		tmp = y * -x
	elif z <= 1.05e-239:
		tmp = (y * (z * -x)) / z
	else:
		tmp = x * y
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (z <= -1.45e-58)
		tmp = Float64(y * Float64(-x));
	elseif (z <= 1.05e-239)
		tmp = Float64(Float64(y * Float64(z * Float64(-x))) / z);
	else
		tmp = Float64(x * y);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (z <= -1.45e-58)
		tmp = y * -x;
	elseif (z <= 1.05e-239)
		tmp = (y * (z * -x)) / z;
	else
		tmp = x * y;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.45e-58], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 1.05e-239], N[(N[(y * N[(z * (-x)), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(x * y), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.45 \cdot 10^{-58}:\\
\;\;\;\;y \cdot \left(-x\right)\\

\mathbf{elif}\;z \leq 1.05 \cdot 10^{-239}:\\
\;\;\;\;\frac{y \cdot \left(z \cdot \left(-x\right)\right)}{z}\\

\mathbf{else}:\\
\;\;\;\;x \cdot y\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.44999999999999995e-58

    1. Initial program 52.9%

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

        \[\leadsto \color{blue}{\frac{x \cdot y}{\sqrt{z \cdot z - t \cdot a}} \cdot z} \]
      2. *-commutative56.3%

        \[\leadsto \frac{\color{blue}{y \cdot x}}{\sqrt{z \cdot z - t \cdot a}} \cdot z \]
      3. associate-*l/55.2%

        \[\leadsto \color{blue}{\left(\frac{y}{\sqrt{z \cdot z - t \cdot a}} \cdot x\right)} \cdot z \]
      4. associate-*r*52.6%

        \[\leadsto \color{blue}{\frac{y}{\sqrt{z \cdot z - t \cdot a}} \cdot \left(x \cdot z\right)} \]
      5. sub-neg52.6%

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \left(x \cdot y\right)} \]
    5. Step-by-step derivation
      1. *-commutative88.6%

        \[\leadsto -1 \cdot \color{blue}{\left(y \cdot x\right)} \]
      2. mul-1-neg88.6%

        \[\leadsto \color{blue}{-y \cdot x} \]
      3. *-commutative88.6%

        \[\leadsto -\color{blue}{x \cdot y} \]
    6. Simplified88.6%

      \[\leadsto \color{blue}{-x \cdot y} \]

    if -1.44999999999999995e-58 < z < 1.0500000000000001e-239

    1. Initial program 87.6%

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

        \[\leadsto \color{blue}{\frac{x \cdot y}{\sqrt{z \cdot z - t \cdot a}} \cdot z} \]
      2. *-commutative88.4%

        \[\leadsto \frac{\color{blue}{y \cdot x}}{\sqrt{z \cdot z - t \cdot a}} \cdot z \]
      3. associate-*l/88.5%

        \[\leadsto \color{blue}{\left(\frac{y}{\sqrt{z \cdot z - t \cdot a}} \cdot x\right)} \cdot z \]
      4. associate-*r*79.9%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(x \cdot z\right) \cdot \frac{y}{z}} \]
      2. frac-2neg19.2%

        \[\leadsto \left(x \cdot z\right) \cdot \color{blue}{\frac{-y}{-z}} \]
      3. mul-1-neg19.2%

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

        \[\leadsto \color{blue}{\frac{\left(x \cdot z\right) \cdot \left(-y\right)}{-1 \cdot z}} \]
      5. *-commutative29.5%

        \[\leadsto \frac{\color{blue}{\left(z \cdot x\right)} \cdot \left(-y\right)}{-1 \cdot z} \]
      6. add-sqr-sqrt19.1%

        \[\leadsto \frac{\left(z \cdot x\right) \cdot \left(-y\right)}{\color{blue}{\sqrt{-1 \cdot z} \cdot \sqrt{-1 \cdot z}}} \]
      7. sqrt-unprod8.6%

        \[\leadsto \frac{\left(z \cdot x\right) \cdot \left(-y\right)}{\color{blue}{\sqrt{\left(-1 \cdot z\right) \cdot \left(-1 \cdot z\right)}}} \]
      8. mul-1-neg8.6%

        \[\leadsto \frac{\left(z \cdot x\right) \cdot \left(-y\right)}{\sqrt{\color{blue}{\left(-z\right)} \cdot \left(-1 \cdot z\right)}} \]
      9. mul-1-neg8.6%

        \[\leadsto \frac{\left(z \cdot x\right) \cdot \left(-y\right)}{\sqrt{\left(-z\right) \cdot \color{blue}{\left(-z\right)}}} \]
      10. sqr-neg8.6%

        \[\leadsto \frac{\left(z \cdot x\right) \cdot \left(-y\right)}{\sqrt{\color{blue}{z \cdot z}}} \]
      11. sqrt-prod10.2%

        \[\leadsto \frac{\left(z \cdot x\right) \cdot \left(-y\right)}{\color{blue}{\sqrt{z} \cdot \sqrt{z}}} \]
      12. add-sqr-sqrt38.2%

        \[\leadsto \frac{\left(z \cdot x\right) \cdot \left(-y\right)}{\color{blue}{z}} \]
    6. Applied egg-rr38.2%

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

    if 1.0500000000000001e-239 < z

    1. Initial program 67.3%

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

        \[\leadsto \color{blue}{\frac{x \cdot y}{\sqrt{z \cdot z - t \cdot a}} \cdot z} \]
      2. *-commutative65.6%

        \[\leadsto \frac{\color{blue}{y \cdot x}}{\sqrt{z \cdot z - t \cdot a}} \cdot z \]
      3. associate-*l/64.8%

        \[\leadsto \color{blue}{\left(\frac{y}{\sqrt{z \cdot z - t \cdot a}} \cdot x\right)} \cdot z \]
      4. associate-*r*65.6%

        \[\leadsto \color{blue}{\frac{y}{\sqrt{z \cdot z - t \cdot a}} \cdot \left(x \cdot z\right)} \]
      5. sub-neg65.6%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.45 \cdot 10^{-58}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{elif}\;z \leq 1.05 \cdot 10^{-239}:\\ \;\;\;\;\frac{y \cdot \left(z \cdot \left(-x\right)\right)}{z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \]

Alternative 15: 75.0% accurate, 10.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -3.25 \cdot 10^{-215}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{elif}\;z \leq 5 \cdot 10^{-173}:\\ \;\;\;\;\frac{y}{\frac{z}{z \cdot x}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= z -3.25e-215)
   (* y (- x))
   (if (<= z 5e-173) (/ y (/ z (* z x))) (* x y))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -3.25e-215) {
		tmp = y * -x;
	} else if (z <= 5e-173) {
		tmp = y / (z / (z * x));
	} else {
		tmp = x * y;
	}
	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 (z <= (-3.25d-215)) then
        tmp = y * -x
    else if (z <= 5d-173) then
        tmp = y / (z / (z * x))
    else
        tmp = x * y
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -3.25e-215) {
		tmp = y * -x;
	} else if (z <= 5e-173) {
		tmp = y / (z / (z * x));
	} else {
		tmp = x * y;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if z <= -3.25e-215:
		tmp = y * -x
	elif z <= 5e-173:
		tmp = y / (z / (z * x))
	else:
		tmp = x * y
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (z <= -3.25e-215)
		tmp = Float64(y * Float64(-x));
	elseif (z <= 5e-173)
		tmp = Float64(y / Float64(z / Float64(z * x)));
	else
		tmp = Float64(x * y);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (z <= -3.25e-215)
		tmp = y * -x;
	elseif (z <= 5e-173)
		tmp = y / (z / (z * x));
	else
		tmp = x * y;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.25e-215], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 5e-173], N[(y / N[(z / N[(z * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.25 \cdot 10^{-215}:\\
\;\;\;\;y \cdot \left(-x\right)\\

\mathbf{elif}\;z \leq 5 \cdot 10^{-173}:\\
\;\;\;\;\frac{y}{\frac{z}{z \cdot x}}\\

\mathbf{else}:\\
\;\;\;\;x \cdot y\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -3.25e-215

    1. Initial program 59.6%

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

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

        \[\leadsto \frac{\color{blue}{y \cdot x}}{\sqrt{z \cdot z - t \cdot a}} \cdot z \]
      3. associate-*l/61.1%

        \[\leadsto \color{blue}{\left(\frac{y}{\sqrt{z \cdot z - t \cdot a}} \cdot x\right)} \cdot z \]
      4. associate-*r*58.4%

        \[\leadsto \color{blue}{\frac{y}{\sqrt{z \cdot z - t \cdot a}} \cdot \left(x \cdot z\right)} \]
      5. sub-neg58.4%

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \left(x \cdot y\right)} \]
    5. Step-by-step derivation
      1. *-commutative75.6%

        \[\leadsto -1 \cdot \color{blue}{\left(y \cdot x\right)} \]
      2. mul-1-neg75.6%

        \[\leadsto \color{blue}{-y \cdot x} \]
      3. *-commutative75.6%

        \[\leadsto -\color{blue}{x \cdot y} \]
    6. Simplified75.6%

      \[\leadsto \color{blue}{-x \cdot y} \]

    if -3.25e-215 < z < 5.0000000000000002e-173

    1. Initial program 88.3%

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

        \[\leadsto \color{blue}{\frac{x \cdot y}{\sqrt{z \cdot z - t \cdot a}} \cdot z} \]
      2. *-commutative89.8%

        \[\leadsto \frac{\color{blue}{y \cdot x}}{\sqrt{z \cdot z - t \cdot a}} \cdot z \]
      3. associate-*l/89.8%

        \[\leadsto \color{blue}{\left(\frac{y}{\sqrt{z \cdot z - t \cdot a}} \cdot x\right)} \cdot z \]
      4. associate-*r*80.3%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y}{\frac{z}{x \cdot z}}} \]
      3. *-commutative29.8%

        \[\leadsto \frac{y}{\frac{z}{\color{blue}{z \cdot x}}} \]
    6. Applied egg-rr29.8%

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

    if 5.0000000000000002e-173 < z

    1. Initial program 65.5%

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

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

        \[\leadsto \frac{\color{blue}{y \cdot x}}{\sqrt{z \cdot z - t \cdot a}} \cdot z \]
      3. associate-*l/63.0%

        \[\leadsto \color{blue}{\left(\frac{y}{\sqrt{z \cdot z - t \cdot a}} \cdot x\right)} \cdot z \]
      4. associate-*r*63.9%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.25 \cdot 10^{-215}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{elif}\;z \leq 5 \cdot 10^{-173}:\\ \;\;\;\;\frac{y}{\frac{z}{z \cdot x}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \]

Alternative 16: 75.8% accurate, 10.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.55 \cdot 10^{-215}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{elif}\;z \leq 1.45 \cdot 10^{-112}:\\ \;\;\;\;\frac{x \cdot \left(z \cdot y\right)}{z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= z -1.55e-215)
   (* y (- x))
   (if (<= z 1.45e-112) (/ (* x (* z y)) z) (* x y))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -1.55e-215) {
		tmp = y * -x;
	} else if (z <= 1.45e-112) {
		tmp = (x * (z * y)) / z;
	} else {
		tmp = x * y;
	}
	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 (z <= (-1.55d-215)) then
        tmp = y * -x
    else if (z <= 1.45d-112) then
        tmp = (x * (z * y)) / z
    else
        tmp = x * y
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -1.55e-215) {
		tmp = y * -x;
	} else if (z <= 1.45e-112) {
		tmp = (x * (z * y)) / z;
	} else {
		tmp = x * y;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if z <= -1.55e-215:
		tmp = y * -x
	elif z <= 1.45e-112:
		tmp = (x * (z * y)) / z
	else:
		tmp = x * y
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (z <= -1.55e-215)
		tmp = Float64(y * Float64(-x));
	elseif (z <= 1.45e-112)
		tmp = Float64(Float64(x * Float64(z * y)) / z);
	else
		tmp = Float64(x * y);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (z <= -1.55e-215)
		tmp = y * -x;
	elseif (z <= 1.45e-112)
		tmp = (x * (z * y)) / z;
	else
		tmp = x * y;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.55e-215], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 1.45e-112], N[(N[(x * N[(z * y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(x * y), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.55 \cdot 10^{-215}:\\
\;\;\;\;y \cdot \left(-x\right)\\

\mathbf{elif}\;z \leq 1.45 \cdot 10^{-112}:\\
\;\;\;\;\frac{x \cdot \left(z \cdot y\right)}{z}\\

\mathbf{else}:\\
\;\;\;\;x \cdot y\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.54999999999999997e-215

    1. Initial program 60.0%

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

        \[\leadsto \color{blue}{\frac{x \cdot y}{\sqrt{z \cdot z - t \cdot a}} \cdot z} \]
      2. *-commutative62.3%

        \[\leadsto \frac{\color{blue}{y \cdot x}}{\sqrt{z \cdot z - t \cdot a}} \cdot z \]
      3. associate-*l/61.4%

        \[\leadsto \color{blue}{\left(\frac{y}{\sqrt{z \cdot z - t \cdot a}} \cdot x\right)} \cdot z \]
      4. associate-*r*58.8%

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \left(x \cdot y\right)} \]
    5. Step-by-step derivation
      1. *-commutative74.9%

        \[\leadsto -1 \cdot \color{blue}{\left(y \cdot x\right)} \]
      2. mul-1-neg74.9%

        \[\leadsto \color{blue}{-y \cdot x} \]
      3. *-commutative74.9%

        \[\leadsto -\color{blue}{x \cdot y} \]
    6. Simplified74.9%

      \[\leadsto \color{blue}{-x \cdot y} \]

    if -1.54999999999999997e-215 < z < 1.44999999999999996e-112

    1. Initial program 87.2%

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

        \[\leadsto \color{blue}{\frac{x \cdot y}{\sqrt{z \cdot z - t \cdot a}} \cdot z} \]
      2. *-commutative84.3%

        \[\leadsto \frac{\color{blue}{y \cdot x}}{\sqrt{z \cdot z - t \cdot a}} \cdot z \]
      3. associate-*l/84.4%

        \[\leadsto \color{blue}{\left(\frac{y}{\sqrt{z \cdot z - t \cdot a}} \cdot x\right)} \cdot z \]
      4. associate-*r*82.1%

        \[\leadsto \color{blue}{\frac{y}{\sqrt{z \cdot z - t \cdot a}} \cdot \left(x \cdot z\right)} \]
      5. sub-neg82.1%

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\left(x \cdot z\right) \cdot y}}{z} \]
      3. associate-*r*47.4%

        \[\leadsto \frac{\color{blue}{x \cdot \left(z \cdot y\right)}}{z} \]
    6. Applied egg-rr47.4%

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

    if 1.44999999999999996e-112 < z

    1. Initial program 64.7%

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

        \[\leadsto \color{blue}{\frac{x \cdot y}{\sqrt{z \cdot z - t \cdot a}} \cdot z} \]
      2. *-commutative64.8%

        \[\leadsto \frac{\color{blue}{y \cdot x}}{\sqrt{z \cdot z - t \cdot a}} \cdot z \]
      3. associate-*l/63.9%

        \[\leadsto \color{blue}{\left(\frac{y}{\sqrt{z \cdot z - t \cdot a}} \cdot x\right)} \cdot z \]
      4. associate-*r*62.1%

        \[\leadsto \color{blue}{\frac{y}{\sqrt{z \cdot z - t \cdot a}} \cdot \left(x \cdot z\right)} \]
      5. sub-neg62.1%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.55 \cdot 10^{-215}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{elif}\;z \leq 1.45 \cdot 10^{-112}:\\ \;\;\;\;\frac{x \cdot \left(z \cdot y\right)}{z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \]

Alternative 17: 73.6% accurate, 18.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -5 \cdot 10^{-310}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= z -5e-310) (* y (- x)) (* x y)))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -5e-310) {
		tmp = y * -x;
	} else {
		tmp = x * y;
	}
	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 (z <= (-5d-310)) then
        tmp = y * -x
    else
        tmp = x * y
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -5e-310) {
		tmp = y * -x;
	} else {
		tmp = x * y;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if z <= -5e-310:
		tmp = y * -x
	else:
		tmp = x * y
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (z <= -5e-310)
		tmp = Float64(y * Float64(-x));
	else
		tmp = Float64(x * y);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (z <= -5e-310)
		tmp = y * -x;
	else
		tmp = x * y;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -5e-310], N[(y * (-x)), $MachinePrecision], N[(x * y), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -5 \cdot 10^{-310}:\\
\;\;\;\;y \cdot \left(-x\right)\\

\mathbf{else}:\\
\;\;\;\;x \cdot y\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -4.999999999999985e-310

    1. Initial program 64.2%

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

        \[\leadsto \color{blue}{\frac{x \cdot y}{\sqrt{z \cdot z - t \cdot a}} \cdot z} \]
      2. *-commutative66.2%

        \[\leadsto \frac{\color{blue}{y \cdot x}}{\sqrt{z \cdot z - t \cdot a}} \cdot z \]
      3. associate-*l/65.5%

        \[\leadsto \color{blue}{\left(\frac{y}{\sqrt{z \cdot z - t \cdot a}} \cdot x\right)} \cdot z \]
      4. associate-*r*61.0%

        \[\leadsto \color{blue}{\frac{y}{\sqrt{z \cdot z - t \cdot a}} \cdot \left(x \cdot z\right)} \]
      5. sub-neg61.0%

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

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

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

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

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

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

        \[\leadsto -1 \cdot \color{blue}{\left(y \cdot x\right)} \]
      2. mul-1-neg66.5%

        \[\leadsto \color{blue}{-y \cdot x} \]
      3. *-commutative66.5%

        \[\leadsto -\color{blue}{x \cdot y} \]
    6. Simplified66.5%

      \[\leadsto \color{blue}{-x \cdot y} \]

    if -4.999999999999985e-310 < z

    1. Initial program 68.6%

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

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

        \[\leadsto \frac{\color{blue}{y \cdot x}}{\sqrt{z \cdot z - t \cdot a}} \cdot z \]
      3. associate-*l/67.1%

        \[\leadsto \color{blue}{\left(\frac{y}{\sqrt{z \cdot z - t \cdot a}} \cdot x\right)} \cdot z \]
      4. associate-*r*67.1%

        \[\leadsto \color{blue}{\frac{y}{\sqrt{z \cdot z - t \cdot a}} \cdot \left(x \cdot z\right)} \]
      5. sub-neg67.1%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -5 \cdot 10^{-310}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \]

Alternative 18: 44.6% accurate, 37.7× speedup?

\[\begin{array}{l} \\ x \cdot y \end{array} \]
(FPCore (x y z t a) :precision binary64 (* x y))
double code(double x, double y, double z, double t, double a) {
	return x * y;
}
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
end function
public static double code(double x, double y, double z, double t, double a) {
	return x * y;
}
def code(x, y, z, t, a):
	return x * y
function code(x, y, z, t, a)
	return Float64(x * y)
end
function tmp = code(x, y, z, t, a)
	tmp = x * y;
end
code[x_, y_, z_, t_, a_] := N[(x * y), $MachinePrecision]
\begin{array}{l}

\\
x \cdot y
\end{array}
Derivation
  1. Initial program 66.4%

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

      \[\leadsto \color{blue}{\frac{x \cdot y}{\sqrt{z \cdot z - t \cdot a}} \cdot z} \]
    2. *-commutative67.0%

      \[\leadsto \frac{\color{blue}{y \cdot x}}{\sqrt{z \cdot z - t \cdot a}} \cdot z \]
    3. associate-*l/66.3%

      \[\leadsto \color{blue}{\left(\frac{y}{\sqrt{z \cdot z - t \cdot a}} \cdot x\right)} \cdot z \]
    4. associate-*r*64.0%

      \[\leadsto \color{blue}{\frac{y}{\sqrt{z \cdot z - t \cdot a}} \cdot \left(x \cdot z\right)} \]
    5. sub-neg64.0%

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

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

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

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

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

    \[\leadsto \color{blue}{x \cdot y} \]
  5. Final simplification43.7%

    \[\leadsto x \cdot y \]

Developer target: 89.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z < -3.1921305903852764 \cdot 10^{+46}:\\ \;\;\;\;-y \cdot x\\ \mathbf{elif}\;z < 5.976268120920894 \cdot 10^{+90}:\\ \;\;\;\;\frac{x \cdot z}{\frac{\sqrt{z \cdot z - a \cdot t}}{y}}\\ \mathbf{else}:\\ \;\;\;\;y \cdot x\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (< z -3.1921305903852764e+46)
   (- (* y x))
   (if (< z 5.976268120920894e+90)
     (/ (* x z) (/ (sqrt (- (* z z) (* a t))) y))
     (* y x))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z < -3.1921305903852764e+46) {
		tmp = -(y * x);
	} else if (z < 5.976268120920894e+90) {
		tmp = (x * z) / (sqrt(((z * z) - (a * t))) / y);
	} else {
		tmp = y * x;
	}
	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 (z < (-3.1921305903852764d+46)) then
        tmp = -(y * x)
    else if (z < 5.976268120920894d+90) then
        tmp = (x * z) / (sqrt(((z * z) - (a * t))) / y)
    else
        tmp = y * x
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z < -3.1921305903852764e+46) {
		tmp = -(y * x);
	} else if (z < 5.976268120920894e+90) {
		tmp = (x * z) / (Math.sqrt(((z * z) - (a * t))) / y);
	} else {
		tmp = y * x;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if z < -3.1921305903852764e+46:
		tmp = -(y * x)
	elif z < 5.976268120920894e+90:
		tmp = (x * z) / (math.sqrt(((z * z) - (a * t))) / y)
	else:
		tmp = y * x
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (z < -3.1921305903852764e+46)
		tmp = Float64(-Float64(y * x));
	elseif (z < 5.976268120920894e+90)
		tmp = Float64(Float64(x * z) / Float64(sqrt(Float64(Float64(z * z) - Float64(a * t))) / y));
	else
		tmp = Float64(y * x);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (z < -3.1921305903852764e+46)
		tmp = -(y * x);
	elseif (z < 5.976268120920894e+90)
		tmp = (x * z) / (sqrt(((z * z) - (a * t))) / y);
	else
		tmp = y * x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[Less[z, -3.1921305903852764e+46], (-N[(y * x), $MachinePrecision]), If[Less[z, 5.976268120920894e+90], N[(N[(x * z), $MachinePrecision] / N[(N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(y * x), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z < -3.1921305903852764 \cdot 10^{+46}:\\
\;\;\;\;-y \cdot x\\

\mathbf{elif}\;z < 5.976268120920894 \cdot 10^{+90}:\\
\;\;\;\;\frac{x \cdot z}{\frac{\sqrt{z \cdot z - a \cdot t}}{y}}\\

\mathbf{else}:\\
\;\;\;\;y \cdot x\\


\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2023301 
(FPCore (x y z t a)
  :name "Statistics.Math.RootFinding:ridders from math-functions-0.1.5.2"
  :precision binary64

  :herbie-target
  (if (< z -3.1921305903852764e+46) (- (* y x)) (if (< z 5.976268120920894e+90) (/ (* x z) (/ (sqrt (- (* z z) (* a t))) y)) (* y x)))

  (/ (* (* x y) z) (sqrt (- (* z z) (* t a)))))