Small fix in arithmetic_extension_special_cases (#140)

This is detecting the case where we multiply something by 1 and add 0.  In that case we can just return the thing being multiplied by 1. We were using the wrong constant to detect this.

Reduces the cost of `compute_evaluation` from 8 to 6 gates.
This commit is contained in:
Daniel Lubarov 2021-07-30 12:00:24 -07:00 committed by GitHub
parent 94b85b0806
commit 36a1386c6f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -143,7 +143,7 @@ impl<F: Extendable<D>, const D: usize> CircuitBuilder<F, D> {
}
}
if let Some(x) = mul_1_const {
if (x * const_1.into()).is_one() {
if (x * const_0.into()).is_one() {
return Some(multiplicand_0);
}
}