FastMath test5

Percentage Accurate: 99.9% → 100.0%
Time: 1.5min
Alternatives: 13
Speedup: 1.0×

Specification

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

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

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

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

Alternative 1: 100.0% accurate, 0.2× speedup?

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

\\
{d1}^{10}
\end{array}
Derivation
  1. Initial program 99.9%

    \[\left(d1 \cdot \left(\left(\left(\left(\left(d1 \cdot \left(d1 \cdot d1\right)\right) \cdot d1\right) \cdot d1\right) \cdot \left(d1 \cdot d1\right)\right) \cdot d1\right)\right) \cdot d1 \]
  2. Step-by-step derivation
    1. *-commutativeN/A

      \[\leadsto d1 \cdot \color{blue}{\left(d1 \cdot \left(\left(\left(\left(\left(d1 \cdot \left(d1 \cdot d1\right)\right) \cdot d1\right) \cdot d1\right) \cdot \left(d1 \cdot d1\right)\right) \cdot d1\right)\right)} \]
    2. associate-*r*N/A

      \[\leadsto \left(d1 \cdot d1\right) \cdot \color{blue}{\left(\left(\left(\left(\left(d1 \cdot \left(d1 \cdot d1\right)\right) \cdot d1\right) \cdot d1\right) \cdot \left(d1 \cdot d1\right)\right) \cdot d1\right)} \]
    3. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\left(d1 \cdot d1\right), \color{blue}{\left(\left(\left(\left(\left(d1 \cdot \left(d1 \cdot d1\right)\right) \cdot d1\right) \cdot d1\right) \cdot \left(d1 \cdot d1\right)\right) \cdot d1\right)}\right) \]
    4. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, d1\right), \left(\color{blue}{\left(\left(\left(\left(d1 \cdot \left(d1 \cdot d1\right)\right) \cdot d1\right) \cdot d1\right) \cdot \left(d1 \cdot d1\right)\right)} \cdot d1\right)\right) \]
    5. associate-*l*N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, d1\right), \left(\left(\left(\left(d1 \cdot \left(d1 \cdot d1\right)\right) \cdot d1\right) \cdot \left(d1 \cdot \left(d1 \cdot d1\right)\right)\right) \cdot d1\right)\right) \]
    6. associate-*l*N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, d1\right), \left(\left(\left(d1 \cdot \left(d1 \cdot d1\right)\right) \cdot d1\right) \cdot \color{blue}{\left(\left(d1 \cdot \left(d1 \cdot d1\right)\right) \cdot d1\right)}\right)\right) \]
    7. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, d1\right), \mathsf{*.f64}\left(\left(\left(d1 \cdot \left(d1 \cdot d1\right)\right) \cdot d1\right), \color{blue}{\left(\left(d1 \cdot \left(d1 \cdot d1\right)\right) \cdot d1\right)}\right)\right) \]
    8. *-commutativeN/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, d1\right), \mathsf{*.f64}\left(\left(d1 \cdot \left(d1 \cdot \left(d1 \cdot d1\right)\right)\right), \left(\color{blue}{\left(d1 \cdot \left(d1 \cdot d1\right)\right)} \cdot d1\right)\right)\right) \]
    9. associate-*r*N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, d1\right), \mathsf{*.f64}\left(\left(\left(d1 \cdot d1\right) \cdot \left(d1 \cdot d1\right)\right), \left(\color{blue}{\left(d1 \cdot \left(d1 \cdot d1\right)\right)} \cdot d1\right)\right)\right) \]
    10. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, d1\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(d1 \cdot d1\right), \left(d1 \cdot d1\right)\right), \left(\color{blue}{\left(d1 \cdot \left(d1 \cdot d1\right)\right)} \cdot d1\right)\right)\right) \]
    11. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, d1\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, d1\right), \left(d1 \cdot d1\right)\right), \left(\left(\color{blue}{d1} \cdot \left(d1 \cdot d1\right)\right) \cdot d1\right)\right)\right) \]
    12. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, d1\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, d1\right), \mathsf{*.f64}\left(d1, d1\right)\right), \left(\left(d1 \cdot \color{blue}{\left(d1 \cdot d1\right)}\right) \cdot d1\right)\right)\right) \]
    13. *-commutativeN/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, d1\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, d1\right), \mathsf{*.f64}\left(d1, d1\right)\right), \left(d1 \cdot \color{blue}{\left(d1 \cdot \left(d1 \cdot d1\right)\right)}\right)\right)\right) \]
    14. associate-*r*N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, d1\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, d1\right), \mathsf{*.f64}\left(d1, d1\right)\right), \left(\left(d1 \cdot d1\right) \cdot \color{blue}{\left(d1 \cdot d1\right)}\right)\right)\right) \]
    15. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, d1\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, d1\right), \mathsf{*.f64}\left(d1, d1\right)\right), \mathsf{*.f64}\left(\left(d1 \cdot d1\right), \color{blue}{\left(d1 \cdot d1\right)}\right)\right)\right) \]
    16. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, d1\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, d1\right), \mathsf{*.f64}\left(d1, d1\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, d1\right), \left(\color{blue}{d1} \cdot d1\right)\right)\right)\right) \]
    17. *-lowering-*.f6499.8%

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, d1\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, d1\right), \mathsf{*.f64}\left(d1, d1\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, d1\right), \mathsf{*.f64}\left(d1, \color{blue}{d1}\right)\right)\right)\right) \]
  3. Simplified99.8%

    \[\leadsto \color{blue}{\left(d1 \cdot d1\right) \cdot \left(\left(\left(d1 \cdot d1\right) \cdot \left(d1 \cdot d1\right)\right) \cdot \left(\left(d1 \cdot d1\right) \cdot \left(d1 \cdot d1\right)\right)\right)} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. associate-*r*N/A

      \[\leadsto \left(\left(d1 \cdot d1\right) \cdot \left(\left(d1 \cdot d1\right) \cdot \left(d1 \cdot d1\right)\right)\right) \cdot \color{blue}{\left(\left(d1 \cdot d1\right) \cdot \left(d1 \cdot d1\right)\right)} \]
    2. unswap-sqrN/A

      \[\leadsto \left(\left(d1 \cdot \left(d1 \cdot d1\right)\right) \cdot \left(d1 \cdot \left(d1 \cdot d1\right)\right)\right) \cdot \left(\color{blue}{\left(d1 \cdot d1\right)} \cdot \left(d1 \cdot d1\right)\right) \]
    3. pow2N/A

      \[\leadsto {\left(d1 \cdot \left(d1 \cdot d1\right)\right)}^{2} \cdot \left(\color{blue}{\left(d1 \cdot d1\right)} \cdot \left(d1 \cdot d1\right)\right) \]
    4. pow2N/A

      \[\leadsto {\left(d1 \cdot \left(d1 \cdot d1\right)\right)}^{2} \cdot {\left(d1 \cdot d1\right)}^{\color{blue}{2}} \]
    5. unpow-prod-downN/A

      \[\leadsto {\left(\left(d1 \cdot \left(d1 \cdot d1\right)\right) \cdot \left(d1 \cdot d1\right)\right)}^{\color{blue}{2}} \]
    6. cube-unmultN/A

      \[\leadsto {\left({d1}^{3} \cdot \left(d1 \cdot d1\right)\right)}^{2} \]
    7. pow2N/A

      \[\leadsto {\left({d1}^{3} \cdot {d1}^{2}\right)}^{2} \]
    8. pow-prod-upN/A

      \[\leadsto {\left({d1}^{\left(3 + 2\right)}\right)}^{2} \]
    9. pow-powN/A

      \[\leadsto {d1}^{\color{blue}{\left(\left(3 + 2\right) \cdot 2\right)}} \]
    10. pow-lowering-pow.f64N/A

      \[\leadsto \mathsf{pow.f64}\left(d1, \color{blue}{\left(\left(3 + 2\right) \cdot 2\right)}\right) \]
    11. metadata-evalN/A

      \[\leadsto \mathsf{pow.f64}\left(d1, \left(5 \cdot 2\right)\right) \]
    12. metadata-eval100.0%

      \[\leadsto \mathsf{pow.f64}\left(d1, 10\right) \]
  6. Applied egg-rr100.0%

    \[\leadsto \color{blue}{{d1}^{10}} \]
  7. Add Preprocessing

Alternative 2: 99.9% accurate, 1.0× speedup?

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

\\
d1 \cdot \left(d1 \cdot \left(d1 \cdot \left(d1 \cdot \left(d1 \cdot \left(\left(d1 \cdot d1\right) \cdot \left(d1 \cdot \left(d1 \cdot d1\right)\right)\right)\right)\right)\right)\right)
\end{array}
Derivation
  1. Initial program 99.9%

    \[\left(d1 \cdot \left(\left(\left(\left(\left(d1 \cdot \left(d1 \cdot d1\right)\right) \cdot d1\right) \cdot d1\right) \cdot \left(d1 \cdot d1\right)\right) \cdot d1\right)\right) \cdot d1 \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. associate-*l*N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\left(d1 \cdot \left(d1 \cdot d1\right)\right) \cdot \left(d1 \cdot d1\right)\right), \mathsf{*.f64}\left(d1, d1\right)\right), d1\right)\right), d1\right) \]
    2. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(d1 \cdot \left(d1 \cdot d1\right)\right), \left(d1 \cdot d1\right)\right), \mathsf{*.f64}\left(d1, d1\right)\right), d1\right)\right), d1\right) \]
    3. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \left(d1 \cdot d1\right)\right), \left(d1 \cdot d1\right)\right), \mathsf{*.f64}\left(d1, d1\right)\right), d1\right)\right), d1\right) \]
    4. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, d1\right)\right), \left(d1 \cdot d1\right)\right), \mathsf{*.f64}\left(d1, d1\right)\right), d1\right)\right), d1\right) \]
    5. *-lowering-*.f6499.9%

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, d1\right)\right), \mathsf{*.f64}\left(d1, d1\right)\right), \mathsf{*.f64}\left(d1, d1\right)\right), d1\right)\right), d1\right) \]
  4. Applied egg-rr99.9%

    \[\leadsto \left(d1 \cdot \left(\left(\color{blue}{\left(\left(d1 \cdot \left(d1 \cdot d1\right)\right) \cdot \left(d1 \cdot d1\right)\right)} \cdot \left(d1 \cdot d1\right)\right) \cdot d1\right)\right) \cdot d1 \]
  5. Step-by-step derivation
    1. *-commutativeN/A

      \[\leadsto \mathsf{*.f64}\left(\left(\left(\left(\left(\left(d1 \cdot \left(d1 \cdot d1\right)\right) \cdot \left(d1 \cdot d1\right)\right) \cdot \left(d1 \cdot d1\right)\right) \cdot d1\right) \cdot d1\right), d1\right) \]
    2. *-lowering-*.f64N/A

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(d1 \cdot \left(\left(\left(d1 \cdot \left(d1 \cdot d1\right)\right) \cdot \left(d1 \cdot d1\right)\right) \cdot \left(d1 \cdot d1\right)\right)\right), d1\right), d1\right) \]
    4. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \left(\left(\left(d1 \cdot \left(d1 \cdot d1\right)\right) \cdot \left(d1 \cdot d1\right)\right) \cdot \left(d1 \cdot d1\right)\right)\right), d1\right), d1\right) \]
    5. associate-*l*N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \left(\left(d1 \cdot \left(d1 \cdot d1\right)\right) \cdot \left(\left(d1 \cdot d1\right) \cdot \left(d1 \cdot d1\right)\right)\right)\right), d1\right), d1\right) \]
    6. associate-*r*N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \left(\left(d1 \cdot \left(d1 \cdot d1\right)\right) \cdot \left(d1 \cdot \left(d1 \cdot \left(d1 \cdot d1\right)\right)\right)\right)\right), d1\right), d1\right) \]
    7. associate-*r*N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \left(d1 \cdot \left(\left(d1 \cdot d1\right) \cdot \left(d1 \cdot \left(d1 \cdot \left(d1 \cdot d1\right)\right)\right)\right)\right)\right), d1\right), d1\right) \]
    8. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \left(\left(d1 \cdot d1\right) \cdot \left(d1 \cdot \left(d1 \cdot \left(d1 \cdot d1\right)\right)\right)\right)\right)\right), d1\right), d1\right) \]
    9. associate-*l*N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \left(d1 \cdot \left(d1 \cdot \left(d1 \cdot \left(d1 \cdot \left(d1 \cdot d1\right)\right)\right)\right)\right)\right)\right), d1\right), d1\right) \]
    10. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \left(d1 \cdot \left(d1 \cdot \left(d1 \cdot \left(d1 \cdot d1\right)\right)\right)\right)\right)\right)\right), d1\right), d1\right) \]
    11. associate-*r*N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \left(\left(d1 \cdot d1\right) \cdot \left(d1 \cdot \left(d1 \cdot d1\right)\right)\right)\right)\right)\right), d1\right), d1\right) \]
    12. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(\left(d1 \cdot d1\right), \left(d1 \cdot \left(d1 \cdot d1\right)\right)\right)\right)\right)\right), d1\right), d1\right) \]
    13. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, d1\right), \left(d1 \cdot \left(d1 \cdot d1\right)\right)\right)\right)\right)\right), d1\right), d1\right) \]
    14. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, d1\right), \mathsf{*.f64}\left(d1, \left(d1 \cdot d1\right)\right)\right)\right)\right)\right), d1\right), d1\right) \]
    15. *-lowering-*.f6499.9%

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, d1\right), \mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, d1\right)\right)\right)\right)\right)\right), d1\right), d1\right) \]
  6. Applied egg-rr99.9%

    \[\leadsto \color{blue}{\left(\left(d1 \cdot \left(d1 \cdot \left(d1 \cdot \left(\left(d1 \cdot d1\right) \cdot \left(d1 \cdot \left(d1 \cdot d1\right)\right)\right)\right)\right)\right) \cdot d1\right)} \cdot d1 \]
  7. Final simplification99.9%

    \[\leadsto d1 \cdot \left(d1 \cdot \left(d1 \cdot \left(d1 \cdot \left(d1 \cdot \left(\left(d1 \cdot d1\right) \cdot \left(d1 \cdot \left(d1 \cdot d1\right)\right)\right)\right)\right)\right)\right) \]
  8. Add Preprocessing

