?

Average Accuracy: 94.5% → 99.4%
Time: 9.4s
Precision: binary64
Cost: 26048

?

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

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation?

  1. Initial program 94.5%

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

    \[\leadsto \cos x \cdot \color{blue}{{\left({\left(e^{10}\right)}^{x}\right)}^{x}} \]
    Proof

    [Start]94.5

    \[ \cos x \cdot e^{10 \cdot \left(x \cdot x\right)} \]

    exp-prod [=>]95.2

    \[ \cos x \cdot \color{blue}{{\left(e^{10}\right)}^{\left(x \cdot x\right)}} \]

    pow-unpow [=>]97.9

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

    \[\leadsto \cos x \cdot {\color{blue}{\left(\sqrt{{\left(e^{20}\right)}^{x}}\right)}}^{x} \]
    Proof

    [Start]97.9

    \[ \cos x \cdot {\left({\left(e^{10}\right)}^{x}\right)}^{x} \]

    add-sqr-sqrt [=>]98.0

    \[ \cos x \cdot {\color{blue}{\left(\sqrt{{\left(e^{10}\right)}^{x}} \cdot \sqrt{{\left(e^{10}\right)}^{x}}\right)}}^{x} \]

    sqrt-unprod [=>]97.9

    \[ \cos x \cdot {\color{blue}{\left(\sqrt{{\left(e^{10}\right)}^{x} \cdot {\left(e^{10}\right)}^{x}}\right)}}^{x} \]

    pow-prod-down [=>]98.0

    \[ \cos x \cdot {\left(\sqrt{\color{blue}{{\left(e^{10} \cdot e^{10}\right)}^{x}}}\right)}^{x} \]

    prod-exp [=>]99.2

    \[ \cos x \cdot {\left(\sqrt{{\color{blue}{\left(e^{10 + 10}\right)}}^{x}}\right)}^{x} \]

    metadata-eval [=>]99.2

    \[ \cos x \cdot {\left(\sqrt{{\left(e^{\color{blue}{20}}\right)}^{x}}\right)}^{x} \]
  4. Applied egg-rr99.4%

    \[\leadsto \cos x \cdot \color{blue}{\sqrt{{\left({\left(e^{20}\right)}^{x}\right)}^{x}}} \]
    Proof

    [Start]99.2

    \[ \cos x \cdot {\left(\sqrt{{\left(e^{20}\right)}^{x}}\right)}^{x} \]

    sqrt-pow2 [=>]99.4

    \[ \cos x \cdot \color{blue}{{\left({\left(e^{20}\right)}^{x}\right)}^{\left(\frac{x}{2}\right)}} \]

    sqrt-pow1 [<=]99.4

    \[ \cos x \cdot \color{blue}{\sqrt{{\left({\left(e^{20}\right)}^{x}\right)}^{x}}} \]
  5. Applied egg-rr99.4%

    \[\leadsto \cos x \cdot \color{blue}{{\left({\left(e^{20}\right)}^{x}\right)}^{\left(x \cdot 0.5\right)}} \]
    Proof

    [Start]99.4

    \[ \cos x \cdot \sqrt{{\left({\left(e^{20}\right)}^{x}\right)}^{x}} \]

    pow1/2 [=>]99.4

    \[ \cos x \cdot \color{blue}{{\left({\left({\left(e^{20}\right)}^{x}\right)}^{x}\right)}^{0.5}} \]

    pow-pow [=>]99.4

    \[ \cos x \cdot \color{blue}{{\left({\left(e^{20}\right)}^{x}\right)}^{\left(x \cdot 0.5\right)}} \]
  6. Final simplification99.4%

    \[\leadsto \cos x \cdot {\left({\left(e^{20}\right)}^{x}\right)}^{\left(x \cdot 0.5\right)} \]

Alternatives

Alternative 1
Accuracy97.9%
Cost25920
\[\cos x \cdot {\left({\left(e^{10}\right)}^{x}\right)}^{x} \]
Alternative 2
Accuracy95.3%
Cost19712
\[\cos x \cdot {\left(e^{20}\right)}^{\left(x \cdot \left(x \cdot 0.5\right)\right)} \]
Alternative 3
Accuracy95.2%
Cost19584
\[\cos x \cdot {\left(e^{10}\right)}^{\left(x \cdot x\right)} \]
Alternative 4
Accuracy95.2%
Cost19584
\[\cos x \cdot {\left(e^{x \cdot x}\right)}^{10} \]
Alternative 5
Accuracy94.5%
Cost13248
\[\cos x \cdot e^{10 \cdot \left(x \cdot x\right)} \]
Alternative 6
Accuracy9.6%
Cost6464
\[\cos x \]
Alternative 7
Accuracy1.5%
Cost448
\[1 + \left(x \cdot x\right) \cdot 9.5 \]
Alternative 8
Accuracy1.5%
Cost64
\[1 \]

Error

Reproduce?

herbie shell --seed 2023137 
(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)))))