1. Member
Join Date
Jun 2013
Posts
10
Rep Power
0

numerical problem

Hello!here is my question : how can i find the min x for this equation
x+10^5=x

2. Senior Member
Join Date
Jan 2013
Location
Northern Virginia, United States
Posts
5,738
Rep Power
10

Re: numerical problem

First, what does this have to do with Java? Second, x does not exist. Subtract x from both sides and you get 10^5 = 0 which is false.

Regards,
Jim

3. Member
Join Date
Jun 2013
Posts
10
Rep Power
0

Re: numerical problem

Ok i have to explain more.This is an equation with the numerical analysis rules(computer epsilon)
I type here my question because i want to make a programm in java that compute the min x
thanks for anwser me.

4. Senior Member
Join Date
Jan 2013
Location
Northern Virginia, United States
Posts
5,738
Rep Power
10

Re: numerical problem

Well, unfortunately I am unable to help. I have had numerical analysis a long time ago but I am still not certain what you are asking. But there are lots of bright people on this forum so one of them should be able to help. However, no one here will write the code for you. They will only give you hints and point you in the right direction.

Regards,
Jim

5. Member
Join Date
Jun 2013
Posts
10
Rep Power
0

Re: numerical problem

Thanks jim.Of course i dont want the code from anyone.i have make something
but i m not sure that this is correct:
double e=2;
while(e+10^6>e){
e*=e;
}
So with the first look this is an infinity loop but for a big e its equals.so when we exit the loop the
e is the min x?

6. Re: numerical problem

Strange that ( x + N > x ) can be false with N > 0. Is this some test of the limits of computers to hold a numeric value? For example large positive int values roll over to negative values when they reach their bit size limit. For example:
Java Code:
```        int x  = 0x7FFFFFFF;
System.out.println(x > (x + 1));  // true```

7. Senior Member
Join Date
Jan 2013
Location
Northern Virginia, United States
Posts
5,738
Rep Power
10

Re: numerical problem

Well, looking at your loop I still say that e + 10^6 > e will always be true since e will never be negative from a pure mathematical sense. Now e *= e can approach infinity in Java. But your loop would stop earlier due to limitations of decimal computations. Perhaps that is what you are seeking.

And it should be
Java Code:
```while(e + 1_000_0000 > e)
//or
double error = Math.pow(10,6);
while (e + error > e)```
Regards,
Jim

Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•