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

Percentage Accurate: 70.5% → 95.0%
Time: 32.9s
Alternatives: 13
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 13 alternatives:

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

Initial Program: 70.5% 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: 95.0% accurate, 0.3× speedup?

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

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


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

    1. Initial program 67.8%

      \[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z} \]
    2. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \color{blue}{\left(\sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z}\right)}\right) \]
      2. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\left(\left(x \cdot y + x \cdot z\right) + y \cdot z\right)\right)\right) \]
      3. associate-+l+N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\left(x \cdot y + \left(x \cdot z + y \cdot z\right)\right)\right)\right) \]
      4. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(x \cdot y\right), \left(x \cdot z + y \cdot z\right)\right)\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \left(x \cdot z + y \cdot z\right)\right)\right)\right) \]
      6. distribute-rgt-outN/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \left(z \cdot \left(x + y\right)\right)\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \mathsf{*.f64}\left(z, \left(x + y\right)\right)\right)\right)\right) \]
      8. +-lowering-+.f6467.8%

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \mathsf{*.f64}\left(z, \mathsf{+.f64}\left(x, y\right)\right)\right)\right)\right) \]
    3. Simplified67.8%

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

        \[\leadsto \mathsf{*.f64}\left(2, \left({\left(x \cdot y + z \cdot \left(x + y\right)\right)}^{\color{blue}{\frac{1}{2}}}\right)\right) \]
      2. distribute-rgt-inN/A

        \[\leadsto \mathsf{*.f64}\left(2, \left({\left(x \cdot y + \left(x \cdot z + y \cdot z\right)\right)}^{\frac{1}{2}}\right)\right) \]
      3. associate-+l+N/A

        \[\leadsto \mathsf{*.f64}\left(2, \left({\left(\left(x \cdot y + x \cdot z\right) + y \cdot z\right)}^{\frac{1}{2}}\right)\right) \]
      4. sqr-powN/A

        \[\leadsto \mathsf{*.f64}\left(2, \left({\left(\left(x \cdot y + x \cdot z\right) + y \cdot z\right)}^{\left(\frac{\frac{1}{2}}{2}\right)} \cdot \color{blue}{{\left(\left(x \cdot y + x \cdot z\right) + y \cdot z\right)}^{\left(\frac{\frac{1}{2}}{2}\right)}}\right)\right) \]
      5. pow2N/A

        \[\leadsto \mathsf{*.f64}\left(2, \left({\left({\left(\left(x \cdot y + x \cdot z\right) + y \cdot z\right)}^{\left(\frac{\frac{1}{2}}{2}\right)}\right)}^{\color{blue}{2}}\right)\right) \]
      6. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{pow.f64}\left(\left({\left(\left(x \cdot y + x \cdot z\right) + y \cdot z\right)}^{\left(\frac{\frac{1}{2}}{2}\right)}\right), \color{blue}{2}\right)\right) \]
      7. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{pow.f64}\left(\mathsf{pow.f64}\left(\left(\left(x \cdot y + x \cdot z\right) + y \cdot z\right), \left(\frac{\frac{1}{2}}{2}\right)\right), 2\right)\right) \]
      8. associate-+l+N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{pow.f64}\left(\mathsf{pow.f64}\left(\left(x \cdot y + \left(x \cdot z + y \cdot z\right)\right), \left(\frac{\frac{1}{2}}{2}\right)\right), 2\right)\right) \]
      9. distribute-rgt-inN/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{pow.f64}\left(\mathsf{pow.f64}\left(\left(x \cdot y + z \cdot \left(x + y\right)\right), \left(\frac{\frac{1}{2}}{2}\right)\right), 2\right)\right) \]
      10. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{pow.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(\left(x \cdot y\right), \left(z \cdot \left(x + y\right)\right)\right), \left(\frac{\frac{1}{2}}{2}\right)\right), 2\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{pow.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \left(z \cdot \left(x + y\right)\right)\right), \left(\frac{\frac{1}{2}}{2}\right)\right), 2\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{pow.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \mathsf{*.f64}\left(z, \left(x + y\right)\right)\right), \left(\frac{\frac{1}{2}}{2}\right)\right), 2\right)\right) \]
      13. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{pow.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \mathsf{*.f64}\left(z, \mathsf{+.f64}\left(x, y\right)\right)\right), \left(\frac{\frac{1}{2}}{2}\right)\right), 2\right)\right) \]
      14. metadata-eval67.4%

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{pow.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \mathsf{*.f64}\left(z, \mathsf{+.f64}\left(x, y\right)\right)\right), \frac{1}{4}\right), 2\right)\right) \]
    6. Applied egg-rr67.4%

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

      \[\leadsto \mathsf{*.f64}\left(2, \mathsf{pow.f64}\left(\color{blue}{\left(e^{\frac{1}{4} \cdot \left(\log \left(-1 \cdot y + -1 \cdot z\right) + -1 \cdot \log \left(\frac{-1}{x}\right)\right)}\right)}, 2\right)\right) \]
    8. Step-by-step derivation
      1. exp-lowering-exp.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{pow.f64}\left(\mathsf{exp.f64}\left(\left(\frac{1}{4} \cdot \left(\log \left(-1 \cdot y + -1 \cdot z\right) + -1 \cdot \log \left(\frac{-1}{x}\right)\right)\right)\right), 2\right)\right) \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{pow.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\frac{1}{4}, \left(\log \left(-1 \cdot y + -1 \cdot z\right) + -1 \cdot \log \left(\frac{-1}{x}\right)\right)\right)\right), 2\right)\right) \]
      3. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{pow.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\frac{1}{4}, \mathsf{+.f64}\left(\log \left(-1 \cdot y + -1 \cdot z\right), \left(-1 \cdot \log \left(\frac{-1}{x}\right)\right)\right)\right)\right), 2\right)\right) \]
      4. log-lowering-log.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{pow.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\frac{1}{4}, \mathsf{+.f64}\left(\mathsf{log.f64}\left(\left(-1 \cdot y + -1 \cdot z\right)\right), \left(-1 \cdot \log \left(\frac{-1}{x}\right)\right)\right)\right)\right), 2\right)\right) \]
      5. fma-defineN/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{pow.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\frac{1}{4}, \mathsf{+.f64}\left(\mathsf{log.f64}\left(\left(\mathsf{fma}\left(-1, y, -1 \cdot z\right)\right)\right), \left(-1 \cdot \log \left(\frac{-1}{x}\right)\right)\right)\right)\right), 2\right)\right) \]
      6. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{pow.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\frac{1}{4}, \mathsf{+.f64}\left(\mathsf{log.f64}\left(\left(\mathsf{fma}\left(-1, y, \mathsf{neg}\left(z\right)\right)\right)\right), \left(-1 \cdot \log \left(\frac{-1}{x}\right)\right)\right)\right)\right), 2\right)\right) \]
      7. fmm-undefN/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{pow.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\frac{1}{4}, \mathsf{+.f64}\left(\mathsf{log.f64}\left(\left(-1 \cdot y - z\right)\right), \left(-1 \cdot \log \left(\frac{-1}{x}\right)\right)\right)\right)\right), 2\right)\right) \]
      8. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{pow.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\frac{1}{4}, \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{\_.f64}\left(\left(-1 \cdot y\right), z\right)\right), \left(-1 \cdot \log \left(\frac{-1}{x}\right)\right)\right)\right)\right), 2\right)\right) \]
      9. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{pow.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\frac{1}{4}, \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{\_.f64}\left(\left(\mathsf{neg}\left(y\right)\right), z\right)\right), \left(-1 \cdot \log \left(\frac{-1}{x}\right)\right)\right)\right)\right), 2\right)\right) \]
      10. neg-lowering-neg.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{pow.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\frac{1}{4}, \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{\_.f64}\left(\mathsf{neg.f64}\left(y\right), z\right)\right), \left(-1 \cdot \log \left(\frac{-1}{x}\right)\right)\right)\right)\right), 2\right)\right) \]
      11. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{pow.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\frac{1}{4}, \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{\_.f64}\left(\mathsf{neg.f64}\left(y\right), z\right)\right), \left(\mathsf{neg}\left(\log \left(\frac{-1}{x}\right)\right)\right)\right)\right)\right), 2\right)\right) \]
      12. neg-lowering-neg.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{pow.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\frac{1}{4}, \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{\_.f64}\left(\mathsf{neg.f64}\left(y\right), z\right)\right), \mathsf{neg.f64}\left(\log \left(\frac{-1}{x}\right)\right)\right)\right)\right), 2\right)\right) \]
      13. log-lowering-log.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{pow.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\frac{1}{4}, \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{\_.f64}\left(\mathsf{neg.f64}\left(y\right), z\right)\right), \mathsf{neg.f64}\left(\mathsf{log.f64}\left(\left(\frac{-1}{x}\right)\right)\right)\right)\right)\right), 2\right)\right) \]
      14. /-lowering-/.f6440.8%

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{pow.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\frac{1}{4}, \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{\_.f64}\left(\mathsf{neg.f64}\left(y\right), z\right)\right), \mathsf{neg.f64}\left(\mathsf{log.f64}\left(\mathsf{/.f64}\left(-1, x\right)\right)\right)\right)\right)\right), 2\right)\right) \]
    9. Simplified40.8%

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

    if 2.1500000000000001e-305 < y

    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. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \color{blue}{\left(\sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z}\right)}\right) \]
      2. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\left(\left(x \cdot y + x \cdot z\right) + y \cdot z\right)\right)\right) \]
      3. associate-+l+N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\left(x \cdot y + \left(x \cdot z + y \cdot z\right)\right)\right)\right) \]
      4. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(x \cdot y\right), \left(x \cdot z + y \cdot z\right)\right)\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \left(x \cdot z + y \cdot z\right)\right)\right)\right) \]
      6. distribute-rgt-outN/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \left(z \cdot \left(x + y\right)\right)\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \mathsf{*.f64}\left(z, \left(x + y\right)\right)\right)\right)\right) \]
      8. +-lowering-+.f6467.7%

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \mathsf{*.f64}\left(z, \mathsf{+.f64}\left(x, y\right)\right)\right)\right)\right) \]
    3. Simplified67.7%

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

      \[\leadsto \color{blue}{2 \cdot \sqrt{z \cdot \left(x + y\right)}} \]
    6. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \color{blue}{\left(\sqrt{z \cdot \left(x + y\right)}\right)}\right) \]
      2. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\left(z \cdot \left(x + y\right)\right)\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(z, \left(x + y\right)\right)\right)\right) \]
      4. +-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(z, \left(y + x\right)\right)\right)\right) \]
      5. +-lowering-+.f6441.5%

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(z, \mathsf{+.f64}\left(y, x\right)\right)\right)\right) \]
    7. Simplified41.5%

      \[\leadsto \color{blue}{2 \cdot \sqrt{z \cdot \left(y + x\right)}} \]
    8. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(2, \left(\sqrt{z \cdot \left(x + y\right)}\right)\right) \]
      2. flip-+N/A

        \[\leadsto \mathsf{*.f64}\left(2, \left(\sqrt{z \cdot \frac{x \cdot x - y \cdot y}{x - y}}\right)\right) \]
      3. associate-*r/N/A

        \[\leadsto \mathsf{*.f64}\left(2, \left(\sqrt{\frac{z \cdot \left(x \cdot x - y \cdot y\right)}{x - y}}\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(2, \left(\sqrt{\frac{\left(x \cdot x - y \cdot y\right) \cdot z}{x - y}}\right)\right) \]
      5. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(2, \left(\sqrt{\frac{1}{\frac{x - y}{\left(x \cdot x - y \cdot y\right) \cdot z}}}\right)\right) \]
      6. sqrt-divN/A

        \[\leadsto \mathsf{*.f64}\left(2, \left(\frac{\sqrt{1}}{\color{blue}{\sqrt{\frac{x - y}{\left(x \cdot x - y \cdot y\right) \cdot z}}}}\right)\right) \]
      7. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(2, \left(\frac{1}{\sqrt{\color{blue}{\frac{x - y}{\left(x \cdot x - y \cdot y\right) \cdot z}}}}\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \color{blue}{\left(\sqrt{\frac{x - y}{\left(x \cdot x - y \cdot y\right) \cdot z}}\right)}\right)\right) \]
      9. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \mathsf{sqrt.f64}\left(\left(\frac{x - y}{\left(x \cdot x - y \cdot y\right) \cdot z}\right)\right)\right)\right) \]
      10. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \mathsf{sqrt.f64}\left(\left(\frac{1}{\frac{\left(x \cdot x - y \cdot y\right) \cdot z}{x - y}}\right)\right)\right)\right) \]
      11. associate-*l/N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \mathsf{sqrt.f64}\left(\left(\frac{1}{\frac{x \cdot x - y \cdot y}{x - y} \cdot z}\right)\right)\right)\right) \]
      12. flip-+N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \mathsf{sqrt.f64}\left(\left(\frac{1}{\left(x + y\right) \cdot z}\right)\right)\right)\right) \]
      13. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \mathsf{sqrt.f64}\left(\left(\frac{1}{z \cdot \left(x + y\right)}\right)\right)\right)\right) \]
      14. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(z \cdot \left(x + y\right)\right)\right)\right)\right)\right) \]
      15. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(z, \left(x + y\right)\right)\right)\right)\right)\right) \]
      16. +-lowering-+.f6440.1%

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(z, \mathsf{+.f64}\left(x, y\right)\right)\right)\right)\right)\right) \]
    9. Applied egg-rr40.1%

      \[\leadsto 2 \cdot \color{blue}{\frac{1}{\sqrt{\frac{1}{z \cdot \left(x + y\right)}}}} \]
    10. Step-by-step derivation
      1. inv-powN/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \left(\sqrt{{\left(z \cdot \left(x + y\right)\right)}^{-1}}\right)\right)\right) \]
      2. sqrt-pow1N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \left({\left(z \cdot \left(x + y\right)\right)}^{\color{blue}{\left(\frac{-1}{2}\right)}}\right)\right)\right) \]
      3. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \left({\left(z \cdot \left(x + y\right)\right)}^{\frac{-1}{2}}\right)\right)\right) \]
      4. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \left({\left(z \cdot \left(x + y\right)\right)}^{\left(\frac{1}{2} \cdot \color{blue}{-1}\right)}\right)\right)\right) \]
      5. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \left({\left(\left(x + y\right) \cdot z\right)}^{\left(\color{blue}{\frac{1}{2}} \cdot -1\right)}\right)\right)\right) \]
      6. unpow-prod-downN/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \left({\left(x + y\right)}^{\left(\frac{1}{2} \cdot -1\right)} \cdot \color{blue}{{z}^{\left(\frac{1}{2} \cdot -1\right)}}\right)\right)\right) \]
      7. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \left({\left(x + y\right)}^{\left(\frac{1}{2} \cdot -1\right)} \cdot {z}^{\frac{-1}{2}}\right)\right)\right) \]
      8. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \left({\left(x + y\right)}^{\left(\frac{1}{2} \cdot -1\right)} \cdot {z}^{\left(\frac{-1}{\color{blue}{2}}\right)}\right)\right)\right) \]
      9. sqrt-pow1N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \left({\left(x + y\right)}^{\left(\frac{1}{2} \cdot -1\right)} \cdot \sqrt{{z}^{-1}}\right)\right)\right) \]
      10. inv-powN/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \left({\left(x + y\right)}^{\left(\frac{1}{2} \cdot -1\right)} \cdot \sqrt{\frac{1}{z}}\right)\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \mathsf{*.f64}\left(\left({\left(x + y\right)}^{\left(\frac{1}{2} \cdot -1\right)}\right), \color{blue}{\left(\sqrt{\frac{1}{z}}\right)}\right)\right)\right) \]
      12. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(x + y\right), \left(\frac{1}{2} \cdot -1\right)\right), \left(\sqrt{\color{blue}{\frac{1}{z}}}\right)\right)\right)\right) \]
      13. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(x, y\right), \left(\frac{1}{2} \cdot -1\right)\right), \left(\sqrt{\frac{\color{blue}{1}}{z}}\right)\right)\right)\right) \]
      14. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(x, y\right), \frac{-1}{2}\right), \left(\sqrt{\frac{1}{\color{blue}{z}}}\right)\right)\right)\right) \]
      15. inv-powN/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(x, y\right), \frac{-1}{2}\right), \left(\sqrt{{z}^{-1}}\right)\right)\right)\right) \]
      16. sqrt-pow1N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(x, y\right), \frac{-1}{2}\right), \left({z}^{\color{blue}{\left(\frac{-1}{2}\right)}}\right)\right)\right)\right) \]
      17. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(x, y\right), \frac{-1}{2}\right), \left({z}^{\frac{-1}{2}}\right)\right)\right)\right) \]
      18. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(x, y\right), \frac{-1}{2}\right), \left({z}^{\left(\frac{1}{2} \cdot \color{blue}{-1}\right)}\right)\right)\right)\right) \]
      19. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(x, y\right), \frac{-1}{2}\right), \mathsf{pow.f64}\left(z, \color{blue}{\left(\frac{1}{2} \cdot -1\right)}\right)\right)\right)\right) \]
      20. metadata-eval45.6%

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(x, y\right), \frac{-1}{2}\right), \mathsf{pow.f64}\left(z, \frac{-1}{2}\right)\right)\right)\right) \]
    11. Applied egg-rr45.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 2.15 \cdot 10^{-305}:\\ \;\;\;\;2 \cdot {\left(e^{0.25 \cdot \left(\log \left(\left(0 - y\right) - z\right) - \log \left(\frac{-1}{x}\right)\right)}\right)}^{2}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \frac{1}{{\left(y + x\right)}^{-0.5} \cdot {z}^{-0.5}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 94.9% accurate, 0.3× speedup?

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

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


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

    1. Initial program 67.8%

      \[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z} \]
    2. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \color{blue}{\left(\sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z}\right)}\right) \]
      2. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\left(\left(x \cdot y + x \cdot z\right) + y \cdot z\right)\right)\right) \]
      3. associate-+l+N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\left(x \cdot y + \left(x \cdot z + y \cdot z\right)\right)\right)\right) \]
      4. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(x \cdot y\right), \left(x \cdot z + y \cdot z\right)\right)\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \left(x \cdot z + y \cdot z\right)\right)\right)\right) \]
      6. distribute-rgt-outN/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \left(z \cdot \left(x + y\right)\right)\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \mathsf{*.f64}\left(z, \left(x + y\right)\right)\right)\right)\right) \]
      8. +-lowering-+.f6467.8%

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \mathsf{*.f64}\left(z, \mathsf{+.f64}\left(x, y\right)\right)\right)\right)\right) \]
    3. Simplified67.8%

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

        \[\leadsto \mathsf{*.f64}\left(2, \left({\left(x \cdot y + z \cdot \left(x + y\right)\right)}^{\color{blue}{\frac{1}{2}}}\right)\right) \]
      2. distribute-rgt-inN/A

        \[\leadsto \mathsf{*.f64}\left(2, \left({\left(x \cdot y + \left(x \cdot z + y \cdot z\right)\right)}^{\frac{1}{2}}\right)\right) \]
      3. associate-+l+N/A

        \[\leadsto \mathsf{*.f64}\left(2, \left({\left(\left(x \cdot y + x \cdot z\right) + y \cdot z\right)}^{\frac{1}{2}}\right)\right) \]
      4. sqr-powN/A

        \[\leadsto \mathsf{*.f64}\left(2, \left({\left(\left(x \cdot y + x \cdot z\right) + y \cdot z\right)}^{\left(\frac{\frac{1}{2}}{2}\right)} \cdot \color{blue}{{\left(\left(x \cdot y + x \cdot z\right) + y \cdot z\right)}^{\left(\frac{\frac{1}{2}}{2}\right)}}\right)\right) \]
      5. pow2N/A

        \[\leadsto \mathsf{*.f64}\left(2, \left({\left({\left(\left(x \cdot y + x \cdot z\right) + y \cdot z\right)}^{\left(\frac{\frac{1}{2}}{2}\right)}\right)}^{\color{blue}{2}}\right)\right) \]
      6. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{pow.f64}\left(\left({\left(\left(x \cdot y + x \cdot z\right) + y \cdot z\right)}^{\left(\frac{\frac{1}{2}}{2}\right)}\right), \color{blue}{2}\right)\right) \]
      7. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{pow.f64}\left(\mathsf{pow.f64}\left(\left(\left(x \cdot y + x \cdot z\right) + y \cdot z\right), \left(\frac{\frac{1}{2}}{2}\right)\right), 2\right)\right) \]
      8. associate-+l+N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{pow.f64}\left(\mathsf{pow.f64}\left(\left(x \cdot y + \left(x \cdot z + y \cdot z\right)\right), \left(\frac{\frac{1}{2}}{2}\right)\right), 2\right)\right) \]
      9. distribute-rgt-inN/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{pow.f64}\left(\mathsf{pow.f64}\left(\left(x \cdot y + z \cdot \left(x + y\right)\right), \left(\frac{\frac{1}{2}}{2}\right)\right), 2\right)\right) \]
      10. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{pow.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(\left(x \cdot y\right), \left(z \cdot \left(x + y\right)\right)\right), \left(\frac{\frac{1}{2}}{2}\right)\right), 2\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{pow.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \left(z \cdot \left(x + y\right)\right)\right), \left(\frac{\frac{1}{2}}{2}\right)\right), 2\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{pow.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \mathsf{*.f64}\left(z, \left(x + y\right)\right)\right), \left(\frac{\frac{1}{2}}{2}\right)\right), 2\right)\right) \]
      13. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{pow.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \mathsf{*.f64}\left(z, \mathsf{+.f64}\left(x, y\right)\right)\right), \left(\frac{\frac{1}{2}}{2}\right)\right), 2\right)\right) \]
      14. metadata-eval67.4%

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{pow.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \mathsf{*.f64}\left(z, \mathsf{+.f64}\left(x, y\right)\right)\right), \frac{1}{4}\right), 2\right)\right) \]
    6. Applied egg-rr67.4%

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

        \[\leadsto \mathsf{*.f64}\left(2, \left({\left({\left(x \cdot y + z \cdot \left(x + y\right)\right)}^{\left(\frac{\frac{1}{4}}{2}\right)} \cdot {\left(x \cdot y + z \cdot \left(x + y\right)\right)}^{\left(\frac{\frac{1}{4}}{2}\right)}\right)}^{2}\right)\right) \]
      2. unpow-prod-downN/A

        \[\leadsto \mathsf{*.f64}\left(2, \left({\left({\left(x \cdot y + z \cdot \left(x + y\right)\right)}^{\left(\frac{\frac{1}{4}}{2}\right)}\right)}^{2} \cdot \color{blue}{{\left({\left(x \cdot y + z \cdot \left(x + y\right)\right)}^{\left(\frac{\frac{1}{4}}{2}\right)}\right)}^{2}}\right)\right) \]
      3. pow-prod-upN/A

        \[\leadsto \mathsf{*.f64}\left(2, \left({\left({\left(x \cdot y + z \cdot \left(x + y\right)\right)}^{\left(\frac{\frac{1}{4}}{2}\right)}\right)}^{\color{blue}{\left(2 + 2\right)}}\right)\right) \]
      4. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{pow.f64}\left(\left({\left(x \cdot y + z \cdot \left(x + y\right)\right)}^{\left(\frac{\frac{1}{4}}{2}\right)}\right), \color{blue}{\left(2 + 2\right)}\right)\right) \]
      5. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{pow.f64}\left(\mathsf{pow.f64}\left(\left(x \cdot y + z \cdot \left(x + y\right)\right), \left(\frac{\frac{1}{4}}{2}\right)\right), \left(\color{blue}{2} + 2\right)\right)\right) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{pow.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(\left(x \cdot y\right), \left(z \cdot \left(x + y\right)\right)\right), \left(\frac{\frac{1}{4}}{2}\right)\right), \left(2 + 2\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{pow.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \left(z \cdot \left(x + y\right)\right)\right), \left(\frac{\frac{1}{4}}{2}\right)\right), \left(2 + 2\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{pow.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \mathsf{*.f64}\left(z, \left(x + y\right)\right)\right), \left(\frac{\frac{1}{4}}{2}\right)\right), \left(2 + 2\right)\right)\right) \]
      9. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{pow.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \mathsf{*.f64}\left(z, \mathsf{+.f64}\left(x, y\right)\right)\right), \left(\frac{\frac{1}{4}}{2}\right)\right), \left(2 + 2\right)\right)\right) \]
      10. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{pow.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \mathsf{*.f64}\left(z, \mathsf{+.f64}\left(x, y\right)\right)\right), \frac{1}{8}\right), \left(2 + 2\right)\right)\right) \]
      11. metadata-eval67.1%

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{pow.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \mathsf{*.f64}\left(z, \mathsf{+.f64}\left(x, y\right)\right)\right), \frac{1}{8}\right), 4\right)\right) \]
    8. Applied egg-rr67.1%

      \[\leadsto 2 \cdot \color{blue}{{\left({\left(x \cdot y + z \cdot \left(x + y\right)\right)}^{0.125}\right)}^{4}} \]
    9. Taylor expanded in x around -inf

      \[\leadsto \mathsf{*.f64}\left(2, \mathsf{pow.f64}\left(\color{blue}{\left(e^{\frac{1}{8} \cdot \left(\log \left(-1 \cdot y + -1 \cdot z\right) + -1 \cdot \log \left(\frac{-1}{x}\right)\right)}\right)}, 4\right)\right) \]
    10. Step-by-step derivation
      1. exp-lowering-exp.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{pow.f64}\left(\mathsf{exp.f64}\left(\left(\frac{1}{8} \cdot \left(\log \left(-1 \cdot y + -1 \cdot z\right) + -1 \cdot \log \left(\frac{-1}{x}\right)\right)\right)\right), 4\right)\right) \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{pow.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\frac{1}{8}, \left(\log \left(-1 \cdot y + -1 \cdot z\right) + -1 \cdot \log \left(\frac{-1}{x}\right)\right)\right)\right), 4\right)\right) \]
      3. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{pow.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\frac{1}{8}, \mathsf{+.f64}\left(\log \left(-1 \cdot y + -1 \cdot z\right), \left(-1 \cdot \log \left(\frac{-1}{x}\right)\right)\right)\right)\right), 4\right)\right) \]
      4. log-lowering-log.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{pow.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\frac{1}{8}, \mathsf{+.f64}\left(\mathsf{log.f64}\left(\left(-1 \cdot y + -1 \cdot z\right)\right), \left(-1 \cdot \log \left(\frac{-1}{x}\right)\right)\right)\right)\right), 4\right)\right) \]
      5. fma-defineN/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{pow.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\frac{1}{8}, \mathsf{+.f64}\left(\mathsf{log.f64}\left(\left(\mathsf{fma}\left(-1, y, -1 \cdot z\right)\right)\right), \left(-1 \cdot \log \left(\frac{-1}{x}\right)\right)\right)\right)\right), 4\right)\right) \]
      6. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{pow.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\frac{1}{8}, \mathsf{+.f64}\left(\mathsf{log.f64}\left(\left(\mathsf{fma}\left(-1, y, \mathsf{neg}\left(z\right)\right)\right)\right), \left(-1 \cdot \log \left(\frac{-1}{x}\right)\right)\right)\right)\right), 4\right)\right) \]
      7. fmm-undefN/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{pow.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\frac{1}{8}, \mathsf{+.f64}\left(\mathsf{log.f64}\left(\left(-1 \cdot y - z\right)\right), \left(-1 \cdot \log \left(\frac{-1}{x}\right)\right)\right)\right)\right), 4\right)\right) \]
      8. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{pow.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\frac{1}{8}, \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{\_.f64}\left(\left(-1 \cdot y\right), z\right)\right), \left(-1 \cdot \log \left(\frac{-1}{x}\right)\right)\right)\right)\right), 4\right)\right) \]
      9. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{pow.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\frac{1}{8}, \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{\_.f64}\left(\left(\mathsf{neg}\left(y\right)\right), z\right)\right), \left(-1 \cdot \log \left(\frac{-1}{x}\right)\right)\right)\right)\right), 4\right)\right) \]
      10. neg-lowering-neg.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{pow.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\frac{1}{8}, \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{\_.f64}\left(\mathsf{neg.f64}\left(y\right), z\right)\right), \left(-1 \cdot \log \left(\frac{-1}{x}\right)\right)\right)\right)\right), 4\right)\right) \]
      11. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{pow.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\frac{1}{8}, \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{\_.f64}\left(\mathsf{neg.f64}\left(y\right), z\right)\right), \left(\mathsf{neg}\left(\log \left(\frac{-1}{x}\right)\right)\right)\right)\right)\right), 4\right)\right) \]
      12. neg-lowering-neg.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{pow.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\frac{1}{8}, \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{\_.f64}\left(\mathsf{neg.f64}\left(y\right), z\right)\right), \mathsf{neg.f64}\left(\log \left(\frac{-1}{x}\right)\right)\right)\right)\right), 4\right)\right) \]
      13. log-lowering-log.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{pow.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\frac{1}{8}, \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{\_.f64}\left(\mathsf{neg.f64}\left(y\right), z\right)\right), \mathsf{neg.f64}\left(\mathsf{log.f64}\left(\left(\frac{-1}{x}\right)\right)\right)\right)\right)\right), 4\right)\right) \]
      14. /-lowering-/.f6441.9%

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{pow.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\frac{1}{8}, \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{\_.f64}\left(\mathsf{neg.f64}\left(y\right), z\right)\right), \mathsf{neg.f64}\left(\mathsf{log.f64}\left(\mathsf{/.f64}\left(-1, x\right)\right)\right)\right)\right)\right), 4\right)\right) \]
    11. Simplified41.9%

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

    if 2.10000000000000005e-293 < y

    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. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \color{blue}{\left(\sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z}\right)}\right) \]
      2. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\left(\left(x \cdot y + x \cdot z\right) + y \cdot z\right)\right)\right) \]
      3. associate-+l+N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\left(x \cdot y + \left(x \cdot z + y \cdot z\right)\right)\right)\right) \]
      4. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(x \cdot y\right), \left(x \cdot z + y \cdot z\right)\right)\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \left(x \cdot z + y \cdot z\right)\right)\right)\right) \]
      6. distribute-rgt-outN/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \left(z \cdot \left(x + y\right)\right)\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \mathsf{*.f64}\left(z, \left(x + y\right)\right)\right)\right)\right) \]
      8. +-lowering-+.f6467.7%

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \mathsf{*.f64}\left(z, \mathsf{+.f64}\left(x, y\right)\right)\right)\right)\right) \]
    3. Simplified67.7%

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

      \[\leadsto \color{blue}{2 \cdot \sqrt{z \cdot \left(x + y\right)}} \]
    6. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \color{blue}{\left(\sqrt{z \cdot \left(x + y\right)}\right)}\right) \]
      2. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\left(z \cdot \left(x + y\right)\right)\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(z, \left(x + y\right)\right)\right)\right) \]
      4. +-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(z, \left(y + x\right)\right)\right)\right) \]
      5. +-lowering-+.f6440.9%

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(z, \mathsf{+.f64}\left(y, x\right)\right)\right)\right) \]
    7. Simplified40.9%

      \[\leadsto \color{blue}{2 \cdot \sqrt{z \cdot \left(y + x\right)}} \]
    8. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(2, \left(\sqrt{z \cdot \left(x + y\right)}\right)\right) \]
      2. flip-+N/A

        \[\leadsto \mathsf{*.f64}\left(2, \left(\sqrt{z \cdot \frac{x \cdot x - y \cdot y}{x - y}}\right)\right) \]
      3. associate-*r/N/A

        \[\leadsto \mathsf{*.f64}\left(2, \left(\sqrt{\frac{z \cdot \left(x \cdot x - y \cdot y\right)}{x - y}}\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(2, \left(\sqrt{\frac{\left(x \cdot x - y \cdot y\right) \cdot z}{x - y}}\right)\right) \]
      5. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(2, \left(\sqrt{\frac{1}{\frac{x - y}{\left(x \cdot x - y \cdot y\right) \cdot z}}}\right)\right) \]
      6. sqrt-divN/A

        \[\leadsto \mathsf{*.f64}\left(2, \left(\frac{\sqrt{1}}{\color{blue}{\sqrt{\frac{x - y}{\left(x \cdot x - y \cdot y\right) \cdot z}}}}\right)\right) \]
      7. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(2, \left(\frac{1}{\sqrt{\color{blue}{\frac{x - y}{\left(x \cdot x - y \cdot y\right) \cdot z}}}}\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \color{blue}{\left(\sqrt{\frac{x - y}{\left(x \cdot x - y \cdot y\right) \cdot z}}\right)}\right)\right) \]
      9. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \mathsf{sqrt.f64}\left(\left(\frac{x - y}{\left(x \cdot x - y \cdot y\right) \cdot z}\right)\right)\right)\right) \]
      10. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \mathsf{sqrt.f64}\left(\left(\frac{1}{\frac{\left(x \cdot x - y \cdot y\right) \cdot z}{x - y}}\right)\right)\right)\right) \]
      11. associate-*l/N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \mathsf{sqrt.f64}\left(\left(\frac{1}{\frac{x \cdot x - y \cdot y}{x - y} \cdot z}\right)\right)\right)\right) \]
      12. flip-+N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \mathsf{sqrt.f64}\left(\left(\frac{1}{\left(x + y\right) \cdot z}\right)\right)\right)\right) \]
      13. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \mathsf{sqrt.f64}\left(\left(\frac{1}{z \cdot \left(x + y\right)}\right)\right)\right)\right) \]
      14. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(z \cdot \left(x + y\right)\right)\right)\right)\right)\right) \]
      15. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(z, \left(x + y\right)\right)\right)\right)\right)\right) \]
      16. +-lowering-+.f6440.2%

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(z, \mathsf{+.f64}\left(x, y\right)\right)\right)\right)\right)\right) \]
    9. Applied egg-rr40.2%

      \[\leadsto 2 \cdot \color{blue}{\frac{1}{\sqrt{\frac{1}{z \cdot \left(x + y\right)}}}} \]
    10. Step-by-step derivation
      1. inv-powN/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \left(\sqrt{{\left(z \cdot \left(x + y\right)\right)}^{-1}}\right)\right)\right) \]
      2. sqrt-pow1N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \left({\left(z \cdot \left(x + y\right)\right)}^{\color{blue}{\left(\frac{-1}{2}\right)}}\right)\right)\right) \]
      3. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \left({\left(z \cdot \left(x + y\right)\right)}^{\frac{-1}{2}}\right)\right)\right) \]
      4. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \left({\left(z \cdot \left(x + y\right)\right)}^{\left(\frac{1}{2} \cdot \color{blue}{-1}\right)}\right)\right)\right) \]
      5. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \left({\left(\left(x + y\right) \cdot z\right)}^{\left(\color{blue}{\frac{1}{2}} \cdot -1\right)}\right)\right)\right) \]
      6. unpow-prod-downN/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \left({\left(x + y\right)}^{\left(\frac{1}{2} \cdot -1\right)} \cdot \color{blue}{{z}^{\left(\frac{1}{2} \cdot -1\right)}}\right)\right)\right) \]
      7. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \left({\left(x + y\right)}^{\left(\frac{1}{2} \cdot -1\right)} \cdot {z}^{\frac{-1}{2}}\right)\right)\right) \]
      8. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \left({\left(x + y\right)}^{\left(\frac{1}{2} \cdot -1\right)} \cdot {z}^{\left(\frac{-1}{\color{blue}{2}}\right)}\right)\right)\right) \]
      9. sqrt-pow1N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \left({\left(x + y\right)}^{\left(\frac{1}{2} \cdot -1\right)} \cdot \sqrt{{z}^{-1}}\right)\right)\right) \]
      10. inv-powN/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \left({\left(x + y\right)}^{\left(\frac{1}{2} \cdot -1\right)} \cdot \sqrt{\frac{1}{z}}\right)\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \mathsf{*.f64}\left(\left({\left(x + y\right)}^{\left(\frac{1}{2} \cdot -1\right)}\right), \color{blue}{\left(\sqrt{\frac{1}{z}}\right)}\right)\right)\right) \]
      12. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(x + y\right), \left(\frac{1}{2} \cdot -1\right)\right), \left(\sqrt{\color{blue}{\frac{1}{z}}}\right)\right)\right)\right) \]
      13. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(x, y\right), \left(\frac{1}{2} \cdot -1\right)\right), \left(\sqrt{\frac{\color{blue}{1}}{z}}\right)\right)\right)\right) \]
      14. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(x, y\right), \frac{-1}{2}\right), \left(\sqrt{\frac{1}{\color{blue}{z}}}\right)\right)\right)\right) \]
      15. inv-powN/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(x, y\right), \frac{-1}{2}\right), \left(\sqrt{{z}^{-1}}\right)\right)\right)\right) \]
      16. sqrt-pow1N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(x, y\right), \frac{-1}{2}\right), \left({z}^{\color{blue}{\left(\frac{-1}{2}\right)}}\right)\right)\right)\right) \]
      17. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(x, y\right), \frac{-1}{2}\right), \left({z}^{\frac{-1}{2}}\right)\right)\right)\right) \]
      18. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(x, y\right), \frac{-1}{2}\right), \left({z}^{\left(\frac{1}{2} \cdot \color{blue}{-1}\right)}\right)\right)\right)\right) \]
      19. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(x, y\right), \frac{-1}{2}\right), \mathsf{pow.f64}\left(z, \color{blue}{\left(\frac{1}{2} \cdot -1\right)}\right)\right)\right)\right) \]
      20. metadata-eval46.6%

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(x, y\right), \frac{-1}{2}\right), \mathsf{pow.f64}\left(z, \frac{-1}{2}\right)\right)\right)\right) \]
    11. Applied egg-rr46.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 2.1 \cdot 10^{-293}:\\ \;\;\;\;2 \cdot {\left(e^{\left(\log \left(\left(0 - y\right) - z\right) - \log \left(\frac{-1}{x}\right)\right) \cdot 0.125}\right)}^{4}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \frac{1}{{\left(y + x\right)}^{-0.5} \cdot {z}^{-0.5}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 83.2% accurate, 0.5× speedup?

\[\begin{array}{l} [x, y, z] = \mathsf{sort}([x, y, z])\\ \\ \begin{array}{l} \mathbf{if}\;y \leq 2.15 \cdot 10^{+25}:\\ \;\;\;\;2 \cdot \sqrt{\left(y \cdot x + z \cdot x\right) + y \cdot z}\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(2 \cdot \sqrt{\frac{z}{y}} + x \cdot \sqrt{\frac{z}{y \cdot \left(y \cdot y\right)}}\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.15e+25)
   (* 2.0 (sqrt (+ (+ (* y x) (* z x)) (* y z))))
   (* y (+ (* 2.0 (sqrt (/ z y))) (* x (sqrt (/ z (* y (* y y)))))))))
