Axel Vogt

5936 Reputation

20 Badges

20 years, 247 days
Munich, Bavaria, Germany

MaplePrimes Activity


These are questions asked by Axel Vogt

Working in usual programming languages there is a largest machine epsilon
with 1 + epsilon != 1.

Now I am working with floats in Maple and want something similar: given a
real constant x (as positive floating point number) and m:=floor(log10(x))
(= ilog10(x) scales the x (down or up) to be of size 1). 

My question is:

Does the following always evaluate to "true"

  x + epsilon = x; evalf(eval(%, epsilon= 1/10^(Digits-m)));

and to "false" if taking m+1 instead?


Sorry, stupidly can not find the answer in the docu ...
Usually I work with classical interface, but the java interface has some nice features which I want to use for printing. Thus I open my *.mws worksheet as a *.mw and want to do just that. However I have some problems, may be I am just too awkward here: 1. My mws output is 2 D and always non-italic, however in mw it tasteless shows up as italic. I tried to change that, but there exists no way just to say it to the character (one only can activate a check box to *make* it italic, not conversely). The only way was to select all the sheet and then de-activate italic through the menu bar.
I want to use Compiler:-Compile for a function with a numerical vector v:= [1.0,2.0,3.0,4.0]; as initialized variable. The help refers to CodeGeneration/Details where it says: "The CodeGeneration functions can analyze some rtable type declarations and constructors within procedures. Data types, dimensions and ranges are recognized, but most options are ignored. The only initializer accepted is a list. Dimensions and ranges must have integer values ..." I did:
foo:=proc(x::float)
local v::Vector(1..4,datatype=float[8], order= Fortran_order);
v:= [1.0,2.0,3.0,4.0];
return x*v[1];
I have a sheet in Maple 10 which I want to re-run in Maple 11. It contains a very lengthy (piecewise defined) function f(m) to be integrated over the Reals (numerical) and dito for exp(m)*f(m). The results are certainly ~ 1. In M10 this caused problems which can be overcome using method= _NCRule (I got the advice here ...) in both the cases, the result came up fast. In M11 I killed the execution, it needs to long. While integrating f(m) can be done by the NAG routines, that does not work for exp(m)*f(m). Certainly I could split up at the breaks for piecewise - but can somebody explain *why* it 'fails' now? And: no, I do not want to split up manually.
For testing an external routine against Maple I have something like

  Gamma_mpl:=define_external(
    'Gamma_mpl',
    'C',
    'Z'::ARRAY(1..n,datatype=float[8]),
    'result'::ARRAY(1..n,datatype=float[8]),
    LIB=theDLL);

where the function in the DLL (compiled with Dev-C++) is like

  extern "C" __declspec( dllexport ) __stdcall 
  void Gamma_mpl(double *Z, double *R){ ... some code  ...}

It takes the input in Z and updates values in R.

The following works as expected:

  z:= -1.1 + 2.1*I*0:
  # provide memory
  Z:=Array(1..2, order= Fortran_order, datatype= float[8]):
First 7 8 9 10 11 12 Page 9 of 12