mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-29 17:55:45 +01:00
linesweeper: the crossing height in docs/sweep.typ divides the starting gap
lem-intersection-height-error defined t as the ending gap alpha(y_1) - beta(y_1) over the sum of both gaps. The gap beta - alpha between two segments is D0 (1 - t) - D1 t, which is zero at t = D0 / (D0 + D1), with D0 = beta(y_0) - alpha(y_0) the starting gap. With D0 = 1 and D1 = 3 the old formula gave t = 0.75, while the segments cross at t = 0.25. The code in src/curve/line.rs already divides the starting gap. The lemma and its proof now use the starting gap as the numerator c, which also matches the proof's alpha(y) - beta(y) = -c + s d. SOURCE.json records the patch in local_patches and the new sha256 of docs/sweep.typ. README.craft.md and NOTICE say one file is changed.
This commit is contained in:
1 parent
f211604aad
commit
acfedcd148
4 files changed
+25
-18
No files matched your search
@@ -218,10 +218,10 @@ applications retain their own document-font selection and licensing policy.
|
||||
linesweeper
|
||||
|
||||
linesweeper 0.5.0 (https://crates.io/crates/linesweeper/0.5.0), MIT OR Apache-2.0, is stored in
|
||||
vendor/linesweeper with its upstream license files and no file changed. Its manifest names Joe Neeman
|
||||
as author, and its LICENSE-MIT reads "Copyright (c) 2018 Raph Levien". See
|
||||
vendor/linesweeper/README.craft.md and vendor/linesweeper/SOURCE.json for provenance and the files
|
||||
left out.
|
||||
vendor/linesweeper with its upstream license files and one local patch, to docs/sweep.typ. Its
|
||||
manifest names Joe Neeman as author, and its LICENSE-MIT reads "Copyright (c) 2018 Raph Levien". See
|
||||
vendor/linesweeper/README.craft.md and vendor/linesweeper/SOURCE.json for provenance, local changes
|
||||
and the files left out.
|
||||
|
||||
Platform lifecycle source provenance
|
||||
|
||||
|
||||
Vendored
+11
-6
@@ -1,15 +1,20 @@
|
||||
# Local linesweeper 0.5.0 copy
|
||||
|
||||
This is the crates.io linesweeper 0.5.0 package (MIT OR Apache-2.0) with some files left out and no
|
||||
This is the crates.io linesweeper 0.5.0 package (MIT OR Apache-2.0) with some files left out and one
|
||||
file changed. `.cargo_vcs_info.json` names the commit it was packaged from,
|
||||
`824b0791a750f7b27b8edcbb6c6244d0e629875e`. That commit is not in the GitHub repository the manifest
|
||||
names, which is archived; its README says development moved off GitHub.
|
||||
|
||||
Every file here except this one and `SOURCE.json` is byte for byte the file in the `.crate` archive.
|
||||
`SOURCE.json` records the hash of the `.crate` download (`source_archive_sha256`) and, for every file
|
||||
kept, the hash in the package (`source_sha256`) and the hash here (`sha256`). `upstream_repository` is
|
||||
null because no public repository this copy can name holds `upstream_revision`. `local_patches` is
|
||||
empty.
|
||||
Every file here except this one, `SOURCE.json` and `docs/sweep.typ` is byte for byte the file in the
|
||||
`.crate` archive. `SOURCE.json` records the hash of the `.crate` download (`source_archive_sha256`)
|
||||
and, for every file kept, the hash in the package (`source_sha256`) and the hash here (`sha256`).
|
||||
`upstream_repository` is null because no public repository this copy can name holds
|
||||
`upstream_revision`. `local_patches` lists each change:
|
||||
|
||||
- `docs/sweep.typ`: the crossing-height lemma (`lem-intersection-height-error`) and its proof divide
|
||||
the starting gap `beta(y_0) - alpha(y_0)` by the sum of both gaps. With the ending gap
|
||||
`alpha(y_1) - beta(y_1)` as the numerator, gaps of 1 and 3 gave `t = 0.75`, while the segments
|
||||
cross at `t = 0.25`.
|
||||
|
||||
`omitted_files` lists the 43 files of the package left out here, with their hashes:
|
||||
|
||||
|
||||
Vendored
+4
-2
@@ -7,7 +7,9 @@
|
||||
"upstream_repository": null,
|
||||
"upstream_revision": "824b0791a750f7b27b8edcbb6c6244d0e629875e",
|
||||
"upstream_directory": "",
|
||||
"local_patches": [],
|
||||
"local_patches": [
|
||||
"In `docs/sweep.typ`, the crossing-height lemma and its proof use the starting gap `beta(y_0) - alpha(y_0)` as the numerator of `t`, instead of the ending gap `alpha(y_1) - beta(y_1)`, so that `y_0 + t(y_1 - y_0)` is the height where the segments cross."
|
||||
],
|
||||
"files": [
|
||||
{ "path": ".cargo_vcs_info.json", "source_sha256": "47fba6a9dbdf445a5c97f783c9be62093035f9d5e5cdc2cf3216ad8259bcd8fc", "source_git_blob": null, "sha256": "47fba6a9dbdf445a5c97f783c9be62093035f9d5e5cdc2cf3216ad8259bcd8fc" },
|
||||
{ "path": ".gitignore", "source_sha256": "88b59092499ae05234330eb7d0b01e953e969caf05261530e3765eef02536cf0", "source_git_blob": null, "sha256": "88b59092499ae05234330eb7d0b01e953e969caf05261530e3765eef02536cf0" },
|
||||
@@ -21,7 +23,7 @@
|
||||
{ "path": "benches/linebender_logo.rs", "source_sha256": "d10867f43439d37f0e1da5d30eaed9ab3bfbe655ed47212f65dc20ab4db65cb3", "source_git_blob": null, "sha256": "d10867f43439d37f0e1da5d30eaed9ab3bfbe655ed47212f65dc20ab4db65cb3" },
|
||||
{ "path": "benches/painted_dreams.rs", "source_sha256": "073008db93840d380710e13ed3ae38e08cb823f10c12e5f838dac1ccf37eaecf", "source_git_blob": null, "sha256": "073008db93840d380710e13ed3ae38e08cb823f10c12e5f838dac1ccf37eaecf" },
|
||||
{ "path": "benches/synthetic.rs", "source_sha256": "7ce59bef2e1c4f28b00cb89feb15bc71ca4b098a8d27e7b02ea699aca9bcc810", "source_git_blob": null, "sha256": "7ce59bef2e1c4f28b00cb89feb15bc71ca4b098a8d27e7b02ea699aca9bcc810" },
|
||||
{ "path": "docs/sweep.typ", "source_sha256": "4766082c8672a7bb4356b5581043489c13b4e3fb8931ba3a5f0a473fab0172f3", "source_git_blob": null, "sha256": "4766082c8672a7bb4356b5581043489c13b4e3fb8931ba3a5f0a473fab0172f3" },
|
||||
{ "path": "docs/sweep.typ", "source_sha256": "4766082c8672a7bb4356b5581043489c13b4e3fb8931ba3a5f0a473fab0172f3", "source_git_blob": null, "sha256": "73860d363c4a12140e1cbdf8f02d050ed6c526a6f9b3d5d537ad51bfb4962b5d" },
|
||||
{ "path": "examples/boolean_op.rs", "source_sha256": "3b38a1ccda7e736cce4b191a3a45ab4824c4c365190e3eb637b2fb39b5996c9f", "source_git_blob": null, "sha256": "3b38a1ccda7e736cce4b191a3a45ab4824c4c365190e3eb637b2fb39b5996c9f" },
|
||||
{ "path": "examples/bus.rs", "source_sha256": "e206a08be73899f564188052c8ecc15526b54606e52ee2935a64ce6b5723da33", "source_git_blob": null, "sha256": "e206a08be73899f564188052c8ecc15526b54606e52ee2935a64ce6b5723da33" },
|
||||
{ "path": "examples/curve_metrics.rs", "source_sha256": "0db6a5327fd2119a03a9a66624fea3e04b6bbb519655667ad30487aee6c787d2", "source_git_blob": null, "sha256": "0db6a5327fd2119a03a9a66624fea3e04b6bbb519655667ad30487aee6c787d2" },
|
||||
|
||||
Vendored
+6
-6
@@ -719,7 +719,7 @@ and assume that $beta(y_0) - alpha(y_0) >= 0$ and
|
||||
$
|
||||
alpha(y_1) - beta(y_1) > 16/3 (epsilon + 2 epsilon_0 M).
|
||||
$
|
||||
Define $t = (alpha(y_1) - beta(y_1)) / (alpha(y_1) - beta(y_1) + beta(y_0) - alpha(y_0)$ and set $y = y_0 + t(y_1 - y_0)$. The
|
||||
Define $t = (beta(y_0) - alpha(y_0)) / (beta(y_0) - alpha(y_0) + alpha(y_1) - beta(y_1))$ and set $y = y_0 + t(y_1 - y_0)$. The
|
||||
natural way to compute $y$ produces an approximation $hat(y)$ satisfying
|
||||
$
|
||||
|alpha(hat(y)) - beta(hat(y))| <= 4(epsilon + 2 epsilon_0 M) (1 + max(1/m_alpha, 1/m_beta)),
|
||||
@@ -731,18 +731,18 @@ Basically, this says we can find a good approximate crossing height as long as t
|
||||
|
||||
#proof[
|
||||
First, note that at least one of $alpha(y_0)$ or $beta(y_0)$ is calculated exactly; similarly for $alpha(y_1)$ and $beta(y_1)$.
|
||||
Therefore the absolute error in calculating $alpha(y_1) - beta(y_1)$ is at most $epsilon + epsilon_0 M$ (where the $epsilon_0 M$ comes
|
||||
Therefore the absolute error in calculating $beta(y_0) - alpha(y_0)$ is at most $epsilon + epsilon_0 M$ (where the $epsilon_0 M$ comes
|
||||
from rounding after the summation) and the absolute error in calculating
|
||||
$(alpha(y_1) - beta(y_1)) + (beta(y_0) - alpha(y_0))$ is at most $2 epsilon + 3 epsilon_0 M$.
|
||||
These errors aren't independent, though, since both terms involve a computation of $alpha(y_1) - beta(y_1)$.
|
||||
Specifically, let $c = alpha(y_1) - beta(y_1)$ and let $d = (alpha(y_1) - beta(y_1)) + (beta(y_0) - alpha(y_0))$; suppose
|
||||
$(beta(y_0) - alpha(y_0)) + (alpha(y_1) - beta(y_1))$ is at most $2 epsilon + 3 epsilon_0 M$.
|
||||
These errors aren't independent, though, since both terms involve a computation of $beta(y_0) - alpha(y_0)$.
|
||||
Specifically, let $c = beta(y_0) - alpha(y_0)$ and let $d = (beta(y_0) - alpha(y_0)) + (alpha(y_1) - beta(y_1))$; suppose
|
||||
our calculation of $c$ has error $epsilon_c$ and our calculation of $d$ has error $epsilon_d$. Then
|
||||
|
||||
$
|
||||
|epsilon_c - epsilon_d| <= epsilon + 2 epsilon_0 M,
|
||||
$ <eq-error-cancellation>
|
||||
|
||||
because this is the *additional* error introduced into $d$ by computing $beta(y_0) - alpha(y_0)$ and adding it to the other term.
|
||||
because this is the *additional* error introduced into $d$ by computing $alpha(y_1) - beta(y_1)$ and adding it to the other term.
|
||||
|
||||
Now we consider the quotient
|
||||
|
||||
|
||||
Reference in new issue
Block a user