Here I compare performing some simple CAS calculations on Mathematica and on Julia using Symbolics
On Mathematica
On Julia
using Pkg
Pkg.activate("/Users/ssiew/juliascript/Symbolics")
# Pkg.add("Symbolics")
# Pkg.add("Nemo")
# Pkg.add("SymbolicNumericIntegration")
using Symbolics
using Nemo
# using SymbolicNumericIntegration
@variables x
Expr = -279//16 + x^2 ~ 0
println("Expr is ",Expr)
println()
soln = symbolic_solve(Expr,x)
answer = simplify(soln,expand=true)
println("Symbolic solution is ",answer)
mybuildfunction(ans)=build_function(ans,x,expression=Val{false})
FuncBuilderArray = mybuildfunction.(answer)
FuncArray = eval.(FuncBuilderArray)
FloatAnswer = map(x->Float64(x(nothing)),FuncArray)
FloatAnswer_rounded = map(x->round(x, digits=4),FloatAnswer)
println("Float solution is ",FloatAnswer_rounded)
with output
Activating project at `~/juliascript/Symbolics`
Expr is -(279//16) + x^2 ~ 0
Symbolic solution is SymbolicUtils.BasicSymbolic{Real}[(1//2)*√(279//4), (-1//2)*√(279//4)]
Float solution is [4.1758, -4.1758]
My observations: Julia cannot simplify to “3*sqrt(31)/4” and turning the final answer to Floating point requires multiple lines of code.