Alternative 3: 99.9% accurate, 1.0× speedup?

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

\\
d1 \cdot \left(d1 \cdot \left(d1 \cdot \left(\left(d1 \cdot d1\right) \cdot \left(d1 \cdot \left(d1 \cdot \left(d1 \cdot \left(d1 \cdot d1\right)\right)\right)\right)\right)\right)\right)
\end{array}
Derivation
  1. Initial program 99.9%

    \[\left(d1 \cdot \left(\left(\left(\left(\left(d1 \cdot \left(d1 \cdot d1\right)\right) \cdot d1\right) \cdot d1\right) \cdot \left(d1 \cdot d1\right)\right) \cdot d1\right)\right) \cdot d1 \]
  2. Add Preprocessing
  3. Final simplification99.9%

    \[\leadsto d1 \cdot \left(d1 \cdot \left(d1 \cdot \left(\left(d1 \cdot d1\right) \cdot \left(d1 \cdot \left(d1 \cdot \left(d1 \cdot \left(d1 \cdot d1\right)\right)\right)\right)\right)\right)\right) \]
  4. Add Preprocessing

Alternative 4: 99.9% accurate, 1.0× speedup?

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

\\
d1 \cdot \left(d1 \cdot \left(d1 \cdot \left(\left(d1 \cdot d1\right) \cdot \left(\left(d1 \cdot d1\right) \cdot \left(d1 \cdot \left(d1 \cdot d1\right)\right)\right)\right)\right)\right)
\end{array}
Derivation
  1. Initial program 99.9%

    \[\left(d1 \cdot \left(\left(\left(\left(\left(d1 \cdot \left(d1 \cdot d1\right)\right) \cdot d1\right) \cdot d1\right) \cdot \left(d1 \cdot d1\right)\right) \cdot d1\right)\right) \cdot d1 \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. associate-*l*N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\left(d1 \cdot \left(d1 \cdot d1\right)\right) \cdot \left(d1 \cdot d1\right)\right), \mathsf{*.f64}\left(d1, d1\right)\right), d1\right)\right), d1\right) \]
    2. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(d1 \cdot \left(d1 \cdot d1\right)\right), \left(d1 \cdot d1\right)\right), \mathsf{*.f64}\left(d1, d1\right)\right), d1\right)\right), d1\right) \]
    3. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \left(d1 \cdot d1\right)\right), \left(d1 \cdot d1\right)\right), \mathsf{*.f64}\left(d1, d1\right)\right), d1\right)\right), d1\right) \]
    4. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, d1\right)\right), \left(d1 \cdot d1\right)\right), \mathsf{*.f64}\left(d1, d1\right)\right), d1\right)\right), d1\right) \]
    5. *-lowering-*.f6499.9%

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, d1\right)\right), \mathsf{*.f64}\left(d1, d1\right)\right), \mathsf{*.f64}\left(d1, d1\right)\right), d1\right)\right), d1\right) \]
  4. Applied egg-rr99.9%

    \[\leadsto \left(d1 \cdot \left(\left(\color{blue}{\left(\left(d1 \cdot \left(d1 \cdot d1\right)\right) \cdot \left(d1 \cdot d1\right)\right)} \cdot \left(d1 \cdot d1\right)\right) \cdot d1\right)\right) \cdot d1 \]
  5. Final simplification99.9%

    \[\leadsto d1 \cdot \left(d1 \cdot \left(d1 \cdot \left(\left(d1 \cdot d1\right) \cdot \left(\left(d1 \cdot d1\right) \cdot \left(d1 \cdot \left(d1 \cdot d1\right)\right)\right)\right)\right)\right) \]
  6. Add Preprocessing

Alternative 5: 99.9% accurate, 1.0× speedup?

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

