 Your skill will accomplishwhat the force of many cannot PerlMonks

### Re^3: Reverse engineering a formula...

by Skeeve (Parson)
 on Jun 13, 2006 at 10:31 UTC ( #554993=note: print w/replies, xml ) Need Help??

in reply to Re^2: Reverse engineering a formula...
in thread Reverse engineering a formula...

That will never give the sum you told us, because of 18.930167 and 17.96746

You will never get aything with just 2 decimal digits behind the decimal point with those 2 numbers.

s\$\$([},&%#}/&/]+}%&{})*;#\$&&s&&\$^X.(\$'^"%]=\&(|?*{%
+.+=%;.#_}\&"^"-+%*).}%:##%}={~=~:.")&e&&s""`\$''`"e

Replies are listed 'Best First'.
Re^4: Reverse engineering a formula...
by Gilimanjaro (Hermit) on Jun 13, 2006 at 13:58 UTC

And as the information is financial in nature, the end-result is most probably rounded to two digits. So in fact these two numbers may well be part of the formula...

In fact, without knowing for sure how exactly rounding is done, you'll have to look for a 'fuzzy' match; the last few digits may be off. Perhaps rounding the target and the tested result to integers would be the best way to go about this.

On a side note. the two numbers below 0.01 are most probably percentages... So we may also need to do multiplication, which would make it an almost impossible task, mainly because this would mean we also have to take operator-precedence into account...

Re^4: Reverse engineering a formula...
by monkey_boy (Priest) on Jun 13, 2006 at 10:34 UTC
With the info we have, there is no guarantee that all the columns are used.

This is not a Signature...
Re^4: Reverse engineering a formula...
by devnul (Monk) on Jun 13, 2006 at 10:34 UTC
Not every number necessarily needs to be part of the formula (obviously its 2 or more numbers in some combination of addition and/or subtraction). Those two numbers could simply not be part of the formula.

- Devnul
As I said before: Not enough information...

It seems as if your formular is something like this (untested code of course):
```my @sign=( .... ); # Some combination of -1, 0 1
my @sum= map { \$sign[\$i] * \$VAR1[\$i] } (0..\$#VAR1);
print eval join ' + ', @sum;
Now you "only" need to get the correct combination of -1, 0 and 1 for @sign, which is a "simple" combinational task but will be very lengthy...

s\$\$([},&%#}/&/]+}%&{})*;#\$&&s&&\$^X.(\$'^"%]=\&(|?*{%
+.+=%;.#_}\&"^"-+%*).}%:##%}={~=~:.")&e&&s""`\$''`"e

Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://554993]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (3)
As of 2022-05-16 05:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
Voting Booth?
Do you prefer to work remotely?

Results (62 votes). Check out past polls.

Notices?