function [polyrest,taucoeff] = Polyksrestcoeff3(k,s)  % for ZNN methods

% Truncation error order is k + 2 here.
% Seed vector of length s, k <= s needed throughout.

% overall best use with:  (dubious advice ...)
%     (k,s) =  (1,2), (2,4),  (3,5),  (4,5),  and/or  (5,6)

polyrest = []; taucoeff = [];
                          % optimal ranges for h = tau * eta near constant
                          %                        not set yet ...
                       
                          
if k == 1 && s == 2   % second largest root magnitude  0.4472           h                    
  polyrest = [-0.6;-0.2;-0.2];
  taucoeff = 1.6; end
                          
if k == 2 && s == 2  % second largest root magnitude  0.8360           h
  polyrest = [3.808215205198584e-01;-1.168617033577950;-4.156914832110251e-01;
       2.034869962691167e-01]; 
  taucoeff = 2.389539011192650; end    %  ok

if k == 2 && s == 3  % second largest root magnitude  0.5226          h
  polyrest = [1.176689655734125e-01;-8.516604383514612e-01;-3.818277128943235e-01;
        6.773366868988580e-02;4.808551698248645e-02]; 
  taucoeff = 2.219772790140505; end    % ok

if k == 2 && s == 4  % second largest root magnitude  0.4637          h
  polyrest = [-7.325911840449030e-02;-6.340690083336632e-01;-3.531153119650761e-01;
        4.999504148385766e-03;4.272929389028893e-02;1.271464066455492e-02]; 
  taucoeff = 2.090810740934728; end   % ok

if k == 3 && s == 3  % second largest root magnitude  0.8290          h
  polyrest = [7.356287764690319e-01;-1.310212542580311;-9.130279068639379e-01;
         4.241789042054587e-01;1.601227985618904e-01;-9.669002979213243e-02];     
  taucoeff = 2.706690598404911; end  % ok

if k == 3 && s == 4  % second largest root magnitude  0.6397          h
  polyrest = [5.020490554114563e-01;-1.054074297181794;-7.768688386704860e-01;
        1.835959023390256e-01;2.017816085472454e-01;-2.855311728115157e-02;
        -2.793031316429520e-02]; 
  taucoeff = 2.560245298708237; end   %  ok

if k == 3 && s == 5  % second largest root magnitude 0.5816           h
  polyrest = [2.480059771240410e-01;-7.885198366863375e-01;-6.390357837629567e-01;
      4.813679468512866e-03;1.687449854130043e-01;4.118123638757526e-02;
      -2.278552457478595e-02;-1.240473336905329e-02]; 
  taucoeff = 2.394810523248907; end   % ok

if k == 4 && s == 4  % second largest root magnitude 0.8477           h
  polyrest = [1.038159703195576;-1.378825739811979;-1.496966727252006;
      6.334710791603586e-01;5.406390647842177e-01;-3.038823278816560e-01;
      -9.303412726167593e-02;6.043907506716473e-02];
  taucoeff = 2.964332575206227; end   %  ok

if k == 4 && s == 5  % second largest root magnitude 0.7508           h
%   polyrest = [7.141504090527940e-01;-1.070511658359301;-1.128283996208948;
%         1.269168195984023e-01;4.977397465555752e-01;1.811080783514391e-02;
%         -1.773904284095816e-01;-1.184495685920323e-02;3.111325679511826e-02]; 
%   taucoeff = 2.763167380694935; 

  polyrest = [6.643887844445272e-01;-9.273967222211478e-01;-1.299068589620714;...
     1.843924712566855e-01;5.752670764736695e-01;-4.112171440073703e-02;...
    -2.032607397397568e-01;2.599124381423302e-02;2.080818999324064e-02];
  taucoeff = 2.748056965594512;   end   %  ok

if k == 4 && s == 6  % second largest root magnitude 0.7513           h
  polyrest = [1.854040656660873e-01;-4.167064710266586e-01;-1.041699445159904;
        -4.706410159092017e-02;2.125066146101461e-01;2.774435481718890e-01;
        -1.138997269046412e-01;-5.698432164801684e-02;-2.838362875302206e-02;
        2.938346663504090e-02]; 
  taucoeff = 2.448959910091972; end  % ok

if k == 5 && s == 5   % second largest root magnitude 0.9241           h
    polyrest = [1.215386987348222;-1.291056554393765;-2.059796135880188;
        6.095320901394168e-01;1.228581408859198;-4.731170818697435e-01;
       -5.085129829526192e-01;2.285625671433630e-01;1.036480848334800e-01;
       -5.322838322736356e-02];   
    taucoeff = 3.134323027738423; end  % ok

if k == 5 && s == 6  % second largest root magnitude 0.8450           h
  polyrest = [9.789318117566991e-01;-1.091516557617663;-1.693989102837719;
      1.873678566963183e-01;1.016348476940637e+00;-2.991032426368895e-02;
      -4.821578816042506e-01;-2.455350179352843e-02;1.549728822935899e-01;
      7.407813151091853e-03;-2.290147272148661e-02]; 
  taucoeff = 2.988932059446562; end   % ok

if k == 5 && s == 7  % second largest root magnitude 0.8529          h
  polyrest = [9.163297735429142e-01;-1.024354167068672;-1.654636187872638;
      1.566276337562119e-01;9.435980453654198e-01;2.414314319510011e-02;
      -4.440174739171195e-01;-4.428233248795205e-02;1.246731646238272e-01;
      2.121989726029419e-02;-1.543586247760823e-02;-3.865633919776790e-03]; 
  taucoeff = 2.951233120586878; end   %  ok

if isempty(polyrest)
    error('No listed formula for chosen k and s'), end