\\
\left(d1 \cdot d1\right) \cdot \left(d1 \cdot \left(d1 \cdot \left(\left(d1 \cdot d1\right) \cdot \left(d1 \cdot \left(d1 \cdot \left(d1 \cdot d1\right)\right)\right)\right)\right)\right)
\end{array}
Derivation
  1. Initial program 99.9%

    \[\left(d1 \cdot \left(\left(\left(\left(\left(d1 \cdot \left(d1 \cdot d1\right)\right) \cdot d1\right) \cdot d1\right) \cdot \left(d1 \cdot d1\right)\right) \cdot d1\right)\right) \cdot d1 \]
  2. Step-by-step derivation
    1. *-commutativeN/A

      \[\leadsto d1 \cdot \color{blue}{\left(d1 \cdot \left(\left(\left(\left(\left(d1 \cdot \left(d1 \cdot d1\right)\right) \cdot d1\right) \cdot d1\right) \cdot \left(d1 \cdot d1\right)\right) \cdot d1\right)\right)} \]
    2. associate-*r*N/A

      \[\leadsto \left(d1 \cdot d1\right) \cdot \color{blue}{\left(\left(\left(\left(\left(d1 \cdot \left(d1 \cdot d1\right)\right) \cdot d1\right) \cdot d1\right) \cdot \left(d1 \cdot d1\right)\right) \cdot d1\right)} \]
    3. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\left(d1 \cdot d1\right), \color{blue}{\left(\left(\left(\left(\left(d1 \cdot \left(d1 \cdot d1\right)\right) \cdot d1\right) \cdot d1\right) \cdot \left(d1 \cdot d1\right)\right) \cdot d1\right)}\right) \]
    4. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, d1\right), \left(\color{blue}{\left(\left(\left(\left(d1 \cdot \left(d1 \cdot d1\right)\right) \cdot d1\right) \cdot d1\right) \cdot \left(d1 \cdot d1\right)\right)} \cdot d1\right)\right) \]
    5. associate-*l*N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, d1\right), \left(\left(\left(\left(d1 \cdot \left(d1 \cdot d1\right)\right) \cdot d1\right) \cdot \left(d1 \cdot \left(d1 \cdot d1\right)\right)\right) \cdot d1\right)\right) \]
    6. associate-*l*N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, d1\right), \left(\left(\left(d1 \cdot \left(d1 \cdot d1\right)\right) \cdot d1\right) \cdot \color{blue}{\left(\left(d1 \cdot \left(d1 \cdot d1\right)\right) \cdot d1\right)}\right)\right) \]
    7. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, d1\right), \mathsf{*.f64}\left(\left(\left(d1 \cdot \left(d1 \cdot d1\right)\right) \cdot d1\right), \color{blue}{\left(\left(d1 \cdot \left(d1 \cdot d1\right)\right) \cdot d1\right)}\right)\right) \]
    8. *-commutativeN/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, d1\right), \mathsf{*.f64}\left(\left(d1 \cdot \left(d1 \cdot \left(d1 \cdot d1\right)\right)\right), \left(\color{blue}{\left(d1 \cdot \left(d1 \cdot d1\right)\right)} \cdot d1\right)\right)\right) \]
    9. associate-*r*N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, d1\right), \mathsf{*.f64}\left(\left(\left(d1 \cdot d1\right) \cdot \left(d1 \cdot d1\right)\right), \left(\color{blue}{\left(d1 \cdot \left(d1 \cdot d1\right)\right)} \cdot d1\right)\right)\right) \]
    10. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, d1\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(d1 \cdot d1\right), \left(d1 \cdot d1\right)\right), \left(\color{blue}{\left(d1 \cdot \left(d1 \cdot d1\right)\right)} \cdot d1\right)\right)\right) \]
    11. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, d1\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, d1\right), \left(d1 \cdot d1\right)\right), \left(\left(\color{blue}{d1} \cdot \left(d1 \cdot d1\right)\right) \cdot d1\right)\right)\right) \]
    12. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, d1\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, d1\right), \mathsf{*.f64}\left(d1, d1\right)\right), \left(\left(d1 \cdot \color{blue}{\left(d1 \cdot d1\right)}\right) \cdot d1\right)\right)\right) \]
    13. *-commutativeN/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, d1\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, d1\right), \mathsf{*.f64}\left(d1, d1\right)\right), \left(d1 \cdot \color{blue}{\left(d1 \cdot \left(d1 \cdot d1\right)\right)}\right)\right)\right) \]
    14. associate-*r*N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, d1\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, d1\right), \mathsf{*.f64}\left(d1, d1\right)\right), \left(\left(d1 \cdot d1\right) \cdot \color{blue}{\left(d1 \cdot d1\right)}\right)\right)\right) \]
    15. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, d1\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, d1\right), \mathsf{*.f64}\left(d1, d1\right)\right), \mathsf{*.f64}\left(\left(d1 \cdot d1\right), \color{blue}{\left(d1 \cdot d1\right)}\right)\right)\right) \]
    16. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, d1\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, d1\right), \mathsf{*.f64}\left(d1, d1\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, d1\right), \left(\color{blue}{d1} \cdot d1\right)\right)\right)\right) \]
    17. *-lowering-*.f6499.8%

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, d1\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, d1\right), \mathsf{*.f64}\left(d1, d1\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, d1\right), \mathsf{*.f64}\left(d1, \color{blue}{d1}\right)\right)\right)\right) \]
  3. Simplified99.8%

    \[\leadsto \color{blue}{\left(d1 \cdot d1\right) \cdot \left(\left(\left(d1 \cdot d1\right) \cdot \left(d1 \cdot d1\right)\right) \cdot \left(\left(d1 \cdot d1\right) \cdot \left(d1 \cdot d1\right)\right)\right)} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. associate-*r*N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, d1\right), \left(\left(\left(d1 \cdot d1\right) \cdot \left(d1 \cdot d1\right)\right) \cdot \left(\left(\left(d1 \cdot d1\right) \cdot d1\right) \cdot \color{blue}{d1}\right)\right)\right) \]
    2. associate-*r*N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, d1\right), \left(\left(\left(d1 \cdot d1\right) \cdot \left(d1 \cdot d1\right)\right) \cdot \left(\left(d1 \cdot \left(d1 \cdot d1\right)\right) \cdot d1\right)\right)\right) \]
    3. associate-*r*N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, d1\right), \left(\left(\left(\left(d1 \cdot d1\right) \cdot \left(d1 \cdot d1\right)\right) \cdot \left(d1 \cdot \left(d1 \cdot d1\right)\right)\right) \cdot \color{blue}{d1}\right)\right) \]
    4. associate-*l*N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, d1\right), \left(\left(\left(\left(\left(d1 \cdot d1\right) \cdot \left(d1 \cdot d1\right)\right) \cdot d1\right) \cdot \left(d1 \cdot d1\right)\right) \cdot d1\right)\right) \]
    5. associate-*r*N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, d1\right), \left(\left(\left(\left(\left(\left(d1 \cdot d1\right) \cdot d1\right) \cdot d1\right) \cdot d1\right) \cdot \left(d1 \cdot d1\right)\right) \cdot d1\right)\right) \]
    6. associate-*r*N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, d1\right), \left(\left(\left(\left(\left(d1 \cdot \left(d1 \cdot d1\right)\right) \cdot d1\right) \cdot d1\right) \cdot \left(d1 \cdot d1\right)\right) \cdot d1\right)\right) \]
    7. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, d1\right), \mathsf{*.f64}\left(\left(\left(\left(\left(d1 \cdot \left(d1 \cdot d1\right)\right) \cdot d1\right) \cdot d1\right) \cdot \left(d1 \cdot d1\right)\right), \color{blue}{d1}\right)\right) \]
  6. Applied egg-rr99.9%

    \[\leadsto \left(d1 \cdot d1\right) \cdot \color{blue}{\left(\left(d1 \cdot \left(\left(d1 \cdot d1\right) \cdot \left(d1 \cdot \left(d1 \cdot \left(d1 \cdot d1\right)\right)\right)\right)\right) \cdot d1\right)} \]
  7. Final simplification99.9%

    \[\leadsto \left(d1 \cdot d1\right) \cdot \left(d1 \cdot \left(d1 \cdot \left(\left(d1 \cdot d1\right) \cdot \left(d1 \cdot \left(d1 \cdot \left(d1 \cdot d1\right)\right)\right)\right)\right)\right) \]
  8. Add Preprocessing

Alternative 6: 88.4% accurate, 1.3× speedup?

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

