Skip to content

Latest commit

 

History

History
22 lines (15 loc) · 953 Bytes

README.md

File metadata and controls

22 lines (15 loc) · 953 Bytes

Function-Approximation

I implement a function approximator with the help of genetic programming. In this project I only use simple functions such as:

  • +(addition)
  • -(subtraction)
  • *(multiplication)
  • /(division)
  • ^(exponentiation)
  • cos(x) and sin(x)

The picture below is the first approximation of the program for the x*cos(x) function:

xcosx

There is a little error in the results. (the blue one is an approximation and the red one is an exact function). The picture below is another approximation for x*cos(x):

xcosx2

As you see, both are the same and depict it with black color.

To provide a complex example, we give our program a discrete function, and below are the results:

discrete