?

Average Accuracy: 68.4% → 96.3%
Time: 18.0s
Precision: binary64
Cost: 13444

?

\[ \begin{array}{c}[x, y, z] = \mathsf{sort}([x, y, z])\\ \end{array} \]
\[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z} \]
\[\begin{array}{l} \mathbf{if}\;y \leq -5 \cdot 10^{-310}:\\ \;\;\;\;2 \cdot \left(\sqrt{-y} \cdot \sqrt{z - x}\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \frac{\sqrt{z + x}}{{y}^{-0.5}}\\ \end{array} \]
(FPCore (x y z)
 :precision binary64
 (* 2.0 (sqrt (+ (+ (* x y) (* x z)) (* y z)))))
(FPCore (x y z)
 :precision binary64
 (if (<= y -5e-310)
   (* 2.0 (* (sqrt (- y)) (sqrt (- z x))))
   (* 2.0 (/ (sqrt (+ z x)) (pow y -0.5)))))
double code(double x, double y, double z) {
	return 2.0 * sqrt((((x * y) + (x * z)) + (y * z)));
}
double code(double x, double y, double z) {
	double tmp;
	if (y <= -5e-310) {
		tmp = 2.0 * (sqrt(-y) * sqrt((z - x)));
	} else {
		tmp = 2.0 * (sqrt((z + x)) / pow(y, -0.5));
	}
	return tmp;
}
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
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if (y <= (-5d-310)) then
        tmp = 2.0d0 * (sqrt(-y) * sqrt((z - x)))
    else
        tmp = 2.0d0 * (sqrt((z + x)) / (y ** (-0.5d0)))
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	return 2.0 * Math.sqrt((((x * y) + (x * z)) + (y * z)));
}
public static double code(double x, double y, double z) {
	double tmp;
	if (y <= -5e-310) {
		tmp = 2.0 * (Math.sqrt(-y) * Math.sqrt((z - x)));
	} else {
		tmp = 2.0 * (Math.sqrt((z + x)) / Math.pow(y, -0.5));
	}
	return tmp;
}
def code(x, y, z):
	return 2.0 * math.sqrt((((x * y) + (x * z)) + (y * z)))
def code(x, y, z):
	tmp = 0
	if y <= -5e-310:
		tmp = 2.0 * (math.sqrt(-y) * math.sqrt((z - x)))
	else:
		tmp = 2.0 * (math.sqrt((z + x)) / math.pow(y, -0.5))
	return tmp
function code(x, y, z)
	return Float64(2.0 * sqrt(Float64(Float64(Float64(x * y) + Float64(x * z)) + Float64(y * z))))
end
function code(x, y, z)
	tmp = 0.0
	if (y <= -5e-310)
		tmp = Float64(2.0 * Float64(sqrt(Float64(-y)) * sqrt(Float64(z - x))));
	else
		tmp = Float64(2.0 * Float64(sqrt(Float64(z + x)) / (y ^ -0.5)));
	end
	return tmp
