Average Error: 3.5 → 2.0
Time: 25.3s
Precision: binary64
Cost: 45504
\[1.99 \leq x \land x \leq 2.01\]
\[\cos x \cdot e^{10 \cdot \left(x \cdot x\right)} \]
\[\cos x \cdot \sqrt{\sqrt{{\left({\left(e^{30}\right)}^{x}\right)}^{x}} \cdot e^{5 \cdot \left(x \cdot x\right)}} \]
(FPCore (x) :precision binary64 (* (cos x) (exp (* 10.0 (* x x)))))
(FPCore (x)
 :precision binary64
 (*
  (cos x)
  (sqrt (* (sqrt (pow (pow (exp 30.0) x) x)) (exp (* 5.0 (* x x)))))))
double code(double x) {
	return cos(x) * exp((10.0 * (x * x)));
}
double code(double x) {
	return cos(x) * sqrt((sqrt(pow(pow(exp(30.0), x), x)) * exp((5.0 * (x * x)))));
}
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) * sqrt((sqrt(((exp(30.0d0) ** x) ** x)) * exp((5.0d0 * (x * x)))))
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.sqrt((Math.sqrt(Math.pow(Math.pow(Math.exp(30.0), x), x)) * Math.exp((5.0 * (x * x)))));
}
def code(x):
	return math.cos(x) * math.exp((10.0 * (x * x)))
def code(x):
	return math.cos(x) * math.sqrt((math.sqrt(math.pow(math.pow(math.exp(30.0), x), x)) * math.exp((5.0 * (x * x)))))
function code(x)
	return Float64(cos(x) * exp(Float64(10.0 * Float64(x * x))))
end
function code(x)
	return Float64(cos(x) * sqrt(Float64(sqrt(((exp(30.0) ^ x) ^ x)) * exp(Float64(5.0 * Float64(x * x))))))
end
function tmp = code(x)
	tmp = cos(x) * exp((10.0 * (x * x)));
end
function tmp = code(x)
	tmp = cos(x) * sqrt((sqrt(((exp(30.0) ^ x) ^ x)) * exp((5.0 * (x * x)))));
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[Sqrt[N[(N[Sqrt[N[Power[N[Power[N[Exp[30.0], $MachinePrecision], x], $MachinePrecision], x], $MachinePrecision]], $MachinePrecision] * N[Exp[N[(5.0 * N[(x * x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\cos x \cdot e^{10 \cdot \left(x \cdot x\right)}
\cos x \cdot \sqrt{\sqrt{{\left({\left(e^{30}\right)}^{x}\right)}^{x}} \cdot e^{5 \cdot \left(x \cdot x\right)}}

Error

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 3.5

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

    \[\leadsto \cos x \cdot \color{blue}{\left(\sqrt{\sqrt{e^{\left(x \cdot x\right) \cdot 30}}} \cdot \sqrt{e^{5 \cdot \left(x \cdot x\right)}}\right)} \]
  3. Simplified3.1

    \[\leadsto \cos x \cdot \color{blue}{\sqrt{\sqrt{e^{\left(x \cdot x\right) \cdot 30}} \cdot e^{5 \cdot \left(x \cdot x\right)}}} \]
    Proof
  4. Applied egg-rr2.6

    \[\leadsto \cos x \cdot \sqrt{\sqrt{\color{blue}{{\left(e^{x \cdot 30}\right)}^{x}}} \cdot e^{5 \cdot \left(x \cdot x\right)}} \]
  5. Applied egg-rr2.0

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

Alternatives

Alternative 1
Error2.2
Cost45504
\[\cos x \cdot \sqrt{\sqrt{{\left(e^{x \cdot 30}\right)}^{x}} \cdot {\left(e^{x}\right)}^{\left(5 \cdot x\right)}} \]
Alternative 2
Error2.0
Cost45504
\[\cos x \cdot \sqrt{\sqrt{{\left(e^{x \cdot 30}\right)}^{x}} \cdot {\left(e^{5 \cdot x}\right)}^{x}} \]
Alternative 3
Error2.7
Cost39168
\[\cos x \cdot \sqrt{\sqrt{{\left(e^{x}\right)}^{\left(x \cdot 30\right)}} \cdot e^{5 \cdot \left(x \cdot x\right)}} \]
Alternative 4
Error2.6
Cost39168
\[\cos x \cdot \sqrt{\sqrt{{\left(e^{x \cdot 30}\right)}^{x}} \cdot e^{5 \cdot \left(x \cdot x\right)}} \]
Alternative 5
Error2.5
Cost39168
\[\cos x \cdot \sqrt{\sqrt{{\left(e^{x \cdot 30}\right)}^{x}} \cdot e^{\left(5 \cdot x\right) \cdot x}} \]
Alternative 6
Error2.9
Cost32832
\[\cos x \cdot \sqrt{\sqrt{e^{\left(x \cdot 30\right) \cdot x}} \cdot e^{5 \cdot \left(x \cdot x\right)}} \]
Alternative 7
Error3.1
Cost32512
\[\sqrt[3]{{\cos x}^{3}} \cdot \sqrt[3]{e^{x \cdot \left(x \cdot 30\right)}} \]
Alternative 8
Error3.1
Cost26432
\[\cos x \cdot \sqrt{e^{\left(x \cdot x\right) \cdot 15} \cdot e^{5 \cdot \left(x \cdot x\right)}} \]
Alternative 9
Error3.0
Cost19584
\[\cos x \cdot {\left(e^{10}\right)}^{\left(x \cdot x\right)} \]
Alternative 10
Error3.5
Cost13504
\[\frac{0.3333333333333333 \cdot \left(e^{\left(x \cdot x\right) \cdot 10} \cdot \cos x\right)}{0.3333333333333333} \]
Alternative 11
Error3.5
Cost13248
\[\cos x \cdot e^{10 \cdot \left(x \cdot x\right)} \]
Alternative 12
Error52.3
Cost7232
\[\left(1 + \left(x \cdot x\right) \cdot -0.5\right) \cdot e^{10 \cdot \left(x \cdot x\right)} \]
Alternative 13
Error57.8
Cost576
\[\left(1 + \left(x \cdot x\right) \cdot -0.5\right) \cdot 1 \]
Alternative 14
Error63.0
Cost448
\[1 + \left(x \cdot 9.5\right) \cdot x \]

Error

Reproduce

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