Question: Generate and function constuct with it

Helllo folkx :)

What is wrong in my functions f and g ?

I don't catch the point.

Thanks.

JM--

interface(version);
    Standard Worksheet Interface, Maple 2025.2, Windows 11, 

       November 11 2025 Build ID 1971053


with(RandomTools);
[AddFlavor, BlumBlumShub, Generate, GenerateSimilar, 

  GenerateSimilarODE, GetFlavor, GetFlavors, GetState, HasFlavor, 

  LinearCongruence, MersenneTwister, QuadraticCongruence, 

  RandomExpand, RemoveFlavor, SetState]

 


Generate(float);
                            0.983797

Generate(float(range = 2.532000 .. 7.723000, digits = 4));
                             2.537

f := x -> Generate(float(range = 0 .. 100));
f := proc (x) options operator, arrow; RandomTools:-Generate(flo\

  at(range = 0 .. 100)) end proc

 

f(30);
                            94.3141

f(0.200000);
                            23.9622

f(0.000000);
                            63.1512

randomize();
                         2413841372727

f(30);
                            86.2657

plot(f(x), x = 1 .. 100.000000);

plots[listplot](sort([seq(Generate(float(range = 0.032100 .. 162.000000, digits = 3)), i = 1 .. 20)]));

plots[listplot](sort([seq(Generate(float(range = 0.032100 .. 162.000000, digits = 3, method = uniform)), i = 1 .. 20)]));

g := ((x -> Generate(float(range = 0 .. x))) assuming (x*float and 0 < x));
g := proc (x) options operator, arrow; RandomTools:-Generate(flo\

  at(range = 0 .. x)) end proc


plot(g(x), x = 1 .. 50);
Error, (in RandomTools:-Generate) invalid input: unknown expects value for keyword parameter range to be of type numeric .. numeric, but received 0 .. x
NULL;

 

Please Wait...