From ce399ac24eb6ec64162a24a0c668b16ff0456bd8 Mon Sep 17 00:00:00 2001 From: NunoSempere Date: Sun, 9 Jun 2024 14:08:19 +0200 Subject: [PATCH] reach feature parity with past parser --- f2.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/f2.go b/f2.go index 7c8f53f..3ee69ae 100644 --- a/f2.go +++ b/f2.go @@ -99,6 +99,9 @@ func joinDists(old_dist Dist, new_dist Dist, op string) (Dist, error) { switch { case old_dist.Type == "Lognormal" && new_dist.Type == "Lognormal" && op == "*": return Dist{Type: "Lognormal", Lognormal: multiplyLogDists(old_dist.Lognormal, new_dist.Lognormal), Samples: nil}, nil + case old_dist.Type == "Lognormal" && new_dist.Type == "Lognormal" && op == "/": + tmp_dist := Lognormal{low: 1.0 / new_dist.Lognormal.high, high: 1.0 / new_dist.Lognormal.low} + return Dist{Type: "Lognormal", Lognormal: multiplyLogDists(old_dist.Lognormal, tmp_dist), Samples: nil}, nil default: fmt.Printf("For now, can't do anything besides multiplying lognormals\n") }