Continued fractions approximation using golden ratio












0












$begingroup$


Hello today my friend helped me with my problem, but he did not give me any additional informations why it works like that.
Let's suppose that I need to get ln(n) using continued fractions. He told me to convert the n in to the field between $$<0.61803398875, 1.61803398875>$$by either multiplying it by e or dividing it by e and then add number of times that i have multiplied the number and subtract number of times i have divided -- he told me that way i can use just 5 iterations but i do not know why :( . Can someone explain this to me?
Basically this is the transformation :



$$ newNumber = 8.47,count = 0 --> ln(newNumber) $$ will transform it to my range like this



$$ while(newNumber ∉ range) $$ do $$ newNumber = newNumber / e ; count = count + 1$$
when i will be finished new number will be $$newNumber = 1.14628984901 $$
now i can compute my ln using continued fractions formula in just 5 iterations which will give me
$$ ln(newNumber) = 0.13653050866 $$ and to get desired output I will now add count to it $$ln(newNumber) = 0.13653050866 + count$$, which leaves us with $$ln(newNumber) = 2.13653050866$$ which is correct. My question is. Why i could do just 5 iterations to get so accurate result for $$ln(newNumber) --> which is in range$$. But I could not achieve it with 5 iterations for example number 8.47 right of the bat?










share|cite|improve this question











$endgroup$








  • 1




    $begingroup$
    Please structure this post better. And use MathJax to type formulas. So far I can't understand what you described at all
    $endgroup$
    – Yuriy S
    Nov 24 '18 at 23:13










  • $begingroup$
    @YuriyS hopefully now it will make more sense
    $endgroup$
    – Jason Krowl
    Nov 24 '18 at 23:39










  • $begingroup$
    @Ross Millikan Perhaps I need it to 8 significant digits, how can i say that 5 is enough? –
    $endgroup$
    – Jason Krowl
    Nov 25 '18 at 12:38
















0












$begingroup$


Hello today my friend helped me with my problem, but he did not give me any additional informations why it works like that.
Let's suppose that I need to get ln(n) using continued fractions. He told me to convert the n in to the field between $$<0.61803398875, 1.61803398875>$$by either multiplying it by e or dividing it by e and then add number of times that i have multiplied the number and subtract number of times i have divided -- he told me that way i can use just 5 iterations but i do not know why :( . Can someone explain this to me?
Basically this is the transformation :



$$ newNumber = 8.47,count = 0 --> ln(newNumber) $$ will transform it to my range like this



$$ while(newNumber ∉ range) $$ do $$ newNumber = newNumber / e ; count = count + 1$$
when i will be finished new number will be $$newNumber = 1.14628984901 $$
now i can compute my ln using continued fractions formula in just 5 iterations which will give me
$$ ln(newNumber) = 0.13653050866 $$ and to get desired output I will now add count to it $$ln(newNumber) = 0.13653050866 + count$$, which leaves us with $$ln(newNumber) = 2.13653050866$$ which is correct. My question is. Why i could do just 5 iterations to get so accurate result for $$ln(newNumber) --> which is in range$$. But I could not achieve it with 5 iterations for example number 8.47 right of the bat?










share|cite|improve this question











$endgroup$








  • 1




    $begingroup$
    Please structure this post better. And use MathJax to type formulas. So far I can't understand what you described at all
    $endgroup$
    – Yuriy S
    Nov 24 '18 at 23:13










  • $begingroup$
    @YuriyS hopefully now it will make more sense
    $endgroup$
    – Jason Krowl
    Nov 24 '18 at 23:39










  • $begingroup$
    @Ross Millikan Perhaps I need it to 8 significant digits, how can i say that 5 is enough? –
    $endgroup$
    – Jason Krowl
    Nov 25 '18 at 12:38














0












0








0





$begingroup$


Hello today my friend helped me with my problem, but he did not give me any additional informations why it works like that.
Let's suppose that I need to get ln(n) using continued fractions. He told me to convert the n in to the field between $$<0.61803398875, 1.61803398875>$$by either multiplying it by e or dividing it by e and then add number of times that i have multiplied the number and subtract number of times i have divided -- he told me that way i can use just 5 iterations but i do not know why :( . Can someone explain this to me?
Basically this is the transformation :