assert(x < y && y < z);
double code(double x, double y, double z) {
	double tmp;
	if (y <= 2.15e+25) {
		tmp = 2.0 * sqrt((((y * x) + (z * x)) + (y * z)));
	} else {
		tmp = y * ((2.0 * sqrt((z / y))) + (x * sqrt((z / (y * (y * 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.15d+25) then
        tmp = 2.0d0 * sqrt((((y * x) + (z * x)) + (y * z)))
    else
        tmp = y * ((2.0d0 * sqrt((z / y))) + (x * sqrt((z / (y * (y * 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.15e+25) {
		tmp = 2.0 * Math.sqrt((((y * x) + (z * x)) + (y * z)));
	} else {
		tmp = y * ((2.0 * Math.sqrt((z / y))) + (x * Math.sqrt((z / (y * (y * y))))));
	}
	return tmp;
}
[x, y, z] = sort([x, y, z])
def code(x, y, z):
	tmp = 0
	if y <= 2.15e+25:
		tmp = 2.0 * math.sqrt((((y * x) + (z * x)) + (y * z)))
	else:
		tmp = y * ((2.0 * math.sqrt((z / y))) + (x * math.sqrt((z / (y * (y * y))))))
	return tmp
x, y, z = sort([x, y, z])
function code(x, y, z)
	tmp = 0.0
	if (y <= 2.15e+25)
		tmp = Float64(2.0 * sqrt(Float64(Float64(Float64(y * x) + Float64(z * x)) + Float64(y * z))));
	else
		tmp = Float64(y * Float64(Float64(2.0 * sqrt(Float64(z / y))) + Float64(x * sqrt(Float64(z / Float64(y * Float64(y * 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.15e+25)
		tmp = 2.0 * sqrt((((y * x) + (z * x)) + (y * z)));
	else
		tmp = y * ((2.0 * sqrt((z / y))) + (x * sqrt((z / (y * (y * 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.15e+25], N[(2.0 * N[Sqrt[N[(N[(N[(y * x), $MachinePrecision] + N[(z * x), $MachinePrecision]), $MachinePrecision] + N[(y * z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(y * N[(N[(2.0 * N[Sqrt[N[(z / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(x * N[Sqrt[N[(z / N[(y * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z] = \mathsf{sort}([x, y, z])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.15 \cdot 10^{+25}:\\
\;\;\;\;2 \cdot \sqrt{\left(y \cdot x + z \cdot x\right) + y \cdot z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 2.14999999999999999e25

    1. Initial program 73.6%

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

    if 2.14999999999999999e25 < y

    1. Initial program 46.3%

      \[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z} \]
    2. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \color{blue}{\left(\sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z}\right)}\right) \]
      2. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\left(\left(x \cdot y + x \cdot z\right) + y \cdot z\right)\right)\right) \]
      3. associate-+l+N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\left(x \cdot y + \left(x \cdot z + y \cdot z\right)\right)\right)\right) \]
      4. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(x \cdot y\right), \left(x \cdot z + y \cdot z\right)\right)\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \left(x \cdot z + y \cdot z\right)\right)\right)\right) \]
      6. distribute-rgt-outN/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \left(z \cdot \left(x + y\right)\right)\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \mathsf{*.f64}\left(z, \left(x + y\right)\right)\right)\right)\right) \]
      8. +-lowering-+.f6446.5%

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \mathsf{*.f64}\left(z, \mathsf{+.f64}\left(x, y\right)\right)\right)\right)\right) \]
    3. Simplified46.5%

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

      \[\leadsto \color{blue}{2 \cdot \sqrt{z \cdot \left(x + y\right)}} \]
    6. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \color{blue}{\left(\sqrt{z \cdot \left(x + y\right)}\right)}\right) \]
      2. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\left(z \cdot \left(x + y\right)\right)\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(z, \left(x + y\right)\right)\right)\right) \]
      4. +-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(z, \left(y + x\right)\right)\right)\right) \]
      5. +-lowering-+.f6424.3%

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(z, \mathsf{+.f64}\left(y, x\right)\right)\right)\right) \]
    7. Simplified24.3%

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

      \[\leadsto \color{blue}{y \cdot \left(2 \cdot \sqrt{\frac{z}{y}} + x \cdot \sqrt{\frac{z}{{y}^{3}}}\right)} \]
    9. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(y, \color{blue}{\left(2 \cdot \sqrt{\frac{z}{y}} + x \cdot \sqrt{\frac{z}{{y}^{3}}}\right)}\right) \]
      2. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(y, \mathsf{+.f64}\left(\left(2 \cdot \sqrt{\frac{z}{y}}\right), \color{blue}{\left(x \cdot \sqrt{\frac{z}{{y}^{3}}}\right)}\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(y, \mathsf{+.f64}\left(\mathsf{*.f64}\left(2, \left(\sqrt{\frac{z}{y}}\right)\right), \left(\color{blue}{x} \cdot \sqrt{\frac{z}{{y}^{3}}}\right)\right)\right) \]
      4. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(y, \mathsf{+.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\left(\frac{z}{y}\right)\right)\right), \left(x \cdot \sqrt{\frac{z}{{y}^{3}}}\right)\right)\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(y, \mathsf{+.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(z, y\right)\right)\right), \left(x \cdot \sqrt{\frac{z}{{y}^{3}}}\right)\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(y, \mathsf{+.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(z, y\right)\right)\right), \mathsf{*.f64}\left(x, \color{blue}{\left(\sqrt{\frac{z}{{y}^{3}}}\right)}\right)\right)\right) \]
      7. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(y, \mathsf{+.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(z, y\right)\right)\right), \mathsf{*.f64}\left(x, \mathsf{sqrt.f64}\left(\left(\frac{z}{{y}^{3}}\right)\right)\right)\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(y, \mathsf{+.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(z, y\right)\right)\right), \mathsf{*.f64}\left(x, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(z, \left({y}^{3}\right)\right)\right)\right)\right)\right) \]
      9. cube-multN/A

        \[\leadsto \mathsf{*.f64}\left(y, \mathsf{+.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(z, y\right)\right)\right), \mathsf{*.f64}\left(x, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(z, \left(y \cdot \left(y \cdot y\right)\right)\right)\right)\right)\right)\right) \]
      10. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(y, \mathsf{+.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(z, y\right)\right)\right), \mathsf{*.f64}\left(x, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(z, \left(y \cdot {y}^{2}\right)\right)\right)\right)\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(y, \mathsf{+.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(z, y\right)\right)\right), \mathsf{*.f64}\left(x, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(z, \mathsf{*.f64}\left(y, \left({y}^{2}\right)\right)\right)\right)\right)\right)\right) \]
      12. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(y, \mathsf{+.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(z, y\right)\right)\right), \mathsf{*.f64}\left(x, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(z, \mathsf{*.f64}\left(y, \left(y \cdot y\right)\right)\right)\right)\right)\right)\right) \]
      13. *-lowering-*.f6447.4%

        \[\leadsto \mathsf{*.f64}\left(y, \mathsf{+.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(z, y\right)\right)\right), \mathsf{*.f64}\left(x, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(z, \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, y\right)\right)\right)\right)\right)\right)\right) \]
    10. Simplified47.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 2.15 \cdot 10^{+25}:\\ \;\;\;\;2 \cdot \sqrt{\left(y \cdot x + z \cdot x\right) + y \cdot z}\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(2 \cdot \sqrt{\frac{z}{y}} + x \cdot \sqrt{\frac{z}{y \cdot \left(y \cdot y\right)}}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 82.9% accurate, 0.5× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 6.80000000000000002e56

    1. Initial program 73.8%

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

    if 6.80000000000000002e56 < y

    1. Initial program 42.8%

      \[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z} \]
    2. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \color{blue}{\left(\sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z}\right)}\right) \]
      2. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\left(\left(x \cdot y + x \cdot z\right) + y \cdot z\right)\right)\right) \]
      3. associate-+l+N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\left(x \cdot y + \left(x \cdot z + y \cdot z\right)\right)\right)\right) \]
      4. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(x \cdot y\right), \left(x \cdot z + y \cdot z\right)\right)\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \left(x \cdot z + y \cdot z\right)\right)\right)\right) \]
      6. distribute-rgt-outN/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \left(z \cdot \left(x + y\right)\right)\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \mathsf{*.f64}\left(z, \left(x + y\right)\right)\right)\right)\right) \]
      8. +-lowering-+.f6443.0%

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \mathsf{*.f64}\left(z, \mathsf{+.f64}\left(x, y\right)\right)\right)\right)\right) \]
    3. Simplified43.0%

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

      \[\leadsto \color{blue}{2 \cdot \sqrt{z \cdot \left(x + y\right)}} \]
    6. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \color{blue}{\left(\sqrt{z \cdot \left(x + y\right)}\right)}\right) \]
      2. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\left(z \cdot \left(x + y\right)\right)\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(z, \left(x + y\right)\right)\right)\right) \]
      4. +-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(z, \left(y + x\right)\right)\right)\right) \]
      5. +-lowering-+.f6420.3%

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(z, \mathsf{+.f64}\left(y, x\right)\right)\right)\right) \]
    7. Simplified20.3%

      \[\leadsto \color{blue}{2 \cdot \sqrt{z \cdot \left(y + x\right)}} \]
    8. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(2, \left(\sqrt{z \cdot \left(x + y\right)}\right)\right) \]
      2. flip-+N/A

        \[\leadsto \mathsf{*.f64}\left(2, \left(\sqrt{z \cdot \frac{x \cdot x - y \cdot y}{x - y}}\right)\right) \]
      3. associate-*r/N/A

        \[\leadsto \mathsf{*.f64}\left(2, \left(\sqrt{\frac{z \cdot \left(x \cdot x - y \cdot y\right)}{x - y}}\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(2, \left(\sqrt{\frac{\left(x \cdot x - y \cdot y\right) \cdot z}{x - y}}\right)\right) \]
      5. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(2, \left(\sqrt{\frac{1}{\frac{x - y}{\left(x \cdot x - y \cdot y\right) \cdot z}}}\right)\right) \]
      6. sqrt-divN/A

        \[\leadsto \mathsf{*.f64}\left(2, \left(\frac{\sqrt{1}}{\color{blue}{\sqrt{\frac{x - y}{\left(x \cdot x - y \cdot y\right) \cdot z}}}}\right)\right) \]
      7. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(2, \left(\frac{1}{\sqrt{\color{blue}{\frac{x - y}{\left(x \cdot x - y \cdot y\right) \cdot z}}}}\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \color{blue}{\left(\sqrt{\frac{x - y}{\left(x \cdot x - y \cdot y\right) \cdot z}}\right)}\right)\right) \]
      9. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \mathsf{sqrt.f64}\left(\left(\frac{x - y}{\left(x \cdot x - y \cdot y\right) \cdot z}\right)\right)\right)\right) \]
      10. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \mathsf{sqrt.f64}\left(\left(\frac{1}{\frac{\left(x \cdot x - y \cdot y\right) \cdot z}{x - y}}\right)\right)\right)\right) \]
      11. associate-*l/N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \mathsf{sqrt.f64}\left(\left(\frac{1}{\frac{x \cdot x - y \cdot y}{x - y} \cdot z}\right)\right)\right)\right) \]
      12. flip-+N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \mathsf{sqrt.f64}\left(\left(\frac{1}{\left(x + y\right) \cdot z}\right)\right)\right)\right) \]
      13. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \mathsf{sqrt.f64}\left(\left(\frac{1}{z \cdot \left(x + y\right)}\right)\right)\right)\right) \]
      14. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(z \cdot \left(x + y\right)\right)\right)\right)\right)\right) \]
      15. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(z, \left(x + y\right)\right)\right)\right)\right)\right) \]
      16. +-lowering-+.f6420.3%

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(z, \mathsf{+.f64}\left(x, y\right)\right)\right)\right)\right)\right) \]
    9. Applied egg-rr20.3%

      \[\leadsto 2 \cdot \color{blue}{\frac{1}{\sqrt{\frac{1}{z \cdot \left(x + y\right)}}}} \]
    10. Step-by-step derivation
      1. inv-powN/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \left(\sqrt{{\left(z \cdot \left(x + y\right)\right)}^{-1}}\right)\right)\right) \]
      2. sqrt-pow1N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \left({\left(z \cdot \left(x + y\right)\right)}^{\color{blue}{\left(\frac{-1}{2}\right)}}\right)\right)\right) \]
      3. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \left({\left(z \cdot \left(x + y\right)\right)}^{\frac{-1}{2}}\right)\right)\right) \]
      4. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \left({\left(z \cdot \left(x + y\right)\right)}^{\left(\frac{1}{2} \cdot \color{blue}{-1}\right)}\right)\right)\right) \]
      5. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \left({\left(\left(x + y\right) \cdot z\right)}^{\left(\color{blue}{\frac{1}{2}} \cdot -1\right)}\right)\right)\right) \]
      6. unpow-prod-downN/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \left({\left(x + y\right)}^{\left(\frac{1}{2} \cdot -1\right)} \cdot \color{blue}{{z}^{\left(\frac{1}{2} \cdot -1\right)}}\right)\right)\right) \]
      7. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \left({\left(x + y\right)}^{\left(\frac{1}{2} \cdot -1\right)} \cdot {z}^{\frac{-1}{2}}\right)\right)\right) \]
      8. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \left({\left(x + y\right)}^{\left(\frac{1}{2} \cdot -1\right)} \cdot {z}^{\left(\frac{-1}{\color{blue}{2}}\right)}\right)\right)\right) \]
      9. sqrt-pow1N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \left({\left(x + y\right)}^{\left(\frac{1}{2} \cdot -1\right)} \cdot \sqrt{{z}^{-1}}\right)\right)\right) \]
      10. inv-powN/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \left({\left(x + y\right)}^{\left(\frac{1}{2} \cdot -1\right)} \cdot \sqrt{\frac{1}{z}}\right)\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \mathsf{*.f64}\left(\left({\left(x + y\right)}^{\left(\frac{1}{2} \cdot -1\right)}\right), \color{blue}{\left(\sqrt{\frac{1}{z}}\right)}\right)\right)\right) \]
      12. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(x + y\right), \left(\frac{1}{2} \cdot -1\right)\right), \left(\sqrt{\color{blue}{\frac{1}{z}}}\right)\right)\right)\right) \]
      13. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(x, y\right), \left(\frac{1}{2} \cdot -1\right)\right), \left(\sqrt{\frac{\color{blue}{1}}{z}}\right)\right)\right)\right) \]
      14. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(x, y\right), \frac{-1}{2}\right), \left(\sqrt{\frac{1}{\color{blue}{z}}}\right)\right)\right)\right) \]
      15. inv-powN/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(x, y\right), \frac{-1}{2}\right), \left(\sqrt{{z}^{-1}}\right)\right)\right)\right) \]
      16. sqrt-pow1N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(x, y\right), \frac{-1}{2}\right), \left({z}^{\color{blue}{\left(\frac{-1}{2}\right)}}\right)\right)\right)\right) \]
      17. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(x, y\right), \frac{-1}{2}\right), \left({z}^{\frac{-1}{2}}\right)\right)\right)\right) \]
      18. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(x, y\right), \frac{-1}{2}\right), \left({z}^{\left(\frac{1}{2} \cdot \color{blue}{-1}\right)}\right)\right)\right)\right) \]
      19. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(x, y\right), \frac{-1}{2}\right), \mathsf{pow.f64}\left(z, \color{blue}{\left(\frac{1}{2} \cdot -1\right)}\right)\right)\right)\right) \]
      20. metadata-eval52.2%

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(x, y\right), \frac{-1}{2}\right), \mathsf{pow.f64}\left(z, \frac{-1}{2}\right)\right)\right)\right) \]
    11. Applied egg-rr52.2%

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

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

