From d3718d256d6f1aa3ea37dd8366efc8203f8a5289 Mon Sep 17 00:00:00 2001
From: Luke Naylor <l.naylor@sms.ed.ac.uk>
Date: Wed, 19 Apr 2023 17:55:21 +0100
Subject: [PATCH] Reorg some Sage code

---
 main.tex | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/main.tex b/main.tex
index db5b4c1..c560ce7 100644
--- a/main.tex
+++ b/main.tex
@@ -211,9 +211,13 @@ This can be rearranged to express a bound on $d$ as follows:
 
 \begin{sagesilent}
 	var("r_alt",domain="real") # r_alt = r - R/2 temporary substitution
+
 	bgmlv1_with_q_reparam = (bgmlv1_with_q.subs(r == r_alt + R/2)/r_alt).expand()
-	bgmlv1_d_ineq = ((0 > -bgmlv1_with_q_reparam) + 4*d)/4 # Rearrange for d
-	bgmlv1_d_ineq = bgmlv1_d_ineq.subs(r_alt == r - R/2).expand() # Resubstitute r back in
+	bgmlv1_d_ineq = (
+		((0 >= -bgmlv1_with_q_reparam)/4 + d) # Rearrange for d
+		.subs(r_alt == r - R/2) # Resubstitute r back in
+		.expand()
+	)
 
 	bgmlv1_d_lowerbound = bgmlv1_d_ineq.rhs() # Keep hold of lower bound for d
 \end{sagesilent}
-- 
GitLab