>I need something an algorithm or something else to
> help me with this function when a and b are given from functions before.
> (1-(1/(1+r))^b)/r=a this is the function is there anything that can help me?
With the application of some algebra, this will become a quadratic.
You can then use the well-known "quadratic formula" to solve for r.
> Is there any function that can search for the value of r when r 0<r<1?
A search is not necessary. It can be solved analytically.
> IF
> somebody knows this it would be a great help for me if you display how i
> should write the code in c++.
If this is homework, do it yourself. If you are unable to do simple
algebra or find a common formula on the web, and program for
a living, you have chosen the wrong career.
I suggest more care in choosing subject lines in the future. I and
some other people find it difficult to bother looking at a post when
the author cannot bother to do such a simple thing in order to save
readers' time.

Signature
--Larry Brasfield
email: donotspam_larry_brasfield@hotmail.com
Above views may belong only to me.
Larry Brasfield - 02 Feb 2005 18:34 GMT
>>I need something an algorithm or something else to
>> help me with this function when a and b are given from functions before.
>> (1-(1/(1+r))^b)/r=a this is the function is there anything that can help me?
>
> With the application of some algebra, this will become a quadratic.
Wrong. It is quadratic only for b==1.
> You can then use the well-known "quadratic formula" to solve for r.
>
>> Is there any function that can search for the value of r when r 0<r<1?
>
> A search is not necessary. It can be solved analytically.
I would write a function to calculate the derivative w.r.t. r, then
use Newton's method (aka "Newton-Raphson method") to find
the roots of (1-(1/(1+r))^b)/r - a == 0. It should converge
rapidly over the range you gave for r.

Signature
--Larry Brasfield
email: donotspam_larry_brasfield@hotmail.com
Above views may belong only to me.
What about using the newton-raphson method...

Signature
Regards,
Rodrigo Corral Gonz?lez [MVP]
FAQ de microsoft.public.es.vc++
http://rcorral.mvps.org
Or some other finding algorithm...
http://mathworld.wolfram.com/Root-FindingAlgorithm.html

Signature
Regards,
Rodrigo Corral Gonz?lez [MVP]
FAQ de microsoft.public.es.vc++
http://rcorral.mvps.org