My response to the answer by fedja, Jun 5, 2011. This should be a comment, but won't fit.
It didn't work. Taking values of $A,B,\epsilon$ that satisfy your conditions, then tracing back through using 20-digit arithmetic, I get these values: $s_1=0.34018988053902955186$, $s_2=0.98903555253485545775$, $p_1=0.0000000004309513037$, $p_2=0.99999999956904869628$, $b = 0.050000002052149145975$. And this does what you wanted: function $(p_1 s_1^r)^{(1+b r)/(1+b r+r)}+
(p_2 s_2^r)^{(1+b r)/(1+b r+r)}$ looks like this:
It crosses the line $y=1$ three times, as required. But the function $D$ defined as specified implicitly, looks like this:
It
It does not cross the line $1+br$ three times. The value $r=0$ is no good for this (because in fact every number $D$ satisfies the equation when $r=0$).