## 5662 Reputation

18 years, 194 days
Munich, Bavaria, Germany

## pattern matching for function inputs ?...

Maple
`The following works:  u+v*w;   patmatch(%,a::name*b::name +c::name,'p');   p;                                 true                        [a = v, b = w, c = u]`

## 'accessing data' of 3D plot ?...

Maple
```Testing a numerical implementation I want to access data, which are
suggested as maximal errors through plotting (with care) to examine
that in more detail (so plotting is considered just a help)

For univariate functions I am aware how to look into data pairs for
the command plot.

My function is bivariate and real valued.

P:= plot3d( f(x,y), ...) lets me save the result and

op(P);
op(1,P);
arr:=op(3, %);

arr; Arr:=convert(%, Matrix);
plots[matrixplot](Arr, axes=boxed);

```

## modulo, not only for integers...

Maple

Is there a method to work with Reals or Complex modulo Integers (need not
to be modulo a discrete group, circle or torus is fine for me)?

Where the residue class is represented in the unit interval or square (as
the command modp does in the finite case)?

What I have in mind is to modify 'argument' to 'argument modulo 2*Pi', but
mod is for integer cases.

## Working with 'argument'...

Maple
```Especially in old books (but not only there) the authors prefer the notion
of 'argument' ( = polar coordinates and using the angle).

Sometimes it comes to something like

| arg(-z) | < Pi and | arg(1 - z) | < Pi

which I prefer to have in terms of interval notation 'z in ... ' or its
complement  'not (z in .. )'.

I do not even know how to get | arg(z) | < Pi  <==> z is not a negative Real.

How can I do it in Maple?
```

## Compiler:-Compile and complex floats...

Maple
```With Maple 12 the compiler accepts complex complex floats.
However there is some limitation in using compiled results:

# a simple function to be called by another
foo1:=proc(z::complex[8])::complex[8]; return z*I end proc;
foo:=proc(z::complex[8])::complex[8]; return foo1(z); end proc;

Now compile:

cp1:=Compiler:-Compile(foo1);
cp:=Compiler:-Compile(foo);

The first call works, the second gives an error:

Error, (in printtab[CodeGeneration:-Names:-FunctionCall])
```
 2 3 4 5 6 7 8 Last Page 4 of 12
﻿