\\
d1 \cdot \left(d1 \cdot \left(d1 \cdot \left(d1 \cdot \left(d1 \cdot \left(d1 \cdot \left(d1 \cdot d1\right)\right)\right)\right)\right)\right)
\end{array}
Derivation
  1. Initial program 99.9%

    \[\left(d1 \cdot \left(\left(\left(\left(\left(d1 \cdot \left(d1 \cdot d1\right)\right) \cdot d1\right) \cdot d1\right) \cdot \left(d1 \cdot d1\right)\right) \cdot d1\right)\right) \cdot d1 \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. associate-*l*N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\left(d1 \cdot \left(d1 \cdot d1\right)\right) \cdot \left(d1 \cdot d1\right)\right), \mathsf{*.f64}\left(d1, d1\right)\right), d1\right)\right), d1\right) \]
    2. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(d1 \cdot \left(d1 \cdot d1\right)\right), \left(d1 \cdot d1\right)\right), \mathsf{*.f64}\left(d1, d1\right)\right), d1\right)\right), d1\right) \]
    3. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \left(d1 \cdot d1\right)\right), \left(d1 \cdot d1\right)\right), \mathsf{*.f64}\left(d1, d1\right)\right), d1\right)\right), d1\right) \]
    4. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, d1\right)\right), \left(d1 \cdot d1\right)\right), \mathsf{*.f64}\left(d1, d1\right)\right), d1\right)\right), d1\right) \]
    5. *-lowering-*.f6499.9%

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, d1\right)\right), \mathsf{*.f64}\left(d1, d1\right)\right), \mathsf{*.f64}\left(d1, d1\right)\right), d1\right)\right), d1\right) \]
  4. Applied egg-rr99.9%

    \[\leadsto \left(d1 \cdot \left(\left(\color{blue}{\left(\left(d1 \cdot \left(d1 \cdot d1\right)\right) \cdot \left(d1 \cdot d1\right)\right)} \cdot \left(d1 \cdot d1\right)\right) \cdot d1\right)\right) \cdot d1 \]
  5. Step-by-step derivation
    1. *-commutativeN/A

      \[\leadsto \mathsf{*.f64}\left(\left(\left(\left(\left(\left(d1 \cdot \left(d1 \cdot d1\right)\right) \cdot \left(d1 \cdot d1\right)\right) \cdot \left(d1 \cdot d1\right)\right) \cdot d1\right) \cdot d1\right), d1\right) \]
    2. *-lowering-*.f64N/A

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(d1 \cdot \left(\left(\left(d1 \cdot \left(d1 \cdot d1\right)\right) \cdot \left(d1 \cdot d1\right)\right) \cdot \left(d1 \cdot d1\right)\right)\right), d1\right), d1\right) \]
    4. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \left(\left(\left(d1 \cdot \left(d1 \cdot d1\right)\right) \cdot \left(d1 \cdot d1\right)\right) \cdot \left(d1 \cdot d1\right)\right)\right), d1\right), d1\right) \]
    5. associate-*l*N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \left(\left(d1 \cdot \left(d1 \cdot d1\right)\right) \cdot \left(\left(d1 \cdot d1\right) \cdot \left(d1 \cdot d1\right)\right)\right)\right), d1\right), d1\right) \]
    6. associate-*r*N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \left(\left(d1 \cdot \left(d1 \cdot d1\right)\right) \cdot \left(d1 \cdot \left(d1 \cdot \left(d1 \cdot d1\right)\right)\right)\right)\right), d1\right), d1\right) \]
    7. associate-*r*N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \left(d1 \cdot \left(\left(d1 \cdot d1\right) \cdot \left(d1 \cdot \left(d1 \cdot \left(d1 \cdot d1\right)\right)\right)\right)\right)\right), d1\right), d1\right) \]
    8. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \left(\left(d1 \cdot d1\right) \cdot \left(d1 \cdot \left(d1 \cdot \left(d1 \cdot d1\right)\right)\right)\right)\right)\right), d1\right), d1\right) \]
    9. associate-*l*N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \left(d1 \cdot \left(d1 \cdot \left(d1 \cdot \left(d1 \cdot \left(d1 \cdot d1\right)\right)\right)\right)\right)\right)\right), d1\right), d1\right) \]
    10. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \left(d1 \cdot \left(d1 \cdot \left(d1 \cdot \left(d1 \cdot d1\right)\right)\right)\right)\right)\right)\right), d1\right), d1\right) \]
    11. associate-*r*N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \left(\left(d1 \cdot d1\right) \cdot \left(d1 \cdot \left(d1 \cdot d1\right)\right)\right)\right)\right)\right), d1\right), d1\right) \]
    12. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(\left(d1 \cdot d1\right), \left(d1 \cdot \left(d1 \cdot d1\right)\right)\right)\right)\right)\right), d1\right), d1\right) \]
    13. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, d1\right), \left(d1 \cdot \left(d1 \cdot d1\right)\right)\right)\right)\right)\right), d1\right), d1\right) \]
    14. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, d1\right), \mathsf{*.f64}\left(d1, \left(d1 \cdot d1\right)\right)\right)\right)\right)\right), d1\right), d1\right) \]
    15. *-lowering-*.f6499.9%

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, d1\right), \mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, d1\right)\right)\right)\right)\right)\right), d1\right), d1\right) \]
  6. Applied egg-rr99.9%

    \[\leadsto \color{blue}{\left(\left(d1 \cdot \left(d1 \cdot \left(d1 \cdot \left(\left(d1 \cdot d1\right) \cdot \left(d1 \cdot \left(d1 \cdot d1\right)\right)\right)\right)\right)\right) \cdot d1\right)} \cdot d1 \]
  7. Applied egg-rr87.2%

    \[\leadsto \left(\left(d1 \cdot \left(d1 \cdot \left(d1 \cdot \left(\left(d1 \cdot d1\right) \cdot \color{blue}{d1}\right)\right)\right)\right) \cdot d1\right) \cdot d1 \]
  8. Final simplification87.2%

    \[\leadsto d1 \cdot \left(d1 \cdot \left(d1 \cdot \left(d1 \cdot \left(d1 \cdot \left(d1 \cdot \left(d1 \cdot d1\right)\right)\right)\right)\right)\right) \]
  9. Add Preprocessing

Alternative 7: 65.2% accurate, 1.5× speedup?

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

\\
d1 \cdot \left(d1 \cdot \left(d1 \cdot \left(d1 \cdot \left(d1 \cdot \left(d1 \cdot d1\right)\right)\right)\right)\right)
\end{array}
Derivation
  1. Initial program 99.9%

    \[\left(d1 \cdot \left(\left(\left(\left(\left(d1 \cdot \left(d1 \cdot d1\right)\right) \cdot d1\right) \cdot d1\right) \cdot \left(d1 \cdot d1\right)\right) \cdot d1\right)\right) \cdot d1 \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. associate-*l*N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\left(d1 \cdot \left(d1 \cdot d1\right)\right) \cdot \left(d1 \cdot d1\right)\right), \mathsf{*.f64}\left(d1, d1\right)\right), d1\right)\right), d1\right) \]
    2. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(d1 \cdot \left(d1 \cdot d1\right)\right), \left(d1 \cdot d1\right)\right), \mathsf{*.f64}\left(d1, d1\right)\right), d1\right)\right), d1\right) \]
    3. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \left(d1 \cdot d1\right)\right), \left(d1 \cdot d1\right)\right), \mathsf{*.f64}\left(d1, d1\right)\right), d1\right)\right), d1\right) \]
    4. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, d1\right)\right), \left(d1 \cdot d1\right)\right), \mathsf{*.f64}\left(d1, d1\right)\right), d1\right)\right), d1\right) \]
    5. *-lowering-*.f6499.9%

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, d1\right)\right), \mathsf{*.f64}\left(d1, d1\right)\right), \mathsf{*.f64}\left(d1, d1\right)\right), d1\right)\right), d1\right) \]
  4. Applied egg-rr99.9%

    \[\leadsto \left(d1 \cdot \left(\left(\color{blue}{\left(\left(d1 \cdot \left(d1 \cdot d1\right)\right) \cdot \left(d1 \cdot d1\right)\right)} \cdot \left(d1 \cdot d1\right)\right) \cdot d1\right)\right) \cdot d1 \]
  5. Step-by-step derivation
    1. *-commutativeN/A

      \[\leadsto \mathsf{*.f64}\left(\left(\left(\left(\left(\left(d1 \cdot \left(d1 \cdot d1\right)\right) \cdot \left(d1 \cdot d1\right)\right) \cdot \left(d1 \cdot d1\right)\right) \cdot d1\right) \cdot d1\right), d1\right) \]
    2. *-lowering-*.f64N/A

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(d1 \cdot \left(\left(\left(d1 \cdot \left(d1 \cdot d1\right)\right) \cdot \left(d1 \cdot d1\right)\right) \cdot \left(d1 \cdot d1\right)\right)\right), d1\right), d1\right) \]
    4. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \left(\left(\left(d1 \cdot \left(d1 \cdot d1\right)\right) \cdot \left(d1 \cdot d1\right)\right) \cdot \left(d1 \cdot d1\right)\right)\right), d1\right), d1\right) \]
    5. associate-*l*N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \left(\left(d1 \cdot \left(d1 \cdot d1\right)\right) \cdot \left(\left(d1 \cdot d1\right) \cdot \left(d1 \cdot d1\right)\right)\right)\right), d1\right), d1\right) \]
    6. associate-*r*N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \left(\left(d1 \cdot \left(d1 \cdot d1\right)\right) \cdot \left(d1 \cdot \left(d1 \cdot \left(d1 \cdot d1\right)\right)\right)\right)\right), d1\right), d1\right) \]
    7. associate-*r*N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \left(d1 \cdot \left(\left(d1 \cdot d1\right) \cdot \left(d1 \cdot \left(d1 \cdot \left(d1 \cdot d1\right)\right)\right)\right)\right)\right), d1\right), d1\right) \]
    8. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \left(\left(d1 \cdot d1\right) \cdot \left(d1 \cdot \left(d1 \cdot \left(d1 \cdot d1\right)\right)\right)\right)\right)\right), d1\right), d1\right) \]
    9. associate-*l*N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \left(d1 \cdot \left(d1 \cdot \left(d1 \cdot \left(d1 \cdot \left(d1 \cdot d1\right)\right)\right)\right)\right)\right)\right), d1\right), d1\right) \]
    10. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \left(d1 \cdot \left(d1 \cdot \left(d1 \cdot \left(d1 \cdot d1\right)\right)\right)\right)\right)\right)\right), d1\right), d1\right) \]
    11. associate-*r*N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \left(\left(d1 \cdot d1\right) \cdot \left(d1 \cdot \left(d1 \cdot d1\right)\right)\right)\right)\right)\right), d1\right), d1\right) \]
    12. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(\left(d1 \cdot d1\right), \left(d1 \cdot \left(d1 \cdot d1\right)\right)\right)\right)\right)\right), d1\right), d1\right) \]
    13. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, d1\right), \left(d1 \cdot \left(d1 \cdot d1\right)\right)\right)\right)\right)\right), d1\right), d1\right) \]
    14. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, d1\right), \mathsf{*.f64}\left(d1, \left(d1 \cdot d1\right)\right)\right)\right)\right)\right), d1\right), d1\right) \]
    15. *-lowering-*.f6499.9%

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, d1\right), \mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, d1\right)\right)\right)\right)\right)\right), d1\right), d1\right) \]
  6. Applied egg-rr99.9%

    \[\leadsto \color{blue}{\left(\left(d1 \cdot \left(d1 \cdot \left(d1 \cdot \left(\left(d1 \cdot d1\right) \cdot \left(d1 \cdot \left(d1 \cdot d1\right)\right)\right)\right)\right)\right) \cdot d1\right)} \cdot d1 \]
  7. Applied egg-rr87.2%

    \[\leadsto \left(\left(d1 \cdot \left(d1 \cdot \left(d1 \cdot \left(\left(d1 \cdot d1\right) \cdot \color{blue}{d1}\right)\right)\right)\right) \cdot d1\right) \cdot d1 \]
  8. Applied egg-rr62.5%

    \[\leadsto \left(\left(d1 \cdot \left(d1 \cdot \left(d1 \cdot \left(\color{blue}{d1} \cdot d1\right)\right)\right)\right) \cdot d1\right) \cdot d1 \]
  9. Final simplification62.5%

    \[\leadsto d1 \cdot \left(d1 \cdot \left(d1 \cdot \left(d1 \cdot \left(d1 \cdot \left(d1 \cdot d1\right)\right)\right)\right)\right) \]
  10. Add Preprocessing

