Can Euler's formula accurately calculate arcsine?

  • Thread starter Thread starter Marie Cury
  • Start date Start date
  • Tags Tags
    Euler Formula
Click For Summary
SUMMARY

The discussion centers on using Euler's formula for arctangent to calculate arcsine values. A participant reports inaccuracies when inputting values close to 1, specifically noting that while 0.9 yields acceptable results, 0.99 and higher values lead to significant errors. Another user demonstrates that by truncating the infinite series at n=13 or n=32, they achieve up to 10 digits of accuracy using a Python program. The convergence of the series is confirmed through iterative calculations.

PREREQUISITES
  • Understanding of infinite series and convergence
  • Familiarity with Euler's formula and its applications
  • Basic knowledge of Python programming for numerical computations
  • Experience with mathematical functions such as arctan and arcsin
NEXT STEPS
  • Explore the convergence properties of infinite series in numerical analysis
  • Learn about the implementation of Taylor series in Python
  • Investigate the limitations of numerical precision in floating-point calculations
  • Study the differences between arctan and arcsin functions in mathematical contexts
USEFUL FOR

Mathematicians, computer scientists, and anyone interested in numerical methods for calculating trigonometric functions accurately.

Marie Cury
Messages
10
Reaction score
0
1. I use Euler formula of arctan to calculate arcsine
2. This equation\arctan x = \frac{x}{1+x^2} \sum_{n=0}^\infty \prod_{k=1}^n \frac{2k x^2}{(2k+1)(1+x^2)}.
If I input 0.9999999999, I will not be able to get the expected result. If input = 0.9 then it is pretty correct, but 0.99 is definitely wrong and more wrong when the decimal digits get higher till uncomputable.
Could someone help me ? :wink:
 
Physics news on Phys.org
2 weeks already and everyone stopped breathing into my thread!
you ignore my post I guess!
 
It sounds like you just need a better calculator, try using Mathematica.
 
It wasn't clear what you were asking. It's an infinite series, so you must be truncating it at some point, and so of course the result is not exact.
 
Marie Cury said:
1. I use Euler formula of arctan to calculate arcsine



2. This equation\arctan x = \frac{x}{1+x^2} \sum_{n=0}^\infty \prod_{k=1}^n \frac{2k x^2}{(2k+1)(1+x^2)}.

If I input 0.9999999999, I will not be able to get the expected result. If input = 0.9 then it is pretty correct, but 0.99 is definitely wrong and more wrong when the decimal digits get higher till uncomputable.
Could someone help me ? :wink:

I don't see what the problem is, I get at least 4 digits correct If I evaluate the sum for n<=13 and 10 digits correct for n<=32. (I don't think n=0 should count).
Because \frac{2k x^2}{(2k+1)(1+x^2)} is smaller than 1/2 for all x, the error must halve for each increase of n.

I used the following python program

Code:
rom math import *

x = 0.9999
limit = 20

sum = 0
for n in range (1, limit):
    prod = 1
    for k in range (1, n):
        prod *= 2*k*x*x/((2*k+1)*(1+x*x))
    sum += prod
    print n, atan(x), sum * x / (1+x*x)


1 0.785348160897 0.4999999975
2 0.785348160897 0.666649995833
3 0.785348160897 0.733303328833
4 0.785348160897 0.761866186262
5 0.785348160897 0.77455952004
6 0.785348160897 0.780328640213
7 0.785348160897 0.782991044782
8 0.785348160897 0.784233375995
9 0.785348160897 0.784817943983
10 0.785348160897 0.785094816918
11 0.785348160897 0.785226647987
12 0.785348160897 0.785289691324
13 0.785348160897 0.785319949099
14 0.785348160897 0.7853345162
15 0.785348160897 0.785341547891
16 0.785348160897 0.785344949982
17 0.785348160897 0.785346599315
18 0.785348160897 0.78534740034
19 0.785348160897 0.785347789989
20 0.785348160897 0.785347979799

Converges nicely as you can see.
 

Similar threads

  • · Replies 17 ·
Replies
17
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 15 ·
Replies
15
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
Replies
10
Views
3K
  • · Replies 11 ·
Replies
11
Views
3K
  • · Replies 14 ·
Replies
14
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K