Sign in to follow this  

Simplify a eq

This topic is 4718 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello I have this eq: (a*b)+(c*d)=x But I want to simply so it would look like this (a+b)*e=x and e should ONLY be described by b and d and (a+b) if it is needed. Ive tried a lot to find out a way but I can't is it impossible? If it isnt please show me how e is calculated! Thanks in advance

Share this post


Link to post
Share on other sites
I want to optimize code look at this:
it is my problem but easier written


int finaldata[1000];

const int data[MAX][1000]; //
const int datamul[MAX];


// 2 can be any number but since I wrote (a*b)+(c*d)
// I write 2 here too.
for (int n = 0; n < 2; n++)
{
for (int m = 0; m < 1000; m++)
finaldata += data[n][m] * datamul[n];
}

// Intead I want to do this:
for (int n = 0; n < 2; n++)
{
for (int m = 0; m < 1000; m++)
finaldata += data[n][m];
}

for (m = 0; m < 1000; m++)
{
finaldata *= (This is the value I want, but cant find out how to calculate it)
}

// I am not programming for computer so plz dont tell me that it wont be much speed improvement

Share this post


Link to post
Share on other sites

This topic is 4718 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this