Alternative 8: 84.3% accurate, 1.7× speedup?

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

\\
d1 \cdot \left(d1 \cdot \left(d1 \cdot \left(d1 \cdot \left(d1 \cdot d1\right)\right)\right)\right)
\end{array}
Derivation
  1. Initial program 99.9%

    \[\left(d1 \cdot \left(\left(\left(\left(\left(d1 \cdot \left(d1 \cdot d1\right)\right) \cdot d1\right) \cdot d1\right) \cdot \left(d1 \cdot d1\right)\right) \cdot d1\right)\right) \cdot d1 \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. associate-*l*N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\left(d1 \cdot \left(d1 \cdot d1\right)\right) \cdot \left(d1 \cdot d1\right)\right), \mathsf{*.f64}\left(d1, d1\right)\right), d1\right)\right), d1\right) \]
    2. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(d1 \cdot \left(d1 \cdot d1\right)\right), \left(d1 \cdot d1\right)\right), \mathsf{*.f64}\left(d1, d1\right)\right), d1\right)\right), d1\right) \]
    3. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \left(d1 \cdot d1\right)\right), \left(d1 \cdot d1\right)\right), \mathsf{*.f64}\left(d1, d1\right)\right), d1\right)\right), d1\right) \]
    4. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, d1\right)\right), \left(d1 \cdot d1\right)\right), \mathsf{*.f64}\left(d1, d1\right)\right), d1\right)\right), d1\right) \]
    5. *-lowering-*.f6499.9%

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, d1\right)\right), \mathsf{*.f64}\left(d1, d1\right)\right), \mathsf{*.f64}\left(d1, d1\right)\right), d1\right)\right), d1\right) \]
  4. Applied egg-rr99.9%

    \[\leadsto \left(d1 \cdot \left(\left(\color{blue}{\left(\left(d1 \cdot \left(d1 \cdot d1\right)\right) \cdot \left(d1 \cdot d1\right)\right)} \cdot \left(d1 \cdot d1\right)\right) \cdot d1\right)\right) \cdot d1 \]
  5. Step-by-step derivation
    1. *-commutativeN/A

      \[\leadsto \mathsf{*.f64}\left(\left(\left(\left(\left(\left(d1 \cdot \left(d1 \cdot d1\right)\right) \cdot \left(d1 \cdot d1\right)\right) \cdot \left(d1 \cdot d1\right)\right) \cdot d1\right) \cdot d1\right), d1\right) \]
    2. *-lowering-*.f64N/A

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(d1 \cdot \left(\left(\left(d1 \cdot \left(d1 \cdot d1\right)\right) \cdot \left(d1 \cdot d1\right)\right) \cdot \left(d1 \cdot d1\right)\right)\right), d1\right), d1\right) \]
    4. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \left(\left(\left(d1 \cdot \left(d1 \cdot d1\right)\right) \cdot \left(d1 \cdot d1\right)\right) \cdot \left(d1 \cdot d1\right)\right)\right), d1\right), d1\right) \]
    5. associate-*l*N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \left(\left(d1 \cdot \left(d1 \cdot d1\right)\right) \cdot \left(\left(d1 \cdot d1\right) \cdot \left(d1 \cdot d1\right)\right)\right)\right), d1\right), d1\right) \]
    6. associate-*r*N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \left(\left(d1 \cdot \left(d1 \cdot d1\right)\right) \cdot \left(d1 \cdot \left(d1 \cdot \left(d1 \cdot d1\right)\right)\right)\right)\right), d1\right), d1\right) \]
    7. associate-*r*N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \left(d1 \cdot \left(\left(d1 \cdot d1\right) \cdot \left(d1 \cdot \left(d1 \cdot \left(d1 \cdot d1\right)\right)\right)\right)\right)\right), d1\right), d1\right) \]
    8. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \left(\left(d1 \cdot d1\right) \cdot \left(d1 \cdot \left(d1 \cdot \left(d1 \cdot d1\right)\right)\right)\right)\right)\right), d1\right), d1\right) \]
    9. associate-*l*N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \left(d1 \cdot \left(d1 \cdot \left(d1 \cdot \left(d1 \cdot \left(d1 \cdot d1\right)\right)\right)\right)\right)\right)\right), d1\right), d1\right) \]
    10. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \left(d1 \cdot \left(d1 \cdot \left(d1 \cdot \left(d1 \cdot d1\right)\right)\right)\right)\right)\right)\right), d1\right), d1\right) \]
    11. associate-*r*N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \left(\left(d1 \cdot d1\right) \cdot \left(d1 \cdot \left(d1 \cdot d1\right)\right)\right)\right)\right)\right), d1\right), d1\right) \]
    12. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(\left(d1 \cdot d1\right), \left(d1 \cdot \left(d1 \cdot d1\right)\right)\right)\right)\right)\right), d1\right), d1\right) \]
    13. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, d1\right), \left(d1 \cdot \left(d1 \cdot d1\right)\right)\right)\right)\right)\right), d1\right), d1\right) \]
    14. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, d1\right), \mathsf{*.f64}\left(d1, \left(d1 \cdot d1\right)\right)\right)\right)\right)\right), d1\right), d1\right) \]
    15. *-lowering-*.f6499.9%

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, d1\right), \mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, d1\right)\right)\right)\right)\right)\right), d1\right), d1\right) \]
  6. Applied egg-rr99.9%

    \[\leadsto \color{blue}{\left(\left(d1 \cdot \left(d1 \cdot \left(d1 \cdot \left(\left(d1 \cdot d1\right) \cdot \left(d1 \cdot \left(d1 \cdot d1\right)\right)\right)\right)\right)\right) \cdot d1\right)} \cdot d1 \]
  7. Applied egg-rr84.1%

    \[\leadsto \left(\left(d1 \cdot \left(d1 \cdot \left(d1 \cdot \color{blue}{d1}\right)\right)\right) \cdot d1\right) \cdot d1 \]
  8. Final simplification84.1%

    \[\leadsto d1 \cdot \left(d1 \cdot \left(d1 \cdot \left(d1 \cdot \left(d1 \cdot d1\right)\right)\right)\right) \]
  9. Add Preprocessing

Alternative 9: 61.3% accurate, 2.1× speedup?

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

