sqrt C (should all be same)

Percentage Accurate: 54.9% → 99.3%
Time: 4.5s
Alternatives: 7
Speedup: 1.0×

Specification

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

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

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

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

Alternative 1: 99.3% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -4 \cdot 10^{-310}:\\ \;\;\;\;\sqrt{2} \cdot \left(-x\right)\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2} \cdot x\\ \end{array} \end{array} \]
(FPCore (x)
 :precision binary64
 (if (<= x -4e-310) (* (sqrt 2.0) (- x)) (* (sqrt 2.0) x)))
double code(double x) {
	double tmp;
	if (x <= -4e-310) {
		tmp = sqrt(2.0) * -x;
	} else {
		tmp = sqrt(2.0) * x;
	}
	return tmp;
}
real(8) function code(x)
    real(8), intent (in) :: x
    real(8) :: tmp
    if (x <= (-4d-310)) then
        tmp = sqrt(2.0d0) * -x
    else
        tmp = sqrt(2.0d0) * x
    end if
    code = tmp
end function
public static double code(double x) {
	double tmp;
	if (x <= -4e-310) {
		tmp = Math.sqrt(2.0) * -x;
	} else {
		tmp = Math.sqrt(2.0) * x;
	}
	return tmp;
}
def code(x):
	tmp = 0
	if x <= -4e-310:
		tmp = math.sqrt(2.0) * -x
	else:
		tmp = math.sqrt(2.0) * x
	return tmp
function code(x)
	tmp = 0.0
	if (x <= -4e-310)
		tmp = Float64(sqrt(2.0) * Float64(-x));
	else
		tmp = Float64(sqrt(2.0) * x);
	end
	return tmp
end
function tmp_2 = code(x)
	tmp = 0.0;
	if (x <= -4e-310)
		tmp = sqrt(2.0) * -x;
	else
		tmp = sqrt(2.0) * x;
	end
	tmp_2 = tmp;