$$ newNumber = 8.47,count = 0 --> ln(newNumber) $$ will transform it to my range like this



$$ while(newNumber ∉ range) $$ do $$ newNumber = newNumber / e ; count = count + 1$$
when i will be finished new number will be $$newNumber = 1.14628984901 $$
now i can compute my ln using continued fractions formula in just 5 iterations which will give me
$$ ln(newNumber) = 0.13653050866 $$ and to get desired output I will now add count to it $$ln(newNumber) = 0.13653050866 + count$$, which leaves us with $$ln(newNumber) = 2.13653050866$$ which is correct. My question is. Why i could do just 5 iterations to get so accurate result for $$ln(newNumber) --> which is in range$$. But I could not achieve it with 5 iterations for example number 8.47 right of the bat?










share|cite|improve this question











$endgroup$




Hello today my friend helped me with my problem, but he did not give me any additional informations why it works like that.
Let's suppose that I need to get ln(n) using continued fractions. He told me to convert the n in to the field between $$<0.61803398875, 1.61803398875>$$by either multiplying it by e or dividing it by e and then add number of times that i have multiplied the number and subtract number of times i have divided -- he told me that way i can use just 5 iterations but i do not know why :( . Can someone explain this to me?
Basically this is the transformation :



$$ newNumber = 8.47,count = 0 --> ln(newNumber) $$ will transform it to my range like this



$$ while(newNumber ∉ range) $$ do $$ newNumber = newNumber / e ; count = count + 1$$
when i will be finished new number will be $$newNumber = 1.14628984901 $$
now i can compute my ln using continued fractions formula in just 5 iterations which will give me
$$ ln(newNumber) = 0.13653050866 $$ and to get desired output I will now add count to it $$ln(newNumber) = 0.13653050866 + count$$, which leaves us with $$ln(newNumber) = 2.13653050866$$ which is correct. My question is. Why i could do just 5 iterations to get so accurate result for $$ln(newNumber) --> which is in range$$. But I could not achieve it with 5 iterations for example number 8.47 right of the bat?







logic approximation continued-fractions golden-ratio eulers-constant






share|cite|improve this question















share|cite|improve this question













share|cite|improve this question




share|cite|improve this question








edited Nov 24 '18 at 23:39







Jason Krowl

















asked Nov 24 '18 at 22:14









Jason KrowlJason Krowl

32




32








  • 1




    $begingroup$
    Please structure this post better. And use MathJax to type formulas. So far I can't understand what you described at all
    $endgroup$
    – Yuriy S
    Nov 24 '18 at 23:13










  • $begingroup$
    @YuriyS hopefully now it will make more sense
    $endgroup$
    – Jason Krowl
    Nov 24 '18 at 23:39










  • $begingroup$
    @Ross Millikan Perhaps I need it to 8 significant digits, how can i say that 5 is enough? –
    $endgroup$
    – Jason Krowl
    Nov 25 '18 at 12:38














  • 1




    $begingroup$
    Please structure this post better. And use MathJax to type formulas. So far I can't understand what you described at all
    $endgroup$
    – Yuriy S
    Nov 24 '18 at 23:13










  • $begingroup$
    @YuriyS hopefully now it will make more sense
    $endgroup$
    – Jason Krowl
    Nov 24 '18 at 23:39










  • $begingroup$
    @Ross Millikan Perhaps I need it to 8 significant digits, how can i say that 5 is enough? –
    $endgroup$
    – Jason Krowl
    Nov 25 '18 at 12:38








1




1




$begingroup$
Please structure this post better. And use MathJax to type formulas. So far I can't understand what you described at all
$endgroup$
– Yuriy S
Nov 24 '18 at 23:13




$begingroup$
Please structure this post better. And use MathJax to type formulas. So far I can't understand what you described at all
$endgroup$
– Yuriy S
Nov 24 '18 at 23:13












$begingroup$
@YuriyS hopefully now it will make more sense
$endgroup$
– Jason Krowl
Nov 24 '18 at 23:39




$begingroup$
@YuriyS hopefully now it will make more sense
$endgroup$
– Jason Krowl
Nov 24 '18 at 23:39












$begingroup$
@Ross Millikan Perhaps I need it to 8 significant digits, how can i say that 5 is enough? –
$endgroup$
– Jason Krowl
Nov 25 '18 at 12:38




