mersenneforum.org calculate logarithm base 2 of number very close 1
 Register FAQ Search Today's Posts Mark Forums Read

 2011-04-18, 07:39 #1 thehealer   7×17×19 Posts 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?
 2011-04-18, 09:51 #2 kar_bon     Mar 2006 Germany 2·5·172 Posts Perhaps this can help, but I've not checked a result you need and it's only available in German.
 2011-04-18, 10:40 #3 jasonp Tribal Bullet     Oct 2004 33·131 Posts 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.
 2011-04-18, 11:20 #4 Mini-Geek Account Deleted     "Tim Sorbera" Aug 2006 San Antonio, TX USA 10000101010112 Posts Wolfram Alpha seems to have no trouble with it.
2011-04-18, 17:21   #5
R.D. Silverman

Nov 2003

22×5×373 Posts

Quote:
 Originally Posted by jasonp 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.

 2011-04-18, 22:35 #6 Batalov     "Serge" Mar 2008 Phi(4,2^7658614+1)/2 223158 Posts 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.
2011-04-19, 05:27   #7
CRGreathouse

Aug 2006

32×5×7×19 Posts

Quote:
 Originally Posted by R.D. Silverman 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?

2011-04-20, 06:27   #8

"Richard B. Woods"
Aug 2002
Wisconsin USA

22×3×641 Posts

Quote:
 Originally Posted by Batalov 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!

2011-04-20, 12:53   #9
R.D. Silverman

Nov 2003

164448 Posts

Quote:
 Originally Posted by Batalov 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.

2011-04-20, 14:02   #10
science_man_88

"Forget I exist"
Jul 2009
Dumbassville

26×131 Posts

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

 Similar Threads Thread Thread Starter Forum Replies Last Post mickfrancis Math 16 2017-03-01 07:17 jnml Miscellaneous Math 3 2013-11-30 05:35 Sairam Math 34 2011-06-12 02:24 Fusion_power Math 19 2007-11-02 21:37 Fusion_power Miscellaneous Math 13 2005-10-24 17:58

All times are UTC. The time now is 17:09.

Sun May 9 17:09:35 UTC 2021 up 31 days, 11:50, 1 user, load averages: 4.35, 4.19, 3.90