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

Percentage Accurate: 70.3% → 94.8%
Time: 11.8s
Alternatives: 11
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 11 alternatives:

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

Initial Program: 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: 94.8% accurate, 0.1× speedup?

\[\begin{array}{l} [x, y, z] = \mathsf{sort}([x, y, z])\\ \\ \begin{array}{l} t_0 := \log \left(\frac{-1}{x}\right)\\ t_1 := -t_0\\ t_2 := \log \left(\left(-z\right) - y\right)\\ t_3 := \sqrt{t_2}\\ \mathbf{if}\;y \leq -2.8 \cdot 10^{+32}:\\ \;\;\;\;2 \cdot e^{\left(\mathsf{fma}\left(t_3, t_3, t_1\right) + \mathsf{fma}\left(t_1, 1, t_0\right)\right) \cdot 0.5}\\ \mathbf{elif}\;y \leq -2.8 \cdot 10^{-209}:\\ \;\;\;\;2 \cdot \sqrt{z \cdot \left(y + x\right) + y \cdot x}\\ \mathbf{elif}\;y \leq 1.95 \cdot 10^{-271}:\\ \;\;\;\;2 \cdot e^{0.5 \cdot \left(t_2 - t_0\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
 (let* ((t_0 (log (/ -1.0 x)))
        (t_1 (- t_0))
        (t_2 (log (- (- z) y)))
        (t_3 (sqrt t_2)))
   (if (<= y -2.8e+32)
     (* 2.0 (exp (* (+ (fma t_3 t_3 t_1) (fma t_1 1.0 t_0)) 0.5)))
     (if (<= y -2.8e-209)
       (* 2.0 (sqrt (+ (* z (+ y x)) (* y x))))
       (if (<= y 1.95e-271)
         (* 2.0 (exp (* 0.5 (- t_2 t_0))))
         (* 2.0 (* (sqrt z) (sqrt y))))))))
assert(x < y && y < z);
double code(double x, double y, double z) {
	double t_0 = log((-1.0 / x));
	double t_1 = -t_0;
	double t_2 = log((-z - y));
	double t_3 = sqrt(t_2);
	double tmp;
	if (y <= -2.8e+32) {
		tmp = 2.0 * exp(((fma(t_3, t_3, t_1) + fma(t_1, 1.0, t_0)) * 0.5));
	} else if (y <= -2.8e-209) {
		tmp = 2.0 * sqrt(((z * (y + x)) + (y * x)));
	} else if (y <= 1.95e-271) {
		tmp = 2.0 * exp((0.5 * (t_2 - t_0)));
	} else {
		tmp = 2.0 * (sqrt(z) * sqrt(y));
	}
	return tmp;
}
x, y, z = sort([x, y, z])
function code(x, y, z)
	t_0 = log(Float64(-1.0 / x))
	t_1 = Float64(-t_0)
	t_2 = log(Float64(Float64(-z) - y))
	t_3 = sqrt(t_2)
	tmp = 0.0
	if (y <= -2.8e+32)
		tmp = Float64(2.0 * exp(Float64(Float64(fma(t_3, t_3, t_1) + fma(t_1, 1.0, t_0)) * 0.5)));
	elseif (y <= -2.8e-209)
		tmp = Float64(2.0 * sqrt(Float64(Float64(z * Float64(y + x)) + Float64(y * x))));
	elseif (y <= 1.95e-271)
		tmp = Float64(2.0 * exp(Float64(0.5 * Float64(t_2 - t_0))));
	else
		tmp = Float64(2.0 * Float64(sqrt(z) * sqrt(y)));
	end
	return 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[Log[N[(-1.0 / x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = (-t$95$0)}, Block[{t$95$2 = N[Log[N[((-z) - y), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[t$95$2], $MachinePrecision]}, If[LessEqual[y, -2.8e+32], N[(2.0 * N[Exp[N[(N[(N[(t$95$3 * t$95$3 + t$95$1), $MachinePrecision] + N[(t$95$1 * 1.0 + t$95$0), $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -2.8e-209], N[(2.0 * N[Sqrt[N[(N[(z * N[(y + x), $MachinePrecision]), $MachinePrecision] + N[(y * x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.95e-271], N[(2.0 * N[Exp[N[(0.5 * N[(t$95$2 - t$95$0), $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}
t_0 := \log \left(\frac{-1}{x}\right)\\
t_1 := -t_0\\
t_2 := \log \left(\left(-z\right) - y\right)\\
t_3 := \sqrt{t_2}\\
\mathbf{if}\;y \leq -2.8 \cdot 10^{+32}:\\
\;\;\;\;2 \cdot e^{\left(\mathsf{fma}\left(t_3, t_3, t_1\right) + \mathsf{fma}\left(t_1, 1, t_0\right)\right) \cdot 0.5}\\

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

\mathbf{elif}\;y \leq 1.95 \cdot 10^{-271}:\\
\;\;\;\;2 \cdot e^{0.5 \cdot \left(t_2 - t_0\right)}\\

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


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

    1. Initial program 48.9%

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

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

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

        \[\leadsto 2 \cdot \sqrt{\color{blue}{\left(x \cdot y + x \cdot z\right)} + y \cdot z} \]
      2. associate-+l+48.9%

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

        \[\leadsto 2 \cdot \sqrt{\color{blue}{\left(x \cdot z + y \cdot z\right) + x \cdot y}} \]
      4. distribute-rgt-in48.9%

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

        \[\leadsto 2 \cdot \sqrt{\color{blue}{\mathsf{fma}\left(z, x + y, x \cdot y\right)}} \]
      6. pow1/249.1%

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

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

        \[\leadsto 2 \cdot e^{\log \color{blue}{\left(z \cdot \left(x + y\right) + x \cdot y\right)} \cdot 0.5} \]
      9. distribute-rgt-in45.6%

        \[\leadsto 2 \cdot e^{\log \left(\color{blue}{\left(x \cdot z + y \cdot z\right)} + x \cdot y\right) \cdot 0.5} \]
      10. +-commutative45.6%

        \[\leadsto 2 \cdot e^{\log \color{blue}{\left(x \cdot y + \left(x \cdot z + y \cdot z\right)\right)} \cdot 0.5} \]
      11. fma-def45.6%

        \[\leadsto 2 \cdot e^{\log \color{blue}{\left(\mathsf{fma}\left(x, y, x \cdot z + y \cdot z\right)\right)} \cdot 0.5} \]
      12. distribute-rgt-in45.6%

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

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

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

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

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

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

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

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

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

      \[\leadsto 2 \cdot e^{\color{blue}{\left(\log \left(\left(-z\right) - y\right) - \log \left(\frac{-1}{x}\right)\right)} \cdot 0.5} \]
    9. Step-by-step derivation
      1. add-sqr-sqrt47.6%

        \[\leadsto 2 \cdot e^{\left(\color{blue}{\sqrt{\log \left(\left(-z\right) - y\right)} \cdot \sqrt{\log \left(\left(-z\right) - y\right)}} - \log \left(\frac{-1}{x}\right)\right) \cdot 0.5} \]
      2. *-un-lft-identity47.6%

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

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

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

    if -2.8e32 < y < -2.80000000000000012e-209

    1. Initial program 77.1%

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

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

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

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

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

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

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

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

    if -2.80000000000000012e-209 < y < 1.94999999999999999e-271

    1. Initial program 64.7%

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

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

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

        \[\leadsto 2 \cdot \sqrt{\color{blue}{\left(x \cdot y + x \cdot z\right)} + y \cdot z} \]
      2. associate-+l+64.7%

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

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

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

        \[\leadsto 2 \cdot \sqrt{\color{blue}{\mathsf{fma}\left(z, x + y, x \cdot y\right)}} \]
      6. pow1/264.7%

        \[\leadsto 2 \cdot \color{blue}{{\left(\mathsf{fma}\left(z, x + y, x \cdot y\right)\right)}^{0.5}} \]
      7. pow-to-exp60.0%

        \[\leadsto 2 \cdot \color{blue}{e^{\log \left(\mathsf{fma}\left(z, x + y, x \cdot y\right)\right) \cdot 0.5}} \]
      8. fma-udef60.0%

        \[\leadsto 2 \cdot e^{\log \color{blue}{\left(z \cdot \left(x + y\right) + x \cdot y\right)} \cdot 0.5} \]
      9. distribute-rgt-in60.0%

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

        \[\leadsto 2 \cdot e^{\log \color{blue}{\left(x \cdot y + \left(x \cdot z + y \cdot z\right)\right)} \cdot 0.5} \]
      11. fma-def60.0%

        \[\leadsto 2 \cdot e^{\log \color{blue}{\left(\mathsf{fma}\left(x, y, x \cdot z + y \cdot z\right)\right)} \cdot 0.5} \]
      12. distribute-rgt-in60.0%

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

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

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

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

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

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

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

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

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

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

    if 1.94999999999999999e-271 < y

    1. Initial program 76.1%

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

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

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

      \[\leadsto 2 \cdot \color{blue}{\sqrt{y \cdot z}} \]
    5. Step-by-step derivation
      1. pow1/235.1%

        \[\leadsto 2 \cdot \color{blue}{{\left(y \cdot z\right)}^{0.5}} \]
      2. *-commutative35.1%

        \[\leadsto 2 \cdot {\color{blue}{\left(z \cdot y\right)}}^{0.5} \]
      3. metadata-eval35.1%

        \[\leadsto 2 \cdot {\left(z \cdot y\right)}^{\color{blue}{\left(\sqrt{0.25}\right)}} \]
      4. unpow-prod-down44.7%

        \[\leadsto 2 \cdot \color{blue}{\left({z}^{\left(\sqrt{0.25}\right)} \cdot {y}^{\left(\sqrt{0.25}\right)}\right)} \]
      5. metadata-eval44.7%

        \[\leadsto 2 \cdot \left({z}^{\color{blue}{0.5}} \cdot {y}^{\left(\sqrt{0.25}\right)}\right) \]
      6. pow1/244.7%

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

        \[\leadsto 2 \cdot \left(\sqrt{z} \cdot {y}^{\color{blue}{0.5}}\right) \]
      8. pow1/244.7%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.8 \cdot 10^{+32}:\\ \;\;\;\;2 \cdot e^{\left(\mathsf{fma}\left(\sqrt{\log \left(\left(-z\right) - y\right)}, \sqrt{\log \left(\left(-z\right) - y\right)}, -\log \left(\frac{-1}{x}\right)\right) + \mathsf{fma}\left(-\log \left(\frac{-1}{x}\right), 1, \log \left(\frac{-1}{x}\right)\right)\right) \cdot 0.5}\\ \mathbf{elif}\;y \leq -2.8 \cdot 10^{-209}:\\ \;\;\;\;2 \cdot \sqrt{z \cdot \left(y + x\right) + y \cdot x}\\ \mathbf{elif}\;y \leq 1.95 \cdot 10^{-271}:\\ \;\;\;\;2 \cdot e^{0.5 \cdot \left(\log \left(\left(-z\right) - y\right) - \log \left(\frac{-1}{x}\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(\sqrt{z} \cdot \sqrt{y}\right)\\ \end{array} \]

Alternative 2: 94.8% 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(\left(-z\right) - y\right) - \log \left(\frac{-1}{x}\right)\right)}\\ \mathbf{if}\;y \leq -3.2 \cdot 10^{+31}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq -3.5 \cdot 10^{-208}:\\ \;\;\;\;2 \cdot \sqrt{z \cdot \left(y + x\right) + y \cdot x}\\ \mathbf{elif}\;y \leq 4.7 \cdot 10^{-271}:\\ \;\;\;\;t_0\\ \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
 (let* ((t_0 (* 2.0 (exp (* 0.5 (- (log (- (- z) y)) (log (/ -1.0 x))))))))
   (if (<= y -3.2e+31)
     t_0
     (if (<= y -3.5e-208)
       (* 2.0 (sqrt (+ (* z (+ y x)) (* y x))))
       (if (<= y 4.7e-271) t_0 (* 2.0 (* (sqrt z) (sqrt y))))))))
assert(x < y && y < z);
double code(double x, double y, double z) {
	double t_0 = 2.0 * exp((0.5 * (log((-z - y)) - log((-1.0 / x)))));
	double tmp;
	if (y <= -3.2e+31) {
		tmp = t_0;
	} else if (y <= -3.5e-208) {
		tmp = 2.0 * sqrt(((z * (y + x)) + (y * x)));
	} else if (y <= 4.7e-271) {
		tmp = t_0;
	} 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) :: t_0
    real(8) :: tmp
    t_0 = 2.0d0 * exp((0.5d0 * (log((-z - y)) - log(((-1.0d0) / x)))))
    if (y <= (-3.2d+31)) then
        tmp = t_0
    else if (y <= (-3.5d-208)) then
        tmp = 2.0d0 * sqrt(((z * (y + x)) + (y * x)))
    else if (y <= 4.7d-271) then
        tmp = t_0
    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 t_0 = 2.0 * Math.exp((0.5 * (Math.log((-z - y)) - Math.log((-1.0 / x)))));
	double tmp;
	if (y <= -3.2e+31) {
		tmp = t_0;
	} else if (y <= -3.5e-208) {
		tmp = 2.0 * Math.sqrt(((z * (y + x)) + (y * x)));
	} else if (y <= 4.7e-271) {
		tmp = t_0;
	} else {
		tmp = 2.0 * (Math.sqrt(z) * Math.sqrt(y));
	}
	return tmp;
}
[x, y, z] = sort([x, y, z])
def code(x, y, z):
	t_0 = 2.0 * math.exp((0.5 * (math.log((-z - y)) - math.log((-1.0 / x)))))
	tmp = 0
	if y <= -3.2e+31:
		tmp = t_0
	elif y <= -3.5e-208:
		tmp = 2.0 * math.sqrt(((z * (y + x)) + (y * x)))
	elif y <= 4.7e-271:
		tmp = t_0
	else:
		tmp = 2.0 * (math.sqrt(z) * math.sqrt(y))
	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(Float64(-z) - y)) - log(Float64(-1.0 / x))))))
	tmp = 0.0
	if (y <= -3.2e+31)
		tmp = t_0;
	elseif (y <= -3.5e-208)
		tmp = Float64(2.0 * sqrt(Float64(Float64(z * Float64(y + x)) + Float64(y * x))));
	elseif (y <= 4.7e-271)
		tmp = t_0;
	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)
	t_0 = 2.0 * exp((0.5 * (log((-z - y)) - log((-1.0 / x)))));
	tmp = 0.0;
	if (y <= -3.2e+31)
		tmp = t_0;
	elseif (y <= -3.5e-208)
		tmp = 2.0 * sqrt(((z * (y + x)) + (y * x)));
	elseif (y <= 4.7e-271)
		tmp = t_0;
	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_] := Block[{t$95$0 = N[(2.0 * N[Exp[N[(0.5 * N[(N[Log[N[((-z) - y), $MachinePrecision]], $MachinePrecision] - N[Log[N[(-1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -3.2e+31], t$95$0, If[LessEqual[y, -3.5e-208], N[(2.0 * N[Sqrt[N[(N[(z * N[(y + x), $MachinePrecision]), $MachinePrecision] + N[(y * x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.7e-271], t$95$0, 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}
t_0 := 2 \cdot e^{0.5 \cdot \left(\log \left(\left(-z\right) - y\right) - \log \left(\frac{-1}{x}\right)\right)}\\
\mathbf{if}\;y \leq -3.2 \cdot 10^{+31}:\\
\;\;\;\;t_0\\

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

\mathbf{elif}\;y \leq 4.7 \cdot 10^{-271}:\\
\;\;\;\;t_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -3.2000000000000001e31 or -3.49999999999999991e-208 < y < 4.70000000000000005e-271

    1. Initial program 54.2%

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

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

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

        \[\leadsto 2 \cdot \sqrt{\color{blue}{\left(x \cdot y + x \cdot z\right)} + y \cdot z} \]
      2. associate-+l+54.2%

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

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

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

        \[\leadsto 2 \cdot \sqrt{\color{blue}{\mathsf{fma}\left(z, x + y, x \cdot y\right)}} \]
      6. pow1/254.3%

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

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

        \[\leadsto 2 \cdot e^{\log \color{blue}{\left(z \cdot \left(x + y\right) + x \cdot y\right)} \cdot 0.5} \]
      9. distribute-rgt-in50.4%

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

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

        \[\leadsto 2 \cdot e^{\log \color{blue}{\left(\mathsf{fma}\left(x, y, x \cdot z + y \cdot z\right)\right)} \cdot 0.5} \]
      12. distribute-rgt-in50.4%

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

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

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

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

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

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

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

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

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

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

    if -3.2000000000000001e31 < y < -3.49999999999999991e-208

    1. Initial program 77.1%

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

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

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

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

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

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

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

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

    if 4.70000000000000005e-271 < y

    1. Initial program 76.1%

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

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

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

      \[\leadsto 2 \cdot \color{blue}{\sqrt{y \cdot z}} \]
    5. Step-by-step derivation
      1. pow1/235.1%

        \[\leadsto 2 \cdot \color{blue}{{\left(y \cdot z\right)}^{0.5}} \]
      2. *-commutative35.1%

        \[\leadsto 2 \cdot {\color{blue}{\left(z \cdot y\right)}}^{0.5} \]
      3. metadata-eval35.1%

        \[\leadsto 2 \cdot {\left(z \cdot y\right)}^{\color{blue}{\left(\sqrt{0.25}\right)}} \]
      4. unpow-prod-down44.7%

        \[\leadsto 2 \cdot \color{blue}{\left({z}^{\left(\sqrt{0.25}\right)} \cdot {y}^{\left(\sqrt{0.25}\right)}\right)} \]
      5. metadata-eval44.7%

        \[\leadsto 2 \cdot \left({z}^{\color{blue}{0.5}} \cdot {y}^{\left(\sqrt{0.25}\right)}\right) \]
      6. pow1/244.7%

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

        \[\leadsto 2 \cdot \left(\sqrt{z} \cdot {y}^{\color{blue}{0.5}}\right) \]
      8. pow1/244.7%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.2 \cdot 10^{+31}:\\ \;\;\;\;2 \cdot e^{0.5 \cdot \left(\log \left(\left(-z\right) - y\right) - \log \left(\frac{-1}{x}\right)\right)}\\ \mathbf{elif}\;y \leq -3.5 \cdot 10^{-208}:\\ \;\;\;\;2 \cdot \sqrt{z \cdot \left(y + x\right) + y \cdot x}\\ \mathbf{elif}\;y \leq 4.7 \cdot 10^{-271}:\\ \;\;\;\;2 \cdot e^{0.5 \cdot \left(\log \left(\left(-z\right) - y\right) - \log \left(\frac{-1}{x}\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(\sqrt{z} \cdot \sqrt{y}\right)\\ \end{array} \]

Alternative 3: 94.6% 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(-y\right) - \log \left(\frac{-1}{x}\right)\right)}\\ \mathbf{if}\;y \leq -1.4 \cdot 10^{+34}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq -2.8 \cdot 10^{-209}:\\ \;\;\;\;2 \cdot \sqrt{z \cdot \left(y + x\right) + y \cdot x}\\ \mathbf{elif}\;y \leq -1 \cdot 10^{-310}:\\ \;\;\;\;t_0\\ \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
 (let* ((t_0 (* 2.0 (exp (* 0.5 (- (log (- y)) (log (/ -1.0 x))))))))
   (if (<= y -1.4e+34)
     t_0
     (if (<= y -2.8e-209)
       (* 2.0 (sqrt (+ (* z (+ y x)) (* y x))))
       (if (<= y -1e-310) t_0 (* 2.0 (* (sqrt z) (sqrt y))))))))
assert(x < y && y < z);
double code(double x, double y, double z) {
	double t_0 = 2.0 * exp((0.5 * (log(-y) - log((-1.0 / x)))));
	double tmp;
	if (y <= -1.4e+34) {
		tmp = t_0;
	} else if (y <= -2.8e-209) {
		tmp = 2.0 * sqrt(((z * (y + x)) + (y * x)));
	} else if (y <= -1e-310) {
		tmp = t_0;
	} 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) :: t_0
    real(8) :: tmp
    t_0 = 2.0d0 * exp((0.5d0 * (log(-y) - log(((-1.0d0) / x)))))
    if (y <= (-1.4d+34)) then
        tmp = t_0
    else if (y <= (-2.8d-209)) then
        tmp = 2.0d0 * sqrt(((z * (y + x)) + (y * x)))
    else if (y <= (-1d-310)) then
        tmp = t_0
    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 t_0 = 2.0 * Math.exp((0.5 * (Math.log(-y) - Math.log((-1.0 / x)))));
	double tmp;
	if (y <= -1.4e+34) {
		tmp = t_0;
	} else if (y <= -2.8e-209) {
		tmp = 2.0 * Math.sqrt(((z * (y + x)) + (y * x)));
	} else if (y <= -1e-310) {
		tmp = t_0;
	} else {
		tmp = 2.0 * (Math.sqrt(z) * Math.sqrt(y));
	}
	return tmp;
}
[x, y, z] = sort([x, y, z])
def code(x, y, z):
	t_0 = 2.0 * math.exp((0.5 * (math.log(-y) - math.log((-1.0 / x)))))
	tmp = 0
	if y <= -1.4e+34:
		tmp = t_0
	elif y <= -2.8e-209:
		tmp = 2.0 * math.sqrt(((z * (y + x)) + (y * x)))
	elif y <= -1e-310:
		tmp = t_0
	else:
		tmp = 2.0 * (math.sqrt(z) * math.sqrt(y))
	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(-y)) - log(Float64(-1.0 / x))))))
	tmp = 0.0
	if (y <= -1.4e+34)
		tmp = t_0;
	elseif (y <= -2.8e-209)
		tmp = Float64(2.0 * sqrt(Float64(Float64(z * Float64(y + x)) + Float64(y * x))));
	elseif (y <= -1e-310)
		tmp = t_0;
	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)
	t_0 = 2.0 * exp((0.5 * (log(-y) - log((-1.0 / x)))));
	tmp = 0.0;
	if (y <= -1.4e+34)
		tmp = t_0;
	elseif (y <= -2.8e-209)
		tmp = 2.0 * sqrt(((z * (y + x)) + (y * x)));
	elseif (y <= -1e-310)
		tmp = t_0;
	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_] := Block[{t$95$0 = N[(2.0 * N[Exp[N[(0.5 * N[(N[Log[(-y)], $MachinePrecision] - N[Log[N[(-1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.4e+34], t$95$0, If[LessEqual[y, -2.8e-209], N[(2.0 * N[Sqrt[N[(N[(z * N[(y + x), $MachinePrecision]), $MachinePrecision] + N[(y * x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1e-310], t$95$0, 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}
t_0 := 2 \cdot e^{0.5 \cdot \left(\log \left(-y\right) - \log \left(\frac{-1}{x}\right)\right)}\\
\mathbf{if}\;y \leq -1.4 \cdot 10^{+34}:\\
\;\;\;\;t_0\\

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

\mathbf{elif}\;y \leq -1 \cdot 10^{-310}:\\
\;\;\;\;t_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.40000000000000004e34 or -2.80000000000000012e-209 < y < -9.999999999999969e-311

    1. Initial program 55.1%

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

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

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

        \[\leadsto 2 \cdot \sqrt{\color{blue}{\left(x \cdot y + x \cdot z\right)} + y \cdot z} \]
      2. associate-+l+55.1%

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

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

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

        \[\leadsto 2 \cdot \sqrt{\color{blue}{\mathsf{fma}\left(z, x + y, x \cdot y\right)}} \]
      6. pow1/255.2%

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

        \[\leadsto 2 \cdot \color{blue}{e^{\log \left(\mathsf{fma}\left(z, x + y, x \cdot y\right)\right) \cdot 0.5}} \]
      8. fma-udef51.3%

        \[\leadsto 2 \cdot e^{\log \color{blue}{\left(z \cdot \left(x + y\right) + x \cdot y\right)} \cdot 0.5} \]
      9. distribute-rgt-in51.3%

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

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

        \[\leadsto 2 \cdot e^{\log \color{blue}{\left(\mathsf{fma}\left(x, y, x \cdot z + y \cdot z\right)\right)} \cdot 0.5} \]
      12. distribute-rgt-in51.3%

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

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

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

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

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

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

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

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

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

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

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

    if -1.40000000000000004e34 < y < -2.80000000000000012e-209

    1. Initial program 75.8%

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

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

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

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

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

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

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

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

    if -9.999999999999969e-311 < y

    1. Initial program 74.7%

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

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

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

      \[\leadsto 2 \cdot \color{blue}{\sqrt{y \cdot z}} \]
    5. Step-by-step derivation
      1. pow1/233.3%

        \[\leadsto 2 \cdot \color{blue}{{\left(y \cdot z\right)}^{0.5}} \]
      2. *-commutative33.3%

        \[\leadsto 2 \cdot {\color{blue}{\left(z \cdot y\right)}}^{0.5} \]
      3. metadata-eval33.3%

        \[\leadsto 2 \cdot {\left(z \cdot y\right)}^{\color{blue}{\left(\sqrt{0.25}\right)}} \]
      4. unpow-prod-down42.2%

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

        \[\leadsto 2 \cdot \left({z}^{\color{blue}{0.5}} \cdot {y}^{\left(\sqrt{0.25}\right)}\right) \]
      6. pow1/242.2%

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

        \[\leadsto 2 \cdot \left(\sqrt{z} \cdot {y}^{\color{blue}{0.5}}\right) \]
      8. pow1/242.2%

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

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

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

Alternative 4: 83.1% accurate, 0.5× speedup?

\[\begin{array}{l} [x, y, z] = \mathsf{sort}([x, y, z])\\ \\ \begin{array}{l} \mathbf{if}\;y \leq 4.7 \cdot 10^{-271}:\\ \;\;\;\;2 \cdot \sqrt{\mathsf{fma}\left(z, y + x, y \cdot x\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 4.7e-271)
   (* 2.0 (sqrt (fma z (+ y x) (* y x))))
   (* 2.0 (* (sqrt z) (sqrt y)))))
assert(x < y && y < z);
double code(double x, double y, double z) {
	double tmp;
	if (y <= 4.7e-271) {
		tmp = 2.0 * sqrt(fma(z, (y + x), (y * x)));
	} else {
		tmp = 2.0 * (sqrt(z) * sqrt(y));
	}
	return tmp;
}
x, y, z = sort([x, y, z])
function code(x, y, z)
	tmp = 0.0
	if (y <= 4.7e-271)
		tmp = Float64(2.0 * sqrt(fma(z, Float64(y + x), Float64(y * x))));
	else
		tmp = Float64(2.0 * Float64(sqrt(z) * sqrt(y)));
	end
	return tmp
end
NOTE: x, y, and z should be sorted in increasing order before calling this function.
code[x_, y_, z_] := If[LessEqual[y, 4.7e-271], N[(2.0 * N[Sqrt[N[(z * N[(y + x), $MachinePrecision] + N[(y * x), $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 4.7 \cdot 10^{-271}:\\
\;\;\;\;2 \cdot \sqrt{\mathsf{fma}\left(z, y + x, y \cdot x\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 < 4.70000000000000005e-271

    1. Initial program 63.8%

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

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

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

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

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

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

    if 4.70000000000000005e-271 < y

    1. Initial program 76.1%

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

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

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

      \[\leadsto 2 \cdot \color{blue}{\sqrt{y \cdot z}} \]
    5. Step-by-step derivation
      1. pow1/235.1%

        \[\leadsto 2 \cdot \color{blue}{{\left(y \cdot z\right)}^{0.5}} \]
      2. *-commutative35.1%

        \[\leadsto 2 \cdot {\color{blue}{\left(z \cdot y\right)}}^{0.5} \]
      3. metadata-eval35.1%

        \[\leadsto 2 \cdot {\left(z \cdot y\right)}^{\color{blue}{\left(\sqrt{0.25}\right)}} \]
      4. unpow-prod-down44.7%

        \[\leadsto 2 \cdot \color{blue}{\left({z}^{\left(\sqrt{0.25}\right)} \cdot {y}^{\left(\sqrt{0.25}\right)}\right)} \]
      5. metadata-eval44.7%

        \[\leadsto 2 \cdot \left({z}^{\color{blue}{0.5}} \cdot {y}^{\left(\sqrt{0.25}\right)}\right) \]
      6. pow1/244.7%

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

        \[\leadsto 2 \cdot \left(\sqrt{z} \cdot {y}^{\color{blue}{0.5}}\right) \]
      8. pow1/244.7%

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

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

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

Alternative 5: 82.7% accurate, 0.5× speedup?

\[\begin{array}{l} [x, y, z] = \mathsf{sort}([x, y, z])\\ \\ \begin{array}{l} \mathbf{if}\;y \leq 4.7 \cdot 10^{-271}:\\ \;\;\;\;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 4.7e-271)
   (* 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 <= 4.7e-271) {
		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 <= 4.7d-271) 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 <= 4.7e-271) {
		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 <= 4.7e-271:
		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 <= 4.7e-271)
		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 <= 4.7e-271)
		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, 4.7e-271], 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 4.7 \cdot 10^{-271}:\\
\;\;\;\;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 < 4.70000000000000005e-271

    1. Initial program 63.8%

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

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

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

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

    if 4.70000000000000005e-271 < y

    1. Initial program 76.1%

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

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

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

      \[\leadsto 2 \cdot \color{blue}{\sqrt{y \cdot z}} \]
    5. Step-by-step derivation
      1. pow1/235.1%

        \[\leadsto 2 \cdot \color{blue}{{\left(y \cdot z\right)}^{0.5}} \]
      2. *-commutative35.1%

        \[\leadsto 2 \cdot {\color{blue}{\left(z \cdot y\right)}}^{0.5} \]
      3. metadata-eval35.1%

        \[\leadsto 2 \cdot {\left(z \cdot y\right)}^{\color{blue}{\left(\sqrt{0.25}\right)}} \]
      4. unpow-prod-down44.7%

        \[\leadsto 2 \cdot \color{blue}{\left({z}^{\left(\sqrt{0.25}\right)} \cdot {y}^{\left(\sqrt{0.25}\right)}\right)} \]
      5. metadata-eval44.7%

        \[\leadsto 2 \cdot \left({z}^{\color{blue}{0.5}} \cdot {y}^{\left(\sqrt{0.25}\right)}\right) \]
      6. pow1/244.7%

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

        \[\leadsto 2 \cdot \left(\sqrt{z} \cdot {y}^{\color{blue}{0.5}}\right) \]
      8. pow1/244.7%

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

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

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

Alternative 6: 70.4% accurate, 1.0× speedup?

\[\begin{array}{l} [x, y, z] = \mathsf{sort}([x, y, z])\\ \\ 2 \cdot \sqrt{x \cdot \left(y + z\right) + y \cdot z} \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 (+ (* x (+ y z)) (* y z)))))
assert(x < y && y < z);
double code(double x, double y, double z) {
	return 2.0 * sqrt(((x * (y + z)) + (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(((x * (y + z)) + (y * z)))
end function
assert x < y && y < z;
public static double code(double x, double y, double z) {
	return 2.0 * Math.sqrt(((x * (y + z)) + (y * z)));
}
[x, y, z] = sort([x, y, z])
def code(x, y, z):
	return 2.0 * math.sqrt(((x * (y + z)) + (y * z)))
x, y, z = sort([x, y, z])
function code(x, y, z)
	return Float64(2.0 * sqrt(Float64(Float64(x * Float64(y + z)) + Float64(y * z))))
end
x, y, z = num2cell(sort([x, y, z])){:}
function tmp = code(x, y, z)
	tmp = 2.0 * sqrt(((x * (y + z)) + (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[(x * N[(y + z), $MachinePrecision]), $MachinePrecision] + N[(y * z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z] = \mathsf{sort}([x, y, z])\\
\\
2 \cdot \sqrt{x \cdot \left(y + z\right) + y \cdot z}
\end{array}
Derivation
  1. Initial program 69.9%

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

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

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

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

Alternative 7: 70.3% accurate, 1.0× speedup?

\[\begin{array}{l} [x, y, z] = \mathsf{sort}([x, y, z])\\ \\ 2 \cdot \sqrt{z \cdot \left(y + x\right) + 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 (+ (* z (+ y x)) (* y x)))))
assert(x < y && y < z);
double code(double x, double y, double z) {
	return 2.0 * sqrt(((z * (y + x)) + (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(((z * (y + x)) + (y * x)))
end function
assert x < y && y < z;
public static double code(double x, double y, double z) {
	return 2.0 * Math.sqrt(((z * (y + x)) + (y * x)));
}
[x, y, z] = sort([x, y, z])
def code(x, y, z):
	return 2.0 * math.sqrt(((z * (y + x)) + (y * x)))
x, y, z = sort([x, y, z])
function code(x, y, z)
	return Float64(2.0 * sqrt(Float64(Float64(z * Float64(y + x)) + Float64(y * x))))
end
x, y, z = num2cell(sort([x, y, z])){:}
function tmp = code(x, y, z)
	tmp = 2.0 * sqrt(((z * (y + x)) + (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[(N[(z * N[(y + x), $MachinePrecision]), $MachinePrecision] + N[(y * x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z] = \mathsf{sort}([x, y, z])\\
\\
2 \cdot \sqrt{z \cdot \left(y + x\right) + y \cdot x}
\end{array}
Derivation
  1. Initial program 69.9%

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

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

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

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

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

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

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

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

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

Alternative 8: 69.4% 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^{-295}:\\ \;\;\;\;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-295) (* 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-295) {
		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-295)) 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-295) {
		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-295:
		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-295)
		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-295)
		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-295], 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^{-295}:\\
\;\;\;\;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-295

    1. Initial program 64.5%

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

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

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

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

    if -2.3e-295 < y

    1. Initial program 74.7%

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

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

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

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

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

Alternative 9: 70.2% 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^{-266}:\\ \;\;\;\;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-266) (* 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-266) {
		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-266)) 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-266) {
		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-266:
		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-266)
		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-266)
		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-266], 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^{-266}:\\
\;\;\;\;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.9999999999999998e-267

    1. Initial program 63.8%

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

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

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

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

    if -9.9999999999999998e-267 < y

    1. Initial program 75.0%

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

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

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

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

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

Alternative 10: 68.3% accurate, 1.1× speedup?

\[\begin{array}{l} [x, y, z] = \mathsf{sort}([x, y, z])\\ \\ \begin{array}{l} \mathbf{if}\;y \leq -1 \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 -1e-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 <= -1e-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 <= (-1d-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 <= -1e-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 <= -1e-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 <= -1e-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 <= -1e-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, -1e-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 -1 \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 < -9.999999999999969e-311

    1. Initial program 64.5%

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

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

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

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

    if -9.999999999999969e-311 < y

    1. Initial program 74.7%

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

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

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

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

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

Alternative 11: 35.6% 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 69.9%

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

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

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

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

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

Developer target: 82.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 2023230 
(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)))))