Besser so:
Delphi-Quellcode:
const
INFIMUM = -100;
MAXIMUM = 1000;
EPSILON = 1E-8;
STEP = 1E-4;
function F(x: Double): Double;
var
r: Double;
begin
r := 39 / 25 * x * x - 19;
if r < 0
then Result := NaN
else Result := (-8/5) * x + Sqrt(r);
end;
procedure TDemoForm.Button14Click(Sender: TObject);
var
x, y: Double;
begin
x := INFIMUM;
repeat
x := x + STEP;
y := F(x);
until IsNaN(y) or (x > MAXIMUM) or IsZero(y - Round(y), EPSILON);
if IsNaN(y)
then ShowMessage('rats')
else ShowMessage(Format('x = %0.4f y = %.4f', [x, y]));
end;
Analysiere die Unterschiede.