math.cube on real

Percentage Accurate: 66.4% → 67.3%
Time: 6.0s
Alternatives: 5
Speedup: 1.0×

Specification

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

\\
\left(x \cdot x\right) \cdot x
\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 5 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: 66.4% accurate, 1.0× speedup?

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

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

Alternative 1: 67.3% accurate, 0.0× speedup?

\[\begin{array}{l} x = |x|\\ \\ \begin{array}{l} t_0 := -{x}^{3}\\ \mathbf{if}\;x \leq 1.46 \cdot 10^{-15}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 5.3 \cdot 10^{+97}:\\ \;\;\;\;{x}^{3}\\ \mathbf{elif}\;x \leq 2.55 \cdot 10^{+225}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(x \cdot x\right)\\ \end{array} \end{array} \]
NOTE: x should be positive before calling this function
(FPCore (x)
 :precision binary64
 (let* ((t_0 (- (pow x 3.0))))
   (if (<= x 1.46e-15)
     t_0
     (if (<= x 5.3e+97) (pow x 3.0) (if (<= x 2.55e+225) t_0 (* x (* x x)))))))
x = abs(x);
double code(double x) {
	double t_0 = -pow(x, 3.0);
	double tmp;
	if (x <= 1.46e-15) {
		tmp = t_0;
	} else if (x <= 5.3e+97) {
		tmp = pow(x, 3.0);
	} else if (x <= 2.55e+225) {
		tmp = t_0;
	} else {
		tmp = x * (x * x);
	}
	return tmp;
}
NOTE: x should be positive before calling this function
real(8) function code(x)
    real(8), intent (in) :: x
    real(8) :: t_0
    real(8) :: tmp
    t_0 = -(x ** 3.0d0)
    if (x <= 1.46d-15) then
        tmp = t_0
    else if (x <= 5.3d+97) then
        tmp = x ** 3.0d0
    else if (x <= 2.55d+225) then
        tmp = t_0
    else
        tmp = x * (x * x)
    end if
    code = tmp
end function
x = Math.abs(x);
public static double code(double x) {
	double t_0 = -Math.pow(x, 3.0);
	double tmp;
	if (x <= 1.46e-15) {
		tmp = t_0;
	} else if (x <= 5.3e+97) {
		tmp = Math.pow(x, 3.0);
	} else if (x <= 2.55e+225) {
		tmp = t_0;
	} else {
		tmp = x * (x * x);
	}
	return tmp;
}
x = abs(x)
def code(x):
	t_0 = -math.pow(x, 3.0)
	tmp = 0
	if x <= 1.46e-15:
		tmp = t_0
	elif x <= 5.3e+97:
		tmp = math.pow(x, 3.0)
	elif x <= 2.55e+225:
		tmp = t_0
	else:
		tmp = x * (x * x)
	return tmp
x = abs(x)
function code(x)
	t_0 = Float64(-(x ^ 3.0))
	tmp = 0.0
	if (x <= 1.46e-15)
		tmp = t_0;
	elseif (x <= 5.3e+97)
		tmp = x ^ 3.0;
	elseif (x <= 2.55e+225)
		tmp = t_0;
	else
		tmp = Float64(x * Float64(x * x));
	end
	return tmp
end
x = abs(x)
function tmp_2 = code(x)
	t_0 = -(x ^ 3.0);
	tmp = 0.0;
	if (x <= 1.46e-15)
		tmp = t_0;
	elseif (x <= 5.3e+97)
		tmp = x ^ 3.0;
	elseif (x <= 2.55e+225)
		tmp = t_0;
	else
		tmp = x * (x * x);
	end
	tmp_2 = tmp;