$begingroup$
@Ross Millikan Perhaps I need it to 8 significant digits, how can i say that 5 is enough? –
$endgroup$
– Jason Krowl
Nov 25 '18 at 12:38










1 Answer
1






active

oldest

votes


















0












$begingroup$

The first basic idea is that it is easier to make a good approximation over a narrow interval. Many approximations are exact at one point and match closely near that point.



The second idea is using the laws of logarithms. If $N=e^ab, ln N=ln(e^ab)=a+ln b$. You can restrict the range of $b$ that you need to take the log of by dividing $b$ by the proper power of $e$. The suggested range does not quite work because $frac phi{phi-1}=1+phiapprox 2.618 lt e$. You can restrict it to $(e^{-1/2},e^{1/2})approx (0.6065,1.645)$ which is not so different from what your friend suggested. This assumes you can find the correct integral $a$ to divide your number by $e^a$ to get the quotient in range.



Once you have divided out $e^a$ you can use whatever approximation technique you want over the restricted range. You can do continued fractions, Taylor series, Padé approximations, or whatever. You need to use enough terms to get the accuracy you need. I don't see how you can know that five terms are enough unless you specify the accuracy requirement.






share|cite|improve this answer











$endgroup$













  • $begingroup$
    Perhaps I need it to 8 significant digits, how can i say that 5 is enough?
    $endgroup$
    – Jason Krowl
    Nov 25 '18 at 12:37










  • $begingroup$
    That depends on the approximation. I don't know how quickly the continued fraction converges. The Taylor series for $log(1+x)=x-frac {x^2}2+frac {x^3}3-frac {x^4}4 ldots$ The alternating series theorem says the error is the sign of and smaller than the first neglected term. You would need $frac {0.645^n}n lt 10^{-8}$ so you need $34$ terms for this one. I'm sure others are faster.
    $endgroup$
    – Ross Millikan
    Nov 25 '18 at 14:52










  • $begingroup$
    You could also reduce the range further. If you divide out half-integral powers of $e$ you can reduce the range to $[e^{-1/4},e^{1/4})approx [0.7788,1.284)$ and the series will converge more quickly
    $endgroup$
    – Ross Millikan
    Nov 25 '18 at 15:29











Your Answer





StackExchange.ifUsing("editor", function () {
return StackExchange.using("mathjaxEditing", function () {
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
});
});
}, "mathjax-editing");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "69"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
noCode: true, onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3012162%2fcontinued-fractions-approximation-using-golden-ratio%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0












$begingroup$

The first basic idea is that it is easier to make a good approximation over a narrow interval. Many approximations are exact at one point and match closely near that point.



The second idea is using the laws of logarithms. If $N=e^ab, ln N=ln(e^ab)=a+ln b$. You can restrict the range of $b$ that you need to take the log of by dividing $b$ by the proper power of $e$. The suggested range does not quite work because $frac phi{phi-1}=1+phiapprox 2.618 lt e$. You can restrict it to $(e^{-1/2},e^{1/2})approx (0.6065,1.645)$ which is not so different from what your friend suggested. This assumes you can find the correct integral $a$ to divide your number by $e^a$ to get the quotient in range.



Once you have divided out $e^a$ you can use whatever approximation technique you want over the restricted range. You can do continued fractions, Taylor series, Padé approximations, or whatever. You need to use enough terms to get the accuracy you need. I don't see how you can know that five terms are enough unless you specify the accuracy requirement.






share|cite|improve this answer











$endgroup$













  • $begingroup$
    Perhaps I need it to 8 significant digits, how can i say that 5 is enough?
    $endgroup$
    – Jason Krowl
    Nov 25 '18 at 12:37










  • $begingroup$
    That depends on the approximation. I don't know how quickly the continued fraction converges. The Taylor series for $log(1+x)=x-frac {x^2}2+frac {x^3}3-frac {x^4}4 ldots$ The alternating series theorem says the error is the sign of and smaller than the first neglected term. You would need $frac {0.645^n}n lt 10^{-8}$ so you need $34$ terms for this one. I'm sure others are faster.
    $endgroup$
    – Ross Millikan
    Nov 25 '18 at 14:52










  • $begingroup$
    You could also reduce the range further. If you divide out half-integral powers of $e$ you can reduce the range to $[e^{-1/4},e^{1/4})approx [0.7788,1.284)$ and the series will converge more quickly
    $endgroup$
    – Ross Millikan
    Nov 25 '18 at 15:29
















