• computer algebra with Forth II

    From mhx@21:1/5 to All on Sat Jan 20 13:17:37 2024
    ( there is a thread about this from 2014 but it went nowhere )

    Symbolic differentiation might be interesting for my circuit
    simulation engine. Is there a Forth package available
    to handle this, or at least be helpful with nuts and bolts
    when implementing something?

    I'd like to avoid having to build a full Lisp or Prolog engine
    first (unless these are completely hands-off / can be kept
    invisible).

    -marcel

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Buzz McCool@21:1/5 to mhx on Fri Jan 26 12:38:13 2024
    On 1/20/2024 5:17 AM, mhx wrote:
    ( there is a thread about this from 2014 but it went nowhere )

    Symbolic differentiation might be interesting for my circuit
    simulation engine. Is there a Forth package available
    to handle this, or at least be helpful with nuts and bolts when
    implementing something?

    Perhaps the book Scientific Forth: A Modern Language for Scientific
    Computing by Julian V. Noble would be a starting point?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Marc Olschok@21:1/5 to All on Fri Jan 26 23:31:41 2024
    On Sat, 20 Jan 2024 14:17:37 mhx wrote:
    ( there is a thread about this from 2014 but it went nowhere )

    Symbolic differentiation might be interesting for my circuit
    simulation engine. Is there a Forth package available
    to handle this, or at least be helpful with nuts and bolts
    when implementing something?

    I'd like to avoid having to build a full Lisp or Prolog engine
    first (unless these are completely hands-off / can be kept
    invisible).

    John Wavrik ( https://math.ucsd.edu/~jwavrik/ ) has used
    Forth for work in algebra. He is probably not active anymore,
    but you might find some useful pointers on his pages
    (also https://math.ucsd.edu/~jwavrik/pub/index.html ).

    --
    M.O.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Ahmed@21:1/5 to All on Sat Jan 27 12:41:27 2024
    Hi,

    By "Symbolic Differentiation", do you mean "Automatic Differentiation"?
    If so you can see the Julia language packages for AD "Automatic Differentiation" based on:
    - dual numbers
    - complex numbers (for precision)

    Bye

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From mhx@21:1/5 to Ahmed on Sat Jan 27 16:36:39 2024
    Ahmed wrote:

    By "Symbolic Differentiation", do you mean "Automatic Differentiation"?
    If so you can see the Julia language packages for AD "Automatic Differentiation" based on:
    - dual numbers
    - complex numbers (for precision)

    Whoa, thanks a lot for this pointer!

    Actually, I was looking for Symbolic differentiation
    ( https://www.cs.utexas.edu/users/novak/asg-symdif.html ).

    I didn't know there is a well-established difference between
    'Symbolic' and 'Automatic' differentiation. A quite lucid
    introduction to AS can be found on Wikipedia (https://en.wikipedia.org/wiki/Automatic_differentiation).

    Instrumenting a compiler to find first order backward differences
    alongside the 'normal' result, using dual numbers, is natural to
    the Forth way of thinking and (appears) trivial to implement.
    It might be much more fundamental to circuit simulation and discrete
    control than I originally thought, and maybe even a breakthrough.

    There might be a relation with past Forth experiments to implement
    'reverse computation' or running programs backwards in time (website
    of Forth UK?). I'll have to review that work.

    Admittedly, I knew about Julia's secret AD weapon, but as it was never
    properly explained what people meant with it, I had come to suspect that
    it was just another hype. There's a JuliaCon in Eindhoven soon that
    I probably should attend.

    -marcel

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From mhx@21:1/5 to Marc Olschok on Sat Jan 27 16:50:39 2024
    Marc Olschok wrote:

    John Wavrik ( https://math.ucsd.edu/~jwavrik/ ) has used
    Forth for work in algebra. He is probably not active anymore,
    but you might find some useful pointers on his pages
    (also https://math.ucsd.edu/~jwavrik/pub/index.html ).

    Thank you. Not really what I was looking for, but I plan to read
    the JOMA paper "Evolution of a Computer Application" (https://mathweb.ucsd.edu/~jwavrik/pub/23_Evolution.pdf),
    eventually.

    -marcel

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Paul Rubin@21:1/5 to mhx on Sat Jan 27 13:41:47 2024
    mhx@iae.nl (mhx) writes:
    (https://en.wikipedia.org/wiki/Automatic_differentiation).

    This is more concise and is where I first heard of the topic:

    http://blog.sigfpe.com/2005/07/automatic-differentiation.html

    It also points to a portal site, https://www.autodiff.org/

    Sigfpe.com is a really cool site and I learned a lot there.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From mhx@21:1/5 to Paul Rubin on Sun Jan 28 08:51:27 2024
    Paul Rubin wrote:

    mhx@iae.nl (mhx) writes:
    (https://en.wikipedia.org/wiki/Automatic_differentiation).

    This is more concise and is where I first heard of the topic:

    http://blog.sigfpe.com/2005/07/automatic-differentiation.html

    It also points to a portal site, https://www.autodiff.org/

    Sigfpe.com is a really cool site and I learned a lot there.

    Both references assume for granted that readers know why one
    would want to symbolically differentiate a computational
    procedure. I see that sigfpe's lost paper
    (search on the Wayback machine for http://homepage.mac.com/sigfpe/paper.pdf) takes very good care of that and he probably didn't want to
    repeat himself on his blog (such people exist :-)

    -marcel

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Paul Rubin@21:1/5 to mhx on Mon Jan 29 15:11:14 2024
    mhx@iae.nl (mhx) writes:
    Both references assume for granted that readers know why one
    would want to symbolically differentiate a computational procedure. I
    see that sigfpe's lost paper (search on the Wayback machine for http://homepage.mac.com/sigfpe/paper.pdf)
    takes very good care of that and he probably didn't want to repeat
    himself on his blog (such people exist :-)

    A url from a blog comment is: http://web.archive.org/web/20120111180418/http://homepage.mac.com/sigfpe/paper.pdf

    I believe that Sussman and Wisdom's book "Structure and Interpretation
    of Classical Mechanics" (which presents a lot of classical mechanics
    formulas as Scheme code) uses this method extensively. But I haven't
    looked at the book much. Maybe someday. The book is online: see
    "External links" at the end of

    https://en.wikipedia.org/wiki/Structure_and_Interpretation_of_Classical_Mechanics

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)