Math notation that I am not familiar with

103 Views Asked by At

I am working on reverse engineering a game and have come across the following formula as a string in a config file:

A*(B^xt)+C; xt=A2*x*(T>x)*(B2^x+C2)

It would appear that I would solve for xt then plug it into the first function. However I don't know how to interpret the (T>x). I have static values for A, B, C, A2, B2, C2, T and they are as follows:

A: 300
B: 1.51
C: -319

A2: 1.8
B2: 0.93
C2: -0.64

T: 14

I know the outcomes of this equation to be:

x = 2, y = 365
x = 3, y = 714
x = 4, y = 1,241
x = 5, y = 2,036
(I can post more if needed)

My attempts to plug in the constants and x value (completely ignoring the (T>x)) have resulted in values that are not even close to what they are supposed to be. I'm hoping someone here can make sense of it, especially the (T>x) part. Thank you for any help you may be able to provide.

2

There are 2 best solutions below

3
On BEST ANSWER

The values you've shown are consistent with y=A*(B^x)+C, if we interpret the caret ^ as exponentiation and round to the nearest integer:

300*(1.51^2)-319 =  365.03
300*(1.51^3)-319 =  713.885
300*(1.51^4)-319 = 1240.657
300*(1.51^5)-319 = 2036.082

So I'm not convinced that this code first computes xt and then plugs it into the first part; I'd suppose that the first part is computed first, using a previously established value of xt where it happens to be equal to x, and then, perhaps, the second part is used to change the value of xt to something mysterious.

2
On

The code (T > x) is used in some languages (e.g. MATLAB) as a boolean function, returning 1 when the condition is true, and 0 otherwise.

In other words, > is treated as a binary operator mapping $X\times Y$ to $\{0,1\}$.

For instance, if I had T = 4 and x = [0 1 2 3 4 5], then T > x would return [1 1 1 1 0].