diff --git a/haskell/Language/Hakaru/Pretty/Maple.hs b/haskell/Language/Hakaru/Pretty/Maple.hs index e909b58b..910a2c99 100644 --- a/haskell/Language/Hakaru/Pretty/Maple.hs +++ b/haskell/Language/Hakaru/Pretty/Maple.hs @@ -311,6 +311,7 @@ maplePrimOp Not (e1 :* End) = app1 "Not" e1 maplePrimOp Pi End = showString "Pi" maplePrimOp Cos (e1 :* End) = app1 "cos" e1 maplePrimOp Sin (e1 :* End) = app1 "sin" e1 +maplePrimOp Tan (e1 :* End) = app1 "tan" e1 maplePrimOp RealPow (e1 :* e2 :* End) = parens (arg e1 . showString " ^ " . arg e2) maplePrimOp Choose (e1 :* e2 :* End) = app2 "binomial" e1 e2 diff --git a/haskell/Tests/RoundTrip.hs b/haskell/Tests/RoundTrip.hs index aa34117f..c412c981 100644 --- a/haskell/Tests/RoundTrip.hs +++ b/haskell/Tests/RoundTrip.hs @@ -217,6 +217,7 @@ testStdChiSqRelations = test [ testCauchyRelations :: Test testCauchyRelations = test [ + "t_uniform_to_cauchy" ~: testConcreteFiles "tests/RoundTrip/t_uniform_to_cauchy.0.hk" "tests/RoundTrip/t_uniform_to_cauchy.expected.hk", "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" ] diff --git a/tests/RoundTrip/t_uniform_to_cauchy.0.hk b/tests/RoundTrip/t_uniform_to_cauchy.0.hk new file mode 100644 index 00000000..fe15cc07 --- /dev/null +++ b/tests/RoundTrip/t_uniform_to_cauchy.0.hk @@ -0,0 +1,2 @@ +X <~ uniform(0, 1) +return tan(pi * (X - 1/2)) \ No newline at end of file diff --git a/tests/RoundTrip/t_uniform_to_cauchy.expected.hk b/tests/RoundTrip/t_uniform_to_cauchy.expected.hk new file mode 100644 index 00000000..af3077da --- /dev/null +++ b/tests/RoundTrip/t_uniform_to_cauchy.expected.hk @@ -0,0 +1,5 @@ +#cauchy(0,1) +X1 <~ normal(+0/1, 1/1) +X2 <~ normal(+0/1, 1/1) +return X1/X2 +