Some examples of using the logistic function in smooth approximations for ifthen and max/min:
- ifthen(x1>x2, y, z) = z + (y-z)*0.5*(1+tanh(k*(x1-x2)))
- ifthen(x1<x2, y, z) = y + (z-y)*0.5*(1+tanh(k*(x1-x2)))
- max(x,y) = ifthen(x>y,x,y) = y + (x-y)*0.5*(1+tanh(k*(x-y)))
- min(x,y) = ifthen(x<y,x,y) = x + (y-x)*0.5*(1+tanh(k*(x-y)))
Some graphs with k=100:
this is super powerful, could you give us more on that or any smooth approximations pdf or books to read ?
ReplyDeleteThank you very much.
Sorry: I don't know such reference.
ReplyDelete