Calculating Hyperbolic Sin faster than using a standard power seriesIs there a way to get trig functions...
Pure Functions: Does "No Side Effects" Imply "Always Same Output, Given Same Input"?
Inverse of the covariance matrix of a multivariate normal distribution
I encountered my boss during an on-site interview at another company. Should I bring it up when seeing him next time?
Can throughput exceed the bandwidth of a network
Why are special aircraft used for the carriers in the United States Navy?
The need of reserving one's ability in job interviews
Borrowing Characters
What is better: yes / no radio, or simple checkbox?
Real life puzzle: Unknown alphabet or shorthand
Test pad's ESD protection
Non-Italian European mafias in USA?
What are the issues with an additional (limited) concentration slot instead of Bladesong?
Is there a math equivalent to the conditional ternary operator?
What should the omniscient narrator call a character?
Are there any other Chaos-worshipping races?
What happened to QGIS 2.x LTR?
Reason why dimensional travelling would be restricted
How to substitute values from a list into a function?
Giving a talk in my old university, how prominently should I tell students my salary?
Book about a time-travel war fought by computers
Can we carry rice to Japan?
Is the withholding of funding notice allowed?
Difference between 'stomach' and 'uterus'
How can I be pwned if I'm not registered on the compromised site?
Calculating Hyperbolic Sin faster than using a standard power series
Is there a way to get trig functions without a calculator?Broken Calculator: only certain unary functions work.How do we define $sin(theta)$ or $cos(theta)$Help with Trigonometric FunctionsHow would Taylor Series work?Understanding power series and their representation of functionsSeries Convergence of $sumlimits_{n=1}^{infty} frac{cos(npi/3)}{n!}$ by Ratio TestOrthogonal Function Dirac Delta SeriesHow do calculators calculate the value of trigonometric functions?How to calculate a “rational” sine/cosine to specific digits of precision?Calculating trig functions faster than with standard power series
$begingroup$
Using $$ sinh x = x + tfrac{x^3}{3!}+ tfrac{x^5}{5!} + tfrac{x^7}{7!}+ cdots$$ as the Standard Power Series. This series takes a very long time to run. Can it be written without using the exponentials divided by a huge factorial. The example functions in Is there a way to get trig functions without a calculator? using the "Tailored Taylor" series representation for sin and cosine are very fast and give the same answers. I want to use it within my calculator program.
Thank you very much.
sequences-and-series trigonometry
New contributor
$endgroup$
add a comment |
$begingroup$
Using $$ sinh x = x + tfrac{x^3}{3!}+ tfrac{x^5}{5!} + tfrac{x^7}{7!}+ cdots$$ as the Standard Power Series. This series takes a very long time to run. Can it be written without using the exponentials divided by a huge factorial. The example functions in Is there a way to get trig functions without a calculator? using the "Tailored Taylor" series representation for sin and cosine are very fast and give the same answers. I want to use it within my calculator program.
Thank you very much.
sequences-and-series trigonometry
New contributor
$endgroup$
add a comment |
$begingroup$
Using $$ sinh x = x + tfrac{x^3}{3!}+ tfrac{x^5}{5!} + tfrac{x^7}{7!}+ cdots$$ as the Standard Power Series. This series takes a very long time to run. Can it be written without using the exponentials divided by a huge factorial. The example functions in Is there a way to get trig functions without a calculator? using the "Tailored Taylor" series representation for sin and cosine are very fast and give the same answers. I want to use it within my calculator program.
Thank you very much.
sequences-and-series trigonometry
New contributor
$endgroup$
Using $$ sinh x = x + tfrac{x^3}{3!}+ tfrac{x^5}{5!} + tfrac{x^7}{7!}+ cdots$$ as the Standard Power Series. This series takes a very long time to run. Can it be written without using the exponentials divided by a huge factorial. The example functions in Is there a way to get trig functions without a calculator? using the "Tailored Taylor" series representation for sin and cosine are very fast and give the same answers. I want to use it within my calculator program.
Thank you very much.
sequences-and-series trigonometry
sequences-and-series trigonometry
New contributor
New contributor
edited 2 hours ago
MPW
30.5k12157
30.5k12157
New contributor
asked 3 hours ago
Bill BollingerBill Bollinger
312
312
New contributor
New contributor
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
$begingroup$
Note that $$sinh x=frac{e^x-e^{-x}}2$$
So all you need is a fast way to calculate the exponential $e^x$. You can use the regular Taylor series, but that's slow. So you can use the definition $$e^x=lim_{ntoinfty}left(1+frac xnright)^n$$
For calculation purposes, use $n$ as a power of $2$, $n=2^k$. You calculate first $y=1+frac x{2^k}$, then you repeat the $y=ycdot y$ operation $k$ times. I've got the idea about calculating the fast exponential from this article.
$endgroup$
add a comment |
$begingroup$
Let me consider the problem from a computing point of view assumin that you do not know how to compute $e^x$.
The infinite series is
$$sinh(x)=sum_{n=0}^infty frac{x^{2n+1}}{(2n+1)!}$$ If you compute each term independently of the other, for sure, it is expensive since you have to compute each power of $x$ as well as each factorial.
But suppose that you write instead
$$sinh(x)=sum_{n=0}^infty T_n qquad text{where} qquad T_n=frac{x^{2n+1}}{(2n+1)!}qquad text{and} qquad T_0=x$$ then
$$T_{n+1}= frac {t,, T_n}{(2n+2)(2n+3)}qquad text{where} qquad t=x^2$$ This would be much less expensive in terms of basic operations.
You could use the same trick for most functions expressed as infinite series.
$endgroup$
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
});
}
});
Bill Bollinger is a new contributor. Be nice, and check out our Code of Conduct.
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%2f3137004%2fcalculating-hyperbolic-sin-faster-than-using-a-standard-power-series%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
Note that $$sinh x=frac{e^x-e^{-x}}2$$
So all you need is a fast way to calculate the exponential $e^x$. You can use the regular Taylor series, but that's slow. So you can use the definition $$e^x=lim_{ntoinfty}left(1+frac xnright)^n$$
For calculation purposes, use $n$ as a power of $2$, $n=2^k$. You calculate first $y=1+frac x{2^k}$, then you repeat the $y=ycdot y$ operation $k$ times. I've got the idea about calculating the fast exponential from this article.
$endgroup$
add a comment |
$begingroup$
Note that $$sinh x=frac{e^x-e^{-x}}2$$
So all you need is a fast way to calculate the exponential $e^x$. You can use the regular Taylor series, but that's slow. So you can use the definition $$e^x=lim_{ntoinfty}left(1+frac xnright)^n$$
For calculation purposes, use $n$ as a power of $2$, $n=2^k$. You calculate first $y=1+frac x{2^k}$, then you repeat the $y=ycdot y$ operation $k$ times. I've got the idea about calculating the fast exponential from this article.
$endgroup$
add a comment |
$begingroup$
Note that $$sinh x=frac{e^x-e^{-x}}2$$
So all you need is a fast way to calculate the exponential $e^x$. You can use the regular Taylor series, but that's slow. So you can use the definition $$e^x=lim_{ntoinfty}left(1+frac xnright)^n$$
For calculation purposes, use $n$ as a power of $2$, $n=2^k$. You calculate first $y=1+frac x{2^k}$, then you repeat the $y=ycdot y$ operation $k$ times. I've got the idea about calculating the fast exponential from this article.
$endgroup$
Note that $$sinh x=frac{e^x-e^{-x}}2$$
So all you need is a fast way to calculate the exponential $e^x$. You can use the regular Taylor series, but that's slow. So you can use the definition $$e^x=lim_{ntoinfty}left(1+frac xnright)^n$$
For calculation purposes, use $n$ as a power of $2$, $n=2^k$. You calculate first $y=1+frac x{2^k}$, then you repeat the $y=ycdot y$ operation $k$ times. I've got the idea about calculating the fast exponential from this article.
answered 2 hours ago
AndreiAndrei
12.7k21128
12.7k21128
add a comment |
add a comment |
$begingroup$
Let me consider the problem from a computing point of view assumin that you do not know how to compute $e^x$.
The infinite series is
$$sinh(x)=sum_{n=0}^infty frac{x^{2n+1}}{(2n+1)!}$$ If you compute each term independently of the other, for sure, it is expensive since you have to compute each power of $x$ as well as each factorial.
But suppose that you write instead
$$sinh(x)=sum_{n=0}^infty T_n qquad text{where} qquad T_n=frac{x^{2n+1}}{(2n+1)!}qquad text{and} qquad T_0=x$$ then
$$T_{n+1}= frac {t,, T_n}{(2n+2)(2n+3)}qquad text{where} qquad t=x^2$$ This would be much less expensive in terms of basic operations.
You could use the same trick for most functions expressed as infinite series.
$endgroup$
add a comment |
$begingroup$
Let me consider the problem from a computing point of view assumin that you do not know how to compute $e^x$.
The infinite series is
$$sinh(x)=sum_{n=0}^infty frac{x^{2n+1}}{(2n+1)!}$$ If you compute each term independently of the other, for sure, it is expensive since you have to compute each power of $x$ as well as each factorial.
But suppose that you write instead
$$sinh(x)=sum_{n=0}^infty T_n qquad text{where} qquad T_n=frac{x^{2n+1}}{(2n+1)!}qquad text{and} qquad T_0=x$$ then
$$T_{n+1}= frac {t,, T_n}{(2n+2)(2n+3)}qquad text{where} qquad t=x^2$$ This would be much less expensive in terms of basic operations.
You could use the same trick for most functions expressed as infinite series.
$endgroup$
add a comment |
$begingroup$
Let me consider the problem from a computing point of view assumin that you do not know how to compute $e^x$.
The infinite series is
$$sinh(x)=sum_{n=0}^infty frac{x^{2n+1}}{(2n+1)!}$$ If you compute each term independently of the other, for sure, it is expensive since you have to compute each power of $x$ as well as each factorial.
But suppose that you write instead
$$sinh(x)=sum_{n=0}^infty T_n qquad text{where} qquad T_n=frac{x^{2n+1}}{(2n+1)!}qquad text{and} qquad T_0=x$$ then
$$T_{n+1}= frac {t,, T_n}{(2n+2)(2n+3)}qquad text{where} qquad t=x^2$$ This would be much less expensive in terms of basic operations.
You could use the same trick for most functions expressed as infinite series.
$endgroup$
Let me consider the problem from a computing point of view assumin that you do not know how to compute $e^x$.
The infinite series is
$$sinh(x)=sum_{n=0}^infty frac{x^{2n+1}}{(2n+1)!}$$ If you compute each term independently of the other, for sure, it is expensive since you have to compute each power of $x$ as well as each factorial.
But suppose that you write instead
$$sinh(x)=sum_{n=0}^infty T_n qquad text{where} qquad T_n=frac{x^{2n+1}}{(2n+1)!}qquad text{and} qquad T_0=x$$ then
$$T_{n+1}= frac {t,, T_n}{(2n+2)(2n+3)}qquad text{where} qquad t=x^2$$ This would be much less expensive in terms of basic operations.
You could use the same trick for most functions expressed as infinite series.
answered 20 mins ago
Claude LeiboviciClaude Leibovici
123k1157135
123k1157135
add a comment |
add a comment |
Bill Bollinger is a new contributor. Be nice, and check out our Code of Conduct.
Bill Bollinger is a new contributor. Be nice, and check out our Code of Conduct.
Bill Bollinger is a new contributor. Be nice, and check out our Code of Conduct.
Bill Bollinger is a new contributor. Be nice, and check out our Code of Conduct.
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.
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%2f3137004%2fcalculating-hyperbolic-sin-faster-than-using-a-standard-power-series%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