Sha256: 2517d432618defbbadb4773fdc8b0cea3583214e9a9824cb449c718b0fab3163

Contents?: true

Size: 603 Bytes

Versions: 1

Compression:

Stored size: 603 Bytes

Contents

module Danica
  class Function::Gauss < Function.build(:x, median: :u, variance_root: { latex: '\theta', gnu: :v }) { product(parcels) }

    private

    def parcels
      [
        division(1, denominator),
        exponential(exp)
      ]
    end

    def denominator
      squared_root(
        product(2, PI, variance),
      )
    end

    def exp
      negative(
        division(
          power(group(
            sum(x, negative(median))
          ), 2),
          product(2, variance)
        )
      )
    end

    def variance
      @variance ||= power(variance_root, 2)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
danica-2.2.1 spec/support/models/functions/gauss.rb