end
code[x_] := If[LessEqual[x, -4e-310], N[(N[Sqrt[2.0], $MachinePrecision] * (-x)), $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * x), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -4 \cdot 10^{-310}:\\
\;\;\;\;\sqrt{2} \cdot \left(-x\right)\\

\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot x\\


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

    1. Initial program 58.5%

      \[\sqrt{2 \cdot \left(x \cdot x\right)} \]
    2. Taylor expanded in x around -inf 99.3%

      \[\leadsto \color{blue}{-1 \cdot \left(\sqrt{2} \cdot x\right)} \]
    3. Step-by-step derivation
      1. mul-1-neg99.3%

        \[\leadsto \color{blue}{-\sqrt{2} \cdot x} \]
      2. distribute-rgt-neg-in99.3%

        \[\leadsto \color{blue}{\sqrt{2} \cdot \left(-x\right)} \]
    4. Simplified99.3%

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

    if -3.999999999999988e-310 < x

    1. Initial program 58.4%

      \[\sqrt{2 \cdot \left(x \cdot x\right)} \]
    2. Taylor expanded in x around 0 99.3%

      \[\leadsto \color{blue}{\sqrt{2} \cdot x} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification99.3%

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

Alternative 2: 97.8% accurate, 0.3× speedup?

\[\begin{array}{l} \\ {\left({\left(\sqrt[3]{\sqrt{2} \cdot x}\right)}^{2}\right)}^{1.5} \end{array} \]
(FPCore (x) :precision binary64 (pow (pow (cbrt (* (sqrt 2.0) x)) 2.0) 1.5))
double code(double x) {
	return pow(pow(cbrt((sqrt(2.0) * x)), 2.0), 1.5);
}
public static double code(double x) {
	return Math.pow(Math.pow(Math.cbrt((Math.sqrt(2.0) * x)), 2.0), 1.5);
}
function code(x)
	return (cbrt(Float64(sqrt(2.0) * x)) ^ 2.0) ^ 1.5
end
code[x_] := N[Power[N[Power[N[Power[N[(N[Sqrt[2.0], $MachinePrecision] * x), $MachinePrecision], 1/3], $MachinePrecision], 2.0], $MachinePrecision], 1.5], $MachinePrecision]
\begin{array}{l}

\\
{\left({\left(\sqrt[3]{\sqrt{2} \cdot x}\right)}^{2}\right)}^{1.5}
\end{array}
Derivation
  1. Initial program 58.4%

    \[\sqrt{2 \cdot \left(x \cdot x\right)} \]
  2. Taylor expanded in x around -inf 52.6%

    \[\leadsto \color{blue}{-1 \cdot \left(\sqrt{2} \cdot x\right)} \]
  3. Step-by-step derivation
    1. mul-1-neg52.6%

      \[\leadsto \color{blue}{-\sqrt{2} \cdot x} \]
    2. distribute-rgt-neg-in52.6%

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

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

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

      \[\leadsto \sqrt{2} \cdot \color{blue}{\sqrt{\left(-x\right) \cdot \left(-x\right)}} \]
    3. sqr-neg58.1%

      \[\leadsto \sqrt{2} \cdot \sqrt{\color{blue}{x \cdot x}} \]
    4. sqrt-prod58.4%

      \[\leadsto \color{blue}{\sqrt{2 \cdot \left(x \cdot x\right)}} \]
    5. add-cube-cbrt57.7%

      \[\leadsto \sqrt{\color{blue}{\left(\sqrt[3]{2 \cdot \left(x \cdot x\right)} \cdot \sqrt[3]{2 \cdot \left(x \cdot x\right)}\right) \cdot \sqrt[3]{2 \cdot \left(x \cdot x\right)}}} \]
    6. sqrt-prod57.8%

      \[\leadsto \color{blue}{\sqrt{\sqrt[3]{2 \cdot \left(x \cdot x\right)} \cdot \sqrt[3]{2 \cdot \left(x \cdot x\right)}} \cdot \sqrt{\sqrt[3]{2 \cdot \left(x \cdot x\right)}}} \]
    7. sqrt-unprod57.6%

      \[\leadsto \color{blue}{\left(\sqrt{\sqrt[3]{2 \cdot \left(x \cdot x\right)}} \cdot \sqrt{\sqrt[3]{2 \cdot \left(x \cdot x\right)}}\right)} \cdot \sqrt{\sqrt[3]{2 \cdot \left(x \cdot x\right)}} \]
    8. add-sqr-sqrt57.8%

      \[\leadsto \color{blue}{\sqrt[3]{2 \cdot \left(x \cdot x\right)}} \cdot \sqrt{\sqrt[3]{2 \cdot \left(x \cdot x\right)}} \]
    9. pow157.8%

      \[\leadsto \color{blue}{{\left(\sqrt[3]{2 \cdot \left(x \cdot x\right)}\right)}^{1}} \cdot \sqrt{\sqrt[3]{2 \cdot \left(x \cdot x\right)}} \]
    10. pow1/257.8%

      \[\leadsto {\left(\sqrt[3]{2 \cdot \left(x \cdot x\right)}\right)}^{1} \cdot \color{blue}{{\left(\sqrt[3]{2 \cdot \left(x \cdot x\right)}\right)}^{0.5}} \]
    11. pow-prod-up57.8%

      \[\leadsto \color{blue}{{\left(\sqrt[3]{2 \cdot \left(x \cdot x\right)}\right)}^{\left(1 + 0.5\right)}} \]
    12. metadata-eval57.8%

      \[\leadsto {\left(\sqrt[3]{2 \cdot \left(x \cdot x\right)}\right)}^{\color{blue}{1.5}} \]
  6. Applied egg-rr57.8%

    \[\leadsto \color{blue}{{\left(\sqrt[3]{2 \cdot \left(x \cdot x\right)}\right)}^{1.5}} \]
  7. Step-by-step derivation
    1. *-commutative57.8%

      \[\leadsto {\left(\sqrt[3]{\color{blue}{\left(x \cdot x\right) \cdot 2}}\right)}^{1.5} \]
    2. cbrt-prod57.4%

      \[\leadsto {\color{blue}{\left(\sqrt[3]{x \cdot x} \cdot \sqrt[3]{2}\right)}}^{1.5} \]
    3. cbrt-prod97.5%

      \[\leadsto {\left(\color{blue}{\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right)} \cdot \sqrt[3]{2}\right)}^{1.5} \]
    4. add-sqr-sqrt97.5%

      \[\leadsto {\left(\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \sqrt[3]{\color{blue}{\sqrt{2} \cdot \sqrt{2}}}\right)}^{1.5} \]
    5. cbrt-unprod97.8%

      \[\leadsto {\left(\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \color{blue}{\left(\sqrt[3]{\sqrt{2}} \cdot \sqrt[3]{\sqrt{2}}\right)}\right)}^{1.5} \]
    6. swap-sqr97.7%

      \[\leadsto {\color{blue}{\left(\left(\sqrt[3]{x} \cdot \sqrt[3]{\sqrt{2}}\right) \cdot \left(\sqrt[3]{x} \cdot \sqrt[3]{\sqrt{2}}\right)\right)}}^{1.5} \]
    7. cbrt-prod98.2%

      \[\leadsto {\left(\left(\sqrt[3]{x} \cdot \sqrt[3]{\sqrt{2}}\right) \cdot \color{blue}{\sqrt[3]{x \cdot \sqrt{2}}}\right)}^{1.5} \]
    8. cbrt-prod97.9%

      \[\leadsto {\left(\color{blue}{\sqrt[3]{x \cdot \sqrt{2}}} \cdot \sqrt[3]{x \cdot \sqrt{2}}\right)}^{1.5} \]
    9. pow297.9%

      \[\leadsto {\color{blue}{\left({\left(\sqrt[3]{x \cdot \sqrt{2}}\right)}^{2}\right)}}^{1.5} \]
    10. *-commutative97.9%

      \[\leadsto {\left({\left(\sqrt[3]{\color{blue}{\sqrt{2} \cdot x}}\right)}^{2}\right)}^{1.5} \]
  8. Applied egg-rr97.9%

    \[\leadsto {\color{blue}{\left({\left(\sqrt[3]{\sqrt{2} \cdot x}\right)}^{2}\right)}}^{1.5} \]
  9. Final simplification97.9%

    \[\leadsto {\left({\left(\sqrt[3]{\sqrt{2} \cdot x}\right)}^{2}\right)}^{1.5} \]

Alternative 3: 97.9% accurate, 0.3× speedup?

\[\begin{array}{l} \\ {\left(\left|\sqrt[3]{\sqrt{2} \cdot x}\right|\right)}^{3} \end{array} \]
(FPCore (x) :precision binary64 (pow (fabs (cbrt (* (sqrt 2.0) x))) 3.0))
double code(double x) {
	return pow(fabs(cbrt((sqrt(2.0) * x))), 3.0);
}
public static double code(double x) {
	return Math.pow(Math.abs(Math.cbrt((Math.sqrt(2.0) * x))), 3.0);
}
function code(x)
	return abs(cbrt(Float64(sqrt(2.0) * x))) ^ 3.0
end
code[x_] := N[Power[N[Abs[N[Power[N[(N[Sqrt[2.0], $MachinePrecision] * x), $MachinePrecision], 1/3], $MachinePrecision]], $MachinePrecision], 3.0], $MachinePrecision]
\begin{array}{l}

\\
{\left(\left|\sqrt[3]{\sqrt{2} \cdot x}\right|\right)}^{3}
\end{array}
Derivation
  1. Initial program 58.4%

    \[\sqrt{2 \cdot \left(x \cdot x\right)} \]
  2. Step-by-step derivation
    1. add-cube-cbrt57.4%

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

      \[\leadsto \color{blue}{{\left(\sqrt[3]{\sqrt{2 \cdot \left(x \cdot x\right)}}\right)}^{3}} \]
    3. *-commutative57.5%

      \[\leadsto {\left(\sqrt[3]{\sqrt{\color{blue}{\left(x \cdot x\right) \cdot 2}}}\right)}^{3} \]
    4. sqrt-prod57.4%

      \[\leadsto {\left(\sqrt[3]{\color{blue}{\sqrt{x \cdot x} \cdot \sqrt{2}}}\right)}^{3} \]
    5. sqrt-prod46.9%

      \[\leadsto {\left(\sqrt[3]{\color{blue}{\left(\sqrt{x} \cdot \sqrt{x}\right)} \cdot \sqrt{2}}\right)}^{3} \]
    6. add-sqr-sqrt48.0%

      \[\leadsto {\left(\sqrt[3]{\color{blue}{x} \cdot \sqrt{2}}\right)}^{3} \]
  3. Applied egg-rr48.0%

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

      \[\leadsto {\color{blue}{\left(\sqrt{\sqrt[3]{x \cdot \sqrt{2}}} \cdot \sqrt{\sqrt[3]{x \cdot \sqrt{2}}}\right)}}^{3} \]
    2. sqrt-unprod97.8%

      \[\leadsto {\color{blue}{\left(\sqrt{\sqrt[3]{x \cdot \sqrt{2}} \cdot \sqrt[3]{x \cdot \sqrt{2}}}\right)}}^{3} \]
    3. cbrt-prod98.0%

      \[\leadsto {\left(\sqrt{\sqrt[3]{x \cdot \sqrt{2}} \cdot \color{blue}{\left(\sqrt[3]{x} \cdot \sqrt[3]{\sqrt{2}}\right)}}\right)}^{3} \]
    4. cbrt-prod97.7%

      \[\leadsto {\left(\sqrt{\color{blue}{\left(\sqrt[3]{x} \cdot \sqrt[3]{\sqrt{2}}\right)} \cdot \left(\sqrt[3]{x} \cdot \sqrt[3]{\sqrt{2}}\right)}\right)}^{3} \]
    5. swap-sqr97.6%

      \[\leadsto {\left(\sqrt{\color{blue}{\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \left(\sqrt[3]{\sqrt{2}} \cdot \sqrt[3]{\sqrt{2}}\right)}}\right)}^{3} \]
    6. cbrt-prod57.6%

      \[\leadsto {\left(\sqrt{\color{blue}{\sqrt[3]{x \cdot x}} \cdot \left(\sqrt[3]{\sqrt{2}} \cdot \sqrt[3]{\sqrt{2}}\right)}\right)}^{3} \]
    7. cbrt-unprod57.4%

      \[\leadsto {\left(\sqrt{\sqrt[3]{x \cdot x} \cdot \color{blue}{\sqrt[3]{\sqrt{2} \cdot \sqrt{2}}}}\right)}^{3} \]
    8. add-sqr-sqrt57.4%

      \[\leadsto {\left(\sqrt{\sqrt[3]{x \cdot x} \cdot \sqrt[3]{\color{blue}{2}}}\right)}^{3} \]
    9. cbrt-prod57.6%

      \[\leadsto {\left(\sqrt{\color{blue}{\sqrt[3]{\left(x \cdot x\right) \cdot 2}}}\right)}^{3} \]
    10. *-commutative57.6%

      \[\leadsto {\left(\sqrt{\sqrt[3]{\color{blue}{2 \cdot \left(x \cdot x\right)}}}\right)}^{3} \]
    11. add-sqr-sqrt57.6%

      \[\leadsto {\left(\sqrt{\color{blue}{\sqrt{\sqrt[3]{2 \cdot \left(x \cdot x\right)}} \cdot \sqrt{\sqrt[3]{2 \cdot \left(x \cdot x\right)}}}}\right)}^{3} \]
    12. rem-sqrt-square57.6%

      \[\leadsto {\color{blue}{\left(\left|\sqrt{\sqrt[3]{2 \cdot \left(x \cdot x\right)}}\right|\right)}}^{3} \]
    13. *-commutative57.6%

      \[\leadsto {\left(\left|\sqrt{\sqrt[3]{\color{blue}{\left(x \cdot x\right) \cdot 2}}}\right|\right)}^{3} \]
    14. cbrt-prod57.4%

      \[\leadsto {\left(\left|\sqrt{\color{blue}{\sqrt[3]{x \cdot x} \cdot \sqrt[3]{2}}}\right|\right)}^{3} \]
    15. cbrt-prod97.5%

      \[\leadsto {\left(\left|\sqrt{\color{blue}{\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right)} \cdot \sqrt[3]{2}}\right|\right)}^{3} \]
    16. add-sqr-sqrt97.5%

      \[\leadsto {\left(\left|\sqrt{\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \sqrt[3]{\color{blue}{\sqrt{2} \cdot \sqrt{2}}}}\right|\right)}^{3} \]
    17. cbrt-unprod97.6%

      \[\leadsto {\left(\left|\sqrt{\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \color{blue}{\left(\sqrt[3]{\sqrt{2}} \cdot \sqrt[3]{\sqrt{2}}\right)}}\right|\right)}^{3} \]
  5. Applied egg-rr97.8%

    \[\leadsto {\color{blue}{\left(\left|\sqrt[3]{\sqrt{2} \cdot x}\right|\right)}}^{3} \]
  6. Final simplification97.8%

    \[\leadsto {\left(\left|\sqrt[3]{\sqrt{2} \cdot x}\right|\right)}^{3} \]

