diff --git a/extra/math/finance/finance-docs.factor b/extra/math/finance/finance-docs.factor index 97e44d2927..a1e81bf665 100644 --- a/extra/math/finance/finance-docs.factor +++ b/extra/math/finance/finance-docs.factor @@ -1,8 +1,6 @@ -! Copyright (C) 2008 John Benediktsson +! Copyright (C) 2008 John Benediktsson, Doug Coleman. ! See http://factorcode.org/license.txt for BSD license - -USING: help.markup help.syntax ; - +USING: help.markup help.syntax math ; IN: math.finance HELP: sma @@ -73,3 +71,18 @@ HELP: weekly { "y" number } } { $description "Divides a number by the number of weeks in a year." } ; + +ARTICLE: "time-period-calculations" "Calculations over periods of time" +{ $subsection monthly } +{ $subsection semimonthly } +{ $subsection biweekly } +{ $subsection weekly } +{ $subsection daily-360 } +{ $subsection daily-365 } ; + +ARTICLE: "math.finance" "Financial math" +"The " { $vocab-link "math.finance" } " vocabulary contains financial calculation words." $nl +"Calculating payroll over periods of time:" +{ $subsection "time-period-calculations" } ; + +ABOUT: "math.finance" diff --git a/extra/math/finance/finance.factor b/extra/math/finance/finance.factor index a1f2316c38..4823e358b0 100644 --- a/extra/math/finance/finance.factor +++ b/extra/math/finance/finance.factor @@ -1,4 +1,4 @@ -! Copyright (C) 2008 John Benediktsson. +! Copyright (C) 2008 John Benediktsson, Doug Coleman. ! See http://factorcode.org/license.txt for BSD license. USING: arrays assocs kernel grouping sequences shuffle math math.functions math.statistics math.vectors ; diff --git a/extra/math/numerical-integration/numerical-integration.factor b/extra/math/numerical-integration/numerical-integration.factor index dfaa618b53..6b46ba0243 100644 --- a/extra/math/numerical-integration/numerical-integration.factor +++ b/extra/math/numerical-integration/numerical-integration.factor @@ -4,15 +4,16 @@ USING: arrays kernel sequences namespaces make math math.ranges math.vectors vectors ; IN: math.numerical-integration -SYMBOL: num-steps 180 num-steps set-global +SYMBOL: num-steps + +180 num-steps set-global : setup-simpson-range ( from to -- frange ) 2dup swap - num-steps get / ; : generate-simpson-weights ( seq -- seq ) - { 1 4 } - swap length 2 / 2 - { 2 4 } concat - { 1 } 3append ; + length 2 / 2 - { 2 4 } concat + { 1 4 } { 1 } surround ; : integrate-simpson ( from to f -- x ) [ setup-simpson-range dup ] dip