\\
d1 \cdot \left(d1 \cdot \left(d1 \cdot \left(d1 \cdot d1\right)\right)\right)
\end{array}
Derivation
  1. Initial program 99.9%

    \[\left(d1 \cdot \left(\left(\left(\left(\left(d1 \cdot \left(d1 \cdot d1\right)\right) \cdot d1\right) \cdot d1\right) \cdot \left(d1 \cdot d1\right)\right) \cdot d1\right)\right) \cdot d1 \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. associate-*l*N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\left(d1 \cdot \left(d1 \cdot d1\right)\right) \cdot \left(d1 \cdot d1\right)\right), \mathsf{*.f64}\left(d1, d1\right)\right), d1\right)\right), d1\right) \]
    2. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(d1 \cdot \left(d1 \cdot d1\right)\right), \left(d1 \cdot d1\right)\right), \mathsf{*.f64}\left(d1, d1\right)\right), d1\right)\right), d1\right) \]
    3. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \left(d1 \cdot d1\right)\right), \left(d1 \cdot d1\right)\right), \mathsf{*.f64}\left(d1, d1\right)\right), d1\right)\right), d1\right) \]
    4. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, d1\right)\right), \left(d1 \cdot d1\right)\right), \mathsf{*.f64}\left(d1, d1\right)\right), d1\right)\right), d1\right) \]
    5. *-lowering-*.f6499.9%

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, d1\right)\right), \mathsf{*.f64}\left(d1, d1\right)\right), \mathsf{*.f64}\left(d1, d1\right)\right), d1\right)\right), d1\right) \]
  4. Applied egg-rr99.9%

    \[\leadsto \left(d1 \cdot \left(\left(\color{blue}{\left(\left(d1 \cdot \left(d1 \cdot d1\right)\right) \cdot \left(d1 \cdot d1\right)\right)} \cdot \left(d1 \cdot d1\right)\right) \cdot d1\right)\right) \cdot d1 \]
  5. Step-by-step derivation
    1. *-commutativeN/A

      \[\leadsto \mathsf{*.f64}\left(\left(\left(\left(\left(\left(d1 \cdot \left(d1 \cdot d1\right)\right) \cdot \left(d1 \cdot d1\right)\right) \cdot \left(d1 \cdot d1\right)\right) \cdot d1\right) \cdot d1\right), d1\right) \]
    2. *-lowering-*.f64N/A

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(d1 \cdot \left(\left(\left(d1 \cdot \left(d1 \cdot d1\right)\right) \cdot \left(d1 \cdot d1\right)\right) \cdot \left(d1 \cdot d1\right)\right)\right), d1\right), d1\right) \]
    4. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \left(\left(\left(d1 \cdot \left(d1 \cdot d1\right)\right) \cdot \left(d1 \cdot d1\right)\right) \cdot \left(d1 \cdot d1\right)\right)\right), d1\right), d1\right) \]
    5. associate-*l*N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \left(\left(d1 \cdot \left(d1 \cdot d1\right)\right) \cdot \left(\left(d1 \cdot d1\right) \cdot \left(d1 \cdot d1\right)\right)\right)\right), d1\right), d1\right) \]
    6. associate-*r*N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \left(\left(d1 \cdot \left(d1 \cdot d1\right)\right) \cdot \left(d1 \cdot \left(d1 \cdot \left(d1 \cdot d1\right)\right)\right)\right)\right), d1\right), d1\right) \]
    7. associate-*r*N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \left(d1 \cdot \left(\left(d1 \cdot d1\right) \cdot \left(d1 \cdot \left(d1 \cdot \left(d1 \cdot d1\right)\right)\right)\right)\right)\right), d1\right), d1\right) \]
    8. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \left(\left(d1 \cdot d1\right) \cdot \left(d1 \cdot \left(d1 \cdot \left(d1 \cdot d1\right)\right)\right)\right)\right)\right), d1\right), d1\right) \]
    9. associate-*l*N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \left(d1 \cdot \left(d1 \cdot \left(d1 \cdot \left(d1 \cdot \left(d1 \cdot d1\right)\right)\right)\right)\right)\right)\right), d1\right), d1\right) \]
    10. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \left(d1 \cdot \left(d1 \cdot \left(d1 \cdot \left(d1 \cdot d1\right)\right)\right)\right)\right)\right)\right), d1\right), d1\right) \]
    11. associate-*r*N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \left(\left(d1 \cdot d1\right) \cdot \left(d1 \cdot \left(d1 \cdot d1\right)\right)\right)\right)\right)\right), d1\right), d1\right) \]
    12. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(\left(d1 \cdot d1\right), \left(d1 \cdot \left(d1 \cdot d1\right)\right)\right)\right)\right)\right), d1\right), d1\right) \]
    13. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, d1\right), \left(d1 \cdot \left(d1 \cdot d1\right)\right)\right)\right)\right)\right), d1\right), d1\right) \]
    14. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, d1\right), \mathsf{*.f64}\left(d1, \left(d1 \cdot d1\right)\right)\right)\right)\right)\right), d1\right), d1\right) \]
    15. *-lowering-*.f6499.9%

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, d1\right), \mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, d1\right)\right)\right)\right)\right)\right), d1\right), d1\right) \]
  6. Applied egg-rr99.9%

    \[\leadsto \color{blue}{\left(\left(d1 \cdot \left(d1 \cdot \left(d1 \cdot \left(\left(d1 \cdot d1\right) \cdot \left(d1 \cdot \left(d1 \cdot d1\right)\right)\right)\right)\right)\right) \cdot d1\right)} \cdot d1 \]
  7. Applied egg-rr87.2%

    \[\leadsto \left(\left(d1 \cdot \left(d1 \cdot \left(d1 \cdot \left(\left(d1 \cdot d1\right) \cdot \color{blue}{d1}\right)\right)\right)\right) \cdot d1\right) \cdot d1 \]
  8. Applied egg-rr59.6%

    \[\leadsto \left(\left(d1 \cdot \left(d1 \cdot \color{blue}{d1}\right)\right) \cdot d1\right) \cdot d1 \]
  9. Final simplification59.6%

    \[\leadsto d1 \cdot \left(d1 \cdot \left(d1 \cdot \left(d1 \cdot d1\right)\right)\right) \]
  10. Add Preprocessing

Alternative 10: 76.7% accurate, 2.7× speedup?

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

\\
d1 \cdot \left(d1 \cdot \left(d1 \cdot d1\right)\right)
\end{array}
Derivation
  1. Initial program 99.9%

    \[\left(d1 \cdot \left(\left(\left(\left(\left(d1 \cdot \left(d1 \cdot d1\right)\right) \cdot d1\right) \cdot d1\right) \cdot \left(d1 \cdot d1\right)\right) \cdot d1\right)\right) \cdot d1 \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. associate-*l*N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\left(d1 \cdot \left(d1 \cdot d1\right)\right) \cdot \left(d1 \cdot d1\right)\right), \mathsf{*.f64}\left(d1, d1\right)\right), d1\right)\right), d1\right) \]
    2. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(d1 \cdot \left(d1 \cdot d1\right)\right), \left(d1 \cdot d1\right)\right), \mathsf{*.f64}\left(d1, d1\right)\right), d1\right)\right), d1\right) \]
    3. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \left(d1 \cdot d1\right)\right), \left(d1 \cdot d1\right)\right), \mathsf{*.f64}\left(d1, d1\right)\right), d1\right)\right), d1\right) \]
    4. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, d1\right)\right), \left(d1 \cdot d1\right)\right), \mathsf{*.f64}\left(d1, d1\right)\right), d1\right)\right), d1\right) \]
    5. *-lowering-*.f6499.9%

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, d1\right)\right), \mathsf{*.f64}\left(d1, d1\right)\right), \mathsf{*.f64}\left(d1, d1\right)\right), d1\right)\right), d1\right) \]
  4. Applied egg-rr99.9%

    \[\leadsto \left(d1 \cdot \left(\left(\color{blue}{\left(\left(d1 \cdot \left(d1 \cdot d1\right)\right) \cdot \left(d1 \cdot d1\right)\right)} \cdot \left(d1 \cdot d1\right)\right) \cdot d1\right)\right) \cdot d1 \]
  5. Step-by-step derivation
    1. *-commutativeN/A

      \[\leadsto \mathsf{*.f64}\left(\left(\left(\left(\left(\left(d1 \cdot \left(d1 \cdot d1\right)\right) \cdot \left(d1 \cdot d1\right)\right) \cdot \left(d1 \cdot d1\right)\right) \cdot d1\right) \cdot d1\right), d1\right) \]
    2. *-lowering-*.f64N/A

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(d1 \cdot \left(\left(\left(d1 \cdot \left(d1 \cdot d1\right)\right) \cdot \left(d1 \cdot d1\right)\right) \cdot \left(d1 \cdot d1\right)\right)\right), d1\right), d1\right) \]
    4. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \left(\left(\left(d1 \cdot \left(d1 \cdot d1\right)\right) \cdot \left(d1 \cdot d1\right)\right) \cdot \left(d1 \cdot d1\right)\right)\right), d1\right), d1\right) \]
    5. associate-*l*N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \left(\left(d1 \cdot \left(d1 \cdot d1\right)\right) \cdot \left(\left(d1 \cdot d1\right) \cdot \left(d1 \cdot d1\right)\right)\right)\right), d1\right), d1\right) \]
    6. associate-*r*N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \left(\left(d1 \cdot \left(d1 \cdot d1\right)\right) \cdot \left(d1 \cdot \left(d1 \cdot \left(d1 \cdot d1\right)\right)\right)\right)\right), d1\right), d1\right) \]
    7. associate-*r*N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \left(d1 \cdot \left(\left(d1 \cdot d1\right) \cdot \left(d1 \cdot \left(d1 \cdot \left(d1 \cdot d1\right)\right)\right)\right)\right)\right), d1\right), d1\right) \]
    8. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \left(\left(d1 \cdot d1\right) \cdot \left(d1 \cdot \left(d1 \cdot \left(d1 \cdot d1\right)\right)\right)\right)\right)\right), d1\right), d1\right) \]
    9. associate-*l*N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \left(d1 \cdot \left(d1 \cdot \left(d1 \cdot \left(d1 \cdot \left(d1 \cdot d1\right)\right)\right)\right)\right)\right)\right), d1\right), d1\right) \]
    10. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \left(d1 \cdot \left(d1 \cdot \left(d1 \cdot \left(d1 \cdot d1\right)\right)\right)\right)\right)\right)\right), d1\right), d1\right) \]
    11. associate-*r*N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \left(\left(d1 \cdot d1\right) \cdot \left(d1 \cdot \left(d1 \cdot d1\right)\right)\right)\right)\right)\right), d1\right), d1\right) \]
    12. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(\left(d1 \cdot d1\right), \left(d1 \cdot \left(d1 \cdot d1\right)\right)\right)\right)\right)\right), d1\right), d1\right) \]
    13. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, d1\right), \left(d1 \cdot \left(d1 \cdot d1\right)\right)\right)\right)\right)\right), d1\right), d1\right) \]
    14. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, d1\right), \mathsf{*.f64}\left(d1, \left(d1 \cdot d1\right)\right)\right)\right)\right)\right), d1\right), d1\right) \]
    15. *-lowering-*.f6499.9%

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, d1\right), \mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, d1\right)\right)\right)\right)\right)\right), d1\right), d1\right) \]
  6. Applied egg-rr99.9%

    \[\leadsto \color{blue}{\left(\left(d1 \cdot \left(d1 \cdot \left(d1 \cdot \left(\left(d1 \cdot d1\right) \cdot \left(d1 \cdot \left(d1 \cdot d1\right)\right)\right)\right)\right)\right) \cdot d1\right)} \cdot d1 \]
  7. Applied egg-rr77.6%

    \[\leadsto \left(\left(d1 \cdot \color{blue}{d1}\right) \cdot d1\right) \cdot d1 \]
  8. Final simplification77.6%

    \[\leadsto d1 \cdot \left(d1 \cdot \left(d1 \cdot d1\right)\right) \]
  9. Add Preprocessing

