|
PUBLIC NUMERIC H
!'LET H=1/10^100 !1000桁モード
LET H=1/32768
INPUT PROMPT "X=":X
PRINT F(X)
PRINT DIFF3(X)
PRINT DIFF4(X)
PRINT DIFF5(X)
PRINT DIFF6(X)
PRINT DIFF7(X)
PRINT DIFF8(X)
PRINT DIFF9(X)
PRINT DIFF10(X)
PRINT DIFF11(X)
PRINT DIFF12(X)
PRINT DIFF13(X)
PRINT DIFF14(X)
PRINT DIFF15(X)
PRINT DIFF16(X)
PRINT DIFF17(X)
PRINT DIFF18(X)
PRINT DIFF19(X)
PRINT DIFF20(X)
PRINT DIFF51(X)
PRINT DIFF75(X)
PRINT DIFF101(X)
PRINT DIFF(X,5)
END
EXTERNAL FUNCTION F(X)
LET F=1/X
END FUNCTION
EXTERNAL FUNCTION DIFF3(X)
LET DIFF3=(-F(X-H)+F(X+H))/(2*H)
END FUNCTION
EXTERNAL FUNCTION DIFF4(X)
LET DIFF4=(F(X-2*H)-6*F(X-H)+3*F(X)+2*F(X+H))/(6*H)
END FUNCTION
EXTERNAL FUNCTION DIFF5(X)
LET DIFF5=(F(X-2*H)-8*F(X-H)+8*F(X+H)-F(X+2*H))/(12*H)
END FUNCTION
EXTERNAL FUNCTION DIFF6(X)
LET DIFF6=(-2*F(X-3*H)+15*F(X-2*H)-60*F(X-H)+20*F(X)+30*F(X+H)-3*F(X+2*H))/(60*H)
END FUNCTION
EXTERNAL FUNCTION DIFF7(X)
LET DIFF7=(-F(X-3*H)+9*F(X-2*H)-45*F(X-H)+45*F(X+H)-9*F(X+2*H)+F(X+3*H))/(60*H)
END FUNCTION
EXTERNAL FUNCTION DIFF8(X)
LET DIFF8=(3*F(X-4*H)-28*F(X-3*H)+126*F(X-2*H)-420*F(X-H)+105*F(X)+252*F(X+H)-42*F(X+2*H)+4*F(X+3*H))/(420*H)
END FUNCTION
EXTERNAL FUNCTION DIFF9(X)
LET DIFF9=(3*F(X-4*H)-32*F(X-3*H)+168*F(X-2*H)-672*F(X-H)+672*F(X+H)-168*F(X+2*H)+32*F(X+3*H)-3*F(X+4*H))/(840*H)
END FUNCTION
EXTERNAL FUNCTION DIFF10(X)
LET DIFF10=(-4*F(X-5*H)+45*F(X-4*H)-240*F(X-3*H)+840*F(X-2*H)-2520*F(X-H)+504*F(X)+1680*F(X+H)-360*F(X+2*H)+60*F(X+3*H)-5*F(X+4*H))/(2520*H)
END FUNCTION
EXTERNAL FUNCTION DIFF11(X)
LET DIFF11=(-2*F(X-5*H)+25*F(X-4*H)-150*F(X-3*H)+600*F(X-2*H)-2100*F(X-H)+2100*F(X+H)-600*F(X+2*H)+150*F(X+3*H)-25*F(X+4*H)+2*F(X+5*H))/(2520*H)
END FUNCTION
EXTERNAL FUNCTION DIFF12(X)
LET DIFF12=(10*F(X-6*H)-132*F(X-5*H)+825*F(X-4*H)-3300*F(X-3*H)+9900*F(X-2*H)-27720*F(X-H)+4620*F(X)+19800*F(X+H)-4950*F(X+2*H)+1100*F(X+3*H)-165*F(X+4*H)+12*F(X+5*H))/(27720*H)
END FUNCTION
EXTERNAL FUNCTION DIFF13(X)
LET DIFF13=(5*F(X-6*H)-72*F(X-5*H)+495*F(X-4*H)-2200*F(X-3*H)+7425*F(X-2*H)-23760*F(X-H)+23760*F(X+H)-7425*F(X+2*H)+2200*F(X+3*H)-495*F(X+4*H)+72*F(X+5*H)-5*F(X+6*H))/(27720*H)
END FUNCTION
EXTERNAL FUNCTION DIFF14(X)
LET DIFF14=(-30*F(X-7*H)+455*F(X-6*H)-3276*F(X-5*H)+15015*F(X-4*H)-50050*F(X-3*H)+135135*F(X-2*H)-360360*F(X-H)+51480*F(X)+270270*F(X+H)-75075*F(X+2*H)+20020*F(X+3*H)-4095*F(X+4*H)+546*F(X+5*H)-35*F(X+6*H))/(360360*H)
END FUNCTION
EXTERNAL FUNCTION DIFF15(X)
LET DIFF15=(-15*F(X-7*H)+245*F(X-6*H)-1911*F(X-5*H)+9555*F(X-4*H)-35035*F(X-3*H)+105105*F(X-2*H)-315315*F(X-H)+315315*F(X+H)-105105*F(X+2*H)+35035*F(X+3*H)-9555*F(X+4*H)+1911*F(X+5*H)-245*F(X+6*H)+15*F(X+7*H))/(360360*H)
END FUNCTION
EXTERNAL FUNCTION DIFF16(X)
LET DIFF16=(7*F(X-8*H)-120*F(X-7*H)+980*F(X-6*H)-5096*F(X-5*H)+19110*F(X-4*H)-56056*F(X-3*H)+140140*F(X-2*H)-360360*F(X-H)+45045*F(X)+280280*F(X+H)-84084*F(X+2*H)+25480*F(X+3*H)-6370*F(X+4*H)+1176*F(X+5*H)-140*F(X+6*H)+8*F(X+7*H))/(360360*H)
END FUNCTION
EXTERNAL FUNCTION DIFF17(X)
LET DIFF17=(7*F(X-8*H)-128*F(X-7*H)+1120*F(X-6*H)-6272*F(X-5*H)+25480*F(X-4*H)-81536*F(X-3*H)+224224*F(X-2*H)-640640*F(X-H)+640640*F(X+H)-224224*F(X+2*H)+81536*F(X+3*H)-25480*F(X+4*H)+6272*F(X+5*H)-1120*F(X+6*H)+128*F(X+7*H)-7*F(X+8*H))/(720720*H)
END FUNCTION
EXTERNAL FUNCTION DIFF18(X)
LET DIFF18=(-56*F(X-9*H)+1071*F(X-8*H)-9792*F(X-7*H)+57120*F(X-6*H)-239904*F(X-5*H)+779688*F(X-4*H)-2079168*F(X-3*H)+4900896*F(X-2*H)-12252240*F(X-H)+1361360*F(X)+9801792*F(X+H)-3118752*F(X+2*H)+1039584*F(X+3*H)-299880*F(X+4*H)+68544*F(X+5*H)-11424*F(X+6*H)+1224*F(X+7*H)-63*F(X+8*H))/(12252240*H)
END FUNCTION
EXTERNAL FUNCTION DIFF19(X)
LET DIFF19=(-28*F(X-9*H)+567*F(X-8*H)-5508*F(X-7*H)+34272*F(X-6*H)-154224*F(X-5*H)+539784*F(X-4*H)-1559376*F(X-3*H)+4009824*F(X-2*H)-11027016*F(X-H)+11027016*F(X+H)-4009824*F(X+2*H)+1559376*F(X+3*H)-539784*F(X+4*H)+154224*F(X+5*H)-34272*F(X+6*H)+5508*F(X+7*H)-567*F(X+8*H)+28*F(X+9*H))/(12252240*H)
END FUNCTION
EXTERNAL FUNCTION DIFF20(X)
LET DIFF20=(252*F(X-10*H)-5320*F(X-9*H)+53865*F(X-8*H)-348840*F(X-7*H)+1627920*F(X-6*H)-5860512*F(X-5*H)+17093160*F(X-4*H)-42325920*F(X-3*H)+95233320*F(X-2*H)-232792560*F(X-H)+23279256*F(X)+190466640*F(X+H)-63488880*F(X+2*H)+22790880*F(X+3*H)-7325640*F(X+4*H)+1953504*F(X+5*H)-406980*F(X+6*H)+61560*F(X+7*H)-5985*F(X+8*H)+280*F(X+9*H))/(232792560*H)
END FUNCTION
EXTERNAL FUNCTION DIFF51(X)
LET DIFF51=(-980628*F(X-25*H)+51074375*F(X-24*H)-1305727500*F(X-23*H)+21841260000*F(X-22*H)-268855510000*F(X-21*H)+2597144226600*F(X-20*H)-20503770210000*F(X-19*H)+136040888060000*F(X-18*H)-774232701165000*F(X-17*H)+3838903809943125*F(X-16*H)-16788805995484600*F(X-15*H)+65410932449940000*F(X-14*H)-228938263574790000*F(X-13*H)+724971167986835000*F(X-12*H)-2090176614195810000*F(X-11*H)+5518066261476938400*F(X-10*H)-13411966607756447500*F(X-9*H)+30176924867452006875*F(X-8*H)-63227842579423252500*F(X-7*H)+124237164366586040000*F(X-6*H)-231081125721850034400*F(X-5*H)+412644867360446490000*F(X-4*H)-725254615360784740000*F(X-3*H)+1324377993267519960000*F(X-2*H)-2979850484851919910000*F(X-H)+2979850484851919910000*F(X+H)-1324377993267519960000*F(X+2*H)+725254615360784740000*F(X+3*H)-412644867360446490000*F(X+4*H)+231081125721850034400*F(X+5*H)-124237164366586040000*F(X+6*H)+63227842579423252500*F(X+7*H)-30176924867452006875*F(X+8*H)+13411966607756447500*F(X+9*H)-5518066261476938400*F(X+10*H)+2090176614195810000*F(X+11*H)-724971167986835000*F(X+12*H)+228938263574790000*F(X+13*H)-65410932449940000*F(X+14*H)+16788805995484600*F(X+15*H)-3838903809943125*F(X+16*H)+774232701165000*F(X+17*H)-136040888060000*F(X+18*H)+20503770210000*F(X+19*H)-2597144226600*F(X+20*H)+268855510000*F(X+21*H)-21841260000*F(X+22*H)+1305727500*F(X+23*H)-51074375*F(X+24*H)+980628*F(X+25*H))/(3099044504245996706400*H)
END FUNCTION
EXTERNAL FUNCTION DIFF75(X)
LET DIFF75=(-6354671400*F(X-37*H)+483308063700*F(X-36*H)-18144765591480*F(X-35*H)+448282444024800*F(X-34*H)-8198134999059600*F(X-33*H)+118360574048922975*F(X-32*H)-1405054556451730800*F(X-31*H)+14104071452382135840*F(X-30*H)-122194756979690056200*F(X-29*H)+928098273250503045900*F(X-28*H)-6256069841910798309400*F(X-27*H)+37798911492384124051200*F(X-26*H)-206382056748417317319552*F(X-25*H)+1025295474230919364888800*F(X-24*H)-4661591845571633385705600*F(X-23*H)+19493929536026830522041600*F(X-22*H)-75306906362389363147648800*F(X-21*H)+269775917498206600923047760*F(X-20*H)-899253058327355336410159200*F(X-19*H)+2797676181462883268831606400*F(X-18*H)-8146174763671336576892030400*F(X-17*H)+22256513193602044576151440200*F(X-16*H)-57192494509619799395686125120*F(X-15*H)+138540825209638023380854588800*F(X-14*H)-317045349998979322736955693600*F(X-13*H)+686931591664455199263404002800*F(X-12*H)-1412292922722726074010075362400*F(X-11*H)+2761817271102219878064147375360*F(X-10*H)-5151008402452552947183132009600*F(X-9*H)+9191885683686883276438864879200*F(X-8*H)-15757518314891799902466625507200*F(X-7*H)+26093094844014378333116777721600*F(X-6*H)-42075115435973185062150804076080*F(X-5*H)+66937683648139158053421733757400*F(X-4*H)-107625295277400214909423179766800*F(X-3*H)+184500506189828939844725451028800*F(X-2*H)-399751096744629369663571810562400*F(X-H)+399751096744629369663571810562400*F(X+H)-184500506189828939844725451028800*F(X+2*H)+107625295277400214909423179766800*F(X+3*H)-66937683648139158053421733757400*F(X+4*H)+42075115435973185062150804076080*F(X+5*H)-26093094844014378333116777721600*F(X+6*H)+15757518314891799902466625507200*F(X+7*H)-9191885683686883276438864879200*F(X+8*H)+5151008402452552947183132009600*F(X+9*H)-2761817271102219878064147375360*F(X+10*H)+1412292922722726074010075362400*F(X+11*H)-686931591664455199263404002800*F(X+12*H)+317045349998979322736955693600*F(X+13*H)-138540825209638023380854588800*F(X+14*H)+57192494509619799395686125120*F(X+15*H)-22256513193602044576151440200*F(X+16*H)+8146174763671336576892030400*F(X+17*H)-2797676181462883268831606400*F(X+18*H)+899253058327355336410159200*F(X+19*H)-269775917498206600923047760*F(X+20*H)+75306906362389363147648800*F(X+21*H)-19493929536026830522041600*F(X+22*H)+4661591845571633385705600*F(X+23*H)-1025295474230919364888800*F(X+24*H)+206382056748417317319552*F(X+25*H)-37798911492384124051200*F(X+26*H)+6256069841910798309400*F(X+27*H)-928098273250503045900*F(X+28*H)+122194756979690056200*F(X+29*H)-14104071452382135840*F(X+30*H)+1405054556451730800*F(X+31*H)-118360574048922975*F(X+32*H)+8198134999059600*F(X+33*H)-448282444024800*F(X+34*H)+18144765591480*F(X+35*H)-483308063700*F(X+36*H)+6354671400*F(X+37*H))/(410555180440430163438262940577600*H)
END FUNCTION
EXTERNAL FUNCTION DIFF101(X)
LET DIFF101=(13820883356*F(X-50*H)-1410294220000*F(X-49*H)+71263929804375*F(X-48*H)-2377485998580000*F(X-47*H)+58907384062642500*F(X-46*H)-1156155591202796800*F(X-45*H)+18721837698454380000*F(X-44*H)-257254221663811680000*F(X-43*H)+3061784620338044370000*F(X-42*H)-32061614560938220720000*F(X-41*H)+299054709817151253765800*F(X-40*H)-2509550012451618912720000*F(X-39*H)+19102298450042915013270000*F(X-38*H)-132802673631899184624480000*F(X-37*H)+848198028613260863702780000*F(X-36*H)-5001944945879344064807251200*F(X-35*H)+27354386422777662854414655000*F(X-34*H)-139258694515959010895201880000*F(X-33*H)+662204104651409254933954773125*F(X-32*H)-2950124907649062622999486120000*F(X-31*H)+12346272738511327077252849412200*F(X-30*H)-48655262023689958925134381920000*F(X-29*H)+180956502104340415417991670420000*F(X-28*H)-636407408366955663885497275680000*F(X-27*H)+2120338144222597476310815442530000*F(X-26*H)-6703661076774164181104274103102848*F(X-25*H)+20143212370114676024952746704035000*F(X-24*H)-57607641174434242544792396370960000*F(X-23*H)+157018229759537489014133820627990000*F(X-22*H)-408402095138107360588485996510240000*F(X-21*H)+1014879206418196791062387701327946400*F(X-20*H)-2412276551758022932915692329132640000*F(X-19*H)+5490441943324250112938320561619602500*F(X-18*H)-11979146058162000246410881225351860000*F(X-17*H)+25081337059276688015922782565580456875*F(X-16*H)-50449317970659395323456111217624690400*F(X-15*H)+97595406788477996905495453248381097500*F(X-14*H)-181799344038412235399841842225674560000*F(X-13*H)+326521190279516712264189624523744440000*F(X-12*H)-566274511813427584905727460712507840000*F(X-11*H)+949925493567024773679357815345231901600*F(X-10*H)-1544594298482967111673752545276799840000*F(X-9*H)+2441010632423974810412983933160656890000*F(X-8*H)-3762886822075496053261211112912108960000*F(X-7*H)+5687090310636829262315239522923982860000*F(X-6*H)-8492721530550998365057424354233147737600*F(X-5*H)+12692926200551763860819520094641932760000*F(X-4*H)-19444482690206957403808626527962109760000*F(X-3*H)+32204924455655273200058037686937244290000*F(X-2*H)-68353309048737722710327263662070885840000*F(X-H)+68353309048737722710327263662070885840000*F(X+H)-32204924455655273200058037686937244290000*F(X+2*H)+19444482690206957403808626527962109760000*F(X+3*H)-12692926200551763860819520094641932760000*F(X+4*H) &
& +8492721530550998365057424354233147737600*F(X+5*H)-5687090310636829262315239522923982860000*F(X+6*H)+3762886822075496053261211112912108960000*F(X+7*H)-2441010632423974810412983933160656890000*F(X+8*H)+1544594298482967111673752545276799840000*F(X+9*H)-949925493567024773679357815345231901600*F(X+10*H)+566274511813427584905727460712507840000*F(X+11*H)-326521190279516712264189624523744440000*F(X+12*H)+181799344038412235399841842225674560000*F(X+13*H)-97595406788477996905495453248381097500*F(X+14*H)+50449317970659395323456111217624690400*F(X+15*H)-25081337059276688015922782565580456875*F(X+16*H)+11979146058162000246410881225351860000*F(X+17*H)-5490441943324250112938320561619602500*F(X+18*H)+2412276551758022932915692329132640000*F(X+19*H)-1014879206418196791062387701327946400*F(X+20*H)+408402095138107360588485996510240000*F(X+21*H)-157018229759537489014133820627990000*F(X+22*H)+57607641174434242544792396370960000*F(X+23*H)-20143212370114676024952746704035000*F(X+24*H)+6703661076774164181104274103102848*F(X+25*H)-2120338144222597476310815442530000*F(X+26*H)+636407408366955663885497275680000*F(X+27*H)-180956502104340415417991670420000*F(X+28*H)+48655262023689958925134381920000*F(X+29*H)-12346272738511327077252849412200*F(X+30*H)+2950124907649062622999486120000*F(X+31*H)-662204104651409254933954773125*F(X+32*H)+139258694515959010895201880000*F(X+33*H)-27354386422777662854414655000*F(X+34*H)+5001944945879344064807251200*F(X+35*H)-848198028613260863702780000*F(X+36*H)+132802673631899184624480000*F(X+37*H)-19102298450042915013270000*F(X+38*H)+2509550012451618912720000*F(X+39*H)-299054709817151253765800*F(X+40*H)+32061614560938220720000*F(X+41*H)-3061784620338044370000*F(X+42*H)+257254221663811680000*F(X+43*H)-18721837698454380000*F(X+44*H)+1156155591202796800*F(X+45*H)-58907384062642500*F(X+46*H)+2377485998580000*F(X+47*H)-71263929804375*F(X+48*H)+1410294220000*F(X+49*H)-13820883356*F(X+50*H))/(69720375229712477164533808935312303556800*H)
END FUNCTION
EXTERNAL FUNCTION DIFF(X,K)
FOR N=1 TO K
FOR J=0 TO N
LET S=S+(-1)^J*COMB(N,J)*F(X-J*H)/N
NEXT J
NEXT N
LET DIFF=S/H
END FUNCTION
|
|