0












$begingroup$

The first basic idea is that it is easier to make a good approximation over a narrow interval. Many approximations are exact at one point and match closely near that point.



The second idea is using the laws of logarithms. If $N=e^ab, ln N=ln(e^ab)=a+ln b$. You can restrict the range of $b$ that you need to take the log of by dividing $b$ by the proper power of $e$. The suggested range does not quite work because $frac phi{phi-1}=1+phiapprox 2.618 lt e$. You can restrict it to $(e^{-1/2},e^{1/2})approx (0.6065,1.645)$ which is not so different from what your friend suggested. This assumes you can find the correct integral $a$ to divide your number by $e^a$ to get the quotient in range.



Once you have divided out $e^a$ you can use whatever approximation technique you want over the restricted range. You can do continued fractions, Taylor series, Padé approximations, or whatever. You need to use enough terms to get the accuracy you need. I don't see how you can know that five terms are enough unless you specify the accuracy requirement.






share|cite|improve this answer











$endgroup$













  • $begingroup$
    Perhaps I need it to 8 significant digits, how can i say that 5 is enough?
    $endgroup$
    – Jason Krowl
    Nov 25 '18 at 12:37










  • $begingroup$
    That depends on the approximation. I don't know how quickly the continued fraction converges. The Taylor series for $log(1+x)=x-frac {x^2}2+frac {x^3}3-frac {x^4}4 ldots$ The alternating series theorem says the error is the sign of and smaller than the first neglected term. You would need $frac {0.645^n}n lt 10^{-8}$ so you need $34$ terms for this one. I'm sure others are faster.
    $endgroup$
    – Ross Millikan
    Nov 25 '18 at 14:52










  • $begingroup$
    You could also reduce the range further. If you divide out half-integral powers of $e$ you can reduce the range to $[e^{-1/4},e^{1/4})approx [0.7788,1.284)$ and the series will converge more quickly
    $endgroup$
    – Ross Millikan
    Nov 25 '18 at 15:29














0












0








0





$begingroup$

The first basic idea is that it is easier to make a good approximation over a narrow interval. Many approximations are exact at one point and match closely near that point.



The second idea is using the laws of logarithms. If $N=e^ab, ln N=ln(e^ab)=a+ln b$. You can restrict the range of $b$ that you need to take the log of by dividing $b$ by the proper power of $e$. The suggested range does not quite work because $frac phi{phi-1}=1+phiapprox 2.618 lt e$. You can restrict it to $(e^{-1/2},e^{1/2})approx (0.6065,1.645)$ which is not so different from what your friend suggested. This assumes you can find the correct integral $a$ to divide your number by $e^a$ to get the quotient in range.



Once you have divided out $e^a$ you can use whatever approximation technique you want over the restricted range. You can do continued fractions, Taylor series, Padé approximations, or whatever. You need to use enough terms to get the accuracy you need. I don't see how you can know that five terms are enough unless you specify the accuracy requirement.






share|cite|improve this answer











$endgroup$



The first basic idea is that it is easier to make a good approximation over a narrow interval. Many approximations are exact at one point and match closely near that point.



The second idea is using the laws of logarithms. If $N=e^ab, ln N=ln(e^ab)=a+ln b$. You can restrict the range of $b$ that you need to take the log of by dividing $b$ by the proper power of $e$. The suggested range does not quite work because $frac phi{phi-1}=1+phiapprox 2.618 lt e$. You can restrict it to $(e^{-1/2},e^{1/2})approx (0.6065,1.645)$ which is not so different from what your friend suggested. This assumes you can find the correct integral $a$ to divide your number by $e^a$ to get the quotient in range.



Once you have divided out $e^a$ you can use whatever approximation technique you want over the restricted range. You can do continued fractions, Taylor series, Padé approximations, or whatever. You need to use enough terms to get the accuracy you need. I don't see how you can know that five terms are enough unless you specify the accuracy requirement.







share|cite|improve this answer














share|cite|improve this answer



share|cite|improve this answer








edited Nov 25 '18 at 14:47

























