Re: [fricas-devel] Interfacing C functions (with SBCL)

2021-04-16 Thread Waldek Hebisch
On Mon, Apr 12, 2021 at 06:03:34PM -0700, Tobias Neumann wrote: > I've noticed that FriCAS doesn't have a numerical implementation of > polylog's yet. I wonder what do you need. I have partial multiple precision implementation, which does not cover full argument range but seem to work well for

Re: [fricas-devel] Interfacing C functions (with SBCL)

2021-04-13 Thread Kurt Pagani
The problem seems to be known for a long time. It works when "compiled" but not when interpreted. https://bugs.launchpad.net/sbcl/+bug/1731556 https://bugs.launchpad.net/sbcl/+bug/992362 https://bugs.launchpad.net/sbcl/+bug/734259 Note: I added a "(in-package :cl-user)" top in your test.lsp,

Re: [fricas-devel] Interfacing C functions (with SBCL)

2021-04-12 Thread Qian Yun
Hi, I can not answer the first part of the question, about the initial value. But for the second part, because in SPAD, the COMPLEX is represented as Rep := Record(real : R, imag : R) which is essentially a Common Lisp cons pair, so you can do this directly: testfun(xx) == TESTFUN(xx ::

[fricas-devel] Interfacing C functions (with SBCL)

2021-04-12 Thread Tobias Neumann
I've noticed that FriCAS doesn't have a numerical implementation of polylog's yet. So I will have to interface some C/Fortran code. For that I have constructed a small example: test.c: void testfun(double arg, double* realpart, double* imagpart) { *realpart = 1.0 * arg; *imagpart = 3.14