Skip to content(if available)orjump to list(if available)

Calculator Forensics (2002)

Calculator Forensics (2002)

18 comments

·September 18, 2025

OskarS

Couldn't resist checking what math.h does for floats and doubles on godbolt, it returns slightly above 9, but curiously not exactly equal to any answer in that list [1]. Maybe not that surprising, these transcendental functions are always iffy in the last digits.

[1]: https://godbolt.org/z/dK85Eq8r6

kazinator

Forensics? Have these calculators committed a crime (against numerical analysis)?

gs17

If they have, this site has their fingerprints.

mysteria

So what's the correct answer?

gs17

9 degrees. arcsin(arccos(arctan(tan(cos(sin(9)))))) basically makes a set of sin-cos-tan layers that arctan-arccos-arcsin unwrap one-by-one, which should result in nothing having changed, unless the functions used weren't accurate.

measurablefunc

That's incorrect, you have to choose the proper inverse branch if you want the answer to be 9.

madars

There is no choice here - each inverse is uniquely determined. That's similar to how 3 and -3 are both square roots of 9 (i.e., solutions to x^2=9), but sqrt(9)=3 as it denotes the principal square root, which by convention is always the non-negative value. Of course, in a different context we might design functions to have multi-valued properties, like atan2(x,y) != atan(y/x) in general (atan2 takes quadrant in account and returns full range [-pi, pi], atan only returns principal values in [-pi/2, pi/2]) as practical applications benefit from preserving quadrant beyond just the principal inverse (or not failing when x=0!)

measurablefunc

You can assume that sin(9) is within the range of all the functions that are post-composed w/ it so what you end up w/ in the end is arcsin(sin(9)). Naively you might think that's 9 but you have to be careful b/c the standard inverse branch of sin is defined to be [-1, 1] → [-π/2, π/2].

Edit: The assumption is that the calculators are using specific branches of the inverse functions but that's still a choice being made b/c the functions are periodic there are no unique choices of inverse functions. You have to pick a branch that is within the domain/range of periodicity.

madars

arcsin(arccos(arctan(tan(cos(sin(9)))))) = 9 (in degrees mode - when regular trig functions output pure numbers, those numbers get interpreted as degrees for the next function and similar for inverses - calculator style), because each intermediate lands in the principal-value domain of the next inverse (e.g., arctan(tan(x)) = x when x \in (-90°, 90°) and the intermediates happen to be in those ranges). Specifically, sin(9°) ≈ 0.156434, cos(0.156434°) ≈ 0.999996, arctan(tan(0.999996°)) = 0.999996°, arccos(0.999996)≈0.156434°, arcsin(0.156434)≈9°.

null

[deleted]

quirkot

I always wonder... if there was an AGI and it's chipset gave the wrong answer, how would it ever know?

nenenejej

How do humans know? usually someone corrects someone else. we have repeatability in physics, or we wait 30 years and quash convictions etc. etc.

gs17

I'd presume it could reason around the wrong answer, at least to realize something was off. Current LLMs will sometimes hallucinate that this has happened when they're "thinking".

GuB-42

The neural networks we use today have really terrible accuracy, and we tend to make them worse, not better, as having more neurons is better than having more precision. Human brains are also a mess, but somehow, they work, and we are usually able to correct our own mistakes.

Since by AGI, we usually mean human-like, that system should be able to self correct the same way we do.

_trampeltier

Didn't expect to see this site here. From time to time I show this site to young guys.

tomhow

Previously:

Calculator Forensics (2002) - https://news.ycombinator.com/item?id=42757455 - Jan 2025 (1 comment)

Calculator Forensics (2002) - https://news.ycombinator.com/item?id=28561298 - Sept 2021 (19 comments)

Calculator Forensics (2002) - https://news.ycombinator.com/item?id=7682045 - May 2014 (2 comments)