The algorithm for the logarithmic conversion of the number in percent

I am looking for a way to convert any number to percent as follows:

  • 1.00 - 50%
  • numbers below 1.00 approach 0% logarithmically
  • numbers above 1.00 are 100% logarithmic.

    x> 0. Therefore, y should approach 0, since x becomes infinitesimal on the positive side.

I am sure it is easy to do, but I cannot remember how to do it.

+3
source share
4 answers

try 1 / (1 + e^(1-x))

this logistic function is shifted by 1 unit

graph

If you want it to move closer, you can change e to something higher

Edit:

so that f (0) = 0 you can use 1 - 2^(-x)

graph

+15

, ? , "y 0, x " f (0) = 0, f . x/(x + 1) : http://www.wolframalpha.com/input/?i=x%2F%28x%2B1%29

+4

y = f(t) = 1 - exp(-t/tau)?

t 0 y t/tau. t y 1.

f (1) = 0,5, tau = 1/log (2).

+2

, , x cubed - .

http://jedsmith.org/static/S01813305.png

This has been shown using y=(x-1)^3+1(converted to make a (1,1)source). Of course, you can make the result as a percentage by simply scaling it by 50.

You are ultimately trying to get an effective solution to give you an approximate percentage behavior in a programming language and not in Mathematica, right?

+2
source

Source: https://habr.com/ru/post/1724184/


All Articles