end
NOTE: x should be positive before calling this function
code[x_] := Block[{t$95$0 = (-N[Power[x, 3.0], $MachinePrecision])}, If[LessEqual[x, 1.46e-15], t$95$0, If[LessEqual[x, 5.3e+97], N[Power[x, 3.0], $MachinePrecision], If[LessEqual[x, 2.55e+225], t$95$0, N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
x = |x|\\
\\
\begin{array}{l}
t_0 := -{x}^{3}\\
\mathbf{if}\;x \leq 1.46 \cdot 10^{-15}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;x \leq 5.3 \cdot 10^{+97}:\\
\;\;\;\;{x}^{3}\\

\mathbf{elif}\;x \leq 2.55 \cdot 10^{+225}:\\
\;\;\;\;t_0\\

\mathbf{else}:\\
\;\;\;\;x \cdot \left(x \cdot x\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < 1.4600000000000001e-15 or 5.3000000000000003e97 < x < 2.55e225

    1. Initial program 99.9%

      \[\left(x \cdot x\right) \cdot x \]
    2. Step-by-step derivation
      1. add-cbrt-cube_binary6489.4%

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

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

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

        \[\leadsto \color{blue}{\left(x \cdot x\right) \cdot x} \]
      3. pow3100.0%

        \[\leadsto \color{blue}{{x}^{3}} \]
      4. sqr-pow35.8%

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

        \[\leadsto \color{blue}{{\left(x \cdot x\right)}^{\left(\frac{3}{2}\right)}} \]
      6. metadata-eval60.1%

        \[\leadsto {\left(x \cdot x\right)}^{\color{blue}{1.5}} \]
    5. Applied egg-rr60.1%

      \[\leadsto \color{blue}{{\left(x \cdot x\right)}^{1.5}} \]
    6. Taylor expanded in x around -inf 46.0%

      \[\leadsto \color{blue}{-1 \cdot {x}^{3}} \]
    7. Simplified46.0%

      \[\leadsto \color{blue}{-{x}^{3}} \]

    if 1.4600000000000001e-15 < x < 5.3000000000000003e97

    1. Initial program 99.7%

      \[\left(x \cdot x\right) \cdot x \]
    2. Step-by-step derivation
      1. unpow3100.0%

        \[\leadsto \color{blue}{{x}^{3}} \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{{x}^{3}} \]

    if 2.55e225 < x

    1. Initial program 100.0%

      \[\left(x \cdot x\right) \cdot x \]
  3. Recombined 3 regimes into one program.
  4. Final simplification57.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 1.46 \cdot 10^{-15}:\\ \;\;\;\;-{x}^{3}\\ \mathbf{elif}\;x \leq 5.3 \cdot 10^{+97}:\\ \;\;\;\;{x}^{3}\\ \mathbf{elif}\;x \leq 2.55 \cdot 10^{+225}:\\ \;\;\;\;-{x}^{3}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(x \cdot x\right)\\ \end{array} \]

Alternative 2: 66.5% accurate, 0.0× speedup?

\[\begin{array}{l} x = |x|\\ \\ {x}^{3} \end{array} \]
NOTE: x should be positive before calling this function
(FPCore (x) :precision binary64 (pow x 3.0))
x = abs(x);
double code(double x) {
	return pow(x, 3.0);
}
NOTE: x should be positive before calling this function
real(8) function code(x)
    real(8), intent (in) :: x
    code = x ** 3.0d0
end function
x = Math.abs(x);
public static double code(double x) {
	return Math.pow(x, 3.0);
}
x = abs(x)
def code(x):
	return math.pow(x, 3.0)
x = abs(x)
function code(x)
	return x ^ 3.0
end
x = abs(x)
function tmp = code(x)
	tmp = x ^ 3.0;
end
NOTE: x should be positive before calling this function
code[x_] := N[Power[x, 3.0], $MachinePrecision]
\begin{array}{l}
x = |x|\\
\\
{x}^{3}
\end{array}
Derivation
  1. Initial program 99.9%

    \[\left(x \cdot x\right) \cdot x \]
  2. Step-by-step derivation
    1. unpow3100.0%

      \[\leadsto \color{blue}{{x}^{3}} \]
  3. Simplified100.0%

    \[\leadsto \color{blue}{{x}^{3}} \]
  4. Final simplification100.0%

    \[\leadsto {x}^{3} \]

Alternative 3: 47.2% accurate, 1.0× speedup?

\[\begin{array}{l} x = |x|\\ \\ \begin{array}{l} \mathbf{if}\;x \leq 8.8 \cdot 10^{-48}:\\ \;\;\;\;0\\ \mathbf{else}:\\ \;\;\;\;x \cdot x\\ \end{array} \end{array} \]
NOTE: x should be positive before calling this function
(FPCore (x) :precision binary64 (if (<= x 8.8e-48) 0.0 (* x x)))
x = abs(x);
double code(double x) {
	double tmp;
	if (x <= 8.8e-48) {
		tmp = 0.0;
	} else {
		tmp = x * x;
	}
	return tmp;
}
NOTE: x should be positive before calling this function
real(8) function code(x)
    real(8), intent (in) :: x
    real(8) :: tmp
    if (x <= 8.8d-48) then
        tmp = 0.0d0
    else
        tmp = x * x
    end if
    code = tmp
end function
x = Math.abs(x);
public static double code(double x) {
	double tmp;
	if (x <= 8.8e-48) {
		tmp = 0.0;
	} else {
		tmp = x * x;
	}
	return tmp;
}
x = abs(x)
def code(x):
	tmp = 0
	if x <= 8.8e-48:
		tmp = 0.0
	else:
		tmp = x * x
	return tmp
x = abs(x)
function code(x)
	tmp = 0.0
	if (x <= 8.8e-48)
		tmp = 0.0;
	else
		tmp = Float64(x * x);
	end
	return tmp
end
x = abs(x)
function tmp_2 = code(x)
	tmp = 0.0;
	if (x <= 8.8e-48)
		tmp = 0.0;
	else
		tmp = x * x;
	end
	tmp_2 = tmp;
end
NOTE: x should be positive before calling this function
code[x_] := If[LessEqual[x, 8.8e-48], 0.0, N[(x * x), $MachinePrecision]]
\begin{array}{l}
x = |x|\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq 8.8 \cdot 10^{-48}:\\
\;\;\;\;0\\

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


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

    1. Initial program 99.9%

      \[\left(x \cdot x\right) \cdot x \]
    2. Step-by-step derivation
      1. add-cbrt-cube_binary6488.5%

        \[\leadsto \color{blue}{\sqrt[3]{\left(\left(\left(x \cdot x\right) \cdot x\right) \cdot \left(\left(x \cdot x\right) \cdot x\right)\right) \cdot \left(\left(x \cdot x\right) \cdot x\right)}} \]
    3. Applied rewrite-once88.5%

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

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

        \[\leadsto \color{blue}{\left(x \cdot x\right) \cdot x} \]
      3. pow3100.0%

        \[\leadsto \color{blue}{{x}^{3}} \]
      4. sqr-pow27.1%

        \[\leadsto \color{blue}{{x}^{\left(\frac{3}{2}\right)} \cdot {x}^{\left(\frac{3}{2}\right)}} \]
      5. pow-prod-down54.7%

        \[\leadsto \color{blue}{{\left(x \cdot x\right)}^{\left(\frac{3}{2}\right)}} \]
      6. metadata-eval54.7%

        \[\leadsto {\left(x \cdot x\right)}^{\color{blue}{1.5}} \]
    5. Applied egg-rr54.7%

      \[\leadsto \color{blue}{{\left(x \cdot x\right)}^{1.5}} \]
    6. Step-by-step derivation
      1. pow-to-exp54.4%

        \[\leadsto \color{blue}{e^{\log \left(x \cdot x\right) \cdot 1.5}} \]
      2. pow254.4%

        \[\leadsto e^{\log \color{blue}{\left({x}^{2}\right)} \cdot 1.5} \]
      3. log-pow26.9%

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

        \[\leadsto e^{\color{blue}{2 \cdot \left(\log x \cdot 1.5\right)}} \]
      5. exp-prod26.9%

        \[\leadsto \color{blue}{{\left(e^{2}\right)}^{\left(\log x \cdot 1.5\right)}} \]
      6. metadata-eval26.9%

        \[\leadsto {\left(e^{2}\right)}^{\left(\log x \cdot \color{blue}{\left(2 \cdot 0.75\right)}\right)} \]
      7. metadata-eval26.9%

        \[\leadsto {\left(e^{2}\right)}^{\left(\log x \cdot \left(2 \cdot \color{blue}{\frac{1.5}{2}}\right)\right)} \]
      8. associate-*l*26.9%

        \[\leadsto {\left(e^{2}\right)}^{\color{blue}{\left(\left(\log x \cdot 2\right) \cdot \frac{1.5}{2}\right)}} \]
      9. *-commutative26.9%

        \[\leadsto {\left(e^{2}\right)}^{\left(\color{blue}{\left(2 \cdot \log x\right)} \cdot \frac{1.5}{2}\right)} \]
      10. count-226.9%

        \[\leadsto {\left(e^{2}\right)}^{\left(\color{blue}{\left(\log x + \log x\right)} \cdot \frac{1.5}{2}\right)} \]
      11. flip-+0.0%

        \[\leadsto {\left(e^{2}\right)}^{\left(\color{blue}{\frac{\log x \cdot \log x - \log x \cdot \log x}{\log x - \log x}} \cdot \frac{1.5}{2}\right)} \]
      12. +-inverses0.0%

        \[\leadsto {\left(e^{2}\right)}^{\left(\frac{\log x \cdot \log x - \log x \cdot \log x}{\color{blue}{0}} \cdot \frac{1.5}{2}\right)} \]
      13. +-inverses0.0%

        \[\leadsto {\left(e^{2}\right)}^{\left(\frac{\log x \cdot \log x - \log x \cdot \log x}{\color{blue}{\log x \cdot \log x - \log x \cdot \log x}} \cdot \frac{1.5}{2}\right)} \]
      14. associate-*l/0.0%

        \[\leadsto {\left(e^{2}\right)}^{\color{blue}{\left(\frac{\left(\log x \cdot \log x - \log x \cdot \log x\right) \cdot \frac{1.5}{2}}{\log x \cdot \log x - \log x \cdot \log x}\right)}} \]
      15. +-inverses0.0%

        \[\leadsto {\left(e^{2}\right)}^{\left(\frac{\color{blue}{0} \cdot \frac{1.5}{2}}{\log x \cdot \log x - \log x \cdot \log x}\right)} \]
      16. metadata-eval0.0%

        \[\leadsto {\left(e^{2}\right)}^{\left(\frac{0 \cdot \color{blue}{0.75}}{\log x \cdot \log x - \log x \cdot \log x}\right)} \]
      17. metadata-eval0.0%

        \[\leadsto {\left(e^{2}\right)}^{\left(\frac{\color{blue}{0}}{\log x \cdot \log x - \log x \cdot \log x}\right)} \]
      18. +-inverses0.0%

        \[\leadsto {\left(e^{2}\right)}^{\left(\frac{\color{blue}{\log x \cdot \log x - \log x \cdot \log x}}{\log x \cdot \log x - \log x \cdot \log x}\right)} \]
    7. Applied egg-rr0.0%

      \[\leadsto \color{blue}{e^{\frac{0}{0}}} \]
    8. Simplified52.9%

      \[\leadsto \color{blue}{0} \]

    if 8.8000000000000005e-48 < x

    1. Initial program 99.8%

      \[\left(x \cdot x\right) \cdot x \]
    2. Step-by-step derivation
      1. add-cbrt-cube_binary6481.7%

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

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

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

        \[\leadsto \color{blue}{\left(x \cdot x\right) \cdot x} \]
      3. pow3100.0%

        \[\leadsto \color{blue}{{x}^{3}} \]
      4. sqr-pow99.6%

        \[\leadsto \color{blue}{{x}^{\left(\frac{3}{2}\right)} \cdot {x}^{\left(\frac{3}{2}\right)}} \]
      5. pow-prod-down99.7%

        \[\leadsto \color{blue}{{\left(x \cdot x\right)}^{\left(\frac{3}{2}\right)}} \]
      6. metadata-eval99.7%

        \[\leadsto {\left(x \cdot x\right)}^{\color{blue}{1.5}} \]
    5. Applied egg-rr99.7%

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

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

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

Alternative 4: 66.4% accurate, 1.0× speedup?

\[\begin{array}{l} x = |x|\\ \\ x \cdot \left(x \cdot x\right) \end{array} \]
NOTE: x should be positive before calling this function
(FPCore (x) :precision binary64 (* x (* x x)))
x = abs(x);
double code(double x) {
	return x * (x * x);
}
NOTE: x should be positive before calling this function
real(8) function code(x)
    real(8), intent (in) :: x
    code = x * (x * x)
end function
x = Math.abs(x);
public static double code(double x) {
	return x * (x * x);
}
x = abs(x)
def code(x):
	return x * (x * x)
x = abs(x)
function code(x)
	return Float64(x * Float64(x * x))
end
x = abs(x)
function tmp = code(x)
	tmp = x * (x * x);
end
NOTE: x should be positive before calling this function
code[x_] := N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x = |x|\\
\\
x \cdot \left(x \cdot x\right)
\end{array}
Derivation
  1. Initial program 99.9%

    \[\left(x \cdot x\right) \cdot x \]
  2. Final simplification99.9%

    \[\leadsto x \cdot \left(x \cdot x\right) \]

Alternative 5: 35.0% accurate, 5.0× speedup?

\[\begin{array}{l} x = |x|\\ \\ 0 \end{array} \]
NOTE: x should be positive before calling this function
(FPCore (x) :precision binary64 0.0)
x = abs(x);
double code(double x) {
	return 0.0;
}
NOTE: x should be positive before calling this function
real(8) function code(x)
    real(8), intent (in) :: x
    code = 0.0d0
end function
x = Math.abs(x);
public static double code(double x) {
	return 0.0;
}
x = abs(x)
def code(x):
	return 0.0
x = abs(x)
function code(x)
	return 0.0
end
x = abs(x)
function tmp = code(x)
	tmp = 0.0;
end
NOTE: x should be positive before calling this function
code[x_] := 0.0
\begin{array}{l}
x = |x|\\
\\
0
\end{array}
Derivation
  1. Initial program 99.9%

    \[\left(x \cdot x\right) \cdot x \]
  2. Step-by-step derivation
    1. add-cbrt-cube_binary6486.4%

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

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

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

      \[\leadsto \color{blue}{\left(x \cdot x\right) \cdot x} \]
    3. pow3100.0%

      \[\leadsto \color{blue}{{x}^{3}} \]
    4. sqr-pow49.5%

      \[\leadsto \color{blue}{{x}^{\left(\frac{3}{2}\right)} \cdot {x}^{\left(\frac{3}{2}\right)}} \]
    5. pow-prod-down68.6%

      \[\leadsto \color{blue}{{\left(x \cdot x\right)}^{\left(\frac{3}{2}\right)}} \]
    6. metadata-eval68.6%

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

    \[\leadsto \color{blue}{{\left(x \cdot x\right)}^{1.5}} \]
  6. Step-by-step derivation
    1. pow-to-exp67.2%

      \[\leadsto \color{blue}{e^{\log \left(x \cdot x\right) \cdot 1.5}} \]
    2. pow267.2%

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

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

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

      \[\leadsto \color{blue}{{\left(e^{2}\right)}^{\left(\log x \cdot 1.5\right)}} \]
    6. metadata-eval48.2%

      \[\leadsto {\left(e^{2}\right)}^{\left(\log x \cdot \color{blue}{\left(2 \cdot 0.75\right)}\right)} \]
    7. metadata-eval48.2%

      \[\leadsto {\left(e^{2}\right)}^{\left(\log x \cdot \left(2 \cdot \color{blue}{\frac{1.5}{2}}\right)\right)} \]
    8. associate-*l*48.2%

      \[\leadsto {\left(e^{2}\right)}^{\color{blue}{\left(\left(\log x \cdot 2\right) \cdot \frac{1.5}{2}\right)}} \]
    9. *-commutative48.2%

      \[\leadsto {\left(e^{2}\right)}^{\left(\color{blue}{\left(2 \cdot \log x\right)} \cdot \frac{1.5}{2}\right)} \]
    10. count-248.2%

      \[\leadsto {\left(e^{2}\right)}^{\left(\color{blue}{\left(\log x + \log x\right)} \cdot \frac{1.5}{2}\right)} \]
    11. flip-+0.0%

      \[\leadsto {\left(e^{2}\right)}^{\left(\color{blue}{\frac{\log x \cdot \log x - \log x \cdot \log x}{\log x - \log x}} \cdot \frac{1.5}{2}\right)} \]
    12. +-inverses0.0%

      \[\leadsto {\left(e^{2}\right)}^{\left(\frac{\log x \cdot \log x - \log x \cdot \log x}{\color{blue}{0}} \cdot \frac{1.5}{2}\right)} \]
    13. +-inverses0.0%

      \[\leadsto {\left(e^{2}\right)}^{\left(\frac{\log x \cdot \log x - \log x \cdot \log x}{\color{blue}{\log x \cdot \log x - \log x \cdot \log x}} \cdot \frac{1.5}{2}\right)} \]
    14. associate-*l/0.0%

      \[\leadsto {\left(e^{2}\right)}^{\color{blue}{\left(\frac{\left(\log x \cdot \log x - \log x \cdot \log x\right) \cdot \frac{1.5}{2}}{\log x \cdot \log x - \log x \cdot \log x}\right)}} \]
    15. +-inverses0.0%

      \[\leadsto {\left(e^{2}\right)}^{\left(\frac{\color{blue}{0} \cdot \frac{1.5}{2}}{\log x \cdot \log x - \log x \cdot \log x}\right)} \]
    16. metadata-eval0.0%

      \[\leadsto {\left(e^{2}\right)}^{\left(\frac{0 \cdot \color{blue}{0.75}}{\log x \cdot \log x - \log x \cdot \log x}\right)} \]
    17. metadata-eval0.0%

      \[\leadsto {\left(e^{2}\right)}^{\left(\frac{\color{blue}{0}}{\log x \cdot \log x - \log x \cdot \log x}\right)} \]
    18. +-inverses0.0%

      \[\leadsto {\left(e^{2}\right)}^{\left(\frac{\color{blue}{\log x \cdot \log x - \log x \cdot \log x}}{\log x \cdot \log x - \log x \cdot \log x}\right)} \]
  7. Applied egg-rr0.0%

    \[\leadsto \color{blue}{e^{\frac{0}{0}}} \]
  8. Simplified37.2%

    \[\leadsto \color{blue}{0} \]
  9. Final simplification37.2%

    \[\leadsto 0 \]

Developer target: 66.5% accurate, 0.0× speedup?

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

\\
{x}^{3}
\end{array}

Reproduce

?
herbie shell --seed 2023297 
(FPCore (x)
  :name "math.cube on real"
  :precision binary64

  :herbie-target
  (pow x 3.0)

  (* (* x x) x))