diff --git a/haskell/Tests/RoundTrip.hs b/haskell/Tests/RoundTrip.hs index aa34117f..905697d6 100644 --- a/haskell/Tests/RoundTrip.hs +++ b/haskell/Tests/RoundTrip.hs @@ -211,7 +211,8 @@ testStdChiSqRelations = test [ "t_stdChiSq_to_beta" ~: testConcreteFiles "tests/RoundTrip2/t_stdChiSq_to_beta.0.hk" "tests/RoundTrip2/t_stdChiSq_to_beta.expected.hk", "t_stdChiSq_to_gamma" ~: testConcreteFiles "tests/RoundTrip/t_stdChiSq_to_gamma.0.hk" "tests/RoundTrip/t_stdChiSq_to_gamma.expected.hk", "t_stdChiSq_to_exponential" ~: testConcreteFiles "tests/RoundTrip2/t_stdChiSq_to_exponential.0.hk" "tests/RoundTrip2/t_stdChiSq_to_exponential.expected.hk", - "t_rayleigh_to_stdChiSq" ~: testConcreteFiles "tests/RoundTrip2/t_rayleigh_to_stdChiSq.0.hk" "tests/RoundTrip2/t_rayleigh_to_stdChiSq.expected.hk" + "t_rayleigh_to_stdChiSq" ~: testConcreteFiles "tests/RoundTrip2/t_rayleigh_to_stdChiSq.0.hk" "tests/RoundTrip2/t_rayleigh_to_stdChiSq.expected.hk", + "t_laplace_to_stdChiSq" ~: testConcreteFiles "tests/RoundTrip/t_laplace_to_chiSq.0.hk" "tests/RoundTrip/t_laplace_to_chiSq.expected.hk" ] diff --git a/tests/RoundTrip/t_laplace_to_chiSq.0.hk b/tests/RoundTrip/t_laplace_to_chiSq.0.hk new file mode 100644 index 00000000..d596bb4a --- /dev/null +++ b/tests/RoundTrip/t_laplace_to_chiSq.0.hk @@ -0,0 +1,10 @@ +def exponential(alpha prob): + gamma(1/1, alpha) + +def Laplace(alpha prob, beta prob): + X <~ exponential(alpha) + Y <~ exponential(beta) + return X - Y + +X <~ Laplace (1,1) +return (2 * abs(X-1))/ 1 \ No newline at end of file diff --git a/tests/RoundTrip/t_laplace_to_chiSq.expected.hk b/tests/RoundTrip/t_laplace_to_chiSq.expected.hk new file mode 100644 index 00000000..461dc088 --- /dev/null +++ b/tests/RoundTrip/t_laplace_to_chiSq.expected.hk @@ -0,0 +1,4 @@ +# stdChiSq(2) +X1 <~ normal(+0/1, 1/1) +X2 <~ normal(+0/1, 1/1) +return real2prob(X1^2 + X2^2) \ No newline at end of file