Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.maple > #1133

Re: Simplify Difficulty

From Axel Vogt <&noreply@axelvogt.de>
Newsgroups comp.soft-sys.math.maple
Subject Re: Simplify Difficulty
Date 2015-05-09 22:38 +0200
Message-ID <cr79ivFs49hU1@mid.individual.net> (permalink)
References <g9ednZAkrPT5wdPInZ2dnUU7-K-dnZ2d@megapath.net>

Show all headers | View raw


On 09.05.2015 21:13, Thomas D. Dean wrote:
> I want to get a simpler expression for a function from C code.
>
> I have the inductance calculations from the National Bureau of Standards, developed by Grover.
>
> I copied the C function to a proc, with some minor edits, such as making variable declarations local, changing = to :=,
> asinh to arcsinh, etc. with evalf, Maple 15 produces the same result as the C code, so my edits were correct.
>
> If I call the proc as
>    rectangle(ht, wd, len, turns)
> I get a very complicated expression, as expected.
>
> I have been attempting, unsuccessfully to simplify this and am about to try manually.  Simple is 10 to 12 terms.
>
> Before I do this, will Maple do it?
>
> Tom Dean
>
> rectangle := proc(a, a1, b, N)...
 > ...
>  end proc;

Not quite sure, what you want (or the proc should do), but for coding:

   with(codegen);

   mpl:=codegen[optimize](rectangle, tryhard):
   'original'=cost(mpl);
   'maple'=cost(rectangle);

   original = 25 storage + 57 assignments + 10 divisions
          + 47 multiplications + 28 additions + 16 functions


   maple = 13 storage + 45 assignments + 21 divisions
          + 38 multiplications + 13 functions + 29 additions

Back to comp.soft-sys.math.maple | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Simplify Difficulty "Thomas D. Dean" <tomdean@speakeasy.org> - 2015-05-09 12:13 -0700
  Re: Simplify Difficulty Axel Vogt <&noreply@axelvogt.de> - 2015-05-09 22:38 +0200
    Re: Simplify Difficulty "Thomas D. Dean" <tomdean@speakeasy.org> - 2015-05-09 15:49 -0700
      Re: Simplify Difficulty Axel Vogt <&noreply@axelvogt.de> - 2015-05-10 13:30 +0200
  Re: Simplify Difficulty Joe Riel <joer@san.rr.com> - 2015-05-10 08:50 -0700
    Re: Simplify Difficulty "Thomas D. Dean" <tomdean@speakeasy.org> - 2015-05-10 17:10 -0700

csiph-web