$Version
(* "13.1.0 for Mac OS X x86 (64-bit) (June 16, 2022)" *)
Clear["Global`*"]
sfact[a_, n_] := Product[(a + k - 1), {k, 1, n}]
Your sfact
is just the function Pochhammer
sfact[a, n] === Pochhammer[a, n]
(* True *)
jacobi[n_, a_, b_, z_] :=
Pochhammer[a + 1, n]/n! Sum[
Pochhammer[-n, k] Pochhammer[1 + n + a + b,
k] (1 - z)^k/(Pochhammer[a + 1, k] k! 2^k), {k, 0, n}]
Your definition for jacobii
is what you get for jacobi
if you use Set
rather than SetDelayed
jacobii[n_, a_, b_, z_] = jacobi[n, a, b, z]
(* (Hypergeometric2F1[-n, 1 + a + b + n, 1 + a, (1 - z)/2] *
Pochhammer[1 + a, n])/n!
The differences that you observed are precision issues
soli1 = NSolveValues[jacobi[15, 8.3, -1.55, z] == 0, z]
(* {-1.00164, -0.990395, -0.946253, -0.877127, -0.780995, -0.662574, -0.524198, \
-0.370001, -0.204121, -0.0311152, 0.144319, 0.317478, 0.483868, 0.639596, \
0.78275} *)
Note that the results for jacobi
change with exact input
soli2 = NSolveValues[jacobi[15, 83/10, -155/100, z] == 0, z]
(* {-1.00223, -0.989436, -0.946852, -0.876792, -0.78114, -0.662525, -0.52421, \
-0.369999, -0.204122, -0.0311152, 0.144319, 0.317478, 0.483868, 0.639596, \
0.78275} *)
Similarly with jacobii
solii1 = NSolveValues[jacobii[15, 8.3, -1.55, z] == 0, z]
(* {-1.00214, -0.989586, -0.946753, -0.876849, -0.781115, -0.662534, -0.524208, \
-0.369999, -0.204121, -0.0311152, 0.144319, 0.317478, 0.483868, 0.639596, \
0.78275} *)
solii2 = NSolveValues[jacobii[15, 83/10, -155/100, z] == 0, z]
(* {-1.00223, -0.989436, -0.946852, -0.876792, -0.78114, -0.662525, -0.52421, \
-0.369999, -0.204122, -0.0311152, 0.144319, 0.317478, 0.483868, 0.639596, \
0.78275} *)
However, comparing the results from both methods using exact input
soli2 - solii2
(* {-9.66565*10^-11, -1.32849*10^-10, 2.83897*10^-11,
1.39112*10^-11, -5.60085*10^-12, 1.06459*10^-12,
3.10862*10^-14, -5.55112*10^-16, 8.32667*10^-17, -6.93889*10^-18, 0.,
1.11022*10^-16, 3.33067*10^-16, -3.33067*10^-16, 2.22045*10^-16} *)
EDIT: The built-in JacobiP
gives equivalent results with exact input.
jacobi[n, a, b, z]/JacobiP[n, a, b, z] ==
jacobii[n, a, b, z]/JacobiP[n, a, b, z] == 1 //
FullSimplify
(* True *)
solP = NSolveValues[JacobiP[15, 83/10, -155/100, z] == 0, z];
solP - solii2
(* {-4.89355*10^-11, -1.84909*10^-10,
3.09808*10^-11, -3.90776*10^-12, -3.9404*10^-12, -6.37379*10^-13,
4.40759*10^-14, -8.88178*10^-16, 5.55112*10^-17, 1.04083*10^-17, 0., 0.,
1.11022*10^-16, -9.99201*10^-16, 5.55112*10^-16} *)
To get better results use FullSimplify
with the exact inputs.
solPfs = NSolveValues[FullSimplify[JacobiP[15, 83/10, -155/100, z]] == 0, z];
solii3 = NSolveValues[FullSimplify[jacobii[15, 83/10, -155/100, z]] == 0, z];
solPfs - solii3
(* {0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.} *)
jacobi[4,2,7,z]
andjacobii[4,2,7,z]
and the built-inJacobiP[4,2,7,z]
to see if, at the symbolic level, your expressions are probably correct. If symbolically everything is good, then welcome to floating point world. For instancez/.NSolve[JacobiP[15,5.3,-0.55,z]==0,z]
andw+1/.NSolve[JacobiP[15,5.3,-0.55,w+1]==0,w]
should be identical in theory but are not. These are polynomials with large coefficients and so on... $\endgroup$