Editing ESM Math Library
Jump to navigation
Jump to search
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 574: | Line 574: | ||
set myResultAngle to f.fout</pre> | set myResultAngle to f.fout</pre> | ||
=== Stage 40: | === Stage 40: NaturalLogarithm === | ||
Takes an antilogarithm a (float) and returns the exponent b (float) to the base e(=2.71828...):<br> | Takes an antilogarithm a (float) and returns the exponent b (float) to the base e(=2.71828...):<br> | ||
a=e^b --> b=LN(a)<br> | a=e^b --> b=LN(a)<br> | ||
Line 602: | Line 602: | ||
set f.fout to 0 | set f.fout to 0 | ||
set f.LN_n to 0 | set f.LN_n to 0 | ||
elseif f.fin1 > 4 || f.fin1 < 0.25 | elseif f.fin1 > 4 || f.fin1 < 0.25 ;change values for better or worse accuracy (makes the script faster) | ||
;LN(x) = n * LN( nthRoot(x) ) | ;LN(x) = n * LN( nthRoot(x) ) | ||
set f.LN_n to (f.LN_n * 2) | set f.LN_n to (f.LN_n * 2) | ||
Line 671: | Line 669: | ||
set f.t11 to (f.t10*f.t1) | set f.t11 to (f.t10*f.t1) | ||
set f.fout to (1 + f.t1 + f.t2/2 + f.t3/6 + f.t4/24 + f.t5/120 + f.t6/720 + f.t7/5040 + f.t8/40320 + f.t9/362880 + f.t10/3628800 + f.t11/39916800) | set f.fout to (1 + f.t1 + f.t2/2 + f.t3/6 + f.t4/24 + f.t5/120 + f.t6/720 + f.t7/5040 + f.t8/40320 + f.t9/362880 + f.t10/3628800 + f.t11/39916800)</pre> | ||
Actually, more terms won't increase accuracy any more, because Oblivion can't handle higher values. | Actually, more terms won't increase accuracy any more, because Oblivion can't handle higher values. | ||