answered Nov 25 '18 at 6:36









Ross MillikanRoss Millikan

293k23197371




293k23197371












  • $begingroup$
    Perhaps I need it to 8 significant digits, how can i say that 5 is enough?
    $endgroup$
    – Jason Krowl
    Nov 25 '18 at 12:37










  • $begingroup$
    That depends on the approximation. I don't know how quickly the continued fraction converges. The Taylor series for $log(1+x)=x-frac {x^2}2+frac {x^3}3-frac {x^4}4 ldots$ The alternating series theorem says the error is the sign of and smaller than the first neglected term. You would need $frac {0.645^n}n lt 10^{-8}$ so you need $34$ terms for this one. I'm sure others are faster.
    $endgroup$
    – Ross Millikan
    Nov 25 '18 at 14:52










  • $begingroup$
    You could also reduce the range further. If you divide out half-integral powers of $e$ you can reduce the range to $[e^{-1/4},e^{1/4})approx [0.7788,1.284)$ and the series will converge more quickly
    $endgroup$
    – Ross Millikan
    Nov 25 '18 at 15:29


















  • $begingroup$
    Perhaps I need it to 8 significant digits, how can i say that 5 is enough?
    $endgroup$
    – Jason Krowl
    Nov 25 '18 at 12:37










  • $begingroup$
    That depends on the approximation. I don't know how quickly the continued fraction converges. The Taylor series for $log(1+x)=x-frac {x^2}2+frac {x^3}3-frac {x^4}4 ldots$ The alternating series theorem says the error is the sign of and smaller than the first neglected term. You would need $frac {0.645^n}n lt 10^{-8}$ so you need $34$ terms for this one. I'm sure others are faster.
    $endgroup$
    – Ross Millikan
    Nov 25 '18 at 14:52










  • $begingroup$
    You could also reduce the range further. If you divide out half-integral powers of $e$ you can reduce the range to $[e^{-1/4},e^{1/4})approx [0.7788,1.284)$ and the series will converge more quickly
    $endgroup$
    – Ross Millikan
    Nov 25 '18 at 15:29
















$begingroup$
Perhaps I need it to 8 significant digits, how can i say that 5 is enough?
$endgroup$
– Jason Krowl
Nov 25 '18 at 12:37




$begingroup$
Perhaps I need it to 8 significant digits, how can i say that 5 is enough?
$endgroup$
– Jason Krowl
Nov 25 '18 at 12:37












$begingroup$
That depends on the approximation. I don't know how quickly the continued fraction converges. The Taylor series for $log(1+x)=x-frac {x^2}2+frac {x^3}3-frac {x^4}4 ldots$ The alternating series theorem says the error is the sign of and smaller than the first neglected term. You would need $frac {0.645^n}n lt 10^{-8}$ so you need $34$ terms for this one. I'm sure others are faster.
$endgroup$
– Ross Millikan
Nov 25 '18 at 14:52




$begingroup$
That depends on the approximation. I don't know how quickly the continued fraction converges. The Taylor series for $log(1+x)=x-frac {x^2}2+frac {x^3}3-frac {x^4}4 ldots$ The alternating series theorem says the error is the sign of and smaller than the first neglected term. You would need $frac {0.645^n}n lt 10^{-8}$ so you need $34$ terms for this one. I'm sure others are faster.
$endgroup$
– Ross Millikan
Nov 25 '18 at 14:52












$begingroup$
You could also reduce the range further. If you divide out half-integral powers of $e$ you can reduce the range to $[e^{-1/4},e^{1/4})approx [0.7788,1.284)$ and the series will converge more quickly
$endgroup$
– Ross Millikan
Nov 25 '18 at 15:29




$begingroup$
You could also reduce the range further. If you divide out half-integral powers of $e$ you can reduce the range to $[e^{-1/4},e^{1/4})approx [0.7788,1.284)$ and the series will converge more quickly
$endgroup$
– Ross Millikan
Nov 25 '18 at 15:29


















draft saved

draft discarded




















































Thanks for contributing an answer to Mathematics Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


Use MathJax to format equations. MathJax reference.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3012162%2fcontinued-fractions-approximation-using-golden-ratio%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

How to change which sound is reproduced for terminal bell?

Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents

Can I use Tabulator js library in my java Spring + Thymeleaf project?