%Testfunktionen f\"ur Remez-Algorithmus
%Fall 1: Glockenkurve exp(-x^2), x in [0,1],
%Fall 2: Bessel J_1, x in [0,7],
%Fall 3: xsin(1/x), x in [0.05,1]: 6 Nullstellen: 0.3183, 0.1592, 0.1061,
%                                                 0.0796, 0.0637, 0.0531.
%Fall 4: sin x, x in [0,pi/4],
%Fall 5: tan x, x in [0,pi/4],
%Fall 6: gamma x, x in [1,2].
%Weitere Funktinen k\"onnen hier leicht eingebaut werden.
%Aufruf:              [y,a,b]=remeztestf(j,x)
%Neben dem Funktionswert y erh\"alt man auch den Definitionsbereich [a,b].
%Das ist f\"ur die Berechnung der Anfangsknoten wichtig.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%MATLAB-Programm, Gerhard Opfer, Approximation, SS 1995, s. remez.info 
%leicht modifiziert Juni 1998, f\"ur "Numerische Mathematik f\"ur Anf\"anger"
%Wieder hervorgeholt für Approximation SS 1999 und SS 2000
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [y,a,b]=remeztestf(j,x)
if 1<=j & j<=6
  if j==1
    y=exp(-x.^2);
    a=0;b=1;
  end; %if j=1
  if j==2
    y=bessel(1,x);
    a=0;b=7; 
  end; %if j=2
  if j==3
    y=x.*sin(1./x);
    a=0.05;b=1;
  end; %if j=3
  if j==4
    y=sin(pi/4*x);
    a=0;b=1;
  end; %if j=4
  if j==5
    y=tan(pi/4*x);
    a=0;b=1;
  end; %if j=5
  if j==6
    y=gamma(x);
    a=1;b=2;
  end; %if j=6
else, disp(['Keine Testfunktion definiert f\"ur j=',num2str(j)]);
end; %globales if
return;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
