1 comment
  1. Constructible said:

    Internal representations are not always stored in their simplest form, despite correctly comparing with equivalent representations. For example, sqrt(sqrt(2))*sqrt(sqrt(2)) == sqrt(2) evaluates correctly, but the internal representation of the LHS doesn’t collapse automatically to the RHS.

    This causes problems when performing computations such as sqrt(1-cos_x*cos_x)==0, where the internal representation of cos_x==1 is Constructible(Constructible(Fraction(0, 1), Fraction(0, 1), ()), Constructible(Fraction(1, 2), 0, ()), (Constructible(Fraction(2, 1), 0, ()), ())); in this specific case the internal intermediate computation encounters a division by zero.

    To fix this, representations should be simplified as soon as an operation is performed on a Constructible object. This could be done, for example, by converting to its str form and back; however, this may be too expensive. A more efficient method would be to adapt the internal technique utilised to obtain the irreducible string representation.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: