2 ms·
Eureqa lets you choose what functions you use and what cost each has. I need to know what the expense is for each operation and I can just feed it in. I removed
by Houshalter 12y ago
Eureqa lets you choose what functions you use and what cost each has. I need to know what the expense is for each operation and I can just feed it in. I removed division and increased the cost for multiplication: https://i.imgur.com/8C9OBEY.png?1 https://i.imgur.com/8C9OBEY.png?1 (I'm using the author's error metric of relative error, which is what the 0 = abs(y-...)/y means.)
Here it is without mod which I think might be expensive: pg1: https://i.imgur.com/SMvj68W.jpg https://i.imgur.com/SMvj68W.jpg, and pg2: https://i.imgur.com/ACw321W.png?1 https://i.imgur.com/ACw321W.png?1
And of course the best fit has extra complexity, that's why it gives you many choices along the complexity tradeoff.
I wasn't suggesting a lookup table to approximate the function, but the choose the formula itself. E.g. you might have a function which fits the first half of the function very well, and another which fits the second half very well. I think that branching code is slower, so alternatively you can do a lookup for the constants of the formula. Some constants will be optimized for one part of the function, and another set of constants will be optimized for another part.
I don't think that kind of lookup would be too slow. You only need to fit a few elements in the cache, and interpolation is a simple operation. It's just a subtraction, a multiplication, and an addition.
- Houshalter 12y agoEDIT: In the last paragraph I mean I don't think a complete lookup table and interpolation, like you mentioned, would be too slow. Not referring to the lookup table of formulas I suggested, but computed log values.
- dalke 12y agoI am confused about why you need to think that certain operations are/are not expensive, or why you think a table is faster. I think they are expensive, and it won't be faster. Hence we're at an impasse. That block was predictable, and easily solve by taking the equation you have and testing against the reference code. If you test it out, you'll know the answer. There's no need to think you know the answer when you can just measure it, and overrule any incorrect beliefs I may have.
- Houshalter 12y agoAs I said, I don't have a table of how fast each operation is. I don't think any of my assumptions were unreasonable, but I did explicitly state they were assumptions. And I don't have any way of testing it. I am interested in function approximation mainly for finding functions for when there is no closed form solution, not so much tiny optimization.