Skip to content

An error/mistake in Easom function #9

@shar3579

Description

@shar3579

When i tried to import landscapes library and use easom function in it, The error below occurs because the Easom function has a calculation issue.

Error:


    747    
    748     x, y = xy[0], xy[1]
--> 749     return -cos(x)*cos(y)*exp(-((x-pi)**2 - (y-pi)**2))

OverflowError: math range error


Correct Formula:
-cos(x)cos(y)exp(-((x-pi)**2 + (y-pi)**2))

Proof:
https://en.wikipedia.org/wiki/Test_functions_for_optimization#:~:text=Test%20functions%20for%20single%2Dobjective%20optimization%20Name%20Plot,%7B%5Cdisplaystyle%20f(x%2Cy)=%2D%5Ccos%20%5Cleft(x%5Cright)%5Ccos%20%5Cleft(y%5Cright)%5Cexp%20%5Cleft(%2D%5Cleft(%5Cleft(x%2D%5Cpi%20%5Cright)%5E%7B2%7D+%5Cleft(y%2D%5Cpi%20%5Cright)%5E%7B2%7D%5Cright)%5Cright)%7D

Please Correct This Immediately

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions