11 const std::shared_ptr<SymbolicExpr>&
a,
const std::shared_ptr<SymbolicExpr>&
b,
12 const std::shared_ptr<SymbolicExpr>&
c,
const std::shared_ptr<SymbolicExpr>& d,
16 (
context).limits().max_ast_nodes,
"transform");
17 auto a2 = SymbolicExpr::power(
a,
num(2));
18 auto a3 = SymbolicExpr::power(
a,
num(3));
19 auto a4 = SymbolicExpr::power(
a,
num(4));
20 auto b2 = SymbolicExpr::power(
b,
num(2));
21 auto b3 = SymbolicExpr::power(
b,
num(3));
22 auto b4 = SymbolicExpr::power(
b,
num(4));
24 auto eight_ac = SymbolicExpr::multiply(
num(8), SymbolicExpr::multiply(
a,
c));
25 auto three_b2 = SymbolicExpr::multiply(
num(3), b2);
28 auto four_abc = SymbolicExpr::multiply(
num(4), SymbolicExpr::multiply(
a, SymbolicExpr::multiply(
b,
c)));
29 auto eight_a2d = SymbolicExpr::multiply(
num(8), SymbolicExpr::multiply(a2, d));
30 auto q_num = SymbolicExpr::add(
sub(b3, four_abc), eight_a2d);
33 auto neg3_b4 = SymbolicExpr::multiply(
num(-3), b4);
34 auto t256_a3e = SymbolicExpr::multiply(
num(256), SymbolicExpr::multiply(a3,
e));
35 auto neg64_a2bd = SymbolicExpr::multiply(
num(-64), SymbolicExpr::multiply(a2, SymbolicExpr::multiply(
b, d)));
36 auto t16_ab2c = SymbolicExpr::multiply(
num(16), SymbolicExpr::multiply(
a, SymbolicExpr::multiply(b2,
c)));
37 auto r_num = SymbolicExpr::add(SymbolicExpr::add(SymbolicExpr::add(neg3_b4, t256_a3e), neg64_a2bd), t16_ab2c);
41 return {p, q,
r, shift};
48 (
context).limits().max_ast_nodes,
"transform");
49 const auto& [p, q,
r, shift] = depression;
51 if (q_simp->get_number_value_is_zero()) {
54 std::vector<std::shared_ptr<SymbolicExpr>> results;
55 for (
const auto&
u : u_roots) {
65 auto p2 = SymbolicExpr::power(p,
num(2));
66 auto q2 = SymbolicExpr::power(q,
num(2));
67 auto eight_p = SymbolicExpr::multiply(
num(8), p);
73 std::shared_ptr<SymbolicExpr> m =
nullptr;
74 if (!cubic_roots.empty()) {
80 auto two_m = SymbolicExpr::multiply(
num(2), m);
97 std::vector<std::shared_ptr<SymbolicExpr>> results;
98 for (
const auto& y : y_roots1) {
101 for (
const auto& y : y_roots2) {
std::vector< std::shared_ptr< SymbolicExpr > > solve_cubic_impl(const std::shared_ptr< SymbolicExpr > &a, const std::shared_ptr< SymbolicExpr > &b, const std::shared_ptr< SymbolicExpr > &c, const std::shared_ptr< SymbolicExpr > &d, const std::string &variable, ComputationContext &context)
SymbolicQuarticDepression symbolic_quartic_depression(const std::shared_ptr< SymbolicExpr > &a, const std::shared_ptr< SymbolicExpr > &b, const std::shared_ptr< SymbolicExpr > &c, const std::shared_ptr< SymbolicExpr > &d, const std::shared_ptr< SymbolicExpr > &e, ComputationContext &context)