I am looking for a function that is inversely proportional for positive numbers and directly proportional for negative numbers. The positive and negative can be swapped but the importnat thing is that they are in the same scale. Is there any such function?
Tell me more
×
Mathematics Stack Exchange is a question and answer site for
people studying math at any level and professionals in related fields. It's 100% free, no registration required.
|
|
Easiest way $$ f(x) = \left \{ \begin{array}{ll} \frac mx & x > 0 \\ kx & x \le 0 \end{array}\right . $$ You also can use Heaviside step function $H(x)$ $$ f(x) = \left \{ \begin{array}{ll} \frac mx H(x) + kx H(-x) & x \ne 0 \\ 0 & x = 0 \end{array}\right . $$ |
|||
|
|
