Continued fractions approximation using golden ratio
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
add a comment |
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
1
Please structure this post better. And use MathJax to type formulas. So far I can't understand what you described at all
– Yuriy S
Nov 24 at 23:13
@YuriyS hopefully now it will make more sense
– Jason Krowl
Nov 24 at 23:39
@Ross Millikan Perhaps I need it to 8 significant digits, how can i say that 5 is enough? –
– Jason Krowl
Nov 25 at 12:38
add a comment |
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
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
logic approximation continued-fractions golden-ratio eulers-constant
edited Nov 24 at 23:39
asked Nov 24 at 22:14
Jason Krowl
32
32
1
Please structure this post better. And use MathJax to type formulas. So far I can't understand what you described at all
– Yuriy S
Nov 24 at 23:13
@YuriyS hopefully now it will make more sense
– Jason Krowl
Nov 24 at 23:39
@Ross Millikan Perhaps I need it to 8 significant digits, how can i say that 5 is enough? –
– Jason Krowl
Nov 25 at 12:38
add a comment |
1
Please structure this post better. And use MathJax to type formulas. So far I can't understand what you described at all
– Yuriy S
Nov 24 at 23:13
@YuriyS hopefully now it will make more sense
– Jason Krowl
Nov 24 at 23:39
@Ross Millikan Perhaps I need it to 8 significant digits, how can i say that 5 is enough? –
– Jason Krowl
Nov 25 at 12:38
1
1
Please structure this post better. And use MathJax to type formulas. So far I can't understand what you described at all
– Yuriy S
Nov 24 at 23:13
Please structure this post better. And use MathJax to type formulas. So far I can't understand what you described at all
– Yuriy S
Nov 24 at 23:13
@YuriyS hopefully now it will make more sense
– Jason Krowl
Nov 24 at 23:39
@YuriyS hopefully now it will make more sense
– Jason Krowl
Nov 24 at 23:39
@Ross Millikan Perhaps I need it to 8 significant digits, how can i say that 5 is enough? –
– Jason Krowl
Nov 25 at 12:38
@Ross Millikan Perhaps I need it to 8 significant digits, how can i say that 5 is enough? –
– Jason Krowl
Nov 25 at 12:38
add a comment |
1 Answer
1
active
oldest
votes
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.
Perhaps I need it to 8 significant digits, how can i say that 5 is enough?
– Jason Krowl
Nov 25 at 12:37
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.
– Ross Millikan
Nov 25 at 14:52
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
– Ross Millikan
Nov 25 at 15:29
add a comment |
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
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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.
Perhaps I need it to 8 significant digits, how can i say that 5 is enough?
– Jason Krowl
Nov 25 at 12:37
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.
– Ross Millikan
Nov 25 at 14:52
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
– Ross Millikan
Nov 25 at 15:29
add a comment |
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.
Perhaps I need it to 8 significant digits, how can i say that 5 is enough?
– Jason Krowl
Nov 25 at 12:37
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.
– Ross Millikan
Nov 25 at 14:52
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
– Ross Millikan
Nov 25 at 15:29
add a comment |
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.
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.
edited Nov 25 at 14:47
answered Nov 25 at 6:36
Ross Millikan
290k23196370
290k23196370
Perhaps I need it to 8 significant digits, how can i say that 5 is enough?
– Jason Krowl
Nov 25 at 12:37
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.
– Ross Millikan
Nov 25 at 14:52
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
– Ross Millikan
Nov 25 at 15:29
add a comment |
Perhaps I need it to 8 significant digits, how can i say that 5 is enough?
– Jason Krowl
Nov 25 at 12:37
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.
– Ross Millikan
Nov 25 at 14:52
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
– Ross Millikan
Nov 25 at 15:29
Perhaps I need it to 8 significant digits, how can i say that 5 is enough?
– Jason Krowl
Nov 25 at 12:37
Perhaps I need it to 8 significant digits, how can i say that 5 is enough?
– Jason Krowl
Nov 25 at 12:37
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.
– Ross Millikan
Nov 25 at 14:52
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.
– Ross Millikan
Nov 25 at 14:52
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
– Ross Millikan
Nov 25 at 15:29
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
– Ross Millikan
Nov 25 at 15:29
add a comment |
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.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- 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.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
1
Please structure this post better. And use MathJax to type formulas. So far I can't understand what you described at all
– Yuriy S
Nov 24 at 23:13
@YuriyS hopefully now it will make more sense
– Jason Krowl
Nov 24 at 23:39
@Ross Millikan Perhaps I need it to 8 significant digits, how can i say that 5 is enough? –
– Jason Krowl
Nov 25 at 12:38