Alternative 4: 97.9% accurate, 0.3× speedup?

\[\begin{array}{l} \\ {\left(\sqrt[3]{x + x} \cdot \sqrt[3]{x}\right)}^{1.5} \end{array} \]
(FPCore (x) :precision binary64 (pow (* (cbrt (+ x x)) (cbrt x)) 1.5))
double code(double x) {
	return pow((cbrt((x + x)) * cbrt(x)), 1.5);
}
public static double code(double x) {
	return Math.pow((Math.cbrt((x + x)) * Math.cbrt(x)), 1.5);
}
function code(x)
	return Float64(cbrt(Float64(x + x)) * cbrt(x)) ^ 1.5
end
code[x_] := N[Power[N[(N[Power[N[(x + x), $MachinePrecision], 1/3], $MachinePrecision] * N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision], 1.5], $MachinePrecision]
\begin{array}{l}

\\
{\left(\sqrt[3]{x + x} \cdot \sqrt[3]{x}\right)}^{1.5}
\end{array}
Derivation
  1. Initial program 58.4%

    \[\sqrt{2 \cdot \left(x \cdot x\right)} \]
  2. Taylor expanded in x around -inf 52.6%

    \[\leadsto \color{blue}{-1 \cdot \left(\sqrt{2} \cdot x\right)} \]
  3. Step-by-step derivation
    1. mul-1-neg52.6%

      \[\leadsto \color{blue}{-\sqrt{2} \cdot x} \]
    2. distribute-rgt-neg-in52.6%

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

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

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

      \[\leadsto \sqrt{2} \cdot \color{blue}{\sqrt{\left(-x\right) \cdot \left(-x\right)}} \]
    3. sqr-neg58.1%

      \[\leadsto \sqrt{2} \cdot \sqrt{\color{blue}{x \cdot x}} \]
    4. sqrt-prod58.4%

      \[\leadsto \color{blue}{\sqrt{2 \cdot \left(x \cdot x\right)}} \]
    5. add-cube-cbrt57.7%

      \[\leadsto \sqrt{\color{blue}{\left(\sqrt[3]{2 \cdot \left(x \cdot x\right)} \cdot \sqrt[3]{2 \cdot \left(x \cdot x\right)}\right) \cdot \sqrt[3]{2 \cdot \left(x \cdot x\right)}}} \]
    6. sqrt-prod57.8%

      \[\leadsto \color{blue}{\sqrt{\sqrt[3]{2 \cdot \left(x \cdot x\right)} \cdot \sqrt[3]{2 \cdot \left(x \cdot x\right)}} \cdot \sqrt{\sqrt[3]{2 \cdot \left(x \cdot x\right)}}} \]
    7. sqrt-unprod57.6%

      \[\leadsto \color{blue}{\left(\sqrt{\sqrt[3]{2 \cdot \left(x \cdot x\right)}} \cdot \sqrt{\sqrt[3]{2 \cdot \left(x \cdot x\right)}}\right)} \cdot \sqrt{\sqrt[3]{2 \cdot \left(x \cdot x\right)}} \]
    8. add-sqr-sqrt57.8%

      \[\leadsto \color{blue}{\sqrt[3]{2 \cdot \left(x \cdot x\right)}} \cdot \sqrt{\sqrt[3]{2 \cdot \left(x \cdot x\right)}} \]
    9. pow157.8%

      \[\leadsto \color{blue}{{\left(\sqrt[3]{2 \cdot \left(x \cdot x\right)}\right)}^{1}} \cdot \sqrt{\sqrt[3]{2 \cdot \left(x \cdot x\right)}} \]
    10. pow1/257.8%

      \[\leadsto {\left(\sqrt[3]{2 \cdot \left(x \cdot x\right)}\right)}^{1} \cdot \color{blue}{{\left(\sqrt[3]{2 \cdot \left(x \cdot x\right)}\right)}^{0.5}} \]
    11. pow-prod-up57.8%

      \[\leadsto \color{blue}{{\left(\sqrt[3]{2 \cdot \left(x \cdot x\right)}\right)}^{\left(1 + 0.5\right)}} \]
    12. metadata-eval57.8%

      \[\leadsto {\left(\sqrt[3]{2 \cdot \left(x \cdot x\right)}\right)}^{\color{blue}{1.5}} \]
  6. Applied egg-rr57.8%

    \[\leadsto \color{blue}{{\left(\sqrt[3]{2 \cdot \left(x \cdot x\right)}\right)}^{1.5}} \]
  7. Step-by-step derivation
    1. associate-*r*57.8%

      \[\leadsto {\left(\sqrt[3]{\color{blue}{\left(2 \cdot x\right) \cdot x}}\right)}^{1.5} \]
    2. cbrt-prod97.6%

      \[\leadsto {\color{blue}{\left(\sqrt[3]{2 \cdot x} \cdot \sqrt[3]{x}\right)}}^{1.5} \]
    3. add-log-exp7.2%

      \[\leadsto {\left(\sqrt[3]{\color{blue}{\log \left(e^{2 \cdot x}\right)}} \cdot \sqrt[3]{x}\right)}^{1.5} \]
    4. *-commutative7.2%

      \[\leadsto {\left(\sqrt[3]{\log \left(e^{\color{blue}{x \cdot 2}}\right)} \cdot \sqrt[3]{x}\right)}^{1.5} \]
    5. exp-lft-sqr7.1%

      \[\leadsto {\left(\sqrt[3]{\log \color{blue}{\left(e^{x} \cdot e^{x}\right)}} \cdot \sqrt[3]{x}\right)}^{1.5} \]
    6. log-prod7.1%

      \[\leadsto {\left(\sqrt[3]{\color{blue}{\log \left(e^{x}\right) + \log \left(e^{x}\right)}} \cdot \sqrt[3]{x}\right)}^{1.5} \]
    7. add-log-exp13.5%

      \[\leadsto {\left(\sqrt[3]{\color{blue}{x} + \log \left(e^{x}\right)} \cdot \sqrt[3]{x}\right)}^{1.5} \]
    8. add-log-exp97.6%

      \[\leadsto {\left(\sqrt[3]{x + \color{blue}{x}} \cdot \sqrt[3]{x}\right)}^{1.5} \]
  8. Applied egg-rr97.6%

    \[\leadsto {\color{blue}{\left(\sqrt[3]{x + x} \cdot \sqrt[3]{x}\right)}}^{1.5} \]
  9. Final simplification97.6%

    \[\leadsto {\left(\sqrt[3]{x + x} \cdot \sqrt[3]{x}\right)}^{1.5} \]

Alternative 5: 5.6% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 3.2 \cdot 10^{-206}:\\ \;\;\;\;\sqrt{x \cdot 0}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{x}\\ \end{array} \end{array} \]
(FPCore (x) :precision binary64 (if (<= x 3.2e-206) (sqrt (* x 0.0)) (sqrt x)))
double code(double x) {
	double tmp;
	if (x <= 3.2e-206) {
		tmp = sqrt((x * 0.0));
	} else {
		tmp = sqrt(x);
	}
	return tmp;
}
real(8) function code(x)
    real(8), intent (in) :: x
    real(8) :: tmp
    if (x <= 3.2d-206) then
        tmp = sqrt((x * 0.0d0))
    else
        tmp = sqrt(x)
    end if
    code = tmp
