Hello,

In FriCAS, airyAi has a problem of precision. Here is the output using
DoubleFloat, MathLink (Wolfram engine) with Julia, and Maxima:

(15) -> airyAi 3.7

   (15)  0.0017455720028082336
                                                            Type: DoubleFloat
(16) -> airyAi jWSReal "3.7"

   (16)  0.0017455720006099784
                                                            Type: JuliaWSReal
(17) -> airyBi 3.7

   (17)  47.5607474995892
                                                            Type: DoubleFloat
(18) -> airyBi jWSReal "3.7"

   (18)  47.560747499589446
                                                            Type: JuliaWSReal

In Maxima:
(%i1) airy_ai(3.7);
(%o1)                        0.0017455720006099781
(%i2) airy_bi(3.7);
(%o2)                          47.56074749958946

So as you can see it is not the coercion to DoubleFloat that is to
blame. It seems at first glance that the airyAi computation occurs on
a ~32 bits floating point number. I have not checked. I have another
package that operates also on 64 bits floats that comforts this but
with different function naming schemes, and I plan to uniformize this
right now.

(32) -> )expose JF64SF2
   JuliaFloat64SpecialFunctions2 is now explicitly exposed in frame
      frame0
(32) -> airyai(jf64 3.7)

   (32)  0.001745572000609978
                                                           Type: JuliaFloat64

So my question is, do I fill an issue for this particular special
function, and populate later this issue with other function issues
after I encounter others like this one? Or do I open separate issues?
It is also probable that even if I fill an issue for different
functions tested, I encounter some other later. Frankly I would prefer
not to encounter the airyAy imprecision problem for other functions.
And yes, I know machine floating point numbers are inherently
imprecise to represent real numbers.

I have a test file for the other package on 64 bits floats mentioned
above*, I can modify and use it to have a better view if necessary on
a set of special functions.

- Greg

* I use it to test yet another package, sorry, that operates on high
precision floating point numbers.

(33) -> )expose JFSF2
   JuliaFloatSpecialFunctions2 is now explicitly exposed in frame
      frame0
(33) -> airyai(jfloat "3.7")

   (33)
  0.001745572000609979136759728232445420447338438146589128698021602847417405690
  988777
                                                             Type: JuliaFloat
(34) -> airyAi jWSReal "3.7"

   (34)  0.0017455720006099784
                                                            Type: JuliaWSReal
(35) -> airyAi 3.7

   (35)  0.0017455720028082336
                                                            Type: DoubleFloat

-- 
You received this message because you are subscribed to the Google Groups 
"FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/fricas-devel/CAHnU2dZFdGUGuUfD7RH3xpGuSn%3D0jrhS1wd5KaP0pXi%2BL-TMKg%40mail.gmail.com.

Reply via email to