Published
Edited
Jun 5, 2018
Insert cell
Insert cell
reciprocal = (a) => {
const b = 1.466 - a;
const c = a * b;
const d = 1.0012 - c;
const e = d * b;
return e * 4;
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
normalize = (val) => {
let shift = 0;
[3, 2, 1].map(s => {
if (val > Math.pow(2, s - 1)) {
shift += s;
val /= Math.pow(2, s);
}
});
return {
val: val,
shift: shift
};
}
Insert cell
Insert cell
Insert cell
reciprocal2 = val => {
const a = val;
const b = normalize(a);
const c = reciprocal(b.val);
const d = c / (1 << b.shift);
return d;
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more