Live data from Hacker News

Show HN: Insect – a high-precision scientific calculator with physical units

insect.sh

121–130 of 205 posts

Re: Show HN: Insect – a high-precision scientific calculator with physical units

#122

So "megabytes" appears to be the power-of-ten unit, which is generally not that helpful in practice. ≫ 6 megabytes to bytes 6 MB -> B = 6000000 B Assuming you're sticking with the power-of-ten unit, that means you should really grow support for the (sigh) "mebibytes" family of units; i.e., what some folks are retro-actively calling the power-of-two byte unit. ≫ 6 mebibytes to bytes 6 × mebibytes -> B Unknown identifi…

Thanks! It has already been requested: https://github.com/sharkdp/insect/issues/81

Re: Show HN: Insect – a high-precision scientific calculator with physical units

#123

Needs more temperature scales than just kelvin. US Engineering units of energy would also be help certain people: such as BTUs British Thermal Units etc.

I thought about it for some time and decided not to add Celsius and Fahrenheit: https://github.com/sharkdp/insect/issues/68

They are useful, of course, when it comes to simple unit conversions. But they lead to all kinds of problems if you start using them in calculations (which is what Insect is mostly for).

Re: Show HN: Insect – a high-precision scientific calculator with physical units

#125

Kudos! I would love to see two more things: 1. Propagation of uncertainty.[1] I often yearned for a calculator that automatically propagated uncertainties for me while writing my (high-school) lab reports. I think it would be life-saver functionality for many students at the very least. 2. True high-precision. I don't know how Insect works under the hood (so maybe you are already doing it this way) but instead of usi…

I absolutely agree with these requests! I am so desperate for an uncertainty-aware/unit-aware calculator that I tried implementing one myself, even though it is quite beyond my skill-set. I gave up and used Mathematica (more on that below). Two comments on the requests:

- Most existing calculators that offer propagation of uncertainty use a simplified formula -- the one with the square root and the partial derivatives. That's OK for lab courses. But in real life, the distributions of the input parameters are non-Gaussian, the formulas depend on each other in subtle ways that are easy to miss, and you have to deal with systematic and statistic errors (precision vs. accuracy). Most researches I know, myself included, sort-of fudge this with pen-and-paper and Excel, and end up underestimating their errors... In my view, the best solution is a Monte-Carlo type calculation, where you draw the input parameters from their respective distributions, then do the calculation, and repeat 10000 times. The mean and the std deviation gives you final result.

- Arbitrary precision is doable, but often unnecessary. To me, it was always more important to know when the result is numerical garbage (in which case I rearrange the equations to make them more computer-friendly), than to choose some precision up-front, hoping it would be enough. For me, interval arithmetic [1] is the best solution. All numbers are represented by the next higher and next lower floating point number, and each calculation results in a new interval, where the result is guaranteed to be in the interval. Often, the intervals blow up unnecessarily, but are still much smaller than the desired accuracy or precision. These days, whenever I get an unexpected result, I repeat the calculation with interval arithmetic in Mathematica or Matlab to exclude numerical errors. Interval arithmetic is not very costly in terms of run-time, and there are great libraries out there.

The unit-aware, uncertainty aware calculator that I ended up using for my PhD-thesis was Mathematica. Mathematica deals with units somewhat well and iterates over lists natively. You can write standard formulas and feed them lists for the Monte-Carlo calculation. However, unit calculations are extremely slow. My workaround split the calculation into one unit-calculation and 10000 unit-less calculations. However, I ran into so many Mathematica bugs and quirks that hosed the calculation ("transparent" Mathematica-updates that changed the result, file corruption (!), swalled minus-signs (!!)) that I cannot possibly recommend Mathematica for anything but toy projects.

Great work! I will keep a close eye on this awesom project!

[1]: http://subs.emis.de/LNI/Seminar/Seminar07/148.pdf

Re: Show HN: Insect – a high-precision scientific calculator with physical units

#126
post #43
post #10

Looks pretty nice, but no light years? No attoparsecs? You don't even have hogsheads or fortnights!!!!!1! Still, it's pretty good.

Thank you for the feedback. I'm always open for suggestions on new units ( https://github.com/sharkdp/purescript-quantities )!

Yes, please add light years, parsecs. Perhaps weight of planets in our solar system, and the sun?

Re: Show HN: Insect – a high-precision scientific calculator with physical units

#127
post #120

So "megabytes" appears to be the power-of-ten unit, which is generally not that helpful in practice. ≫ 6 megabytes to bytes 6 MB -> B = 6000000 B Assuming you're sticking with the power-of-ten unit, that means you should really grow support for the (sigh) "mebibytes" family of units; i.e., what some folks are retro-actively calling the power-of-two byte unit. ≫ 6 mebibytes to bytes 6 × mebibytes -> B Unknown identifi…

I'd call them "MB (megabytes)" and "MMB" (marketing megabytes). Pretty clear.

There is already MiB (mebibytes) and MB (once actual megabytes, now what you call MMB).

Re: Show HN: Insect – a high-precision scientific calculator with physical units

#128
post #29

Earlier quoted context omitted.

All of these things work in Google, btw. Google has one of the best unit conversion tools, and it's built into the search.

I've always been frustrated by how Google's unit conversion doesn't integrate well with its calculator.

How is wolfram alpha? I always use it for more complicated pure math, but I don't think I ever used it for unit conversion.

Re: Show HN: Insect – a high-precision scientific calculator with physical units

#129
post #125

Kudos! I would love to see two more things: 1. Propagation of uncertainty.[1] I often yearned for a calculator that automatically propagated uncertainties for me while writing my (high-school) lab reports. I think it would be life-saver functionality for many students at the very least. 2. True high-precision. I don't know how Insect works under the hood (so maybe you are already doing it this way) but instead of usi…

I absolutely agree with these requests! I am so desperate for an uncertainty-aware/unit-aware calculator that I tried implementing one myself, even though it is quite beyond my skill-set. I gave up and used Mathematica (more on that below). Two comments on the requests: - Most existing calculators that offer propagation of uncertainty use a simplified formula -- the one with the square root and the partial derivative…

Frink can do interval arithmetic.

https://frinklang.org/#IntervalArithmetic

Re: Show HN: Insect – a high-precision scientific calculator with physical units

#130
post #31

Earlier quoted context omitted.

All of these things work in Google, btw. Google has one of the best unit conversion tools, and it's built into the search.

You can convert 100m to femtoparsecs, for example.

Oh wow, even microparsec/kilofortnight in m/s works now. This did not work for many years, and prompted me to write my only ever e-mail to Google with a complaint about 5 years ago.

Unfortunaetly, the conversion 30 miles per gallon in liter/100 km still displays an equal sign, which is technically wrong. However, this conversion is so useful, that I won't complain about it.

Post reply on HN