What I need are the power-series for sinh and cosh that are faster to calculate. For example, here is the standard sin(x) power series: $$\sin x = x - \frac{x^3}{3!} + \frac{x^5}{5!} - \frac{x^7}{7!} + \frac{x^9}{9!} - \cdots $$ And now the modified power series: $$\sin(x)=x\left(1-\frac{x^2}{3 \cdot 2}\left(1-\frac{x^2}{5 \cdot 4}\left(1-\frac{x^2}{7 \cdot 6}\left(\phantom{\frac{}{}}\cdots\right.\right.\right.\right.$$
Also, for example, here is the standard cos(x) power series: $$\cos x =1-\frac{x^2}{2!}+\frac{x^4}{4!}-\frac{x^6}{6!}\cdots $$ And now the modified power series: $$\cos x =1-\frac{x^2}{2\cdot 1}\left(1-\frac{x^2}{4 \cdot 3}\left(1-\frac{x^2}{6 \cdot 5}\left(1-\frac{x^2}{8 \cdot 7}\left(\phantom{\frac{}{}}\cdots\right.\right.\right.\right.$$
The modified power series are much faster to calculate because the denominators are much smaller numbers than the Factorials, after (or about) 15! or the 7th iteration. There is a huge difference in time spent calculating $$\frac{x^7}{7!} $$ and calculating $$ 1-\frac{x^2}{7 \cdot 6}$$ I just wonder why if it can be done for the sin() and cos(), why can't it be done for sinh() and cosh() also. sin() and sinh() do not look that different, and the same for cos() and cosh().
!-------------------------------------------------------------
Below is my original post
I also look at the sinh and cosh
I am using $$\sinh x = x + \tfrac{x^3}{3!}+ \tfrac{x^5}{5!} + \tfrac{x^7}{7!}+ \cdots $$ and $$\cosh x = 1 + \tfrac{x^2}{2!}+ \tfrac{x^4}{4!} + \tfrac{x^6}{6!}+ \cdots $$
And I do get correct results. BUT the results are very slow to produce. Using Is there a way to get trig functions without a calculator? , then to the "Tailored Taylor" section, as my primary example and as the greatest "speed-up" given, then the calculation was very fast. Due to "x**11/11!" (and all other calculations of this type) was exchanged for an easier division calculation. I can not re-work or re-design Infinite Series. I do not have that level of Math. Would or could anybody please show me the way. Thank you very much. Also, using "e" does not help. Thank you.
See also my previous questions (and the answers and comments I've received) in this area:
- Calculating Hyperbolic Sin faster than using a standard power series
- Calculating trig functions faster than with standard power series
[Answering the 1st reply And Yes, there must be a better way to answer, but I don't know that method.] I knew this question was close at hand. I can only give "short answers". I am a computer programmer. I am using a different kind of number system that uses an Integer-array to contain a number, rather than just using one (1) 16 bit to a 64 bit memory place. I do add, subtract, multiply, and divide an array with an integer (array/integer) or another array (array/array). But dividing an array with another array is very slow. I want to divide using only an integer which is much faster. So, I know this sounds very odd but this is the basic "short" reason or answer.
[Answering the 2nd reply] No, no floating, or doubles, or decimals. These types of numbers and the algorithms used to make the calculations, have a degree of inaccuracy. Using only integers, power-series and continued-fractions, then any degree of accuracy or precision can be achieved. Yes this does sound odd, but it is my little project.
[Answering the 3rd reply] I rather not use GNU C library. I believe they use polynomials and tables. Which is fine for 6 to 12 decimals of accuracy. But I rather not. Thank you very much.
[To everybody] So far, this site has been the only site that has provided help to me. I want to Thank everybody for their help. And yes, my spelling and grammar is a little off also. Sorry.
mpfr
? – Daniel Schepler Mar 22 '19 at 22:44