0 Members and 3 Guests are viewing this topic.
:ClrHome:Input Str1:For(I,1,length(Str1:sub(Str1,I,1→Str0:If inString("=≠>≥<≤",Str0:Then:I→A:length(Str1→I:End:End:sub(Str1,1,A-1→Y1:sub(Str1,A+1,length(Str1)-A→Y2:"Y1-Y2→Y3:solve(Y3,X,1,{‾300,300→A:nDeriv(Y3,X,A+E‾3→E:Output(4,3,A:4→I:Disp ":Goto 4:Lbl 1:solve(Y3/(X-A),X,{‾2,2},{‾E3,E3→B:nDeriv(Y3,X,B+E‾3→E:Output(5,3,B:Goto 4:Lbl 2:solve(Y3/(X-A)/(X-B),X,{‾E2,E2},{‾E3,E3→C:nDeriv(Y3,X,C+E‾3→E:Output(6,3,C:Goto 4:Lbl 3:solve(Y3/(X-A)/(X-B)/(X-C),X,0,{‾E3,E3→D:nDeriv(Y3,X,D+E‾3→E:Output(7,3,D:Lbl 4:Disp ":Output(I,1,"X:Output(I,2,"=:If Str0="≠:Output(I,2,"≠:If Str0=">" or Str0="<:Then:Output(I,2,">:If E<0 and Str0=">" or E>0 and Str0="<:Output(I,2,"<:End:If Str0="≥" or Str0="≤:Then:Output(I,2,"≥:If E<0 and Str0="≥" or E>0 and Str0="≤:Output(I,2,"≤:End:I+1→I:If I=5:Goto 1:If I=6:Goto 2:If I=7:Goto 3:Pause :"
When you study how this program works, you can see that it always searches for 4 solutions to any equation, and gives the error if there is less than 4 solutions...