While this is of course cool, curve fitting (and things like Taylor's series) seem to be better ways to fight this problem. At least this works very well in dealing with functions.

I long remember reading "The two worst ways to solve a problem are genetic algorithms and neural networks". Worst -> Slowest. This isn't a knock at GA and NN, this is the truth, as written by AI purists themselves.

Loosely: You use the former when you know what "closer to right" means, but you don't know how to make something "more right". You use the latter when you know when the right answer, but you don't know how to get there.

The day we consign math to genetic algorithms, IMHO, is the day we stop understanding math. If you are trying to fit a function to data, there are better ways. Your write-up is of course cool and is well worth of the ++, just be advised the brute-force approach to mathematics...well...it isn't mathematics anymore.

Just like an infinite number of monkeys with typewriters will eventually come up with a Shakespearean tragedy, we could try to have todays fast computers mutate a formula until it gets close to a predefined goal
FYI -- when the predefined goal is the input numerical value for pi, then you know the goal, and you are there. Hence the above quote about the better methods for solving a problem. Pi is probably a very bad case, curve fitting would probably serve a better example and would have a more interesting fitness function.

In reply to Re: Evolving formulae by flyingmoose
in thread Evolving formulae by tsee

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.