-
Notifications
You must be signed in to change notification settings - Fork 100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding jinc function #266
Adding jinc function #266
Conversation
Error for 1.3:
|
Codecov Report
@@ Coverage Diff @@
## master #266 +/- ##
==========================================
+ Coverage 87.59% 87.68% +0.08%
==========================================
Files 11 11
Lines 2508 2526 +18
==========================================
+ Hits 2197 2215 +18
Misses 311 311
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
|
I could track down the problem Mathematica: BesselJ[1, 1.8`200] Julia: besselj1(big(1.8)) Outputs:
What should we do? |
Maybe not good style, but the test cases I pushed fail. I'm not sure what's going on but the problem is probably somewhere in Does someone know why Mathematica (and some webpages) show different results and is it expected? |
You want julia> besselj1(big"1.8")
0.5815169517311651834700847971561908356665362732844824171862452899216979041922363 which matches your Mathematica result. The problem is that julia> big(1.8)
1.8000000000000000444089209850062616169452667236328125 That is because |
Sorry to bother. Your hint fixed many cases, but not all. julia> res2 = big"1.971105539196620210542904558564976891448851717386016064466205835417372529649732623778146798009632930245313240967710133352055225553347549825667896762467087506209685330050397030027682762563950964962993e11" - big"5.89917589196246805438832769814196828580119495400655210987269285701113079909408122244782544425726443894463237062342568390611353700647229983489787030738912900107228049806443988000825445873073676204e6"*1im
1.971105539196620210542904558564976891448851717386016064466205835417372529649727e+11 - 5.899175891962468054388327698141968285801194954006552109872692857011130799094111e+06im
julia> Complex{Float64}(res2)
1.9711055391966202e11 - 5.899175891962468e6im
julia> x2 = big"0.00001" + big"10"*1im
9.99999999999999999999999999999999999999999999999999999999999999999999999999994e-06 + 10.0im
julia> jinc(Complex{Float64}(x2))
1.9711055391966183e11 - 5.899175891974533e6im However, the result still mismatches. Any further idea? Again, Mathematica vs julia for besselj1: BesselJ[1, 0.00001`200 + I*10.0`200]
0.02548617798056962930423261011063522051286601522259212166836850560273\
5224000250169633431820066537728081112783926189116335069422934386705411\
0177843126480606543290913529010319815371330493594661136321 +
2670.9883035791128339955440167296286794317890303094196461232014839508\
3287658223018716591008155410056811500340138735313841171781910267075143\
88244430315094098180814058360987122761051848662031490035143561 I julia> besselj1(Complex{Float64}(x2))
0.025486177980733188 + 2670.988303579112im |
Because the error in the real part by itself is |
Ok, got that. I relaxed \cong for complex number to check for abs accuracy if real and imag accuracy fails. |
No, please don't do that! Please revert this change. In cases where the stronger accuracy condition holds, we want to ensure that it continues to hold! Only change the tests for the cases that don't currently support this level of accuracy. In that case, you don't need a new operator at all — you can just use @test z ≈ z₀ rtol=1e-13 |
Hey,
we already discussed a bit in #264 about adding a
jinc
function.We decided on the following convention, which is similar to
sinc
in terms of the peak height and argument scaling:I wanted to use
fastabs
which is only available in the current master of julia. This is why I copied the definition to the if statement.I would be happy to receive some feedback!
Thanks,
Felix
(Closes #264.)