ENA, Section 1.4, Exercise 1

Percentage Accurate: 94.4% → 98.4%
Time: 9.1s
Alternatives: 16
Speedup: 1.0×

Specification

?
\[1.99 \leq x \land x \leq 2.01\]
\[\begin{array}{l} \\ \cos x \cdot e^{10 \cdot \left(x \cdot x\right)} \end{array} \]
(FPCore (x) :precision binary64 (* (cos x) (exp (* 10.0 (* x x)))))
double code(double x) {
	return cos(x) * exp((10.0 * (x * x)));
}
real(8) function code(x)
    real(8), intent (in) :: x
    code = cos(x) * exp((10.0d0 * (x * x)))
end function
public static double code(double x) {
	return Math.cos(x) * Math.exp((10.0 * (x * x)));
}
def code(x):
	return math.cos(x) * math.exp((10.0 * (x * x)))
function code(x)
	return Float64(cos(x) * exp(Float64(10.0 * Float64(x * x))))
end
function tmp = code(x)
	tmp = cos(x) * exp((10.0 * (x * x)));
end
code[x_] := N[(N[Cos[x], $MachinePrecision] * N[Exp[N[(10.0 * N[(x * x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\cos x \cdot e^{10 \cdot \left(x \cdot x\right)}
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 16 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: 94.4% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \cos x \cdot e^{10 \cdot \left(x \cdot x\right)} \end{array} \]
(FPCore (x) :precision binary64 (* (cos x) (exp (* 10.0 (* x x)))))
double code(double x) {
	return cos(x) * exp((10.0 * (x * x)));
}
real(8) function code(x)
    real(8), intent (in) :: x
    code = cos(x) * exp((10.0d0 * (x * x)))
end function
public static double code(double x) {
	return Math.cos(x) * Math.exp((10.0 * (x * x)));
}
def code(x):
	return math.cos(x) * math.exp((10.0 * (x * x)))
function code(x)
	return Float64(cos(x) * exp(Float64(10.0 * Float64(x * x))))
end
function tmp = code(x)
	tmp = cos(x) * exp((10.0 * (x * x)));
end
code[x_] := N[(N[Cos[x], $MachinePrecision] * N[Exp[N[(10.0 * N[(x * x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\cos x \cdot e^{10 \cdot \left(x \cdot x\right)}
\end{array}

Alternative 1: 98.4% accurate, 0.4× speedup?

\[\begin{array}{l} \\ {\left({\left({\left(e^{10}\right)}^{0.5}\right)}^{\left(x + x\right)}\right)}^{x} \cdot \cos x \end{array} \]
(FPCore (x)
 :precision binary64
 (* (pow (pow (pow (exp 10.0) 0.5) (+ x x)) x) (cos x)))
double code(double x) {
	return pow(pow(pow(exp(10.0), 0.5), (x + x)), x) * cos(x);
}
real(8) function code(x)
    real(8), intent (in) :: x
    code = (((exp(10.0d0) ** 0.5d0) ** (x + x)) ** x) * cos(x)
end function
public static double code(double x) {
	return Math.pow(Math.pow(Math.pow(Math.exp(10.0), 0.5), (x + x)), x) * Math.cos(x);
}
def code(x):
	return math.pow(math.pow(math.pow(math.exp(10.0), 0.5), (x + x)), x) * math.cos(x)
function code(x)
	return Float64((((exp(10.0) ^ 0.5) ^ Float64(x + x)) ^ x) * cos(x))
end
function tmp = code(x)
	tmp = (((exp(10.0) ^ 0.5) ^ (x + x)) ^ x) * cos(x);
end
code[x_] := N[(N[Power[N[Power[N[Power[N[Exp[10.0], $MachinePrecision], 0.5], $MachinePrecision], N[(x + x), $MachinePrecision]], $MachinePrecision], x], $MachinePrecision] * N[Cos[x], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
{\left({\left({\left(e^{10}\right)}^{0.5}\right)}^{\left(x + x\right)}\right)}^{x} \cdot \cos x
\end{array}
Derivation
  1. Initial program 94.4%

    \[\cos x \cdot e^{10 \cdot \left(x \cdot x\right)} \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. associate-*r*N/A

      \[\leadsto \cos x \cdot e^{\color{blue}{\left(10 \cdot x\right) \cdot x}} \]
    2. *-commutativeN/A

      \[\leadsto \cos x \cdot e^{\color{blue}{x \cdot \left(10 \cdot x\right)}} \]
    3. exp-prodN/A

      \[\leadsto \cos x \cdot \color{blue}{{\left(e^{x}\right)}^{\left(10 \cdot x\right)}} \]
    4. *-commutativeN/A

      \[\leadsto \cos x \cdot {\left(e^{x}\right)}^{\color{blue}{\left(x \cdot 10\right)}} \]
    5. unpow1N/A

      \[\leadsto \cos x \cdot {\left(e^{x}\right)}^{\left(\color{blue}{{x}^{1}} \cdot 10\right)} \]
    6. metadata-evalN/A

      \[\leadsto \cos x \cdot {\left(e^{x}\right)}^{\left({x}^{\color{blue}{\left(\frac{2}{2}\right)}} \cdot 10\right)} \]
    7. sqr-powN/A

      \[\leadsto \cos x \cdot {\left(e^{x}\right)}^{\left(\color{blue}{\left({x}^{\left(\frac{\frac{2}{2}}{2}\right)} \cdot {x}^{\left(\frac{\frac{2}{2}}{2}\right)}\right)} \cdot 10\right)} \]
    8. associate-*l*N/A

      \[\leadsto \cos x \cdot {\left(e^{x}\right)}^{\color{blue}{\left({x}^{\left(\frac{\frac{2}{2}}{2}\right)} \cdot \left({x}^{\left(\frac{\frac{2}{2}}{2}\right)} \cdot 10\right)\right)}} \]
    9. pow-unpowN/A

      \[\leadsto \cos x \cdot \color{blue}{{\left({\left(e^{x}\right)}^{\left({x}^{\left(\frac{\frac{2}{2}}{2}\right)}\right)}\right)}^{\left({x}^{\left(\frac{\frac{2}{2}}{2}\right)} \cdot 10\right)}} \]
    10. lower-pow.f64N/A

      \[\leadsto \cos x \cdot \color{blue}{{\left({\left(e^{x}\right)}^{\left({x}^{\left(\frac{\frac{2}{2}}{2}\right)}\right)}\right)}^{\left({x}^{\left(\frac{\frac{2}{2}}{2}\right)} \cdot 10\right)}} \]
    11. pow-expN/A

      \[\leadsto \cos x \cdot {\color{blue}{\left(e^{x \cdot {x}^{\left(\frac{\frac{2}{2}}{2}\right)}}\right)}}^{\left({x}^{\left(\frac{\frac{2}{2}}{2}\right)} \cdot 10\right)} \]
    12. lower-exp.f64N/A

      \[\leadsto \cos x \cdot {\color{blue}{\left(e^{x \cdot {x}^{\left(\frac{\frac{2}{2}}{2}\right)}}\right)}}^{\left({x}^{\left(\frac{\frac{2}{2}}{2}\right)} \cdot 10\right)} \]
    13. lower-*.f64N/A

      \[\leadsto \cos x \cdot {\left(e^{\color{blue}{x \cdot {x}^{\left(\frac{\frac{2}{2}}{2}\right)}}}\right)}^{\left({x}^{\left(\frac{\frac{2}{2}}{2}\right)} \cdot 10\right)} \]
    14. metadata-evalN/A

      \[\leadsto \cos x \cdot {\left(e^{x \cdot {x}^{\left(\frac{\color{blue}{1}}{2}\right)}}\right)}^{\left({x}^{\left(\frac{\frac{2}{2}}{2}\right)} \cdot 10\right)} \]
    15. metadata-evalN/A

      \[\leadsto \cos x \cdot {\left(e^{x \cdot {x}^{\color{blue}{\frac{1}{2}}}}\right)}^{\left({x}^{\left(\frac{\frac{2}{2}}{2}\right)} \cdot 10\right)} \]
    16. unpow1/2N/A

      \[\leadsto \cos x \cdot {\left(e^{x \cdot \color{blue}{\sqrt{x}}}\right)}^{\left({x}^{\left(\frac{\frac{2}{2}}{2}\right)} \cdot 10\right)} \]
    17. lower-sqrt.f64N/A

      \[\leadsto \cos x \cdot {\left(e^{x \cdot \color{blue}{\sqrt{x}}}\right)}^{\left({x}^{\left(\frac{\frac{2}{2}}{2}\right)} \cdot 10\right)} \]
    18. *-commutativeN/A

      \[\leadsto \cos x \cdot {\left(e^{x \cdot \sqrt{x}}\right)}^{\color{blue}{\left(10 \cdot {x}^{\left(\frac{\frac{2}{2}}{2}\right)}\right)}} \]
    19. lower-*.f64N/A

      \[\leadsto \cos x \cdot {\left(e^{x \cdot \sqrt{x}}\right)}^{\color{blue}{\left(10 \cdot {x}^{\left(\frac{\frac{2}{2}}{2}\right)}\right)}} \]
    20. metadata-evalN/A

      \[\leadsto \cos x \cdot {\left(e^{x \cdot \sqrt{x}}\right)}^{\left(10 \cdot {x}^{\left(\frac{\color{blue}{1}}{2}\right)}\right)} \]
    21. metadata-evalN/A

      \[\leadsto \cos x \cdot {\left(e^{x \cdot \sqrt{x}}\right)}^{\left(10 \cdot {x}^{\color{blue}{\frac{1}{2}}}\right)} \]
  4. Applied egg-rr93.2%

    \[\leadsto \cos x \cdot \color{blue}{{\left(e^{x \cdot \sqrt{x}}\right)}^{\left(10 \cdot \sqrt{x}\right)}} \]
  5. Step-by-step derivation
    1. lift-cos.f64N/A

      \[\leadsto \color{blue}{\cos x} \cdot {\left(e^{x \cdot \sqrt{x}}\right)}^{\left(10 \cdot \sqrt{x}\right)} \]
    2. lift-sqrt.f64N/A

      \[\leadsto \cos x \cdot {\left(e^{x \cdot \color{blue}{\sqrt{x}}}\right)}^{\left(10 \cdot \sqrt{x}\right)} \]
    3. lift-*.f64N/A

      \[\leadsto \cos x \cdot {\left(e^{\color{blue}{x \cdot \sqrt{x}}}\right)}^{\left(10 \cdot \sqrt{x}\right)} \]
    4. rem-log-expN/A

      \[\leadsto \cos x \cdot {\left(e^{\color{blue}{\log \left(e^{x \cdot \sqrt{x}}\right)}}\right)}^{\left(10 \cdot \sqrt{x}\right)} \]
    5. lift-exp.f64N/A

      \[\leadsto \cos x \cdot {\left(e^{\log \color{blue}{\left(e^{x \cdot \sqrt{x}}\right)}}\right)}^{\left(10 \cdot \sqrt{x}\right)} \]
    6. lift-sqrt.f64N/A

      \[\leadsto \cos x \cdot {\left(e^{\log \left(e^{x \cdot \sqrt{x}}\right)}\right)}^{\left(10 \cdot \color{blue}{\sqrt{x}}\right)} \]
    7. lift-*.f64N/A

      \[\leadsto \cos x \cdot {\left(e^{\log \left(e^{x \cdot \sqrt{x}}\right)}\right)}^{\color{blue}{\left(10 \cdot \sqrt{x}\right)}} \]
    8. exp-prodN/A

      \[\leadsto \cos x \cdot \color{blue}{e^{\log \left(e^{x \cdot \sqrt{x}}\right) \cdot \left(10 \cdot \sqrt{x}\right)}} \]
    9. pow-to-expN/A

      \[\leadsto \cos x \cdot \color{blue}{{\left(e^{x \cdot \sqrt{x}}\right)}^{\left(10 \cdot \sqrt{x}\right)}} \]
    10. lift-pow.f64N/A

      \[\leadsto \cos x \cdot \color{blue}{{\left(e^{x \cdot \sqrt{x}}\right)}^{\left(10 \cdot \sqrt{x}\right)}} \]
    11. *-commutativeN/A

      \[\leadsto \color{blue}{{\left(e^{x \cdot \sqrt{x}}\right)}^{\left(10 \cdot \sqrt{x}\right)} \cdot \cos x} \]
    12. lower-*.f6493.2

      \[\leadsto \color{blue}{{\left(e^{x \cdot \sqrt{x}}\right)}^{\left(10 \cdot \sqrt{x}\right)} \cdot \cos x} \]
  6. Applied egg-rr93.3%

    \[\leadsto \color{blue}{e^{\sqrt{x} \cdot \left(x \cdot \left(10 \cdot \sqrt{x}\right)\right)} \cdot \cos x} \]
  7. Step-by-step derivation
    1. lift-sqrt.f64N/A

      \[\leadsto e^{\color{blue}{\sqrt{x}} \cdot \left(x \cdot \left(10 \cdot \sqrt{x}\right)\right)} \cdot \cos x \]
    2. lift-sqrt.f64N/A

      \[\leadsto e^{\sqrt{x} \cdot \left(x \cdot \left(10 \cdot \color{blue}{\sqrt{x}}\right)\right)} \cdot \cos x \]
    3. lift-*.f64N/A

      \[\leadsto e^{\sqrt{x} \cdot \left(x \cdot \color{blue}{\left(10 \cdot \sqrt{x}\right)}\right)} \cdot \cos x \]
    4. lift-*.f64N/A

      \[\leadsto e^{\sqrt{x} \cdot \color{blue}{\left(x \cdot \left(10 \cdot \sqrt{x}\right)\right)}} \cdot \cos x \]
    5. exp-prodN/A

      \[\leadsto \color{blue}{{\left(e^{\sqrt{x}}\right)}^{\left(x \cdot \left(10 \cdot \sqrt{x}\right)\right)}} \cdot \cos x \]
    6. lift-*.f64N/A

      \[\leadsto {\left(e^{\sqrt{x}}\right)}^{\color{blue}{\left(x \cdot \left(10 \cdot \sqrt{x}\right)\right)}} \cdot \cos x \]
    7. *-commutativeN/A

      \[\leadsto {\left(e^{\sqrt{x}}\right)}^{\color{blue}{\left(\left(10 \cdot \sqrt{x}\right) \cdot x\right)}} \cdot \cos x \]
    8. pow-unpowN/A

      \[\leadsto \color{blue}{{\left({\left(e^{\sqrt{x}}\right)}^{\left(10 \cdot \sqrt{x}\right)}\right)}^{x}} \cdot \cos x \]
    9. lower-pow.f64N/A

      \[\leadsto \color{blue}{{\left({\left(e^{\sqrt{x}}\right)}^{\left(10 \cdot \sqrt{x}\right)}\right)}^{x}} \cdot \cos x \]
    10. lower-pow.f64N/A

      \[\leadsto {\color{blue}{\left({\left(e^{\sqrt{x}}\right)}^{\left(10 \cdot \sqrt{x}\right)}\right)}}^{x} \cdot \cos x \]
    11. lower-exp.f6493.4

      \[\leadsto {\left({\color{blue}{\left(e^{\sqrt{x}}\right)}}^{\left(10 \cdot \sqrt{x}\right)}\right)}^{x} \cdot \cos x \]
    12. lift-*.f64N/A

      \[\leadsto {\left({\left(e^{\sqrt{x}}\right)}^{\color{blue}{\left(10 \cdot \sqrt{x}\right)}}\right)}^{x} \cdot \cos x \]
    13. *-commutativeN/A

      \[\leadsto {\left({\left(e^{\sqrt{x}}\right)}^{\color{blue}{\left(\sqrt{x} \cdot 10\right)}}\right)}^{x} \cdot \cos x \]
    14. lower-*.f6493.4

      \[\leadsto {\left({\left(e^{\sqrt{x}}\right)}^{\color{blue}{\left(\sqrt{x} \cdot 10\right)}}\right)}^{x} \cdot \cos x \]
  8. Applied egg-rr93.4%

    \[\leadsto \color{blue}{{\left({\left(e^{\sqrt{x}}\right)}^{\left(\sqrt{x} \cdot 10\right)}\right)}^{x}} \cdot \cos x \]
  9. Step-by-step derivation
    1. lift-sqrt.f64N/A

      \[\leadsto {\left({\left(e^{\color{blue}{\sqrt{x}}}\right)}^{\left(\sqrt{x} \cdot 10\right)}\right)}^{x} \cdot \cos x \]
    2. rem-log-expN/A

      \[\leadsto {\left({\left(e^{\color{blue}{\log \left(e^{\sqrt{x}}\right)}}\right)}^{\left(\sqrt{x} \cdot 10\right)}\right)}^{x} \cdot \cos x \]
    3. lift-exp.f64N/A

      \[\leadsto {\left({\left(e^{\log \color{blue}{\left(e^{\sqrt{x}}\right)}}\right)}^{\left(\sqrt{x} \cdot 10\right)}\right)}^{x} \cdot \cos x \]
    4. lift-sqrt.f64N/A

      \[\leadsto {\left({\left(e^{\log \left(e^{\sqrt{x}}\right)}\right)}^{\left(\color{blue}{\sqrt{x}} \cdot 10\right)}\right)}^{x} \cdot \cos x \]
    5. lift-*.f64N/A

      \[\leadsto {\left({\left(e^{\log \left(e^{\sqrt{x}}\right)}\right)}^{\color{blue}{\left(\sqrt{x} \cdot 10\right)}}\right)}^{x} \cdot \cos x \]
    6. lift-exp.f64N/A

      \[\leadsto {\left({\left(e^{\log \color{blue}{\left(e^{\sqrt{x}}\right)}}\right)}^{\left(\sqrt{x} \cdot 10\right)}\right)}^{x} \cdot \cos x \]
    7. rem-log-expN/A

      \[\leadsto {\left({\left(e^{\color{blue}{\sqrt{x}}}\right)}^{\left(\sqrt{x} \cdot 10\right)}\right)}^{x} \cdot \cos x \]
    8. pow-expN/A

      \[\leadsto {\color{blue}{\left(e^{\sqrt{x} \cdot \left(\sqrt{x} \cdot 10\right)}\right)}}^{x} \cdot \cos x \]
    9. *-commutativeN/A

      \[\leadsto {\left(e^{\color{blue}{\left(\sqrt{x} \cdot 10\right) \cdot \sqrt{x}}}\right)}^{x} \cdot \cos x \]
    10. lift-*.f64N/A

      \[\leadsto {\left(e^{\color{blue}{\left(\sqrt{x} \cdot 10\right)} \cdot \sqrt{x}}\right)}^{x} \cdot \cos x \]
    11. *-commutativeN/A

      \[\leadsto {\left(e^{\color{blue}{\left(10 \cdot \sqrt{x}\right)} \cdot \sqrt{x}}\right)}^{x} \cdot \cos x \]
    12. associate-*l*N/A

      \[\leadsto {\left(e^{\color{blue}{10 \cdot \left(\sqrt{x} \cdot \sqrt{x}\right)}}\right)}^{x} \cdot \cos x \]
    13. exp-prodN/A

      \[\leadsto {\color{blue}{\left({\left(e^{10}\right)}^{\left(\sqrt{x} \cdot \sqrt{x}\right)}\right)}}^{x} \cdot \cos x \]
    14. lift-sqrt.f64N/A

      \[\leadsto {\left({\left(e^{10}\right)}^{\left(\color{blue}{\sqrt{x}} \cdot \sqrt{x}\right)}\right)}^{x} \cdot \cos x \]
    15. lift-sqrt.f64N/A

      \[\leadsto {\left({\left(e^{10}\right)}^{\left(\sqrt{x} \cdot \color{blue}{\sqrt{x}}\right)}\right)}^{x} \cdot \cos x \]
    16. rem-square-sqrtN/A

      \[\leadsto {\left({\left(e^{10}\right)}^{\color{blue}{x}}\right)}^{x} \cdot \cos x \]
    17. *-rgt-identityN/A

      \[\leadsto {\left({\left(e^{10}\right)}^{\color{blue}{\left(x \cdot 1\right)}}\right)}^{x} \cdot \cos x \]
    18. metadata-evalN/A

      \[\leadsto {\left({\left(e^{10}\right)}^{\left(x \cdot \color{blue}{\left(\frac{1}{2} + \frac{1}{2}\right)}\right)}\right)}^{x} \cdot \cos x \]
    19. distribute-lft-outN/A

      \[\leadsto {\left({\left(e^{10}\right)}^{\color{blue}{\left(x \cdot \frac{1}{2} + x \cdot \frac{1}{2}\right)}}\right)}^{x} \cdot \cos x \]
    20. distribute-rgt-outN/A

      \[\leadsto {\left({\left(e^{10}\right)}^{\color{blue}{\left(\frac{1}{2} \cdot \left(x + x\right)\right)}}\right)}^{x} \cdot \cos x \]
    21. pow-unpowN/A

      \[\leadsto {\color{blue}{\left({\left({\left(e^{10}\right)}^{\frac{1}{2}}\right)}^{\left(x + x\right)}\right)}}^{x} \cdot \cos x \]
    22. lower-pow.f64N/A

      \[\leadsto {\color{blue}{\left({\left({\left(e^{10}\right)}^{\frac{1}{2}}\right)}^{\left(x + x\right)}\right)}}^{x} \cdot \cos x \]
  10. Applied egg-rr98.4%

    \[\leadsto {\color{blue}{\left({\left({\left(e^{10}\right)}^{0.5}\right)}^{\left(x + x\right)}\right)}}^{x} \cdot \cos x \]
  11. Add Preprocessing

Alternative 2: 98.2% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \cos x \cdot {\left({\left(e^{5}\right)}^{x}\right)}^{\left(x + x\right)} \end{array} \]
(FPCore (x) :precision binary64 (* (cos x) (pow (pow (exp 5.0) x) (+ x x))))
double code(double x) {
	return cos(x) * pow(pow(exp(5.0), x), (x + x));
}
real(8) function code(x)
    real(8), intent (in) :: x
    code = cos(x) * ((exp(5.0d0) ** x) ** (x + x))
end function
public static double code(double x) {
	return Math.cos(x) * Math.pow(Math.pow(Math.exp(5.0), x), (x + x));
}
def code(x):
	return math.cos(x) * math.pow(math.pow(math.exp(5.0), x), (x + x))
function code(x)
	return Float64(cos(x) * ((exp(5.0) ^ x) ^ Float64(x + x)))
end
function tmp = code(x)
	tmp = cos(x) * ((exp(5.0) ^ x) ^ (x + x));
end
code[x_] := N[(N[Cos[x], $MachinePrecision] * N[Power[N[Power[N[Exp[5.0], $MachinePrecision], x], $MachinePrecision], N[(x + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\cos x \cdot {\left({\left(e^{5}\right)}^{x}\right)}^{\left(x + x\right)}
\end{array}
Derivation
  1. Initial program 94.4%

    \[\cos x \cdot e^{10 \cdot \left(x \cdot x\right)} \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. associate-*r*N/A

      \[\leadsto \cos x \cdot e^{\color{blue}{\left(10 \cdot x\right) \cdot x}} \]
    2. exp-prodN/A

      \[\leadsto \cos x \cdot \color{blue}{{\left(e^{10 \cdot x}\right)}^{x}} \]
    3. pow-expN/A

      \[\leadsto \cos x \cdot {\color{blue}{\left({\left(e^{10}\right)}^{x}\right)}}^{x} \]
    4. sqr-powN/A

      \[\leadsto \cos x \cdot {\color{blue}{\left({\left(e^{10}\right)}^{\left(\frac{x}{2}\right)} \cdot {\left(e^{10}\right)}^{\left(\frac{x}{2}\right)}\right)}}^{x} \]
    5. unpow-prod-downN/A

      \[\leadsto \cos x \cdot \color{blue}{\left({\left({\left(e^{10}\right)}^{\left(\frac{x}{2}\right)}\right)}^{x} \cdot {\left({\left(e^{10}\right)}^{\left(\frac{x}{2}\right)}\right)}^{x}\right)} \]
    6. pow-prod-upN/A

      \[\leadsto \cos x \cdot \color{blue}{{\left({\left(e^{10}\right)}^{\left(\frac{x}{2}\right)}\right)}^{\left(x + x\right)}} \]
    7. lower-pow.f64N/A

      \[\leadsto \cos x \cdot \color{blue}{{\left({\left(e^{10}\right)}^{\left(\frac{x}{2}\right)}\right)}^{\left(x + x\right)}} \]
    8. pow-to-expN/A

      \[\leadsto \cos x \cdot {\color{blue}{\left(e^{\log \left(e^{10}\right) \cdot \frac{x}{2}}\right)}}^{\left(x + x\right)} \]
    9. lower-exp.f64N/A

      \[\leadsto \cos x \cdot {\color{blue}{\left(e^{\log \left(e^{10}\right) \cdot \frac{x}{2}}\right)}}^{\left(x + x\right)} \]
    10. rem-log-expN/A

      \[\leadsto \cos x \cdot {\left(e^{\color{blue}{10} \cdot \frac{x}{2}}\right)}^{\left(x + x\right)} \]
    11. associate-*r/N/A

      \[\leadsto \cos x \cdot {\left(e^{\color{blue}{\frac{10 \cdot x}{2}}}\right)}^{\left(x + x\right)} \]
    12. *-commutativeN/A

      \[\leadsto \cos x \cdot {\left(e^{\frac{\color{blue}{x \cdot 10}}{2}}\right)}^{\left(x + x\right)} \]
    13. associate-/l*N/A

      \[\leadsto \cos x \cdot {\left(e^{\color{blue}{x \cdot \frac{10}{2}}}\right)}^{\left(x + x\right)} \]
    14. lower-*.f64N/A

      \[\leadsto \cos x \cdot {\left(e^{\color{blue}{x \cdot \frac{10}{2}}}\right)}^{\left(x + x\right)} \]
    15. metadata-evalN/A

      \[\leadsto \cos x \cdot {\left(e^{x \cdot \color{blue}{5}}\right)}^{\left(x + x\right)} \]
    16. lower-+.f6494.9

      \[\leadsto \cos x \cdot {\left(e^{x \cdot 5}\right)}^{\color{blue}{\left(x + x\right)}} \]
  4. Applied egg-rr94.9%

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

      \[\leadsto \cos x \cdot {\left(e^{\color{blue}{5 \cdot x}}\right)}^{\left(x + x\right)} \]
    2. exp-prodN/A

      \[\leadsto \cos x \cdot {\color{blue}{\left({\left(e^{5}\right)}^{x}\right)}}^{\left(x + x\right)} \]
    3. lower-pow.f64N/A

      \[\leadsto \cos x \cdot {\color{blue}{\left({\left(e^{5}\right)}^{x}\right)}}^{\left(x + x\right)} \]
    4. lower-exp.f6498.3

      \[\leadsto \cos x \cdot {\left({\color{blue}{\left(e^{5}\right)}}^{x}\right)}^{\left(x + x\right)} \]
  6. Applied egg-rr98.3%

    \[\leadsto \cos x \cdot {\color{blue}{\left({\left(e^{5}\right)}^{x}\right)}}^{\left(x + x\right)} \]
  7. Add Preprocessing

Alternative 3: 98.0% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \cos x \cdot {\left({\left(e^{10}\right)}^{x}\right)}^{x} \end{array} \]
(FPCore (x) :precision binary64 (* (cos x) (pow (pow (exp 10.0) x) x)))
double code(double x) {
	return cos(x) * pow(pow(exp(10.0), x), x);
}
real(8) function code(x)
    real(8), intent (in) :: x
    code = cos(x) * ((exp(10.0d0) ** x) ** x)
end function
public static double code(double x) {
	return Math.cos(x) * Math.pow(Math.pow(Math.exp(10.0), x), x);
}
def code(x):
	return math.cos(x) * math.pow(math.pow(math.exp(10.0), x), x)
function code(x)
	return Float64(cos(x) * ((exp(10.0) ^ x) ^ x))
end
function tmp = code(x)
	tmp = cos(x) * ((exp(10.0) ^ x) ^ x);
end
code[x_] := N[(N[Cos[x], $MachinePrecision] * N[Power[N[Power[N[Exp[10.0], $MachinePrecision], x], $MachinePrecision], x], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\cos x \cdot {\left({\left(e^{10}\right)}^{x}\right)}^{x}
\end{array}
Derivation
  1. Initial program 94.4%

    \[\cos x \cdot e^{10 \cdot \left(x \cdot x\right)} \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. associate-*r*N/A

      \[\leadsto \cos x \cdot e^{\color{blue}{\left(10 \cdot x\right) \cdot x}} \]
    2. *-commutativeN/A

      \[\leadsto \cos x \cdot e^{\color{blue}{x \cdot \left(10 \cdot x\right)}} \]
    3. exp-prodN/A

      \[\leadsto \cos x \cdot \color{blue}{{\left(e^{x}\right)}^{\left(10 \cdot x\right)}} \]
    4. *-commutativeN/A

      \[\leadsto \cos x \cdot {\left(e^{x}\right)}^{\color{blue}{\left(x \cdot 10\right)}} \]
    5. unpow1N/A

      \[\leadsto \cos x \cdot {\left(e^{x}\right)}^{\left(\color{blue}{{x}^{1}} \cdot 10\right)} \]
    6. metadata-evalN/A

      \[\leadsto \cos x \cdot {\left(e^{x}\right)}^{\left({x}^{\color{blue}{\left(\frac{2}{2}\right)}} \cdot 10\right)} \]
    7. sqr-powN/A

      \[\leadsto \cos x \cdot {\left(e^{x}\right)}^{\left(\color{blue}{\left({x}^{\left(\frac{\frac{2}{2}}{2}\right)} \cdot {x}^{\left(\frac{\frac{2}{2}}{2}\right)}\right)} \cdot 10\right)} \]
    8. associate-*l*N/A

      \[\leadsto \cos x \cdot {\left(e^{x}\right)}^{\color{blue}{\left({x}^{\left(\frac{\frac{2}{2}}{2}\right)} \cdot \left({x}^{\left(\frac{\frac{2}{2}}{2}\right)} \cdot 10\right)\right)}} \]
    9. pow-unpowN/A

      \[\leadsto \cos x \cdot \color{blue}{{\left({\left(e^{x}\right)}^{\left({x}^{\left(\frac{\frac{2}{2}}{2}\right)}\right)}\right)}^{\left({x}^{\left(\frac{\frac{2}{2}}{2}\right)} \cdot 10\right)}} \]
    10. lower-pow.f64N/A

      \[\leadsto \cos x \cdot \color{blue}{{\left({\left(e^{x}\right)}^{\left({x}^{\left(\frac{\frac{2}{2}}{2}\right)}\right)}\right)}^{\left({x}^{\left(\frac{\frac{2}{2}}{2}\right)} \cdot 10\right)}} \]
    11. pow-expN/A

      \[\leadsto \cos x \cdot {\color{blue}{\left(e^{x \cdot {x}^{\left(\frac{\frac{2}{2}}{2}\right)}}\right)}}^{\left({x}^{\left(\frac{\frac{2}{2}}{2}\right)} \cdot 10\right)} \]
    12. lower-exp.f64N/A

      \[\leadsto \cos x \cdot {\color{blue}{\left(e^{x \cdot {x}^{\left(\frac{\frac{2}{2}}{2}\right)}}\right)}}^{\left({x}^{\left(\frac{\frac{2}{2}}{2}\right)} \cdot 10\right)} \]
    13. lower-*.f64N/A

      \[\leadsto \cos x \cdot {\left(e^{\color{blue}{x \cdot {x}^{\left(\frac{\frac{2}{2}}{2}\right)}}}\right)}^{\left({x}^{\left(\frac{\frac{2}{2}}{2}\right)} \cdot 10\right)} \]
    14. metadata-evalN/A

      \[\leadsto \cos x \cdot {\left(e^{x \cdot {x}^{\left(\frac{\color{blue}{1}}{2}\right)}}\right)}^{\left({x}^{\left(\frac{\frac{2}{2}}{2}\right)} \cdot 10\right)} \]
    15. metadata-evalN/A

      \[\leadsto \cos x \cdot {\left(e^{x \cdot {x}^{\color{blue}{\frac{1}{2}}}}\right)}^{\left({x}^{\left(\frac{\frac{2}{2}}{2}\right)} \cdot 10\right)} \]
    16. unpow1/2N/A

      \[\leadsto \cos x \cdot {\left(e^{x \cdot \color{blue}{\sqrt{x}}}\right)}^{\left({x}^{\left(\frac{\frac{2}{2}}{2}\right)} \cdot 10\right)} \]
    17. lower-sqrt.f64N/A

      \[\leadsto \cos x \cdot {\left(e^{x \cdot \color{blue}{\sqrt{x}}}\right)}^{\left({x}^{\left(\frac{\frac{2}{2}}{2}\right)} \cdot 10\right)} \]
    18. *-commutativeN/A

      \[\leadsto \cos x \cdot {\left(e^{x \cdot \sqrt{x}}\right)}^{\color{blue}{\left(10 \cdot {x}^{\left(\frac{\frac{2}{2}}{2}\right)}\right)}} \]
    19. lower-*.f64N/A

      \[\leadsto \cos x \cdot {\left(e^{x \cdot \sqrt{x}}\right)}^{\color{blue}{\left(10 \cdot {x}^{\left(\frac{\frac{2}{2}}{2}\right)}\right)}} \]
    20. metadata-evalN/A

      \[\leadsto \cos x \cdot {\left(e^{x \cdot \sqrt{x}}\right)}^{\left(10 \cdot {x}^{\left(\frac{\color{blue}{1}}{2}\right)}\right)} \]
    21. metadata-evalN/A

      \[\leadsto \cos x \cdot {\left(e^{x \cdot \sqrt{x}}\right)}^{\left(10 \cdot {x}^{\color{blue}{\frac{1}{2}}}\right)} \]
  4. Applied egg-rr93.2%

    \[\leadsto \cos x \cdot \color{blue}{{\left(e^{x \cdot \sqrt{x}}\right)}^{\left(10 \cdot \sqrt{x}\right)}} \]
  5. Step-by-step derivation
    1. lift-cos.f64N/A

      \[\leadsto \color{blue}{\cos x} \cdot {\left(e^{x \cdot \sqrt{x}}\right)}^{\left(10 \cdot \sqrt{x}\right)} \]
    2. lift-sqrt.f64N/A

      \[\leadsto \cos x \cdot {\left(e^{x \cdot \color{blue}{\sqrt{x}}}\right)}^{\left(10 \cdot \sqrt{x}\right)} \]
    3. lift-*.f64N/A

      \[\leadsto \cos x \cdot {\left(e^{\color{blue}{x \cdot \sqrt{x}}}\right)}^{\left(10 \cdot \sqrt{x}\right)} \]
    4. rem-log-expN/A

      \[\leadsto \cos x \cdot {\left(e^{\color{blue}{\log \left(e^{x \cdot \sqrt{x}}\right)}}\right)}^{\left(10 \cdot \sqrt{x}\right)} \]
    5. lift-exp.f64N/A

      \[\leadsto \cos x \cdot {\left(e^{\log \color{blue}{\left(e^{x \cdot \sqrt{x}}\right)}}\right)}^{\left(10 \cdot \sqrt{x}\right)} \]
    6. lift-sqrt.f64N/A

      \[\leadsto \cos x \cdot {\left(e^{\log \left(e^{x \cdot \sqrt{x}}\right)}\right)}^{\left(10 \cdot \color{blue}{\sqrt{x}}\right)} \]
    7. lift-*.f64N/A

      \[\leadsto \cos x \cdot {\left(e^{\log \left(e^{x \cdot \sqrt{x}}\right)}\right)}^{\color{blue}{\left(10 \cdot \sqrt{x}\right)}} \]
    8. exp-prodN/A

      \[\leadsto \cos x \cdot \color{blue}{e^{\log \left(e^{x \cdot \sqrt{x}}\right) \cdot \left(10 \cdot \sqrt{x}\right)}} \]
    9. pow-to-expN/A

      \[\leadsto \cos x \cdot \color{blue}{{\left(e^{x \cdot \sqrt{x}}\right)}^{\left(10 \cdot \sqrt{x}\right)}} \]
    10. lift-pow.f64N/A

      \[\leadsto \cos x \cdot \color{blue}{{\left(e^{x \cdot \sqrt{x}}\right)}^{\left(10 \cdot \sqrt{x}\right)}} \]
    11. *-commutativeN/A

      \[\leadsto \color{blue}{{\left(e^{x \cdot \sqrt{x}}\right)}^{\left(10 \cdot \sqrt{x}\right)} \cdot \cos x} \]
    12. lower-*.f6493.2

      \[\leadsto \color{blue}{{\left(e^{x \cdot \sqrt{x}}\right)}^{\left(10 \cdot \sqrt{x}\right)} \cdot \cos x} \]
  6. Applied egg-rr93.3%

    \[\leadsto \color{blue}{e^{\sqrt{x} \cdot \left(x \cdot \left(10 \cdot \sqrt{x}\right)\right)} \cdot \cos x} \]
  7. Step-by-step derivation
    1. lift-sqrt.f64N/A

      \[\leadsto e^{\color{blue}{\sqrt{x}} \cdot \left(x \cdot \left(10 \cdot \sqrt{x}\right)\right)} \cdot \cos x \]
    2. lift-sqrt.f64N/A

      \[\leadsto e^{\sqrt{x} \cdot \left(x \cdot \left(10 \cdot \color{blue}{\sqrt{x}}\right)\right)} \cdot \cos x \]
    3. lift-*.f64N/A

      \[\leadsto e^{\sqrt{x} \cdot \left(x \cdot \color{blue}{\left(10 \cdot \sqrt{x}\right)}\right)} \cdot \cos x \]
    4. lift-*.f64N/A

      \[\leadsto e^{\sqrt{x} \cdot \color{blue}{\left(x \cdot \left(10 \cdot \sqrt{x}\right)\right)}} \cdot \cos x \]
    5. exp-prodN/A

      \[\leadsto \color{blue}{{\left(e^{\sqrt{x}}\right)}^{\left(x \cdot \left(10 \cdot \sqrt{x}\right)\right)}} \cdot \cos x \]
    6. lift-*.f64N/A

      \[\leadsto {\left(e^{\sqrt{x}}\right)}^{\color{blue}{\left(x \cdot \left(10 \cdot \sqrt{x}\right)\right)}} \cdot \cos x \]
    7. *-commutativeN/A

      \[\leadsto {\left(e^{\sqrt{x}}\right)}^{\color{blue}{\left(\left(10 \cdot \sqrt{x}\right) \cdot x\right)}} \cdot \cos x \]
    8. pow-unpowN/A

      \[\leadsto \color{blue}{{\left({\left(e^{\sqrt{x}}\right)}^{\left(10 \cdot \sqrt{x}\right)}\right)}^{x}} \cdot \cos x \]
    9. lower-pow.f64N/A

      \[\leadsto \color{blue}{{\left({\left(e^{\sqrt{x}}\right)}^{\left(10 \cdot \sqrt{x}\right)}\right)}^{x}} \cdot \cos x \]
    10. lower-pow.f64N/A

      \[\leadsto {\color{blue}{\left({\left(e^{\sqrt{x}}\right)}^{\left(10 \cdot \sqrt{x}\right)}\right)}}^{x} \cdot \cos x \]
    11. lower-exp.f6493.4

      \[\leadsto {\left({\color{blue}{\left(e^{\sqrt{x}}\right)}}^{\left(10 \cdot \sqrt{x}\right)}\right)}^{x} \cdot \cos x \]
    12. lift-*.f64N/A

      \[\leadsto {\left({\left(e^{\sqrt{x}}\right)}^{\color{blue}{\left(10 \cdot \sqrt{x}\right)}}\right)}^{x} \cdot \cos x \]
    13. *-commutativeN/A

      \[\leadsto {\left({\left(e^{\sqrt{x}}\right)}^{\color{blue}{\left(\sqrt{x} \cdot 10\right)}}\right)}^{x} \cdot \cos x \]
    14. lower-*.f6493.4

      \[\leadsto {\left({\left(e^{\sqrt{x}}\right)}^{\color{blue}{\left(\sqrt{x} \cdot 10\right)}}\right)}^{x} \cdot \cos x \]
  8. Applied egg-rr93.4%

    \[\leadsto \color{blue}{{\left({\left(e^{\sqrt{x}}\right)}^{\left(\sqrt{x} \cdot 10\right)}\right)}^{x}} \cdot \cos x \]
  9. Step-by-step derivation
    1. lift-sqrt.f64N/A

      \[\leadsto {\left({\left(e^{\color{blue}{\sqrt{x}}}\right)}^{\left(\sqrt{x} \cdot 10\right)}\right)}^{x} \cdot \cos x \]
    2. rem-log-expN/A

      \[\leadsto {\left({\left(e^{\color{blue}{\log \left(e^{\sqrt{x}}\right)}}\right)}^{\left(\sqrt{x} \cdot 10\right)}\right)}^{x} \cdot \cos x \]
    3. lift-exp.f64N/A

      \[\leadsto {\left({\left(e^{\log \color{blue}{\left(e^{\sqrt{x}}\right)}}\right)}^{\left(\sqrt{x} \cdot 10\right)}\right)}^{x} \cdot \cos x \]
    4. lift-sqrt.f64N/A

      \[\leadsto {\left({\left(e^{\log \left(e^{\sqrt{x}}\right)}\right)}^{\left(\color{blue}{\sqrt{x}} \cdot 10\right)}\right)}^{x} \cdot \cos x \]
    5. lift-*.f64N/A

      \[\leadsto {\left({\left(e^{\log \left(e^{\sqrt{x}}\right)}\right)}^{\color{blue}{\left(\sqrt{x} \cdot 10\right)}}\right)}^{x} \cdot \cos x \]
    6. lift-exp.f64N/A

      \[\leadsto {\left({\left(e^{\log \color{blue}{\left(e^{\sqrt{x}}\right)}}\right)}^{\left(\sqrt{x} \cdot 10\right)}\right)}^{x} \cdot \cos x \]
    7. rem-log-expN/A

      \[\leadsto {\left({\left(e^{\color{blue}{\sqrt{x}}}\right)}^{\left(\sqrt{x} \cdot 10\right)}\right)}^{x} \cdot \cos x \]
    8. pow-expN/A

      \[\leadsto {\color{blue}{\left(e^{\sqrt{x} \cdot \left(\sqrt{x} \cdot 10\right)}\right)}}^{x} \cdot \cos x \]
    9. *-commutativeN/A

      \[\leadsto {\left(e^{\color{blue}{\left(\sqrt{x} \cdot 10\right) \cdot \sqrt{x}}}\right)}^{x} \cdot \cos x \]
    10. lift-*.f64N/A

      \[\leadsto {\left(e^{\color{blue}{\left(\sqrt{x} \cdot 10\right)} \cdot \sqrt{x}}\right)}^{x} \cdot \cos x \]
    11. *-commutativeN/A

      \[\leadsto {\left(e^{\color{blue}{\left(10 \cdot \sqrt{x}\right)} \cdot \sqrt{x}}\right)}^{x} \cdot \cos x \]
    12. associate-*l*N/A

      \[\leadsto {\left(e^{\color{blue}{10 \cdot \left(\sqrt{x} \cdot \sqrt{x}\right)}}\right)}^{x} \cdot \cos x \]
    13. exp-prodN/A

      \[\leadsto {\color{blue}{\left({\left(e^{10}\right)}^{\left(\sqrt{x} \cdot \sqrt{x}\right)}\right)}}^{x} \cdot \cos x \]
    14. lift-sqrt.f64N/A

      \[\leadsto {\left({\left(e^{10}\right)}^{\left(\color{blue}{\sqrt{x}} \cdot \sqrt{x}\right)}\right)}^{x} \cdot \cos x \]
    15. lift-sqrt.f64N/A

      \[\leadsto {\left({\left(e^{10}\right)}^{\left(\sqrt{x} \cdot \color{blue}{\sqrt{x}}\right)}\right)}^{x} \cdot \cos x \]
    16. rem-square-sqrtN/A

      \[\leadsto {\left({\left(e^{10}\right)}^{\color{blue}{x}}\right)}^{x} \cdot \cos x \]
    17. lower-pow.f64N/A

      \[\leadsto {\color{blue}{\left({\left(e^{10}\right)}^{x}\right)}}^{x} \cdot \cos x \]
    18. lower-exp.f6497.9

      \[\leadsto {\left({\color{blue}{\left(e^{10}\right)}}^{x}\right)}^{x} \cdot \cos x \]
  10. Applied egg-rr97.9%

    \[\leadsto {\color{blue}{\left({\left(e^{10}\right)}^{x}\right)}}^{x} \cdot \cos x \]
  11. Final simplification97.9%

    \[\leadsto \cos x \cdot {\left({\left(e^{10}\right)}^{x}\right)}^{x} \]
  12. Add Preprocessing

Alternative 4: 96.6% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \cos x \cdot {\left({\left(e^{x}\right)}^{x}\right)}^{10} \end{array} \]
(FPCore (x) :precision binary64 (* (cos x) (pow (pow (exp x) x) 10.0)))
double code(double x) {
	return cos(x) * pow(pow(exp(x), x), 10.0);
}
real(8) function code(x)
    real(8), intent (in) :: x
    code = cos(x) * ((exp(x) ** x) ** 10.0d0)
end function
public static double code(double x) {
	return Math.cos(x) * Math.pow(Math.pow(Math.exp(x), x), 10.0);
}
def code(x):
	return math.cos(x) * math.pow(math.pow(math.exp(x), x), 10.0)
function code(x)
	return Float64(cos(x) * ((exp(x) ^ x) ^ 10.0))
end
function tmp = code(x)
	tmp = cos(x) * ((exp(x) ^ x) ^ 10.0);
end
code[x_] := N[(N[Cos[x], $MachinePrecision] * N[Power[N[Power[N[Exp[x], $MachinePrecision], x], $MachinePrecision], 10.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\cos x \cdot {\left({\left(e^{x}\right)}^{x}\right)}^{10}
\end{array}
Derivation
  1. Initial program 94.4%

    \[\cos x \cdot e^{10 \cdot \left(x \cdot x\right)} \]
  2. Add Preprocessing
  3. Applied egg-rr95.2%

    \[\leadsto \cos x \cdot \color{blue}{{\left(e^{x \cdot x}\right)}^{10}} \]
  4. Step-by-step derivation
    1. exp-prodN/A

      \[\leadsto \cos x \cdot {\color{blue}{\left({\left(e^{x}\right)}^{x}\right)}}^{10} \]
    2. lower-pow.f64N/A

      \[\leadsto \cos x \cdot {\color{blue}{\left({\left(e^{x}\right)}^{x}\right)}}^{10} \]
    3. lower-exp.f6496.7

      \[\leadsto \cos x \cdot {\left({\color{blue}{\left(e^{x}\right)}}^{x}\right)}^{10} \]
  5. Applied egg-rr96.7%

    \[\leadsto \cos x \cdot {\color{blue}{\left({\left(e^{x}\right)}^{x}\right)}}^{10} \]
  6. Add Preprocessing

Alternative 5: 95.2% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \cos x \cdot {\left(e^{x \cdot x}\right)}^{10} \end{array} \]
(FPCore (x) :precision binary64 (* (cos x) (pow (exp (* x x)) 10.0)))
double code(double x) {
	return cos(x) * pow(exp((x * x)), 10.0);
}
real(8) function code(x)
    real(8), intent (in) :: x
    code = cos(x) * (exp((x * x)) ** 10.0d0)
end function
public static double code(double x) {
	return Math.cos(x) * Math.pow(Math.exp((x * x)), 10.0);
}
def code(x):
	return math.cos(x) * math.pow(math.exp((x * x)), 10.0)
function code(x)
	return Float64(cos(x) * (exp(Float64(x * x)) ^ 10.0))
end
function tmp = code(x)
	tmp = cos(x) * (exp((x * x)) ^ 10.0);
end
code[x_] := N[(N[Cos[x], $MachinePrecision] * N[Power[N[Exp[N[(x * x), $MachinePrecision]], $MachinePrecision], 10.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\cos x \cdot {\left(e^{x \cdot x}\right)}^{10}
\end{array}
Derivation
  1. Initial program 94.4%

    \[\cos x \cdot e^{10 \cdot \left(x \cdot x\right)} \]
  2. Add Preprocessing
  3. Applied egg-rr95.2%

    \[\leadsto \cos x \cdot \color{blue}{{\left(e^{x \cdot x}\right)}^{10}} \]
  4. Add Preprocessing

Alternative 6: 95.3% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \cos x \cdot {\left(e^{10}\right)}^{\left(x \cdot x\right)} \end{array} \]
(FPCore (x) :precision binary64 (* (cos x) (pow (exp 10.0) (* x x))))
double code(double x) {
	return cos(x) * pow(exp(10.0), (x * x));
}
real(8) function code(x)
    real(8), intent (in) :: x
    code = cos(x) * (exp(10.0d0) ** (x * x))
end function
public static double code(double x) {
	return Math.cos(x) * Math.pow(Math.exp(10.0), (x * x));
}
def code(x):
	return math.cos(x) * math.pow(math.exp(10.0), (x * x))
function code(x)
	return Float64(cos(x) * (exp(10.0) ^ Float64(x * x)))
end
function tmp = code(x)
	tmp = cos(x) * (exp(10.0) ^ (x * x));
end
code[x_] := N[(N[Cos[x], $MachinePrecision] * N[Power[N[Exp[10.0], $MachinePrecision], N[(x * x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\cos x \cdot {\left(e^{10}\right)}^{\left(x \cdot x\right)}
\end{array}
Derivation
  1. Initial program 94.4%

    \[\cos x \cdot e^{10 \cdot \left(x \cdot x\right)} \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. lift-*.f64N/A

      \[\leadsto \cos x \cdot e^{10 \cdot \color{blue}{\left(x \cdot x\right)}} \]
    2. exp-prodN/A

      \[\leadsto \cos x \cdot \color{blue}{{\left(e^{10}\right)}^{\left(x \cdot x\right)}} \]
    3. lower-pow.f64N/A

      \[\leadsto \cos x \cdot \color{blue}{{\left(e^{10}\right)}^{\left(x \cdot x\right)}} \]
    4. lower-exp.f6495.2

      \[\leadsto \cos x \cdot {\color{blue}{\left(e^{10}\right)}}^{\left(x \cdot x\right)} \]
  4. Applied egg-rr95.2%

    \[\leadsto \cos x \cdot \color{blue}{{\left(e^{10}\right)}^{\left(x \cdot x\right)}} \]
  5. Add Preprocessing

Alternative 7: 94.4% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \cos x \cdot e^{\mathsf{fma}\left(x \cdot x, 5, x \cdot \left(x \cdot 5\right)\right)} \end{array} \]
(FPCore (x)
 :precision binary64
 (* (cos x) (exp (fma (* x x) 5.0 (* x (* x 5.0))))))
double code(double x) {
	return cos(x) * exp(fma((x * x), 5.0, (x * (x * 5.0))));
}
function code(x)
	return Float64(cos(x) * exp(fma(Float64(x * x), 5.0, Float64(x * Float64(x * 5.0)))))
end
code[x_] := N[(N[Cos[x], $MachinePrecision] * N[Exp[N[(N[(x * x), $MachinePrecision] * 5.0 + N[(x * N[(x * 5.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\cos x \cdot e^{\mathsf{fma}\left(x \cdot x, 5, x \cdot \left(x \cdot 5\right)\right)}
\end{array}
Derivation
  1. Initial program 94.4%

    \[\cos x \cdot e^{10 \cdot \left(x \cdot x\right)} \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. associate-*r*N/A

      \[\leadsto \cos x \cdot e^{\color{blue}{\left(10 \cdot x\right) \cdot x}} \]
    2. *-commutativeN/A

      \[\leadsto \cos x \cdot e^{\color{blue}{x \cdot \left(10 \cdot x\right)}} \]
    3. exp-prodN/A

      \[\leadsto \cos x \cdot \color{blue}{{\left(e^{x}\right)}^{\left(10 \cdot x\right)}} \]
    4. *-commutativeN/A

      \[\leadsto \cos x \cdot {\left(e^{x}\right)}^{\color{blue}{\left(x \cdot 10\right)}} \]
    5. unpow1N/A

      \[\leadsto \cos x \cdot {\left(e^{x}\right)}^{\left(\color{blue}{{x}^{1}} \cdot 10\right)} \]
    6. metadata-evalN/A

      \[\leadsto \cos x \cdot {\left(e^{x}\right)}^{\left({x}^{\color{blue}{\left(\frac{2}{2}\right)}} \cdot 10\right)} \]
    7. sqr-powN/A

      \[\leadsto \cos x \cdot {\left(e^{x}\right)}^{\left(\color{blue}{\left({x}^{\left(\frac{\frac{2}{2}}{2}\right)} \cdot {x}^{\left(\frac{\frac{2}{2}}{2}\right)}\right)} \cdot 10\right)} \]
    8. associate-*l*N/A

      \[\leadsto \cos x \cdot {\left(e^{x}\right)}^{\color{blue}{\left({x}^{\left(\frac{\frac{2}{2}}{2}\right)} \cdot \left({x}^{\left(\frac{\frac{2}{2}}{2}\right)} \cdot 10\right)\right)}} \]
    9. pow-unpowN/A

      \[\leadsto \cos x \cdot \color{blue}{{\left({\left(e^{x}\right)}^{\left({x}^{\left(\frac{\frac{2}{2}}{2}\right)}\right)}\right)}^{\left({x}^{\left(\frac{\frac{2}{2}}{2}\right)} \cdot 10\right)}} \]
    10. lower-pow.f64N/A

      \[\leadsto \cos x \cdot \color{blue}{{\left({\left(e^{x}\right)}^{\left({x}^{\left(\frac{\frac{2}{2}}{2}\right)}\right)}\right)}^{\left({x}^{\left(\frac{\frac{2}{2}}{2}\right)} \cdot 10\right)}} \]
    11. pow-expN/A

      \[\leadsto \cos x \cdot {\color{blue}{\left(e^{x \cdot {x}^{\left(\frac{\frac{2}{2}}{2}\right)}}\right)}}^{\left({x}^{\left(\frac{\frac{2}{2}}{2}\right)} \cdot 10\right)} \]
    12. lower-exp.f64N/A

      \[\leadsto \cos x \cdot {\color{blue}{\left(e^{x \cdot {x}^{\left(\frac{\frac{2}{2}}{2}\right)}}\right)}}^{\left({x}^{\left(\frac{\frac{2}{2}}{2}\right)} \cdot 10\right)} \]
    13. lower-*.f64N/A

      \[\leadsto \cos x \cdot {\left(e^{\color{blue}{x \cdot {x}^{\left(\frac{\frac{2}{2}}{2}\right)}}}\right)}^{\left({x}^{\left(\frac{\frac{2}{2}}{2}\right)} \cdot 10\right)} \]
    14. metadata-evalN/A

      \[\leadsto \cos x \cdot {\left(e^{x \cdot {x}^{\left(\frac{\color{blue}{1}}{2}\right)}}\right)}^{\left({x}^{\left(\frac{\frac{2}{2}}{2}\right)} \cdot 10\right)} \]
    15. metadata-evalN/A

      \[\leadsto \cos x \cdot {\left(e^{x \cdot {x}^{\color{blue}{\frac{1}{2}}}}\right)}^{\left({x}^{\left(\frac{\frac{2}{2}}{2}\right)} \cdot 10\right)} \]
    16. unpow1/2N/A

      \[\leadsto \cos x \cdot {\left(e^{x \cdot \color{blue}{\sqrt{x}}}\right)}^{\left({x}^{\left(\frac{\frac{2}{2}}{2}\right)} \cdot 10\right)} \]
    17. lower-sqrt.f64N/A

      \[\leadsto \cos x \cdot {\left(e^{x \cdot \color{blue}{\sqrt{x}}}\right)}^{\left({x}^{\left(\frac{\frac{2}{2}}{2}\right)} \cdot 10\right)} \]
    18. *-commutativeN/A

      \[\leadsto \cos x \cdot {\left(e^{x \cdot \sqrt{x}}\right)}^{\color{blue}{\left(10 \cdot {x}^{\left(\frac{\frac{2}{2}}{2}\right)}\right)}} \]
    19. lower-*.f64N/A

      \[\leadsto \cos x \cdot {\left(e^{x \cdot \sqrt{x}}\right)}^{\color{blue}{\left(10 \cdot {x}^{\left(\frac{\frac{2}{2}}{2}\right)}\right)}} \]
    20. metadata-evalN/A

      \[\leadsto \cos x \cdot {\left(e^{x \cdot \sqrt{x}}\right)}^{\left(10 \cdot {x}^{\left(\frac{\color{blue}{1}}{2}\right)}\right)} \]
    21. metadata-evalN/A

      \[\leadsto \cos x \cdot {\left(e^{x \cdot \sqrt{x}}\right)}^{\left(10 \cdot {x}^{\color{blue}{\frac{1}{2}}}\right)} \]
  4. Applied egg-rr93.2%

    \[\leadsto \cos x \cdot \color{blue}{{\left(e^{x \cdot \sqrt{x}}\right)}^{\left(10 \cdot \sqrt{x}\right)}} \]
  5. Step-by-step derivation
    1. lift-cos.f64N/A

      \[\leadsto \color{blue}{\cos x} \cdot {\left(e^{x \cdot \sqrt{x}}\right)}^{\left(10 \cdot \sqrt{x}\right)} \]
    2. lift-sqrt.f64N/A

      \[\leadsto \cos x \cdot {\left(e^{x \cdot \color{blue}{\sqrt{x}}}\right)}^{\left(10 \cdot \sqrt{x}\right)} \]
    3. lift-*.f64N/A

      \[\leadsto \cos x \cdot {\left(e^{\color{blue}{x \cdot \sqrt{x}}}\right)}^{\left(10 \cdot \sqrt{x}\right)} \]
    4. rem-log-expN/A

      \[\leadsto \cos x \cdot {\left(e^{\color{blue}{\log \left(e^{x \cdot \sqrt{x}}\right)}}\right)}^{\left(10 \cdot \sqrt{x}\right)} \]
    5. lift-exp.f64N/A

      \[\leadsto \cos x \cdot {\left(e^{\log \color{blue}{\left(e^{x \cdot \sqrt{x}}\right)}}\right)}^{\left(10 \cdot \sqrt{x}\right)} \]
    6. lift-sqrt.f64N/A

      \[\leadsto \cos x \cdot {\left(e^{\log \left(e^{x \cdot \sqrt{x}}\right)}\right)}^{\left(10 \cdot \color{blue}{\sqrt{x}}\right)} \]
    7. lift-*.f64N/A

      \[\leadsto \cos x \cdot {\left(e^{\log \left(e^{x \cdot \sqrt{x}}\right)}\right)}^{\color{blue}{\left(10 \cdot \sqrt{x}\right)}} \]
    8. exp-prodN/A

      \[\leadsto \cos x \cdot \color{blue}{e^{\log \left(e^{x \cdot \sqrt{x}}\right) \cdot \left(10 \cdot \sqrt{x}\right)}} \]
    9. pow-to-expN/A

      \[\leadsto \cos x \cdot \color{blue}{{\left(e^{x \cdot \sqrt{x}}\right)}^{\left(10 \cdot \sqrt{x}\right)}} \]
    10. lift-pow.f64N/A

      \[\leadsto \cos x \cdot \color{blue}{{\left(e^{x \cdot \sqrt{x}}\right)}^{\left(10 \cdot \sqrt{x}\right)}} \]
    11. *-commutativeN/A

      \[\leadsto \color{blue}{{\left(e^{x \cdot \sqrt{x}}\right)}^{\left(10 \cdot \sqrt{x}\right)} \cdot \cos x} \]
    12. lower-*.f6493.2

      \[\leadsto \color{blue}{{\left(e^{x \cdot \sqrt{x}}\right)}^{\left(10 \cdot \sqrt{x}\right)} \cdot \cos x} \]
  6. Applied egg-rr93.3%

    \[\leadsto \color{blue}{e^{\sqrt{x} \cdot \left(x \cdot \left(10 \cdot \sqrt{x}\right)\right)} \cdot \cos x} \]
  7. Step-by-step derivation
    1. lift-sqrt.f64N/A

      \[\leadsto e^{\color{blue}{\sqrt{x}} \cdot \left(x \cdot \left(10 \cdot \sqrt{x}\right)\right)} \cdot \cos x \]
    2. lift-sqrt.f64N/A

      \[\leadsto e^{\sqrt{x} \cdot \left(x \cdot \left(10 \cdot \color{blue}{\sqrt{x}}\right)\right)} \cdot \cos x \]
    3. lift-*.f64N/A

      \[\leadsto e^{\sqrt{x} \cdot \left(x \cdot \color{blue}{\left(10 \cdot \sqrt{x}\right)}\right)} \cdot \cos x \]
    4. lift-*.f64N/A

      \[\leadsto e^{\sqrt{x} \cdot \color{blue}{\left(x \cdot \left(10 \cdot \sqrt{x}\right)\right)}} \cdot \cos x \]
    5. *-commutativeN/A

      \[\leadsto e^{\color{blue}{\left(x \cdot \left(10 \cdot \sqrt{x}\right)\right) \cdot \sqrt{x}}} \cdot \cos x \]
    6. lift-*.f64N/A

      \[\leadsto e^{\color{blue}{\left(x \cdot \left(10 \cdot \sqrt{x}\right)\right)} \cdot \sqrt{x}} \cdot \cos x \]
    7. *-commutativeN/A

      \[\leadsto e^{\color{blue}{\left(\left(10 \cdot \sqrt{x}\right) \cdot x\right)} \cdot \sqrt{x}} \cdot \cos x \]
    8. associate-*r*N/A

      \[\leadsto e^{\color{blue}{\left(10 \cdot \sqrt{x}\right) \cdot \left(x \cdot \sqrt{x}\right)}} \cdot \cos x \]
    9. *-commutativeN/A

      \[\leadsto e^{\left(10 \cdot \sqrt{x}\right) \cdot \color{blue}{\left(\sqrt{x} \cdot x\right)}} \cdot \cos x \]
    10. associate-*r*N/A

      \[\leadsto e^{\color{blue}{\left(\left(10 \cdot \sqrt{x}\right) \cdot \sqrt{x}\right) \cdot x}} \cdot \cos x \]
    11. lower-*.f64N/A

      \[\leadsto e^{\color{blue}{\left(\left(10 \cdot \sqrt{x}\right) \cdot \sqrt{x}\right) \cdot x}} \cdot \cos x \]
    12. lower-*.f6493.3

      \[\leadsto e^{\color{blue}{\left(\left(10 \cdot \sqrt{x}\right) \cdot \sqrt{x}\right)} \cdot x} \cdot \cos x \]
    13. lift-*.f64N/A

      \[\leadsto e^{\left(\color{blue}{\left(10 \cdot \sqrt{x}\right)} \cdot \sqrt{x}\right) \cdot x} \cdot \cos x \]
    14. *-commutativeN/A

      \[\leadsto e^{\left(\color{blue}{\left(\sqrt{x} \cdot 10\right)} \cdot \sqrt{x}\right) \cdot x} \cdot \cos x \]
    15. lower-*.f6493.3

      \[\leadsto e^{\left(\color{blue}{\left(\sqrt{x} \cdot 10\right)} \cdot \sqrt{x}\right) \cdot x} \cdot \cos x \]
  8. Applied egg-rr93.3%

    \[\leadsto e^{\color{blue}{\left(\left(\sqrt{x} \cdot 10\right) \cdot \sqrt{x}\right) \cdot x}} \cdot \cos x \]
  9. Applied egg-rr94.5%

    \[\leadsto e^{\color{blue}{\mathsf{fma}\left(x \cdot x, 5, x \cdot \left(x \cdot 5\right)\right)}} \cdot \cos x \]
  10. Final simplification94.5%

    \[\leadsto \cos x \cdot e^{\mathsf{fma}\left(x \cdot x, 5, x \cdot \left(x \cdot 5\right)\right)} \]
  11. Add Preprocessing

Alternative 8: 94.4% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \cos x \cdot e^{10 \cdot \left(x \cdot x\right)} \end{array} \]
(FPCore (x) :precision binary64 (* (cos x) (exp (* 10.0 (* x x)))))
double code(double x) {
	return cos(x) * exp((10.0 * (x * x)));
}
real(8) function code(x)
    real(8), intent (in) :: x
    code = cos(x) * exp((10.0d0 * (x * x)))
end function
public static double code(double x) {
	return Math.cos(x) * Math.exp((10.0 * (x * x)));
}
def code(x):
	return math.cos(x) * math.exp((10.0 * (x * x)))
function code(x)
	return Float64(cos(x) * exp(Float64(10.0 * Float64(x * x))))
end
function tmp = code(x)
	tmp = cos(x) * exp((10.0 * (x * x)));
end
code[x_] := N[(N[Cos[x], $MachinePrecision] * N[Exp[N[(10.0 * N[(x * x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\cos x \cdot e^{10 \cdot \left(x \cdot x\right)}
\end{array}
Derivation
  1. Initial program 94.4%

    \[\cos x \cdot e^{10 \cdot \left(x \cdot x\right)} \]
  2. Add Preprocessing
  3. Add Preprocessing

Alternative 9: 27.5% accurate, 1.2× speedup?

\[\begin{array}{l} \\ e^{\sqrt{x} \cdot \left(x \cdot \left(10 \cdot \sqrt{x}\right)\right)} \cdot \mathsf{fma}\left(x \cdot x, \mathsf{fma}\left(x \cdot x, \mathsf{fma}\left(x \cdot x, -0.001388888888888889, 0.041666666666666664\right), -0.5\right), 1\right) \end{array} \]
(FPCore (x)
 :precision binary64
 (*
  (exp (* (sqrt x) (* x (* 10.0 (sqrt x)))))
  (fma
   (* x x)
   (fma (* x x) (fma (* x x) -0.001388888888888889 0.041666666666666664) -0.5)
   1.0)))
double code(double x) {
	return exp((sqrt(x) * (x * (10.0 * sqrt(x))))) * fma((x * x), fma((x * x), fma((x * x), -0.001388888888888889, 0.041666666666666664), -0.5), 1.0);
}
function code(x)
	return Float64(exp(Float64(sqrt(x) * Float64(x * Float64(10.0 * sqrt(x))))) * fma(Float64(x * x), fma(Float64(x * x), fma(Float64(x * x), -0.001388888888888889, 0.041666666666666664), -0.5), 1.0))
end
code[x_] := N[(N[Exp[N[(N[Sqrt[x], $MachinePrecision] * N[(x * N[(10.0 * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * -0.001388888888888889 + 0.041666666666666664), $MachinePrecision] + -0.5), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
e^{\sqrt{x} \cdot \left(x \cdot \left(10 \cdot \sqrt{x}\right)\right)} \cdot \mathsf{fma}\left(x \cdot x, \mathsf{fma}\left(x \cdot x, \mathsf{fma}\left(x \cdot x, -0.001388888888888889, 0.041666666666666664\right), -0.5\right), 1\right)
\end{array}
Derivation
  1. Initial program 94.4%

    \[\cos x \cdot e^{10 \cdot \left(x \cdot x\right)} \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. associate-*r*N/A

      \[\leadsto \cos x \cdot e^{\color{blue}{\left(10 \cdot x\right) \cdot x}} \]
    2. *-commutativeN/A

      \[\leadsto \cos x \cdot e^{\color{blue}{x \cdot \left(10 \cdot x\right)}} \]
    3. exp-prodN/A

      \[\leadsto \cos x \cdot \color{blue}{{\left(e^{x}\right)}^{\left(10 \cdot x\right)}} \]
    4. *-commutativeN/A

      \[\leadsto \cos x \cdot {\left(e^{x}\right)}^{\color{blue}{\left(x \cdot 10\right)}} \]
    5. unpow1N/A

      \[\leadsto \cos x \cdot {\left(e^{x}\right)}^{\left(\color{blue}{{x}^{1}} \cdot 10\right)} \]
    6. metadata-evalN/A

      \[\leadsto \cos x \cdot {\left(e^{x}\right)}^{\left({x}^{\color{blue}{\left(\frac{2}{2}\right)}} \cdot 10\right)} \]
    7. sqr-powN/A

      \[\leadsto \cos x \cdot {\left(e^{x}\right)}^{\left(\color{blue}{\left({x}^{\left(\frac{\frac{2}{2}}{2}\right)} \cdot {x}^{\left(\frac{\frac{2}{2}}{2}\right)}\right)} \cdot 10\right)} \]
    8. associate-*l*N/A

      \[\leadsto \cos x \cdot {\left(e^{x}\right)}^{\color{blue}{\left({x}^{\left(\frac{\frac{2}{2}}{2}\right)} \cdot \left({x}^{\left(\frac{\frac{2}{2}}{2}\right)} \cdot 10\right)\right)}} \]
    9. pow-unpowN/A

      \[\leadsto \cos x \cdot \color{blue}{{\left({\left(e^{x}\right)}^{\left({x}^{\left(\frac{\frac{2}{2}}{2}\right)}\right)}\right)}^{\left({x}^{\left(\frac{\frac{2}{2}}{2}\right)} \cdot 10\right)}} \]
    10. lower-pow.f64N/A

      \[\leadsto \cos x \cdot \color{blue}{{\left({\left(e^{x}\right)}^{\left({x}^{\left(\frac{\frac{2}{2}}{2}\right)}\right)}\right)}^{\left({x}^{\left(\frac{\frac{2}{2}}{2}\right)} \cdot 10\right)}} \]
    11. pow-expN/A

      \[\leadsto \cos x \cdot {\color{blue}{\left(e^{x \cdot {x}^{\left(\frac{\frac{2}{2}}{2}\right)}}\right)}}^{\left({x}^{\left(\frac{\frac{2}{2}}{2}\right)} \cdot 10\right)} \]
    12. lower-exp.f64N/A

      \[\leadsto \cos x \cdot {\color{blue}{\left(e^{x \cdot {x}^{\left(\frac{\frac{2}{2}}{2}\right)}}\right)}}^{\left({x}^{\left(\frac{\frac{2}{2}}{2}\right)} \cdot 10\right)} \]
    13. lower-*.f64N/A

      \[\leadsto \cos x \cdot {\left(e^{\color{blue}{x \cdot {x}^{\left(\frac{\frac{2}{2}}{2}\right)}}}\right)}^{\left({x}^{\left(\frac{\frac{2}{2}}{2}\right)} \cdot 10\right)} \]
    14. metadata-evalN/A

      \[\leadsto \cos x \cdot {\left(e^{x \cdot {x}^{\left(\frac{\color{blue}{1}}{2}\right)}}\right)}^{\left({x}^{\left(\frac{\frac{2}{2}}{2}\right)} \cdot 10\right)} \]
    15. metadata-evalN/A

      \[\leadsto \cos x \cdot {\left(e^{x \cdot {x}^{\color{blue}{\frac{1}{2}}}}\right)}^{\left({x}^{\left(\frac{\frac{2}{2}}{2}\right)} \cdot 10\right)} \]
    16. unpow1/2N/A

      \[\leadsto \cos x \cdot {\left(e^{x \cdot \color{blue}{\sqrt{x}}}\right)}^{\left({x}^{\left(\frac{\frac{2}{2}}{2}\right)} \cdot 10\right)} \]
    17. lower-sqrt.f64N/A

      \[\leadsto \cos x \cdot {\left(e^{x \cdot \color{blue}{\sqrt{x}}}\right)}^{\left({x}^{\left(\frac{\frac{2}{2}}{2}\right)} \cdot 10\right)} \]
    18. *-commutativeN/A

      \[\leadsto \cos x \cdot {\left(e^{x \cdot \sqrt{x}}\right)}^{\color{blue}{\left(10 \cdot {x}^{\left(\frac{\frac{2}{2}}{2}\right)}\right)}} \]
    19. lower-*.f64N/A

      \[\leadsto \cos x \cdot {\left(e^{x \cdot \sqrt{x}}\right)}^{\color{blue}{\left(10 \cdot {x}^{\left(\frac{\frac{2}{2}}{2}\right)}\right)}} \]
    20. metadata-evalN/A

      \[\leadsto \cos x \cdot {\left(e^{x \cdot \sqrt{x}}\right)}^{\left(10 \cdot {x}^{\left(\frac{\color{blue}{1}}{2}\right)}\right)} \]
    21. metadata-evalN/A

      \[\leadsto \cos x \cdot {\left(e^{x \cdot \sqrt{x}}\right)}^{\left(10 \cdot {x}^{\color{blue}{\frac{1}{2}}}\right)} \]
  4. Applied egg-rr93.2%

    \[\leadsto \cos x \cdot \color{blue}{{\left(e^{x \cdot \sqrt{x}}\right)}^{\left(10 \cdot \sqrt{x}\right)}} \]
  5. Step-by-step derivation
    1. lift-cos.f64N/A

      \[\leadsto \color{blue}{\cos x} \cdot {\left(e^{x \cdot \sqrt{x}}\right)}^{\left(10 \cdot \sqrt{x}\right)} \]
    2. lift-sqrt.f64N/A

      \[\leadsto \cos x \cdot {\left(e^{x \cdot \color{blue}{\sqrt{x}}}\right)}^{\left(10 \cdot \sqrt{x}\right)} \]
    3. lift-*.f64N/A

      \[\leadsto \cos x \cdot {\left(e^{\color{blue}{x \cdot \sqrt{x}}}\right)}^{\left(10 \cdot \sqrt{x}\right)} \]
    4. rem-log-expN/A

      \[\leadsto \cos x \cdot {\left(e^{\color{blue}{\log \left(e^{x \cdot \sqrt{x}}\right)}}\right)}^{\left(10 \cdot \sqrt{x}\right)} \]
    5. lift-exp.f64N/A

      \[\leadsto \cos x \cdot {\left(e^{\log \color{blue}{\left(e^{x \cdot \sqrt{x}}\right)}}\right)}^{\left(10 \cdot \sqrt{x}\right)} \]
    6. lift-sqrt.f64N/A

      \[\leadsto \cos x \cdot {\left(e^{\log \left(e^{x \cdot \sqrt{x}}\right)}\right)}^{\left(10 \cdot \color{blue}{\sqrt{x}}\right)} \]
    7. lift-*.f64N/A

      \[\leadsto \cos x \cdot {\left(e^{\log \left(e^{x \cdot \sqrt{x}}\right)}\right)}^{\color{blue}{\left(10 \cdot \sqrt{x}\right)}} \]
    8. exp-prodN/A

      \[\leadsto \cos x \cdot \color{blue}{e^{\log \left(e^{x \cdot \sqrt{x}}\right) \cdot \left(10 \cdot \sqrt{x}\right)}} \]
    9. pow-to-expN/A

      \[\leadsto \cos x \cdot \color{blue}{{\left(e^{x \cdot \sqrt{x}}\right)}^{\left(10 \cdot \sqrt{x}\right)}} \]
    10. lift-pow.f64N/A

      \[\leadsto \cos x \cdot \color{blue}{{\left(e^{x \cdot \sqrt{x}}\right)}^{\left(10 \cdot \sqrt{x}\right)}} \]
    11. *-commutativeN/A

      \[\leadsto \color{blue}{{\left(e^{x \cdot \sqrt{x}}\right)}^{\left(10 \cdot \sqrt{x}\right)} \cdot \cos x} \]
    12. lower-*.f6493.2

      \[\leadsto \color{blue}{{\left(e^{x \cdot \sqrt{x}}\right)}^{\left(10 \cdot \sqrt{x}\right)} \cdot \cos x} \]
  6. Applied egg-rr93.3%

    \[\leadsto \color{blue}{e^{\sqrt{x} \cdot \left(x \cdot \left(10 \cdot \sqrt{x}\right)\right)} \cdot \cos x} \]
  7. Taylor expanded in x around 0

    \[\leadsto e^{\sqrt{x} \cdot \left(x \cdot \left(10 \cdot \sqrt{x}\right)\right)} \cdot \color{blue}{\left(1 + {x}^{2} \cdot \left({x}^{2} \cdot \left(\frac{1}{24} + \frac{-1}{720} \cdot {x}^{2}\right) - \frac{1}{2}\right)\right)} \]
  8. Step-by-step derivation
    1. +-commutativeN/A

      \[\leadsto e^{\sqrt{x} \cdot \left(x \cdot \left(10 \cdot \sqrt{x}\right)\right)} \cdot \color{blue}{\left({x}^{2} \cdot \left({x}^{2} \cdot \left(\frac{1}{24} + \frac{-1}{720} \cdot {x}^{2}\right) - \frac{1}{2}\right) + 1\right)} \]
    2. lower-fma.f64N/A

      \[\leadsto e^{\sqrt{x} \cdot \left(x \cdot \left(10 \cdot \sqrt{x}\right)\right)} \cdot \color{blue}{\mathsf{fma}\left({x}^{2}, {x}^{2} \cdot \left(\frac{1}{24} + \frac{-1}{720} \cdot {x}^{2}\right) - \frac{1}{2}, 1\right)} \]
    3. unpow2N/A

      \[\leadsto e^{\sqrt{x} \cdot \left(x \cdot \left(10 \cdot \sqrt{x}\right)\right)} \cdot \mathsf{fma}\left(\color{blue}{x \cdot x}, {x}^{2} \cdot \left(\frac{1}{24} + \frac{-1}{720} \cdot {x}^{2}\right) - \frac{1}{2}, 1\right) \]
    4. lower-*.f64N/A

      \[\leadsto e^{\sqrt{x} \cdot \left(x \cdot \left(10 \cdot \sqrt{x}\right)\right)} \cdot \mathsf{fma}\left(\color{blue}{x \cdot x}, {x}^{2} \cdot \left(\frac{1}{24} + \frac{-1}{720} \cdot {x}^{2}\right) - \frac{1}{2}, 1\right) \]
    5. sub-negN/A

      \[\leadsto e^{\sqrt{x} \cdot \left(x \cdot \left(10 \cdot \sqrt{x}\right)\right)} \cdot \mathsf{fma}\left(x \cdot x, \color{blue}{{x}^{2} \cdot \left(\frac{1}{24} + \frac{-1}{720} \cdot {x}^{2}\right) + \left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}, 1\right) \]
    6. metadata-evalN/A

      \[\leadsto e^{\sqrt{x} \cdot \left(x \cdot \left(10 \cdot \sqrt{x}\right)\right)} \cdot \mathsf{fma}\left(x \cdot x, {x}^{2} \cdot \left(\frac{1}{24} + \frac{-1}{720} \cdot {x}^{2}\right) + \color{blue}{\frac{-1}{2}}, 1\right) \]
    7. lower-fma.f64N/A

      \[\leadsto e^{\sqrt{x} \cdot \left(x \cdot \left(10 \cdot \sqrt{x}\right)\right)} \cdot \mathsf{fma}\left(x \cdot x, \color{blue}{\mathsf{fma}\left({x}^{2}, \frac{1}{24} + \frac{-1}{720} \cdot {x}^{2}, \frac{-1}{2}\right)}, 1\right) \]
    8. unpow2N/A

      \[\leadsto e^{\sqrt{x} \cdot \left(x \cdot \left(10 \cdot \sqrt{x}\right)\right)} \cdot \mathsf{fma}\left(x \cdot x, \mathsf{fma}\left(\color{blue}{x \cdot x}, \frac{1}{24} + \frac{-1}{720} \cdot {x}^{2}, \frac{-1}{2}\right), 1\right) \]
    9. lower-*.f64N/A

      \[\leadsto e^{\sqrt{x} \cdot \left(x \cdot \left(10 \cdot \sqrt{x}\right)\right)} \cdot \mathsf{fma}\left(x \cdot x, \mathsf{fma}\left(\color{blue}{x \cdot x}, \frac{1}{24} + \frac{-1}{720} \cdot {x}^{2}, \frac{-1}{2}\right), 1\right) \]
    10. +-commutativeN/A

      \[\leadsto e^{\sqrt{x} \cdot \left(x \cdot \left(10 \cdot \sqrt{x}\right)\right)} \cdot \mathsf{fma}\left(x \cdot x, \mathsf{fma}\left(x \cdot x, \color{blue}{\frac{-1}{720} \cdot {x}^{2} + \frac{1}{24}}, \frac{-1}{2}\right), 1\right) \]
    11. *-commutativeN/A

      \[\leadsto e^{\sqrt{x} \cdot \left(x \cdot \left(10 \cdot \sqrt{x}\right)\right)} \cdot \mathsf{fma}\left(x \cdot x, \mathsf{fma}\left(x \cdot x, \color{blue}{{x}^{2} \cdot \frac{-1}{720}} + \frac{1}{24}, \frac{-1}{2}\right), 1\right) \]
    12. lower-fma.f64N/A

      \[\leadsto e^{\sqrt{x} \cdot \left(x \cdot \left(10 \cdot \sqrt{x}\right)\right)} \cdot \mathsf{fma}\left(x \cdot x, \mathsf{fma}\left(x \cdot x, \color{blue}{\mathsf{fma}\left({x}^{2}, \frac{-1}{720}, \frac{1}{24}\right)}, \frac{-1}{2}\right), 1\right) \]
    13. unpow2N/A

      \[\leadsto e^{\sqrt{x} \cdot \left(x \cdot \left(10 \cdot \sqrt{x}\right)\right)} \cdot \mathsf{fma}\left(x \cdot x, \mathsf{fma}\left(x \cdot x, \mathsf{fma}\left(\color{blue}{x \cdot x}, \frac{-1}{720}, \frac{1}{24}\right), \frac{-1}{2}\right), 1\right) \]
    14. lower-*.f6427.5

      \[\leadsto e^{\sqrt{x} \cdot \left(x \cdot \left(10 \cdot \sqrt{x}\right)\right)} \cdot \mathsf{fma}\left(x \cdot x, \mathsf{fma}\left(x \cdot x, \mathsf{fma}\left(\color{blue}{x \cdot x}, -0.001388888888888889, 0.041666666666666664\right), -0.5\right), 1\right) \]
  9. Simplified27.5%

    \[\leadsto e^{\sqrt{x} \cdot \left(x \cdot \left(10 \cdot \sqrt{x}\right)\right)} \cdot \color{blue}{\mathsf{fma}\left(x \cdot x, \mathsf{fma}\left(x \cdot x, \mathsf{fma}\left(x \cdot x, -0.001388888888888889, 0.041666666666666664\right), -0.5\right), 1\right)} \]
  10. Add Preprocessing

Alternative 10: 27.5% accurate, 1.4× speedup?

\[\begin{array}{l} \\ e^{10 \cdot \left(x \cdot x\right)} \cdot \mathsf{fma}\left(x \cdot x, \mathsf{fma}\left(x \cdot x, \mathsf{fma}\left(x \cdot x, -0.001388888888888889, 0.041666666666666664\right), -0.5\right), 1\right) \end{array} \]
(FPCore (x)
 :precision binary64
 (*
  (exp (* 10.0 (* x x)))
  (fma
   (* x x)
   (fma (* x x) (fma (* x x) -0.001388888888888889 0.041666666666666664) -0.5)
   1.0)))
double code(double x) {
	return exp((10.0 * (x * x))) * fma((x * x), fma((x * x), fma((x * x), -0.001388888888888889, 0.041666666666666664), -0.5), 1.0);
}
function code(x)
	return Float64(exp(Float64(10.0 * Float64(x * x))) * fma(Float64(x * x), fma(Float64(x * x), fma(Float64(x * x), -0.001388888888888889, 0.041666666666666664), -0.5), 1.0))
end
code[x_] := N[(N[Exp[N[(10.0 * N[(x * x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * -0.001388888888888889 + 0.041666666666666664), $MachinePrecision] + -0.5), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
e^{10 \cdot \left(x \cdot x\right)} \cdot \mathsf{fma}\left(x \cdot x, \mathsf{fma}\left(x \cdot x, \mathsf{fma}\left(x \cdot x, -0.001388888888888889, 0.041666666666666664\right), -0.5\right), 1\right)
\end{array}
Derivation
  1. Initial program 94.4%

    \[\cos x \cdot e^{10 \cdot \left(x \cdot x\right)} \]
  2. Add Preprocessing
  3. Taylor expanded in x around 0

    \[\leadsto \color{blue}{\left(1 + {x}^{2} \cdot \left({x}^{2} \cdot \left(\frac{1}{24} + \frac{-1}{720} \cdot {x}^{2}\right) - \frac{1}{2}\right)\right)} \cdot e^{10 \cdot \left(x \cdot x\right)} \]
  4. Step-by-step derivation
    1. +-commutativeN/A

      \[\leadsto \color{blue}{\left({x}^{2} \cdot \left({x}^{2} \cdot \left(\frac{1}{24} + \frac{-1}{720} \cdot {x}^{2}\right) - \frac{1}{2}\right) + 1\right)} \cdot e^{10 \cdot \left(x \cdot x\right)} \]
    2. lower-fma.f64N/A

      \[\leadsto \color{blue}{\mathsf{fma}\left({x}^{2}, {x}^{2} \cdot \left(\frac{1}{24} + \frac{-1}{720} \cdot {x}^{2}\right) - \frac{1}{2}, 1\right)} \cdot e^{10 \cdot \left(x \cdot x\right)} \]
    3. unpow2N/A

      \[\leadsto \mathsf{fma}\left(\color{blue}{x \cdot x}, {x}^{2} \cdot \left(\frac{1}{24} + \frac{-1}{720} \cdot {x}^{2}\right) - \frac{1}{2}, 1\right) \cdot e^{10 \cdot \left(x \cdot x\right)} \]
    4. lower-*.f64N/A

      \[\leadsto \mathsf{fma}\left(\color{blue}{x \cdot x}, {x}^{2} \cdot \left(\frac{1}{24} + \frac{-1}{720} \cdot {x}^{2}\right) - \frac{1}{2}, 1\right) \cdot e^{10 \cdot \left(x \cdot x\right)} \]
    5. sub-negN/A

      \[\leadsto \mathsf{fma}\left(x \cdot x, \color{blue}{{x}^{2} \cdot \left(\frac{1}{24} + \frac{-1}{720} \cdot {x}^{2}\right) + \left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}, 1\right) \cdot e^{10 \cdot \left(x \cdot x\right)} \]
    6. metadata-evalN/A

      \[\leadsto \mathsf{fma}\left(x \cdot x, {x}^{2} \cdot \left(\frac{1}{24} + \frac{-1}{720} \cdot {x}^{2}\right) + \color{blue}{\frac{-1}{2}}, 1\right) \cdot e^{10 \cdot \left(x \cdot x\right)} \]
    7. lower-fma.f64N/A

      \[\leadsto \mathsf{fma}\left(x \cdot x, \color{blue}{\mathsf{fma}\left({x}^{2}, \frac{1}{24} + \frac{-1}{720} \cdot {x}^{2}, \frac{-1}{2}\right)}, 1\right) \cdot e^{10 \cdot \left(x \cdot x\right)} \]
    8. unpow2N/A

      \[\leadsto \mathsf{fma}\left(x \cdot x, \mathsf{fma}\left(\color{blue}{x \cdot x}, \frac{1}{24} + \frac{-1}{720} \cdot {x}^{2}, \frac{-1}{2}\right), 1\right) \cdot e^{10 \cdot \left(x \cdot x\right)} \]
    9. lower-*.f64N/A

      \[\leadsto \mathsf{fma}\left(x \cdot x, \mathsf{fma}\left(\color{blue}{x \cdot x}, \frac{1}{24} + \frac{-1}{720} \cdot {x}^{2}, \frac{-1}{2}\right), 1\right) \cdot e^{10 \cdot \left(x \cdot x\right)} \]
    10. +-commutativeN/A

      \[\leadsto \mathsf{fma}\left(x \cdot x, \mathsf{fma}\left(x \cdot x, \color{blue}{\frac{-1}{720} \cdot {x}^{2} + \frac{1}{24}}, \frac{-1}{2}\right), 1\right) \cdot e^{10 \cdot \left(x \cdot x\right)} \]
    11. *-commutativeN/A

      \[\leadsto \mathsf{fma}\left(x \cdot x, \mathsf{fma}\left(x \cdot x, \color{blue}{{x}^{2} \cdot \frac{-1}{720}} + \frac{1}{24}, \frac{-1}{2}\right), 1\right) \cdot e^{10 \cdot \left(x \cdot x\right)} \]
    12. lower-fma.f64N/A

      \[\leadsto \mathsf{fma}\left(x \cdot x, \mathsf{fma}\left(x \cdot x, \color{blue}{\mathsf{fma}\left({x}^{2}, \frac{-1}{720}, \frac{1}{24}\right)}, \frac{-1}{2}\right), 1\right) \cdot e^{10 \cdot \left(x \cdot x\right)} \]
    13. unpow2N/A

      \[\leadsto \mathsf{fma}\left(x \cdot x, \mathsf{fma}\left(x \cdot x, \mathsf{fma}\left(\color{blue}{x \cdot x}, \frac{-1}{720}, \frac{1}{24}\right), \frac{-1}{2}\right), 1\right) \cdot e^{10 \cdot \left(x \cdot x\right)} \]
    14. lower-*.f6427.5

      \[\leadsto \mathsf{fma}\left(x \cdot x, \mathsf{fma}\left(x \cdot x, \mathsf{fma}\left(\color{blue}{x \cdot x}, -0.001388888888888889, 0.041666666666666664\right), -0.5\right), 1\right) \cdot e^{10 \cdot \left(x \cdot x\right)} \]
  5. Simplified27.5%

    \[\leadsto \color{blue}{\mathsf{fma}\left(x \cdot x, \mathsf{fma}\left(x \cdot x, \mathsf{fma}\left(x \cdot x, -0.001388888888888889, 0.041666666666666664\right), -0.5\right), 1\right)} \cdot e^{10 \cdot \left(x \cdot x\right)} \]
  6. Final simplification27.5%

    \[\leadsto e^{10 \cdot \left(x \cdot x\right)} \cdot \mathsf{fma}\left(x \cdot x, \mathsf{fma}\left(x \cdot x, \mathsf{fma}\left(x \cdot x, -0.001388888888888889, 0.041666666666666664\right), -0.5\right), 1\right) \]
  7. Add Preprocessing

Alternative 11: 27.5% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \mathsf{fma}\left(x \cdot x, \mathsf{fma}\left(x \cdot x, \mathsf{fma}\left(x \cdot x, -0.001388888888888889, 0.041666666666666664\right), -0.5\right), 1\right) \cdot e^{x \cdot \left(10 \cdot x\right)} \end{array} \]
(FPCore (x)
 :precision binary64
 (*
  (fma
   (* x x)
   (fma (* x x) (fma (* x x) -0.001388888888888889 0.041666666666666664) -0.5)
   1.0)
  (exp (* x (* 10.0 x)))))
double code(double x) {
	return fma((x * x), fma((x * x), fma((x * x), -0.001388888888888889, 0.041666666666666664), -0.5), 1.0) * exp((x * (10.0 * x)));
}
function code(x)
	return Float64(fma(Float64(x * x), fma(Float64(x * x), fma(Float64(x * x), -0.001388888888888889, 0.041666666666666664), -0.5), 1.0) * exp(Float64(x * Float64(10.0 * x))))
end
code[x_] := N[(N[(N[(x * x), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * -0.001388888888888889 + 0.041666666666666664), $MachinePrecision] + -0.5), $MachinePrecision] + 1.0), $MachinePrecision] * N[Exp[N[(x * N[(10.0 * x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\mathsf{fma}\left(x \cdot x, \mathsf{fma}\left(x \cdot x, \mathsf{fma}\left(x \cdot x, -0.001388888888888889, 0.041666666666666664\right), -0.5\right), 1\right) \cdot e^{x \cdot \left(10 \cdot x\right)}
\end{array}
Derivation
  1. Initial program 94.4%

    \[\cos x \cdot e^{10 \cdot \left(x \cdot x\right)} \]
  2. Add Preprocessing
  3. Taylor expanded in x around inf

    \[\leadsto \color{blue}{\cos x \cdot e^{10 \cdot {x}^{2}}} \]
  4. Step-by-step derivation
    1. *-commutativeN/A

      \[\leadsto \color{blue}{e^{10 \cdot {x}^{2}} \cdot \cos x} \]
    2. *-lft-identityN/A

      \[\leadsto e^{10 \cdot {x}^{2}} \cdot \color{blue}{\left(1 \cdot \cos x\right)} \]
    3. lower-*.f64N/A

      \[\leadsto \color{blue}{e^{10 \cdot {x}^{2}} \cdot \left(1 \cdot \cos x\right)} \]
    4. lower-exp.f64N/A

      \[\leadsto \color{blue}{e^{10 \cdot {x}^{2}}} \cdot \left(1 \cdot \cos x\right) \]
    5. *-commutativeN/A

      \[\leadsto e^{\color{blue}{{x}^{2} \cdot 10}} \cdot \left(1 \cdot \cos x\right) \]
    6. unpow2N/A

      \[\leadsto e^{\color{blue}{\left(x \cdot x\right)} \cdot 10} \cdot \left(1 \cdot \cos x\right) \]
    7. associate-*l*N/A

      \[\leadsto e^{\color{blue}{x \cdot \left(x \cdot 10\right)}} \cdot \left(1 \cdot \cos x\right) \]
    8. lower-*.f64N/A

      \[\leadsto e^{\color{blue}{x \cdot \left(x \cdot 10\right)}} \cdot \left(1 \cdot \cos x\right) \]
    9. lower-*.f64N/A

      \[\leadsto e^{x \cdot \color{blue}{\left(x \cdot 10\right)}} \cdot \left(1 \cdot \cos x\right) \]
    10. *-lft-identityN/A

      \[\leadsto e^{x \cdot \left(x \cdot 10\right)} \cdot \color{blue}{\cos x} \]
    11. lower-cos.f6494.4

      \[\leadsto e^{x \cdot \left(x \cdot 10\right)} \cdot \color{blue}{\cos x} \]
  5. Simplified94.4%

    \[\leadsto \color{blue}{e^{x \cdot \left(x \cdot 10\right)} \cdot \cos x} \]
  6. Taylor expanded in x around 0

    \[\leadsto e^{x \cdot \left(x \cdot 10\right)} \cdot \color{blue}{\left(1 + {x}^{2} \cdot \left({x}^{2} \cdot \left(\frac{1}{24} + \frac{-1}{720} \cdot {x}^{2}\right) - \frac{1}{2}\right)\right)} \]
  7. Step-by-step derivation
    1. +-commutativeN/A

      \[\leadsto e^{x \cdot \left(x \cdot 10\right)} \cdot \color{blue}{\left({x}^{2} \cdot \left({x}^{2} \cdot \left(\frac{1}{24} + \frac{-1}{720} \cdot {x}^{2}\right) - \frac{1}{2}\right) + 1\right)} \]
    2. lower-fma.f64N/A

      \[\leadsto e^{x \cdot \left(x \cdot 10\right)} \cdot \color{blue}{\mathsf{fma}\left({x}^{2}, {x}^{2} \cdot \left(\frac{1}{24} + \frac{-1}{720} \cdot {x}^{2}\right) - \frac{1}{2}, 1\right)} \]
    3. unpow2N/A

      \[\leadsto e^{x \cdot \left(x \cdot 10\right)} \cdot \mathsf{fma}\left(\color{blue}{x \cdot x}, {x}^{2} \cdot \left(\frac{1}{24} + \frac{-1}{720} \cdot {x}^{2}\right) - \frac{1}{2}, 1\right) \]
    4. lower-*.f64N/A

      \[\leadsto e^{x \cdot \left(x \cdot 10\right)} \cdot \mathsf{fma}\left(\color{blue}{x \cdot x}, {x}^{2} \cdot \left(\frac{1}{24} + \frac{-1}{720} \cdot {x}^{2}\right) - \frac{1}{2}, 1\right) \]
    5. sub-negN/A

      \[\leadsto e^{x \cdot \left(x \cdot 10\right)} \cdot \mathsf{fma}\left(x \cdot x, \color{blue}{{x}^{2} \cdot \left(\frac{1}{24} + \frac{-1}{720} \cdot {x}^{2}\right) + \left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}, 1\right) \]
    6. metadata-evalN/A

      \[\leadsto e^{x \cdot \left(x \cdot 10\right)} \cdot \mathsf{fma}\left(x \cdot x, {x}^{2} \cdot \left(\frac{1}{24} + \frac{-1}{720} \cdot {x}^{2}\right) + \color{blue}{\frac{-1}{2}}, 1\right) \]
    7. lower-fma.f64N/A

      \[\leadsto e^{x \cdot \left(x \cdot 10\right)} \cdot \mathsf{fma}\left(x \cdot x, \color{blue}{\mathsf{fma}\left({x}^{2}, \frac{1}{24} + \frac{-1}{720} \cdot {x}^{2}, \frac{-1}{2}\right)}, 1\right) \]
    8. unpow2N/A

      \[\leadsto e^{x \cdot \left(x \cdot 10\right)} \cdot \mathsf{fma}\left(x \cdot x, \mathsf{fma}\left(\color{blue}{x \cdot x}, \frac{1}{24} + \frac{-1}{720} \cdot {x}^{2}, \frac{-1}{2}\right), 1\right) \]
    9. lower-*.f64N/A

      \[\leadsto e^{x \cdot \left(x \cdot 10\right)} \cdot \mathsf{fma}\left(x \cdot x, \mathsf{fma}\left(\color{blue}{x \cdot x}, \frac{1}{24} + \frac{-1}{720} \cdot {x}^{2}, \frac{-1}{2}\right), 1\right) \]
    10. +-commutativeN/A

      \[\leadsto e^{x \cdot \left(x \cdot 10\right)} \cdot \mathsf{fma}\left(x \cdot x, \mathsf{fma}\left(x \cdot x, \color{blue}{\frac{-1}{720} \cdot {x}^{2} + \frac{1}{24}}, \frac{-1}{2}\right), 1\right) \]
    11. *-commutativeN/A

      \[\leadsto e^{x \cdot \left(x \cdot 10\right)} \cdot \mathsf{fma}\left(x \cdot x, \mathsf{fma}\left(x \cdot x, \color{blue}{{x}^{2} \cdot \frac{-1}{720}} + \frac{1}{24}, \frac{-1}{2}\right), 1\right) \]
    12. lower-fma.f64N/A

      \[\leadsto e^{x \cdot \left(x \cdot 10\right)} \cdot \mathsf{fma}\left(x \cdot x, \mathsf{fma}\left(x \cdot x, \color{blue}{\mathsf{fma}\left({x}^{2}, \frac{-1}{720}, \frac{1}{24}\right)}, \frac{-1}{2}\right), 1\right) \]
    13. unpow2N/A

      \[\leadsto e^{x \cdot \left(x \cdot 10\right)} \cdot \mathsf{fma}\left(x \cdot x, \mathsf{fma}\left(x \cdot x, \mathsf{fma}\left(\color{blue}{x \cdot x}, \frac{-1}{720}, \frac{1}{24}\right), \frac{-1}{2}\right), 1\right) \]
    14. lower-*.f6427.5

      \[\leadsto e^{x \cdot \left(x \cdot 10\right)} \cdot \mathsf{fma}\left(x \cdot x, \mathsf{fma}\left(x \cdot x, \mathsf{fma}\left(\color{blue}{x \cdot x}, -0.001388888888888889, 0.041666666666666664\right), -0.5\right), 1\right) \]
  8. Simplified27.5%

    \[\leadsto e^{x \cdot \left(x \cdot 10\right)} \cdot \color{blue}{\mathsf{fma}\left(x \cdot x, \mathsf{fma}\left(x \cdot x, \mathsf{fma}\left(x \cdot x, -0.001388888888888889, 0.041666666666666664\right), -0.5\right), 1\right)} \]
  9. Final simplification27.5%

    \[\leadsto \mathsf{fma}\left(x \cdot x, \mathsf{fma}\left(x \cdot x, \mathsf{fma}\left(x \cdot x, -0.001388888888888889, 0.041666666666666664\right), -0.5\right), 1\right) \cdot e^{x \cdot \left(10 \cdot x\right)} \]
  10. Add Preprocessing

Alternative 12: 21.3% accurate, 1.6× speedup?

\[\begin{array}{l} \\ e^{x \cdot \left(10 \cdot x\right)} \cdot \mathsf{fma}\left(x \cdot x, \mathsf{fma}\left(x, x \cdot 0.041666666666666664, -0.5\right), 1\right) \end{array} \]
(FPCore (x)
 :precision binary64
 (*
  (exp (* x (* 10.0 x)))
  (fma (* x x) (fma x (* x 0.041666666666666664) -0.5) 1.0)))
double code(double x) {
	return exp((x * (10.0 * x))) * fma((x * x), fma(x, (x * 0.041666666666666664), -0.5), 1.0);
}
function code(x)
	return Float64(exp(Float64(x * Float64(10.0 * x))) * fma(Float64(x * x), fma(x, Float64(x * 0.041666666666666664), -0.5), 1.0))
end
code[x_] := N[(N[Exp[N[(x * N[(10.0 * x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * N[(x * N[(x * 0.041666666666666664), $MachinePrecision] + -0.5), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
e^{x \cdot \left(10 \cdot x\right)} \cdot \mathsf{fma}\left(x \cdot x, \mathsf{fma}\left(x, x \cdot 0.041666666666666664, -0.5\right), 1\right)
\end{array}
Derivation
  1. Initial program 94.4%

    \[\cos x \cdot e^{10 \cdot \left(x \cdot x\right)} \]
  2. Add Preprocessing
  3. Taylor expanded in x around inf

    \[\leadsto \color{blue}{\cos x \cdot e^{10 \cdot {x}^{2}}} \]
  4. Step-by-step derivation
    1. *-commutativeN/A

      \[\leadsto \color{blue}{e^{10 \cdot {x}^{2}} \cdot \cos x} \]
    2. *-lft-identityN/A

      \[\leadsto e^{10 \cdot {x}^{2}} \cdot \color{blue}{\left(1 \cdot \cos x\right)} \]
    3. lower-*.f64N/A

      \[\leadsto \color{blue}{e^{10 \cdot {x}^{2}} \cdot \left(1 \cdot \cos x\right)} \]
    4. lower-exp.f64N/A

      \[\leadsto \color{blue}{e^{10 \cdot {x}^{2}}} \cdot \left(1 \cdot \cos x\right) \]
    5. *-commutativeN/A

      \[\leadsto e^{\color{blue}{{x}^{2} \cdot 10}} \cdot \left(1 \cdot \cos x\right) \]
    6. unpow2N/A

      \[\leadsto e^{\color{blue}{\left(x \cdot x\right)} \cdot 10} \cdot \left(1 \cdot \cos x\right) \]
    7. associate-*l*N/A

      \[\leadsto e^{\color{blue}{x \cdot \left(x \cdot 10\right)}} \cdot \left(1 \cdot \cos x\right) \]
    8. lower-*.f64N/A

      \[\leadsto e^{\color{blue}{x \cdot \left(x \cdot 10\right)}} \cdot \left(1 \cdot \cos x\right) \]
    9. lower-*.f64N/A

      \[\leadsto e^{x \cdot \color{blue}{\left(x \cdot 10\right)}} \cdot \left(1 \cdot \cos x\right) \]
    10. *-lft-identityN/A

      \[\leadsto e^{x \cdot \left(x \cdot 10\right)} \cdot \color{blue}{\cos x} \]
    11. lower-cos.f6494.4

      \[\leadsto e^{x \cdot \left(x \cdot 10\right)} \cdot \color{blue}{\cos x} \]
  5. Simplified94.4%

    \[\leadsto \color{blue}{e^{x \cdot \left(x \cdot 10\right)} \cdot \cos x} \]
  6. Taylor expanded in x around 0

    \[\leadsto e^{x \cdot \left(x \cdot 10\right)} \cdot \color{blue}{\left(1 + {x}^{2} \cdot \left(\frac{1}{24} \cdot {x}^{2} - \frac{1}{2}\right)\right)} \]
  7. Step-by-step derivation
    1. +-commutativeN/A

      \[\leadsto e^{x \cdot \left(x \cdot 10\right)} \cdot \color{blue}{\left({x}^{2} \cdot \left(\frac{1}{24} \cdot {x}^{2} - \frac{1}{2}\right) + 1\right)} \]
    2. lower-fma.f64N/A

      \[\leadsto e^{x \cdot \left(x \cdot 10\right)} \cdot \color{blue}{\mathsf{fma}\left({x}^{2}, \frac{1}{24} \cdot {x}^{2} - \frac{1}{2}, 1\right)} \]
    3. unpow2N/A

      \[\leadsto e^{x \cdot \left(x \cdot 10\right)} \cdot \mathsf{fma}\left(\color{blue}{x \cdot x}, \frac{1}{24} \cdot {x}^{2} - \frac{1}{2}, 1\right) \]
    4. lower-*.f64N/A

      \[\leadsto e^{x \cdot \left(x \cdot 10\right)} \cdot \mathsf{fma}\left(\color{blue}{x \cdot x}, \frac{1}{24} \cdot {x}^{2} - \frac{1}{2}, 1\right) \]
    5. sub-negN/A

      \[\leadsto e^{x \cdot \left(x \cdot 10\right)} \cdot \mathsf{fma}\left(x \cdot x, \color{blue}{\frac{1}{24} \cdot {x}^{2} + \left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}, 1\right) \]
    6. unpow2N/A

      \[\leadsto e^{x \cdot \left(x \cdot 10\right)} \cdot \mathsf{fma}\left(x \cdot x, \frac{1}{24} \cdot \color{blue}{\left(x \cdot x\right)} + \left(\mathsf{neg}\left(\frac{1}{2}\right)\right), 1\right) \]
    7. associate-*r*N/A

      \[\leadsto e^{x \cdot \left(x \cdot 10\right)} \cdot \mathsf{fma}\left(x \cdot x, \color{blue}{\left(\frac{1}{24} \cdot x\right) \cdot x} + \left(\mathsf{neg}\left(\frac{1}{2}\right)\right), 1\right) \]
    8. *-commutativeN/A

      \[\leadsto e^{x \cdot \left(x \cdot 10\right)} \cdot \mathsf{fma}\left(x \cdot x, \color{blue}{x \cdot \left(\frac{1}{24} \cdot x\right)} + \left(\mathsf{neg}\left(\frac{1}{2}\right)\right), 1\right) \]
    9. metadata-evalN/A

      \[\leadsto e^{x \cdot \left(x \cdot 10\right)} \cdot \mathsf{fma}\left(x \cdot x, x \cdot \left(\frac{1}{24} \cdot x\right) + \color{blue}{\frac{-1}{2}}, 1\right) \]
    10. lower-fma.f64N/A

      \[\leadsto e^{x \cdot \left(x \cdot 10\right)} \cdot \mathsf{fma}\left(x \cdot x, \color{blue}{\mathsf{fma}\left(x, \frac{1}{24} \cdot x, \frac{-1}{2}\right)}, 1\right) \]
    11. *-commutativeN/A

      \[\leadsto e^{x \cdot \left(x \cdot 10\right)} \cdot \mathsf{fma}\left(x \cdot x, \mathsf{fma}\left(x, \color{blue}{x \cdot \frac{1}{24}}, \frac{-1}{2}\right), 1\right) \]
    12. lower-*.f6421.3

      \[\leadsto e^{x \cdot \left(x \cdot 10\right)} \cdot \mathsf{fma}\left(x \cdot x, \mathsf{fma}\left(x, \color{blue}{x \cdot 0.041666666666666664}, -0.5\right), 1\right) \]
  8. Simplified21.3%

    \[\leadsto e^{x \cdot \left(x \cdot 10\right)} \cdot \color{blue}{\mathsf{fma}\left(x \cdot x, \mathsf{fma}\left(x, x \cdot 0.041666666666666664, -0.5\right), 1\right)} \]
  9. Final simplification21.3%

    \[\leadsto e^{x \cdot \left(10 \cdot x\right)} \cdot \mathsf{fma}\left(x \cdot x, \mathsf{fma}\left(x, x \cdot 0.041666666666666664, -0.5\right), 1\right) \]
  10. Add Preprocessing

Alternative 13: 18.2% accurate, 1.7× speedup?

\[\begin{array}{l} \\ e^{x \cdot \left(10 \cdot x\right)} \cdot \mathsf{fma}\left(x, x \cdot -0.5, 1\right) \end{array} \]
(FPCore (x)
 :precision binary64
 (* (exp (* x (* 10.0 x))) (fma x (* x -0.5) 1.0)))
double code(double x) {
	return exp((x * (10.0 * x))) * fma(x, (x * -0.5), 1.0);
}
function code(x)
	return Float64(exp(Float64(x * Float64(10.0 * x))) * fma(x, Float64(x * -0.5), 1.0))
end
code[x_] := N[(N[Exp[N[(x * N[(10.0 * x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(x * N[(x * -0.5), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
e^{x \cdot \left(10 \cdot x\right)} \cdot \mathsf{fma}\left(x, x \cdot -0.5, 1\right)
\end{array}
Derivation
  1. Initial program 94.4%

    \[\cos x \cdot e^{10 \cdot \left(x \cdot x\right)} \]
  2. Add Preprocessing
  3. Taylor expanded in x around inf

    \[\leadsto \color{blue}{\cos x \cdot e^{10 \cdot {x}^{2}}} \]
  4. Step-by-step derivation
    1. *-commutativeN/A

      \[\leadsto \color{blue}{e^{10 \cdot {x}^{2}} \cdot \cos x} \]
    2. *-lft-identityN/A

      \[\leadsto e^{10 \cdot {x}^{2}} \cdot \color{blue}{\left(1 \cdot \cos x\right)} \]
    3. lower-*.f64N/A

      \[\leadsto \color{blue}{e^{10 \cdot {x}^{2}} \cdot \left(1 \cdot \cos x\right)} \]
    4. lower-exp.f64N/A

      \[\leadsto \color{blue}{e^{10 \cdot {x}^{2}}} \cdot \left(1 \cdot \cos x\right) \]
    5. *-commutativeN/A

      \[\leadsto e^{\color{blue}{{x}^{2} \cdot 10}} \cdot \left(1 \cdot \cos x\right) \]
    6. unpow2N/A

      \[\leadsto e^{\color{blue}{\left(x \cdot x\right)} \cdot 10} \cdot \left(1 \cdot \cos x\right) \]
    7. associate-*l*N/A

      \[\leadsto e^{\color{blue}{x \cdot \left(x \cdot 10\right)}} \cdot \left(1 \cdot \cos x\right) \]
    8. lower-*.f64N/A

      \[\leadsto e^{\color{blue}{x \cdot \left(x \cdot 10\right)}} \cdot \left(1 \cdot \cos x\right) \]
    9. lower-*.f64N/A

      \[\leadsto e^{x \cdot \color{blue}{\left(x \cdot 10\right)}} \cdot \left(1 \cdot \cos x\right) \]
    10. *-lft-identityN/A

      \[\leadsto e^{x \cdot \left(x \cdot 10\right)} \cdot \color{blue}{\cos x} \]
    11. lower-cos.f6494.4

      \[\leadsto e^{x \cdot \left(x \cdot 10\right)} \cdot \color{blue}{\cos x} \]
  5. Simplified94.4%

    \[\leadsto \color{blue}{e^{x \cdot \left(x \cdot 10\right)} \cdot \cos x} \]
  6. Taylor expanded in x around 0

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

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

      \[\leadsto e^{x \cdot \left(x \cdot 10\right)} \cdot \left(\color{blue}{{x}^{2} \cdot \frac{-1}{2}} + 1\right) \]
    3. unpow2N/A

      \[\leadsto e^{x \cdot \left(x \cdot 10\right)} \cdot \left(\color{blue}{\left(x \cdot x\right)} \cdot \frac{-1}{2} + 1\right) \]
    4. associate-*l*N/A

      \[\leadsto e^{x \cdot \left(x \cdot 10\right)} \cdot \left(\color{blue}{x \cdot \left(x \cdot \frac{-1}{2}\right)} + 1\right) \]
    5. lower-fma.f64N/A

      \[\leadsto e^{x \cdot \left(x \cdot 10\right)} \cdot \color{blue}{\mathsf{fma}\left(x, x \cdot \frac{-1}{2}, 1\right)} \]
    6. lower-*.f6418.2

      \[\leadsto e^{x \cdot \left(x \cdot 10\right)} \cdot \mathsf{fma}\left(x, \color{blue}{x \cdot -0.5}, 1\right) \]
  8. Simplified18.2%

    \[\leadsto e^{x \cdot \left(x \cdot 10\right)} \cdot \color{blue}{\mathsf{fma}\left(x, x \cdot -0.5, 1\right)} \]
  9. Final simplification18.2%

    \[\leadsto e^{x \cdot \left(10 \cdot x\right)} \cdot \mathsf{fma}\left(x, x \cdot -0.5, 1\right) \]
  10. Add Preprocessing

Alternative 14: 9.8% accurate, 1.8× speedup?

\[\begin{array}{l} \\ \cos x \cdot \mathsf{fma}\left(x, 10 \cdot x, 1\right) \end{array} \]
(FPCore (x) :precision binary64 (* (cos x) (fma x (* 10.0 x) 1.0)))
double code(double x) {
	return cos(x) * fma(x, (10.0 * x), 1.0);
}
function code(x)
	return Float64(cos(x) * fma(x, Float64(10.0 * x), 1.0))
end
code[x_] := N[(N[Cos[x], $MachinePrecision] * N[(x * N[(10.0 * x), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\cos x \cdot \mathsf{fma}\left(x, 10 \cdot x, 1\right)
\end{array}
Derivation
  1. Initial program 94.4%

    \[\cos x \cdot e^{10 \cdot \left(x \cdot x\right)} \]
  2. Add Preprocessing
  3. Taylor expanded in x around 0

    \[\leadsto \cos x \cdot \color{blue}{\left(1 + 10 \cdot {x}^{2}\right)} \]
  4. Step-by-step derivation
    1. +-commutativeN/A

      \[\leadsto \cos x \cdot \color{blue}{\left(10 \cdot {x}^{2} + 1\right)} \]
    2. *-commutativeN/A

      \[\leadsto \cos x \cdot \left(\color{blue}{{x}^{2} \cdot 10} + 1\right) \]
    3. unpow2N/A

      \[\leadsto \cos x \cdot \left(\color{blue}{\left(x \cdot x\right)} \cdot 10 + 1\right) \]
    4. associate-*l*N/A

      \[\leadsto \cos x \cdot \left(\color{blue}{x \cdot \left(x \cdot 10\right)} + 1\right) \]
    5. lower-fma.f64N/A

      \[\leadsto \cos x \cdot \color{blue}{\mathsf{fma}\left(x, x \cdot 10, 1\right)} \]
    6. lower-*.f649.8

      \[\leadsto \cos x \cdot \mathsf{fma}\left(x, \color{blue}{x \cdot 10}, 1\right) \]
  5. Simplified9.8%

    \[\leadsto \cos x \cdot \color{blue}{\mathsf{fma}\left(x, x \cdot 10, 1\right)} \]
  6. Final simplification9.8%

    \[\leadsto \cos x \cdot \mathsf{fma}\left(x, 10 \cdot x, 1\right) \]
  7. Add Preprocessing

Alternative 15: 9.7% accurate, 19.6× speedup?

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

\\
\left(x \cdot x\right) \cdot -0.5
\end{array}
Derivation
  1. Initial program 94.4%

    \[\cos x \cdot e^{10 \cdot \left(x \cdot x\right)} \]
  2. Add Preprocessing
  3. Taylor expanded in x around 0

    \[\leadsto \cos x \cdot \color{blue}{1} \]
  4. Step-by-step derivation
    1. Simplified9.6%

      \[\leadsto \cos x \cdot \color{blue}{1} \]
    2. Taylor expanded in x around 0

      \[\leadsto \color{blue}{1 + \frac{-1}{2} \cdot {x}^{2}} \]
    3. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \color{blue}{\frac{-1}{2} \cdot {x}^{2} + 1} \]
      2. unpow2N/A

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

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

        \[\leadsto \color{blue}{x \cdot \left(\frac{-1}{2} \cdot x\right)} + 1 \]
      5. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(x, \frac{-1}{2} \cdot x, 1\right)} \]
      6. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(x, \color{blue}{x \cdot \frac{-1}{2}}, 1\right) \]
      7. lower-*.f649.7

        \[\leadsto \mathsf{fma}\left(x, \color{blue}{x \cdot -0.5}, 1\right) \]
    4. Simplified9.7%

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, x \cdot -0.5, 1\right)} \]
    5. Taylor expanded in x around inf

      \[\leadsto \color{blue}{\frac{-1}{2} \cdot {x}^{2}} \]
    6. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \color{blue}{{x}^{2} \cdot \frac{-1}{2}} \]
      2. lower-*.f64N/A

        \[\leadsto \color{blue}{{x}^{2} \cdot \frac{-1}{2}} \]
      3. unpow2N/A

        \[\leadsto \color{blue}{\left(x \cdot x\right)} \cdot \frac{-1}{2} \]
      4. lower-*.f649.7

        \[\leadsto \color{blue}{\left(x \cdot x\right)} \cdot -0.5 \]
    7. Simplified9.7%

      \[\leadsto \color{blue}{\left(x \cdot x\right) \cdot -0.5} \]
    8. Add Preprocessing

    Alternative 16: 1.5% accurate, 216.0× speedup?

    \[\begin{array}{l} \\ 1 \end{array} \]
    (FPCore (x) :precision binary64 1.0)
    double code(double x) {
    	return 1.0;
    }
    
    real(8) function code(x)
        real(8), intent (in) :: x
        code = 1.0d0
    end function
    
    public static double code(double x) {
    	return 1.0;
    }
    
    def code(x):
    	return 1.0
    
    function code(x)
    	return 1.0
    end
    
    function tmp = code(x)
    	tmp = 1.0;
    end
    
    code[x_] := 1.0
    
    \begin{array}{l}
    
    \\
    1
    \end{array}
    
    Derivation
    1. Initial program 94.4%

      \[\cos x \cdot e^{10 \cdot \left(x \cdot x\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0

      \[\leadsto \color{blue}{1} \]
    4. Step-by-step derivation
      1. Simplified1.5%

        \[\leadsto \color{blue}{1} \]
      2. Add Preprocessing

      Reproduce

      ?
      herbie shell --seed 2024207 
      (FPCore (x)
        :name "ENA, Section 1.4, Exercise 1"
        :precision binary64
        :pre (and (<= 1.99 x) (<= x 2.01))
        (* (cos x) (exp (* 10.0 (* x x)))))