Help for generating Jenkins-Traub in Ultra Fractal #12
Replies: 1 comment 3 replies
-
I haven't played with UltraFractal very much but I don't know how well it will do with multiplying and diving polynomials. For example in my function call def shift(P: Poly, H: Poly, s=0):
"""
Shifts a polynomial H by evaluating it at a shift point s using polynomial division.
Parameters
----------
P : Poly
The input polynomial.
H : Poly
The polynomial to be shifted.
s : float, optional
The shift point (default is 0).
Returns
-------
Poly
The shifted H.
"""
Ps = P.eval(s).evalf()
Hs = H.eval(s).evalf()
result, _ = div(H-P*Hs/Ps, x-s)
return result The variables I also don't know if writing something in UltraFractal like I might suggest writing your code to just use arrays of coefficients that you can evaluate with Horner and also to do things like multiplying by a scalar (multiply every coefficient by that value) and also allow for subtracting polynomials (subtract by index and account for if the indexes are different sizes). |
Beta Was this translation helpful? Give feedback.
-
I could really use some of your expertise to help me make this work here:
Beta Was this translation helpful? Give feedback.
All reactions