end function
public static double code(double x) {
	double tmp;
	if (x <= 3.2e-206) {
		tmp = Math.sqrt((x * 0.0));
	} else {
		tmp = Math.sqrt(x);
	}
	return tmp;
}
def code(x):
	tmp = 0
	if x <= 3.2e-206:
		tmp = math.sqrt((x * 0.0))
	else:
		tmp = math.sqrt(x)
	return tmp
function code(x)
	tmp = 0.0
	if (x <= 3.2e-206)
		tmp = sqrt(Float64(x * 0.0));
	else
		tmp = sqrt(x);
	end
	return tmp
end
function tmp_2 = code(x)
	tmp = 0.0;
	if (x <= 3.2e-206)
		tmp = sqrt((x * 0.0));
	else
		tmp = sqrt(x);
	end
	tmp_2 = tmp;
end
code[x_] := If[LessEqual[x, 3.2e-206], N[Sqrt[N[(x * 0.0), $MachinePrecision]], $MachinePrecision], N[Sqrt[x], $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq 3.2 \cdot 10^{-206}:\\
\;\;\;\;\sqrt{x \cdot 0}\\

\mathbf{else}:\\
\;\;\;\;\sqrt{x}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < 3.19999999999999976e-206

    1. Initial program 53.4%

      \[\sqrt{2 \cdot \left(x \cdot x\right)} \]
    2. Step-by-step derivation
      1. add-cube-cbrt52.6%

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

        \[\leadsto \color{blue}{{\left(\sqrt[3]{\sqrt{2 \cdot \left(x \cdot x\right)}}\right)}^{3}} \]
      3. *-commutative52.6%

        \[\leadsto {\left(\sqrt[3]{\sqrt{\color{blue}{\left(x \cdot x\right) \cdot 2}}}\right)}^{3} \]
      4. sqrt-prod52.6%

        \[\leadsto {\left(\sqrt[3]{\color{blue}{\sqrt{x \cdot x} \cdot \sqrt{2}}}\right)}^{3} \]
      5. sqrt-prod9.9%

        \[\leadsto {\left(\sqrt[3]{\color{blue}{\left(\sqrt{x} \cdot \sqrt{x}\right)} \cdot \sqrt{2}}\right)}^{3} \]
      6. add-sqr-sqrt11.7%

        \[\leadsto {\left(\sqrt[3]{\color{blue}{x} \cdot \sqrt{2}}\right)}^{3} \]
    3. Applied egg-rr11.7%

      \[\leadsto \color{blue}{{\left(\sqrt[3]{x \cdot \sqrt{2}}\right)}^{3}} \]
    4. Step-by-step derivation
      1. rem-cube-cbrt11.8%

        \[\leadsto \color{blue}{x \cdot \sqrt{2}} \]
      2. *-commutative11.8%

        \[\leadsto \color{blue}{\sqrt{2} \cdot x} \]
      3. add-sqr-sqrt10.0%

        \[\leadsto \sqrt{2} \cdot \color{blue}{\left(\sqrt{x} \cdot \sqrt{x}\right)} \]
      4. sqrt-prod53.2%

        \[\leadsto \sqrt{2} \cdot \color{blue}{\sqrt{x \cdot x}} \]
      5. sqr-neg53.2%

        \[\leadsto \sqrt{2} \cdot \sqrt{\color{blue}{\left(-x\right) \cdot \left(-x\right)}} \]
      6. sqrt-unprod88.9%

        \[\leadsto \sqrt{2} \cdot \color{blue}{\left(\sqrt{-x} \cdot \sqrt{-x}\right)} \]
      7. add-sqr-sqrt88.8%

        \[\leadsto \color{blue}{\left(\sqrt{\sqrt{2}} \cdot \sqrt{\sqrt{2}}\right)} \cdot \left(\sqrt{-x} \cdot \sqrt{-x}\right) \]
      8. add-sqr-sqrt89.7%

        \[\leadsto \left(\sqrt{\sqrt{2}} \cdot \sqrt{\sqrt{2}}\right) \cdot \color{blue}{\left(-x\right)} \]
      9. associate-*l*89.9%

        \[\leadsto \color{blue}{\sqrt{\sqrt{2}} \cdot \left(\sqrt{\sqrt{2}} \cdot \left(-x\right)\right)} \]
      10. pow1/289.9%

        \[\leadsto \sqrt{\color{blue}{{2}^{0.5}}} \cdot \left(\sqrt{\sqrt{2}} \cdot \left(-x\right)\right) \]
      11. sqrt-pow189.9%

        \[\leadsto \color{blue}{{2}^{\left(\frac{0.5}{2}\right)}} \cdot \left(\sqrt{\sqrt{2}} \cdot \left(-x\right)\right) \]
      12. metadata-eval89.9%

        \[\leadsto {2}^{\color{blue}{0.25}} \cdot \left(\sqrt{\sqrt{2}} \cdot \left(-x\right)\right) \]
      13. pow1/289.9%

        \[\leadsto {2}^{0.25} \cdot \left(\sqrt{\color{blue}{{2}^{0.5}}} \cdot \left(-x\right)\right) \]
      14. sqrt-pow189.9%

        \[\leadsto {2}^{0.25} \cdot \left(\color{blue}{{2}^{\left(\frac{0.5}{2}\right)}} \cdot \left(-x\right)\right) \]
      15. metadata-eval89.9%

        \[\leadsto {2}^{0.25} \cdot \left({2}^{\color{blue}{0.25}} \cdot \left(-x\right)\right) \]
      16. add-sqr-sqrt88.8%

        \[\leadsto {2}^{0.25} \cdot \left({2}^{0.25} \cdot \color{blue}{\left(\sqrt{-x} \cdot \sqrt{-x}\right)}\right) \]
      17. sqrt-unprod53.1%

        \[\leadsto {2}^{0.25} \cdot \left({2}^{0.25} \cdot \color{blue}{\sqrt{\left(-x\right) \cdot \left(-x\right)}}\right) \]
      18. sqr-neg53.1%

        \[\leadsto {2}^{0.25} \cdot \left({2}^{0.25} \cdot \sqrt{\color{blue}{x \cdot x}}\right) \]
      19. sqrt-prod10.0%

        \[\leadsto {2}^{0.25} \cdot \left({2}^{0.25} \cdot \color{blue}{\left(\sqrt{x} \cdot \sqrt{x}\right)}\right) \]
      20. add-sqr-sqrt11.8%

        \[\leadsto {2}^{0.25} \cdot \left({2}^{0.25} \cdot \color{blue}{x}\right) \]
    5. Applied egg-rr11.8%

      \[\leadsto \color{blue}{{2}^{0.25} \cdot \left({2}^{0.25} \cdot x\right)} \]
    6. Step-by-step derivation
      1. associate-*r*11.8%

        \[\leadsto \color{blue}{\left({2}^{0.25} \cdot {2}^{0.25}\right) \cdot x} \]
      2. pow-prod-up11.8%

        \[\leadsto \color{blue}{{2}^{\left(0.25 + 0.25\right)}} \cdot x \]
      3. metadata-eval11.8%

        \[\leadsto {2}^{\color{blue}{0.5}} \cdot x \]
      4. pow1/211.8%

        \[\leadsto \color{blue}{\sqrt{2}} \cdot x \]
      5. add-sqr-sqrt10.0%

        \[\leadsto \sqrt{2} \cdot \color{blue}{\left(\sqrt{x} \cdot \sqrt{x}\right)} \]
      6. sqrt-prod53.2%

        \[\leadsto \sqrt{2} \cdot \color{blue}{\sqrt{x \cdot x}} \]
      7. sqrt-prod53.4%

        \[\leadsto \color{blue}{\sqrt{2 \cdot \left(x \cdot x\right)}} \]
      8. pow1/253.4%

        \[\leadsto \color{blue}{{\left(2 \cdot \left(x \cdot x\right)\right)}^{0.5}} \]
    7. Applied egg-rr53.4%

      \[\leadsto \color{blue}{{\left(2 \cdot \left(x \cdot x\right)\right)}^{0.5}} \]
    8. Simplified4.0%

      \[\leadsto \color{blue}{\sqrt{0 \cdot x}} \]

    if 3.19999999999999976e-206 < x

    1. Initial program 65.3%

      \[\sqrt{2 \cdot \left(x \cdot x\right)} \]
    2. Taylor expanded in x around -inf 1.3%

      \[\leadsto \color{blue}{-1 \cdot \left(\sqrt{2} \cdot x\right)} \]
    3. Step-by-step derivation
      1. mul-1-neg1.3%

        \[\leadsto \color{blue}{-\sqrt{2} \cdot x} \]
      2. distribute-rgt-neg-in1.3%

        \[\leadsto \color{blue}{\sqrt{2} \cdot \left(-x\right)} \]
    4. Simplified1.3%

      \[\leadsto \color{blue}{\sqrt{2} \cdot \left(-x\right)} \]
    5. Step-by-step derivation
      1. add-sqr-sqrt0.0%

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

        \[\leadsto \sqrt{2} \cdot \color{blue}{\sqrt{\left(-x\right) \cdot \left(-x\right)}} \]
      3. sqr-neg64.9%

        \[\leadsto \sqrt{2} \cdot \sqrt{\color{blue}{x \cdot x}} \]
      4. sqrt-prod65.3%

        \[\leadsto \color{blue}{\sqrt{2 \cdot \left(x \cdot x\right)}} \]
      5. add-cube-cbrt64.4%

        \[\leadsto \sqrt{\color{blue}{\left(\sqrt[3]{2 \cdot \left(x \cdot x\right)} \cdot \sqrt[3]{2 \cdot \left(x \cdot x\right)}\right) \cdot \sqrt[3]{2 \cdot \left(x \cdot x\right)}}} \]
      6. sqrt-prod64.5%

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

        \[\leadsto \color{blue}{\left(\sqrt{\sqrt[3]{2 \cdot \left(x \cdot x\right)}} \cdot \sqrt{\sqrt[3]{2 \cdot \left(x \cdot x\right)}}\right)} \cdot \sqrt{\sqrt[3]{2 \cdot \left(x \cdot x\right)}} \]
      8. add-sqr-sqrt64.5%

        \[\leadsto \color{blue}{\sqrt[3]{2 \cdot \left(x \cdot x\right)}} \cdot \sqrt{\sqrt[3]{2 \cdot \left(x \cdot x\right)}} \]
      9. pow164.5%

        \[\leadsto \color{blue}{{\left(\sqrt[3]{2 \cdot \left(x \cdot x\right)}\right)}^{1}} \cdot \sqrt{\sqrt[3]{2 \cdot \left(x \cdot x\right)}} \]
      10. pow1/264.5%

        \[\leadsto {\left(\sqrt[3]{2 \cdot \left(x \cdot x\right)}\right)}^{1} \cdot \color{blue}{{\left(\sqrt[3]{2 \cdot \left(x \cdot x\right)}\right)}^{0.5}} \]
      11. pow-prod-up64.5%

        \[\leadsto \color{blue}{{\left(\sqrt[3]{2 \cdot \left(x \cdot x\right)}\right)}^{\left(1 + 0.5\right)}} \]
      12. metadata-eval64.5%

        \[\leadsto {\left(\sqrt[3]{2 \cdot \left(x \cdot x\right)}\right)}^{\color{blue}{1.5}} \]
    6. Applied egg-rr64.5%

      \[\leadsto \color{blue}{{\left(\sqrt[3]{2 \cdot \left(x \cdot x\right)}\right)}^{1.5}} \]
    7. Step-by-step derivation
      1. pow1/359.8%

        \[\leadsto {\color{blue}{\left({\left(2 \cdot \left(x \cdot x\right)\right)}^{0.3333333333333333}\right)}}^{1.5} \]
      2. pow-pow65.3%

        \[\leadsto \color{blue}{{\left(2 \cdot \left(x \cdot x\right)\right)}^{\left(0.3333333333333333 \cdot 1.5\right)}} \]
      3. metadata-eval65.3%

        \[\leadsto {\left(2 \cdot \left(x \cdot x\right)\right)}^{\color{blue}{0.5}} \]
      4. pow1/265.3%

        \[\leadsto \color{blue}{\sqrt{2 \cdot \left(x \cdot x\right)}} \]
      5. associate-*r*65.3%

        \[\leadsto \sqrt{\color{blue}{\left(2 \cdot x\right) \cdot x}} \]
      6. count-265.3%

        \[\leadsto \sqrt{\color{blue}{\left(x + x\right)} \cdot x} \]
      7. sqrt-prod99.0%

        \[\leadsto \color{blue}{\sqrt{x + x} \cdot \sqrt{x}} \]
      8. flip-+0.0%

        \[\leadsto \sqrt{\color{blue}{\frac{x \cdot x - x \cdot x}{x - x}}} \cdot \sqrt{x} \]
      9. difference-of-squares0.0%

        \[\leadsto \sqrt{\frac{\color{blue}{\left(x + x\right) \cdot \left(x - x\right)}}{x - x}} \cdot \sqrt{x} \]
      10. +-inverses0.0%

        \[\leadsto \sqrt{\frac{\left(x + x\right) \cdot \color{blue}{0}}{x - x}} \cdot \sqrt{x} \]
      11. +-inverses0.0%

        \[\leadsto \sqrt{\frac{\left(x + x\right) \cdot \color{blue}{\left(x \cdot x - x \cdot x\right)}}{x - x}} \cdot \sqrt{x} \]
      12. +-inverses0.0%

        \[\leadsto \sqrt{\frac{\left(x + x\right) \cdot \left(x \cdot x - x \cdot x\right)}{\color{blue}{0}}} \cdot \sqrt{x} \]
      13. +-inverses0.0%

        \[\leadsto \sqrt{\frac{\left(x + x\right) \cdot \left(x \cdot x - x \cdot x\right)}{\color{blue}{x \cdot x - x \cdot x}}} \cdot \sqrt{x} \]
      14. associate-*r/0.0%

        \[\leadsto \sqrt{\color{blue}{\left(x + x\right) \cdot \frac{x \cdot x - x \cdot x}{x \cdot x - x \cdot x}}} \cdot \sqrt{x} \]
      15. +-inverses0.0%

        \[\leadsto \sqrt{\left(x + x\right) \cdot \frac{x \cdot x - x \cdot x}{\color{blue}{0}}} \cdot \sqrt{x} \]
      16. +-inverses0.0%

        \[\leadsto \sqrt{\left(x + x\right) \cdot \frac{x \cdot x - x \cdot x}{\color{blue}{x - x}}} \cdot \sqrt{x} \]
      17. flip-+7.9%

        \[\leadsto \sqrt{\left(x + x\right) \cdot \color{blue}{\left(x + x\right)}} \cdot \sqrt{x} \]
      18. sqrt-unprod8.1%

        \[\leadsto \color{blue}{\left(\sqrt{x + x} \cdot \sqrt{x + x}\right)} \cdot \sqrt{x} \]
      19. add-sqr-sqrt8.1%

        \[\leadsto \color{blue}{\left(x + x\right)} \cdot \sqrt{x} \]
    8. Applied egg-rr8.1%

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

      \[\leadsto \color{blue}{\sqrt{x}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification5.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 3.2 \cdot 10^{-206}:\\ \;\;\;\;\sqrt{x \cdot 0}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{x}\\ \end{array} \]

Alternative 6: 50.5% accurate, 1.0× speedup?

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

\\
\sqrt{2} \cdot x
\end{array}
Derivation
  1. Initial program 58.4%

    \[\sqrt{2 \cdot \left(x \cdot x\right)} \]
  2. Taylor expanded in x around 0 48.7%

    \[\leadsto \color{blue}{\sqrt{2} \cdot x} \]
  3. Final simplification48.7%

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

Alternative 7: 3.5% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \sqrt{x} \end{array} \]
(FPCore (x) :precision binary64 (sqrt x))
double code(double x) {
	return sqrt(x);
}
real(8) function code(x)
    real(8), intent (in) :: x
    code = sqrt(x)
end function
public static double code(double x) {
	return Math.sqrt(x);
}
def code(x):
	return math.sqrt(x)
function code(x)
	return sqrt(x)
end
function tmp = code(x)
	tmp = sqrt(x);
end
code[x_] := N[Sqrt[x], $MachinePrecision]
\begin{array}{l}

\\
\sqrt{x}
\end{array}
Derivation
  1. Initial program 58.4%

    \[\sqrt{2 \cdot \left(x \cdot x\right)} \]
  2. Taylor expanded in x around -inf 52.6%

    \[\leadsto \color{blue}{-1 \cdot \left(\sqrt{2} \cdot x\right)} \]
  3. Step-by-step derivation
    1. mul-1-neg52.6%

      \[\leadsto \color{blue}{-\sqrt{2} \cdot x} \]
    2. distribute-rgt-neg-in52.6%

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

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

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

      \[\leadsto \sqrt{2} \cdot \color{blue}{\sqrt{\left(-x\right) \cdot \left(-x\right)}} \]
    3. sqr-neg58.1%

      \[\leadsto \sqrt{2} \cdot \sqrt{\color{blue}{x \cdot x}} \]
    4. sqrt-prod58.4%

      \[\leadsto \color{blue}{\sqrt{2 \cdot \left(x \cdot x\right)}} \]
    5. add-cube-cbrt57.7%

      \[\leadsto \sqrt{\color{blue}{\left(\sqrt[3]{2 \cdot \left(x \cdot x\right)} \cdot \sqrt[3]{2 \cdot \left(x \cdot x\right)}\right) \cdot \sqrt[3]{2 \cdot \left(x \cdot x\right)}}} \]
    6. sqrt-prod57.8%

      \[\leadsto \color{blue}{\sqrt{\sqrt[3]{2 \cdot \left(x \cdot x\right)} \cdot \sqrt[3]{2 \cdot \left(x \cdot x\right)}} \cdot \sqrt{\sqrt[3]{2 \cdot \left(x \cdot x\right)}}} \]
    7. sqrt-unprod57.6%

      \[\leadsto \color{blue}{\left(\sqrt{\sqrt[3]{2 \cdot \left(x \cdot x\right)}} \cdot \sqrt{\sqrt[3]{2 \cdot \left(x \cdot x\right)}}\right)} \cdot \sqrt{\sqrt[3]{2 \cdot \left(x \cdot x\right)}} \]
    8. add-sqr-sqrt57.8%

      \[\leadsto \color{blue}{\sqrt[3]{2 \cdot \left(x \cdot x\right)}} \cdot \sqrt{\sqrt[3]{2 \cdot \left(x \cdot x\right)}} \]
    9. pow157.8%

      \[\leadsto \color{blue}{{\left(\sqrt[3]{2 \cdot \left(x \cdot x\right)}\right)}^{1}} \cdot \sqrt{\sqrt[3]{2 \cdot \left(x \cdot x\right)}} \]
    10. pow1/257.8%

      \[\leadsto {\left(\sqrt[3]{2 \cdot \left(x \cdot x\right)}\right)}^{1} \cdot \color{blue}{{\left(\sqrt[3]{2 \cdot \left(x \cdot x\right)}\right)}^{0.5}} \]
    11. pow-prod-up57.8%

      \[\leadsto \color{blue}{{\left(\sqrt[3]{2 \cdot \left(x \cdot x\right)}\right)}^{\left(1 + 0.5\right)}} \]
    12. metadata-eval57.8%

      \[\leadsto {\left(\sqrt[3]{2 \cdot \left(x \cdot x\right)}\right)}^{\color{blue}{1.5}} \]
  6. Applied egg-rr57.8%

    \[\leadsto \color{blue}{{\left(\sqrt[3]{2 \cdot \left(x \cdot x\right)}\right)}^{1.5}} \]
  7. Step-by-step derivation
    1. pow1/353.5%

      \[\leadsto {\color{blue}{\left({\left(2 \cdot \left(x \cdot x\right)\right)}^{0.3333333333333333}\right)}}^{1.5} \]
    2. pow-pow58.4%

      \[\leadsto \color{blue}{{\left(2 \cdot \left(x \cdot x\right)\right)}^{\left(0.3333333333333333 \cdot 1.5\right)}} \]
    3. metadata-eval58.4%

      \[\leadsto {\left(2 \cdot \left(x \cdot x\right)\right)}^{\color{blue}{0.5}} \]
    4. pow1/258.4%

      \[\leadsto \color{blue}{\sqrt{2 \cdot \left(x \cdot x\right)}} \]
    5. associate-*r*58.4%

      \[\leadsto \sqrt{\color{blue}{\left(2 \cdot x\right) \cdot x}} \]
    6. count-258.4%

      \[\leadsto \sqrt{\color{blue}{\left(x + x\right)} \cdot x} \]
    7. sqrt-prod47.6%

      \[\leadsto \color{blue}{\sqrt{x + x} \cdot \sqrt{x}} \]
    8. flip-+0.0%

      \[\leadsto \sqrt{\color{blue}{\frac{x \cdot x - x \cdot x}{x - x}}} \cdot \sqrt{x} \]
    9. difference-of-squares0.0%

      \[\leadsto \sqrt{\frac{\color{blue}{\left(x + x\right) \cdot \left(x - x\right)}}{x - x}} \cdot \sqrt{x} \]
    10. +-inverses0.0%

      \[\leadsto \sqrt{\frac{\left(x + x\right) \cdot \color{blue}{0}}{x - x}} \cdot \sqrt{x} \]
    11. +-inverses0.0%

      \[\leadsto \sqrt{\frac{\left(x + x\right) \cdot \color{blue}{\left(x \cdot x - x \cdot x\right)}}{x - x}} \cdot \sqrt{x} \]
    12. +-inverses0.0%

      \[\leadsto \sqrt{\frac{\left(x + x\right) \cdot \left(x \cdot x - x \cdot x\right)}{\color{blue}{0}}} \cdot \sqrt{x} \]
    13. +-inverses0.0%

      \[\leadsto \sqrt{\frac{\left(x + x\right) \cdot \left(x \cdot x - x \cdot x\right)}{\color{blue}{x \cdot x - x \cdot x}}} \cdot \sqrt{x} \]
    14. associate-*r/0.0%

      \[\leadsto \sqrt{\color{blue}{\left(x + x\right) \cdot \frac{x \cdot x - x \cdot x}{x \cdot x - x \cdot x}}} \cdot \sqrt{x} \]
    15. +-inverses0.0%

      \[\leadsto \sqrt{\left(x + x\right) \cdot \frac{x \cdot x - x \cdot x}{\color{blue}{0}}} \cdot \sqrt{x} \]
    16. +-inverses0.0%

      \[\leadsto \sqrt{\left(x + x\right) \cdot \frac{x \cdot x - x \cdot x}{\color{blue}{x - x}}} \cdot \sqrt{x} \]
    17. flip-+3.9%

      \[\leadsto \sqrt{\left(x + x\right) \cdot \color{blue}{\left(x + x\right)}} \cdot \sqrt{x} \]
    18. sqrt-unprod3.9%

      \[\leadsto \color{blue}{\left(\sqrt{x + x} \cdot \sqrt{x + x}\right)} \cdot \sqrt{x} \]
    19. add-sqr-sqrt3.9%

      \[\leadsto \color{blue}{\left(x + x\right)} \cdot \sqrt{x} \]
  8. Applied egg-rr3.9%

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

    \[\leadsto \color{blue}{\sqrt{x}} \]
  10. Final simplification3.3%

    \[\leadsto \sqrt{x} \]

Reproduce

?
herbie shell --seed 2023189 
(FPCore (x)
  :name "sqrt C (should all be same)"
  :precision binary64
  (sqrt (* 2.0 (* x x))))