All Questions
Tagged with floating-point logarithms
8
questions
0
votes
1
answer
43
views
Compute $\frac{\sum_{i=1}^nx_iy_i}{\sum_{i=1}^nx_i}$ in logarithmic space
Let $x,y\in(0,\infty)^n$. Is there a clever way to compute $$\frac{\sum_{i=1}^nx_iy_i}{\sum_{i=1}^nx_i}\tag1$$ by calculating $\ln\frac{\sum_{i=1}^nx_iy_i}{\sum_{i=1}^nx_i}$ instead? My problem is ...
1
vote
2
answers
1k
views
Integer part of natural logarithm
Please, does anyone know of a algorithm to compute the integer part $n$ of natural logarithm of an integer $x$?
$$n = \lfloor \ln(x) \rfloor$$
Preferably using integer arithmetic only (akin to ...
4
votes
2
answers
613
views
How to convert $\ln x - \ln y$ into a more accurate floating point representation?
I have an equation $\ln(x) - \ln(y)$ where x and y are very close to eachother. For example if $x = 5.1234$ then something like $fl(\ln(5.1234)) = 1.6338$ (with 4 significant digits). If $y = 5.1233$ ...
2
votes
2
answers
310
views
How can I rearrange this logarithmic formula to be computer friendly?
I've had a look through the logarithmic identities on Wikipedia, but nothing fits the bill.
Basically, I have a formula which shows how much more 'risky' one number is compared to another, where 0 = ...
2
votes
1
answer
1k
views
How are floating-point numbers logarithmically distributed?
From what I remember from a lecture I had of a course I'm attending called "introduction to computational science", floating-point numbers are distributed logarithmically. What does it mean? ...
4
votes
2
answers
756
views
How to understand or derive the formula "Mantissa bits${}/\log_2 10 ={}$ Decimal digits of precision"?
I asked a question a couple days ago about floating point precision on stackoverflow called, "Is floating point precision mutable or invariant?" and I received the following response.
The formula ...
2
votes
2
answers
3k
views
Converting base2 scientific notation to base10 scientific notation
I would now like to know how to convert a value in base2 scientific notation (is that the correct terminology?), say 1.93 * 2 ^ 88, into the form of A * 10 ^ B.
I want to do this without expressing ...
8
votes
1
answer
2k
views
Explain this code to compute $\log(1+x)$
It's well known that you need to take care when writing a function to compute $\log(1+x)$ when $x$ is small. Because of floating point roundoff, $1+x$ may have less precision than $x$, which can ...