Skip to content

Commit fd8fbd2

Browse files
update to allow for inline math notation
1 parent e227f31 commit fd8fbd2

3 files changed

Lines changed: 15 additions & 6 deletions

File tree

.github/skills/markdown-component-edit/references/component-patterns.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,17 +88,26 @@ Rules:
8888

8989
## Mathematical expressions
9090

91-
To display a mathematical expression inline, encase the expression in `\(...\)`.
91+
Use `\(...\)` to display a mathematical expression inline.
9292

9393
For example:
9494

9595
```md
9696
\(\sqrt{re^2 + im^2}\)
9797
```
98-
To display a mathematical expression in a new line, encase the expression in `$$...$$`.
98+
99+
Use `$$...$$` or `\[...\]` to display a mathematical expression in a block.
99100

100101
For example:
101102

102103
```md
103104
$$re_{new} = re_z^2 - im_z^2 + re_c$$
104-
```
105+
```
106+
107+
or
108+
109+
```md
110+
\[
111+
re_{new} = re_z^2 - im_z^2 + re_c
112+
\]
113+
```

content/learning-paths/servers-and-cloud-computing/performix-mcp-agent/4-optimize.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ The agent will typically surface these optimizations itself based on the profili
2323

2424
### Eliminate the sqrt in the escape check
2525

26-
The inner loop in `Mandelbrot::getIterations` calls `std::abs(z)` on every iteration to check whether the point has escaped. `std::abs` for `std::complex<double>` computes \(\sqrt{re^2 + im^2}\) via `hypotf64` — a full square root on every iteration. The escape condition \(abs(z) > THRESHOLD\) is mathematically equivalent to \(re^2 + im^2 > THRESHOLD^2\), so the square root is never needed.
26+
The inner loop in `Mandelbrot::getIterations` calls `std::abs(z)` on every iteration to check whether the point has escaped. `std::abs` for `std::complex<double>` computes $\sqrt{re^2 + im^2}$ via `hypotf64` — a full square root on every iteration. The escape condition $abs(z) > THRESHOLD$ is mathematically equivalent to $re^2 + im^2 > THRESHOLD^2$, so the square root is never needed.
2727

2828
Ask the agent to apply the fix, rebuild, and re-profile in one step. If the agent hasn't already proposed this change, use the following prompt:
2929

@@ -45,7 +45,7 @@ The hotspot distribution shifts: `getIterations` drops from 28.5% to 18.4% self-
4545

4646
With `hypotf64` and `__complex_abs` removed, the profile now shows `std::complex` operator symbols (`operator+`, `operator*=`, `operator*`, `operator+=`, `__muldc3`, `__rep`) collectively consuming the majority of CPU time. These are all function-call overhead: the debug build disables inlining, so every arithmetic operation on `std::complex<double>` dispatches through the C++ standard library machinery.
4747

48-
The fix is to replace `std::complex<double>` in `getIterations` with plain `double` variables for the real and imaginary parts. The Mandelbrot iteration \(z_{n+1} = z_n^2 + c\) expands algebraically to:
48+
The fix is to replace `std::complex<double>` in `getIterations` with plain `double` variables for the real and imaginary parts. The Mandelbrot iteration $z_{n+1} = z_n^2 + c$ expands algebraically to:
4949

5050
$$re_{new} = re_z^2 - im_z^2 + re_c$$
5151
$$im_{new} = 2 \cdot re_z \cdot im_z + im_c$$

themes/arm-design-system-hugo-theme/layouts/partials/math.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
MathJax = {
44
tex: {
55
displayMath: [['\\[', '\\]'], ['$$', '$$']], // block
6-
inlineMath: [['\\(', '\\)']] // inline
6+
inlineMath: [['\\(', '\\)'], ['$', '$']] // inline
77
},
88
loader:{
99
load: ['ui/safe']

0 commit comments

Comments
 (0)