MATHLAB
1 program
Added 2026-02-10T15:49:56Z
Agent: claude-codeModel: sonnetWebSearch: disabled
Evidence
Report issue
View issues
Aliases: MATHLAB 68
Provenance: commit 5fd732b0c7 · authored 2026-02-10T16:50:58+01:00 · agent claude-code · model sonnet
Sources mentioning this language
2 sources · pl_id:
pl/mathlabRelated languages
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.)
Programs collected by LLM agents experimental · unverified
Gathered by LLM agents during the experiment that started this catalogue. They are not verified: the agent names an origin, but a program can be altered or invented — an audit found one attributed to a file that does not exist, in a syntax the language does not have. Prefer the programs archived by Software Heritage above. The catalogue's goal is the languages themselves, grounded in sources (PLDB, Wikipedia, Rosetta Code, …), with real archived programs; these examples may be dropped.
Polynomial Differentiation
Provenance: commit 5fd732b0c7 · authored 2026-02-10T16:50:58+01:00 · agent claude-code · model sonnet · WebSearch disabled
COMMENT MATHLAB program to differentiate polynomials;
PROCEDURE DIFF(EXPR, VAR);
BEGIN
COMMENT Differentiate EXPR with respect to VAR;
IF ATOM(EXPR) THEN
IF EXPR = VAR THEN RETURN 1
ELSE RETURN 0
ELSE IF CAR(EXPR) = PLUS THEN
RETURN CONS(PLUS, MAPCAR(LAMBDA(X, DIFF(X, VAR)), CDR(EXPR)))
ELSE IF CAR(EXPR) = TIMES THEN
COMMENT Product rule: d(uv)/dx = u*dv/dx + v*du/dx;
BEGIN
SCALAR U, V;
U := CAR(CDR(EXPR));
V := CAR(CDR(CDR(EXPR)));
RETURN CONS(PLUS,
LIST(CONS(TIMES, LIST(U, DIFF(V, VAR))),
CONS(TIMES, LIST(V, DIFF(U, VAR)))))
END
ELSE IF CAR(EXPR) = EXPT THEN
COMMENT Power rule: d(x^n)/dx = n*x^(n-1);
BEGIN
SCALAR BASE, EXP;
BASE := CAR(CDR(EXPR));
EXP := CAR(CDR(CDR(EXPR)));
RETURN CONS(TIMES,
LIST(EXP,
CONS(EXPT, LIST(BASE, CONS(PLUS, LIST(EXP, -1)))),
DIFF(BASE, VAR)))
END
END;
COMMENT Test the differentiation;
EXPR1 := CONS(EXPT, LIST(X, 3));
PRINT("d/dx(x^3) =", DIFF(EXPR1, X));
EXPR2 := CONS(TIMES, LIST(X, CONS(EXPT, LIST(X, 2))));
PRINT("d/dx(x*x^2) =", DIFF(EXPR2, X));