Post Reply 
(50g) Bernoulli polynomials
12-30-2018, 01:44 PM
Post: #14
RE: (50g) Bernoulli polynomials
Hello folks,

now I have the summation function \GS replaced by FOR NEXT loops:

Input is n and the variable for the polynomials 'X'

Code:

« 0 DUP \-> M X RSI RSO
  « 0 M
    FOR N 1 N + INV 0 N 0 'RSI' STO
      FOR K -1 K ^ N K COMB * X K + M ^ * 'RSI' STO+
      NEXT RSI * 'RSO' STO+
    NEXT RSO EVAL FDISTRIB 
  »
»

For getting a symbolic calculation it is necessary to use integer values for the loops (although floatings has a faster performance).

Nice comparison, the "integral" code is slower until n = 18 or 19 and the "sum" code is faster. For n greater or equal 20 the tide turned, the "integral" code is faster (although it uses the CAS-functions "INTVX", "ISOL" and "SUBTL")...
The summations goes quatric with n...

greetings
peacecalc
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
(50g) Bernoulli polynomials - peacecalc - 12-17-2018, 05:31 PM
RE: (50g) Bernoulli polynomials - DavidM - 12-17-2018, 06:07 PM
RE: (50g) Bernoulli polynomials - DavidM - 12-17-2018, 08:37 PM
RE: (50g) Bernoulli polynomials - ttw - 12-17-2018, 09:17 PM
RE: (50g) Bernoulli polynomials - ijabbott - 12-17-2018, 11:58 PM
RE: (50g) Bernoulli polynomials - DavidM - 12-29-2018, 04:40 PM
RE: (50g) Bernoulli polynomials - peacecalc - 12-30-2018 01:44 PM
RE: (50g) Bernoulli polynomials - ttw - 01-02-2019, 11:13 PM



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