Skip to content
Permalink
Browse files

Improve formatting

  • Loading branch information...
ageron committed May 18, 2018
1 parent aeb639b commit 5f9ae7b3be6422f9f6f8c889ae49e31d92e002b9
Showing with 8 additions and 8 deletions.
  1. +8 −8 extra_autodiff.ipynb
@@ -633,23 +633,23 @@
"source": [
"Dual numbers have their own arithmetic rules, which are generally quite natural. For example:\n",
"\n",
"Addition:\n",
"**Addition**\n",
"\n",
"$(a_1 + b_1\\epsilon) + (a_2 + b_2\\epsilon) = (a_1 + a_2) + (b_1 + b_2)\\epsilon$\n",
"\n",
"Subtraction:\n",
"**Subtraction**\n",
"\n",
"$(a_1 + b_1\\epsilon) - (a_2 + b_2\\epsilon) = (a_1 - a_2) + (b_1 - b_2)\\epsilon$\n",
"\n",
"Multiplication:\n",
"**Multiplication**\n",
"\n",
"$(a_1 + b_1\\epsilon) * (a_2 + b_2\\epsilon) = (a_1 a_2) + (a_1 b_2 + a_2 b_1)\\epsilon + b_1 b_2\\epsilon^2 = (a_1 a_2) + (a_1b_2 + a_2b_1)\\epsilon$\n",
"$(a_1 + b_1\\epsilon) \\times (a_2 + b_2\\epsilon) = (a_1 a_2) + (a_1 b_2 + a_2 b_1)\\epsilon + b_1 b_2\\epsilon^2 = (a_1 a_2) + (a_1b_2 + a_2b_1)\\epsilon$\n",
"\n",
"Division:\n",
"**Division**\n",
"\n",
"$\\dfrac{a_1 + b_1\\epsilon}{a_2 + b_2\\epsilon} = \\dfrac{a_1 + b_1\\epsilon}{a_2 + b_2\\epsilon} \\cdot \\dfrac{a_2 - b_2\\epsilon}{a_2 - b_2\\epsilon} = \\dfrac{a_1 a_2 + (b_1 a_2 - a_1 b_2)\\epsilon - b_1 b_2\\epsilon^2}{{a_2}^2 + (a_2 b_2 - a_2 b_2)\\epsilon - {b_2}^2\\epsilon} = \\dfrac{a_1}{a_2} + \\dfrac{a_1 b_2 - b_1 a_2}{{a_2}^2}\\epsilon$\n",
"\n",
"Power:\n",
"**Power**\n",
"\n",
"$(a + b\\epsilon)^n = a^n + (n a^{n-1}b)\\epsilon$\n",
"\n",
@@ -660,7 +660,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Let's create a class to represent dual numbers, and implement a few operations (addition and multiplication). You try adding some more if you want."
"Let's create a class to represent dual numbers, and implement a few operations (addition and multiplication). You can try adding some more if you want."
]
},
{
@@ -729,7 +729,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"$(3 + 4ε)\\times(5 + 7ε) = 3 \\times 5 + 3 \\times 7ε + 4ε \\times 5 + 4ε \\times 7ε = 15 + 21ε + 20ε + 28ε^2 = 15 + 41ε + 28 \\times 0 = 15 + 41ε$"
"$(3 + 4ε)\\times(5 + 7ε)$ = $3 \\times 5 + 3 \\times 7ε + 4ε \\times 5 + 4ε \\times 7ε$ = $15 + 21ε + 20ε + 28ε^2$ = $15 + 41ε + 28 \\times 0$ = $15 + 41ε$"
]
},
{

0 comments on commit 5f9ae7b

Please sign in to comment.
You can’t perform that action at this time.