Update cetz & ci
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
#import "@local/handout:0.1.0": *
|
||||
#import "@preview/cetz:0.3.1"
|
||||
#import "@preview/cetz-plot:0.1.0": plot, chart
|
||||
#import "@preview/cetz:0.4.2"
|
||||
#import "@preview/cetz-plot:0.1.2": chart, plot
|
||||
|
||||
= Integers and Floats
|
||||
|
||||
@ -44,19 +44,11 @@ This allows us to improve the average error of our linear approximation:
|
||||
{
|
||||
let domain = (0, 1)
|
||||
|
||||
plot.add(
|
||||
f1,
|
||||
domain: domain,
|
||||
label: $log(1+x)$,
|
||||
style: (stroke: ogrape),
|
||||
)
|
||||
plot.add(f1, domain: domain, label: $log(1+x)$, style: (
|
||||
stroke: ogrape,
|
||||
))
|
||||
|
||||
plot.add(
|
||||
f2,
|
||||
domain: domain,
|
||||
label: $x$,
|
||||
style: (stroke: oblue),
|
||||
)
|
||||
plot.add(f2, domain: domain, label: $x$, style: (stroke: oblue))
|
||||
},
|
||||
)
|
||||
})
|
||||
@ -90,19 +82,11 @@ This allows us to improve the average error of our linear approximation:
|
||||
{
|
||||
let domain = (0, 1)
|
||||
|
||||
plot.add(
|
||||
f1,
|
||||
domain: domain,
|
||||
label: $log(1+x)$,
|
||||
style: (stroke: ogrape),
|
||||
)
|
||||
plot.add(f1, domain: domain, label: $log(1+x)$, style: (
|
||||
stroke: ogrape,
|
||||
))
|
||||
|
||||
plot.add(
|
||||
f2,
|
||||
domain: domain,
|
||||
label: $x$,
|
||||
style: (stroke: oblue),
|
||||
)
|
||||
plot.add(f2, domain: domain, label: $x$, style: (stroke: oblue))
|
||||
},
|
||||
)
|
||||
})
|
||||
@ -120,16 +104,13 @@ We won't bother with this---we'll simply leave the correction term as an opaque
|
||||
|
||||
#v(1fr)
|
||||
|
||||
#note(
|
||||
type: "Note",
|
||||
[
|
||||
"Average error" above is simply the area of the region between the two graphs:
|
||||
$
|
||||
integral_0^1 abs( #v(1mm) log(1+x)_2 - (x+epsilon) #v(1mm))
|
||||
$
|
||||
Feel free to ignore this note, it isn't a critical part of this handout.
|
||||
],
|
||||
)
|
||||
#note(type: "Note", [
|
||||
"Average error" above is simply the area of the region between the two graphs:
|
||||
$
|
||||
integral_0^1 abs(#v(1mm) log(1+x)_2 - (x+epsilon) #v(1mm))
|
||||
$
|
||||
Feel free to ignore this note, it isn't a critical part of this handout.
|
||||
])
|
||||
|
||||
|
||||
#pagebreak()
|
||||
@ -149,12 +130,11 @@ $
|
||||
Let $E$ and $F$ be the exponent and float bits of $x_f$. \
|
||||
We then have:
|
||||
$
|
||||
log_2(x_f)
|
||||
&= log_2 ( 2^(E-127) times (1 + (F) / (2^23)) ) \
|
||||
&= E - 127 + log_2(1 + F / (2^23)) \
|
||||
& approx E-127 + F / (2^23) + epsilon \
|
||||
&= 1 / (2^23)(2^23 E + F) - 127 + epsilon \
|
||||
&= 1 / (2^23)(x_i) - 127 + epsilon
|
||||
log_2(x_f) & = log_2 ( 2^(E-127) times (1 + (F) / (2^23)) ) \
|
||||
& = E - 127 + log_2(1 + F / (2^23)) \
|
||||
& approx E-127 + F / (2^23) + epsilon \
|
||||
& = 1 / (2^23)(2^23 E + F) - 127 + epsilon \
|
||||
& = 1 / (2^23)(x_i) - 127 + epsilon
|
||||
$
|
||||
])
|
||||
|
||||
|
Reference in New Issue
Block a user