Axel Vogt

5821 Reputation

20 Badges

20 years, 358 days
Munich, Bavaria, Germany

MaplePrimes Activity


These are answers submitted by Axel Vogt

I do not have it in Maple, but I have snipped of the part up to the
'milestone 10', which gives the radix and U1, U2 for separating 1
(and to get the largest possible mantissa, that's what I wanted).

Not what you hoped, but probably small enough to get it in Maple without
too much pain (guessing that the Basic version would translate better,
but I do not have such). May be it helps a bit.

At least for evalhf I am sure, that it does not comply with IEEE 754.
As far as simulating compiled versions it would be nice to have such
a variant.

Download 102_separation.zip

a) You can use Wikipedia (or Google) to look up recursion or recursive

b) Hint: you want to look at something like this:



  The methods halfs an interval and depending on a decision you
  apply the method again for one of the halfs (until you stop).
gen:=proc(x0,a,b,M,n)
...
end proc; # this is missing in your code

BTW: if you use the Classical interface you may find to have less troubles starting with Maple,
for example it would have said "Warning, premature end of input", which tells you much more.

invfourier(S,w,t); convert(%, Int); shows the integral and writing
Heaviside as a piecewise function you end up with the following

  Int(1/2*1/Pi*exp(-9/640000000*I*w)/w^2,w = -infinity .. 0);

which does not exist (in 0 it is like int(1/w^2) ).

StripTrailingZeroes:=proc(x) # a real float, 0 < x
 local n,xi, M,E, str_M, str_mu,mu,k,eta;
 
 if not( type(x, float) ) then return 'x' end if;
 
 if x=0 then return 0. end if;
 if x < 0 then return -procname(-x) end if;
 
 M,E:= SFloatMantissa(x),SFloatExponent(x);
 
 str_M:=convert(M, string);
 StringTools:-SubstituteAll(%, "0", " ");
 StringTools:-TrimRight(%);
 str_mu:=StringTools:-SubstituteAll(%, " ", "0");
 mu:=parse(%);
 
 k:=length(str_M)-length(str_mu);
 SFloat(mu,E+k);
end proc;

Example (for which the other proc has problems):

 Digits:=15;
 evalf[5](Pi)*1e-101 +0; 
 x:=-evalf(%/1.0);
 StripTrailingZeroes(x);
                                              -100
                    x := -0.314160000000000 10

                                      -100
                           -0.31416 10

This can be used for expressions as well:

 z := .314160000000000e100*exp(t)-.300000000000000e-100*I;
 subsindets(z,float,StripTrailingZeroes);

                            100                              -100
   z := 0.314160000000000 10    exp(t) - 0.300000000000000 10     I

                           100                -100
                 0.31416 10    exp(t) - 0.3 10     I



 exp(1)*randpoly(t, terms = 3); #evalf[5](%)*10^(Digits);
 evalf[5](%)*10^(-2); 
 z:=%/1.0;
 subsindets(z,float,StripTrailingZeroes);
                          4                     2
  z := -1.30480000000000 t  + 1.44070000000000 t  - 0.761120000000000 t

                           4           2
                  -1.3048 t  + 1.4407 t  - 0.76112 t



 taylor(exp(3*t), t); evalf(%);
 subsindets(%,float,StripTrailingZeroes);
 
                                2                     3
  1. + 3. t + 4.50000000000000 t  + 4.50000000000000 t  +
                          4                     5      6
        3.37500000000000 t  + 2.02500000000000 t  + O(t )


                       2        3          4          5      6
      1. + 3. t + 4.5 t  + 4.5 t  + 3.375 t  + 2.025 t  + O(t )

cosh(z) = 1/2*exp(z)+1/2*exp(-z) which may cause overflow/underflow.

For large arguments the 2nd term contributes almost nothing and if one
wants a small relative error (say working with 14 Digits) one can do:

  Digits:=floor(evalhf(Digits));
                             Digits := 14


  1 - ln(exp(z)/2) / ln(cosh(z)) = HFloat(1,- Digits); 
  fsolve(%, z=10);

                           14.794944520857

Now using rationals instead of floats is what I often prefer

  a:=14.9165/9.81;
  a:=convert(%, rational);

  zx := '2000 - a*ln(cosh(60*x/a))'; evalf(%);

and switching from cosh to exp does it as follows:

  2000 - a*ln(exp(60*x/a)/2);  # instead of cosh 
  zzx:=simplify(%) assuming 0 < x; evalf(%);

  f:= x -> piecewise( x < 14.79, zx, zzx);

  plot( f(x), x=0 ..38);

In mild words I find it astonishing that a company with more than 100 employees including technicians, support admins and a marketing section is not able to organize the current situation (nor able to make decisions).

I could not imagine that our admin would behave like that and is really easy to ask stuff to check the site for 4 hours and then handing over.

Otherwise said: quite a strange culture, at least for me.

Cheers

admin, how about cleaning up the board from spam now and then ...

Not sure whether I posted it already (Maple 12):

  A:=argument(exp(phi*I))+argument(1/exp(I*phi));
  B:=simplify(%);
  eval(B, phi=Pi);
                                 2 Pi
  evalc(B);
                                  0

  evalc(A);
  eval(%, phi=Pi);

                  phi + arctan(-sin(phi), cos(phi))

                                 2 Pi

... just do not use it (guess it is thought for spam only)

Thank you! That problem seems minor, I will care for it later:

  argument(exp(phi*I))=-argument(exp(-I*phi)); eval(%, phi=-Pi);
  map('t -> &discretemod(t, 2*Pi)', %);
  is(%);
                               Pi = -Pi
                              1/2 = 1/2
                                 true

I think you mean "assume(t < 0)"

It silently assumes the integral exists for any (large) s.

guess you need assumptions (like Reals, not zero), here is a lame version
K^(p-1)*L^(-p+1)=(K/L)^(p-1);
lhs(%)/rhs(%); simplify(%, symbolic);
                                  1

You can consider it as set (but you may use sorting):

  A:=<1,2,3,2,4,1,6,3,2,0,0>; # a column Vector
  convert(A, set);            # duplicates will vanish 
  convert(%, list);           # now back to Vectors
  convert(%, Vector[row]);    # I prefer row Vector here
 
                          [0, 1, 2, 3, 4, 6]

I do not quite agree, that one should not impose some effort to new posters.

Maple just makes it too easy:

- no variable question to be answered when typing in an registration
- no individual, additional reply needed for confirming the first account details

And may be the 1st post is going to be 'reviewed' if situations become worse.

I know semi-commercial sites which do *not* accept 'anonymous' domains
such as hotmail, yahoo, gmail etc. Not a bad idea.

 

But one can not avoid such shit completely, sigh.

First 57 58 59 60 61 62 63 Last Page 59 of 92