func (self *Gaussian) Pdf(x float64) float64 {
	m := self.standardDeviation * math.Sqrt(2*math.Pi)
	e := math.Exp(-math.Pow(x-self.mean, 2) / (2 * self.variance))
	return e / m
}
/ PROB
pdf(x): the probability density function, which describes the probability
of a random variable taking on the value x
package gaussian
import (
	"math"
)
type Gaussian struct {
	mean              float64
	variance          float64
	standardDeviation float64
}
func NewGaussian(mean, variance float64) *Gaussian {
	if variance <= 0.0 {
		panic("error")
	}
	return &Gaussian{
		mean:              mean,
		variance:          variance,
		standardDeviation: math.Sqrt(float64(variance)),
	}
}
func Erfc(x float64) float64 {
	z := math.Abs(x)
	t := 1 / (1 + z/2)
	r := t * math.Exp(-z*z-1.26551223+t*(1.00002368+
		t*(0.37409196+t*(0.09678418+t*(-0.18628806+
			t*(0.27886807+t*(-1.13520398+t*(1.48851587+
				t*(-0.82215223+t*0.17087277)))))))))
	if x >= 0 {
		return r
	} else {
		return 2 - r
	}
}
func Ierfc(x float64) float64 {
	if x >= 2 {
		return -100
	}
	if x <= 0 {
		return 100
	}
	var xx float64
	if x < 1 {
		xx = x
	} else {
		xx = 2 - x
	}
	t := math.Sqrt(-2 * math.Log(xx/2))
	r := -0.70711 * ((2.30753+t*0.27061)/
		(1+t*(0.99229+t*0.04481)) - t)
	for j := 0; j < 2; j++ {
		e := Erfc(r) - xx
		r += e / (1.12837916709551257*math.Exp(-(r*r)) - r*e)
	}
	if x < 1 {
		return r
	} else {
		return -r
	}
}
func fromPrecisionMean(precision, precisionmean float64) *Gaussian {
	return NewGaussian(precisionmean/precision, 1/precision)
}