diff --git a/haskell/Tests/RoundTrip.hs b/haskell/Tests/RoundTrip.hs index aa34117f..b6e5e3da 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_reciprocal_transformation" ~: testConcreteFiles "tests/RoundTrip/t_cauchy_reciprocal_transformation.0.hk" "tests/RoundTrip/t_cauchy_reciprocal_transformation.expected.hk" ] testExponentialRelations :: Test diff --git a/tests/RoundTrip/t_cauchy_reciprocal_transformation.0.hk b/tests/RoundTrip/t_cauchy_reciprocal_transformation.0.hk new file mode 100644 index 00000000..a262c13c --- /dev/null +++ b/tests/RoundTrip/t_cauchy_reciprocal_transformation.0.hk @@ -0,0 +1,15 @@ +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 + +X <~ cauchy(0, 2) +return 1 / X \ No newline at end of file diff --git a/tests/RoundTrip/t_cauchy_reciprocal_transformation.expected.hk b/tests/RoundTrip/t_cauchy_reciprocal_transformation.expected.hk new file mode 100644 index 00000000..645ad7a3 --- /dev/null +++ b/tests/RoundTrip/t_cauchy_reciprocal_transformation.expected.hk @@ -0,0 +1,4 @@ +#cauchy(0,1/2) +X1 <~ normal(+0/1, 1/1) +X2 <~ normal(+0/1, 1/1) +return 1/X2*X1*(+1/2) \ No newline at end of file