mersenneforum.org  

Go Back   mersenneforum.org > Math Stuff > Other Mathematical Topics

Reply
 
Thread Tools
Old 2011-04-18, 07:39   #1
thehealer
 

5×1,129 Posts
Default calculate logarithm base 2 of number very close 1

I need to calculate logarithm base 2 of number very close to 1. for example
log2(0.9999999999999999999999999999999… The expected result is around 2^-80.
I can't calculate it even with Matlab.
Anyone can help me?
  Reply With Quote
Old 2011-04-18, 09:51   #2
kar_bon
 
kar_bon's Avatar
 
Mar 2006
Germany

37·79 Posts
Default

Perhaps this can help, but I've not checked a result you need and it's only available in German.
kar_bon is offline   Reply With Quote
Old 2011-04-18, 10:40   #3
jasonp
Tribal Bullet
 
jasonp's Avatar
 
Oct 2004

1101110101112 Posts
Default

Look up the infinite series for ln(1+x) centered about x=0. For your value of x you should get twice the double precision accuracy with a single term. Then divide by ln2 to convert to the base-2 logarithm.
jasonp is offline   Reply With Quote
Old 2011-04-18, 11:20   #4
Mini-Geek
Account Deleted
 
Mini-Geek's Avatar
 
"Tim Sorbera"
Aug 2006
San Antonio, TX USA

10000101011002 Posts
Default

Wolfram Alpha seems to have no trouble with it.
Mini-Geek is offline   Reply With Quote
Old 2011-04-18, 17:21   #5
R.D. Silverman
 
R.D. Silverman's Avatar
 
Nov 2003

1D2416 Posts
Default

Quote:
Originally Posted by jasonp View Post
Look up the infinite series for ln(1+x) centered about x=0. For your value of x you should get twice the double precision accuracy with a single term. Then divide by ln2 to convert to the base-2 logarithm.
How refreshing to see an actual discussion of mathematics, rather than
merely pointing at black boxes to perform the requested calculation.
R.D. Silverman is offline   Reply With Quote
Old 2011-04-18, 22:35   #6
Batalov
 
Batalov's Avatar
 
"Serge"
Mar 2008
Phi(4,2^7658614+1)/2

2·7·683 Posts
Default

http://cr.yp.to/2005-590/goldberg.pdf ...and see Theorem 4.
Come for the log2(1-x), stay for the whole document. It will be worth it.
Batalov is offline   Reply With Quote
Old 2011-04-19, 05:27   #7
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

3·1,993 Posts
Default

Quote:
Originally Posted by R.D. Silverman View Post
How refreshing to see an actual discussion of mathematics, rather than
merely pointing at black boxes to perform the requested calculation.
I guess this would be a bad time to mention FYL2XP1?
CRGreathouse is offline   Reply With Quote
Old 2011-04-20, 06:27   #8
cheesehead
 
cheesehead's Avatar
 
"Richard B. Woods"
Aug 2002
Wisconsin USA

22×3×641 Posts
Smile

Quote:
Originally Posted by Batalov View Post
http://cr.yp.to/2005-590/goldberg.pdf ...and see Theorem 4.
Come for the log2(1-x), stay for the whole document. It will be worth it.
One of my favorites!
cheesehead is offline   Reply With Quote
Old 2011-04-20, 12:53   #9
R.D. Silverman
 
R.D. Silverman's Avatar
 
Nov 2003

22·5·373 Posts
Default

Quote:
Originally Posted by Batalov View Post
http://cr.yp.to/2005-590/goldberg.pdf ...and see Theorem 4.
Come for the log2(1-x), stay for the whole document. It will be worth it.
Yep! Definitely worth it.
R.D. Silverman is offline   Reply With Quote
Old 2011-04-20, 14:02   #10
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

20C016 Posts
Default

Quote:
Originally Posted by R.D. Silverman View Post
Yep! Definitely worth it.
What did you do with the real R.D Silverman ?, I've never seen him agreeing this well.
science_man_88 is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Finding multiples of a real number that are close to a whole number mickfrancis Math 16 2017-03-01 07:17
[Curiosity] Binary logarithm of a Mersenne number jnml Miscellaneous Math 3 2013-11-30 05:35
The base of the logarithm in AKS algorithms Sairam Math 34 2011-06-12 02:24
Fastest possible algorithm to calculate the square root of a 10,000,000 digit number Fusion_power Math 19 2007-11-02 21:37
Formula to calculate number of potential factors? Fusion_power Miscellaneous Math 13 2005-10-24 17:58

All times are UTC. The time now is 10:35.


Mon Oct 18 10:35:21 UTC 2021 up 87 days, 5:04, 0 users, load averages: 1.69, 1.53, 1.54

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.