It is happening in numsolve.spad, function "findGenZeros"
that precision is increased by 100.

I think in the attached patch, by reordering the transform
to be after resetting precision, this problem is solved.

- Qian

On 6/3/26 2:11 PM, Grégory Vanuxem wrote:
> Hello,
> 
> Any idea why I obtain a huge numerical precision using complexSolve
> here, at least, displayed?
> 
> (1) -> complexSolve(x^3+3*x^2+x+17=0, 0.0000000001)
> 
>    (1)
>    [x = - 3.8744001380_296332337,
>     x = 0.4372000690_1481618814_9406395091_6108308765_2840423528 -
> 2.0485683086_313182244 %i,
> 
>        x
>      =
>          0.4372000690_1481618814_9406395091_6108308765_2840423528
>        +
>          2.0485683086_3131822439_9819882819_4290399551_391601562 %i
>      ]
>                                                               Type:
> List(Equation(Polynomial(Complex(Float))))
> (2) -> precision()$Float
> 
>    (2)  68
>                                                                        
>                  Type: PositiveInteger
> 
> (3) -> digits()$Float
> 
>    (3)  20
> 
> Regards,
> 
> Greg
> 
> -- 
> You received this message because you are subscribed to the Google
> Groups "FriCAS - computer algebra system" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to [email protected] <mailto:fricas-
> [email protected]>.
> To view this discussion visit https://groups.google.com/d/msgid/fricas-
> devel/CAHnU2dZfeWi0kGYXSMQWzi1m-
> FmT_giYQUqU9qt2rpUMZ%3D9CJg%40mail.gmail.com <https://groups.google.com/
> d/msgid/fricas-devel/CAHnU2dZfeWi0kGYXSMQWzi1m-
> FmT_giYQUqU9qt2rpUMZ%3D9CJg%40mail.gmail.com?
> utm_medium=email&utm_source=footer>.

-- 
You received this message because you are subscribed to the Google Groups 
"FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/fricas-devel/887ce321-5acf-4b62-bc36-6610034a0c21%40gmail.com.
diff --git a/src/algebra/numsolve.spad b/src/algebra/numsolve.spad
index 2400b653..5db6c0f5 100644
--- a/src/algebra/numsolve.spad
+++ b/src/algebra/numsolve.spad
@@ -246,9 +246,9 @@ InnerNumericFloatSolvePackage(K, F, Par) : Cat == Cap where
                nfeps := (1/etol)*nfeps
                lz := innerSolve1(f, neps)
                ok := true
-               sol : L L F := []
+               sol : L L CI := []
                for z in lz while ok repeat
-                   sol1 : L F := [CI_to_F(F_to_CI1(z, feps))]
+                   sol1 : L CI := [F_to_CI1(z, feps)]
                    for pol in rlp for xvar in rest(rlvar) repeat
                        pp := ieval(pol, xvar, zvar, z, nfeps)
                        pp case "failed" =>
@@ -258,11 +258,12 @@ InnerNumericFloatSolvePackage(K, F, Par) : Cat == Cap where
                        width(real(ppi)) > feps or width(imag(ppi)) > feps =>
                            ok := false
                            break
-                       sol1 := cons(CI_to_F(ppi), sol1)
+                       sol1 := cons(ppi, sol1)
                    sol := cons(sol1, sol)
                ok =>
                    bits(obits)
-                   return reverse(sol)
+                   res := [[CI_to_F(x) for x in l] for l in sol]
+                   return reverse!(res)
                etol := etol^2
                ebits := 2*ebits
 

Reply via email to