end
function tmp = code(x, y, z)
	tmp = 2.0 * sqrt((((x * y) + (x * z)) + (y * z)));
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (y <= -5e-310)
		tmp = 2.0 * (sqrt(-y) * sqrt((z - x)));
	else
		tmp = 2.0 * (sqrt((z + x)) / (y ^ -0.5));
	end
	tmp_2 = tmp;
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]
code[x_, y_, z_] := If[LessEqual[y, -5e-310], N[(2.0 * N[(N[Sqrt[(-y)], $MachinePrecision] * N[Sqrt[N[(z - x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[Sqrt[N[(z + x), $MachinePrecision]], $MachinePrecision] / N[Power[y, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z}
\begin{array}{l}
\mathbf{if}\;y \leq -5 \cdot 10^{-310}:\\
\;\;\;\;2 \cdot \left(\sqrt{-y} \cdot \sqrt{z - x}\right)\\

\mathbf{else}:\\
\;\;\;\;2 \cdot \frac{\sqrt{z + x}}{{y}^{-0.5}}\\


\end{array}

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original68.4%
Target81.4%
Herbie96.3%
\[\begin{array}{l} \mathbf{if}\;z < 7.636950090573675 \cdot 10^{+176}:\\ \;\;\;\;2 \cdot \sqrt{\left(x + y\right) \cdot z + x \cdot y}\\ \mathbf{else}:\\ \;\;\;\;\left(\left(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}\right) \cdot \left(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}\right)\right) \cdot 2\\ \end{array} \]

Derivation?

  1. Split input into 2 regimes
  2. if y < -4.999999999999985e-310

    1. Initial program 68.2%

      \[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z} \]
    2. Simplified68.1%

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

      [Start]68.2

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

      distribute-lft-out [=>]68.1

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

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

      [Start]68.1

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

      flip3-+ [=>]24.5

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

      clear-num [=>]24.5

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

      *-un-lft-identity [=>]24.5

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

      associate-/l* [=>]24.5

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

      flip3-+ [<=]67.9

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

      fma-def [=>]67.9

      \[ 2 \cdot \sqrt{\frac{1}{\frac{1}{\color{blue}{\mathsf{fma}\left(x, y + z, y \cdot z\right)}}}} \]
    4. Taylor expanded in y around -inf 65.5%

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

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

      [Start]65.5

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

      associate-/r* [=>]65.4

      \[ 2 \cdot \sqrt{\frac{1}{\color{blue}{\frac{\frac{-1}{y}}{-1 \cdot z + -1 \cdot x}}}} \]

      mul-1-neg [=>]65.4

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

      unsub-neg [=>]65.4

      \[ 2 \cdot \sqrt{\frac{1}{\frac{\frac{-1}{y}}{\color{blue}{-1 \cdot z - x}}}} \]

      mul-1-neg [=>]65.4

      \[ 2 \cdot \sqrt{\frac{1}{\frac{\frac{-1}{y}}{\color{blue}{\left(-z\right)} - x}}} \]
    6. Applied egg-rr96.3%

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

      [Start]65.4

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

      associate-/r/ [=>]65.6

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

      sqrt-prod [=>]96.3

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

      associate-/r/ [=>]96.3

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

      metadata-eval [=>]96.3

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

      neg-mul-1 [<=]96.3

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

      add-sqr-sqrt [=>]47.7

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

      sqrt-unprod [=>]94.7

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

      sqr-neg [=>]94.7

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

      sqrt-unprod [<=]48.6

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

      add-sqr-sqrt [<=]96.3

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

    if -4.999999999999985e-310 < y

    1. Initial program 68.7%

      \[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z} \]
    2. Simplified68.7%

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

      [Start]68.7

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

      distribute-lft-out [=>]68.7

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

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

      [Start]68.7

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

      flip3-+ [=>]25.1

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

      clear-num [=>]25.1

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

      *-un-lft-identity [=>]25.1

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

      associate-/l* [=>]25.1

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

      flip3-+ [<=]68.2

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

      fma-def [=>]68.2

      \[ 2 \cdot \sqrt{\frac{1}{\frac{1}{\color{blue}{\mathsf{fma}\left(x, y + z, y \cdot z\right)}}}} \]
    4. Taylor expanded in y around -inf 65.9%

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

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

      [Start]65.9

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

      associate-/r* [=>]65.9

      \[ 2 \cdot \sqrt{\frac{1}{\color{blue}{\frac{\frac{-1}{y}}{-1 \cdot z + -1 \cdot x}}}} \]

      mul-1-neg [=>]65.9

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

      unsub-neg [=>]65.9

      \[ 2 \cdot \sqrt{\frac{1}{\frac{\frac{-1}{y}}{\color{blue}{-1 \cdot z - x}}}} \]

      mul-1-neg [=>]65.9

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

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

      [Start]65.9

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

      sqrt-div [=>]67.5

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

      metadata-eval [=>]67.5

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

      /-rgt-identity [<=]67.5

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

      clear-num [=>]65.8

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

      frac-2neg [=>]65.8

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

      associate-/r/ [=>]65.8

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

      distribute-neg-frac [=>]65.8

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

      metadata-eval [=>]65.8

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

      associate-/r/ [=>]65.8

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

      metadata-eval [=>]65.8

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

      *-un-lft-identity [<=]65.8

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

      neg-sub0 [=>]65.8

      \[ 2 \cdot \frac{1}{\sqrt{\frac{1}{y \cdot \color{blue}{\left(0 - \left(\left(-z\right) - x\right)\right)}}}} \]

      metadata-eval [<=]65.8

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

      add-sqr-sqrt [=>]0.0

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

      sqrt-unprod [=>]0.0

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

      sqr-neg [=>]0.0

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

      sqrt-unprod [<=]0.0

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

      add-sqr-sqrt [<=]0.0

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

      associate-+l- [<=]0.0

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

      metadata-eval [=>]0.0

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

      neg-sub0 [<=]0.0

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

      \[\leadsto 2 \cdot \color{blue}{\frac{1}{\sqrt{\frac{\frac{1}{y}}{x + z}}}} \]
      Proof

      [Start]65.8

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

      associate-/r* [=>]67.5

      \[ 2 \cdot \frac{1}{\sqrt{\color{blue}{\frac{\frac{1}{y}}{z + x}}}} \]

      +-commutative [=>]67.5

      \[ 2 \cdot \frac{1}{\sqrt{\frac{\frac{1}{y}}{\color{blue}{x + z}}}} \]
    8. Applied egg-rr96.1%

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

      [Start]67.5

      \[ 2 \cdot \frac{1}{\sqrt{\frac{\frac{1}{y}}{x + z}}} \]

      sqrt-div [=>]96.1

      \[ 2 \cdot \frac{1}{\color{blue}{\frac{\sqrt{\frac{1}{y}}}{\sqrt{x + z}}}} \]

      frac-2neg [=>]96.1

      \[ 2 \cdot \frac{1}{\color{blue}{\frac{-\sqrt{\frac{1}{y}}}{-\sqrt{x + z}}}} \]

      associate-/r/ [=>]96.1

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

      inv-pow [=>]96.1

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

      metadata-eval [<=]96.1

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

      sqrt-pow1 [=>]96.1

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

      metadata-eval [=>]96.1

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

      metadata-eval [=>]96.1

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

      \[\leadsto 2 \cdot \color{blue}{\frac{\sqrt{z + x}}{{y}^{-0.5}}} \]
      Proof

      [Start]96.1

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

      associate-*l/ [=>]96.2

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

      *-lft-identity [=>]96.2

      \[ 2 \cdot \frac{\color{blue}{-\sqrt{x + z}}}{-{y}^{-0.5}} \]

      mul-1-neg [<=]96.2

      \[ 2 \cdot \frac{\color{blue}{-1 \cdot \sqrt{x + z}}}{-{y}^{-0.5}} \]

      *-commutative [=>]96.2

      \[ 2 \cdot \frac{\color{blue}{\sqrt{x + z} \cdot -1}}{-{y}^{-0.5}} \]

      associate-/l* [=>]96.2

      \[ 2 \cdot \color{blue}{\frac{\sqrt{x + z}}{\frac{-{y}^{-0.5}}{-1}}} \]

      +-commutative [=>]96.2

      \[ 2 \cdot \frac{\sqrt{\color{blue}{z + x}}}{\frac{-{y}^{-0.5}}{-1}} \]

      neg-mul-1 [=>]96.2

      \[ 2 \cdot \frac{\sqrt{z + x}}{\frac{\color{blue}{-1 \cdot {y}^{-0.5}}}{-1}} \]

      associate-/l* [=>]96.1

      \[ 2 \cdot \frac{\sqrt{z + x}}{\color{blue}{\frac{-1}{\frac{-1}{{y}^{-0.5}}}}} \]

      associate-/r/ [=>]96.2

      \[ 2 \cdot \frac{\sqrt{z + x}}{\color{blue}{\frac{-1}{-1} \cdot {y}^{-0.5}}} \]

      metadata-eval [=>]96.2

      \[ 2 \cdot \frac{\sqrt{z + x}}{\color{blue}{1} \cdot {y}^{-0.5}} \]

      *-lft-identity [=>]96.2

      \[ 2 \cdot \frac{\sqrt{z + x}}{\color{blue}{{y}^{-0.5}}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification96.3%

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

Alternatives

Alternative 1
Accuracy96.3%
Cost13444
\[\begin{array}{l} \mathbf{if}\;y \leq -5 \cdot 10^{-310}:\\ \;\;\;\;2 \cdot \left(\sqrt{-y} \cdot \sqrt{z - x}\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(\sqrt{z} \cdot \sqrt{y}\right)\\ \end{array} \]
Alternative 2
Accuracy81.9%
Cost13252
\[\begin{array}{l} \mathbf{if}\;y \leq 1.8 \cdot 10^{-285}:\\ \;\;\;\;2 \cdot \sqrt{x \cdot \left(y + z\right)}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(\sqrt{z} \cdot \sqrt{y}\right)\\ \end{array} \]
Alternative 3
Accuracy70.1%
Cost7876
\[\begin{array}{l} \mathbf{if}\;\left(y \cdot x + z \cdot x\right) + y \cdot z \leq 2 \cdot 10^{+305}:\\ \;\;\;\;2 \cdot \sqrt{y \cdot z + x \cdot \left(y + z\right)}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \frac{1}{\sqrt{\frac{\frac{1}{y}}{z + x}}}\\ \end{array} \]
Alternative 4
Accuracy69.2%
Cost7236
\[\begin{array}{l} \mathbf{if}\;y \leq 1.95 \cdot 10^{-41}:\\ \;\;\;\;2 \cdot \sqrt{y \cdot z + x \cdot \left(y + z\right)}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot {\left(\frac{\frac{1}{z}}{y + x}\right)}^{-0.5}\\ \end{array} \]
Alternative 5
Accuracy69.0%
Cost7172
\[\begin{array}{l} \mathbf{if}\;y \leq -2 \cdot 10^{-295}:\\ \;\;\;\;2 \cdot \sqrt{x \cdot \left(y + z\right)}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot {\left(\frac{\frac{1}{z}}{y + x}\right)}^{-0.5}\\ \end{array} \]
Alternative 6
Accuracy67.8%
Cost7044
\[\begin{array}{l} \mathbf{if}\;y \leq 1.8 \cdot 10^{-285}:\\ \;\;\;\;2 \cdot \sqrt{x \cdot \left(y + z\right)}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot {\left(\frac{\frac{1}{y}}{z}\right)}^{-0.5}\\ \end{array} \]
Alternative 7
Accuracy66.8%
Cost6980
\[\begin{array}{l} \mathbf{if}\;y \leq -8 \cdot 10^{-259}:\\ \;\;\;\;2 \cdot \sqrt{y \cdot x}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \sqrt{z \cdot \left(y + x\right)}\\ \end{array} \]
Alternative 8
Accuracy68.3%
Cost6980
\[\begin{array}{l} \mathbf{if}\;y \leq 2 \cdot 10^{-285}:\\ \;\;\;\;2 \cdot \sqrt{x \cdot \left(y + z\right)}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \sqrt{z \cdot \left(y + x\right)}\\ \end{array} \]
Alternative 9
Accuracy66.0%
Cost6852
\[\begin{array}{l} \mathbf{if}\;y \leq -5 \cdot 10^{-310}:\\ \;\;\;\;2 \cdot \sqrt{y \cdot x}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \sqrt{y \cdot z}\\ \end{array} \]
Alternative 10
Accuracy34.5%
Cost6720
\[2 \cdot \sqrt{y \cdot x} \]

Error

Reproduce?

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

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

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