Mercurial > hg > ishara
view general/numerical/scalar/safe_exp2.m @ 53:3ba80c9914ff
Minor doc fix, added .class to .hgignore
author | samer |
---|---|
date | Mon, 02 Feb 2015 10:47:55 +0000 |
parents | cb249ba61e9e |
children |
line wrap: on
line source
function [y,k]=safe_exp2(x,l) % safe_exp2 - high dynamic range exponential % % safe_exp2 :: X:[[N,M]], L:real -> [[N,M]], [[1,M]]. % % returns y and k such that exp(X) = y * exp(k) and % maximum value in y is exp(L). % Maximum sensible value of L is log(realmax)=709.78. k=max(x,[],1)-l; y=exp(x-repmat(k,size(x,1),1));