From 8bb4a3b74712b16954b93ae18f4d3dcd5bea063b Mon Sep 17 00:00:00 2001 From: Adrien Hopkins Date: Tue, 5 Sep 2023 11:37:00 -0500 Subject: Add lower bound estimate for massive MTCs This can easily be estimated from existing information, so it's useful to have, even in the compact view. This estimate is more accurate (narrows the range down further) the higher the radix's totative ratio. It also should be closer to the actual value than the upper bound. --- factor_info.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'factor_info.go') diff --git a/factor_info.go b/factor_info.go index c243048..0d0bd40 100644 --- a/factor_info.go +++ b/factor_info.go @@ -98,8 +98,11 @@ func (fi *FactorInfo) WriteTo(w io.Writer) { if fi.MTC != nil { fmt.Fprintln(w, "Multiplication Table Complexity:", *fi.MTC) } else { - fmt.Fprintf(w, "Multiplication Table Complexity ≤ %.4g\n", - float32(fi.Radix)*float32(fi.Radix-2)) + low_mtc_est := float64(fi.Radix)*float64(fi.Totient-2) + high_mtc_est := float64(fi.Radix)*float64(fi.Radix-2) + fmt.Fprintf(w, + "Multiplication Table Complexity is between %.6g and %.6g.\n", + low_mtc_est, high_mtc_est) } fmt.Fprintf(w, "Natural Logarithm: %.3f\n", fi.Ln) if len(fi.DigitMap) > 0 { @@ -116,7 +119,9 @@ func (fi *FactorInfo) WriteToCompact(w io.Writer) { if fi.MTC != nil { fmt.Fprintf(w, "MTC: %d | ", *fi.MTC) } else { - fmt.Fprintf(w, "MTC ≤ %.3g | ", float32(fi.Radix)*float32(fi.Radix-2)) + low_mtc_est := float32(fi.Radix)*float32(fi.Totient-2) + high_mtc_est := float32(fi.Radix)*float32(fi.Radix-2) + fmt.Fprintf(w, "%.4g ≤ MTC ≤ %.4g | ", low_mtc_est, high_mtc_est) } fmt.Fprintf(w, "Ln: %.2f", fi.Ln) fmt.Fprintln(w) -- cgit v1.2.3