## Question 3: Ackley's function (8 marks) Write code to input two numbers from the user (x1 and x2) and then print out
Posted: Tue May 24, 2022 8:38 am
## Question 3: Ackley's function (8 marks) Write code to input
two numbers from the user (x1 and x2) and then print out the result
of the following fuction (known as Ackley's function). You can test
your code using the following test cases: f(0,0) $\approx$ 0, and
f(31.5, 31.5) $\approx$ 22.314. **Hint**: In Python, trigonometric
functions (such as cos and sin) are defined in the math package.
$f(x_1,x_2) = -20\,\textrm{exp}\big(-0.2\sqrt{0.5(x_1^2 +
x_2^2)}\big)-\textrm{exp}(0.5(\cos2\pi x_1 + \cos2\pi x_2)) + 20 +
\textrm{exp}(1)$
two numbers from the user (x1 and x2) and then print out the result
of the following fuction (known as Ackley's function). You can test
your code using the following test cases: f(0,0) $\approx$ 0, and
f(31.5, 31.5) $\approx$ 22.314. **Hint**: In Python, trigonometric
functions (such as cos and sin) are defined in the math package.
$f(x_1,x_2) = -20\,\textrm{exp}\big(-0.2\sqrt{0.5(x_1^2 +
x_2^2)}\big)-\textrm{exp}(0.5(\cos2\pi x_1 + \cos2\pi x_2)) + 20 +
\textrm{exp}(1)$