Why does

`Rational::from_two_ints`

take `RCP`

as argument while `Complex::from_two_rats`

doesn't:```
static RCP<const Number> from_two_rats(const Rational &re,
const Rational &im);
```

```
static RCP<const Number> from_two_ints(const RCP<const Integer> &n,
const RCP<const Integer> &d);
```

Sorry, whenever I check in mobile, something gets in :smile:

@certik Should I change it throughout SymEngine?

I think I am not understanding you.

There is

There is

`__hash__`

and `add_poly`

two separate methods
Yes, but you were worried about the hash of two polys (with same tuples but different variables) being same, weren't you?

Take an example:

`{x, y, z}`

poly mul with `{x, y, z}`

`{x, y, z}`

poly mul with `{p, q, r}`

Here the mul routine that takes in

`Polynomial`

should have more checks
Our previous routine used to take in

`hash_set`

We can have more checks. But I still dont understand why hash_set is problematic.

The

`mul`

routine which we used for benchmarking, in that we didn't consider the fact that given a exponent vector, each element is mapped to a symbol
For example if there a exponent vector

`{1, 2, 3}`

of monomial `x**1*y**2*z**3`

, and another is `{2, 3, 4}`

but of `p**2*q**3*r**4`

, then I suspect that the `mul`

routine doesn't remain the same.
It may be assuming that the

`{2, 3, 4}`

still corresponds to x, y, z
cc @bluescarni

Ok, you mean mul will fail if we try something like

`(x*y**2*z**3)*(p*q**2*r**3)`

?
Either we need to modify it to make sure it takes care of different variables or that we always multiply polys with same variables

`mul`

is done, basic arith like `add`

, `sub`

, `neg`

shouldn't take time
constructors are there, can be improved upon a lot

Thanks

We can finish this fast and you can send a separate PR for other methods

That way we can work on PRs parallely

I think arithmetic methods except division should do

I think @certik was mentioning about replacing

`mpz_class`

by `piranha::integer`

throughout and testing benchmarks, I'll do that first in the morning tomorrow
`temp.first = a.first + b.first; size_t bucket = C._bucket(temp); auto it = C._find(temp, bucket);`

This finds if resulting

`hash_set`

has the same term in a iteration`if (it == C.end()) { ... }`

If present, it will insert and increase size

`} else { piranha::math::multiply_accumulate(it->second,a.second,b.second); }`

else FMA

Yeah, I did see the code. But the use of buckets is not obvious

What algo are you using?

Let me know if it is fine

I'll go through it.

Once the basic arithmetic operations are done, the code structure won't change, will it?

I want to start implementing function expansions.

Yes, it should work fine for that

But amendments will be needed when you have to expand to other domains

Domain change will affect the hash-set , right?

`mutable Expression second`

Also, I have to use

`std::unordered_set`

whenever Piranha dependency is not there
So that we have working code, just slower

We have only 3-4 weeks. Need to move fast.

Will catch you tomorrow