Alternative 11: 51.9% accurate, 3.8× speedup?

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

\\
d1 \cdot \left(d1 \cdot d1\right)
\end{array}
Derivation
  1. Initial program 99.9%

    \[\left(d1 \cdot \left(\left(\left(\left(\left(d1 \cdot \left(d1 \cdot d1\right)\right) \cdot d1\right) \cdot d1\right) \cdot \left(d1 \cdot d1\right)\right) \cdot d1\right)\right) \cdot d1 \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. associate-*l*N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\left(d1 \cdot \left(d1 \cdot d1\right)\right) \cdot \left(d1 \cdot d1\right)\right), \mathsf{*.f64}\left(d1, d1\right)\right), d1\right)\right), d1\right) \]
    2. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(d1 \cdot \left(d1 \cdot d1\right)\right), \left(d1 \cdot d1\right)\right), \mathsf{*.f64}\left(d1, d1\right)\right), d1\right)\right), d1\right) \]
    3. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \left(d1 \cdot d1\right)\right), \left(d1 \cdot d1\right)\right), \mathsf{*.f64}\left(d1, d1\right)\right), d1\right)\right), d1\right) \]
    4. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, d1\right)\right), \left(d1 \cdot d1\right)\right), \mathsf{*.f64}\left(d1, d1\right)\right), d1\right)\right), d1\right) \]
    5. *-lowering-*.f6499.9%

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, d1\right)\right), \mathsf{*.f64}\left(d1, d1\right)\right), \mathsf{*.f64}\left(d1, d1\right)\right), d1\right)\right), d1\right) \]
  4. Applied egg-rr99.9%

    \[\leadsto \left(d1 \cdot \left(\left(\color{blue}{\left(\left(d1 \cdot \left(d1 \cdot d1\right)\right) \cdot \left(d1 \cdot d1\right)\right)} \cdot \left(d1 \cdot d1\right)\right) \cdot d1\right)\right) \cdot d1 \]
  5. Step-by-step derivation
    1. *-commutativeN/A

      \[\leadsto \mathsf{*.f64}\left(\left(\left(\left(\left(\left(d1 \cdot \left(d1 \cdot d1\right)\right) \cdot \left(d1 \cdot d1\right)\right) \cdot \left(d1 \cdot d1\right)\right) \cdot d1\right) \cdot d1\right), d1\right) \]
    2. *-lowering-*.f64N/A

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(d1 \cdot \left(\left(\left(d1 \cdot \left(d1 \cdot d1\right)\right) \cdot \left(d1 \cdot d1\right)\right) \cdot \left(d1 \cdot d1\right)\right)\right), d1\right), d1\right) \]
    4. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \left(\left(\left(d1 \cdot \left(d1 \cdot d1\right)\right) \cdot \left(d1 \cdot d1\right)\right) \cdot \left(d1 \cdot d1\right)\right)\right), d1\right), d1\right) \]
    5. associate-*l*N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \left(\left(d1 \cdot \left(d1 \cdot d1\right)\right) \cdot \left(\left(d1 \cdot d1\right) \cdot \left(d1 \cdot d1\right)\right)\right)\right), d1\right), d1\right) \]
    6. associate-*r*N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \left(\left(d1 \cdot \left(d1 \cdot d1\right)\right) \cdot \left(d1 \cdot \left(d1 \cdot \left(d1 \cdot d1\right)\right)\right)\right)\right), d1\right), d1\right) \]
    7. associate-*r*N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \left(d1 \cdot \left(\left(d1 \cdot d1\right) \cdot \left(d1 \cdot \left(d1 \cdot \left(d1 \cdot d1\right)\right)\right)\right)\right)\right), d1\right), d1\right) \]
    8. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \left(\left(d1 \cdot d1\right) \cdot \left(d1 \cdot \left(d1 \cdot \left(d1 \cdot d1\right)\right)\right)\right)\right)\right), d1\right), d1\right) \]
    9. associate-*l*N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \left(d1 \cdot \left(d1 \cdot \left(d1 \cdot \left(d1 \cdot \left(d1 \cdot d1\right)\right)\right)\right)\right)\right)\right), d1\right), d1\right) \]
    10. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \left(d1 \cdot \left(d1 \cdot \left(d1 \cdot \left(d1 \cdot d1\right)\right)\right)\right)\right)\right)\right), d1\right), d1\right) \]
    11. associate-*r*N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \left(\left(d1 \cdot d1\right) \cdot \left(d1 \cdot \left(d1 \cdot d1\right)\right)\right)\right)\right)\right), d1\right), d1\right) \]
    12. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(\left(d1 \cdot d1\right), \left(d1 \cdot \left(d1 \cdot d1\right)\right)\right)\right)\right)\right), d1\right), d1\right) \]
    13. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, d1\right), \left(d1 \cdot \left(d1 \cdot d1\right)\right)\right)\right)\right)\right), d1\right), d1\right) \]
    14. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, d1\right), \mathsf{*.f64}\left(d1, \left(d1 \cdot d1\right)\right)\right)\right)\right)\right), d1\right), d1\right) \]
    15. *-lowering-*.f6499.9%

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, d1\right), \mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, d1\right)\right)\right)\right)\right)\right), d1\right), d1\right) \]
  6. Applied egg-rr99.9%

    \[\leadsto \color{blue}{\left(\left(d1 \cdot \left(d1 \cdot \left(d1 \cdot \left(\left(d1 \cdot d1\right) \cdot \left(d1 \cdot \left(d1 \cdot d1\right)\right)\right)\right)\right)\right) \cdot d1\right)} \cdot d1 \]
  7. Applied egg-rr49.8%

    \[\leadsto \left(\color{blue}{d1} \cdot d1\right) \cdot d1 \]
  8. Final simplification49.8%

    \[\leadsto d1 \cdot \left(d1 \cdot d1\right) \]
  9. Add Preprocessing

Alternative 12: 52.4% accurate, 6.3× speedup?

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