Alternative 5: 83.6% accurate, 0.5× speedup?

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

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


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

    1. Initial program 73.7%

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

    if 4.5999999999999999e-27 < y

    1. Initial program 51.0%

      \[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z} \]
    2. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \color{blue}{\left(\sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z}\right)}\right) \]
      2. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\left(\left(x \cdot y + x \cdot z\right) + y \cdot z\right)\right)\right) \]
      3. associate-+l+N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\left(x \cdot y + \left(x \cdot z + y \cdot z\right)\right)\right)\right) \]
      4. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(x \cdot y\right), \left(x \cdot z + y \cdot z\right)\right)\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \left(x \cdot z + y \cdot z\right)\right)\right)\right) \]
      6. distribute-rgt-outN/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \left(z \cdot \left(x + y\right)\right)\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \mathsf{*.f64}\left(z, \left(x + y\right)\right)\right)\right)\right) \]
      8. +-lowering-+.f6451.2%

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \mathsf{*.f64}\left(z, \mathsf{+.f64}\left(x, y\right)\right)\right)\right)\right) \]
    3. Simplified51.2%

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

      \[\leadsto \color{blue}{2 \cdot \sqrt{z \cdot \left(x + y\right)}} \]
    6. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \color{blue}{\left(\sqrt{z \cdot \left(x + y\right)}\right)}\right) \]
      2. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\left(z \cdot \left(x + y\right)\right)\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(z, \left(x + y\right)\right)\right)\right) \]
      4. +-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(z, \left(y + x\right)\right)\right)\right) \]
      5. +-lowering-+.f6423.5%

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(z, \mathsf{+.f64}\left(y, x\right)\right)\right)\right) \]
    7. Simplified23.5%

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

        \[\leadsto 2 \cdot {\left(z \cdot \left(y + x\right)\right)}^{\color{blue}{\frac{1}{2}}} \]
      2. +-commutativeN/A

        \[\leadsto 2 \cdot {\left(z \cdot \left(x + y\right)\right)}^{\frac{1}{2}} \]
      3. metadata-evalN/A

        \[\leadsto 2 \cdot {\left(z \cdot \left(x + y\right)\right)}^{\left(\frac{1}{4} \cdot \color{blue}{2}\right)} \]
      4. unpow-prod-downN/A

        \[\leadsto 2 \cdot \left({z}^{\left(\frac{1}{4} \cdot 2\right)} \cdot \color{blue}{{\left(x + y\right)}^{\left(\frac{1}{4} \cdot 2\right)}}\right) \]
      5. associate-*r*N/A

        \[\leadsto \left(2 \cdot {z}^{\left(\frac{1}{4} \cdot 2\right)}\right) \cdot \color{blue}{{\left(x + y\right)}^{\left(\frac{1}{4} \cdot 2\right)}} \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(2 \cdot {z}^{\left(\frac{1}{4} \cdot 2\right)}\right), \color{blue}{\left({\left(x + y\right)}^{\left(\frac{1}{4} \cdot 2\right)}\right)}\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \left({z}^{\left(\frac{1}{4} \cdot 2\right)}\right)\right), \left({\color{blue}{\left(x + y\right)}}^{\left(\frac{1}{4} \cdot 2\right)}\right)\right) \]
      8. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \left({z}^{\frac{1}{2}}\right)\right), \left({\left(x + y\right)}^{\left(\frac{1}{4} \cdot 2\right)}\right)\right) \]
      9. pow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \left(\sqrt{z}\right)\right), \left({\left(x + \color{blue}{y}\right)}^{\left(\frac{1}{4} \cdot 2\right)}\right)\right) \]
      10. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(z\right)\right), \left({\left(x + \color{blue}{y}\right)}^{\left(\frac{1}{4} \cdot 2\right)}\right)\right) \]
      11. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(z\right)\right), \mathsf{pow.f64}\left(\left(x + y\right), \color{blue}{\left(\frac{1}{4} \cdot 2\right)}\right)\right) \]
      12. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(z\right)\right), \mathsf{pow.f64}\left(\mathsf{+.f64}\left(x, y\right), \left(\color{blue}{\frac{1}{4}} \cdot 2\right)\right)\right) \]
      13. metadata-eval49.4%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(z\right)\right), \mathsf{pow.f64}\left(\mathsf{+.f64}\left(x, y\right), \frac{1}{2}\right)\right) \]
    9. Applied egg-rr49.4%

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

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

