Goal:
- f(0) = 0
- f(1) = inf
- f(-1) = -inf
try1 : f(x) = 1/(1-x)-1
- f(0) = 0
- f(1) = inf
- f(-1) = fail
try2 : f(x) = tan(x*PI/2)
- f(0) = 0
- f(1) = inf
- f(-1) = -inf
inverse of function : f-1(x)= atan(x)/(PI/2)
OK! But calculation time complexity is high and inverse of function is also.
try3 : reshape of try1
- f(x) = 1/(1-abs(x))-1
- f(x) = sign(x)*(1/(1-|x|) - 1)
It seems good! But it can be simplified.
sign(x) = x/|x| = |x|/x
- f(x) = (x/|x|)*(1/(1-|x|) - 1)
- f(x) = (x/|x|)*((1 - 1 + |x|)/(1-|x|))
- f(x) = (x/|x|)*(|x|/(1-|x|))
- f(x) = (x/(1-|x|)) nice!!
what about inverse?
- f(x) = y = (x/(1-|x|))
- f-1(y) = x
in our case :
- sign(x) = sign(y) = x/|x| = |x|/x = y/|y| = |y|/y
- y = f(x) = (x/(1-|x|)) = 1/(1/x - sign(x))
- 1/y = 1/x - sign(x)
- 1/y + sign(x) = 1/x
- (1+y*sign(x))/y = 1/x
- x = y/(1+y*sign(x))
- x = y/(1+y*sign(y))
- x = y/(1+y*|y|/y)
- f-1(y) = y/(1+|y|)
- f-1(x) = x/(1+|x|) niceeeee!
in summary :
- f(x) = x/(1-|x|)
- f-1(x) = x/(1+|x|)
generalized :
- f(x) = ((x*|x|)^(n-1)) / (1-(|x|^n))
- f-1(x) = sign(x) * ((x/(1+|x|))^(1/n))