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

Percentage Accurate: 71.1% → 94.6%
Time: 14.4s
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: 71.1% 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.6% accurate, 0.1× speedup?

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

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

\mathbf{elif}\;y \leq 6.8 \cdot 10^{-275}:\\
\;\;\;\;2 \cdot e^{0.5 \cdot \left(\log \left(\left(-y\right) - z\right) - \left(t_2 + 2 \cdot t_2\right)\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 < -7.4999999999999999e50

    1. Initial program 55.9%

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

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

      \[\leadsto \color{blue}{2 \cdot \sqrt{x \cdot \left(y + z\right) + y \cdot z}} \]
    4. Step-by-step derivation
      1. flip-+18.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-num18.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. pow218.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. pow218.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-rr18.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-pow18.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-pow118.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-num18.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. unpow218.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. unpow218.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.9%

        \[\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.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. +-commutative56.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -7.4999999999999999e50 < y < -3.5000000000000001e-180

    1. Initial program 86.7%

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

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

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

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

    if -3.5000000000000001e-180 < y < 6.79999999999999936e-275

    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 68.5%

      \[\leadsto 2 \cdot \sqrt{\color{blue}{\left(y + z\right) \cdot x}} \]
    5. Step-by-step derivation
      1. pow1/268.5%

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

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

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

        \[\leadsto 2 \cdot \color{blue}{e^{\log \left(x \cdot \left(y + z\right)\right) \cdot \sqrt{0.25}}} \]
      5. +-commutative63.4%

        \[\leadsto 2 \cdot e^{\log \left(x \cdot \color{blue}{\left(z + y\right)}\right) \cdot \sqrt{0.25}} \]
      6. metadata-eval63.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 6.79999999999999936e-275 < y

    1. Initial program 69.7%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -7.5 \cdot 10^{+50}:\\ \;\;\;\;2 \cdot \frac{1}{\mathsf{fma}\left(0.5, \frac{z}{y} \cdot \frac{x \cdot {\left(e^{-0.5}\right)}^{\left(\mathsf{fma}\left(-1, \log \left(\frac{-1}{y}\right), \log \left(\left(-x\right) - z\right)\right)\right)}}{\left(-x\right) - z}, {\left(e^{-0.5}\right)}^{\left(\mathsf{fma}\left(-1, \log \left(\frac{-1}{y}\right), \log \left(\left(-x\right) - z\right)\right)\right)}\right)}\\ \mathbf{elif}\;y \leq -3.5 \cdot 10^{-180}:\\ \;\;\;\;2 \cdot \sqrt{x \cdot \left(y + z\right)}\\ \mathbf{elif}\;y \leq 6.8 \cdot 10^{-275}:\\ \;\;\;\;2 \cdot e^{0.5 \cdot \left(\log \left(\left(-y\right) - z\right) - \left(\log \left(\sqrt[3]{\frac{-1}{x}}\right) + 2 \cdot \log \left(\sqrt[3]{\frac{-1}{x}}\right)\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(\sqrt{z} \cdot \sqrt{y}\right)\\ \end{array} \]

Alternative 2: 94.7% accurate, 0.2× speedup?

\[\begin{array}{l} [x, y, z] = \mathsf{sort}([x, y, z])\\ \\ \begin{array}{l} t_0 := \log \left(\sqrt[3]{\frac{-1}{x}}\right)\\ t_1 := \log \left(\left(-y\right) - z\right)\\ \mathbf{if}\;y \leq -2.3 \cdot 10^{+50}:\\ \;\;\;\;2 \cdot e^{0.5 \cdot \left(t_1 - \log \left(\frac{-1}{x}\right)\right)}\\ \mathbf{elif}\;y \leq -3.5 \cdot 10^{-180}:\\ \;\;\;\;2 \cdot \sqrt{x \cdot \left(y + z\right)}\\ \mathbf{elif}\;y \leq 3.4 \cdot 10^{-275}:\\ \;\;\;\;2 \cdot e^{0.5 \cdot \left(t_1 - \left(t_0 + 2 \cdot t_0\right)\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 (cbrt (/ -1.0 x)))) (t_1 (log (- (- y) z))))
   (if (<= y -2.3e+50)
     (* 2.0 (exp (* 0.5 (- t_1 (log (/ -1.0 x))))))
     (if (<= y -3.5e-180)
       (* 2.0 (sqrt (* x (+ y z))))
       (if (<= y 3.4e-275)
         (* 2.0 (exp (* 0.5 (- t_1 (+ t_0 (* 2.0 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(cbrt((-1.0 / x)));
	double t_1 = log((-y - z));
	double tmp;
	if (y <= -2.3e+50) {
		tmp = 2.0 * exp((0.5 * (t_1 - log((-1.0 / x)))));
	} else if (y <= -3.5e-180) {
		tmp = 2.0 * sqrt((x * (y + z)));
	} else if (y <= 3.4e-275) {
		tmp = 2.0 * exp((0.5 * (t_1 - (t_0 + (2.0 * t_0)))));
	} else {
		tmp = 2.0 * (sqrt(z) * sqrt(y));
	}
	return tmp;
}
assert x < y && y < z;
public static double code(double x, double y, double z) {
	double t_0 = Math.log(Math.cbrt((-1.0 / x)));
	double t_1 = Math.log((-y - z));
	double tmp;
	if (y <= -2.3e+50) {
		tmp = 2.0 * Math.exp((0.5 * (t_1 - Math.log((-1.0 / x)))));
	} else if (y <= -3.5e-180) {
		tmp = 2.0 * Math.sqrt((x * (y + z)));
	} else if (y <= 3.4e-275) {
		tmp = 2.0 * Math.exp((0.5 * (t_1 - (t_0 + (2.0 * 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 = log(cbrt(Float64(-1.0 / x)))
	t_1 = log(Float64(Float64(-y) - z))
	tmp = 0.0
	if (y <= -2.3e+50)
		tmp = Float64(2.0 * exp(Float64(0.5 * Float64(t_1 - log(Float64(-1.0 / x))))));
	elseif (y <= -3.5e-180)
		tmp = Float64(2.0 * sqrt(Float64(x * Float64(y + z))));
	elseif (y <= 3.4e-275)
		tmp = Float64(2.0 * exp(Float64(0.5 * Float64(t_1 - Float64(t_0 + Float64(2.0 * 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[Power[N[(-1.0 / x), $MachinePrecision], 1/3], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Log[N[((-y) - z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, -2.3e+50], N[(2.0 * N[Exp[N[(0.5 * N[(t$95$1 - N[Log[N[(-1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -3.5e-180], N[(2.0 * N[Sqrt[N[(x * N[(y + z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.4e-275], N[(2.0 * N[Exp[N[(0.5 * N[(t$95$1 - N[(t$95$0 + N[(2.0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $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(\sqrt[3]{\frac{-1}{x}}\right)\\
t_1 := \log \left(\left(-y\right) - z\right)\\
\mathbf{if}\;y \leq -2.3 \cdot 10^{+50}:\\
\;\;\;\;2 \cdot e^{0.5 \cdot \left(t_1 - \log \left(\frac{-1}{x}\right)\right)}\\

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

\mathbf{elif}\;y \leq 3.4 \cdot 10^{-275}:\\
\;\;\;\;2 \cdot e^{0.5 \cdot \left(t_1 - \left(t_0 + 2 \cdot t_0\right)\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.29999999999999997e50

    1. Initial program 55.9%

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

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

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

      \[\leadsto 2 \cdot \sqrt{\color{blue}{\left(y + z\right) \cdot x}} \]
    5. Step-by-step derivation
      1. pow1/233.4%

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

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

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

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

        \[\leadsto 2 \cdot e^{\log \left(x \cdot \color{blue}{\left(z + y\right)}\right) \cdot \sqrt{0.25}} \]
      6. metadata-eval31.1%

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

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

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

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

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

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

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

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

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

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

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

    if -2.29999999999999997e50 < y < -3.5000000000000001e-180

    1. Initial program 86.7%

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

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

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

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

    if -3.5000000000000001e-180 < y < 3.39999999999999968e-275

    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 68.5%

      \[\leadsto 2 \cdot \sqrt{\color{blue}{\left(y + z\right) \cdot x}} \]
    5. Step-by-step derivation
      1. pow1/268.5%

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

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

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

        \[\leadsto 2 \cdot \color{blue}{e^{\log \left(x \cdot \left(y + z\right)\right) \cdot \sqrt{0.25}}} \]
      5. +-commutative63.4%

        \[\leadsto 2 \cdot e^{\log \left(x \cdot \color{blue}{\left(z + y\right)}\right) \cdot \sqrt{0.25}} \]
      6. metadata-eval63.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.39999999999999968e-275 < y

    1. Initial program 69.7%

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

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

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

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

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

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

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

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

Alternative 3: 94.5% accurate, 0.3× speedup?

\[\begin{array}{l} [x, y, z] = \mathsf{sort}([x, y, z])\\ \\ \begin{array}{l} \mathbf{if}\;y \leq -2.25 \cdot 10^{+50}:\\ \;\;\;\;2 \cdot e^{0.5 \cdot \left(\log \left(\left(-y\right) - z\right) - \log \left(\frac{-1}{x}\right)\right)}\\ \mathbf{elif}\;y \leq -3.5 \cdot 10^{-180}:\\ \;\;\;\;2 \cdot \sqrt{x \cdot \left(y + z\right)}\\ \mathbf{elif}\;y \leq -2 \cdot 10^{-310}:\\ \;\;\;\;2 \cdot {\left(e^{0.25 \cdot \left(\log \left(-x\right) - \log \left(\frac{-1}{y}\right)\right)}\right)}^{2}\\ \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 -2.25e+50)
   (* 2.0 (exp (* 0.5 (- (log (- (- y) z)) (log (/ -1.0 x))))))
   (if (<= y -3.5e-180)
     (* 2.0 (sqrt (* x (+ y z))))
     (if (<= y -2e-310)
       (* 2.0 (pow (exp (* 0.25 (- (log (- x)) (log (/ -1.0 y))))) 2.0))
       (* 2.0 (* (sqrt z) (sqrt y)))))))
assert(x < y && y < z);
double code(double x, double y, double z) {
	double tmp;
	if (y <= -2.25e+50) {
		tmp = 2.0 * exp((0.5 * (log((-y - z)) - log((-1.0 / x)))));
	} else if (y <= -3.5e-180) {
		tmp = 2.0 * sqrt((x * (y + z)));
	} else if (y <= -2e-310) {
		tmp = 2.0 * pow(exp((0.25 * (log(-x) - log((-1.0 / y))))), 2.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) :: tmp
    if (y <= (-2.25d+50)) then
        tmp = 2.0d0 * exp((0.5d0 * (log((-y - z)) - log(((-1.0d0) / x)))))
    else if (y <= (-3.5d-180)) then
        tmp = 2.0d0 * sqrt((x * (y + z)))
    else if (y <= (-2d-310)) then
        tmp = 2.0d0 * (exp((0.25d0 * (log(-x) - log(((-1.0d0) / y))))) ** 2.0d0)
    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 <= -2.25e+50) {
		tmp = 2.0 * Math.exp((0.5 * (Math.log((-y - z)) - Math.log((-1.0 / x)))));
	} else if (y <= -3.5e-180) {
		tmp = 2.0 * Math.sqrt((x * (y + z)));
	} else if (y <= -2e-310) {
		tmp = 2.0 * Math.pow(Math.exp((0.25 * (Math.log(-x) - Math.log((-1.0 / y))))), 2.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):
	tmp = 0
	if y <= -2.25e+50:
		tmp = 2.0 * math.exp((0.5 * (math.log((-y - z)) - math.log((-1.0 / x)))))
	elif y <= -3.5e-180:
		tmp = 2.0 * math.sqrt((x * (y + z)))
	elif y <= -2e-310:
		tmp = 2.0 * math.pow(math.exp((0.25 * (math.log(-x) - math.log((-1.0 / y))))), 2.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)
	tmp = 0.0
	if (y <= -2.25e+50)
		tmp = Float64(2.0 * exp(Float64(0.5 * Float64(log(Float64(Float64(-y) - z)) - log(Float64(-1.0 / x))))));
	elseif (y <= -3.5e-180)
		tmp = Float64(2.0 * sqrt(Float64(x * Float64(y + z))));
	elseif (y <= -2e-310)
		tmp = Float64(2.0 * (exp(Float64(0.25 * Float64(log(Float64(-x)) - log(Float64(-1.0 / y))))) ^ 2.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)
	tmp = 0.0;
	if (y <= -2.25e+50)
		tmp = 2.0 * exp((0.5 * (log((-y - z)) - log((-1.0 / x)))));
	elseif (y <= -3.5e-180)
		tmp = 2.0 * sqrt((x * (y + z)));
	elseif (y <= -2e-310)
		tmp = 2.0 * (exp((0.25 * (log(-x) - log((-1.0 / y))))) ^ 2.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_] := If[LessEqual[y, -2.25e+50], N[(2.0 * N[Exp[N[(0.5 * N[(N[Log[N[((-y) - z), $MachinePrecision]], $MachinePrecision] - N[Log[N[(-1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -3.5e-180], N[(2.0 * N[Sqrt[N[(x * N[(y + z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -2e-310], N[(2.0 * N[Power[N[Exp[N[(0.25 * N[(N[Log[(-x)], $MachinePrecision] - N[Log[N[(-1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], 2.0], $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 -2.25 \cdot 10^{+50}:\\
\;\;\;\;2 \cdot e^{0.5 \cdot \left(\log \left(\left(-y\right) - z\right) - \log \left(\frac{-1}{x}\right)\right)}\\

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

\mathbf{elif}\;y \leq -2 \cdot 10^{-310}:\\
\;\;\;\;2 \cdot {\left(e^{0.25 \cdot \left(\log \left(-x\right) - \log \left(\frac{-1}{y}\right)\right)}\right)}^{2}\\

\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.25000000000000007e50

    1. Initial program 55.9%

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

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

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

      \[\leadsto 2 \cdot \sqrt{\color{blue}{\left(y + z\right) \cdot x}} \]
    5. Step-by-step derivation
      1. pow1/233.4%

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

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

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

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

        \[\leadsto 2 \cdot e^{\log \left(x \cdot \color{blue}{\left(z + y\right)}\right) \cdot \sqrt{0.25}} \]
      6. metadata-eval31.1%

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

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

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

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

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

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

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

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

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

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

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

    if -2.25000000000000007e50 < y < -3.5000000000000001e-180

    1. Initial program 86.7%

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

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

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

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

    if -3.5000000000000001e-180 < y < -1.999999999999994e-310

    1. Initial program 67.0%

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

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

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

        \[\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. pow266.7%

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

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

        \[\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-def66.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-eval66.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-rr66.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 0 8.1%

      \[\leadsto 2 \cdot {\color{blue}{\left({\left(y \cdot x\right)}^{0.25}\right)}}^{2} \]
    7. Taylor expanded in y around -inf 7.1%

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

    if -1.999999999999994e-310 < y

    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.5%

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

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

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

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

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

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

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

Alternative 4: 94.5% accurate, 0.4× speedup?

\[\begin{array}{l} [x, y, z] = \mathsf{sort}([x, y, z])\\ \\ \begin{array}{l} \mathbf{if}\;y \leq -5.6 \cdot 10^{+52}:\\ \;\;\;\;2 \cdot e^{0.5 \cdot \left(\log \left(\left(-y\right) - z\right) - \log \left(\frac{-1}{x}\right)\right)}\\ \mathbf{elif}\;y \leq -3.5 \cdot 10^{-180}:\\ \;\;\;\;2 \cdot \sqrt{x \cdot \left(y + z\right)}\\ \mathbf{elif}\;y \leq -2 \cdot 10^{-310}:\\ \;\;\;\;2 \cdot \frac{1}{e^{-0.5 \cdot \left(\log \left(\left(-x\right) - z\right) - \log \left(\frac{-1}{y}\right)\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 -5.6e+52)
   (* 2.0 (exp (* 0.5 (- (log (- (- y) z)) (log (/ -1.0 x))))))
   (if (<= y -3.5e-180)
     (* 2.0 (sqrt (* x (+ y z))))
     (if (<= y -2e-310)
       (* 2.0 (/ 1.0 (exp (* -0.5 (- (log (- (- x) z)) (log (/ -1.0 y)))))))
       (* 2.0 (* (sqrt z) (sqrt y)))))))
assert(x < y && y < z);
double code(double x, double y, double z) {
	double tmp;
	if (y <= -5.6e+52) {
		tmp = 2.0 * exp((0.5 * (log((-y - z)) - log((-1.0 / x)))));
	} else if (y <= -3.5e-180) {
		tmp = 2.0 * sqrt((x * (y + z)));
	} else if (y <= -2e-310) {
		tmp = 2.0 * (1.0 / exp((-0.5 * (log((-x - z)) - log((-1.0 / y))))));
	} 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 <= (-5.6d+52)) then
        tmp = 2.0d0 * exp((0.5d0 * (log((-y - z)) - log(((-1.0d0) / x)))))
    else if (y <= (-3.5d-180)) then
        tmp = 2.0d0 * sqrt((x * (y + z)))
    else if (y <= (-2d-310)) then
        tmp = 2.0d0 * (1.0d0 / exp(((-0.5d0) * (log((-x - z)) - log(((-1.0d0) / y))))))
    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 <= -5.6e+52) {
		tmp = 2.0 * Math.exp((0.5 * (Math.log((-y - z)) - Math.log((-1.0 / x)))));
	} else if (y <= -3.5e-180) {
		tmp = 2.0 * Math.sqrt((x * (y + z)));
	} else if (y <= -2e-310) {
		tmp = 2.0 * (1.0 / Math.exp((-0.5 * (Math.log((-x - z)) - Math.log((-1.0 / y))))));
	} 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 <= -5.6e+52:
		tmp = 2.0 * math.exp((0.5 * (math.log((-y - z)) - math.log((-1.0 / x)))))
	elif y <= -3.5e-180:
		tmp = 2.0 * math.sqrt((x * (y + z)))
	elif y <= -2e-310:
		tmp = 2.0 * (1.0 / math.exp((-0.5 * (math.log((-x - z)) - math.log((-1.0 / y))))))
	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 <= -5.6e+52)
		tmp = Float64(2.0 * exp(Float64(0.5 * Float64(log(Float64(Float64(-y) - z)) - log(Float64(-1.0 / x))))));
	elseif (y <= -3.5e-180)
		tmp = Float64(2.0 * sqrt(Float64(x * Float64(y + z))));
	elseif (y <= -2e-310)
		tmp = Float64(2.0 * Float64(1.0 / exp(Float64(-0.5 * Float64(log(Float64(Float64(-x) - z)) - log(Float64(-1.0 / y)))))));
	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 <= -5.6e+52)
		tmp = 2.0 * exp((0.5 * (log((-y - z)) - log((-1.0 / x)))));
	elseif (y <= -3.5e-180)
		tmp = 2.0 * sqrt((x * (y + z)));
	elseif (y <= -2e-310)
		tmp = 2.0 * (1.0 / exp((-0.5 * (log((-x - z)) - log((-1.0 / y))))));
	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, -5.6e+52], N[(2.0 * N[Exp[N[(0.5 * N[(N[Log[N[((-y) - z), $MachinePrecision]], $MachinePrecision] - N[Log[N[(-1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -3.5e-180], N[(2.0 * N[Sqrt[N[(x * N[(y + z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -2e-310], N[(2.0 * N[(1.0 / N[Exp[N[(-0.5 * N[(N[Log[N[((-x) - z), $MachinePrecision]], $MachinePrecision] - N[Log[N[(-1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $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 -5.6 \cdot 10^{+52}:\\
\;\;\;\;2 \cdot e^{0.5 \cdot \left(\log \left(\left(-y\right) - z\right) - \log \left(\frac{-1}{x}\right)\right)}\\

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

\mathbf{elif}\;y \leq -2 \cdot 10^{-310}:\\
\;\;\;\;2 \cdot \frac{1}{e^{-0.5 \cdot \left(\log \left(\left(-x\right) - z\right) - \log \left(\frac{-1}{y}\right)\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 < -5.6e52

    1. Initial program 55.9%

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

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

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

      \[\leadsto 2 \cdot \sqrt{\color{blue}{\left(y + z\right) \cdot x}} \]
    5. Step-by-step derivation
      1. pow1/233.4%

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

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

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

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

        \[\leadsto 2 \cdot e^{\log \left(x \cdot \color{blue}{\left(z + y\right)}\right) \cdot \sqrt{0.25}} \]
      6. metadata-eval31.1%

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

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

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

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

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

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

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

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

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

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

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

    if -5.6e52 < y < -3.5000000000000001e-180

    1. Initial program 86.7%

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

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

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

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

    if -3.5000000000000001e-180 < y < -1.999999999999994e-310

    1. Initial program 67.0%

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

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

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

        \[\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-num48.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. pow248.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. pow248.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-rr48.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-pow48.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-pow148.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-num48.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. unpow248.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. unpow248.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-+67.0%

        \[\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-udef67.0%

        \[\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. +-commutative67.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.999999999999994e-310 < y

    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.5%

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

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

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

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

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

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

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

Alternative 5: 94.3% 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(-x\right) - \log \left(\frac{-1}{y}\right)\right)}\\ \mathbf{if}\;y \leq -7 \cdot 10^{+50}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq -3.5 \cdot 10^{-180}:\\ \;\;\;\;2 \cdot \sqrt{x \cdot \left(y + z\right)}\\ \mathbf{elif}\;y \leq -2 \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 (- x)) (log (/ -1.0 y))))))))
   (if (<= y -7e+50)
     t_0
     (if (<= y -3.5e-180)
       (* 2.0 (sqrt (* x (+ y z))))
       (if (<= y -2e-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(-x) - log((-1.0 / y)))));
	double tmp;
	if (y <= -7e+50) {
		tmp = t_0;
	} else if (y <= -3.5e-180) {
		tmp = 2.0 * sqrt((x * (y + z)));
	} else if (y <= -2e-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(-x) - log(((-1.0d0) / y)))))
    if (y <= (-7d+50)) then
        tmp = t_0
    else if (y <= (-3.5d-180)) then
        tmp = 2.0d0 * sqrt((x * (y + z)))
    else if (y <= (-2d-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(-x) - Math.log((-1.0 / y)))));
	double tmp;
	if (y <= -7e+50) {
		tmp = t_0;
	} else if (y <= -3.5e-180) {
		tmp = 2.0 * Math.sqrt((x * (y + z)));
	} else if (y <= -2e-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(-x) - math.log((-1.0 / y)))))
	tmp = 0
	if y <= -7e+50:
		tmp = t_0
	elif y <= -3.5e-180:
		tmp = 2.0 * math.sqrt((x * (y + z)))
	elif y <= -2e-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(-x)) - log(Float64(-1.0 / y))))))
	tmp = 0.0
	if (y <= -7e+50)
		tmp = t_0;
	elseif (y <= -3.5e-180)
		tmp = Float64(2.0 * sqrt(Float64(x * Float64(y + z))));
	elseif (y <= -2e-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(-x) - log((-1.0 / y)))));
	tmp = 0.0;
	if (y <= -7e+50)
		tmp = t_0;
	elseif (y <= -3.5e-180)
		tmp = 2.0 * sqrt((x * (y + z)));
	elseif (y <= -2e-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[(-x)], $MachinePrecision] - N[Log[N[(-1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -7e+50], t$95$0, If[LessEqual[y, -3.5e-180], N[(2.0 * N[Sqrt[N[(x * N[(y + z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -2e-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(-x\right) - \log \left(\frac{-1}{y}\right)\right)}\\
\mathbf{if}\;y \leq -7 \cdot 10^{+50}:\\
\;\;\;\;t_0\\

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

\mathbf{elif}\;y \leq -2 \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 < -7.00000000000000012e50 or -3.5000000000000001e-180 < y < -1.999999999999994e-310

    1. Initial program 58.7%

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

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

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

      \[\leadsto 2 \cdot \sqrt{\color{blue}{\left(y + z\right) \cdot x}} \]
    5. Step-by-step derivation
      1. pow1/241.2%

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

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

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

        \[\leadsto 2 \cdot \color{blue}{e^{\log \left(x \cdot \left(y + z\right)\right) \cdot \sqrt{0.25}}} \]
      5. +-commutative38.3%

        \[\leadsto 2 \cdot e^{\log \left(x \cdot \color{blue}{\left(z + y\right)}\right) \cdot \sqrt{0.25}} \]
      6. metadata-eval38.3%

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

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

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

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

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

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

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

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

    if -7.00000000000000012e50 < y < -3.5000000000000001e-180

    1. Initial program 86.7%

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

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

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

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

    if -1.999999999999994e-310 < y

    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.5%

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

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

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

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

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

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

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

Alternative 6: 94.5% accurate, 0.4× speedup?

\[\begin{array}{l} [x, y, z] = \mathsf{sort}([x, y, z])\\ \\ \begin{array}{l} \mathbf{if}\;y \leq -1 \cdot 10^{+51}:\\ \;\;\;\;2 \cdot e^{0.5 \cdot \left(\log \left(\left(-y\right) - z\right) - \log \left(\frac{-1}{x}\right)\right)}\\ \mathbf{elif}\;y \leq -3.5 \cdot 10^{-180}:\\ \;\;\;\;2 \cdot \sqrt{x \cdot \left(y + z\right)}\\ \mathbf{elif}\;y \leq -2 \cdot 10^{-310}:\\ \;\;\;\;2 \cdot e^{0.5 \cdot \left(\log \left(-x\right) - \log \left(\frac{-1}{y}\right)\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 -1e+51)
   (* 2.0 (exp (* 0.5 (- (log (- (- y) z)) (log (/ -1.0 x))))))
   (if (<= y -3.5e-180)
     (* 2.0 (sqrt (* x (+ y z))))
     (if (<= y -2e-310)
       (* 2.0 (exp (* 0.5 (- (log (- x)) (log (/ -1.0 y))))))
       (* 2.0 (* (sqrt z) (sqrt y)))))))
assert(x < y && y < z);
double code(double x, double y, double z) {
	double tmp;
	if (y <= -1e+51) {
		tmp = 2.0 * exp((0.5 * (log((-y - z)) - log((-1.0 / x)))));
	} else if (y <= -3.5e-180) {
		tmp = 2.0 * sqrt((x * (y + z)));
	} else if (y <= -2e-310) {
		tmp = 2.0 * exp((0.5 * (log(-x) - log((-1.0 / y)))));
	} 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 <= (-1d+51)) then
        tmp = 2.0d0 * exp((0.5d0 * (log((-y - z)) - log(((-1.0d0) / x)))))
    else if (y <= (-3.5d-180)) then
        tmp = 2.0d0 * sqrt((x * (y + z)))
    else if (y <= (-2d-310)) then
        tmp = 2.0d0 * exp((0.5d0 * (log(-x) - log(((-1.0d0) / y)))))
    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 <= -1e+51) {
		tmp = 2.0 * Math.exp((0.5 * (Math.log((-y - z)) - Math.log((-1.0 / x)))));
	} else if (y <= -3.5e-180) {
		tmp = 2.0 * Math.sqrt((x * (y + z)));
	} else if (y <= -2e-310) {
		tmp = 2.0 * Math.exp((0.5 * (Math.log(-x) - Math.log((-1.0 / y)))));
	} 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 <= -1e+51:
		tmp = 2.0 * math.exp((0.5 * (math.log((-y - z)) - math.log((-1.0 / x)))))
	elif y <= -3.5e-180:
		tmp = 2.0 * math.sqrt((x * (y + z)))
	elif y <= -2e-310:
		tmp = 2.0 * math.exp((0.5 * (math.log(-x) - math.log((-1.0 / y)))))
	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 <= -1e+51)
		tmp = Float64(2.0 * exp(Float64(0.5 * Float64(log(Float64(Float64(-y) - z)) - log(Float64(-1.0 / x))))));
	elseif (y <= -3.5e-180)
		tmp = Float64(2.0 * sqrt(Float64(x * Float64(y + z))));
	elseif (y <= -2e-310)
		tmp = Float64(2.0 * exp(Float64(0.5 * Float64(log(Float64(-x)) - log(Float64(-1.0 / y))))));
	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 <= -1e+51)
		tmp = 2.0 * exp((0.5 * (log((-y - z)) - log((-1.0 / x)))));
	elseif (y <= -3.5e-180)
		tmp = 2.0 * sqrt((x * (y + z)));
	elseif (y <= -2e-310)
		tmp = 2.0 * exp((0.5 * (log(-x) - log((-1.0 / y)))));
	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, -1e+51], N[(2.0 * N[Exp[N[(0.5 * N[(N[Log[N[((-y) - z), $MachinePrecision]], $MachinePrecision] - N[Log[N[(-1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -3.5e-180], N[(2.0 * N[Sqrt[N[(x * N[(y + z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -2e-310], N[(2.0 * N[Exp[N[(0.5 * N[(N[Log[(-x)], $MachinePrecision] - N[Log[N[(-1.0 / y), $MachinePrecision]], $MachinePrecision]), $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 -1 \cdot 10^{+51}:\\
\;\;\;\;2 \cdot e^{0.5 \cdot \left(\log \left(\left(-y\right) - z\right) - \log \left(\frac{-1}{x}\right)\right)}\\

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

\mathbf{elif}\;y \leq -2 \cdot 10^{-310}:\\
\;\;\;\;2 \cdot e^{0.5 \cdot \left(\log \left(-x\right) - \log \left(\frac{-1}{y}\right)\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 < -1e51

    1. Initial program 55.9%

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

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

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

      \[\leadsto 2 \cdot \sqrt{\color{blue}{\left(y + z\right) \cdot x}} \]
    5. Step-by-step derivation
      1. pow1/233.4%

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

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

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

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

        \[\leadsto 2 \cdot e^{\log \left(x \cdot \color{blue}{\left(z + y\right)}\right) \cdot \sqrt{0.25}} \]
      6. metadata-eval31.1%

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

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

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

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

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

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

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

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

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

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

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

    if -1e51 < y < -3.5000000000000001e-180

    1. Initial program 86.7%

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

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

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

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

    if -3.5000000000000001e-180 < y < -1.999999999999994e-310

    1. Initial program 67.0%

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

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

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

      \[\leadsto 2 \cdot \sqrt{\color{blue}{\left(y + z\right) \cdot x}} \]
    5. Step-by-step derivation
      1. pow1/264.4%

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

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

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

        \[\leadsto 2 \cdot \color{blue}{e^{\log \left(x \cdot \left(y + z\right)\right) \cdot \sqrt{0.25}}} \]
      5. +-commutative59.7%

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

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

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

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

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

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

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

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

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

    if -1.999999999999994e-310 < y

    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.5%

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

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

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

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

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

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

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

Alternative 7: 83.9% accurate, 0.5× speedup?

\[\begin{array}{l} [x, y, z] = \mathsf{sort}([x, y, z])\\ \\ \begin{array}{l} \mathbf{if}\;y \leq 210000000000:\\ \;\;\;\;2 \cdot \sqrt{\mathsf{fma}\left(z, y, x \cdot \left(y + z\right)\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 210000000000.0)
   (* 2.0 (sqrt (fma z y (* 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 <= 210000000000.0) {
		tmp = 2.0 * sqrt(fma(z, y, (x * (y + z))));
	} 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 <= 210000000000.0)
		tmp = Float64(2.0 * sqrt(fma(z, y, Float64(x * Float64(y + z)))));
	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, 210000000000.0], N[(2.0 * N[Sqrt[N[(z * y + N[(x * N[(y + z), $MachinePrecision]), $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 210000000000:\\
\;\;\;\;2 \cdot \sqrt{\mathsf{fma}\left(z, y, x \cdot \left(y + z\right)\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 < 2.1e11

    1. Initial program 74.2%

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

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

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

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

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

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

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

    if 2.1e11 < y

    1. Initial program 51.1%

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

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

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

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

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

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

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

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

Alternative 8: 83.8% accurate, 0.5× speedup?

\[\begin{array}{l} [x, y, z] = \mathsf{sort}([x, y, z])\\ \\ \begin{array}{l} \mathbf{if}\;y \leq 530000000000:\\ \;\;\;\;2 \cdot \sqrt{x \cdot \left(y + z\right) + y \cdot z}\\ \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 530000000000.0)
   (* 2.0 (sqrt (+ (* x (+ y z)) (* 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 <= 530000000000.0) {
		tmp = 2.0 * sqrt(((x * (y + z)) + (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 <= 530000000000.0d0) then
        tmp = 2.0d0 * sqrt(((x * (y + z)) + (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 <= 530000000000.0) {
		tmp = 2.0 * Math.sqrt(((x * (y + z)) + (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 <= 530000000000.0:
		tmp = 2.0 * math.sqrt(((x * (y + z)) + (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 <= 530000000000.0)
		tmp = Float64(2.0 * sqrt(Float64(Float64(x * Float64(y + z)) + 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 <= 530000000000.0)
		tmp = 2.0 * sqrt(((x * (y + z)) + (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, 530000000000.0], N[(2.0 * N[Sqrt[N[(N[(x * N[(y + z), $MachinePrecision]), $MachinePrecision] + 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 530000000000:\\
\;\;\;\;2 \cdot \sqrt{x \cdot \left(y + z\right) + y \cdot z}\\

\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 < 5.3e11

    1. Initial program 74.2%

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

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

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

    if 5.3e11 < y

    1. Initial program 51.1%

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

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

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

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

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

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

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

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

Alternative 9: 71.2% 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.0%

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

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

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

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

Alternative 10: 69.9% accurate, 1.0× speedup?

\[\begin{array}{l} [x, y, z] = \mathsf{sort}([x, y, z])\\ \\ 2 \cdot {\left(\frac{\frac{1}{y}}{z + x}\right)}^{-0.5} \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 (pow (/ (/ 1.0 y) (+ z x)) -0.5)))
assert(x < y && y < z);
double code(double x, double y, double z) {
	return 2.0 * pow(((1.0 / y) / (z + x)), -0.5);
}
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 * (((1.0d0 / y) / (z + x)) ** (-0.5d0))
end function
assert x < y && y < z;
public static double code(double x, double y, double z) {
	return 2.0 * Math.pow(((1.0 / y) / (z + x)), -0.5);
}
[x, y, z] = sort([x, y, z])
def code(x, y, z):
	return 2.0 * math.pow(((1.0 / y) / (z + x)), -0.5)
x, y, z = sort([x, y, z])
function code(x, y, z)
	return Float64(2.0 * (Float64(Float64(1.0 / y) / Float64(z + x)) ^ -0.5))
end
x, y, z = num2cell(sort([x, y, z])){:}
function tmp = code(x, y, z)
	tmp = 2.0 * (((1.0 / y) / (z + x)) ^ -0.5);
end
NOTE: x, y, and z should be sorted in increasing order before calling this function.
code[x_, y_, z_] := 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])\\
\\
2 \cdot {\left(\frac{\frac{1}{y}}{z + x}\right)}^{-0.5}
\end{array}
Derivation
  1. Initial program 69.0%

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

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

    \[\leadsto \color{blue}{2 \cdot \sqrt{x \cdot \left(y + z\right) + y \cdot z}} \]
  4. Step-by-step derivation
    1. flip-+34.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-num34.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. pow234.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. pow234.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-rr34.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-pow34.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-pow134.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-num34.6%

      \[\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. unpow234.6%

      \[\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. unpow234.6%

      \[\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-+68.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-udef69.0%

      \[\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. +-commutative69.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 69.8% accurate, 1.0× speedup?

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

    1. Initial program 68.3%

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

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

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

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

    if -4.7999999999999997e-264 < y

    1. Initial program 69.6%

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

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

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

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

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

Alternative 12: 71.3% accurate, 1.0× speedup?

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

    1. Initial program 67.6%

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

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

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

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

    if -1.99999999999999986e-303 < y

    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.5%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2 \cdot 10^{-303}:\\ \;\;\;\;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.9% accurate, 1.1× speedup?

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

    1. Initial program 67.6%

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

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

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

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

    if -1.999999999999994e-310 < y

    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.5%

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

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

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

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

Alternative 14: 36.0% 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.0%

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

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

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

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

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

Developer target: 83.3% 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 2023229 
(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)))))