1

I want to write a formula where 1 or -1 may be added to a starting variable of zero, any number of times, but I want to make it so that the rate of increase / decrease decreases infinitely before reaching +10 or -10. The farther the number moves from zero, the less it should be affected by the +1 or -1 input.

I'm not very good with math. How can I do this?

J.Todd
  • 253
  • Hopefully this makes sense. If there's any way I can improve the question or need to clarify, I'm here to do so. – J.Todd Oct 09 '14 at 06:06

1 Answers1

2

Are you looking for a function like $$f(x) = \frac{10}{x}\left(\sqrt{x^2+1} - 1\right),$$ perhaps? Here's a plot showing that the function increases from close to $-10$ to close to $10$ but never reaches either in either direction:

enter image description here

If the transition from $-10$ to $10$ happens too quickly then you might consider scaling $x$, say by replacing it with $x/2$ or something like that.