15,961,997 members
See more:
hi how i can calculate the amount of x up to 4 digits after decimal? p , q , r , s ,t , u are the inputs of problem
( 0<=x<=1 and we know this function in 0<=x<=1 is descending)
`p×e^(-x)+q×sin(x)+r×cos(x)+s×tan(x)+t×x^2+u=0`

thanks alot.
Posted
Updated 29-Mar-15 19:46pm
v2
Sergey Alexandrovich Kryukov 30-Mar-15 1:17am
The question makes no sense. If you are asking "how to do X", you should not tell us using what? Surprised?
Now, there is no "divide and conquer approach", as a technical term. It's nonsense in the following sense: you always "divide and conquer", to certain degree; so this is the talk about nothing. Anyway, What have you tried so far?
—SA

## Solution 1

At first this is a mathematical issue: this function isnt linear and has other dificulties. So D&C isnt a solution but part of the problem :-O

If your are looking for a 4-digit solution, I would ran a big loop like this:
Meta code:
C++
```float results[10000];
int n = 0;
for( float step = 0; i < 1; i+=0.00001 )
{
results[n] = callProblem( i );
}
//take a look on the sample```

some divide and conquer approach

C++
```float x = 0;
float diff = 1;//Startvalue
while( )
{
result = callProblem(x);

if( result > 0 )
{
x -= diff;
diff = diff/2;
result = callProblem(x);
}
else
{
x += diff;
diff = diff/2;
result = callProblem(x);
}
}```