Alternative 6: 82.7% accurate, 0.5× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 6.80000000000000002e56

    1. Initial program 73.8%

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

    if 6.80000000000000002e56 < y

    1. Initial program 42.8%

      \[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z} \]
    2. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \color{blue}{\left(\sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z}\right)}\right) \]
      2. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\left(\left(x \cdot y + x \cdot z\right) + y \cdot z\right)\right)\right) \]
      3. associate-+l+N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\left(x \cdot y + \left(x \cdot z + y \cdot z\right)\right)\right)\right) \]
      4. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(x \cdot y\right), \left(x \cdot z + y \cdot z\right)\right)\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \left(x \cdot z + y \cdot z\right)\right)\right)\right) \]
      6. distribute-rgt-outN/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \left(z \cdot \left(x + y\right)\right)\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \mathsf{*.f64}\left(z, \left(x + y\right)\right)\right)\right)\right) \]
      8. +-lowering-+.f6443.0%

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \mathsf{*.f64}\left(z, \mathsf{+.f64}\left(x, y\right)\right)\right)\right)\right) \]
    3. Simplified43.0%

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

      \[\leadsto \color{blue}{2 \cdot \sqrt{z \cdot \left(x + y\right)}} \]
    6. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \color{blue}{\left(\sqrt{z \cdot \left(x + y\right)}\right)}\right) \]
      2. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\left(z \cdot \left(x + y\right)\right)\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(z, \left(x + y\right)\right)\right)\right) \]
      4. +-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(z, \left(y + x\right)\right)\right)\right) \]
      5. +-lowering-+.f6420.3%

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(z, \mathsf{+.f64}\left(y, x\right)\right)\right)\right) \]
    7. Simplified20.3%

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

      \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(z, \color{blue}{y}\right)\right)\right) \]
    9. Step-by-step derivation
      1. Simplified20.3%

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

          \[\leadsto 2 \cdot {\left(z \cdot y\right)}^{\color{blue}{\frac{1}{2}}} \]
        2. unpow-prod-downN/A

          \[\leadsto 2 \cdot \left({z}^{\frac{1}{2}} \cdot \color{blue}{{y}^{\frac{1}{2}}}\right) \]
        3. associate-*r*N/A

          \[\leadsto \left(2 \cdot {z}^{\frac{1}{2}}\right) \cdot \color{blue}{{y}^{\frac{1}{2}}} \]
        4. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\left(2 \cdot {z}^{\frac{1}{2}}\right), \color{blue}{\left({y}^{\frac{1}{2}}\right)}\right) \]
        5. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \left({z}^{\frac{1}{2}}\right)\right), \left({\color{blue}{y}}^{\frac{1}{2}}\right)\right) \]
        6. pow1/2N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \left(\sqrt{z}\right)\right), \left({y}^{\frac{1}{2}}\right)\right) \]
        7. sqrt-lowering-sqrt.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(z\right)\right), \left({y}^{\frac{1}{2}}\right)\right) \]
        8. pow1/2N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(z\right)\right), \left(\sqrt{y}\right)\right) \]
        9. sqrt-lowering-sqrt.f6448.6%

          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(z\right)\right), \mathsf{sqrt.f64}\left(y\right)\right) \]
      3. Applied egg-rr48.6%

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 6.8 \cdot 10^{+56}:\\ \;\;\;\;2 \cdot \sqrt{\left(y \cdot x + z \cdot x\right) + y \cdot z}\\ \mathbf{else}:\\ \;\;\;\;\left(2 \cdot \sqrt{z}\right) \cdot \sqrt{y}\\ \end{array} \]
    12. Add Preprocessing

    Alternative 7: 71.0% accurate, 1.0× speedup?

    \[\begin{array}{l} [x, y, z] = \mathsf{sort}([x, y, z])\\ \\ \begin{array}{l} \mathbf{if}\;y \leq 8.8 \cdot 10^{+56}:\\ \;\;\;\;2 \cdot \sqrt{\left(y \cdot x + z \cdot x\right) + y \cdot z}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \frac{1}{\sqrt{\frac{\frac{1}{y + x}}{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 8.8e+56)
       (* 2.0 (sqrt (+ (+ (* y x) (* z x)) (* y z))))
       (* 2.0 (/ 1.0 (sqrt (/ (/ 1.0 (+ y x)) z))))))
    assert(x < y && y < z);
    double code(double x, double y, double z) {
    	double tmp;
    	if (y <= 8.8e+56) {
    		tmp = 2.0 * sqrt((((y * x) + (z * x)) + (y * z)));
    	} else {
    		tmp = 2.0 * (1.0 / sqrt(((1.0 / (y + x)) / 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 <= 8.8d+56) then
            tmp = 2.0d0 * sqrt((((y * x) + (z * x)) + (y * z)))
        else
            tmp = 2.0d0 * (1.0d0 / sqrt(((1.0d0 / (y + x)) / 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 <= 8.8e+56) {
    		tmp = 2.0 * Math.sqrt((((y * x) + (z * x)) + (y * z)));
    	} else {
    		tmp = 2.0 * (1.0 / Math.sqrt(((1.0 / (y + x)) / z)));
    	}
    	return tmp;
    }
    
    [x, y, z] = sort([x, y, z])
    def code(x, y, z):
    	tmp = 0
    	if y <= 8.8e+56:
    		tmp = 2.0 * math.sqrt((((y * x) + (z * x)) + (y * z)))
    	else:
    		tmp = 2.0 * (1.0 / math.sqrt(((1.0 / (y + x)) / z)))
    	return tmp
    
    x, y, z = sort([x, y, z])
    function code(x, y, z)
    	tmp = 0.0
    	if (y <= 8.8e+56)
    		tmp = Float64(2.0 * sqrt(Float64(Float64(Float64(y * x) + Float64(z * x)) + Float64(y * z))));
    	else
    		tmp = Float64(2.0 * Float64(1.0 / sqrt(Float64(Float64(1.0 / Float64(y + x)) / 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 <= 8.8e+56)
    		tmp = 2.0 * sqrt((((y * x) + (z * x)) + (y * z)));
    	else
    		tmp = 2.0 * (1.0 / sqrt(((1.0 / (y + x)) / 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, 8.8e+56], N[(2.0 * N[Sqrt[N[(N[(N[(y * x), $MachinePrecision] + N[(z * x), $MachinePrecision]), $MachinePrecision] + N[(y * z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(1.0 / N[Sqrt[N[(N[(1.0 / N[(y + x), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
    
    \begin{array}{l}
    [x, y, z] = \mathsf{sort}([x, y, z])\\
    \\
    \begin{array}{l}
    \mathbf{if}\;y \leq 8.8 \cdot 10^{+56}:\\
    \;\;\;\;2 \cdot \sqrt{\left(y \cdot x + z \cdot x\right) + y \cdot z}\\
    
    \mathbf{else}:\\
    \;\;\;\;2 \cdot \frac{1}{\sqrt{\frac{\frac{1}{y + x}}{z}}}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if y < 8.80000000000000063e56

      1. Initial program 73.8%

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

      if 8.80000000000000063e56 < y

      1. Initial program 42.8%

        \[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z} \]
      2. Step-by-step derivation
        1. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(2, \color{blue}{\left(\sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z}\right)}\right) \]
        2. sqrt-lowering-sqrt.f64N/A

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\left(\left(x \cdot y + x \cdot z\right) + y \cdot z\right)\right)\right) \]
        3. associate-+l+N/A

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\left(x \cdot y + \left(x \cdot z + y \cdot z\right)\right)\right)\right) \]
        4. +-lowering-+.f64N/A

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(x \cdot y\right), \left(x \cdot z + y \cdot z\right)\right)\right)\right) \]
        5. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \left(x \cdot z + y \cdot z\right)\right)\right)\right) \]
        6. distribute-rgt-outN/A

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \left(z \cdot \left(x + y\right)\right)\right)\right)\right) \]
        7. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \mathsf{*.f64}\left(z, \left(x + y\right)\right)\right)\right)\right) \]
        8. +-lowering-+.f6443.0%

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \mathsf{*.f64}\left(z, \mathsf{+.f64}\left(x, y\right)\right)\right)\right)\right) \]
      3. Simplified43.0%

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

        \[\leadsto \color{blue}{2 \cdot \sqrt{z \cdot \left(x + y\right)}} \]
      6. Step-by-step derivation
        1. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(2, \color{blue}{\left(\sqrt{z \cdot \left(x + y\right)}\right)}\right) \]
        2. sqrt-lowering-sqrt.f64N/A

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\left(z \cdot \left(x + y\right)\right)\right)\right) \]
        3. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(z, \left(x + y\right)\right)\right)\right) \]
        4. +-commutativeN/A

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(z, \left(y + x\right)\right)\right)\right) \]
        5. +-lowering-+.f6420.3%

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(z, \mathsf{+.f64}\left(y, x\right)\right)\right)\right) \]
      7. Simplified20.3%

        \[\leadsto \color{blue}{2 \cdot \sqrt{z \cdot \left(y + x\right)}} \]
      8. Step-by-step derivation
        1. +-commutativeN/A

          \[\leadsto \mathsf{*.f64}\left(2, \left(\sqrt{z \cdot \left(x + y\right)}\right)\right) \]
        2. flip-+N/A

          \[\leadsto \mathsf{*.f64}\left(2, \left(\sqrt{z \cdot \frac{x \cdot x - y \cdot y}{x - y}}\right)\right) \]
        3. associate-*r/N/A

          \[\leadsto \mathsf{*.f64}\left(2, \left(\sqrt{\frac{z \cdot \left(x \cdot x - y \cdot y\right)}{x - y}}\right)\right) \]
        4. *-commutativeN/A

          \[\leadsto \mathsf{*.f64}\left(2, \left(\sqrt{\frac{\left(x \cdot x - y \cdot y\right) \cdot z}{x - y}}\right)\right) \]
        5. clear-numN/A

          \[\leadsto \mathsf{*.f64}\left(2, \left(\sqrt{\frac{1}{\frac{x - y}{\left(x \cdot x - y \cdot y\right) \cdot z}}}\right)\right) \]
        6. sqrt-divN/A

          \[\leadsto \mathsf{*.f64}\left(2, \left(\frac{\sqrt{1}}{\color{blue}{\sqrt{\frac{x - y}{\left(x \cdot x - y \cdot y\right) \cdot z}}}}\right)\right) \]
        7. metadata-evalN/A

          \[\leadsto \mathsf{*.f64}\left(2, \left(\frac{1}{\sqrt{\color{blue}{\frac{x - y}{\left(x \cdot x - y \cdot y\right) \cdot z}}}}\right)\right) \]
        8. /-lowering-/.f64N/A

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \color{blue}{\left(\sqrt{\frac{x - y}{\left(x \cdot x - y \cdot y\right) \cdot z}}\right)}\right)\right) \]
        9. sqrt-lowering-sqrt.f64N/A

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \mathsf{sqrt.f64}\left(\left(\frac{x - y}{\left(x \cdot x - y \cdot y\right) \cdot z}\right)\right)\right)\right) \]
        10. clear-numN/A

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \mathsf{sqrt.f64}\left(\left(\frac{1}{\frac{\left(x \cdot x - y \cdot y\right) \cdot z}{x - y}}\right)\right)\right)\right) \]
        11. associate-*l/N/A

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \mathsf{sqrt.f64}\left(\left(\frac{1}{\frac{x \cdot x - y \cdot y}{x - y} \cdot z}\right)\right)\right)\right) \]
        12. flip-+N/A

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \mathsf{sqrt.f64}\left(\left(\frac{1}{\left(x + y\right) \cdot z}\right)\right)\right)\right) \]
        13. *-commutativeN/A

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \mathsf{sqrt.f64}\left(\left(\frac{1}{z \cdot \left(x + y\right)}\right)\right)\right)\right) \]
        14. /-lowering-/.f64N/A

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(z \cdot \left(x + y\right)\right)\right)\right)\right)\right) \]
        15. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(z, \left(x + y\right)\right)\right)\right)\right)\right) \]
        16. +-lowering-+.f6420.3%

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(z, \mathsf{+.f64}\left(x, y\right)\right)\right)\right)\right)\right) \]
      9. Applied egg-rr20.3%

        \[\leadsto 2 \cdot \color{blue}{\frac{1}{\sqrt{\frac{1}{z \cdot \left(x + y\right)}}}} \]
      10. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \mathsf{sqrt.f64}\left(\left(\frac{1}{\left(x + y\right) \cdot z}\right)\right)\right)\right) \]
        2. associate-/r*N/A

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{x + y}}{z}\right)\right)\right)\right) \]
        3. /-lowering-/.f64N/A

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{x + y}\right), z\right)\right)\right)\right) \]
        4. /-lowering-/.f64N/A

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \left(x + y\right)\right), z\right)\right)\right)\right) \]
        5. +-lowering-+.f6426.9%

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(x, y\right)\right), z\right)\right)\right)\right) \]
      11. Applied egg-rr26.9%

        \[\leadsto 2 \cdot \frac{1}{\sqrt{\color{blue}{\frac{\frac{1}{x + y}}{z}}}} \]
    3. Recombined 2 regimes into one program.
    4. Final simplification64.6%

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

    Alternative 8: 71.1% accurate, 1.0× speedup?

    \[\begin{array}{l} [x, y, z] = \mathsf{sort}([x, y, z])\\ \\ \begin{array}{l} \mathbf{if}\;z \leq 1.02 \cdot 10^{+91}:\\ \;\;\;\;2 \cdot \sqrt{y \cdot x + z \cdot \left(y + x\right)}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \frac{1}{\sqrt{\frac{\frac{1}{y + x}}{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 (<= z 1.02e+91)
       (* 2.0 (sqrt (+ (* y x) (* z (+ y x)))))
       (* 2.0 (/ 1.0 (sqrt (/ (/ 1.0 (+ y x)) z))))))
    assert(x < y && y < z);
    double code(double x, double y, double z) {
    	double tmp;
    	if (z <= 1.02e+91) {
    		tmp = 2.0 * sqrt(((y * x) + (z * (y + x))));
    	} else {
    		tmp = 2.0 * (1.0 / sqrt(((1.0 / (y + x)) / 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 (z <= 1.02d+91) then
            tmp = 2.0d0 * sqrt(((y * x) + (z * (y + x))))
        else
            tmp = 2.0d0 * (1.0d0 / sqrt(((1.0d0 / (y + x)) / 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 (z <= 1.02e+91) {
    		tmp = 2.0 * Math.sqrt(((y * x) + (z * (y + x))));
    	} else {
    		tmp = 2.0 * (1.0 / Math.sqrt(((1.0 / (y + x)) / z)));
    	}
    	return tmp;
    }
    
    [x, y, z] = sort([x, y, z])
    def code(x, y, z):
    	tmp = 0
    	if z <= 1.02e+91:
    		tmp = 2.0 * math.sqrt(((y * x) + (z * (y + x))))
    	else:
    		tmp = 2.0 * (1.0 / math.sqrt(((1.0 / (y + x)) / z)))
    	return tmp
    
    x, y, z = sort([x, y, z])
    function code(x, y, z)
    	tmp = 0.0
    	if (z <= 1.02e+91)
    		tmp = Float64(2.0 * sqrt(Float64(Float64(y * x) + Float64(z * Float64(y + x)))));
    	else
    		tmp = Float64(2.0 * Float64(1.0 / sqrt(Float64(Float64(1.0 / Float64(y + x)) / z))));
    	end
    	return tmp
    end
    
    x, y, z = num2cell(sort([x, y, z])){:}
    function tmp_2 = code(x, y, z)
    	tmp = 0.0;
    	if (z <= 1.02e+91)
    		tmp = 2.0 * sqrt(((y * x) + (z * (y + x))));
    	else
    		tmp = 2.0 * (1.0 / sqrt(((1.0 / (y + x)) / 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[z, 1.02e+91], N[(2.0 * N[Sqrt[N[(N[(y * x), $MachinePrecision] + N[(z * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(1.0 / N[Sqrt[N[(N[(1.0 / N[(y + x), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
    
    \begin{array}{l}
    [x, y, z] = \mathsf{sort}([x, y, z])\\
    \\
    \begin{array}{l}
    \mathbf{if}\;z \leq 1.02 \cdot 10^{+91}:\\
    \;\;\;\;2 \cdot \sqrt{y \cdot x + z \cdot \left(y + x\right)}\\
    
    \mathbf{else}:\\
    \;\;\;\;2 \cdot \frac{1}{\sqrt{\frac{\frac{1}{y + x}}{z}}}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if z < 1.01999999999999992e91

      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. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(2, \color{blue}{\left(\sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z}\right)}\right) \]
        2. sqrt-lowering-sqrt.f64N/A

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\left(\left(x \cdot y + x \cdot z\right) + y \cdot z\right)\right)\right) \]
        3. associate-+l+N/A

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\left(x \cdot y + \left(x \cdot z + y \cdot z\right)\right)\right)\right) \]
        4. +-lowering-+.f64N/A

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(x \cdot y\right), \left(x \cdot z + y \cdot z\right)\right)\right)\right) \]
        5. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \left(x \cdot z + y \cdot z\right)\right)\right)\right) \]
        6. distribute-rgt-outN/A

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \left(z \cdot \left(x + y\right)\right)\right)\right)\right) \]
        7. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \mathsf{*.f64}\left(z, \left(x + y\right)\right)\right)\right)\right) \]
        8. +-lowering-+.f6474.2%

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \mathsf{*.f64}\left(z, \mathsf{+.f64}\left(x, y\right)\right)\right)\right)\right) \]
      3. Simplified74.2%

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

      if 1.01999999999999992e91 < z

      1. Initial program 38.0%

        \[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z} \]
      2. Step-by-step derivation
        1. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(2, \color{blue}{\left(\sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z}\right)}\right) \]
        2. sqrt-lowering-sqrt.f64N/A

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\left(\left(x \cdot y + x \cdot z\right) + y \cdot z\right)\right)\right) \]
        3. associate-+l+N/A

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\left(x \cdot y + \left(x \cdot z + y \cdot z\right)\right)\right)\right) \]
        4. +-lowering-+.f64N/A

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(x \cdot y\right), \left(x \cdot z + y \cdot z\right)\right)\right)\right) \]
        5. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \left(x \cdot z + y \cdot z\right)\right)\right)\right) \]
        6. distribute-rgt-outN/A

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \left(z \cdot \left(x + y\right)\right)\right)\right)\right) \]
        7. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \mathsf{*.f64}\left(z, \left(x + y\right)\right)\right)\right)\right) \]
        8. +-lowering-+.f6438.2%

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \mathsf{*.f64}\left(z, \mathsf{+.f64}\left(x, y\right)\right)\right)\right)\right) \]
      3. Simplified38.2%

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

        \[\leadsto \color{blue}{2 \cdot \sqrt{z \cdot \left(x + y\right)}} \]
      6. Step-by-step derivation
        1. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(2, \color{blue}{\left(\sqrt{z \cdot \left(x + y\right)}\right)}\right) \]
        2. sqrt-lowering-sqrt.f64N/A

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\left(z \cdot \left(x + y\right)\right)\right)\right) \]
        3. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(z, \left(x + y\right)\right)\right)\right) \]
        4. +-commutativeN/A

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(z, \left(y + x\right)\right)\right)\right) \]
        5. +-lowering-+.f6438.4%

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(z, \mathsf{+.f64}\left(y, x\right)\right)\right)\right) \]
      7. Simplified38.4%

        \[\leadsto \color{blue}{2 \cdot \sqrt{z \cdot \left(y + x\right)}} \]
      8. Step-by-step derivation
        1. +-commutativeN/A

          \[\leadsto \mathsf{*.f64}\left(2, \left(\sqrt{z \cdot \left(x + y\right)}\right)\right) \]
        2. flip-+N/A

          \[\leadsto \mathsf{*.f64}\left(2, \left(\sqrt{z \cdot \frac{x \cdot x - y \cdot y}{x - y}}\right)\right) \]
        3. associate-*r/N/A

          \[\leadsto \mathsf{*.f64}\left(2, \left(\sqrt{\frac{z \cdot \left(x \cdot x - y \cdot y\right)}{x - y}}\right)\right) \]
        4. *-commutativeN/A

          \[\leadsto \mathsf{*.f64}\left(2, \left(\sqrt{\frac{\left(x \cdot x - y \cdot y\right) \cdot z}{x - y}}\right)\right) \]
        5. clear-numN/A

          \[\leadsto \mathsf{*.f64}\left(2, \left(\sqrt{\frac{1}{\frac{x - y}{\left(x \cdot x - y \cdot y\right) \cdot z}}}\right)\right) \]
        6. sqrt-divN/A

          \[\leadsto \mathsf{*.f64}\left(2, \left(\frac{\sqrt{1}}{\color{blue}{\sqrt{\frac{x - y}{\left(x \cdot x - y \cdot y\right) \cdot z}}}}\right)\right) \]
        7. metadata-evalN/A

          \[\leadsto \mathsf{*.f64}\left(2, \left(\frac{1}{\sqrt{\color{blue}{\frac{x - y}{\left(x \cdot x - y \cdot y\right) \cdot z}}}}\right)\right) \]
        8. /-lowering-/.f64N/A

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \color{blue}{\left(\sqrt{\frac{x - y}{\left(x \cdot x - y \cdot y\right) \cdot z}}\right)}\right)\right) \]
        9. sqrt-lowering-sqrt.f64N/A

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \mathsf{sqrt.f64}\left(\left(\frac{x - y}{\left(x \cdot x - y \cdot y\right) \cdot z}\right)\right)\right)\right) \]
        10. clear-numN/A

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \mathsf{sqrt.f64}\left(\left(\frac{1}{\frac{\left(x \cdot x - y \cdot y\right) \cdot z}{x - y}}\right)\right)\right)\right) \]
        11. associate-*l/N/A

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \mathsf{sqrt.f64}\left(\left(\frac{1}{\frac{x \cdot x - y \cdot y}{x - y} \cdot z}\right)\right)\right)\right) \]
        12. flip-+N/A

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \mathsf{sqrt.f64}\left(\left(\frac{1}{\left(x + y\right) \cdot z}\right)\right)\right)\right) \]
        13. *-commutativeN/A

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \mathsf{sqrt.f64}\left(\left(\frac{1}{z \cdot \left(x + y\right)}\right)\right)\right)\right) \]
        14. /-lowering-/.f64N/A

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(z \cdot \left(x + y\right)\right)\right)\right)\right)\right) \]
        15. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(z, \left(x + y\right)\right)\right)\right)\right)\right) \]
        16. +-lowering-+.f6438.2%

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(z, \mathsf{+.f64}\left(x, y\right)\right)\right)\right)\right)\right) \]
      9. Applied egg-rr38.2%

        \[\leadsto 2 \cdot \color{blue}{\frac{1}{\sqrt{\frac{1}{z \cdot \left(x + y\right)}}}} \]
      10. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \mathsf{sqrt.f64}\left(\left(\frac{1}{\left(x + y\right) \cdot z}\right)\right)\right)\right) \]
        2. associate-/r*N/A

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{x + y}}{z}\right)\right)\right)\right) \]
        3. /-lowering-/.f64N/A

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{x + y}\right), z\right)\right)\right)\right) \]
        4. /-lowering-/.f64N/A

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \left(x + y\right)\right), z\right)\right)\right)\right) \]
        5. +-lowering-+.f6445.8%

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(1, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(x, y\right)\right), z\right)\right)\right)\right) \]
      11. Applied egg-rr45.8%

        \[\leadsto 2 \cdot \frac{1}{\sqrt{\color{blue}{\frac{\frac{1}{x + y}}{z}}}} \]
    3. Recombined 2 regimes into one program.
    4. Final simplification69.1%

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

    Alternative 9: 70.6% accurate, 1.0× speedup?

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

      1. Initial program 67.1%

        \[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z} \]
      2. Step-by-step derivation
        1. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(2, \color{blue}{\left(\sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z}\right)}\right) \]
        2. sqrt-lowering-sqrt.f64N/A

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\left(\left(x \cdot y + x \cdot z\right) + y \cdot z\right)\right)\right) \]
        3. associate-+l+N/A

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\left(x \cdot y + \left(x \cdot z + y \cdot z\right)\right)\right)\right) \]
        4. +-lowering-+.f64N/A

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(x \cdot y\right), \left(x \cdot z + y \cdot z\right)\right)\right)\right) \]
        5. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \left(x \cdot z + y \cdot z\right)\right)\right)\right) \]
        6. distribute-rgt-outN/A

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \left(z \cdot \left(x + y\right)\right)\right)\right)\right) \]
        7. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \mathsf{*.f64}\left(z, \left(x + y\right)\right)\right)\right)\right) \]
        8. +-lowering-+.f6467.1%

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \mathsf{*.f64}\left(z, \mathsf{+.f64}\left(x, y\right)\right)\right)\right)\right) \]
      3. Simplified67.1%

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

        \[\leadsto \color{blue}{2 \cdot \sqrt{x \cdot \left(y + z\right)}} \]
      6. Step-by-step derivation
        1. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(2, \color{blue}{\left(\sqrt{x \cdot \left(y + z\right)}\right)}\right) \]
        2. sqrt-lowering-sqrt.f64N/A

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\left(x \cdot \left(y + z\right)\right)\right)\right) \]
        3. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(x, \left(y + z\right)\right)\right)\right) \]
        4. +-lowering-+.f6438.9%

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(y, z\right)\right)\right)\right) \]
      7. Simplified38.9%

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

      if -4.0000000000000002e-292 < y

      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. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(2, \color{blue}{\left(\sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z}\right)}\right) \]
        2. sqrt-lowering-sqrt.f64N/A

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\left(\left(x \cdot y + x \cdot z\right) + y \cdot z\right)\right)\right) \]
        3. associate-+l+N/A

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\left(x \cdot y + \left(x \cdot z + y \cdot z\right)\right)\right)\right) \]
        4. +-lowering-+.f64N/A

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(x \cdot y\right), \left(x \cdot z + y \cdot z\right)\right)\right)\right) \]
        5. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \left(x \cdot z + y \cdot z\right)\right)\right)\right) \]
        6. distribute-rgt-outN/A

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \left(z \cdot \left(x + y\right)\right)\right)\right)\right) \]
        7. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \mathsf{*.f64}\left(z, \left(x + y\right)\right)\right)\right)\right) \]
        8. +-lowering-+.f6468.4%

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \mathsf{*.f64}\left(z, \mathsf{+.f64}\left(x, y\right)\right)\right)\right)\right) \]
      3. Simplified68.4%

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

        \[\leadsto \color{blue}{2 \cdot \sqrt{z \cdot \left(x + y\right)}} \]
      6. Step-by-step derivation
        1. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(2, \color{blue}{\left(\sqrt{z \cdot \left(x + y\right)}\right)}\right) \]
        2. sqrt-lowering-sqrt.f64N/A

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\left(z \cdot \left(x + y\right)\right)\right)\right) \]
        3. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(z, \left(x + y\right)\right)\right)\right) \]
        4. +-commutativeN/A

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(z, \left(y + x\right)\right)\right)\right) \]
        5. +-lowering-+.f6442.8%

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(z, \mathsf{+.f64}\left(y, x\right)\right)\right)\right) \]
      7. Simplified42.8%

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

    Alternative 10: 69.4% accurate, 1.0× speedup?

    \[\begin{array}{l} [x, y, z] = \mathsf{sort}([x, y, z])\\ \\ \begin{array}{l} \mathbf{if}\;y \leq -3.05 \cdot 10^{-298}:\\ \;\;\;\;2 \cdot \sqrt{x \cdot \left(y + z\right)}\\ \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 -3.05e-298) (* 2.0 (sqrt (* x (+ y z)))) (* 2.0 (sqrt (* y z)))))
    assert(x < y && y < z);
    double code(double x, double y, double z) {
    	double tmp;
    	if (y <= -3.05e-298) {
    		tmp = 2.0 * sqrt((x * (y + z)));
    	} 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 <= (-3.05d-298)) then
            tmp = 2.0d0 * sqrt((x * (y + z)))
        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 <= -3.05e-298) {
    		tmp = 2.0 * Math.sqrt((x * (y + z)));
    	} 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 <= -3.05e-298:
    		tmp = 2.0 * math.sqrt((x * (y + z)))
    	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 <= -3.05e-298)
    		tmp = Float64(2.0 * sqrt(Float64(x * Float64(y + z))));
    	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 <= -3.05e-298)
    		tmp = 2.0 * sqrt((x * (y + z)));
    	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, -3.05e-298], N[(2.0 * N[Sqrt[N[(x * N[(y + z), $MachinePrecision]), $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 -3.05 \cdot 10^{-298}:\\
    \;\;\;\;2 \cdot \sqrt{x \cdot \left(y + z\right)}\\
    
    \mathbf{else}:\\
    \;\;\;\;2 \cdot \sqrt{y \cdot z}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if y < -3.05000000000000006e-298

      1. Initial program 67.3%

        \[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z} \]
      2. Step-by-step derivation
        1. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(2, \color{blue}{\left(\sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z}\right)}\right) \]
        2. sqrt-lowering-sqrt.f64N/A

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\left(\left(x \cdot y + x \cdot z\right) + y \cdot z\right)\right)\right) \]
        3. associate-+l+N/A

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\left(x \cdot y + \left(x \cdot z + y \cdot z\right)\right)\right)\right) \]
        4. +-lowering-+.f64N/A

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(x \cdot y\right), \left(x \cdot z + y \cdot z\right)\right)\right)\right) \]
        5. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \left(x \cdot z + y \cdot z\right)\right)\right)\right) \]
        6. distribute-rgt-outN/A

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \left(z \cdot \left(x + y\right)\right)\right)\right)\right) \]
        7. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \mathsf{*.f64}\left(z, \left(x + y\right)\right)\right)\right)\right) \]
        8. +-lowering-+.f6467.3%

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \mathsf{*.f64}\left(z, \mathsf{+.f64}\left(x, y\right)\right)\right)\right)\right) \]
      3. Simplified67.3%

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

        \[\leadsto \color{blue}{2 \cdot \sqrt{x \cdot \left(y + z\right)}} \]
      6. Step-by-step derivation
        1. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(2, \color{blue}{\left(\sqrt{x \cdot \left(y + z\right)}\right)}\right) \]
        2. sqrt-lowering-sqrt.f64N/A

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\left(x \cdot \left(y + z\right)\right)\right)\right) \]
        3. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(x, \left(y + z\right)\right)\right)\right) \]
        4. +-lowering-+.f6439.3%

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(y, z\right)\right)\right)\right) \]
      7. Simplified39.3%

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

      if -3.05000000000000006e-298 < y

      1. Initial program 68.1%

        \[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z} \]
      2. Step-by-step derivation
        1. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(2, \color{blue}{\left(\sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z}\right)}\right) \]
        2. sqrt-lowering-sqrt.f64N/A

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\left(\left(x \cdot y + x \cdot z\right) + y \cdot z\right)\right)\right) \]
        3. associate-+l+N/A

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\left(x \cdot y + \left(x \cdot z + y \cdot z\right)\right)\right)\right) \]
        4. +-lowering-+.f64N/A

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(x \cdot y\right), \left(x \cdot z + y \cdot z\right)\right)\right)\right) \]
        5. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \left(x \cdot z + y \cdot z\right)\right)\right)\right) \]
        6. distribute-rgt-outN/A

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \left(z \cdot \left(x + y\right)\right)\right)\right)\right) \]
        7. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \mathsf{*.f64}\left(z, \left(x + y\right)\right)\right)\right)\right) \]
        8. +-lowering-+.f6468.1%

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \mathsf{*.f64}\left(z, \mathsf{+.f64}\left(x, y\right)\right)\right)\right)\right) \]
      3. Simplified68.1%

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

        \[\leadsto \color{blue}{2 \cdot \sqrt{y \cdot z}} \]
      6. Step-by-step derivation
        1. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(2, \color{blue}{\left(\sqrt{y \cdot z}\right)}\right) \]
        2. sqrt-lowering-sqrt.f64N/A

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\left(y \cdot z\right)\right)\right) \]
        3. *-lowering-*.f6419.0%

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(y, z\right)\right)\right) \]
      7. Simplified19.0%

        \[\leadsto \color{blue}{2 \cdot \sqrt{y \cdot z}} \]
    3. Recombined 2 regimes into one program.
    4. Add Preprocessing

    Alternative 11: 70.6% accurate, 1.0× speedup?

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

      \[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z} \]
    2. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \color{blue}{\left(\sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z}\right)}\right) \]
      2. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\left(\left(x \cdot y + x \cdot z\right) + y \cdot z\right)\right)\right) \]
      3. associate-+l+N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\left(x \cdot y + \left(x \cdot z + y \cdot z\right)\right)\right)\right) \]
      4. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(x \cdot y\right), \left(x \cdot z + y \cdot z\right)\right)\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \left(x \cdot z + y \cdot z\right)\right)\right)\right) \]
      6. distribute-rgt-outN/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \left(z \cdot \left(x + y\right)\right)\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \mathsf{*.f64}\left(z, \left(x + y\right)\right)\right)\right)\right) \]
      8. +-lowering-+.f6467.7%

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \mathsf{*.f64}\left(z, \mathsf{+.f64}\left(x, y\right)\right)\right)\right)\right) \]
    3. Simplified67.7%

      \[\leadsto \color{blue}{2 \cdot \sqrt{x \cdot y + z \cdot \left(x + y\right)}} \]
    4. Add Preprocessing
    5. Final simplification67.7%

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

    Alternative 12: 68.3% accurate, 1.0× speedup?

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

      1. Initial program 67.3%

        \[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z} \]
      2. Step-by-step derivation
        1. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(2, \color{blue}{\left(\sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z}\right)}\right) \]
        2. sqrt-lowering-sqrt.f64N/A

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\left(\left(x \cdot y + x \cdot z\right) + y \cdot z\right)\right)\right) \]
        3. associate-+l+N/A

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\left(x \cdot y + \left(x \cdot z + y \cdot z\right)\right)\right)\right) \]
        4. +-lowering-+.f64N/A

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(x \cdot y\right), \left(x \cdot z + y \cdot z\right)\right)\right)\right) \]
        5. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \left(x \cdot z + y \cdot z\right)\right)\right)\right) \]
        6. distribute-rgt-outN/A

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \left(z \cdot \left(x + y\right)\right)\right)\right)\right) \]
        7. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \mathsf{*.f64}\left(z, \left(x + y\right)\right)\right)\right)\right) \]
        8. +-lowering-+.f6467.3%

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \mathsf{*.f64}\left(z, \mathsf{+.f64}\left(x, y\right)\right)\right)\right)\right) \]
      3. Simplified67.3%

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

        \[\leadsto \color{blue}{2 \cdot \sqrt{x \cdot y}} \]
      6. Step-by-step derivation
        1. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(2, \color{blue}{\left(\sqrt{x \cdot y}\right)}\right) \]
        2. sqrt-lowering-sqrt.f64N/A

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\left(x \cdot y\right)\right)\right) \]
        3. *-commutativeN/A

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\left(y \cdot x\right)\right)\right) \]
        4. *-lowering-*.f6419.9%

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(y, x\right)\right)\right) \]
      7. Simplified19.9%

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

      if -3.05000000000000006e-298 < y

      1. Initial program 68.1%

        \[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z} \]
      2. Step-by-step derivation
        1. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(2, \color{blue}{\left(\sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z}\right)}\right) \]
        2. sqrt-lowering-sqrt.f64N/A

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\left(\left(x \cdot y + x \cdot z\right) + y \cdot z\right)\right)\right) \]
        3. associate-+l+N/A

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\left(x \cdot y + \left(x \cdot z + y \cdot z\right)\right)\right)\right) \]
        4. +-lowering-+.f64N/A

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(x \cdot y\right), \left(x \cdot z + y \cdot z\right)\right)\right)\right) \]
        5. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \left(x \cdot z + y \cdot z\right)\right)\right)\right) \]
        6. distribute-rgt-outN/A

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \left(z \cdot \left(x + y\right)\right)\right)\right)\right) \]
        7. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \mathsf{*.f64}\left(z, \left(x + y\right)\right)\right)\right)\right) \]
        8. +-lowering-+.f6468.1%

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \mathsf{*.f64}\left(z, \mathsf{+.f64}\left(x, y\right)\right)\right)\right)\right) \]
      3. Simplified68.1%

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

        \[\leadsto \color{blue}{2 \cdot \sqrt{y \cdot z}} \]
      6. Step-by-step derivation
        1. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(2, \color{blue}{\left(\sqrt{y \cdot z}\right)}\right) \]
        2. sqrt-lowering-sqrt.f64N/A

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\left(y \cdot z\right)\right)\right) \]
        3. *-lowering-*.f6419.0%

          \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(y, z\right)\right)\right) \]
      7. Simplified19.0%

        \[\leadsto \color{blue}{2 \cdot \sqrt{y \cdot z}} \]
    3. Recombined 2 regimes into one program.
    4. Add Preprocessing

    Alternative 13: 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 67.7%

      \[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z} \]
    2. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \color{blue}{\left(\sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z}\right)}\right) \]
      2. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\left(\left(x \cdot y + x \cdot z\right) + y \cdot z\right)\right)\right) \]
      3. associate-+l+N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\left(x \cdot y + \left(x \cdot z + y \cdot z\right)\right)\right)\right) \]
      4. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(x \cdot y\right), \left(x \cdot z + y \cdot z\right)\right)\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \left(x \cdot z + y \cdot z\right)\right)\right)\right) \]
      6. distribute-rgt-outN/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \left(z \cdot \left(x + y\right)\right)\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \mathsf{*.f64}\left(z, \left(x + y\right)\right)\right)\right)\right) \]
      8. +-lowering-+.f6467.7%

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \mathsf{*.f64}\left(z, \mathsf{+.f64}\left(x, y\right)\right)\right)\right)\right) \]
    3. Simplified67.7%

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

      \[\leadsto \color{blue}{2 \cdot \sqrt{x \cdot y}} \]
    6. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \color{blue}{\left(\sqrt{x \cdot y}\right)}\right) \]
      2. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\left(x \cdot y\right)\right)\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\left(y \cdot x\right)\right)\right) \]
      4. *-lowering-*.f6424.0%

        \[\leadsto \mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(y, x\right)\right)\right) \]
    7. Simplified24.0%

      \[\leadsto \color{blue}{2 \cdot \sqrt{y \cdot x}} \]
    8. Add Preprocessing

    Developer Target 1: 82.7% 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 2024141 
    (FPCore (x y z)
      :name "Diagrams.TwoD.Apollonian:descartes from diagrams-contrib-1.3.0.5"
      :precision binary64
    
      :alt
      (! :herbie-platform default (if (< z 763695009057367500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (* 2 (sqrt (+ (* (+ x y) z) (* x y)))) (* (* (+ (* 1/4 (* (* (pow y -3/4) (* (pow z -3/4) x)) (+ y z))) (* (pow z 1/4) (pow y 1/4))) (+ (* 1/4 (* (* (pow y -3/4) (* (pow z -3/4) x)) (+ y z))) (* (pow z 1/4) (pow y 1/4)))) 2)))
    
      (* 2.0 (sqrt (+ (+ (* x y) (* x z)) (* y z)))))