I believe pi is a hardcoded constant for floating point contexts.

A quick look at the source finds, in j.h:
#define PI              ((D)3.14159265358979323846)

It's an algorithm for expressions like

   <.@o. 100000000000000000000000x
314159265358979323846264

But http://www.jsoftware.com/help/dictionary/special.htm does not
describe the algorithm used.  But a quick investigation suggests that
the algorithm used here is described at
http://www.jsoftware.com/jwiki/Essays/Chudnovsky%20Algorithm

I hope this helps.

-- 
Raul

On Thu, May 30, 2013 at 8:34 AM, Robert Herman <[email protected]> wrote:
> Yes, different tools do make you see the same problem from different
> angles. I am trying to repeat my exercises in J also in Mathematica and
> vice-versa. Some colleagues are saying I should learn F#, however, I find J
> to be more mind-opening in the sense that I have dabbled with some
> functional languages and you can do functional in J too.
> My speed question is not simply a general benchmark question. I am curious
> on how things work beneath the IDE and the J scripts. For instance, how pi
> or 'o. 1' is implemented. Is it calling a C routine that uses a standard
> way of calculating pi? Or Sin (1 o. 1r3p1 = 0.866)? I am not a HFT looking
> to shave calculation times by milliseconds (nanoseconds?), but when I
> dabbled with the programming language Oz, some calculations took minutes!
> Thanks again.
>
> Rob
>
>
> On Wed, May 29, 2013 at 8:34 PM, Raul Miller <[email protected]> wrote:
>
>> I do not fully understand your questions, but if I were learning math,
>> I would try to keep using both tools.
>>
>> The issues, in my mind include perspective (different tools reveal
>> different aspects of issues) and accessibility (when you are learning
>> you will need to draw as many useful connections as you can).
>>
>> Put differently, on the one hand you have limited time to figure
>> things out and it takes time to express things in multiple ways, but
>> on the other hand it's the process of figuring out how to express
>> things in different ways that constitutes learning maths.
>>
>> That said, J doesn't inherently use libraries (other than the standard
>> C libraries) but can use things like LAPACK.  It's not LAPACK support
>> is built into J but that the interpreter allows you to reference
>> arbitrary shared libraries (or DLLs on windows).  [So, for example,
>> it's possible to have a J script which includes compiled C, finds and
>> runs a C compiler on it [assuming one is available], then links to the
>> result. This isn't implementation pattern particularly common though,
>> because using external libraries means that they can crash and take
>> down your J session with it. It's also possible to run such libraries
>> in an external program, of course - including a copy of your J
>> session.]
>>
>> Meanwhile, for speed... it is very difficult to make generally valid
>> statements here. Expect some things to be faster on one system and
>> others to be faster on another. Expect also that choices you make will
>> have disproportionate influences on speed.
>>
>> --
>> Raul
>>
>> On Wed, May 29, 2013 at 1:39 AM, Robert Herman <[email protected]>
>> wrote:
>> > I am trying to evaluate J for doing mathematics vs. Mathematica. I own
>> the
>> > Home edition of Mathematica. At the moment, I am trying to teach myself
>> > higher maths with an eye towards completing my maths degree online. I
>> never
>> > finished my degree many moons ago. I like the notebook structure and
>> > multi-paradigm approach in Mathematica, but I am gravitating towards J's
>> > succinctness and analogy to learning it's symbols akin to mathematics'
>> > symbols. Iverson's 'Notation as a Tool of Thought' really grabbed me. My
>> > latest curiosity about J, if I understand it correctly, is that J is
>> > provided as an executable for several platforms. That it was written in
>> C.
>> > Now, does it implement standard c maths libraries optimized for speed and
>> > accuracy? How does the linux version compare to Mathematica in terms of
>> > doing certain operations, say large arrays, for signal processing, from a
>> > time and numerical accuracy index? Where can I find a listing of the
>> > libraries it uses, in the source headers? Thank you.
>> >
>> > Rob
>> > ----------------------------------------------------------------------
>> > For information about J forums see http://www.jsoftware.com/forums.htm
>> ----------------------------------------------------------------------
>> For information about J forums see http://www.jsoftware.com/forums.htm
>>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to