gitnlsn / gitnlsn/ncas

Algebraic Factoring

Open
#9 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
Rust
Stars
9
Forks
0
PR merge metrics
No merged PRs in 30d

Description

```rust
#[test]
fn square_sample_1() {
use crate::base::symbol::Symbol;

let a = &Symbol::variable("a").expr();
let b = &Symbol::variable("b").expr();
let two = &Symbol::variable(2).expr();

assert_eq!(
Factoring::apply(a * a + two * a * b + b * b),
(a + b).pow(two)
);
}

#[test]
fn square_sample_2() {
use crate::base::symbol::Symbol;

let a = &Symbol::variable("a").expr();
let b = &Symbol::variable("b").expr();
let one = &Symbol::variable(1).expr();
let two = &Symbol::variable(2).expr();

assert_eq!(
Factoring::apply(a * a + a * b + a + b),
(a + one) * (a + b)
);
}

```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.