lib/math — numbers, formulas, plotsok
文档
怎样读这份可执行文档
正文说明意图,标记指出哪些片段会执行。遮蔽只在正文显示动作说明,实际逻辑放在侧注;阅读、展开与定位都不会运行代码。
| 标记 | 阅读含义 |
|---|---|
无标记文字 | 作者的解释,按普通 Markdown 阅读。 |
空行 | 分隔叙述与结构,不是计算步骤。 |
# / ## | 一级标题声明对象或入口,更深标题声明函数;说明按钮可查看输入、返回与依据。 |
> | 调用函数;实际执行结果另有标注。 |
1. 递增 | 按条件选择分支,不是普通编号说明。 |
- | 重复或遍历结构;迭代选择器只切换已有运行记录。 |
+ `名` | 兼容的显式形参;新库优先在叙述中声明参数,标题下的表格解释契约。 |
GFM 表 | 未绑定的契约表是说明;绑定表按列、行和 @ 形态构成数据。 |
```lang | 代码块;绑定的外语代码与普通示例区分展示,数学公式另有公式卡片。 |
--- / *** | 分隔内容,不能把分隔线当作函数返回。 |
<!-- marqdo-out --> | 程序写回的结果,区别于作者原始正文。 |
`名` | 叙述中的参数或变量;默认值跟在名称之后。 |
**…** | 执行语句:赋值、调用或计算;不是打印,也不是返回。 |
*…* | 返回表达式;句中以返回、Return 等明确引出。 |
*None* / **** | 显式返回空值或结束当前函数。 |
[键](集合) | 正文显示描述,侧注按函数与参数、可跳转链接、结构化内容展示括号内的细节;空括号表示待补充实际逻辑。阅读不会执行调用。classic 模式保留旧链接取元。 |
修饰… [函数] … | 兼容的带修饰调用;不能把任意普通链接当作执行授权。 |
集合[^键] | 兼容的脚注取元;当前库优先用 access 读取集合。 |
*仅* / **说明** | 普通强调仍属于文字;界面按真实解析结果区分强调、语句与返回。 |
| 返回 | 类型 | 说明 |
|---|---|---|
| result | any | None; execute this page's documented steps in order and observe their output or stated effects |
Import lib/math.mq.md. Runtime types: num (float) and formula (symbolic tree). Bind a formula with an empty-RHS assign followed by a $$…$$ fence (same shape as table assigns). In view, Structure renders that fence with KaTeX.
Numeric helpers: pi, e, num, add/sub/mul/div/pow, sin/cos/tan, sqrt/abs/ln/exp, floor/ceil, min/max. Random: seed, random, random_int (reproducible after seed).
Symbolic: formula(text), simplify, expand, diff, subs, eval, solve.
Plotting (already in the library): plot / plot_points / plot_conic return SVG text. Axes include arrows and tick labels; grid is on by default (pass grid=False / grid=假 to hide). Optional path= writes a file under the sandbox. With no path, CLI auto-writes stem-plot-n.svg and prints plot: …; view embeds the SVG under Execution.
diff / simplify / expand / partial subs return formula values so you can chain (e.g. differentiate twice, then plot or eval).
函数调用Compute ty
type- 参数 1
`f`
原始写法
type(`f`)函数调用Display this step's result
print- text
`ty`
原始写法
> print text=`ty`函数调用Compute df
math.diff- formula
`f`- var
- x
原始写法
math.diff(formula=`f`, var="x")函数调用Display this step's result
print- text
`df`
原始写法
> print text=`df`函数调用Compute roots
math.solve- formula
`f`- var
- x
原始写法
math.solve(formula=`f`, var="x")函数调用Display this step's result
print- text
`roots`
原始写法
> print text=`roots`函数调用Compute _svg
math.plot- formula
`f`- var
- x
- min
-3- max
3
原始写法
math.plot(formula=`f`, var="x", min=-3, max=3)函数调用Display this step's result
print- text
- plot-ok
原始写法
> print text="plot-ok"Functions
Variables
-
_svg text<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 520 360" width="520" height="360" role="img" aria-label="function plot"> <defs> <marker id="arrow" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse"> <path d="M 0 0 L 10 5 L 0 10 z" fill="#4b5563"/> </marker> </defs> <style> .grid { stroke: #e5e7eb; stroke-width: 1; } .axis { stroke: #4b5563; stroke-width: 1.5; } .tick { stroke: #4b5563; stroke-width: 1; } .curve { fill: none; stroke: #1f6feb; stroke-width: 2; } .pt { fill: #1f6feb; } .axis-label { font: 12px ui-sans-serif, system-ui, sans-serif; fill: #374151; font-weight: 600; } .tick-label { font: 10px ui-sans-serif, system-ui, sans-serif; fill: #6b7280; } </style> <line x1="36.00" y1="36" x2="36.00" y2="324" class="grid"/><line x1="110.67" y1="36" x2="110.67" y2="324" class="grid"/><line x1="185.33" y1="36" x2="185.33" y2="324" class="grid"/><line x1="260.00" y1="36" x2="260.00" y2="324" class="grid"/><line x1="334.67" y1="36" x2="334.67" y2="324" class="grid"/><line x1="409.33" y1="36" x2="409.33" y2="324" class="grid"/><line x1="484.00" y1="36" x2="484.00" y2="324" class="grid"/><line x1="36" y1="310.91" x2="484" y2="310.91" class="grid"/><line x1="36" y1="252.73" x2="484" y2="252.73" class="grid"/><line x1="36" y1="194.55" x2="484" y2="194.55" class="grid"/><line x1="36" y1="136.36" x2="484" y2="136.36" class="grid"/><line x1="36" y1="78.18" x2="484" y2="78.18" class="grid"/><line x1="36" y1="252.73" x2="484" y2="252.73" class="axis" marker-end="url(#arrow)"/><line x1="260.00" y1="324" x2="260.00" y2="36" class="axis" marker-end="url(#arrow)"/><text x="488.00" y="256.73" class="axis-label">x</text><text x="266.00" y="40.00" class="axis-label">y</text><line x1="36.00" y1="248.73" x2="36.00" y2="256.73" class="tick"/><text x="36.00" y="266.73" text-anchor="middle" class="tick-label">-3</text><line x1="110.67" y1="248.73" x2="110.67" y2="256.73" class="tick"/><text x="110.67" y="266.73" text-anchor="middle" class="tick-label">-2</text><line x1="185.33" y1="248.73" x2="185.33" y2="256.73" class="tick"/><text x="185.33" y="266.73" text-anchor="middle" class="tick-label">-1</text><line x1="334.67" y1="248.73" x2="334.67" y2="256.73" class="tick"/><text x="334.67" y="266.73" text-anchor="middle" class="tick-label">1</text><line x1="409.33" y1="248.73" x2="409.33" y2="256.73" class="tick"/><text x="409.33" y="266.73" text-anchor="middle" class="tick-label">2</text><line x1="484.00" y1="248.73" x2="484.00" y2="256.73" class="tick"/><text x="484.00" y="266.73" text-anchor="middle" class="tick-label">3</text><line x1="256.00" y1="310.91" x2="264.00" y2="310.91" class="tick"/><text x="252.00" y="310.91" text-anchor="end" dominant-baseline="middle" class="tick-label">-2</text><line x1="256.00" y1="194.55" x2="264.00" y2="194.55" class="tick"/><text x="252.00" y="194.55" text-anchor="end" dominant-baseline="middle" class="tick-label">2</text><line x1="256.00" y1="136.36" x2="264.00" y2="136.36" class="tick"/><text x="252.00" y="136.36" text-anchor="end" dominant-baseline="middle" class="tick-label">4</text><line x1="256.00" y1="78.18" x2="264.00" y2="78.18" class="tick"/><text x="252.00" y="78.18" text-anchor="end" dominant-baseline="middle" class="tick-label">6</text><text x="252.00" y="266.73" class="tick-label">0</text><path d="M 36.00 49.09 L 38.24 54.30 L 40.48 59.46 L 42.72 64.56 L 44.96 69.62 L 47.20 74.62 L 49.44 79.57 L 51.68 84.46 L 53.92 89.31 L 56.16 94.10 L 58.40 98.84 L 60.64 103.52 L 62.88 108.16 L 65.12 112.74 L 67.36 117.27 L 69.60 121.75 L 71.84 126.17 L 74.08 130.54 L 76.32 134.86 L 78.56 139.13 L 80.80 143.35 L 83.04 147.51 L 85.28 151.62 L 87.52 155.68 L 89.76 159.68 L 92.00 163.64 L 94.24 167.54 L 96.48 171.39 L 98.72 175.18 L 100.96 178.93 L 103.20 182.62 L 105.44 186.26 L 107.68 189.84 L 109.92 193.38 L 112.16 196.86 L 114.40 200.29 L 116.64 203.67 L 118.88 206.99 L 121.12 210.27 L 123.36 213.49 L 125.60 216.65 L 127.84 219.77 L 130.08 222.83 L 132.32 225.84 L 134.56 228.80 L 136.80 231.71 L 139.04 234.56 L 141.28 237.36 L 143.52 240.11 L 145.76 242.81 L 148.00 245.45 L 150.24 248.05 L 152.48 250.59 L 154.72 253.07 L 156.96 255.51 L 159.20 257.89 L 161.44 260.22 L 163.68 262.50 L 165.92 264.72 L 168.16 266.90 L 170.40 269.02 L 172.64 271.09 L 174.88 273.10 L 177.12 275.07 L 179.36 276.98 L 181.60 278.84 L 183.84 280.64 L 186.08 282.40 L 188.32 284.10 L 190.56 285.75 L 192.80 287.35 L 195.04 288.89 L 197.28 290.38 L 199.52 291.82 L 201.76 293.21 L 204.00 294.55 L 206.24 295.83 L 208.48 297.06 L 210.72 298.24 L 212.96 299.36 L 215.20 300.44 L 217.44 301.46 L 219.68 302.43 L 221.92 303.34 L 224.16 304.21 L 226.40 305.02 L 228.64 305.78 L 230.88 306.48 L 233.12 307.14 L 235.36 307.74 L 237.60 308.29 L 239.84 308.79 L 242.08 309.23 L 244.32 309.63 L 246.56 309.97 L 248.80 310.25 L 251.04 310.49 L 253.28 310.67 L 255.52 310.80 L 257.76 310.88 L 260.00 310.91 L 262.24 310.88 L 264.48 310.80 L 266.72 310.67 L 268.96 310.49 L 271.20 310.25 L 273.44 309.97 L 275.68 309.63 L 277.92 309.23 L 280.16 308.79 L 282.40 308.29 L 284.64 307.74 L 286.88 307.14 L 289.12 306.48 L 291.36 305.78 L 293.60 305.02 L 295.84 304.21 L 298.08 303.34 L 300.32 302.43 L 302.56 301.46 L 304.80 300.44 L 307.04 299.36 L 309.28 298.24 L 311.52 297.06 L 313.76 295.83 L 316.00 294.55 L 318.24 293.21 L 320.48 291.82 L 322.72 290.38 L 324.96 288.89 L 327.20 287.35 L 329.44 285.75 L 331.68 284.10 L 333.92 282.40 L 336.16 280.64 L 338.40 278.84 L 340.64 276.98 L 342.88 275.07 L 345.12 273.10 L 347.36 271.09 L 349.60 269.02 L 351.84 266.90 L 354.08 264.72 L 356.32 262.50 L 358.56 260.22 L 360.80 257.89 L 363.04 255.51 L 365.28 253.07 L 367.52 250.59 L 369.76 248.05 L 372.00 245.45 L 374.24 242.81 L 376.48 240.11 L 378.72 237.36 L 380.96 234.56 L 383.20 231.71 L 385.44 228.80 L 387.68 225.84 L 389.92 222.83 L 392.16 219.77 L 394.40 216.65 L 396.64 213.49 L 398.88 210.27 L 401.12 206.99 L 403.36 203.67 L 405.60 200.29 L 407.84 196.86 L 410.08 193.38 L 412.32 189.84 L 414.56 186.26 L 416.80 182.62 L 419.04 178.93 L 421.28 175.18 L 423.52 171.39 L 425.76 167.54 L 428.00 163.64 L 430.24 159.68 L 432.48 155.68 L 434.72 151.62 L 436.96 147.51 L 439.20 143.35 L 441.44 139.13 L 443.68 134.86 L 445.92 130.54 L 448.16 126.17 L 450.40 121.75 L 452.64 117.27 L 454.88 112.74 L 457.12 108.16 L 459.36 103.52 L 461.60 98.84 L 463.84 94.10 L 466.08 89.31 L 468.32 84.46 L 470.56 79.57 L 472.80 74.62 L 475.04 69.62 L 477.28 64.56 L 479.52 59.46 L 481.76 54.30 L 484.00 49.09" class="curve"/> </svg><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 520 360" width="520" height="360" role="img" aria-label="function plot"> <defs> <marker id="arrow" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse"> <path d="M 0 0 L 10 5 L 0 10 z" fill="#4b5563"/> </marker> </defs> <style> .grid { stroke: #e5e7eb; stroke-width: 1; } .axis { stroke: #4b5563; stroke-width: 1.5; } .tick { stroke: #4b5563; stroke-width: 1; } .curve { fill: none; stroke: #1f6feb; stroke-width: 2; } .pt { fill: #1f6feb; } .axis-label { font: 12px ui-sans-serif, system-ui, sans-serif; fill: #374151; font-weight: 600; } .tick-label { font: 10px ui-sans-serif, system-ui, sans-serif; fill: #6b7280; } </style> <line x1="36.00" y1="36" x2="36.00" y2="324" class="grid"/><line x1="110.67" y1="36" x2="110.67" y2="324" class="grid"/><line x1="185.33" y1="36" x2="185.33" y2="324" class="grid"/><line x1="260.00" y1="36" x2="260.00" y2="324" class="grid"/><line x1="334.67" y1="36" x2="334.67" y2="324" class="grid"/><line x1="409.33" y1="36" x2="409.33" y2="324" class="grid"/><line x1="484.00" y1="36" x2="484.00" y2="324" class="grid"/><line x1="36" y1="310.91" x2="484" y2="310.91" class="grid"/><line x1="36" y1="252.73" x2="484" y2="252.73" class="grid"/><line x1="36" y1="194.55" x2="484" y2="194.55" class="grid"/><line x1="36" y1="136.36" x2="484" y2="136.36" class="grid"/><line x1="36" y1="78.18" x2="484" y2="78.18" class="grid"/><line x1="36" y1="252.73" x2="484" y2="252.73" class="axis" marker-end="url(#arrow)"/><line x1="260.00" y1="324" x2="260.00" y2="36" class="axis" marker-end="url(#arrow)"/><text x="488.00" y="256.73" class="axis-label">x</text><text x="266.00" y="40.00" class="axis-label">y</text><line x1="36.00" y1="248.73" x2="36.00" y2="256.73" class="tick"/><text x="36.00" y="266.73" text-anchor="middle" class="tick-label">-3</text><line x1="110.67" y1="248.73" x2="110.67" y2="256.73" class="tick"/><text x="110.67" y="266.73" text-anchor="middle" class="tick-label">-2</text><line x1="185.33" y1="248.73" x2="185.33" y2="256.73" class="tick"/><text x="185.33" y="266.73" text-anchor="middle" class="tick-label">-1</text><line x1="334.67" y1="248.73" x2="334.67" y2="256.73" class="tick"/><text x="334.67" y="266.73" text-anchor="middle" class="tick-label">1</text><line x1="409.33" y1="248.73" x2="409.33" y2="256.73" class="tick"/><text x="409.33" y="266.73" text-anchor="middle" class="tick-label">2</text><line x1="484.00" y1="248.73" x2="484.00" y2="256.73" class="tick"/><text x="484.00" y="266.73" text-anchor="middle" class="tick-label">3</text><line x1="256.00" y1="310.91" x2="264.00" y2="310.91" class="tick"/><text x="252.00" y="310.91" text-anchor="end" dominant-baseline="middle" class="tick-label">-2</text><line x1="256.00" y1="194.55" x2="264.00" y2="194.55" class="tick"/><text x="252.00" y="194.55" text-anchor="end" dominant-baseline="middle" class="tick-label">2</text><line x1="256.00" y1="136.36" x2="264.00" y2="136.36" class="tick"/><text x="252.00" y="136.36" text-anchor="end" dominant-baseline="middle" class="tick-label">4</text><line x1="256.00" y1="78.18" x2="264.00" y2="78.18" class="tick"/><text x="252.00" y="78.18" text-anchor="end" dominant-baseline="middle" class="tick-label">6</text><text x="252.00" y="266.73" class="tick-label">0</text><path d="M 36.00 49.09 L 38.24 54.30 L 40.48 59.46 L 42.72 64.56 L 44.96 69.62 L 47.20 74.62 L 49.44 79.57 L 51.68 84.46 L 53.92 89.31 L 56.16 94.10 L 58.40 98.84 L 60.64 103.52 L 62.88 108.16 L 65.12 112.74 L 67.36 117.27 L 69.60 121.75 L 71.84 126.17 L 74.08 130.54 L 76.32 134.86 L 78.56 139.13 L 80.80 143.35 L 83.04 147.51 L 85.28 151.62 L 87.52 155.68 L 89.76 159.68 L 92.00 163.64 L 94.24 167.54 L 96.48 171.39 L 98.72 175.18 L 100.96 178.93 L 103.20 182.62 L 105.44 186.26 L 107.68 189.84 L 109.92 193.38 L 112.16 196.86 L 114.40 200.29 L 116.64 203.67 L 118.88 206.99 L 121.12 210.27 L 123.36 213.49 L 125.60 216.65 L 127.84 219.77 L 130.08 222.83 L 132.32 225.84 L 134.56 228.80 L 136.80 231.71 L 139.04 234.56 L 141.28 237.36 L 143.52 240.11 L 145.76 242.81 L 148.00 245.45 L 150.24 248.05 L 152.48 250.59 L 154.72 253.07 L 156.96 255.51 L 159.20 257.89 L 161.44 260.22 L 163.68 262.50 L 165.92 264.72 L 168.16 266.90 L 170.40 269.02 L 172.64 271.09 L 174.88 273.10 L 177.12 275.07 L 179.36 276.98 L 181.60 278.84 L 183.84 280.64 L 186.08 282.40 L 188.32 284.10 L 190.56 285.75 L 192.80 287.35 L 195.04 288.89 L 197.28 290.38 L 199.52 291.82 L 201.76 293.21 L 204.00 294.55 L 206.24 295.83 L 208.48 297.06 L 210.72 298.24 L 212.96 299.36 L 215.20 300.44 L 217.44 301.46 L 219.68 302.43 L 221.92 303.34 L 224.16 304.21 L 226.40 305.02 L 228.64 305.78 L 230.88 306.48 L 233.12 307.14 L 235.36 307.74 L 237.60 308.29 L 239.84 308.79 L 242.08 309.23 L 244.32 309.63 L 246.56 309.97 L 248.80 310.25 L 251.04 310.49 L 253.28 310.67 L 255.52 310.80 L 257.76 310.88 L 260.00 310.91 L 262.24 310.88 L 264.48 310.80 L 266.72 310.67 L 268.96 310.49 L 271.20 310.25 L 273.44 309.97 L 275.68 309.63 L 277.92 309.23 L 280.16 308.79 L 282.40 308.29 L 284.64 307.74 L 286.88 307.14 L 289.12 306.48 L 291.36 305.78 L 293.60 305.02 L 295.84 304.21 L 298.08 303.34 L 300.32 302.43 L 302.56 301.46 L 304.80 300.44 L 307.04 299.36 L 309.28 298.24 L 311.52 297.06 L 313.76 295.83 L 316.00 294.55 L 318.24 293.21 L 320.48 291.82 L 322.72 290.38 L 324.96 288.89 L 327.20 287.35 L 329.44 285.75 L 331.68 284.10 L 333.92 282.40 L 336.16 280.64 L 338.40 278.84 L 340.64 276.98 L 342.88 275.07 L 345.12 273.10 L 347.36 271.09 L 349.60 269.02 L 351.84 266.90 L 354.08 264.72 L 356.32 262.50 L 358.56 260.22 L 360.80 257.89 L 363.04 255.51 L 365.28 253.07 L 367.52 250.59 L 369.76 248.05 L 372.00 245.45 L 374.24 242.81 L 376.48 240.11 L 378.72 237.36 L 380.96 234.56 L 383.20 231.71 L 385.44 228.80 L 387.68 225.84 L 389.92 222.83 L 392.16 219.77 L 394.40 216.65 L 396.64 213.49 L 398.88 210.27 L 401.12 206.99 L 403.36 203.67 L 405.60 200.29 L 407.84 196.86 L 410.08 193.38 L 412.32 189.84 L 414.56 186.26 L 416.80 182.62 L 419.04 178.93 L 421.28 175.18 L 423.52 171.39 L 425.76 167.54 L 428.00 163.64 L 430.24 159.68 L 432.48 155.68 L 434.72 151.62 L 436.96 147.51 L 439.20 143.35 L 441.44 139.13 L 443.68 134.86 L 445.92 130.54 L 448.16 126.17 L 450.40 121.75 L 452.64 117.27 L 454.88 112.74 L 457.12 108.16 L 459.36 103.52 L 461.60 98.84 L 463.84 94.10 L 466.08 89.31 L 468.32 84.46 L 470.56 79.57 L 472.80 74.62 L 475.04 69.62 L 477.28 64.56 L 479.52 59.46 L 481.76 54.30 L 484.00 49.09" class="curve"/> </svg>
-
description textHigh-school math stdlib (English)High-school math stdlib (English)
-
df formula$$2 \cdot x$$$$2 \cdot x$$
-
f formula$$x^{2} - 2$$$$x^{2} - 2$$
-
markup textocclusionocclusion
-
roots list · 2
# value 1 -1.4142135624 2 1.4142135624 # value 1 -1.4142135624 2 1.4142135624 -
title textlib/math — numbers, formulas, plotslib/math — numbers, formulas, plots
-
ty textformulaformula
可执行知识 · 输入、返回与依据
这份文档怎样成为可调用的知识
1 个知识单元 · 16 个结构步骤。先读输入、返回与调用边界,再按需查看依赖和依据。
以下来自静态分析,不代表程序已经运行、测试通过或内容已获领域确认。实际运行见正文标注与“运行与结果”。
main程序入口
这是程序入口或对象声明。成员函数的输入输出在各自说明中列出。
源码中的返回契约
any · None; execute this page's documented steps in order and observe their output or stated effects
调用边界
输出文本。权限由实际运行入口授予;静态副作用信息不等于运行许可。
当前有哪些依据
- 语法与引用
- 检查通过;检查通过
- 契约检查
- 尚未检查
- 测试记录
- 没有可用记录
- 内容来源
- 尚无已核验证据
- 领域审阅
- 尚未进行领域审阅
查看本单元的结构步骤
这是源码结构,不是实际执行时序;正文引用不会因阅读而执行。
- 调用Compute ty
- 正文引用Display this step's result
- 正文引用Compute df
- 正文引用Display this step's result
- 正文引用Compute roots
- 正文引用Display this step's result
- 正文引用Compute _svg
- 正文引用Display this step's result
- 调用Display this step's result
- 调用Compute df
- 调用Display this step's result
- 调用Compute roots
- 调用Display this step's result
- 调用Compute _svg
- 调用Display this step's result
- 正文引用Compute ty
技术详情:身份、摘要与原始状态
- 目标标识
mq://public/stdlib%2Fmath/type/main- 制品摘要(未检查锁定状态)
sha256:43c1a102b0b77717893b11ba38a66bf686a5fde45c2578e86bf3c1747bb9f2ef- 依赖标识
- 原始验证状态
parse: passed; resolve: passed; contract: unchecked; execution: not_run; tests: unknown; evidence: unverified; domain: unreviewed
运行与结果
完整源码
--- markup: occlusion title: lib/math — numbers, formulas, plots description: High-school math stdlib (English) import: math: lib/math.mq.md --- # main | 返回 | 类型 | 说明 | |---|---|---| | result | any | None; execute this page's documented steps in order and observe their output or stated effects | Import lib/math.mq.md. Runtime types: num (float) and formula (symbolic tree). Bind a formula with an empty-RHS assign followed by a `$$…$$` fence (same shape as table assigns). In view, Structure renders that fence with KaTeX. `f` = $$ x^2 - 2 $$ Numeric helpers: pi, e, num, add/sub/mul/div/pow, sin/cos/tan, sqrt/abs/ln/exp, floor/ceil, min/max. Random: seed, random, random_int (reproducible after seed). Symbolic: formula(text), simplify, expand, diff, subs, eval, solve. Plotting (already in the library): plot / plot_points / plot_conic return SVG text. Axes include arrows and tick labels; grid is on by default (pass grid=False / grid=假 to hide). Optional path= writes a file under the sandbox. With no path, CLI auto-writes stem-plot-n.svg and prints plot: …; view embeds the SVG under Execution. diff / simplify / expand / partial subs return formula values so you can chain (e.g. differentiate twice, then plot or eval). We first **ty = [Compute ty](type(`f`))** for the next step. We now **[Display this step's result](> print text=`ty`)**. We first **df = [Compute df](math.diff(formula=`f`, var="x"))** for the next step. We now **[Display this step's result](> print text=`df`)**. We first **roots = [Compute roots](math.solve(formula=`f`, var="x"))** for the next step. We now **[Display this step's result](> print text=`roots`)**. We first **_svg = [Compute _svg](math.plot(formula=`f`, var="x", min=-3, max=3))** for the next step. We now **[Display this step's result](> print text="plot-ok")**.