Question: How do I create a function using define_external?

Hi! I have an external library with this function: double test(double x) { return sin(x); } In Maple I am doing this: test := define_external('test', x::(float[8]), RETURN::(float[8]), LIB = "Test.dylib"); f := x->test(x); Now when I call f(2) for example, I get 0.909297426825681710 back. But if I try this: plot(f(y), y = 0 .. 2); I get this error message: Error, (in f) invalid input: test expects its 1st argument, x, to be of type numeric, but received y I think I need to somehow convert the (possible) symbolic input of f into a float[8] before it is passed to the procedure test, but I can't figure it out. Any help appreciated, thanks!
Please Wait...