(50g) Bernoulli polynomials
12-30-2018, 01:44 PM
Post: #14
 peacecalc Member Posts: 187 Joined: Dec 2013
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
 « Next Oldest | Next Newest »

 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 - John Keith - 12-17-2018, 07:03 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 - peacecalc - 12-17-2018, 10:03 PM RE: (50g) Bernoulli polynomials - ijabbott - 12-17-2018, 11:58 PM RE: (50g) Bernoulli polynomials - peacecalc - 12-22-2018, 11:06 PM RE: (50g) Bernoulli polynomials - John Keith - 12-23-2018, 07:58 PM RE: (50g) Bernoulli polynomials - peacecalc - 12-29-2018, 02:18 PM RE: (50g) Bernoulli polynomials - Albert Chan - 12-29-2018, 03:52 PM RE: (50g) Bernoulli polynomials - DavidM - 12-29-2018, 04:40 PM RE: (50g) Bernoulli polynomials - John Keith - 12-29-2018, 05:54 PM RE: (50g) Bernoulli polynomials - peacecalc - 12-30-2018 01:44 PM RE: (50g) Bernoulli polynomials - ttw - 01-02-2019, 11:13 PM RE: (50g) Bernoulli polynomials - peacecalc - 01-03-2019, 10:20 AM

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