Fix double scaledown bug for mul like ops.
Squarediff exposed a bug in codegen where both inputs to mul were same. Depending on the scale of the variable at that point, we sometimes do a scaledown of the inputs of multiplication so as to maintain precision. scaledown(a, scale) scaledown(b, scale) mul(a,b) But in this case both the inputs to mul were same so we were doing scaledown(a, scale) scaledown(a, scale) mul(a,a) This led to loss of precision. Now we just do: scaledown(a, scale) mul(a,a)
Loading
Please register or sign in to comment