diff --git a/haskell/Tests/RoundTrip.hs b/haskell/Tests/RoundTrip.hs index aa34117f..82799b8b 100644 --- a/haskell/Tests/RoundTrip.hs +++ b/haskell/Tests/RoundTrip.hs @@ -214,11 +214,11 @@ testStdChiSqRelations = test [ "t_rayleigh_to_stdChiSq" ~: testConcreteFiles "tests/RoundTrip2/t_rayleigh_to_stdChiSq.0.hk" "tests/RoundTrip2/t_rayleigh_to_stdChiSq.expected.hk" ] - testCauchyRelations :: Test testCauchyRelations = test [ "t_cauchy_add_transformation" ~: testConcreteFiles "tests/RoundTrip2/t_cauchy_add_transformation.0.hk" "tests/RoundTrip2/t_cauchy_add_transformation.expected.hk", - "t_cauchy_sub_transformation" ~: testConcreteFiles "tests/RoundTrip2/t_cauchy_sub_transformation.0.hk" "tests/RoundTrip2/t_cauchy_sub_transformation.expected.hk" + "t_cauchy_sub_transformation" ~: testConcreteFiles "tests/RoundTrip2/t_cauchy_sub_transformation.0.hk" "tests/RoundTrip2/t_cauchy_sub_transformation.expected.hk", + "t_cauchy_to_students_t" ~: testConcreteFiles "tests/RoundTrip/t_cauchy_to_students_t.0.hk" "tests/RoundTrip/t_cauchy_to_students_t.expected.hk" ] testExponentialRelations :: Test diff --git a/tests/RoundTrip/t_cauchy_to_students_t.0.hk b/tests/RoundTrip/t_cauchy_to_students_t.0.hk new file mode 100644 index 00000000..90cfd748 --- /dev/null +++ b/tests/RoundTrip/t_cauchy_to_students_t.0.hk @@ -0,0 +1,14 @@ +def stdNormal(): + p <~ normal(0, 1) + return p + +def stdCauchy(): + X1 <~ stdNormal() + X2 <~ stdNormal() + return X1/X2 + +def cauchy(a real, alpha prob): + X <~ stdCauchy() + return a + alpha*X + +cauchy(0, 1) \ No newline at end of file diff --git a/tests/RoundTrip/t_cauchy_to_students_t.expected.hk b/tests/RoundTrip/t_cauchy_to_students_t.expected.hk new file mode 100644 index 00000000..b7c3f5e7 --- /dev/null +++ b/tests/RoundTrip/t_cauchy_to_students_t.expected.hk @@ -0,0 +1,4 @@ +#t(1) +U <~ normal(+0/1,1/1) +X <~ normal(+0/1,1/1) +return U/X