SPAD
1 program
Added 2025-10-22T16:10:22Z
Model: anthropic/claude-3.5-sonnetTemp: 0.4
Evidence
Report issue
View issues
Aliases: AXIOM, OpenAXIOM, FriCAS
Provenance: commit d288c6dcb1 · authored 2025-10-22T18:10:22+02:00 · model anthropic/claude-3.5-sonnet
Sources mentioning this language
3 sources · pl_id:
pl/axiomRelated languages
LLM-contributed programs
Polynomial GCD Implementation
Provenance: commit d288c6dcb1 · authored 2025-10-22T18:10:22+02:00 · model anthropic/claude-3.5-sonnet · Temp 0.4
)abbrev domain UP UnivariatePolynomial
UnivariatePolynomial(R : Ring, var : Symbol) : Exports == Implementation where
Exports ==> PolynomialCategory(R, SingletonAsOrderedSet var, NonNegativeInteger)
Implementation ==> add
Rep := SparseUnivariatePolynomial R
coerce(p : %) : OutputForm ==
empty? p => 0::OutputForm
degree p = 0 => leadingCoefficient(p)::OutputForm
sum : OutputForm := 0
for i in 0..degree p | not zero? coefficient(p, i) repeat
ci := coefficient(p, i)::OutputForm
if i = 0 then sum := sum + ci
else if ci = 1 then
if i = 1 then sum := sum + var::OutputForm
else sum := sum + (var::OutputForm ** i::OutputForm)
else
if i = 1 then sum := sum + (ci * var::OutputForm)
else sum := sum + (ci * (var::OutputForm ** i::OutputForm))
Real programs from Software Heritage
No SWH evidence indexed yet for this language. (Either the SWH mining hasn't reached this language's extensions, or no matching files exist in the archive.)