For what it's worth, here's a rough approximation of Euler's constant:

   (% - !@<:) 2^_27
0.5772156715393066

And here's a more exact value:

Euler=: {{
  A=.B=. ^.1r13 1x1
  r=. j=. 0
  whilst. (r=.%/B)~:!.0(r) do.
    B=. B+A=. (j,1)%~+/\.A*169%(1,j)*(j=.j+1)
  end. r
}}0

   Euler
0.5772156649015329

I've not tackled anything in the math/calculus addon.

Thanks,

-- 
Raul

On Tue, Jan 17, 2023 at 2:51 PM Raul Miller <[email protected]> wrote:
>
> In the current jbeta, we have "improved error reporting", and it looks
> like https://code.jsoftware.com/wiki/Vocabulary/ErrorMessages has been
> updated to include some information about this mechanism.
>
> However, this is error reporting on primitives and it could probably
> be extended to support error reporting on library code. But I'm not
> sure if that's more of a documentation issue or an implementation
> issue.
>
> ----------------
>
> My motivation for going here (and, thus, the subject line of this
> email message) was that I was trying to figure out how to compute
> euler's constant. https://en.wikipedia.org/wiki/Euler%27s_constant
>
> The wikipedia page mentioned the digamma function, so I tried:
>
>    require'math/calculus'
>    ! deriv_jcalculus_ 1
>
> Ideally this would have given me a verb, but instead I got a domain
> error which was somewhat opaque given the context. Studying the page
> on J errors shows me that the second line of the error report means
> that this was a synthetic domain error. Conceptually speaking, though,
> this should probably be a nonce error (the math exists to find the
> derivative of the gamma function, but it has not been implemented
> here).
>
> So that gives me three problems:
>
> (1) I still need to figure out how to compute euler's constant, and
>
> (2) I should probably change the error reporting in the math/calculus
> implementation (which, by the way, matches the previous d.
> implementation -- so it's somewhat understandable why it's the way it
> is), and
>
> (3) It seems like the second line of an error report from 13!:8 should
> provide a line from higher up in the stack, since 13!:8 by itself
> isn't particularly meaningful. (Perhaps this should be the topmost
> explicit line which does not contain the invoking 13!:8 unless there
> is no such line?)
>
> For now, I'm just leaving this note here...
>
> FYI,
>
> --
> Raul
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to