Snippet A nice math function...

Renendaru

(Evol)ution is nothing without love.
Reaction score
309
I had problems with the Webpage version too, when I pressed the button to 'do the work' nothing happened at all.
 

Builder Bob

Live free or don't
Reaction score
249
Wow! That formula finder script works really well. Nice job!

Most useful when giving 3 values. With 4/5 it could make some crazy long formulas.

About reports about the script not working, I can say that it works perfectly on firefox.
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
> With 4/5 it could make some crazy long formulas

That is to be expected.
And also shows that your values have no "simple" system to them :p

The usual GIGO Law applies (Garbage in, garbage out).
 

emjlr3

Change can be a good thing
Reaction score
395
must be my issue here at work
 

monoVertex

I'm back!
Reaction score
460
(Garbage in, garbage out)

Ha ha :D.

It's funny, I inserted:

3
-5
0
0
1234

And the expected thing with the formula is:

Code:
Level 1: 3
Level 2: -58.125
Level 3: -1.5
Level 4: 154.875
Level 5: 1650

Levels 4 and 5 are way off, lol.

But anyway, good job on this, kind of late-comer to have any use for me.
 

Siretu

Starcraft 2 Editor Moderator
Reaction score
293
JASS:
    local real a = 0.5 * (y3 - 2 * y2 + y1)
    local real b = y2 - y1 - 3 * a
    local real c = y1 - a - b

Can you explain those 3 lines? I know it works but I want to know WHY!

I get the a * x * x + b * x + c line, I almost get the a = line.
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
Problem:
Determine a, b and c from "a * x² + b * x + c",
where the result gives y1 when x = 1, y2 with x = 2 and y3 with x = 3.
(I.e. the expected result on levels 1 to 3)


(1) a * 1 + b * 1 + c = y1
(2) a * 4 + b * 2 + c = y2
(3) a * 9 + b * 3 + c = y3

(4): (2) - (1): 3a + b = y2 - y1
(5): (3) - (2): 5a + b = y3 - y2

(6): (5) - (4): 2a = (y3 - y2) - (y2 - y1)
(6): a = 0.5 * (y3 - 2 * y2 + y1)

(7): b from (4): b = y2 - y1 - 3 * a
(8): c from (1): c = y1 - a - b
 

SerraAvenger

Cuz I can
Reaction score
234
What did you plug into that poor thing?
And what were you expecting instead?
What's the problem?

Input: 9 - 8 - 7 - 9 - 7
Output:
Level 1: 9
Level 2: 8.539
Level 3: 7.232
Level 4: 8.061

Level 5: 4

Level 6: -21.985
Level 7: -96.936
Level 8: -257.903
Level 9: -551.944
Level 10: -1036.125
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
Not really.
It just depends on what you plug in as values.

Those from post #36 for example are not representable with a polynomial of degree 4.
As such, while you do get a formula, it's only ever a "nearly there".
 

SerraAvenger

Cuz I can
Reaction score
234
Not really.
It just depends on what you plug in as values.

Those from post #36 for example are not representable with a polynomial of degree 4.
As such, while you do get a formula, it's only ever a "nearly there".

Shouldn't a polynomial of degree 5 do it?
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top