0 Members and 1 Guest are viewing this topic.
: If a≠grau Then: Define f2(x)=((f2(x))/(x-raiz))
Oh, I see. I don't think you can do that, unfortunately. You can always overwrite existing functions though. Don't know if that would help with what you're doing.
In other news, Frey continues kicking unprecedented levels of ass.
You mean the error you got? That's because you're defining a function that calls itself. You can't do that.
Define vieta(number,grade)=Prgm:Local a,root: Disp "The root are:": For a,0,grau,1: If grade=1 Then: root=newton2(number,15): Disp root: Else: If grade=2 Then: newton3(number+a,15,root)→root: Disp root: Else: If grau=3 Then©-----------------------------------------------------------------------©Here is where it's showed as the error when I run the "program": newton4(number+a,15,root)→root©-----------------------------------------------------------------------: Disp root: EndIf: EndIf: EndIf: EndFor:EndPrgm
Define newton4(guess,number,root)=Func:Local new_guess,fn,k,newt©-----------------------------------------------------------------------©Here is the problem....:Define f4(x)=((f3(x))/(x-root))©This line doesn't work at all©-----------------------------------------------------------------------:newt:={guess}:For k,1,number: new_guess:=guess-((f4(guess))/(nDeriv(f4(x),x=guess))): guess:=new_guess: newt:=augment(newt,{new_guess}):EndFor:Return new_guess:EndFunc