Diagrams.TwoD.Apollonian:descartes from diagrams-contrib-1.3.0.5

Percentage Accurate: 70.3% → 96.7%
Time: 13.2s
Alternatives: 14
Speedup: 1.0×

Specification

?
\[\begin{array}{l} \\ 2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (* 2.0 (sqrt (+ (+ (* x y) (* x z)) (* y z)))))
double code(double x, double y, double z) {
	return 2.0 * sqrt((((x * y) + (x * z)) + (y * z)));
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    code = 2.0d0 * sqrt((((x * y) + (x * z)) + (y * z)))
end function
public static double code(double x, double y, double z) {
	return 2.0 * Math.sqrt((((x * y) + (x * z)) + (y * z)));
}
def code(x, y, z):
	return 2.0 * math.sqrt((((x * y) + (x * z)) + (y * z)))
function code(x, y, z)
	return Float64(2.0 * sqrt(Float64(Float64(Float64(x * y) + Float64(x * z)) + Float64(y * z))))
end
function tmp = code(x, y, z)
	tmp = 2.0 * sqrt((((x * y) + (x * z)) + (y * z)));
end
code[x_, y_, z_] := N[(2.0 * N[Sqrt[N[(N[(N[(x * y), $MachinePrecision] + N[(x * z), $MachinePrecision]), $MachinePrecision] + N[(y * z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z}
\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 14 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: 70.3% accurate, 1.0× speedup?

\[\begin{array}{l} \\ 2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (* 2.0 (sqrt (+ (+ (* x y) (* x z)) (* y z)))))
double code(double x, double y, double z) {
	return 2.0 * sqrt((((x * y) + (x * z)) + (y * z)));
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    code = 2.0d0 * sqrt((((x * y) + (x * z)) + (y * z)))
end function
public static double code(double x, double y, double z) {
	return 2.0 * Math.sqrt((((x * y) + (x * z)) + (y * z)));
}
def code(x, y, z):
	return 2.0 * math.sqrt((((x * y) + (x * z)) + (y * z)))
function code(x, y, z)
	return Float64(2.0 * sqrt(Float64(Float64(Float64(x * y) + Float64(x * z)) + Float64(y * z))))
end
function tmp = code(x, y, z)
	tmp = 2.0 * sqrt((((x * y) + (x * z)) + (y * z)));
end
code[x_, y_, z_] := N[(2.0 * N[Sqrt[N[(N[(N[(x * y), $MachinePrecision] + N[(x * z), $MachinePrecision]), $MachinePrecision] + N[(y * z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z}
\end{array}

Alternative 1: 96.7% accurate, 0.3× speedup?

\[\begin{array}{l} [x, y, z] = \mathsf{sort}([x, y, z])\\ \\ \begin{array}{l} t_0 := \log \left(\left(-y\right) - z\right) - \log \left(\frac{-1}{x}\right)\\ \mathbf{if}\;y \leq -6.1 \cdot 10^{+36}:\\ \;\;\;\;2 \cdot {\left(e^{0.25 \cdot t_0}\right)}^{2}\\ \mathbf{elif}\;y \leq -5.6 \cdot 10^{-192}:\\ \;\;\;\;2 \cdot \sqrt{x \cdot \left(y + z\right)}\\ \mathbf{elif}\;y \leq -5.2 \cdot 10^{-306}:\\ \;\;\;\;2 \cdot \frac{1}{{\left(e^{-0.5}\right)}^{t_0}}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(\sqrt{y + x} \cdot \sqrt{z}\right)\\ \end{array} \end{array} \]
NOTE: x, y, and z should be sorted in increasing order before calling this function.
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (- (log (- (- y) z)) (log (/ -1.0 x)))))
   (if (<= y -6.1e+36)
     (* 2.0 (pow (exp (* 0.25 t_0)) 2.0))
     (if (<= y -5.6e-192)
       (* 2.0 (sqrt (* x (+ y z))))
       (if (<= y -5.2e-306)
         (* 2.0 (/ 1.0 (pow (exp -0.5) t_0)))
         (* 2.0 (* (sqrt (+ y x)) (sqrt z))))))))
assert(x < y && y < z);
double code(double x, double y, double z) {
	double t_0 = log((-y - z)) - log((-1.0 / x));
	double tmp;
	if (y <= -6.1e+36) {
		tmp = 2.0 * pow(exp((0.25 * t_0)), 2.0);
	} else if (y <= -5.6e-192) {
		tmp = 2.0 * sqrt((x * (y + z)));
	} else if (y <= -5.2e-306) {
		tmp = 2.0 * (1.0 / pow(exp(-0.5), t_0));
	} else {
		tmp = 2.0 * (sqrt((y + x)) * sqrt(z));
	}
	return tmp;
}
NOTE: x, y, and z should be sorted in increasing order before calling this function.
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: tmp
    t_0 = log((-y - z)) - log(((-1.0d0) / x))
    if (y <= (-6.1d+36)) then
        tmp = 2.0d0 * (exp((0.25d0 * t_0)) ** 2.0d0)
    else if (y <= (-5.6d-192)) then
        tmp = 2.0d0 * sqrt((x * (y + z)))
    else if (y <= (-5.2d-306)) then
        tmp = 2.0d0 * (1.0d0 / (exp((-0.5d0)) ** t_0))
    else
        tmp = 2.0d0 * (sqrt((y + x)) * sqrt(z))
    end if
    code = tmp
end function
assert x < y && y < z;
public static double code(double x, double y, double z) {
	double t_0 = Math.log((-y - z)) - Math.log((-1.0 / x));
	double tmp;
	if (y <= -6.1e+36) {
		tmp = 2.0 * Math.pow(Math.exp((0.25 * t_0)), 2.0);
	} else if (y <= -5.6e-192) {
		tmp = 2.0 * Math.sqrt((x * (y + z)));
	} else if (y <= -5.2e-306) {
		tmp = 2.0 * (1.0 / Math.pow(Math.exp(-0.5), t_0));
	} else {
		tmp = 2.0 * (Math.sqrt((y + x)) * Math.sqrt(z));
	}
	return tmp;
}
[x, y, z] = sort([x, y, z])
def code(x, y, z):
	t_0 = math.log((-y - z)) - math.log((-1.0 / x))
	tmp = 0
	if y <= -6.1e+36:
		tmp = 2.0 * math.pow(math.exp((0.25 * t_0)), 2.0)
	elif y <= -5.6e-192:
		tmp = 2.0 * math.sqrt((x * (y + z)))
	elif y <= -5.2e-306:
		tmp = 2.0 * (1.0 / math.pow(math.exp(-0.5), t_0))
	else:
		tmp = 2.0 * (math.sqrt((y + x)) * math.sqrt(z))
	return tmp
x, y, z = sort([x, y, z])
function code(x, y, z)
	t_0 = Float64(log(Float64(Float64(-y) - z)) - log(Float64(-1.0 / x)))
	tmp = 0.0
	if (y <= -6.1e+36)
		tmp = Float64(2.0 * (exp(Float64(0.25 * t_0)) ^ 2.0));
	elseif (y <= -5.6e-192)
		tmp = Float64(2.0 * sqrt(Float64(x * Float64(y + z))));
	elseif (y <= -5.2e-306)
		tmp = Float64(2.0 * Float64(1.0 / (exp(-0.5) ^ t_0)));
	else
		tmp = Float64(2.0 * Float64(sqrt(Float64(y + x)) * sqrt(z)));
	end
	return tmp
end
x, y, z = num2cell(sort([x, y, z])){:}
function tmp_2 = code(x, y, z)
	t_0 = log((-y - z)) - log((-1.0 / x));
	tmp = 0.0;
	if (y <= -6.1e+36)
		tmp = 2.0 * (exp((0.25 * t_0)) ^ 2.0);
	elseif (y <= -5.6e-192)
		tmp = 2.0 * sqrt((x * (y + z)));
	elseif (y <= -5.2e-306)
		tmp = 2.0 * (1.0 / (exp(-0.5) ^ t_0));
	else
		tmp = 2.0 * (sqrt((y + x)) * sqrt(z));
	end
	tmp_2 = tmp;
end
NOTE: x, y, and z should be sorted in increasing order before calling this function.
code[x_, y_, z_] := Block[{t$95$0 = N[(N[Log[N[((-y) - z), $MachinePrecision]], $MachinePrecision] - N[Log[N[(-1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -6.1e+36], N[(2.0 * N[Power[N[Exp[N[(0.25 * t$95$0), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -5.6e-192], N[(2.0 * N[Sqrt[N[(x * N[(y + z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -5.2e-306], N[(2.0 * N[(1.0 / N[Power[N[Exp[-0.5], $MachinePrecision], t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[Sqrt[N[(y + x), $MachinePrecision]], $MachinePrecision] * N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z] = \mathsf{sort}([x, y, z])\\
\\
\begin{array}{l}
t_0 := \log \left(\left(-y\right) - z\right) - \log \left(\frac{-1}{x}\right)\\
\mathbf{if}\;y \leq -6.1 \cdot 10^{+36}:\\
\;\;\;\;2 \cdot {\left(e^{0.25 \cdot t_0}\right)}^{2}\\

\mathbf{elif}\;y \leq -5.6 \cdot 10^{-192}:\\
\;\;\;\;2 \cdot \sqrt{x \cdot \left(y + z\right)}\\

\mathbf{elif}\;y \leq -5.2 \cdot 10^{-306}:\\
\;\;\;\;2 \cdot \frac{1}{{\left(e^{-0.5}\right)}^{t_0}}\\

\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\sqrt{y + x} \cdot \sqrt{z}\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -6.1e36

    1. Initial program 55.6%

      \[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z} \]
    2. Step-by-step derivation
      1. distribute-lft-out55.7%

        \[\leadsto 2 \cdot \sqrt{\color{blue}{x \cdot \left(y + z\right)} + y \cdot z} \]
    3. Simplified55.7%

      \[\leadsto \color{blue}{2 \cdot \sqrt{x \cdot \left(y + z\right) + y \cdot z}} \]
    4. Step-by-step derivation
      1. add-sqr-sqrt55.4%

        \[\leadsto 2 \cdot \color{blue}{\left(\sqrt{\sqrt{x \cdot \left(y + z\right) + y \cdot z}} \cdot \sqrt{\sqrt{x \cdot \left(y + z\right) + y \cdot z}}\right)} \]
      2. pow255.4%

        \[\leadsto 2 \cdot \color{blue}{{\left(\sqrt{\sqrt{x \cdot \left(y + z\right) + y \cdot z}}\right)}^{2}} \]
      3. pow1/255.4%

        \[\leadsto 2 \cdot {\left(\sqrt{\color{blue}{{\left(x \cdot \left(y + z\right) + y \cdot z\right)}^{0.5}}}\right)}^{2} \]
      4. sqrt-pow155.4%

        \[\leadsto 2 \cdot {\color{blue}{\left({\left(x \cdot \left(y + z\right) + y \cdot z\right)}^{\left(\frac{0.5}{2}\right)}\right)}}^{2} \]
      5. fma-def56.1%

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

        \[\leadsto 2 \cdot {\left({\left(\mathsf{fma}\left(x, y + z, y \cdot z\right)\right)}^{\color{blue}{0.25}}\right)}^{2} \]
    5. Applied egg-rr56.1%

      \[\leadsto 2 \cdot \color{blue}{{\left({\left(\mathsf{fma}\left(x, y + z, y \cdot z\right)\right)}^{0.25}\right)}^{2}} \]
    6. Taylor expanded in x around -inf 47.5%

      \[\leadsto 2 \cdot {\color{blue}{\left(e^{0.25 \cdot \left(-1 \cdot \log \left(\frac{-1}{x}\right) + \log \left(-1 \cdot \left(y + z\right)\right)\right)}\right)}}^{2} \]

    if -6.1e36 < y < -5.60000000000000007e-192

    1. Initial program 85.4%

      \[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z} \]
    2. Step-by-step derivation
      1. distribute-lft-out85.4%

        \[\leadsto 2 \cdot \sqrt{\color{blue}{x \cdot \left(y + z\right)} + y \cdot z} \]
    3. Simplified85.4%

      \[\leadsto \color{blue}{2 \cdot \sqrt{x \cdot \left(y + z\right) + y \cdot z}} \]
    4. Taylor expanded in x around inf 52.8%

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

    if -5.60000000000000007e-192 < y < -5.2000000000000001e-306

    1. Initial program 74.3%

      \[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z} \]
    2. Step-by-step derivation
      1. distribute-lft-out74.3%

        \[\leadsto 2 \cdot \sqrt{\color{blue}{x \cdot \left(y + z\right)} + y \cdot z} \]
    3. Simplified74.3%

      \[\leadsto \color{blue}{2 \cdot \sqrt{x \cdot \left(y + z\right) + y \cdot z}} \]
    4. Step-by-step derivation
      1. flip-+58.7%

        \[\leadsto 2 \cdot \sqrt{\color{blue}{\frac{\left(x \cdot \left(y + z\right)\right) \cdot \left(x \cdot \left(y + z\right)\right) - \left(y \cdot z\right) \cdot \left(y \cdot z\right)}{x \cdot \left(y + z\right) - y \cdot z}}} \]
      2. clear-num58.7%

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

        \[\leadsto 2 \cdot \sqrt{\frac{1}{\frac{x \cdot \left(y + z\right) - y \cdot z}{\color{blue}{{\left(x \cdot \left(y + z\right)\right)}^{2}} - \left(y \cdot z\right) \cdot \left(y \cdot z\right)}}} \]
      4. pow258.7%

        \[\leadsto 2 \cdot \sqrt{\frac{1}{\frac{x \cdot \left(y + z\right) - y \cdot z}{{\left(x \cdot \left(y + z\right)\right)}^{2} - \color{blue}{{\left(y \cdot z\right)}^{2}}}}} \]
    5. Applied egg-rr58.7%

      \[\leadsto 2 \cdot \sqrt{\color{blue}{\frac{1}{\frac{x \cdot \left(y + z\right) - y \cdot z}{{\left(x \cdot \left(y + z\right)\right)}^{2} - {\left(y \cdot z\right)}^{2}}}}} \]
    6. Step-by-step derivation
      1. inv-pow58.7%

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

        \[\leadsto 2 \cdot \color{blue}{{\left(\frac{x \cdot \left(y + z\right) - y \cdot z}{{\left(x \cdot \left(y + z\right)\right)}^{2} - {\left(y \cdot z\right)}^{2}}\right)}^{\left(\frac{-1}{2}\right)}} \]
      3. clear-num58.7%

        \[\leadsto 2 \cdot {\color{blue}{\left(\frac{1}{\frac{{\left(x \cdot \left(y + z\right)\right)}^{2} - {\left(y \cdot z\right)}^{2}}{x \cdot \left(y + z\right) - y \cdot z}}\right)}}^{\left(\frac{-1}{2}\right)} \]
      4. unpow258.7%

        \[\leadsto 2 \cdot {\left(\frac{1}{\frac{\color{blue}{\left(x \cdot \left(y + z\right)\right) \cdot \left(x \cdot \left(y + z\right)\right)} - {\left(y \cdot z\right)}^{2}}{x \cdot \left(y + z\right) - y \cdot z}}\right)}^{\left(\frac{-1}{2}\right)} \]
      5. unpow258.7%

        \[\leadsto 2 \cdot {\left(\frac{1}{\frac{\left(x \cdot \left(y + z\right)\right) \cdot \left(x \cdot \left(y + z\right)\right) - \color{blue}{\left(y \cdot z\right) \cdot \left(y \cdot z\right)}}{x \cdot \left(y + z\right) - y \cdot z}}\right)}^{\left(\frac{-1}{2}\right)} \]
      6. flip-+72.3%

        \[\leadsto 2 \cdot {\left(\frac{1}{\color{blue}{x \cdot \left(y + z\right) + y \cdot z}}\right)}^{\left(\frac{-1}{2}\right)} \]
      7. fma-udef72.3%

        \[\leadsto 2 \cdot {\left(\frac{1}{\color{blue}{\mathsf{fma}\left(x, y + z, y \cdot z\right)}}\right)}^{\left(\frac{-1}{2}\right)} \]
      8. metadata-eval72.3%

        \[\leadsto 2 \cdot {\left(\frac{1}{\mathsf{fma}\left(x, y + z, y \cdot z\right)}\right)}^{\color{blue}{-0.5}} \]
    7. Applied egg-rr72.3%

      \[\leadsto 2 \cdot \color{blue}{{\left(\frac{1}{\mathsf{fma}\left(x, y + z, y \cdot z\right)}\right)}^{-0.5}} \]
    8. Step-by-step derivation
      1. fma-def72.3%

        \[\leadsto 2 \cdot {\left(\frac{1}{\color{blue}{x \cdot \left(y + z\right) + y \cdot z}}\right)}^{-0.5} \]
      2. +-commutative72.3%

        \[\leadsto 2 \cdot {\left(\frac{1}{\color{blue}{y \cdot z + x \cdot \left(y + z\right)}}\right)}^{-0.5} \]
      3. fma-udef72.3%

        \[\leadsto 2 \cdot {\left(\frac{1}{\color{blue}{\mathsf{fma}\left(y, z, x \cdot \left(y + z\right)\right)}}\right)}^{-0.5} \]
    9. Simplified72.3%

      \[\leadsto 2 \cdot \color{blue}{{\left(\frac{1}{\mathsf{fma}\left(y, z, x \cdot \left(y + z\right)\right)}\right)}^{-0.5}} \]
    10. Step-by-step derivation
      1. add-sqr-sqrt71.7%

        \[\leadsto 2 \cdot {\color{blue}{\left(\sqrt{\frac{1}{\mathsf{fma}\left(y, z, x \cdot \left(y + z\right)\right)}} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(y, z, x \cdot \left(y + z\right)\right)}}\right)}}^{-0.5} \]
      2. unpow-prod-down71.6%

        \[\leadsto 2 \cdot \color{blue}{\left({\left(\sqrt{\frac{1}{\mathsf{fma}\left(y, z, x \cdot \left(y + z\right)\right)}}\right)}^{-0.5} \cdot {\left(\sqrt{\frac{1}{\mathsf{fma}\left(y, z, x \cdot \left(y + z\right)\right)}}\right)}^{-0.5}\right)} \]
      3. inv-pow71.6%

        \[\leadsto 2 \cdot \left({\left(\sqrt{\color{blue}{{\left(\mathsf{fma}\left(y, z, x \cdot \left(y + z\right)\right)\right)}^{-1}}}\right)}^{-0.5} \cdot {\left(\sqrt{\frac{1}{\mathsf{fma}\left(y, z, x \cdot \left(y + z\right)\right)}}\right)}^{-0.5}\right) \]
      4. sqrt-pow171.5%

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

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

        \[\leadsto 2 \cdot \left({\left({\left(\mathsf{fma}\left(y, z, x \cdot \left(y + z\right)\right)\right)}^{-0.5}\right)}^{-0.5} \cdot {\left(\sqrt{\color{blue}{{\left(\mathsf{fma}\left(y, z, x \cdot \left(y + z\right)\right)\right)}^{-1}}}\right)}^{-0.5}\right) \]
      7. sqrt-pow173.8%

        \[\leadsto 2 \cdot \left({\left({\left(\mathsf{fma}\left(y, z, x \cdot \left(y + z\right)\right)\right)}^{-0.5}\right)}^{-0.5} \cdot {\color{blue}{\left({\left(\mathsf{fma}\left(y, z, x \cdot \left(y + z\right)\right)\right)}^{\left(\frac{-1}{2}\right)}\right)}}^{-0.5}\right) \]
      8. metadata-eval73.8%

        \[\leadsto 2 \cdot \left({\left({\left(\mathsf{fma}\left(y, z, x \cdot \left(y + z\right)\right)\right)}^{-0.5}\right)}^{-0.5} \cdot {\left({\left(\mathsf{fma}\left(y, z, x \cdot \left(y + z\right)\right)\right)}^{\color{blue}{-0.5}}\right)}^{-0.5}\right) \]
    11. Applied egg-rr73.8%

      \[\leadsto 2 \cdot \color{blue}{\left({\left({\left(\mathsf{fma}\left(y, z, x \cdot \left(y + z\right)\right)\right)}^{-0.5}\right)}^{-0.5} \cdot {\left({\left(\mathsf{fma}\left(y, z, x \cdot \left(y + z\right)\right)\right)}^{-0.5}\right)}^{-0.5}\right)} \]
    12. Step-by-step derivation
      1. pow-sqr74.1%

        \[\leadsto 2 \cdot \color{blue}{{\left({\left(\mathsf{fma}\left(y, z, x \cdot \left(y + z\right)\right)\right)}^{-0.5}\right)}^{\left(2 \cdot -0.5\right)}} \]
      2. metadata-eval74.1%

        \[\leadsto 2 \cdot {\left({\left(\mathsf{fma}\left(y, z, x \cdot \left(y + z\right)\right)\right)}^{-0.5}\right)}^{\color{blue}{-1}} \]
      3. unpow-174.1%

        \[\leadsto 2 \cdot \color{blue}{\frac{1}{{\left(\mathsf{fma}\left(y, z, x \cdot \left(y + z\right)\right)\right)}^{-0.5}}} \]
      4. fma-udef74.1%

        \[\leadsto 2 \cdot \frac{1}{{\color{blue}{\left(y \cdot z + x \cdot \left(y + z\right)\right)}}^{-0.5}} \]
      5. *-commutative74.1%

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

        \[\leadsto 2 \cdot \frac{1}{{\left(z \cdot y + \color{blue}{\left(y + z\right) \cdot x}\right)}^{-0.5}} \]
      7. fma-def74.1%

        \[\leadsto 2 \cdot \frac{1}{{\color{blue}{\left(\mathsf{fma}\left(z, y, \left(y + z\right) \cdot x\right)\right)}}^{-0.5}} \]
      8. *-commutative74.1%

        \[\leadsto 2 \cdot \frac{1}{{\left(\mathsf{fma}\left(z, y, \color{blue}{x \cdot \left(y + z\right)}\right)\right)}^{-0.5}} \]
      9. +-commutative74.1%

        \[\leadsto 2 \cdot \frac{1}{{\left(\mathsf{fma}\left(z, y, x \cdot \color{blue}{\left(z + y\right)}\right)\right)}^{-0.5}} \]
    13. Simplified74.1%

      \[\leadsto 2 \cdot \color{blue}{\frac{1}{{\left(\mathsf{fma}\left(z, y, x \cdot \left(z + y\right)\right)\right)}^{-0.5}}} \]
    14. Taylor expanded in x around -inf 42.4%

      \[\leadsto 2 \cdot \frac{1}{\color{blue}{e^{-0.5 \cdot \left(-1 \cdot \log \left(\frac{-1}{x}\right) + \log \left(-1 \cdot \left(y + z\right)\right)\right)}}} \]
    15. Step-by-step derivation
      1. exp-prod42.4%

        \[\leadsto 2 \cdot \frac{1}{\color{blue}{{\left(e^{-0.5}\right)}^{\left(-1 \cdot \log \left(\frac{-1}{x}\right) + \log \left(-1 \cdot \left(y + z\right)\right)\right)}}} \]
      2. +-commutative42.4%

        \[\leadsto 2 \cdot \frac{1}{{\left(e^{-0.5}\right)}^{\color{blue}{\left(\log \left(-1 \cdot \left(y + z\right)\right) + -1 \cdot \log \left(\frac{-1}{x}\right)\right)}}} \]
      3. mul-1-neg42.4%

        \[\leadsto 2 \cdot \frac{1}{{\left(e^{-0.5}\right)}^{\left(\log \left(-1 \cdot \left(y + z\right)\right) + \color{blue}{\left(-\log \left(\frac{-1}{x}\right)\right)}\right)}} \]
      4. unsub-neg42.4%

        \[\leadsto 2 \cdot \frac{1}{{\left(e^{-0.5}\right)}^{\color{blue}{\left(\log \left(-1 \cdot \left(y + z\right)\right) - \log \left(\frac{-1}{x}\right)\right)}}} \]
      5. distribute-lft-in42.4%

        \[\leadsto 2 \cdot \frac{1}{{\left(e^{-0.5}\right)}^{\left(\log \color{blue}{\left(-1 \cdot y + -1 \cdot z\right)} - \log \left(\frac{-1}{x}\right)\right)}} \]
      6. mul-1-neg42.4%

        \[\leadsto 2 \cdot \frac{1}{{\left(e^{-0.5}\right)}^{\left(\log \left(-1 \cdot y + \color{blue}{\left(-z\right)}\right) - \log \left(\frac{-1}{x}\right)\right)}} \]
      7. unsub-neg42.4%

        \[\leadsto 2 \cdot \frac{1}{{\left(e^{-0.5}\right)}^{\left(\log \color{blue}{\left(-1 \cdot y - z\right)} - \log \left(\frac{-1}{x}\right)\right)}} \]
      8. mul-1-neg42.4%

        \[\leadsto 2 \cdot \frac{1}{{\left(e^{-0.5}\right)}^{\left(\log \left(\color{blue}{\left(-y\right)} - z\right) - \log \left(\frac{-1}{x}\right)\right)}} \]
    16. Simplified42.4%

      \[\leadsto 2 \cdot \frac{1}{\color{blue}{{\left(e^{-0.5}\right)}^{\left(\log \left(\left(-y\right) - z\right) - \log \left(\frac{-1}{x}\right)\right)}}} \]

    if -5.2000000000000001e-306 < y

    1. Initial program 69.4%

      \[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z} \]
    2. Step-by-step derivation
      1. distribute-lft-out69.4%

        \[\leadsto 2 \cdot \sqrt{\color{blue}{x \cdot \left(y + z\right)} + y \cdot z} \]
    3. Simplified69.4%

      \[\leadsto \color{blue}{2 \cdot \sqrt{x \cdot \left(y + z\right) + y \cdot z}} \]
    4. Step-by-step derivation
      1. add-sqr-sqrt69.0%

        \[\leadsto 2 \cdot \color{blue}{\left(\sqrt{\sqrt{x \cdot \left(y + z\right) + y \cdot z}} \cdot \sqrt{\sqrt{x \cdot \left(y + z\right) + y \cdot z}}\right)} \]
      2. pow269.0%

        \[\leadsto 2 \cdot \color{blue}{{\left(\sqrt{\sqrt{x \cdot \left(y + z\right) + y \cdot z}}\right)}^{2}} \]
      3. pow1/269.0%

        \[\leadsto 2 \cdot {\left(\sqrt{\color{blue}{{\left(x \cdot \left(y + z\right) + y \cdot z\right)}^{0.5}}}\right)}^{2} \]
      4. sqrt-pow169.1%

        \[\leadsto 2 \cdot {\color{blue}{\left({\left(x \cdot \left(y + z\right) + y \cdot z\right)}^{\left(\frac{0.5}{2}\right)}\right)}}^{2} \]
      5. fma-def69.5%

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

        \[\leadsto 2 \cdot {\left({\left(\mathsf{fma}\left(x, y + z, y \cdot z\right)\right)}^{\color{blue}{0.25}}\right)}^{2} \]
    5. Applied egg-rr69.5%

      \[\leadsto 2 \cdot \color{blue}{{\left({\left(\mathsf{fma}\left(x, y + z, y \cdot z\right)\right)}^{0.25}\right)}^{2}} \]
    6. Taylor expanded in z around inf 42.7%

      \[\leadsto 2 \cdot {\left({\color{blue}{\left(\left(y + x\right) \cdot z\right)}}^{0.25}\right)}^{2} \]
    7. Step-by-step derivation
      1. pow-pow42.9%

        \[\leadsto 2 \cdot \color{blue}{{\left(\left(y + x\right) \cdot z\right)}^{\left(0.25 \cdot 2\right)}} \]
      2. metadata-eval42.9%

        \[\leadsto 2 \cdot {\left(\left(y + x\right) \cdot z\right)}^{\color{blue}{0.5}} \]
      3. pow1/242.9%

        \[\leadsto 2 \cdot \color{blue}{\sqrt{\left(y + x\right) \cdot z}} \]
      4. sqrt-prod54.7%

        \[\leadsto 2 \cdot \color{blue}{\left(\sqrt{y + x} \cdot \sqrt{z}\right)} \]
    8. Applied egg-rr54.7%

      \[\leadsto 2 \cdot \color{blue}{\left(\sqrt{y + x} \cdot \sqrt{z}\right)} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification51.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -6.1 \cdot 10^{+36}:\\ \;\;\;\;2 \cdot {\left(e^{0.25 \cdot \left(\log \left(\left(-y\right) - z\right) - \log \left(\frac{-1}{x}\right)\right)}\right)}^{2}\\ \mathbf{elif}\;y \leq -5.6 \cdot 10^{-192}:\\ \;\;\;\;2 \cdot \sqrt{x \cdot \left(y + z\right)}\\ \mathbf{elif}\;y \leq -5.2 \cdot 10^{-306}:\\ \;\;\;\;2 \cdot \frac{1}{{\left(e^{-0.5}\right)}^{\left(\log \left(\left(-y\right) - z\right) - \log \left(\frac{-1}{x}\right)\right)}}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(\sqrt{y + x} \cdot \sqrt{z}\right)\\ \end{array} \]

Alternative 2: 96.7% accurate, 0.3× speedup?

\[\begin{array}{l} [x, y, z] = \mathsf{sort}([x, y, z])\\ \\ \begin{array}{l} t_0 := \log \left(\left(-y\right) - z\right) - \log \left(\frac{-1}{x}\right)\\ \mathbf{if}\;y \leq -2.6 \cdot 10^{+39}:\\ \;\;\;\;2 \cdot \frac{1}{e^{t_0 \cdot -0.5}}\\ \mathbf{elif}\;y \leq -6.5 \cdot 10^{-192}:\\ \;\;\;\;2 \cdot \sqrt{x \cdot \left(y + z\right)}\\ \mathbf{elif}\;y \leq -1.1 \cdot 10^{-302}:\\ \;\;\;\;2 \cdot \frac{1}{{\left(e^{-0.5}\right)}^{t_0}}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(\sqrt{y + x} \cdot \sqrt{z}\right)\\ \end{array} \end{array} \]
NOTE: x, y, and z should be sorted in increasing order before calling this function.
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (- (log (- (- y) z)) (log (/ -1.0 x)))))
   (if (<= y -2.6e+39)
     (* 2.0 (/ 1.0 (exp (* t_0 -0.5))))
     (if (<= y -6.5e-192)
       (* 2.0 (sqrt (* x (+ y z))))
       (if (<= y -1.1e-302)
         (* 2.0 (/ 1.0 (pow (exp -0.5) t_0)))
         (* 2.0 (* (sqrt (+ y x)) (sqrt z))))))))
assert(x < y && y < z);
double code(double x, double y, double z) {
	double t_0 = log((-y - z)) - log((-1.0 / x));
	double tmp;
	if (y <= -2.6e+39) {
		tmp = 2.0 * (1.0 / exp((t_0 * -0.5)));
	} else if (y <= -6.5e-192) {
		tmp = 2.0 * sqrt((x * (y + z)));
	} else if (y <= -1.1e-302) {
		tmp = 2.0 * (1.0 / pow(exp(-0.5), t_0));
	} else {
		tmp = 2.0 * (sqrt((y + x)) * sqrt(z));
	}
	return tmp;
}
NOTE: x, y, and z should be sorted in increasing order before calling this function.
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: tmp
    t_0 = log((-y - z)) - log(((-1.0d0) / x))
    if (y <= (-2.6d+39)) then
        tmp = 2.0d0 * (1.0d0 / exp((t_0 * (-0.5d0))))
    else if (y <= (-6.5d-192)) then
        tmp = 2.0d0 * sqrt((x * (y + z)))
    else if (y <= (-1.1d-302)) then
        tmp = 2.0d0 * (1.0d0 / (exp((-0.5d0)) ** t_0))
    else
        tmp = 2.0d0 * (sqrt((y + x)) * sqrt(z))
    end if
    code = tmp
end function
assert x < y && y < z;
public static double code(double x, double y, double z) {
	double t_0 = Math.log((-y - z)) - Math.log((-1.0 / x));
	double tmp;
	if (y <= -2.6e+39) {
		tmp = 2.0 * (1.0 / Math.exp((t_0 * -0.5)));
	} else if (y <= -6.5e-192) {
		tmp = 2.0 * Math.sqrt((x * (y + z)));
	} else if (y <= -1.1e-302) {
		tmp = 2.0 * (1.0 / Math.pow(Math.exp(-0.5), t_0));
	} else {
		tmp = 2.0 * (Math.sqrt((y + x)) * Math.sqrt(z));
	}
	return tmp;
}
[x, y, z] = sort([x, y, z])
def code(x, y, z):
	t_0 = math.log((-y - z)) - math.log((-1.0 / x))
	tmp = 0
	if y <= -2.6e+39:
		tmp = 2.0 * (1.0 / math.exp((t_0 * -0.5)))
	elif y <= -6.5e-192:
		tmp = 2.0 * math.sqrt((x * (y + z)))
	elif y <= -1.1e-302:
		tmp = 2.0 * (1.0 / math.pow(math.exp(-0.5), t_0))
	else:
		tmp = 2.0 * (math.sqrt((y + x)) * math.sqrt(z))
	return tmp
x, y, z = sort([x, y, z])
function code(x, y, z)
	t_0 = Float64(log(Float64(Float64(-y) - z)) - log(Float64(-1.0 / x)))
	tmp = 0.0
	if (y <= -2.6e+39)
		tmp = Float64(2.0 * Float64(1.0 / exp(Float64(t_0 * -0.5))));
	elseif (y <= -6.5e-192)
		tmp = Float64(2.0 * sqrt(Float64(x * Float64(y + z))));
	elseif (y <= -1.1e-302)
		tmp = Float64(2.0 * Float64(1.0 / (exp(-0.5) ^ t_0)));
	else
		tmp = Float64(2.0 * Float64(sqrt(Float64(y + x)) * sqrt(z)));
	end
	return tmp
end
x, y, z = num2cell(sort([x, y, z])){:}
function tmp_2 = code(x, y, z)
	t_0 = log((-y - z)) - log((-1.0 / x));
	tmp = 0.0;
	if (y <= -2.6e+39)
		tmp = 2.0 * (1.0 / exp((t_0 * -0.5)));
	elseif (y <= -6.5e-192)
		tmp = 2.0 * sqrt((x * (y + z)));
	elseif (y <= -1.1e-302)
		tmp = 2.0 * (1.0 / (exp(-0.5) ^ t_0));
	else
		tmp = 2.0 * (sqrt((y + x)) * sqrt(z));
	end
	tmp_2 = tmp;
end
NOTE: x, y, and z should be sorted in increasing order before calling this function.
code[x_, y_, z_] := Block[{t$95$0 = N[(N[Log[N[((-y) - z), $MachinePrecision]], $MachinePrecision] - N[Log[N[(-1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.6e+39], N[(2.0 * N[(1.0 / N[Exp[N[(t$95$0 * -0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -6.5e-192], N[(2.0 * N[Sqrt[N[(x * N[(y + z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1.1e-302], N[(2.0 * N[(1.0 / N[Power[N[Exp[-0.5], $MachinePrecision], t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[Sqrt[N[(y + x), $MachinePrecision]], $MachinePrecision] * N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z] = \mathsf{sort}([x, y, z])\\
\\
\begin{array}{l}
t_0 := \log \left(\left(-y\right) - z\right) - \log \left(\frac{-1}{x}\right)\\
\mathbf{if}\;y \leq -2.6 \cdot 10^{+39}:\\
\;\;\;\;2 \cdot \frac{1}{e^{t_0 \cdot -0.5}}\\

\mathbf{elif}\;y \leq -6.5 \cdot 10^{-192}:\\
\;\;\;\;2 \cdot \sqrt{x \cdot \left(y + z\right)}\\

\mathbf{elif}\;y \leq -1.1 \cdot 10^{-302}:\\
\;\;\;\;2 \cdot \frac{1}{{\left(e^{-0.5}\right)}^{t_0}}\\

\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\sqrt{y + x} \cdot \sqrt{z}\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -2.6e39

    1. Initial program 55.6%

      \[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z} \]
    2. Step-by-step derivation
      1. distribute-lft-out55.7%

        \[\leadsto 2 \cdot \sqrt{\color{blue}{x \cdot \left(y + z\right)} + y \cdot z} \]
    3. Simplified55.7%

      \[\leadsto \color{blue}{2 \cdot \sqrt{x \cdot \left(y + z\right) + y \cdot z}} \]
    4. Step-by-step derivation
      1. flip-+21.4%

        \[\leadsto 2 \cdot \sqrt{\color{blue}{\frac{\left(x \cdot \left(y + z\right)\right) \cdot \left(x \cdot \left(y + z\right)\right) - \left(y \cdot z\right) \cdot \left(y \cdot z\right)}{x \cdot \left(y + z\right) - y \cdot z}}} \]
      2. clear-num21.4%

        \[\leadsto 2 \cdot \sqrt{\color{blue}{\frac{1}{\frac{x \cdot \left(y + z\right) - y \cdot z}{\left(x \cdot \left(y + z\right)\right) \cdot \left(x \cdot \left(y + z\right)\right) - \left(y \cdot z\right) \cdot \left(y \cdot z\right)}}}} \]
      3. pow221.4%

        \[\leadsto 2 \cdot \sqrt{\frac{1}{\frac{x \cdot \left(y + z\right) - y \cdot z}{\color{blue}{{\left(x \cdot \left(y + z\right)\right)}^{2}} - \left(y \cdot z\right) \cdot \left(y \cdot z\right)}}} \]
      4. pow221.4%

        \[\leadsto 2 \cdot \sqrt{\frac{1}{\frac{x \cdot \left(y + z\right) - y \cdot z}{{\left(x \cdot \left(y + z\right)\right)}^{2} - \color{blue}{{\left(y \cdot z\right)}^{2}}}}} \]
    5. Applied egg-rr21.4%

      \[\leadsto 2 \cdot \sqrt{\color{blue}{\frac{1}{\frac{x \cdot \left(y + z\right) - y \cdot z}{{\left(x \cdot \left(y + z\right)\right)}^{2} - {\left(y \cdot z\right)}^{2}}}}} \]
    6. Step-by-step derivation
      1. inv-pow21.4%

        \[\leadsto 2 \cdot \sqrt{\color{blue}{{\left(\frac{x \cdot \left(y + z\right) - y \cdot z}{{\left(x \cdot \left(y + z\right)\right)}^{2} - {\left(y \cdot z\right)}^{2}}\right)}^{-1}}} \]
      2. sqrt-pow121.4%

        \[\leadsto 2 \cdot \color{blue}{{\left(\frac{x \cdot \left(y + z\right) - y \cdot z}{{\left(x \cdot \left(y + z\right)\right)}^{2} - {\left(y \cdot z\right)}^{2}}\right)}^{\left(\frac{-1}{2}\right)}} \]
      3. clear-num21.4%

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

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

        \[\leadsto 2 \cdot {\left(\frac{1}{\frac{\left(x \cdot \left(y + z\right)\right) \cdot \left(x \cdot \left(y + z\right)\right) - \color{blue}{\left(y \cdot z\right) \cdot \left(y \cdot z\right)}}{x \cdot \left(y + z\right) - y \cdot z}}\right)}^{\left(\frac{-1}{2}\right)} \]
      6. flip-+55.8%

        \[\leadsto 2 \cdot {\left(\frac{1}{\color{blue}{x \cdot \left(y + z\right) + y \cdot z}}\right)}^{\left(\frac{-1}{2}\right)} \]
      7. fma-udef56.5%

        \[\leadsto 2 \cdot {\left(\frac{1}{\color{blue}{\mathsf{fma}\left(x, y + z, y \cdot z\right)}}\right)}^{\left(\frac{-1}{2}\right)} \]
      8. metadata-eval56.5%

        \[\leadsto 2 \cdot {\left(\frac{1}{\mathsf{fma}\left(x, y + z, y \cdot z\right)}\right)}^{\color{blue}{-0.5}} \]
    7. Applied egg-rr56.5%

      \[\leadsto 2 \cdot \color{blue}{{\left(\frac{1}{\mathsf{fma}\left(x, y + z, y \cdot z\right)}\right)}^{-0.5}} \]
    8. Step-by-step derivation
      1. fma-def55.8%

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

        \[\leadsto 2 \cdot {\left(\frac{1}{\color{blue}{y \cdot z + x \cdot \left(y + z\right)}}\right)}^{-0.5} \]
      3. fma-udef56.5%

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

      \[\leadsto 2 \cdot \color{blue}{{\left(\frac{1}{\mathsf{fma}\left(y, z, x \cdot \left(y + z\right)\right)}\right)}^{-0.5}} \]
    10. Step-by-step derivation
      1. add-sqr-sqrt56.4%

        \[\leadsto 2 \cdot {\color{blue}{\left(\sqrt{\frac{1}{\mathsf{fma}\left(y, z, x \cdot \left(y + z\right)\right)}} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(y, z, x \cdot \left(y + z\right)\right)}}\right)}}^{-0.5} \]
      2. unpow-prod-down56.1%

        \[\leadsto 2 \cdot \color{blue}{\left({\left(\sqrt{\frac{1}{\mathsf{fma}\left(y, z, x \cdot \left(y + z\right)\right)}}\right)}^{-0.5} \cdot {\left(\sqrt{\frac{1}{\mathsf{fma}\left(y, z, x \cdot \left(y + z\right)\right)}}\right)}^{-0.5}\right)} \]
      3. inv-pow56.1%

        \[\leadsto 2 \cdot \left({\left(\sqrt{\color{blue}{{\left(\mathsf{fma}\left(y, z, x \cdot \left(y + z\right)\right)\right)}^{-1}}}\right)}^{-0.5} \cdot {\left(\sqrt{\frac{1}{\mathsf{fma}\left(y, z, x \cdot \left(y + z\right)\right)}}\right)}^{-0.5}\right) \]
      4. sqrt-pow156.2%

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

        \[\leadsto 2 \cdot \left({\left({\left(\mathsf{fma}\left(y, z, x \cdot \left(y + z\right)\right)\right)}^{\color{blue}{-0.5}}\right)}^{-0.5} \cdot {\left(\sqrt{\frac{1}{\mathsf{fma}\left(y, z, x \cdot \left(y + z\right)\right)}}\right)}^{-0.5}\right) \]
      6. inv-pow56.2%

        \[\leadsto 2 \cdot \left({\left({\left(\mathsf{fma}\left(y, z, x \cdot \left(y + z\right)\right)\right)}^{-0.5}\right)}^{-0.5} \cdot {\left(\sqrt{\color{blue}{{\left(\mathsf{fma}\left(y, z, x \cdot \left(y + z\right)\right)\right)}^{-1}}}\right)}^{-0.5}\right) \]
      7. sqrt-pow156.1%

        \[\leadsto 2 \cdot \left({\left({\left(\mathsf{fma}\left(y, z, x \cdot \left(y + z\right)\right)\right)}^{-0.5}\right)}^{-0.5} \cdot {\color{blue}{\left({\left(\mathsf{fma}\left(y, z, x \cdot \left(y + z\right)\right)\right)}^{\left(\frac{-1}{2}\right)}\right)}}^{-0.5}\right) \]
      8. metadata-eval56.1%

        \[\leadsto 2 \cdot \left({\left({\left(\mathsf{fma}\left(y, z, x \cdot \left(y + z\right)\right)\right)}^{-0.5}\right)}^{-0.5} \cdot {\left({\left(\mathsf{fma}\left(y, z, x \cdot \left(y + z\right)\right)\right)}^{\color{blue}{-0.5}}\right)}^{-0.5}\right) \]
    11. Applied egg-rr56.1%

      \[\leadsto 2 \cdot \color{blue}{\left({\left({\left(\mathsf{fma}\left(y, z, x \cdot \left(y + z\right)\right)\right)}^{-0.5}\right)}^{-0.5} \cdot {\left({\left(\mathsf{fma}\left(y, z, x \cdot \left(y + z\right)\right)\right)}^{-0.5}\right)}^{-0.5}\right)} \]
    12. Step-by-step derivation
      1. pow-sqr56.4%

        \[\leadsto 2 \cdot \color{blue}{{\left({\left(\mathsf{fma}\left(y, z, x \cdot \left(y + z\right)\right)\right)}^{-0.5}\right)}^{\left(2 \cdot -0.5\right)}} \]
      2. metadata-eval56.4%

        \[\leadsto 2 \cdot {\left({\left(\mathsf{fma}\left(y, z, x \cdot \left(y + z\right)\right)\right)}^{-0.5}\right)}^{\color{blue}{-1}} \]
      3. unpow-156.4%

        \[\leadsto 2 \cdot \color{blue}{\frac{1}{{\left(\mathsf{fma}\left(y, z, x \cdot \left(y + z\right)\right)\right)}^{-0.5}}} \]
      4. fma-udef55.7%

        \[\leadsto 2 \cdot \frac{1}{{\color{blue}{\left(y \cdot z + x \cdot \left(y + z\right)\right)}}^{-0.5}} \]
      5. *-commutative55.7%

        \[\leadsto 2 \cdot \frac{1}{{\left(\color{blue}{z \cdot y} + x \cdot \left(y + z\right)\right)}^{-0.5}} \]
      6. *-commutative55.7%

        \[\leadsto 2 \cdot \frac{1}{{\left(z \cdot y + \color{blue}{\left(y + z\right) \cdot x}\right)}^{-0.5}} \]
      7. fma-def56.4%

        \[\leadsto 2 \cdot \frac{1}{{\color{blue}{\left(\mathsf{fma}\left(z, y, \left(y + z\right) \cdot x\right)\right)}}^{-0.5}} \]
      8. *-commutative56.4%

        \[\leadsto 2 \cdot \frac{1}{{\left(\mathsf{fma}\left(z, y, \color{blue}{x \cdot \left(y + z\right)}\right)\right)}^{-0.5}} \]
      9. +-commutative56.4%

        \[\leadsto 2 \cdot \frac{1}{{\left(\mathsf{fma}\left(z, y, x \cdot \color{blue}{\left(z + y\right)}\right)\right)}^{-0.5}} \]
    13. Simplified56.4%

      \[\leadsto 2 \cdot \color{blue}{\frac{1}{{\left(\mathsf{fma}\left(z, y, x \cdot \left(z + y\right)\right)\right)}^{-0.5}}} \]
    14. Taylor expanded in x around -inf 47.5%

      \[\leadsto 2 \cdot \frac{1}{\color{blue}{e^{-0.5 \cdot \left(-1 \cdot \log \left(\frac{-1}{x}\right) + \log \left(-1 \cdot \left(y + z\right)\right)\right)}}} \]

    if -2.6e39 < y < -6.49999999999999966e-192

    1. Initial program 85.4%

      \[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z} \]
    2. Step-by-step derivation
      1. distribute-lft-out85.4%

        \[\leadsto 2 \cdot \sqrt{\color{blue}{x \cdot \left(y + z\right)} + y \cdot z} \]
    3. Simplified85.4%

      \[\leadsto \color{blue}{2 \cdot \sqrt{x \cdot \left(y + z\right) + y \cdot z}} \]
    4. Taylor expanded in x around inf 52.8%

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

    if -6.49999999999999966e-192 < y < -1.10000000000000004e-302

    1. Initial program 75.7%

      \[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z} \]
    2. Step-by-step derivation
      1. distribute-lft-out75.7%

        \[\leadsto 2 \cdot \sqrt{\color{blue}{x \cdot \left(y + z\right)} + y \cdot z} \]
    3. Simplified75.7%

      \[\leadsto \color{blue}{2 \cdot \sqrt{x \cdot \left(y + z\right) + y \cdot z}} \]
    4. Step-by-step derivation
      1. flip-+59.3%

        \[\leadsto 2 \cdot \sqrt{\color{blue}{\frac{\left(x \cdot \left(y + z\right)\right) \cdot \left(x \cdot \left(y + z\right)\right) - \left(y \cdot z\right) \cdot \left(y \cdot z\right)}{x \cdot \left(y + z\right) - y \cdot z}}} \]
      2. clear-num59.3%

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

        \[\leadsto 2 \cdot \sqrt{\frac{1}{\frac{x \cdot \left(y + z\right) - y \cdot z}{\color{blue}{{\left(x \cdot \left(y + z\right)\right)}^{2}} - \left(y \cdot z\right) \cdot \left(y \cdot z\right)}}} \]
      4. pow259.3%

        \[\leadsto 2 \cdot \sqrt{\frac{1}{\frac{x \cdot \left(y + z\right) - y \cdot z}{{\left(x \cdot \left(y + z\right)\right)}^{2} - \color{blue}{{\left(y \cdot z\right)}^{2}}}}} \]
    5. Applied egg-rr59.3%

      \[\leadsto 2 \cdot \sqrt{\color{blue}{\frac{1}{\frac{x \cdot \left(y + z\right) - y \cdot z}{{\left(x \cdot \left(y + z\right)\right)}^{2} - {\left(y \cdot z\right)}^{2}}}}} \]
    6. Step-by-step derivation
      1. inv-pow59.3%

        \[\leadsto 2 \cdot \sqrt{\color{blue}{{\left(\frac{x \cdot \left(y + z\right) - y \cdot z}{{\left(x \cdot \left(y + z\right)\right)}^{2} - {\left(y \cdot z\right)}^{2}}\right)}^{-1}}} \]
      2. sqrt-pow159.3%

        \[\leadsto 2 \cdot \color{blue}{{\left(\frac{x \cdot \left(y + z\right) - y \cdot z}{{\left(x \cdot \left(y + z\right)\right)}^{2} - {\left(y \cdot z\right)}^{2}}\right)}^{\left(\frac{-1}{2}\right)}} \]
      3. clear-num59.3%

        \[\leadsto 2 \cdot {\color{blue}{\left(\frac{1}{\frac{{\left(x \cdot \left(y + z\right)\right)}^{2} - {\left(y \cdot z\right)}^{2}}{x \cdot \left(y + z\right) - y \cdot z}}\right)}}^{\left(\frac{-1}{2}\right)} \]
      4. unpow259.3%

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

        \[\leadsto 2 \cdot {\left(\frac{1}{\frac{\left(x \cdot \left(y + z\right)\right) \cdot \left(x \cdot \left(y + z\right)\right) - \color{blue}{\left(y \cdot z\right) \cdot \left(y \cdot z\right)}}{x \cdot \left(y + z\right) - y \cdot z}}\right)}^{\left(\frac{-1}{2}\right)} \]
      6. flip-+73.7%

        \[\leadsto 2 \cdot {\left(\frac{1}{\color{blue}{x \cdot \left(y + z\right) + y \cdot z}}\right)}^{\left(\frac{-1}{2}\right)} \]
      7. fma-udef73.7%

        \[\leadsto 2 \cdot {\left(\frac{1}{\color{blue}{\mathsf{fma}\left(x, y + z, y \cdot z\right)}}\right)}^{\left(\frac{-1}{2}\right)} \]
      8. metadata-eval73.7%

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

      \[\leadsto 2 \cdot \color{blue}{{\left(\frac{1}{\mathsf{fma}\left(x, y + z, y \cdot z\right)}\right)}^{-0.5}} \]
    8. Step-by-step derivation
      1. fma-def73.7%

        \[\leadsto 2 \cdot {\left(\frac{1}{\color{blue}{x \cdot \left(y + z\right) + y \cdot z}}\right)}^{-0.5} \]
      2. +-commutative73.7%

        \[\leadsto 2 \cdot {\left(\frac{1}{\color{blue}{y \cdot z + x \cdot \left(y + z\right)}}\right)}^{-0.5} \]
      3. fma-udef73.7%

        \[\leadsto 2 \cdot {\left(\frac{1}{\color{blue}{\mathsf{fma}\left(y, z, x \cdot \left(y + z\right)\right)}}\right)}^{-0.5} \]
    9. Simplified73.7%

      \[\leadsto 2 \cdot \color{blue}{{\left(\frac{1}{\mathsf{fma}\left(y, z, x \cdot \left(y + z\right)\right)}\right)}^{-0.5}} \]
    10. Step-by-step derivation
      1. add-sqr-sqrt73.2%

        \[\leadsto 2 \cdot {\color{blue}{\left(\sqrt{\frac{1}{\mathsf{fma}\left(y, z, x \cdot \left(y + z\right)\right)}} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(y, z, x \cdot \left(y + z\right)\right)}}\right)}}^{-0.5} \]
      2. unpow-prod-down73.1%

        \[\leadsto 2 \cdot \color{blue}{\left({\left(\sqrt{\frac{1}{\mathsf{fma}\left(y, z, x \cdot \left(y + z\right)\right)}}\right)}^{-0.5} \cdot {\left(\sqrt{\frac{1}{\mathsf{fma}\left(y, z, x \cdot \left(y + z\right)\right)}}\right)}^{-0.5}\right)} \]
      3. inv-pow73.1%

        \[\leadsto 2 \cdot \left({\left(\sqrt{\color{blue}{{\left(\mathsf{fma}\left(y, z, x \cdot \left(y + z\right)\right)\right)}^{-1}}}\right)}^{-0.5} \cdot {\left(\sqrt{\frac{1}{\mathsf{fma}\left(y, z, x \cdot \left(y + z\right)\right)}}\right)}^{-0.5}\right) \]
      4. sqrt-pow173.0%

        \[\leadsto 2 \cdot \left({\color{blue}{\left({\left(\mathsf{fma}\left(y, z, x \cdot \left(y + z\right)\right)\right)}^{\left(\frac{-1}{2}\right)}\right)}}^{-0.5} \cdot {\left(\sqrt{\frac{1}{\mathsf{fma}\left(y, z, x \cdot \left(y + z\right)\right)}}\right)}^{-0.5}\right) \]
      5. metadata-eval73.0%

        \[\leadsto 2 \cdot \left({\left({\left(\mathsf{fma}\left(y, z, x \cdot \left(y + z\right)\right)\right)}^{\color{blue}{-0.5}}\right)}^{-0.5} \cdot {\left(\sqrt{\frac{1}{\mathsf{fma}\left(y, z, x \cdot \left(y + z\right)\right)}}\right)}^{-0.5}\right) \]
      6. inv-pow73.0%

        \[\leadsto 2 \cdot \left({\left({\left(\mathsf{fma}\left(y, z, x \cdot \left(y + z\right)\right)\right)}^{-0.5}\right)}^{-0.5} \cdot {\left(\sqrt{\color{blue}{{\left(\mathsf{fma}\left(y, z, x \cdot \left(y + z\right)\right)\right)}^{-1}}}\right)}^{-0.5}\right) \]
      7. sqrt-pow175.2%

        \[\leadsto 2 \cdot \left({\left({\left(\mathsf{fma}\left(y, z, x \cdot \left(y + z\right)\right)\right)}^{-0.5}\right)}^{-0.5} \cdot {\color{blue}{\left({\left(\mathsf{fma}\left(y, z, x \cdot \left(y + z\right)\right)\right)}^{\left(\frac{-1}{2}\right)}\right)}}^{-0.5}\right) \]
      8. metadata-eval75.2%

        \[\leadsto 2 \cdot \left({\left({\left(\mathsf{fma}\left(y, z, x \cdot \left(y + z\right)\right)\right)}^{-0.5}\right)}^{-0.5} \cdot {\left({\left(\mathsf{fma}\left(y, z, x \cdot \left(y + z\right)\right)\right)}^{\color{blue}{-0.5}}\right)}^{-0.5}\right) \]
    11. Applied egg-rr75.2%

      \[\leadsto 2 \cdot \color{blue}{\left({\left({\left(\mathsf{fma}\left(y, z, x \cdot \left(y + z\right)\right)\right)}^{-0.5}\right)}^{-0.5} \cdot {\left({\left(\mathsf{fma}\left(y, z, x \cdot \left(y + z\right)\right)\right)}^{-0.5}\right)}^{-0.5}\right)} \]
    12. Step-by-step derivation
      1. pow-sqr75.6%

        \[\leadsto 2 \cdot \color{blue}{{\left({\left(\mathsf{fma}\left(y, z, x \cdot \left(y + z\right)\right)\right)}^{-0.5}\right)}^{\left(2 \cdot -0.5\right)}} \]
      2. metadata-eval75.6%

        \[\leadsto 2 \cdot {\left({\left(\mathsf{fma}\left(y, z, x \cdot \left(y + z\right)\right)\right)}^{-0.5}\right)}^{\color{blue}{-1}} \]
      3. unpow-175.6%

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

        \[\leadsto 2 \cdot \frac{1}{{\color{blue}{\left(y \cdot z + x \cdot \left(y + z\right)\right)}}^{-0.5}} \]
      5. *-commutative75.6%

        \[\leadsto 2 \cdot \frac{1}{{\left(\color{blue}{z \cdot y} + x \cdot \left(y + z\right)\right)}^{-0.5}} \]
      6. *-commutative75.6%

        \[\leadsto 2 \cdot \frac{1}{{\left(z \cdot y + \color{blue}{\left(y + z\right) \cdot x}\right)}^{-0.5}} \]
      7. fma-def75.6%

        \[\leadsto 2 \cdot \frac{1}{{\color{blue}{\left(\mathsf{fma}\left(z, y, \left(y + z\right) \cdot x\right)\right)}}^{-0.5}} \]
      8. *-commutative75.6%

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

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

      \[\leadsto 2 \cdot \color{blue}{\frac{1}{{\left(\mathsf{fma}\left(z, y, x \cdot \left(z + y\right)\right)\right)}^{-0.5}}} \]
    14. Taylor expanded in x around -inf 42.3%

      \[\leadsto 2 \cdot \frac{1}{\color{blue}{e^{-0.5 \cdot \left(-1 \cdot \log \left(\frac{-1}{x}\right) + \log \left(-1 \cdot \left(y + z\right)\right)\right)}}} \]
    15. Step-by-step derivation
      1. exp-prod42.3%

        \[\leadsto 2 \cdot \frac{1}{\color{blue}{{\left(e^{-0.5}\right)}^{\left(-1 \cdot \log \left(\frac{-1}{x}\right) + \log \left(-1 \cdot \left(y + z\right)\right)\right)}}} \]
      2. +-commutative42.3%

        \[\leadsto 2 \cdot \frac{1}{{\left(e^{-0.5}\right)}^{\color{blue}{\left(\log \left(-1 \cdot \left(y + z\right)\right) + -1 \cdot \log \left(\frac{-1}{x}\right)\right)}}} \]
      3. mul-1-neg42.3%

        \[\leadsto 2 \cdot \frac{1}{{\left(e^{-0.5}\right)}^{\left(\log \left(-1 \cdot \left(y + z\right)\right) + \color{blue}{\left(-\log \left(\frac{-1}{x}\right)\right)}\right)}} \]
      4. unsub-neg42.3%

        \[\leadsto 2 \cdot \frac{1}{{\left(e^{-0.5}\right)}^{\color{blue}{\left(\log \left(-1 \cdot \left(y + z\right)\right) - \log \left(\frac{-1}{x}\right)\right)}}} \]
      5. distribute-lft-in42.3%

        \[\leadsto 2 \cdot \frac{1}{{\left(e^{-0.5}\right)}^{\left(\log \color{blue}{\left(-1 \cdot y + -1 \cdot z\right)} - \log \left(\frac{-1}{x}\right)\right)}} \]
      6. mul-1-neg42.3%

        \[\leadsto 2 \cdot \frac{1}{{\left(e^{-0.5}\right)}^{\left(\log \left(-1 \cdot y + \color{blue}{\left(-z\right)}\right) - \log \left(\frac{-1}{x}\right)\right)}} \]
      7. unsub-neg42.3%

        \[\leadsto 2 \cdot \frac{1}{{\left(e^{-0.5}\right)}^{\left(\log \color{blue}{\left(-1 \cdot y - z\right)} - \log \left(\frac{-1}{x}\right)\right)}} \]
      8. mul-1-neg42.3%

        \[\leadsto 2 \cdot \frac{1}{{\left(e^{-0.5}\right)}^{\left(\log \left(\color{blue}{\left(-y\right)} - z\right) - \log \left(\frac{-1}{x}\right)\right)}} \]
    16. Simplified42.3%

      \[\leadsto 2 \cdot \frac{1}{\color{blue}{{\left(e^{-0.5}\right)}^{\left(\log \left(\left(-y\right) - z\right) - \log \left(\frac{-1}{x}\right)\right)}}} \]

    if -1.10000000000000004e-302 < y

    1. Initial program 69.1%

      \[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z} \]
    2. Step-by-step derivation
      1. distribute-lft-out69.1%

        \[\leadsto 2 \cdot \sqrt{\color{blue}{x \cdot \left(y + z\right)} + y \cdot z} \]
    3. Simplified69.1%

      \[\leadsto \color{blue}{2 \cdot \sqrt{x \cdot \left(y + z\right) + y \cdot z}} \]
    4. Step-by-step derivation
      1. add-sqr-sqrt68.8%

        \[\leadsto 2 \cdot \color{blue}{\left(\sqrt{\sqrt{x \cdot \left(y + z\right) + y \cdot z}} \cdot \sqrt{\sqrt{x \cdot \left(y + z\right) + y \cdot z}}\right)} \]
      2. pow268.8%

        \[\leadsto 2 \cdot \color{blue}{{\left(\sqrt{\sqrt{x \cdot \left(y + z\right) + y \cdot z}}\right)}^{2}} \]
      3. pow1/268.8%

        \[\leadsto 2 \cdot {\left(\sqrt{\color{blue}{{\left(x \cdot \left(y + z\right) + y \cdot z\right)}^{0.5}}}\right)}^{2} \]
      4. sqrt-pow168.8%

        \[\leadsto 2 \cdot {\color{blue}{\left({\left(x \cdot \left(y + z\right) + y \cdot z\right)}^{\left(\frac{0.5}{2}\right)}\right)}}^{2} \]
      5. fma-def69.2%

        \[\leadsto 2 \cdot {\left({\color{blue}{\left(\mathsf{fma}\left(x, y + z, y \cdot z\right)\right)}}^{\left(\frac{0.5}{2}\right)}\right)}^{2} \]
      6. metadata-eval69.2%

        \[\leadsto 2 \cdot {\left({\left(\mathsf{fma}\left(x, y + z, y \cdot z\right)\right)}^{\color{blue}{0.25}}\right)}^{2} \]
    5. Applied egg-rr69.2%

      \[\leadsto 2 \cdot \color{blue}{{\left({\left(\mathsf{fma}\left(x, y + z, y \cdot z\right)\right)}^{0.25}\right)}^{2}} \]
    6. Taylor expanded in z around inf 42.8%

      \[\leadsto 2 \cdot {\left({\color{blue}{\left(\left(y + x\right) \cdot z\right)}}^{0.25}\right)}^{2} \]
    7. Step-by-step derivation
      1. pow-pow43.0%

        \[\leadsto 2 \cdot \color{blue}{{\left(\left(y + x\right) \cdot z\right)}^{\left(0.25 \cdot 2\right)}} \]
      2. metadata-eval43.0%

        \[\leadsto 2 \cdot {\left(\left(y + x\right) \cdot z\right)}^{\color{blue}{0.5}} \]
      3. pow1/243.0%

        \[\leadsto 2 \cdot \color{blue}{\sqrt{\left(y + x\right) \cdot z}} \]
      4. sqrt-prod54.6%

        \[\leadsto 2 \cdot \color{blue}{\left(\sqrt{y + x} \cdot \sqrt{z}\right)} \]
    8. Applied egg-rr54.6%

      \[\leadsto 2 \cdot \color{blue}{\left(\sqrt{y + x} \cdot \sqrt{z}\right)} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification51.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.6 \cdot 10^{+39}:\\ \;\;\;\;2 \cdot \frac{1}{e^{\left(\log \left(\left(-y\right) - z\right) - \log \left(\frac{-1}{x}\right)\right) \cdot -0.5}}\\ \mathbf{elif}\;y \leq -6.5 \cdot 10^{-192}:\\ \;\;\;\;2 \cdot \sqrt{x \cdot \left(y + z\right)}\\ \mathbf{elif}\;y \leq -1.1 \cdot 10^{-302}:\\ \;\;\;\;2 \cdot \frac{1}{{\left(e^{-0.5}\right)}^{\left(\log \left(\left(-y\right) - z\right) - \log \left(\frac{-1}{x}\right)\right)}}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(\sqrt{y + x} \cdot \sqrt{z}\right)\\ \end{array} \]

Alternative 3: 96.7% accurate, 0.4× speedup?

\[\begin{array}{l} [x, y, z] = \mathsf{sort}([x, y, z])\\ \\ \begin{array}{l} t_0 := 2 \cdot \frac{1}{e^{\left(\log \left(\left(-y\right) - z\right) - \log \left(\frac{-1}{x}\right)\right) \cdot -0.5}}\\ \mathbf{if}\;y \leq -2.85 \cdot 10^{+38}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq -5.6 \cdot 10^{-192}:\\ \;\;\;\;2 \cdot \sqrt{x \cdot \left(y + z\right)}\\ \mathbf{elif}\;y \leq 4.3 \cdot 10^{-308}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(\sqrt{y + x} \cdot \sqrt{z}\right)\\ \end{array} \end{array} \]
NOTE: x, y, and z should be sorted in increasing order before calling this function.
(FPCore (x y z)
 :precision binary64
 (let* ((t_0
         (*
          2.0
          (/ 1.0 (exp (* (- (log (- (- y) z)) (log (/ -1.0 x))) -0.5))))))
   (if (<= y -2.85e+38)
     t_0
     (if (<= y -5.6e-192)
       (* 2.0 (sqrt (* x (+ y z))))
       (if (<= y 4.3e-308) t_0 (* 2.0 (* (sqrt (+ y x)) (sqrt z))))))))
assert(x < y && y < z);
double code(double x, double y, double z) {
	double t_0 = 2.0 * (1.0 / exp(((log((-y - z)) - log((-1.0 / x))) * -0.5)));
	double tmp;
	if (y <= -2.85e+38) {
		tmp = t_0;
	} else if (y <= -5.6e-192) {
		tmp = 2.0 * sqrt((x * (y + z)));
	} else if (y <= 4.3e-308) {
		tmp = t_0;
	} else {
		tmp = 2.0 * (sqrt((y + x)) * sqrt(z));
	}
	return tmp;
}
NOTE: x, y, and z should be sorted in increasing order before calling this function.
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: tmp
    t_0 = 2.0d0 * (1.0d0 / exp(((log((-y - z)) - log(((-1.0d0) / x))) * (-0.5d0))))
    if (y <= (-2.85d+38)) then
        tmp = t_0
    else if (y <= (-5.6d-192)) then
        tmp = 2.0d0 * sqrt((x * (y + z)))
    else if (y <= 4.3d-308) then
        tmp = t_0
    else
        tmp = 2.0d0 * (sqrt((y + x)) * sqrt(z))
    end if
    code = tmp
end function
assert x < y && y < z;
public static double code(double x, double y, double z) {
	double t_0 = 2.0 * (1.0 / Math.exp(((Math.log((-y - z)) - Math.log((-1.0 / x))) * -0.5)));
	double tmp;
	if (y <= -2.85e+38) {
		tmp = t_0;
	} else if (y <= -5.6e-192) {
		tmp = 2.0 * Math.sqrt((x * (y + z)));
	} else if (y <= 4.3e-308) {
		tmp = t_0;
	} else {
		tmp = 2.0 * (Math.sqrt((y + x)) * Math.sqrt(z));
	}
	return tmp;
}
[x, y, z] = sort([x, y, z])
def code(x, y, z):
	t_0 = 2.0 * (1.0 / math.exp(((math.log((-y - z)) - math.log((-1.0 / x))) * -0.5)))
	tmp = 0
	if y <= -2.85e+38:
		tmp = t_0
	elif y <= -5.6e-192:
		tmp = 2.0 * math.sqrt((x * (y + z)))
	elif y <= 4.3e-308:
		tmp = t_0
	else:
		tmp = 2.0 * (math.sqrt((y + x)) * math.sqrt(z))
	return tmp
x, y, z = sort([x, y, z])
function code(x, y, z)
	t_0 = Float64(2.0 * Float64(1.0 / exp(Float64(Float64(log(Float64(Float64(-y) - z)) - log(Float64(-1.0 / x))) * -0.5))))
	tmp = 0.0
	if (y <= -2.85e+38)
		tmp = t_0;
	elseif (y <= -5.6e-192)
		tmp = Float64(2.0 * sqrt(Float64(x * Float64(y + z))));
	elseif (y <= 4.3e-308)
		tmp = t_0;
	else
		tmp = Float64(2.0 * Float64(sqrt(Float64(y + x)) * sqrt(z)));
	end
	return tmp
end
x, y, z = num2cell(sort([x, y, z])){:}
function tmp_2 = code(x, y, z)
	t_0 = 2.0 * (1.0 / exp(((log((-y - z)) - log((-1.0 / x))) * -0.5)));
	tmp = 0.0;
	if (y <= -2.85e+38)
		tmp = t_0;
	elseif (y <= -5.6e-192)
		tmp = 2.0 * sqrt((x * (y + z)));
	elseif (y <= 4.3e-308)
		tmp = t_0;
	else
		tmp = 2.0 * (sqrt((y + x)) * sqrt(z));
	end
	tmp_2 = tmp;
end
NOTE: x, y, and z should be sorted in increasing order before calling this function.
code[x_, y_, z_] := Block[{t$95$0 = N[(2.0 * N[(1.0 / N[Exp[N[(N[(N[Log[N[((-y) - z), $MachinePrecision]], $MachinePrecision] - N[Log[N[(-1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * -0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.85e+38], t$95$0, If[LessEqual[y, -5.6e-192], N[(2.0 * N[Sqrt[N[(x * N[(y + z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.3e-308], t$95$0, N[(2.0 * N[(N[Sqrt[N[(y + x), $MachinePrecision]], $MachinePrecision] * N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z] = \mathsf{sort}([x, y, z])\\
\\
\begin{array}{l}
t_0 := 2 \cdot \frac{1}{e^{\left(\log \left(\left(-y\right) - z\right) - \log \left(\frac{-1}{x}\right)\right) \cdot -0.5}}\\
\mathbf{if}\;y \leq -2.85 \cdot 10^{+38}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;y \leq -5.6 \cdot 10^{-192}:\\
\;\;\;\;2 \cdot \sqrt{x \cdot \left(y + z\right)}\\

\mathbf{elif}\;y \leq 4.3 \cdot 10^{-308}:\\
\;\;\;\;t_0\\

\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\sqrt{y + x} \cdot \sqrt{z}\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -2.8499999999999999e38 or -5.60000000000000007e-192 < y < 4.3000000000000002e-308

    1. Initial program 62.4%

      \[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z} \]
    2. Step-by-step derivation
      1. distribute-lft-out62.5%

        \[\leadsto 2 \cdot \sqrt{\color{blue}{x \cdot \left(y + z\right)} + y \cdot z} \]
    3. Simplified62.5%

      \[\leadsto \color{blue}{2 \cdot \sqrt{x \cdot \left(y + z\right) + y \cdot z}} \]
    4. Step-by-step derivation
      1. flip-+35.0%

        \[\leadsto 2 \cdot \sqrt{\color{blue}{\frac{\left(x \cdot \left(y + z\right)\right) \cdot \left(x \cdot \left(y + z\right)\right) - \left(y \cdot z\right) \cdot \left(y \cdot z\right)}{x \cdot \left(y + z\right) - y \cdot z}}} \]
      2. clear-num35.0%

        \[\leadsto 2 \cdot \sqrt{\color{blue}{\frac{1}{\frac{x \cdot \left(y + z\right) - y \cdot z}{\left(x \cdot \left(y + z\right)\right) \cdot \left(x \cdot \left(y + z\right)\right) - \left(y \cdot z\right) \cdot \left(y \cdot z\right)}}}} \]
      3. pow235.0%

        \[\leadsto 2 \cdot \sqrt{\frac{1}{\frac{x \cdot \left(y + z\right) - y \cdot z}{\color{blue}{{\left(x \cdot \left(y + z\right)\right)}^{2}} - \left(y \cdot z\right) \cdot \left(y \cdot z\right)}}} \]
      4. pow235.0%

        \[\leadsto 2 \cdot \sqrt{\frac{1}{\frac{x \cdot \left(y + z\right) - y \cdot z}{{\left(x \cdot \left(y + z\right)\right)}^{2} - \color{blue}{{\left(y \cdot z\right)}^{2}}}}} \]
    5. Applied egg-rr35.0%

      \[\leadsto 2 \cdot \sqrt{\color{blue}{\frac{1}{\frac{x \cdot \left(y + z\right) - y \cdot z}{{\left(x \cdot \left(y + z\right)\right)}^{2} - {\left(y \cdot z\right)}^{2}}}}} \]
    6. Step-by-step derivation
      1. inv-pow35.0%

        \[\leadsto 2 \cdot \sqrt{\color{blue}{{\left(\frac{x \cdot \left(y + z\right) - y \cdot z}{{\left(x \cdot \left(y + z\right)\right)}^{2} - {\left(y \cdot z\right)}^{2}}\right)}^{-1}}} \]
      2. sqrt-pow135.0%

        \[\leadsto 2 \cdot \color{blue}{{\left(\frac{x \cdot \left(y + z\right) - y \cdot z}{{\left(x \cdot \left(y + z\right)\right)}^{2} - {\left(y \cdot z\right)}^{2}}\right)}^{\left(\frac{-1}{2}\right)}} \]
      3. clear-num35.0%

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

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

        \[\leadsto 2 \cdot {\left(\frac{1}{\frac{\left(x \cdot \left(y + z\right)\right) \cdot \left(x \cdot \left(y + z\right)\right) - \color{blue}{\left(y \cdot z\right) \cdot \left(y \cdot z\right)}}{x \cdot \left(y + z\right) - y \cdot z}}\right)}^{\left(\frac{-1}{2}\right)} \]
      6. flip-+61.8%

        \[\leadsto 2 \cdot {\left(\frac{1}{\color{blue}{x \cdot \left(y + z\right) + y \cdot z}}\right)}^{\left(\frac{-1}{2}\right)} \]
      7. fma-udef62.3%

        \[\leadsto 2 \cdot {\left(\frac{1}{\color{blue}{\mathsf{fma}\left(x, y + z, y \cdot z\right)}}\right)}^{\left(\frac{-1}{2}\right)} \]
      8. metadata-eval62.3%

        \[\leadsto 2 \cdot {\left(\frac{1}{\mathsf{fma}\left(x, y + z, y \cdot z\right)}\right)}^{\color{blue}{-0.5}} \]
    7. Applied egg-rr62.3%

      \[\leadsto 2 \cdot \color{blue}{{\left(\frac{1}{\mathsf{fma}\left(x, y + z, y \cdot z\right)}\right)}^{-0.5}} \]
    8. Step-by-step derivation
      1. fma-def61.8%

        \[\leadsto 2 \cdot {\left(\frac{1}{\color{blue}{x \cdot \left(y + z\right) + y \cdot z}}\right)}^{-0.5} \]
      2. +-commutative61.8%

        \[\leadsto 2 \cdot {\left(\frac{1}{\color{blue}{y \cdot z + x \cdot \left(y + z\right)}}\right)}^{-0.5} \]
      3. fma-udef62.3%

        \[\leadsto 2 \cdot {\left(\frac{1}{\color{blue}{\mathsf{fma}\left(y, z, x \cdot \left(y + z\right)\right)}}\right)}^{-0.5} \]
    9. Simplified62.3%

      \[\leadsto 2 \cdot \color{blue}{{\left(\frac{1}{\mathsf{fma}\left(y, z, x \cdot \left(y + z\right)\right)}\right)}^{-0.5}} \]
    10. Step-by-step derivation
      1. add-sqr-sqrt62.0%

        \[\leadsto 2 \cdot {\color{blue}{\left(\sqrt{\frac{1}{\mathsf{fma}\left(y, z, x \cdot \left(y + z\right)\right)}} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(y, z, x \cdot \left(y + z\right)\right)}}\right)}}^{-0.5} \]
      2. unpow-prod-down61.8%

        \[\leadsto 2 \cdot \color{blue}{\left({\left(\sqrt{\frac{1}{\mathsf{fma}\left(y, z, x \cdot \left(y + z\right)\right)}}\right)}^{-0.5} \cdot {\left(\sqrt{\frac{1}{\mathsf{fma}\left(y, z, x \cdot \left(y + z\right)\right)}}\right)}^{-0.5}\right)} \]
      3. inv-pow61.8%

        \[\leadsto 2 \cdot \left({\left(\sqrt{\color{blue}{{\left(\mathsf{fma}\left(y, z, x \cdot \left(y + z\right)\right)\right)}^{-1}}}\right)}^{-0.5} \cdot {\left(\sqrt{\frac{1}{\mathsf{fma}\left(y, z, x \cdot \left(y + z\right)\right)}}\right)}^{-0.5}\right) \]
      4. sqrt-pow161.8%

        \[\leadsto 2 \cdot \left({\color{blue}{\left({\left(\mathsf{fma}\left(y, z, x \cdot \left(y + z\right)\right)\right)}^{\left(\frac{-1}{2}\right)}\right)}}^{-0.5} \cdot {\left(\sqrt{\frac{1}{\mathsf{fma}\left(y, z, x \cdot \left(y + z\right)\right)}}\right)}^{-0.5}\right) \]
      5. metadata-eval61.8%

        \[\leadsto 2 \cdot \left({\left({\left(\mathsf{fma}\left(y, z, x \cdot \left(y + z\right)\right)\right)}^{\color{blue}{-0.5}}\right)}^{-0.5} \cdot {\left(\sqrt{\frac{1}{\mathsf{fma}\left(y, z, x \cdot \left(y + z\right)\right)}}\right)}^{-0.5}\right) \]
      6. inv-pow61.8%

        \[\leadsto 2 \cdot \left({\left({\left(\mathsf{fma}\left(y, z, x \cdot \left(y + z\right)\right)\right)}^{-0.5}\right)}^{-0.5} \cdot {\left(\sqrt{\color{blue}{{\left(\mathsf{fma}\left(y, z, x \cdot \left(y + z\right)\right)\right)}^{-1}}}\right)}^{-0.5}\right) \]
      7. sqrt-pow162.5%

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

        \[\leadsto 2 \cdot \left({\left({\left(\mathsf{fma}\left(y, z, x \cdot \left(y + z\right)\right)\right)}^{-0.5}\right)}^{-0.5} \cdot {\left({\left(\mathsf{fma}\left(y, z, x \cdot \left(y + z\right)\right)\right)}^{\color{blue}{-0.5}}\right)}^{-0.5}\right) \]
    11. Applied egg-rr62.5%

      \[\leadsto 2 \cdot \color{blue}{\left({\left({\left(\mathsf{fma}\left(y, z, x \cdot \left(y + z\right)\right)\right)}^{-0.5}\right)}^{-0.5} \cdot {\left({\left(\mathsf{fma}\left(y, z, x \cdot \left(y + z\right)\right)\right)}^{-0.5}\right)}^{-0.5}\right)} \]
    12. Step-by-step derivation
      1. pow-sqr62.9%

        \[\leadsto 2 \cdot \color{blue}{{\left({\left(\mathsf{fma}\left(y, z, x \cdot \left(y + z\right)\right)\right)}^{-0.5}\right)}^{\left(2 \cdot -0.5\right)}} \]
      2. metadata-eval62.9%

        \[\leadsto 2 \cdot {\left({\left(\mathsf{fma}\left(y, z, x \cdot \left(y + z\right)\right)\right)}^{-0.5}\right)}^{\color{blue}{-1}} \]
      3. unpow-162.9%

        \[\leadsto 2 \cdot \color{blue}{\frac{1}{{\left(\mathsf{fma}\left(y, z, x \cdot \left(y + z\right)\right)\right)}^{-0.5}}} \]
      4. fma-udef62.4%

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

        \[\leadsto 2 \cdot \frac{1}{{\left(\color{blue}{z \cdot y} + x \cdot \left(y + z\right)\right)}^{-0.5}} \]
      6. *-commutative62.4%

        \[\leadsto 2 \cdot \frac{1}{{\left(z \cdot y + \color{blue}{\left(y + z\right) \cdot x}\right)}^{-0.5}} \]
      7. fma-def62.9%

        \[\leadsto 2 \cdot \frac{1}{{\color{blue}{\left(\mathsf{fma}\left(z, y, \left(y + z\right) \cdot x\right)\right)}}^{-0.5}} \]
      8. *-commutative62.9%

        \[\leadsto 2 \cdot \frac{1}{{\left(\mathsf{fma}\left(z, y, \color{blue}{x \cdot \left(y + z\right)}\right)\right)}^{-0.5}} \]
      9. +-commutative62.9%

        \[\leadsto 2 \cdot \frac{1}{{\left(\mathsf{fma}\left(z, y, x \cdot \color{blue}{\left(z + y\right)}\right)\right)}^{-0.5}} \]
    13. Simplified62.9%

      \[\leadsto 2 \cdot \color{blue}{\frac{1}{{\left(\mathsf{fma}\left(z, y, x \cdot \left(z + y\right)\right)\right)}^{-0.5}}} \]
    14. Taylor expanded in x around -inf 45.6%

      \[\leadsto 2 \cdot \frac{1}{\color{blue}{e^{-0.5 \cdot \left(-1 \cdot \log \left(\frac{-1}{x}\right) + \log \left(-1 \cdot \left(y + z\right)\right)\right)}}} \]

    if -2.8499999999999999e38 < y < -5.60000000000000007e-192

    1. Initial program 85.4%

      \[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z} \]
    2. Step-by-step derivation
      1. distribute-lft-out85.4%

        \[\leadsto 2 \cdot \sqrt{\color{blue}{x \cdot \left(y + z\right)} + y \cdot z} \]
    3. Simplified85.4%

      \[\leadsto \color{blue}{2 \cdot \sqrt{x \cdot \left(y + z\right) + y \cdot z}} \]
    4. Taylor expanded in x around inf 52.8%

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

    if 4.3000000000000002e-308 < y

    1. Initial program 69.4%

      \[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z} \]
    2. Step-by-step derivation
      1. distribute-lft-out69.4%

        \[\leadsto 2 \cdot \sqrt{\color{blue}{x \cdot \left(y + z\right)} + y \cdot z} \]
    3. Simplified69.4%

      \[\leadsto \color{blue}{2 \cdot \sqrt{x \cdot \left(y + z\right) + y \cdot z}} \]
    4. Step-by-step derivation
      1. add-sqr-sqrt69.0%

        \[\leadsto 2 \cdot \color{blue}{\left(\sqrt{\sqrt{x \cdot \left(y + z\right) + y \cdot z}} \cdot \sqrt{\sqrt{x \cdot \left(y + z\right) + y \cdot z}}\right)} \]
      2. pow269.0%

        \[\leadsto 2 \cdot \color{blue}{{\left(\sqrt{\sqrt{x \cdot \left(y + z\right) + y \cdot z}}\right)}^{2}} \]
      3. pow1/269.0%

        \[\leadsto 2 \cdot {\left(\sqrt{\color{blue}{{\left(x \cdot \left(y + z\right) + y \cdot z\right)}^{0.5}}}\right)}^{2} \]
      4. sqrt-pow169.1%

        \[\leadsto 2 \cdot {\color{blue}{\left({\left(x \cdot \left(y + z\right) + y \cdot z\right)}^{\left(\frac{0.5}{2}\right)}\right)}}^{2} \]
      5. fma-def69.5%

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

        \[\leadsto 2 \cdot {\left({\left(\mathsf{fma}\left(x, y + z, y \cdot z\right)\right)}^{\color{blue}{0.25}}\right)}^{2} \]
    5. Applied egg-rr69.5%

      \[\leadsto 2 \cdot \color{blue}{{\left({\left(\mathsf{fma}\left(x, y + z, y \cdot z\right)\right)}^{0.25}\right)}^{2}} \]
    6. Taylor expanded in z around inf 42.7%

      \[\leadsto 2 \cdot {\left({\color{blue}{\left(\left(y + x\right) \cdot z\right)}}^{0.25}\right)}^{2} \]
    7. Step-by-step derivation
      1. pow-pow42.9%

        \[\leadsto 2 \cdot \color{blue}{{\left(\left(y + x\right) \cdot z\right)}^{\left(0.25 \cdot 2\right)}} \]
      2. metadata-eval42.9%

        \[\leadsto 2 \cdot {\left(\left(y + x\right) \cdot z\right)}^{\color{blue}{0.5}} \]
      3. pow1/242.9%

        \[\leadsto 2 \cdot \color{blue}{\sqrt{\left(y + x\right) \cdot z}} \]
      4. sqrt-prod54.7%

        \[\leadsto 2 \cdot \color{blue}{\left(\sqrt{y + x} \cdot \sqrt{z}\right)} \]
    8. Applied egg-rr54.7%

      \[\leadsto 2 \cdot \color{blue}{\left(\sqrt{y + x} \cdot \sqrt{z}\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification51.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.85 \cdot 10^{+38}:\\ \;\;\;\;2 \cdot \frac{1}{e^{\left(\log \left(\left(-y\right) - z\right) - \log \left(\frac{-1}{x}\right)\right) \cdot -0.5}}\\ \mathbf{elif}\;y \leq -5.6 \cdot 10^{-192}:\\ \;\;\;\;2 \cdot \sqrt{x \cdot \left(y + z\right)}\\ \mathbf{elif}\;y \leq 4.3 \cdot 10^{-308}:\\ \;\;\;\;2 \cdot \frac{1}{e^{\left(\log \left(\left(-y\right) - z\right) - \log \left(\frac{-1}{x}\right)\right) \cdot -0.5}}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(\sqrt{y + x} \cdot \sqrt{z}\right)\\ \end{array} \]

Alternative 4: 96.7% accurate, 0.4× speedup?

\[\begin{array}{l} [x, y, z] = \mathsf{sort}([x, y, z])\\ \\ \begin{array}{l} t_0 := 2 \cdot e^{-0.5 \cdot \left(\log \left(\frac{-1}{x}\right) + \log \left(\frac{-1}{y + z}\right)\right)}\\ \mathbf{if}\;y \leq -7.5 \cdot 10^{+36}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq -5.6 \cdot 10^{-192}:\\ \;\;\;\;2 \cdot \sqrt{x \cdot \left(y + z\right)}\\ \mathbf{elif}\;y \leq -3.4 \cdot 10^{-301}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(\sqrt{y + x} \cdot \sqrt{z}\right)\\ \end{array} \end{array} \]
NOTE: x, y, and z should be sorted in increasing order before calling this function.
(FPCore (x y z)
 :precision binary64
 (let* ((t_0
         (* 2.0 (exp (* -0.5 (+ (log (/ -1.0 x)) (log (/ -1.0 (+ y z)))))))))
   (if (<= y -7.5e+36)
     t_0
     (if (<= y -5.6e-192)
       (* 2.0 (sqrt (* x (+ y z))))
       (if (<= y -3.4e-301) t_0 (* 2.0 (* (sqrt (+ y x)) (sqrt z))))))))
assert(x < y && y < z);
double code(double x, double y, double z) {
	double t_0 = 2.0 * exp((-0.5 * (log((-1.0 / x)) + log((-1.0 / (y + z))))));
	double tmp;
	if (y <= -7.5e+36) {
		tmp = t_0;
	} else if (y <= -5.6e-192) {
		tmp = 2.0 * sqrt((x * (y + z)));
	} else if (y <= -3.4e-301) {
		tmp = t_0;
	} else {
		tmp = 2.0 * (sqrt((y + x)) * sqrt(z));
	}
	return tmp;
}
NOTE: x, y, and z should be sorted in increasing order before calling this function.
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: tmp
    t_0 = 2.0d0 * exp(((-0.5d0) * (log(((-1.0d0) / x)) + log(((-1.0d0) / (y + z))))))
    if (y <= (-7.5d+36)) then
        tmp = t_0
    else if (y <= (-5.6d-192)) then
        tmp = 2.0d0 * sqrt((x * (y + z)))
    else if (y <= (-3.4d-301)) then
        tmp = t_0
    else
        tmp = 2.0d0 * (sqrt((y + x)) * sqrt(z))
    end if
    code = tmp
end function
assert x < y && y < z;
public static double code(double x, double y, double z) {
	double t_0 = 2.0 * Math.exp((-0.5 * (Math.log((-1.0 / x)) + Math.log((-1.0 / (y + z))))));
	double tmp;
	if (y <= -7.5e+36) {
		tmp = t_0;
	} else if (y <= -5.6e-192) {
		tmp = 2.0 * Math.sqrt((x * (y + z)));
	} else if (y <= -3.4e-301) {
		tmp = t_0;
	} else {
		tmp = 2.0 * (Math.sqrt((y + x)) * Math.sqrt(z));
	}
	return tmp;
}
[x, y, z] = sort([x, y, z])
def code(x, y, z):
	t_0 = 2.0 * math.exp((-0.5 * (math.log((-1.0 / x)) + math.log((-1.0 / (y + z))))))
	tmp = 0
	if y <= -7.5e+36:
		tmp = t_0
	elif y <= -5.6e-192:
		tmp = 2.0 * math.sqrt((x * (y + z)))
	elif y <= -3.4e-301:
		tmp = t_0
	else:
		tmp = 2.0 * (math.sqrt((y + x)) * math.sqrt(z))
	return tmp
x, y, z = sort([x, y, z])
function code(x, y, z)
	t_0 = Float64(2.0 * exp(Float64(-0.5 * Float64(log(Float64(-1.0 / x)) + log(Float64(-1.0 / Float64(y + z)))))))
	tmp = 0.0
	if (y <= -7.5e+36)
		tmp = t_0;
	elseif (y <= -5.6e-192)
		tmp = Float64(2.0 * sqrt(Float64(x * Float64(y + z))));
	elseif (y <= -3.4e-301)
		tmp = t_0;
	else
		tmp = Float64(2.0 * Float64(sqrt(Float64(y + x)) * sqrt(z)));
	end
	return tmp
end
x, y, z = num2cell(sort([x, y, z])){:}
function tmp_2 = code(x, y, z)
	t_0 = 2.0 * exp((-0.5 * (log((-1.0 / x)) + log((-1.0 / (y + z))))));
	tmp = 0.0;
	if (y <= -7.5e+36)
		tmp = t_0;
	elseif (y <= -5.6e-192)
		tmp = 2.0 * sqrt((x * (y + z)));
	elseif (y <= -3.4e-301)
		tmp = t_0;
	else
		tmp = 2.0 * (sqrt((y + x)) * sqrt(z));
	end
	tmp_2 = tmp;
end
NOTE: x, y, and z should be sorted in increasing order before calling this function.
code[x_, y_, z_] := Block[{t$95$0 = N[(2.0 * N[Exp[N[(-0.5 * N[(N[Log[N[(-1.0 / x), $MachinePrecision]], $MachinePrecision] + N[Log[N[(-1.0 / N[(y + z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -7.5e+36], t$95$0, If[LessEqual[y, -5.6e-192], N[(2.0 * N[Sqrt[N[(x * N[(y + z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -3.4e-301], t$95$0, N[(2.0 * N[(N[Sqrt[N[(y + x), $MachinePrecision]], $MachinePrecision] * N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z] = \mathsf{sort}([x, y, z])\\
\\
\begin{array}{l}
t_0 := 2 \cdot e^{-0.5 \cdot \left(\log \left(\frac{-1}{x}\right) + \log \left(\frac{-1}{y + z}\right)\right)}\\
\mathbf{if}\;y \leq -7.5 \cdot 10^{+36}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;y \leq -5.6 \cdot 10^{-192}:\\
\;\;\;\;2 \cdot \sqrt{x \cdot \left(y + z\right)}\\

\mathbf{elif}\;y \leq -3.4 \cdot 10^{-301}:\\
\;\;\;\;t_0\\

\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\sqrt{y + x} \cdot \sqrt{z}\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -7.50000000000000054e36 or -5.60000000000000007e-192 < y < -3.4000000000000002e-301

    1. Initial program 63.3%

      \[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z} \]
    2. Step-by-step derivation
      1. distribute-lft-out63.4%

        \[\leadsto 2 \cdot \sqrt{\color{blue}{x \cdot \left(y + z\right)} + y \cdot z} \]
    3. Simplified63.4%

      \[\leadsto \color{blue}{2 \cdot \sqrt{x \cdot \left(y + z\right) + y \cdot z}} \]
    4. Step-by-step derivation
      1. flip-+35.0%

        \[\leadsto 2 \cdot \sqrt{\color{blue}{\frac{\left(x \cdot \left(y + z\right)\right) \cdot \left(x \cdot \left(y + z\right)\right) - \left(y \cdot z\right) \cdot \left(y \cdot z\right)}{x \cdot \left(y + z\right) - y \cdot z}}} \]
      2. clear-num35.1%

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

        \[\leadsto 2 \cdot \sqrt{\frac{1}{\frac{x \cdot \left(y + z\right) - y \cdot z}{\color{blue}{{\left(x \cdot \left(y + z\right)\right)}^{2}} - \left(y \cdot z\right) \cdot \left(y \cdot z\right)}}} \]
      4. pow235.1%

        \[\leadsto 2 \cdot \sqrt{\frac{1}{\frac{x \cdot \left(y + z\right) - y \cdot z}{{\left(x \cdot \left(y + z\right)\right)}^{2} - \color{blue}{{\left(y \cdot z\right)}^{2}}}}} \]
    5. Applied egg-rr35.1%

      \[\leadsto 2 \cdot \sqrt{\color{blue}{\frac{1}{\frac{x \cdot \left(y + z\right) - y \cdot z}{{\left(x \cdot \left(y + z\right)\right)}^{2} - {\left(y \cdot z\right)}^{2}}}}} \]
    6. Step-by-step derivation
      1. inv-pow35.1%

        \[\leadsto 2 \cdot \sqrt{\color{blue}{{\left(\frac{x \cdot \left(y + z\right) - y \cdot z}{{\left(x \cdot \left(y + z\right)\right)}^{2} - {\left(y \cdot z\right)}^{2}}\right)}^{-1}}} \]
      2. sqrt-pow135.1%

        \[\leadsto 2 \cdot \color{blue}{{\left(\frac{x \cdot \left(y + z\right) - y \cdot z}{{\left(x \cdot \left(y + z\right)\right)}^{2} - {\left(y \cdot z\right)}^{2}}\right)}^{\left(\frac{-1}{2}\right)}} \]
      3. clear-num35.1%

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

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

        \[\leadsto 2 \cdot {\left(\frac{1}{\frac{\left(x \cdot \left(y + z\right)\right) \cdot \left(x \cdot \left(y + z\right)\right) - \color{blue}{\left(y \cdot z\right) \cdot \left(y \cdot z\right)}}{x \cdot \left(y + z\right) - y \cdot z}}\right)}^{\left(\frac{-1}{2}\right)} \]
      6. flip-+62.7%

        \[\leadsto 2 \cdot {\left(\frac{1}{\color{blue}{x \cdot \left(y + z\right) + y \cdot z}}\right)}^{\left(\frac{-1}{2}\right)} \]
      7. fma-udef63.2%

        \[\leadsto 2 \cdot {\left(\frac{1}{\color{blue}{\mathsf{fma}\left(x, y + z, y \cdot z\right)}}\right)}^{\left(\frac{-1}{2}\right)} \]
      8. metadata-eval63.2%

        \[\leadsto 2 \cdot {\left(\frac{1}{\mathsf{fma}\left(x, y + z, y \cdot z\right)}\right)}^{\color{blue}{-0.5}} \]
    7. Applied egg-rr63.2%

      \[\leadsto 2 \cdot \color{blue}{{\left(\frac{1}{\mathsf{fma}\left(x, y + z, y \cdot z\right)}\right)}^{-0.5}} \]
    8. Step-by-step derivation
      1. fma-def62.7%

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

        \[\leadsto 2 \cdot {\left(\frac{1}{\color{blue}{y \cdot z + x \cdot \left(y + z\right)}}\right)}^{-0.5} \]
      3. fma-udef63.2%

        \[\leadsto 2 \cdot {\left(\frac{1}{\color{blue}{\mathsf{fma}\left(y, z, x \cdot \left(y + z\right)\right)}}\right)}^{-0.5} \]
    9. Simplified63.2%

      \[\leadsto 2 \cdot \color{blue}{{\left(\frac{1}{\mathsf{fma}\left(y, z, x \cdot \left(y + z\right)\right)}\right)}^{-0.5}} \]
    10. Taylor expanded in x around -inf 46.2%

      \[\leadsto 2 \cdot \color{blue}{e^{-0.5 \cdot \left(\log \left(\frac{-1}{x}\right) + \log \left(\frac{-1}{y + z}\right)\right)}} \]

    if -7.50000000000000054e36 < y < -5.60000000000000007e-192

    1. Initial program 85.4%

      \[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z} \]
    2. Step-by-step derivation
      1. distribute-lft-out85.4%

        \[\leadsto 2 \cdot \sqrt{\color{blue}{x \cdot \left(y + z\right)} + y \cdot z} \]
    3. Simplified85.4%

      \[\leadsto \color{blue}{2 \cdot \sqrt{x \cdot \left(y + z\right) + y \cdot z}} \]
    4. Taylor expanded in x around inf 52.8%

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

    if -3.4000000000000002e-301 < y

    1. Initial program 68.6%

      \[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z} \]
    2. Step-by-step derivation
      1. distribute-lft-out68.6%

        \[\leadsto 2 \cdot \sqrt{\color{blue}{x \cdot \left(y + z\right)} + y \cdot z} \]
    3. Simplified68.6%

      \[\leadsto \color{blue}{2 \cdot \sqrt{x \cdot \left(y + z\right) + y \cdot z}} \]
    4. Step-by-step derivation
      1. add-sqr-sqrt68.3%

        \[\leadsto 2 \cdot \color{blue}{\left(\sqrt{\sqrt{x \cdot \left(y + z\right) + y \cdot z}} \cdot \sqrt{\sqrt{x \cdot \left(y + z\right) + y \cdot z}}\right)} \]
      2. pow268.3%

        \[\leadsto 2 \cdot \color{blue}{{\left(\sqrt{\sqrt{x \cdot \left(y + z\right) + y \cdot z}}\right)}^{2}} \]
      3. pow1/268.3%

        \[\leadsto 2 \cdot {\left(\sqrt{\color{blue}{{\left(x \cdot \left(y + z\right) + y \cdot z\right)}^{0.5}}}\right)}^{2} \]
      4. sqrt-pow168.3%

        \[\leadsto 2 \cdot {\color{blue}{\left({\left(x \cdot \left(y + z\right) + y \cdot z\right)}^{\left(\frac{0.5}{2}\right)}\right)}}^{2} \]
      5. fma-def68.7%

        \[\leadsto 2 \cdot {\left({\color{blue}{\left(\mathsf{fma}\left(x, y + z, y \cdot z\right)\right)}}^{\left(\frac{0.5}{2}\right)}\right)}^{2} \]
      6. metadata-eval68.7%

        \[\leadsto 2 \cdot {\left({\left(\mathsf{fma}\left(x, y + z, y \cdot z\right)\right)}^{\color{blue}{0.25}}\right)}^{2} \]
    5. Applied egg-rr68.7%

      \[\leadsto 2 \cdot \color{blue}{{\left({\left(\mathsf{fma}\left(x, y + z, y \cdot z\right)\right)}^{0.25}\right)}^{2}} \]
    6. Taylor expanded in z around inf 42.5%

      \[\leadsto 2 \cdot {\left({\color{blue}{\left(\left(y + x\right) \cdot z\right)}}^{0.25}\right)}^{2} \]
    7. Step-by-step derivation
      1. pow-pow42.7%

        \[\leadsto 2 \cdot \color{blue}{{\left(\left(y + x\right) \cdot z\right)}^{\left(0.25 \cdot 2\right)}} \]
      2. metadata-eval42.7%

        \[\leadsto 2 \cdot {\left(\left(y + x\right) \cdot z\right)}^{\color{blue}{0.5}} \]
      3. pow1/242.7%

        \[\leadsto 2 \cdot \color{blue}{\sqrt{\left(y + x\right) \cdot z}} \]
      4. sqrt-prod55.0%

        \[\leadsto 2 \cdot \color{blue}{\left(\sqrt{y + x} \cdot \sqrt{z}\right)} \]
    8. Applied egg-rr55.0%

      \[\leadsto 2 \cdot \color{blue}{\left(\sqrt{y + x} \cdot \sqrt{z}\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification51.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -7.5 \cdot 10^{+36}:\\ \;\;\;\;2 \cdot e^{-0.5 \cdot \left(\log \left(\frac{-1}{x}\right) + \log \left(\frac{-1}{y + z}\right)\right)}\\ \mathbf{elif}\;y \leq -5.6 \cdot 10^{-192}:\\ \;\;\;\;2 \cdot \sqrt{x \cdot \left(y + z\right)}\\ \mathbf{elif}\;y \leq -3.4 \cdot 10^{-301}:\\ \;\;\;\;2 \cdot e^{-0.5 \cdot \left(\log \left(\frac{-1}{x}\right) + \log \left(\frac{-1}{y + z}\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(\sqrt{y + x} \cdot \sqrt{z}\right)\\ \end{array} \]

Alternative 5: 96.0% accurate, 0.4× speedup?

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

\mathbf{elif}\;y \leq 9.2 \cdot 10^{-301}:\\
\;\;\;\;2 \cdot \sqrt{x \cdot \left(y + z\right)}\\

\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\sqrt{y + x} \cdot \sqrt{z}\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -3.40000000000000006e37

    1. Initial program 55.6%

      \[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z} \]
    2. Step-by-step derivation
      1. distribute-lft-out55.7%

        \[\leadsto 2 \cdot \sqrt{\color{blue}{x \cdot \left(y + z\right)} + y \cdot z} \]
    3. Simplified55.7%

      \[\leadsto \color{blue}{2 \cdot \sqrt{x \cdot \left(y + z\right) + y \cdot z}} \]
    4. Step-by-step derivation
      1. flip-+21.4%

        \[\leadsto 2 \cdot \sqrt{\color{blue}{\frac{\left(x \cdot \left(y + z\right)\right) \cdot \left(x \cdot \left(y + z\right)\right) - \left(y \cdot z\right) \cdot \left(y \cdot z\right)}{x \cdot \left(y + z\right) - y \cdot z}}} \]
      2. clear-num21.4%

        \[\leadsto 2 \cdot \sqrt{\color{blue}{\frac{1}{\frac{x \cdot \left(y + z\right) - y \cdot z}{\left(x \cdot \left(y + z\right)\right) \cdot \left(x \cdot \left(y + z\right)\right) - \left(y \cdot z\right) \cdot \left(y \cdot z\right)}}}} \]
      3. pow221.4%

        \[\leadsto 2 \cdot \sqrt{\frac{1}{\frac{x \cdot \left(y + z\right) - y \cdot z}{\color{blue}{{\left(x \cdot \left(y + z\right)\right)}^{2}} - \left(y \cdot z\right) \cdot \left(y \cdot z\right)}}} \]
      4. pow221.4%

        \[\leadsto 2 \cdot \sqrt{\frac{1}{\frac{x \cdot \left(y + z\right) - y \cdot z}{{\left(x \cdot \left(y + z\right)\right)}^{2} - \color{blue}{{\left(y \cdot z\right)}^{2}}}}} \]
    5. Applied egg-rr21.4%

      \[\leadsto 2 \cdot \sqrt{\color{blue}{\frac{1}{\frac{x \cdot \left(y + z\right) - y \cdot z}{{\left(x \cdot \left(y + z\right)\right)}^{2} - {\left(y \cdot z\right)}^{2}}}}} \]
    6. Step-by-step derivation
      1. inv-pow21.4%

        \[\leadsto 2 \cdot \sqrt{\color{blue}{{\left(\frac{x \cdot \left(y + z\right) - y \cdot z}{{\left(x \cdot \left(y + z\right)\right)}^{2} - {\left(y \cdot z\right)}^{2}}\right)}^{-1}}} \]
      2. sqrt-pow121.4%

        \[\leadsto 2 \cdot \color{blue}{{\left(\frac{x \cdot \left(y + z\right) - y \cdot z}{{\left(x \cdot \left(y + z\right)\right)}^{2} - {\left(y \cdot z\right)}^{2}}\right)}^{\left(\frac{-1}{2}\right)}} \]
      3. clear-num21.4%

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

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

        \[\leadsto 2 \cdot {\left(\frac{1}{\frac{\left(x \cdot \left(y + z\right)\right) \cdot \left(x \cdot \left(y + z\right)\right) - \color{blue}{\left(y \cdot z\right) \cdot \left(y \cdot z\right)}}{x \cdot \left(y + z\right) - y \cdot z}}\right)}^{\left(\frac{-1}{2}\right)} \]
      6. flip-+55.8%

        \[\leadsto 2 \cdot {\left(\frac{1}{\color{blue}{x \cdot \left(y + z\right) + y \cdot z}}\right)}^{\left(\frac{-1}{2}\right)} \]
      7. fma-udef56.5%

        \[\leadsto 2 \cdot {\left(\frac{1}{\color{blue}{\mathsf{fma}\left(x, y + z, y \cdot z\right)}}\right)}^{\left(\frac{-1}{2}\right)} \]
      8. metadata-eval56.5%

        \[\leadsto 2 \cdot {\left(\frac{1}{\mathsf{fma}\left(x, y + z, y \cdot z\right)}\right)}^{\color{blue}{-0.5}} \]
    7. Applied egg-rr56.5%

      \[\leadsto 2 \cdot \color{blue}{{\left(\frac{1}{\mathsf{fma}\left(x, y + z, y \cdot z\right)}\right)}^{-0.5}} \]
    8. Step-by-step derivation
      1. fma-def55.8%

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

        \[\leadsto 2 \cdot {\left(\frac{1}{\color{blue}{y \cdot z + x \cdot \left(y + z\right)}}\right)}^{-0.5} \]
      3. fma-udef56.5%

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

      \[\leadsto 2 \cdot \color{blue}{{\left(\frac{1}{\mathsf{fma}\left(y, z, x \cdot \left(y + z\right)\right)}\right)}^{-0.5}} \]
    10. Taylor expanded in x around -inf 47.5%

      \[\leadsto 2 \cdot \color{blue}{e^{-0.5 \cdot \left(\log \left(\frac{-1}{x}\right) + \log \left(\frac{-1}{y + z}\right)\right)}} \]
    11. Taylor expanded in y around inf 0.0%

      \[\leadsto 2 \cdot e^{-0.5 \cdot \color{blue}{\left(\log \left(\frac{-1}{x}\right) + \left(\log -1 + \log \left(\frac{1}{y}\right)\right)\right)}} \]
    12. Step-by-step derivation
      1. +-commutative0.0%

        \[\leadsto 2 \cdot e^{-0.5 \cdot \color{blue}{\left(\left(\log -1 + \log \left(\frac{1}{y}\right)\right) + \log \left(\frac{-1}{x}\right)\right)}} \]
      2. log-rec0.0%

        \[\leadsto 2 \cdot e^{-0.5 \cdot \left(\left(\log -1 + \color{blue}{\left(-\log y\right)}\right) + \log \left(\frac{-1}{x}\right)\right)} \]
      3. sub-neg0.0%

        \[\leadsto 2 \cdot e^{-0.5 \cdot \left(\color{blue}{\left(\log -1 - \log y\right)} + \log \left(\frac{-1}{x}\right)\right)} \]
      4. log-div45.3%

        \[\leadsto 2 \cdot e^{-0.5 \cdot \left(\color{blue}{\log \left(\frac{-1}{y}\right)} + \log \left(\frac{-1}{x}\right)\right)} \]
    13. Simplified45.3%

      \[\leadsto 2 \cdot e^{-0.5 \cdot \color{blue}{\left(\log \left(\frac{-1}{y}\right) + \log \left(\frac{-1}{x}\right)\right)}} \]

    if -3.40000000000000006e37 < y < 9.2000000000000007e-301

    1. Initial program 80.9%

      \[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z} \]
    2. Step-by-step derivation
      1. distribute-lft-out80.9%

        \[\leadsto 2 \cdot \sqrt{\color{blue}{x \cdot \left(y + z\right)} + y \cdot z} \]
    3. Simplified80.9%

      \[\leadsto \color{blue}{2 \cdot \sqrt{x \cdot \left(y + z\right) + y \cdot z}} \]
    4. Taylor expanded in x around inf 59.1%

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

    if 9.2000000000000007e-301 < y

    1. Initial program 69.4%

      \[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z} \]
    2. Step-by-step derivation
      1. distribute-lft-out69.4%

        \[\leadsto 2 \cdot \sqrt{\color{blue}{x \cdot \left(y + z\right)} + y \cdot z} \]
    3. Simplified69.4%

      \[\leadsto \color{blue}{2 \cdot \sqrt{x \cdot \left(y + z\right) + y \cdot z}} \]
    4. Step-by-step derivation
      1. add-sqr-sqrt69.0%

        \[\leadsto 2 \cdot \color{blue}{\left(\sqrt{\sqrt{x \cdot \left(y + z\right) + y \cdot z}} \cdot \sqrt{\sqrt{x \cdot \left(y + z\right) + y \cdot z}}\right)} \]
      2. pow269.0%

        \[\leadsto 2 \cdot \color{blue}{{\left(\sqrt{\sqrt{x \cdot \left(y + z\right) + y \cdot z}}\right)}^{2}} \]
      3. pow1/269.0%

        \[\leadsto 2 \cdot {\left(\sqrt{\color{blue}{{\left(x \cdot \left(y + z\right) + y \cdot z\right)}^{0.5}}}\right)}^{2} \]
      4. sqrt-pow169.1%

        \[\leadsto 2 \cdot {\color{blue}{\left({\left(x \cdot \left(y + z\right) + y \cdot z\right)}^{\left(\frac{0.5}{2}\right)}\right)}}^{2} \]
      5. fma-def69.5%

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

        \[\leadsto 2 \cdot {\left({\left(\mathsf{fma}\left(x, y + z, y \cdot z\right)\right)}^{\color{blue}{0.25}}\right)}^{2} \]
    5. Applied egg-rr69.5%

      \[\leadsto 2 \cdot \color{blue}{{\left({\left(\mathsf{fma}\left(x, y + z, y \cdot z\right)\right)}^{0.25}\right)}^{2}} \]
    6. Taylor expanded in z around inf 42.7%

      \[\leadsto 2 \cdot {\left({\color{blue}{\left(\left(y + x\right) \cdot z\right)}}^{0.25}\right)}^{2} \]
    7. Step-by-step derivation
      1. pow-pow42.9%

        \[\leadsto 2 \cdot \color{blue}{{\left(\left(y + x\right) \cdot z\right)}^{\left(0.25 \cdot 2\right)}} \]
      2. metadata-eval42.9%

        \[\leadsto 2 \cdot {\left(\left(y + x\right) \cdot z\right)}^{\color{blue}{0.5}} \]
      3. pow1/242.9%

        \[\leadsto 2 \cdot \color{blue}{\sqrt{\left(y + x\right) \cdot z}} \]
      4. sqrt-prod54.7%

        \[\leadsto 2 \cdot \color{blue}{\left(\sqrt{y + x} \cdot \sqrt{z}\right)} \]
    8. Applied egg-rr54.7%

      \[\leadsto 2 \cdot \color{blue}{\left(\sqrt{y + x} \cdot \sqrt{z}\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification54.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.4 \cdot 10^{+37}:\\ \;\;\;\;2 \cdot e^{-0.5 \cdot \left(\log \left(\frac{-1}{x}\right) + \log \left(\frac{-1}{y}\right)\right)}\\ \mathbf{elif}\;y \leq 9.2 \cdot 10^{-301}:\\ \;\;\;\;2 \cdot \sqrt{x \cdot \left(y + z\right)}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(\sqrt{y + x} \cdot \sqrt{z}\right)\\ \end{array} \]

Alternative 6: 85.3% accurate, 0.5× speedup?

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

\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\sqrt{y + x} \cdot \sqrt{z}\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 9.2000000000000007e-301

    1. Initial program 70.5%

      \[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z} \]
    2. Step-by-step derivation
      1. distribute-lft-out70.6%

        \[\leadsto 2 \cdot \sqrt{\color{blue}{x \cdot \left(y + z\right)} + y \cdot z} \]
    3. Simplified70.6%

      \[\leadsto \color{blue}{2 \cdot \sqrt{x \cdot \left(y + z\right) + y \cdot z}} \]
    4. Taylor expanded in x around inf 47.1%

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

    if 9.2000000000000007e-301 < y

    1. Initial program 69.4%

      \[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z} \]
    2. Step-by-step derivation
      1. distribute-lft-out69.4%

        \[\leadsto 2 \cdot \sqrt{\color{blue}{x \cdot \left(y + z\right)} + y \cdot z} \]
    3. Simplified69.4%

      \[\leadsto \color{blue}{2 \cdot \sqrt{x \cdot \left(y + z\right) + y \cdot z}} \]
    4. Step-by-step derivation
      1. add-sqr-sqrt69.0%

        \[\leadsto 2 \cdot \color{blue}{\left(\sqrt{\sqrt{x \cdot \left(y + z\right) + y \cdot z}} \cdot \sqrt{\sqrt{x \cdot \left(y + z\right) + y \cdot z}}\right)} \]
      2. pow269.0%

        \[\leadsto 2 \cdot \color{blue}{{\left(\sqrt{\sqrt{x \cdot \left(y + z\right) + y \cdot z}}\right)}^{2}} \]
      3. pow1/269.0%

        \[\leadsto 2 \cdot {\left(\sqrt{\color{blue}{{\left(x \cdot \left(y + z\right) + y \cdot z\right)}^{0.5}}}\right)}^{2} \]
      4. sqrt-pow169.1%

        \[\leadsto 2 \cdot {\color{blue}{\left({\left(x \cdot \left(y + z\right) + y \cdot z\right)}^{\left(\frac{0.5}{2}\right)}\right)}}^{2} \]
      5. fma-def69.5%

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

        \[\leadsto 2 \cdot {\left({\left(\mathsf{fma}\left(x, y + z, y \cdot z\right)\right)}^{\color{blue}{0.25}}\right)}^{2} \]
    5. Applied egg-rr69.5%

      \[\leadsto 2 \cdot \color{blue}{{\left({\left(\mathsf{fma}\left(x, y + z, y \cdot z\right)\right)}^{0.25}\right)}^{2}} \]
    6. Taylor expanded in z around inf 42.7%

      \[\leadsto 2 \cdot {\left({\color{blue}{\left(\left(y + x\right) \cdot z\right)}}^{0.25}\right)}^{2} \]
    7. Step-by-step derivation
      1. pow-pow42.9%

        \[\leadsto 2 \cdot \color{blue}{{\left(\left(y + x\right) \cdot z\right)}^{\left(0.25 \cdot 2\right)}} \]
      2. metadata-eval42.9%

        \[\leadsto 2 \cdot {\left(\left(y + x\right) \cdot z\right)}^{\color{blue}{0.5}} \]
      3. pow1/242.9%

        \[\leadsto 2 \cdot \color{blue}{\sqrt{\left(y + x\right) \cdot z}} \]
      4. sqrt-prod54.7%

        \[\leadsto 2 \cdot \color{blue}{\left(\sqrt{y + x} \cdot \sqrt{z}\right)} \]
    8. Applied egg-rr54.7%

      \[\leadsto 2 \cdot \color{blue}{\left(\sqrt{y + x} \cdot \sqrt{z}\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification50.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 9.2 \cdot 10^{-301}:\\ \;\;\;\;2 \cdot \sqrt{x \cdot \left(y + z\right)}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(\sqrt{y + x} \cdot \sqrt{z}\right)\\ \end{array} \]

Alternative 7: 84.0% accurate, 0.5× speedup?

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

\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\sqrt{z} \cdot \sqrt{y}\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 9.2000000000000007e-301

    1. Initial program 70.5%

      \[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z} \]
    2. Step-by-step derivation
      1. distribute-lft-out70.6%

        \[\leadsto 2 \cdot \sqrt{\color{blue}{x \cdot \left(y + z\right)} + y \cdot z} \]
    3. Simplified70.6%

      \[\leadsto \color{blue}{2 \cdot \sqrt{x \cdot \left(y + z\right) + y \cdot z}} \]
    4. Taylor expanded in x around inf 47.1%

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

    if 9.2000000000000007e-301 < y

    1. Initial program 69.4%

      \[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z} \]
    2. Step-by-step derivation
      1. distribute-lft-out69.4%

        \[\leadsto 2 \cdot \sqrt{\color{blue}{x \cdot \left(y + z\right)} + y \cdot z} \]
    3. Simplified69.4%

      \[\leadsto \color{blue}{2 \cdot \sqrt{x \cdot \left(y + z\right) + y \cdot z}} \]
    4. Taylor expanded in x around 0 19.7%

      \[\leadsto 2 \cdot \color{blue}{\sqrt{y \cdot z}} \]
    5. Step-by-step derivation
      1. *-commutative19.7%

        \[\leadsto 2 \cdot \sqrt{\color{blue}{z \cdot y}} \]
      2. sqrt-prod34.7%

        \[\leadsto 2 \cdot \color{blue}{\left(\sqrt{z} \cdot \sqrt{y}\right)} \]
    6. Applied egg-rr34.7%

      \[\leadsto 2 \cdot \color{blue}{\left(\sqrt{z} \cdot \sqrt{y}\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification41.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 9.2 \cdot 10^{-301}:\\ \;\;\;\;2 \cdot \sqrt{x \cdot \left(y + z\right)}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(\sqrt{z} \cdot \sqrt{y}\right)\\ \end{array} \]

Alternative 8: 71.7% accurate, 0.9× speedup?

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

\mathbf{else}:\\
\;\;\;\;2 \cdot {\left(\frac{\frac{-1}{y}}{\left(-z\right) - x}\right)}^{-0.5}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (+.f64 (+.f64 (*.f64 x y) (*.f64 x z)) (*.f64 y z)) < 5.00000000000000033e264

    1. Initial program 96.2%

      \[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z} \]
    2. Step-by-step derivation
      1. distribute-lft-out96.2%

        \[\leadsto 2 \cdot \sqrt{\color{blue}{x \cdot \left(y + z\right)} + y \cdot z} \]
    3. Simplified96.2%

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

    if 5.00000000000000033e264 < (+.f64 (+.f64 (*.f64 x y) (*.f64 x z)) (*.f64 y z))

    1. Initial program 19.0%

      \[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z} \]
    2. Step-by-step derivation
      1. distribute-lft-out19.1%

        \[\leadsto 2 \cdot \sqrt{\color{blue}{x \cdot \left(y + z\right)} + y \cdot z} \]
    3. Simplified19.1%

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

        \[\leadsto 2 \cdot \sqrt{\color{blue}{\frac{\left(x \cdot \left(y + z\right)\right) \cdot \left(x \cdot \left(y + z\right)\right) - \left(y \cdot z\right) \cdot \left(y \cdot z\right)}{x \cdot \left(y + z\right) - y \cdot z}}} \]
      2. clear-num0.5%

        \[\leadsto 2 \cdot \sqrt{\color{blue}{\frac{1}{\frac{x \cdot \left(y + z\right) - y \cdot z}{\left(x \cdot \left(y + z\right)\right) \cdot \left(x \cdot \left(y + z\right)\right) - \left(y \cdot z\right) \cdot \left(y \cdot z\right)}}}} \]
      3. pow20.5%

        \[\leadsto 2 \cdot \sqrt{\frac{1}{\frac{x \cdot \left(y + z\right) - y \cdot z}{\color{blue}{{\left(x \cdot \left(y + z\right)\right)}^{2}} - \left(y \cdot z\right) \cdot \left(y \cdot z\right)}}} \]
      4. pow20.5%

        \[\leadsto 2 \cdot \sqrt{\frac{1}{\frac{x \cdot \left(y + z\right) - y \cdot z}{{\left(x \cdot \left(y + z\right)\right)}^{2} - \color{blue}{{\left(y \cdot z\right)}^{2}}}}} \]
    5. Applied egg-rr0.5%

      \[\leadsto 2 \cdot \sqrt{\color{blue}{\frac{1}{\frac{x \cdot \left(y + z\right) - y \cdot z}{{\left(x \cdot \left(y + z\right)\right)}^{2} - {\left(y \cdot z\right)}^{2}}}}} \]
    6. Step-by-step derivation
      1. inv-pow0.5%

        \[\leadsto 2 \cdot \sqrt{\color{blue}{{\left(\frac{x \cdot \left(y + z\right) - y \cdot z}{{\left(x \cdot \left(y + z\right)\right)}^{2} - {\left(y \cdot z\right)}^{2}}\right)}^{-1}}} \]
      2. sqrt-pow10.5%

        \[\leadsto 2 \cdot \color{blue}{{\left(\frac{x \cdot \left(y + z\right) - y \cdot z}{{\left(x \cdot \left(y + z\right)\right)}^{2} - {\left(y \cdot z\right)}^{2}}\right)}^{\left(\frac{-1}{2}\right)}} \]
      3. clear-num0.5%

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

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

        \[\leadsto 2 \cdot {\left(\frac{1}{\frac{\left(x \cdot \left(y + z\right)\right) \cdot \left(x \cdot \left(y + z\right)\right) - \color{blue}{\left(y \cdot z\right) \cdot \left(y \cdot z\right)}}{x \cdot \left(y + z\right) - y \cdot z}}\right)}^{\left(\frac{-1}{2}\right)} \]
      6. flip-+19.1%

        \[\leadsto 2 \cdot {\left(\frac{1}{\color{blue}{x \cdot \left(y + z\right) + y \cdot z}}\right)}^{\left(\frac{-1}{2}\right)} \]
      7. fma-udef20.1%

        \[\leadsto 2 \cdot {\left(\frac{1}{\color{blue}{\mathsf{fma}\left(x, y + z, y \cdot z\right)}}\right)}^{\left(\frac{-1}{2}\right)} \]
      8. metadata-eval20.1%

        \[\leadsto 2 \cdot {\left(\frac{1}{\mathsf{fma}\left(x, y + z, y \cdot z\right)}\right)}^{\color{blue}{-0.5}} \]
    7. Applied egg-rr20.1%

      \[\leadsto 2 \cdot \color{blue}{{\left(\frac{1}{\mathsf{fma}\left(x, y + z, y \cdot z\right)}\right)}^{-0.5}} \]
    8. Step-by-step derivation
      1. fma-def19.1%

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

        \[\leadsto 2 \cdot {\left(\frac{1}{\color{blue}{y \cdot z + x \cdot \left(y + z\right)}}\right)}^{-0.5} \]
      3. fma-udef20.1%

        \[\leadsto 2 \cdot {\left(\frac{1}{\color{blue}{\mathsf{fma}\left(y, z, x \cdot \left(y + z\right)\right)}}\right)}^{-0.5} \]
    9. Simplified20.1%

      \[\leadsto 2 \cdot \color{blue}{{\left(\frac{1}{\mathsf{fma}\left(y, z, x \cdot \left(y + z\right)\right)}\right)}^{-0.5}} \]
    10. Taylor expanded in y around -inf 13.9%

      \[\leadsto 2 \cdot {\color{blue}{\left(\frac{-1}{y \cdot \left(-1 \cdot z + -1 \cdot x\right)}\right)}}^{-0.5} \]
    11. Step-by-step derivation
      1. associate-/r*17.2%

        \[\leadsto 2 \cdot {\color{blue}{\left(\frac{\frac{-1}{y}}{-1 \cdot z + -1 \cdot x}\right)}}^{-0.5} \]
      2. mul-1-neg17.2%

        \[\leadsto 2 \cdot {\left(\frac{\frac{-1}{y}}{-1 \cdot z + \color{blue}{\left(-x\right)}}\right)}^{-0.5} \]
      3. unsub-neg17.2%

        \[\leadsto 2 \cdot {\left(\frac{\frac{-1}{y}}{\color{blue}{-1 \cdot z - x}}\right)}^{-0.5} \]
      4. mul-1-neg17.2%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(y \cdot x + x \cdot z\right) + y \cdot z \leq 5 \cdot 10^{+264}:\\ \;\;\;\;2 \cdot \sqrt{y \cdot z + x \cdot \left(y + z\right)}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot {\left(\frac{\frac{-1}{y}}{\left(-z\right) - x}\right)}^{-0.5}\\ \end{array} \]

Alternative 9: 70.3% accurate, 1.0× speedup?

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

\mathbf{else}:\\
\;\;\;\;2 \cdot {\left(\frac{1}{z \cdot \left(y + x\right)}\right)}^{-0.5}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 9.99999999999999909e-308

    1. Initial program 70.5%

      \[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z} \]
    2. Step-by-step derivation
      1. distribute-lft-out70.6%

        \[\leadsto 2 \cdot \sqrt{\color{blue}{x \cdot \left(y + z\right)} + y \cdot z} \]
    3. Simplified70.6%

      \[\leadsto \color{blue}{2 \cdot \sqrt{x \cdot \left(y + z\right) + y \cdot z}} \]
    4. Taylor expanded in x around inf 47.1%

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

    if 9.99999999999999909e-308 < y

    1. Initial program 69.4%

      \[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z} \]
    2. Step-by-step derivation
      1. distribute-lft-out69.4%

        \[\leadsto 2 \cdot \sqrt{\color{blue}{x \cdot \left(y + z\right)} + y \cdot z} \]
    3. Simplified69.4%

      \[\leadsto \color{blue}{2 \cdot \sqrt{x \cdot \left(y + z\right) + y \cdot z}} \]
    4. Step-by-step derivation
      1. flip-+37.9%

        \[\leadsto 2 \cdot \sqrt{\color{blue}{\frac{\left(x \cdot \left(y + z\right)\right) \cdot \left(x \cdot \left(y + z\right)\right) - \left(y \cdot z\right) \cdot \left(y \cdot z\right)}{x \cdot \left(y + z\right) - y \cdot z}}} \]
      2. clear-num37.9%

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

        \[\leadsto 2 \cdot \sqrt{\frac{1}{\frac{x \cdot \left(y + z\right) - y \cdot z}{\color{blue}{{\left(x \cdot \left(y + z\right)\right)}^{2}} - \left(y \cdot z\right) \cdot \left(y \cdot z\right)}}} \]
      4. pow237.9%

        \[\leadsto 2 \cdot \sqrt{\frac{1}{\frac{x \cdot \left(y + z\right) - y \cdot z}{{\left(x \cdot \left(y + z\right)\right)}^{2} - \color{blue}{{\left(y \cdot z\right)}^{2}}}}} \]
    5. Applied egg-rr37.9%

      \[\leadsto 2 \cdot \sqrt{\color{blue}{\frac{1}{\frac{x \cdot \left(y + z\right) - y \cdot z}{{\left(x \cdot \left(y + z\right)\right)}^{2} - {\left(y \cdot z\right)}^{2}}}}} \]
    6. Step-by-step derivation
      1. inv-pow37.9%

        \[\leadsto 2 \cdot \sqrt{\color{blue}{{\left(\frac{x \cdot \left(y + z\right) - y \cdot z}{{\left(x \cdot \left(y + z\right)\right)}^{2} - {\left(y \cdot z\right)}^{2}}\right)}^{-1}}} \]
      2. sqrt-pow137.9%

        \[\leadsto 2 \cdot \color{blue}{{\left(\frac{x \cdot \left(y + z\right) - y \cdot z}{{\left(x \cdot \left(y + z\right)\right)}^{2} - {\left(y \cdot z\right)}^{2}}\right)}^{\left(\frac{-1}{2}\right)}} \]
      3. clear-num37.9%

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

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

        \[\leadsto 2 \cdot {\left(\frac{1}{\frac{\left(x \cdot \left(y + z\right)\right) \cdot \left(x \cdot \left(y + z\right)\right) - \color{blue}{\left(y \cdot z\right) \cdot \left(y \cdot z\right)}}{x \cdot \left(y + z\right) - y \cdot z}}\right)}^{\left(\frac{-1}{2}\right)} \]
      6. flip-+69.4%

        \[\leadsto 2 \cdot {\left(\frac{1}{\color{blue}{x \cdot \left(y + z\right) + y \cdot z}}\right)}^{\left(\frac{-1}{2}\right)} \]
      7. fma-udef69.8%

        \[\leadsto 2 \cdot {\left(\frac{1}{\color{blue}{\mathsf{fma}\left(x, y + z, y \cdot z\right)}}\right)}^{\left(\frac{-1}{2}\right)} \]
      8. metadata-eval69.8%

        \[\leadsto 2 \cdot {\left(\frac{1}{\mathsf{fma}\left(x, y + z, y \cdot z\right)}\right)}^{\color{blue}{-0.5}} \]
    7. Applied egg-rr69.8%

      \[\leadsto 2 \cdot \color{blue}{{\left(\frac{1}{\mathsf{fma}\left(x, y + z, y \cdot z\right)}\right)}^{-0.5}} \]
    8. Step-by-step derivation
      1. fma-def69.4%

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

        \[\leadsto 2 \cdot {\left(\frac{1}{\color{blue}{y \cdot z + x \cdot \left(y + z\right)}}\right)}^{-0.5} \]
      3. fma-udef69.8%

        \[\leadsto 2 \cdot {\left(\frac{1}{\color{blue}{\mathsf{fma}\left(y, z, x \cdot \left(y + z\right)\right)}}\right)}^{-0.5} \]
    9. Simplified69.8%

      \[\leadsto 2 \cdot \color{blue}{{\left(\frac{1}{\mathsf{fma}\left(y, z, x \cdot \left(y + z\right)\right)}\right)}^{-0.5}} \]
    10. Taylor expanded in z around inf 42.9%

      \[\leadsto 2 \cdot {\color{blue}{\left(\frac{1}{\left(y + x\right) \cdot z}\right)}}^{-0.5} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification45.0%

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

Alternative 10: 70.3% accurate, 1.0× speedup?

\[\begin{array}{l} [x, y, z] = \mathsf{sort}([x, y, z])\\ \\ 2 \cdot \sqrt{y \cdot z + x \cdot \left(y + z\right)} \end{array} \]
NOTE: x, y, and z should be sorted in increasing order before calling this function.
(FPCore (x y z) :precision binary64 (* 2.0 (sqrt (+ (* y z) (* x (+ y z))))))
assert(x < y && y < z);
double code(double x, double y, double z) {
	return 2.0 * sqrt(((y * z) + (x * (y + z))));
}
NOTE: x, y, and z should be sorted in increasing order before calling this function.
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    code = 2.0d0 * sqrt(((y * z) + (x * (y + z))))
end function
assert x < y && y < z;
public static double code(double x, double y, double z) {
	return 2.0 * Math.sqrt(((y * z) + (x * (y + z))));
}
[x, y, z] = sort([x, y, z])
def code(x, y, z):
	return 2.0 * math.sqrt(((y * z) + (x * (y + z))))
x, y, z = sort([x, y, z])
function code(x, y, z)
	return Float64(2.0 * sqrt(Float64(Float64(y * z) + Float64(x * Float64(y + z)))))
end
x, y, z = num2cell(sort([x, y, z])){:}
function tmp = code(x, y, z)
	tmp = 2.0 * sqrt(((y * z) + (x * (y + z))));
end
NOTE: x, y, and z should be sorted in increasing order before calling this function.
code[x_, y_, z_] := N[(2.0 * N[Sqrt[N[(N[(y * z), $MachinePrecision] + N[(x * N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z] = \mathsf{sort}([x, y, z])\\
\\
2 \cdot \sqrt{y \cdot z + x \cdot \left(y + z\right)}
\end{array}
Derivation
  1. Initial program 70.0%

    \[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z} \]
  2. Step-by-step derivation
    1. distribute-lft-out70.0%

      \[\leadsto 2 \cdot \sqrt{\color{blue}{x \cdot \left(y + z\right)} + y \cdot z} \]
  3. Simplified70.0%

    \[\leadsto \color{blue}{2 \cdot \sqrt{x \cdot \left(y + z\right) + y \cdot z}} \]
  4. Final simplification70.0%

    \[\leadsto 2 \cdot \sqrt{y \cdot z + x \cdot \left(y + z\right)} \]

Alternative 11: 69.3% accurate, 1.0× speedup?

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

\mathbf{else}:\\
\;\;\;\;2 \cdot \sqrt{z \cdot \left(y + x\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.3e-288

    1. Initial program 70.6%

      \[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z} \]
    2. Step-by-step derivation
      1. distribute-lft-out70.7%

        \[\leadsto 2 \cdot \sqrt{\color{blue}{x \cdot \left(y + z\right)} + y \cdot z} \]
    3. Simplified70.7%

      \[\leadsto \color{blue}{2 \cdot \sqrt{x \cdot \left(y + z\right) + y \cdot z}} \]
    4. Taylor expanded in z around 0 29.1%

      \[\leadsto 2 \cdot \color{blue}{\sqrt{y \cdot x}} \]

    if -2.3e-288 < y

    1. Initial program 69.4%

      \[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z} \]
    2. Step-by-step derivation
      1. distribute-lft-out69.4%

        \[\leadsto 2 \cdot \sqrt{\color{blue}{x \cdot \left(y + z\right)} + y \cdot z} \]
    3. Simplified69.4%

      \[\leadsto \color{blue}{2 \cdot \sqrt{x \cdot \left(y + z\right) + y \cdot z}} \]
    4. Taylor expanded in z around inf 44.0%

      \[\leadsto 2 \cdot \sqrt{\color{blue}{\left(y + x\right) \cdot z}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification36.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.3 \cdot 10^{-288}:\\ \;\;\;\;2 \cdot \sqrt{y \cdot x}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \sqrt{z \cdot \left(y + x\right)}\\ \end{array} \]

Alternative 12: 70.5% accurate, 1.0× speedup?

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

\mathbf{else}:\\
\;\;\;\;2 \cdot \sqrt{z \cdot \left(y + x\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -9.9999999999999996e-303

    1. Initial program 70.8%

      \[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z} \]
    2. Step-by-step derivation
      1. distribute-lft-out70.8%

        \[\leadsto 2 \cdot \sqrt{\color{blue}{x \cdot \left(y + z\right)} + y \cdot z} \]
    3. Simplified70.8%

      \[\leadsto \color{blue}{2 \cdot \sqrt{x \cdot \left(y + z\right) + y \cdot z}} \]
    4. Taylor expanded in x around inf 47.0%

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

    if -9.9999999999999996e-303 < y

    1. Initial program 69.1%

      \[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z} \]
    2. Step-by-step derivation
      1. distribute-lft-out69.1%

        \[\leadsto 2 \cdot \sqrt{\color{blue}{x \cdot \left(y + z\right)} + y \cdot z} \]
    3. Simplified69.1%

      \[\leadsto \color{blue}{2 \cdot \sqrt{x \cdot \left(y + z\right) + y \cdot z}} \]
    4. Taylor expanded in z around inf 43.0%

      \[\leadsto 2 \cdot \sqrt{\color{blue}{\left(y + x\right) \cdot z}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification45.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1 \cdot 10^{-302}:\\ \;\;\;\;2 \cdot \sqrt{x \cdot \left(y + z\right)}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \sqrt{z \cdot \left(y + x\right)}\\ \end{array} \]

Alternative 13: 68.4% accurate, 1.1× speedup?

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

\mathbf{else}:\\
\;\;\;\;2 \cdot \sqrt{y \cdot z}\\


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

    1. Initial program 70.5%

      \[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z} \]
    2. Step-by-step derivation
      1. distribute-lft-out70.6%

        \[\leadsto 2 \cdot \sqrt{\color{blue}{x \cdot \left(y + z\right)} + y \cdot z} \]
    3. Simplified70.6%

      \[\leadsto \color{blue}{2 \cdot \sqrt{x \cdot \left(y + z\right) + y \cdot z}} \]
    4. Taylor expanded in z around 0 27.9%

      \[\leadsto 2 \cdot \color{blue}{\sqrt{y \cdot x}} \]

    if -4.999999999999985e-310 < y

    1. Initial program 69.4%

      \[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z} \]
    2. Step-by-step derivation
      1. distribute-lft-out69.4%

        \[\leadsto 2 \cdot \sqrt{\color{blue}{x \cdot \left(y + z\right)} + y \cdot z} \]
    3. Simplified69.4%

      \[\leadsto \color{blue}{2 \cdot \sqrt{x \cdot \left(y + z\right) + y \cdot z}} \]
    4. Taylor expanded in x around 0 19.7%

      \[\leadsto 2 \cdot \color{blue}{\sqrt{y \cdot z}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification23.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -5 \cdot 10^{-310}:\\ \;\;\;\;2 \cdot \sqrt{y \cdot x}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \sqrt{y \cdot z}\\ \end{array} \]

Alternative 14: 35.8% accurate, 1.1× speedup?

\[\begin{array}{l} [x, y, z] = \mathsf{sort}([x, y, z])\\ \\ 2 \cdot \sqrt{y \cdot x} \end{array} \]
NOTE: x, y, and z should be sorted in increasing order before calling this function.
(FPCore (x y z) :precision binary64 (* 2.0 (sqrt (* y x))))
assert(x < y && y < z);
double code(double x, double y, double z) {
	return 2.0 * sqrt((y * x));
}
NOTE: x, y, and z should be sorted in increasing order before calling this function.
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    code = 2.0d0 * sqrt((y * x))
end function
assert x < y && y < z;
public static double code(double x, double y, double z) {
	return 2.0 * Math.sqrt((y * x));
}
[x, y, z] = sort([x, y, z])
def code(x, y, z):
	return 2.0 * math.sqrt((y * x))
x, y, z = sort([x, y, z])
function code(x, y, z)
	return Float64(2.0 * sqrt(Float64(y * x)))
end
x, y, z = num2cell(sort([x, y, z])){:}
function tmp = code(x, y, z)
	tmp = 2.0 * sqrt((y * x));
end
NOTE: x, y, and z should be sorted in increasing order before calling this function.
code[x_, y_, z_] := N[(2.0 * N[Sqrt[N[(y * x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z] = \mathsf{sort}([x, y, z])\\
\\
2 \cdot \sqrt{y \cdot x}
\end{array}
Derivation
  1. Initial program 70.0%

    \[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z} \]
  2. Step-by-step derivation
    1. distribute-lft-out70.0%

      \[\leadsto 2 \cdot \sqrt{\color{blue}{x \cdot \left(y + z\right)} + y \cdot z} \]
  3. Simplified70.0%

    \[\leadsto \color{blue}{2 \cdot \sqrt{x \cdot \left(y + z\right) + y \cdot z}} \]
  4. Taylor expanded in z around 0 28.8%

    \[\leadsto 2 \cdot \color{blue}{\sqrt{y \cdot x}} \]
  5. Final simplification28.8%

    \[\leadsto 2 \cdot \sqrt{y \cdot x} \]

Developer target: 83.4% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 0.25 \cdot \left(\left({y}^{-0.75} \cdot \left({z}^{-0.75} \cdot x\right)\right) \cdot \left(y + z\right)\right) + {z}^{0.25} \cdot {y}^{0.25}\\ \mathbf{if}\;z < 7.636950090573675 \cdot 10^{+176}:\\ \;\;\;\;2 \cdot \sqrt{\left(x + y\right) \cdot z + x \cdot y}\\ \mathbf{else}:\\ \;\;\;\;\left(t_0 \cdot t_0\right) \cdot 2\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0
         (+
          (* 0.25 (* (* (pow y -0.75) (* (pow z -0.75) x)) (+ y z)))
          (* (pow z 0.25) (pow y 0.25)))))
   (if (< z 7.636950090573675e+176)
     (* 2.0 (sqrt (+ (* (+ x y) z) (* x y))))
     (* (* t_0 t_0) 2.0))))
double code(double x, double y, double z) {
	double t_0 = (0.25 * ((pow(y, -0.75) * (pow(z, -0.75) * x)) * (y + z))) + (pow(z, 0.25) * pow(y, 0.25));
	double tmp;
	if (z < 7.636950090573675e+176) {
		tmp = 2.0 * sqrt((((x + y) * z) + (x * y)));
	} else {
		tmp = (t_0 * t_0) * 2.0;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: tmp
    t_0 = (0.25d0 * (((y ** (-0.75d0)) * ((z ** (-0.75d0)) * x)) * (y + z))) + ((z ** 0.25d0) * (y ** 0.25d0))
    if (z < 7.636950090573675d+176) then
        tmp = 2.0d0 * sqrt((((x + y) * z) + (x * y)))
    else
        tmp = (t_0 * t_0) * 2.0d0
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = (0.25 * ((Math.pow(y, -0.75) * (Math.pow(z, -0.75) * x)) * (y + z))) + (Math.pow(z, 0.25) * Math.pow(y, 0.25));
	double tmp;
	if (z < 7.636950090573675e+176) {
		tmp = 2.0 * Math.sqrt((((x + y) * z) + (x * y)));
	} else {
		tmp = (t_0 * t_0) * 2.0;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = (0.25 * ((math.pow(y, -0.75) * (math.pow(z, -0.75) * x)) * (y + z))) + (math.pow(z, 0.25) * math.pow(y, 0.25))
	tmp = 0
	if z < 7.636950090573675e+176:
		tmp = 2.0 * math.sqrt((((x + y) * z) + (x * y)))
	else:
		tmp = (t_0 * t_0) * 2.0
	return tmp
function code(x, y, z)
	t_0 = Float64(Float64(0.25 * Float64(Float64((y ^ -0.75) * Float64((z ^ -0.75) * x)) * Float64(y + z))) + Float64((z ^ 0.25) * (y ^ 0.25)))
	tmp = 0.0
	if (z < 7.636950090573675e+176)
		tmp = Float64(2.0 * sqrt(Float64(Float64(Float64(x + y) * z) + Float64(x * y))));
	else
		tmp = Float64(Float64(t_0 * t_0) * 2.0);
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = (0.25 * (((y ^ -0.75) * ((z ^ -0.75) * x)) * (y + z))) + ((z ^ 0.25) * (y ^ 0.25));
	tmp = 0.0;
	if (z < 7.636950090573675e+176)
		tmp = 2.0 * sqrt((((x + y) * z) + (x * y)));
	else
		tmp = (t_0 * t_0) * 2.0;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(0.25 * N[(N[(N[Power[y, -0.75], $MachinePrecision] * N[(N[Power[z, -0.75], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] * N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Power[z, 0.25], $MachinePrecision] * N[Power[y, 0.25], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[z, 7.636950090573675e+176], N[(2.0 * N[Sqrt[N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(t$95$0 * t$95$0), $MachinePrecision] * 2.0), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := 0.25 \cdot \left(\left({y}^{-0.75} \cdot \left({z}^{-0.75} \cdot x\right)\right) \cdot \left(y + z\right)\right) + {z}^{0.25} \cdot {y}^{0.25}\\
\mathbf{if}\;z < 7.636950090573675 \cdot 10^{+176}:\\
\;\;\;\;2 \cdot \sqrt{\left(x + y\right) \cdot z + x \cdot y}\\

\mathbf{else}:\\
\;\;\;\;\left(t_0 \cdot t_0\right) \cdot 2\\


\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2023221 
(FPCore (x y z)
  :name "Diagrams.TwoD.Apollonian:descartes from diagrams-contrib-1.3.0.5"
  :precision binary64

  :herbie-target
  (if (< z 7.636950090573675e+176) (* 2.0 (sqrt (+ (* (+ x y) z) (* x y)))) (* (* (+ (* 0.25 (* (* (pow y -0.75) (* (pow z -0.75) x)) (+ y z))) (* (pow z 0.25) (pow y 0.25))) (+ (* 0.25 (* (* (pow y -0.75) (* (pow z -0.75) x)) (+ y z))) (* (pow z 0.25) (pow y 0.25)))) 2.0))

  (* 2.0 (sqrt (+ (+ (* x y) (* x z)) (* y z)))))