\\
d1 \cdot d1
\end{array}
Derivation
  1. Initial program 99.9%

    \[\left(d1 \cdot \left(\left(\left(\left(\left(d1 \cdot \left(d1 \cdot d1\right)\right) \cdot d1\right) \cdot d1\right) \cdot \left(d1 \cdot d1\right)\right) \cdot d1\right)\right) \cdot d1 \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. associate-*l*N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\left(d1 \cdot \left(d1 \cdot d1\right)\right) \cdot \left(d1 \cdot d1\right)\right), \mathsf{*.f64}\left(d1, d1\right)\right), d1\right)\right), d1\right) \]
    2. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(d1 \cdot \left(d1 \cdot d1\right)\right), \left(d1 \cdot d1\right)\right), \mathsf{*.f64}\left(d1, d1\right)\right), d1\right)\right), d1\right) \]
    3. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \left(d1 \cdot d1\right)\right), \left(d1 \cdot d1\right)\right), \mathsf{*.f64}\left(d1, d1\right)\right), d1\right)\right), d1\right) \]
    4. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, d1\right)\right), \left(d1 \cdot d1\right)\right), \mathsf{*.f64}\left(d1, d1\right)\right), d1\right)\right), d1\right) \]
    5. *-lowering-*.f6499.9%

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, d1\right)\right), \mathsf{*.f64}\left(d1, d1\right)\right), \mathsf{*.f64}\left(d1, d1\right)\right), d1\right)\right), d1\right) \]
  4. Applied egg-rr99.9%

    \[\leadsto \left(d1 \cdot \left(\left(\color{blue}{\left(\left(d1 \cdot \left(d1 \cdot d1\right)\right) \cdot \left(d1 \cdot d1\right)\right)} \cdot \left(d1 \cdot d1\right)\right) \cdot d1\right)\right) \cdot d1 \]
  5. Step-by-step derivation
    1. *-commutativeN/A

      \[\leadsto \mathsf{*.f64}\left(\left(\left(\left(\left(\left(d1 \cdot \left(d1 \cdot d1\right)\right) \cdot \left(d1 \cdot d1\right)\right) \cdot \left(d1 \cdot d1\right)\right) \cdot d1\right) \cdot d1\right), d1\right) \]
    2. *-lowering-*.f64N/A

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(d1 \cdot \left(\left(\left(d1 \cdot \left(d1 \cdot d1\right)\right) \cdot \left(d1 \cdot d1\right)\right) \cdot \left(d1 \cdot d1\right)\right)\right), d1\right), d1\right) \]
    4. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \left(\left(\left(d1 \cdot \left(d1 \cdot d1\right)\right) \cdot \left(d1 \cdot d1\right)\right) \cdot \left(d1 \cdot d1\right)\right)\right), d1\right), d1\right) \]
    5. associate-*l*N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \left(\left(d1 \cdot \left(d1 \cdot d1\right)\right) \cdot \left(\left(d1 \cdot d1\right) \cdot \left(d1 \cdot d1\right)\right)\right)\right), d1\right), d1\right) \]
    6. associate-*r*N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \left(\left(d1 \cdot \left(d1 \cdot d1\right)\right) \cdot \left(d1 \cdot \left(d1 \cdot \left(d1 \cdot d1\right)\right)\right)\right)\right), d1\right), d1\right) \]
    7. associate-*r*N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \left(d1 \cdot \left(\left(d1 \cdot d1\right) \cdot \left(d1 \cdot \left(d1 \cdot \left(d1 \cdot d1\right)\right)\right)\right)\right)\right), d1\right), d1\right) \]
    8. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \left(\left(d1 \cdot d1\right) \cdot \left(d1 \cdot \left(d1 \cdot \left(d1 \cdot d1\right)\right)\right)\right)\right)\right), d1\right), d1\right) \]
    9. associate-*l*N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \left(d1 \cdot \left(d1 \cdot \left(d1 \cdot \left(d1 \cdot \left(d1 \cdot d1\right)\right)\right)\right)\right)\right)\right), d1\right), d1\right) \]
    10. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \left(d1 \cdot \left(d1 \cdot \left(d1 \cdot \left(d1 \cdot d1\right)\right)\right)\right)\right)\right)\right), d1\right), d1\right) \]
    11. associate-*r*N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \left(\left(d1 \cdot d1\right) \cdot \left(d1 \cdot \left(d1 \cdot d1\right)\right)\right)\right)\right)\right), d1\right), d1\right) \]
    12. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(\left(d1 \cdot d1\right), \left(d1 \cdot \left(d1 \cdot d1\right)\right)\right)\right)\right)\right), d1\right), d1\right) \]
    13. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, d1\right), \left(d1 \cdot \left(d1 \cdot d1\right)\right)\right)\right)\right)\right), d1\right), d1\right) \]
    14. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, d1\right), \mathsf{*.f64}\left(d1, \left(d1 \cdot d1\right)\right)\right)\right)\right)\right), d1\right), d1\right) \]
    15. *-lowering-*.f6499.9%

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, d1\right), \mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, d1\right)\right)\right)\right)\right)\right), d1\right), d1\right) \]
  6. Applied egg-rr99.9%

    \[\leadsto \color{blue}{\left(\left(d1 \cdot \left(d1 \cdot \left(d1 \cdot \left(\left(d1 \cdot d1\right) \cdot \left(d1 \cdot \left(d1 \cdot d1\right)\right)\right)\right)\right)\right) \cdot d1\right)} \cdot d1 \]
  7. Applied egg-rr51.6%

    \[\leadsto \color{blue}{d1} \cdot d1 \]
  8. Add Preprocessing

Alternative 13: 4.2% accurate, 19.0× speedup?

\[\begin{array}{l} \\ d1 \end{array} \]
(FPCore (d1) :precision binary64 d1)
double code(double d1) {
	return d1;
}
real(8) function code(d1)
    real(8), intent (in) :: d1
    code = d1
end function
public static double code(double d1) {
	return d1;
}
def code(d1):
	return d1
function code(d1)
	return d1
end
function tmp = code(d1)
	tmp = d1;
end
code[d1_] := d1
\begin{array}{l}

\\
d1
\end{array}
Derivation
  1. Initial program 99.9%

    \[\left(d1 \cdot \left(\left(\left(\left(\left(d1 \cdot \left(d1 \cdot d1\right)\right) \cdot d1\right) \cdot d1\right) \cdot \left(d1 \cdot d1\right)\right) \cdot d1\right)\right) \cdot d1 \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. associate-*l*N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\left(d1 \cdot \left(d1 \cdot d1\right)\right) \cdot \left(d1 \cdot d1\right)\right), \mathsf{*.f64}\left(d1, d1\right)\right), d1\right)\right), d1\right) \]
    2. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(d1 \cdot \left(d1 \cdot d1\right)\right), \left(d1 \cdot d1\right)\right), \mathsf{*.f64}\left(d1, d1\right)\right), d1\right)\right), d1\right) \]
    3. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \left(d1 \cdot d1\right)\right), \left(d1 \cdot d1\right)\right), \mathsf{*.f64}\left(d1, d1\right)\right), d1\right)\right), d1\right) \]
    4. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, d1\right)\right), \left(d1 \cdot d1\right)\right), \mathsf{*.f64}\left(d1, d1\right)\right), d1\right)\right), d1\right) \]
    5. *-lowering-*.f6499.9%

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, d1\right)\right), \mathsf{*.f64}\left(d1, d1\right)\right), \mathsf{*.f64}\left(d1, d1\right)\right), d1\right)\right), d1\right) \]
  4. Applied egg-rr99.9%

    \[\leadsto \left(d1 \cdot \left(\left(\color{blue}{\left(\left(d1 \cdot \left(d1 \cdot d1\right)\right) \cdot \left(d1 \cdot d1\right)\right)} \cdot \left(d1 \cdot d1\right)\right) \cdot d1\right)\right) \cdot d1 \]
  5. Step-by-step derivation
    1. *-commutativeN/A

      \[\leadsto \mathsf{*.f64}\left(\left(\left(\left(\left(\left(d1 \cdot \left(d1 \cdot d1\right)\right) \cdot \left(d1 \cdot d1\right)\right) \cdot \left(d1 \cdot d1\right)\right) \cdot d1\right) \cdot d1\right), d1\right) \]
    2. *-lowering-*.f64N/A

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(d1 \cdot \left(\left(\left(d1 \cdot \left(d1 \cdot d1\right)\right) \cdot \left(d1 \cdot d1\right)\right) \cdot \left(d1 \cdot d1\right)\right)\right), d1\right), d1\right) \]
    4. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \left(\left(\left(d1 \cdot \left(d1 \cdot d1\right)\right) \cdot \left(d1 \cdot d1\right)\right) \cdot \left(d1 \cdot d1\right)\right)\right), d1\right), d1\right) \]
    5. associate-*l*N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \left(\left(d1 \cdot \left(d1 \cdot d1\right)\right) \cdot \left(\left(d1 \cdot d1\right) \cdot \left(d1 \cdot d1\right)\right)\right)\right), d1\right), d1\right) \]
    6. associate-*r*N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \left(\left(d1 \cdot \left(d1 \cdot d1\right)\right) \cdot \left(d1 \cdot \left(d1 \cdot \left(d1 \cdot d1\right)\right)\right)\right)\right), d1\right), d1\right) \]
    7. associate-*r*N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \left(d1 \cdot \left(\left(d1 \cdot d1\right) \cdot \left(d1 \cdot \left(d1 \cdot \left(d1 \cdot d1\right)\right)\right)\right)\right)\right), d1\right), d1\right) \]
    8. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \left(\left(d1 \cdot d1\right) \cdot \left(d1 \cdot \left(d1 \cdot \left(d1 \cdot d1\right)\right)\right)\right)\right)\right), d1\right), d1\right) \]
    9. associate-*l*N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \left(d1 \cdot \left(d1 \cdot \left(d1 \cdot \left(d1 \cdot \left(d1 \cdot d1\right)\right)\right)\right)\right)\right)\right), d1\right), d1\right) \]
    10. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \left(d1 \cdot \left(d1 \cdot \left(d1 \cdot \left(d1 \cdot d1\right)\right)\right)\right)\right)\right)\right), d1\right), d1\right) \]
    11. associate-*r*N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \left(\left(d1 \cdot d1\right) \cdot \left(d1 \cdot \left(d1 \cdot d1\right)\right)\right)\right)\right)\right), d1\right), d1\right) \]
    12. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(\left(d1 \cdot d1\right), \left(d1 \cdot \left(d1 \cdot d1\right)\right)\right)\right)\right)\right), d1\right), d1\right) \]
    13. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, d1\right), \left(d1 \cdot \left(d1 \cdot d1\right)\right)\right)\right)\right)\right), d1\right), d1\right) \]
    14. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, d1\right), \mathsf{*.f64}\left(d1, \left(d1 \cdot d1\right)\right)\right)\right)\right)\right), d1\right), d1\right) \]
    15. *-lowering-*.f6499.9%

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(d1, d1\right), \mathsf{*.f64}\left(d1, \mathsf{*.f64}\left(d1, d1\right)\right)\right)\right)\right)\right), d1\right), d1\right) \]
  6. Applied egg-rr99.9%

    \[\leadsto \color{blue}{\left(\left(d1 \cdot \left(d1 \cdot \left(d1 \cdot \left(\left(d1 \cdot d1\right) \cdot \left(d1 \cdot \left(d1 \cdot d1\right)\right)\right)\right)\right)\right) \cdot d1\right)} \cdot d1 \]
  7. Applied egg-rr4.0%

    \[\leadsto \color{blue}{d1} \]
  8. Add Preprocessing

Developer Target 1: 100.0% accurate, 0.2× speedup?

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

\\
{d1}^{10}
\end{array}

Reproduce

?
herbie shell --seed 2024139 
(FPCore (d1)
  :name "FastMath test5"
  :precision binary64

  :alt
  (! :herbie-platform default (pow d1 10))

  (* (* d1 (* (* (* (* (* d1 (* d1 d1)) d1) d1) (* d1 d1)) d1)) d1))