Post Reply 
HP42s first major program (Double Integral) Best way to approach?
06-15-2020, 12:25 AM
Post: #59
RE: HP42s first major program (Double Integral) Best way to approach?
(05-27-2020 08:27 PM)DM48 Wrote:  I am looking to make this the fastest calculation possible with at least five, preferably six decimals.

Previous post HV1(m), if you plot it (m = 0 to 1), it look like a straight line, HV1 ≈ 2/3*m

Using a trick I learned earlier, for asinc(x), using Mathematica:

In[1]:= <<Calculus`Pade`
In[2]:= hv1[m_] := ((m+1) EllipticE[m] + (m-1) EllipticK[m]) / 3
In[3]:= EconomizedRationalApproximation[hv1[m]/m, {m,{0,0.75},2,2}]

Results coded in Lua, for m ≤ 0.7, this get about 6 digits accuracy.
Code:
function hv1(m)
    local num = (m-5.375879977642193) * (m-1.7259819956617186)
    local den = (m-12.968817144843689) * (m-1.7752730551508353)
    return 1.948810875414419 * m * num / den
end

Adding back dimensions to test the result:

lua> function hv(d,D) return D^3 * hv1((d/D)^2) end
lua> v2 = hv(24, 58)
lua> v1 = hv(24, 48)
lua> print(v2, v1, v2-v1)
25664.275659138966       21013.02544172724       4651.250217411725

For reference, this is EKmc HV version

Free42: 48 Enter 58 Enter 24 XEQ "HV" -

   25664.27923311925502790987133042097
− 21013.03279650214793028432717211253
=   4651.24643661710709762554415830844
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: HP42s first major program (Double Integral) Best way to approach? - Albert Chan - 06-15-2020 12:25 AM



User(s) browsing this thread: 1 Guest(s)