[CAS problem] High-precision operations in numerical solution equations
|
04-01-2020, 01:03 PM
(This post was last modified: 04-01-2020 01:24 PM by yangyongkang.)
Post: #1
|
|||
|
|||
[CAS problem] High-precision operations in numerical solution equations
Hi everyone, I recently came across an x = tan (x) equation about x. Find x> 0, the solution over the interval [k * pi, (k + 1/2) * pi] (k is a positive integer). It is found that when k is taken large, the error occurs.
Code: subst(tan(x)-x,x=fsolve(tan(x)=x,x=100000.5*pi)) Very large error。 mathematica supports high-precision operations Code: FindRoot[Tan[x] - x, {x, 100000.5*Pi}, WorkingPrecision -> 30] I wrote it in C (dichotomy), compared it, and found that the error increases with increasing k. Code: #include<stdio.h> Contrast with MMA, found this Code: Show[ListPlot @@@ {{#1^2*Sin[#2 - #1] & @@@ Red represents the MMA result, blue represents the C language calculation result, and the accuracy gap is widened. study hard, improve every day |
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
[CAS problem] High-precision operations in numerical solution equations - yangyongkang - 04-01-2020 01:03 PM
RE: [CAS problem] High-precision operations in numerical solution equations - Albert Chan - 04-01-2020, 06:14 PM
RE: [CAS problem] High-precision operations in numerical solution equations - parisse - 04-02-2020, 12:00 PM
RE: [CAS problem] High-precision operations in numerical solution equations - yangyongkang - 04-03-2020, 05:29 AM
|
User(s) browsing this thread: 1 Guest(s)