2022-05-02 21:15:23 +00:00
|
|
|
/*
|
|
|
|
This test case comes via Nuño https://github.com/quantified-uncertainty/squiggle/issues/433
|
|
|
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
open Jest
|
|
|
|
open Expect
|
|
|
|
open TestHelpers
|
|
|
|
|
2022-05-02 22:40:34 +00:00
|
|
|
describe("Scale logarithm", () => {
|
|
|
|
test("mean of the base two scalar logarithm of an exponential(10)", () => {
|
2022-05-02 21:15:23 +00:00
|
|
|
let scalelog = DistributionOperation.Constructors.scaleLogarithm(~env, mkExponential(10.0), 2.0)
|
|
|
|
|
|
|
|
E.R2.bind(DistributionOperation.Constructors.mean(~env), scalelog)
|
|
|
|
->expect
|
|
|
|
->toEqual(Ok(-2.348336572091017))
|
|
|
|
})
|
|
|
|
})
|