Gamma function, SinhIntegral, CoshIntegral
|
11-06-2022, 06:27 PM
Post: #1
|
|||
|
|||
Gamma function, SinhIntegral, CoshIntegral
Hello, I found that the HP PRIME "Gamma" function does not provide the same results as Wolfram's MATHEMATICA. For instance:
HP PRIME --> Gamma (4/5, -6) --> 294.845140024 MATHEMATICA --> Gamma [4/5, -6] --> 238.757-172.621*i. For this reason I have written a program to calculate the Incomplete Gamma function, extending it for numeric values that do not work on the HP PRIME. The code has been named “Upper_Inc_Γ”, which needs two other small programs to work well. One program calculates the value of the integral of the hyperbolic sine (Shi (x)), while the other program calculates the value of the integral of the hyperbolic cosine (Chi (x)). Shi(x) code: Code:
Chi(x) code: Code:
Upper_Inc_Γ(n,x): Code:
It would be nice if xCas implemented the Gamma function - what do you think? Best regards, Roberto. |
|||
11-06-2022, 07:03 PM
Post: #2
|
|||
|
|||
RE: Gamma function, SinhIntegral, CoshIntegral
The Prime answer is the absolute value of the other platform’s answer…
|
|||
11-06-2022, 07:24 PM
Post: #3
|
|||
|
|||
RE: Gamma function, SinhIntegral, CoshIntegral | |||
11-06-2022, 08:45 PM
Post: #4
|
|||
|
|||
RE: Gamma function, SinhIntegral, CoshIntegral
I do not know…
|
|||
11-07-2022, 02:31 PM
Post: #5
|
|||
|
|||
RE: Gamma function, SinhIntegral, CoshIntegral
(11-06-2022 06:27 PM)robmio Wrote: HP PRIME --> Gamma (4/5, -6) --> 294.845140024 Mathematica Gamma, converted to HP Prime Gamma Note: it is not Abs[Gamma[4/5,-6]] ≈ 294.624 Gamma[4/5] + Abs[Gamma[4/5] - Gamma[4/5,-6]] = Gamma[4/5] + (Gamma[4/5] - Gamma[4/5,-6]) / (-1)^(4/5) = 294.845140024 ... HP Prime Gamma, back to Mathematica Gamma: CAS> gamma(a,x) := when(x<0, [Gamma(a),Gamma(a,x)] * [1+(-1)^a,-(-1)^a], Gamma(a,x)) CAS> gamma(4/5,-6.) → 238.757077078-172.62130796*i Quote:I hadn't really noticed: why does HP PRIME return the absolute value? It is just a guess, but some integral result is more elegant. CAS> int(e^x^3) → 1/3*(Gamma(1/3,-x^3) - Gamma(1/3)) CAS> Ans(x=6.) → 5.96393809188e91 Mathematica: ∫(e^x^3) = -(x Γ(1/3, -x^3))/(3 (-x^3)^(1/3)) ∫(e^x^3, x=0..6) ≈ (5.964E91 + 0.7733*i) - (-0.4465 + 0.7733*i) ≈ 5.964E91 |
|||
11-07-2022, 03:34 PM
Post: #6
|
|||
|
|||
RE: Gamma function, SinhIntegral, CoshIntegral
(11-07-2022 02:31 PM)Albert Chan Wrote:(11-06-2022 06:27 PM)robmio Wrote: HP PRIME --> Gamma (4/5, -6) --> 294.845140024 Dear Albert, you are right: "xCas" does not return the absolute value of the "Gamma" function: I noticed it too, just before connecting to the forum. I would like you to judge my program for calculating the gamma function. I have not yet implemented the program for calculating the Gamma function with lower bound of integration as a complex number. Best regards, Roberto. Code:
|
|||
11-08-2022, 11:49 AM
Post: #7
|
|||
|
|||
RE: Gamma function, SinhIntegral, CoshIntegral
Good morning everyone,
since I have found that the latest version of my program about the Gamma function does not return a correct result when the arguments are made up of complex numbers, I made a change. For safety, I also attach the program for the integral hyperbolic sine, for the integral hyperbolic cosine, and for the "Pochhammer symbol": Shi(z): Code:
Chi(z): Code:
Pochhammer(a,n): Code:
Upper_Inc_Γ(a,z): Code:
|
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 3 Guest(s)