Apollo 11 Trig Was Brief

In this day and age where a megabyte of memory isn’t a big deal, it is hard to recall when you had to conserve every byte of memory. If you are a student of such things, you might enjoy an annotated view of the Apollo 11 DSKY sine and cosine routines. Want to guess how many lines of code that takes? Try 35 for both.

Figuring out how it works takes a little knowledge of how the DSKY works and the number formats involved. Luckily, the site has a feature where you can click on the instructions and see comments and questions from other reviewers.

According to commenter [Luís Batalha], the code uses a polynomial approximation, but not part of the Taylor series as you might expect. Apparently, the polynomial used had less error over the expected range of inputs than a similar number of Taylor terms. He even includes some graphs comparing different methods of computing the functions.

When we land on the moon again, soon, it will be amazing and awe-inspiring. Now think of doing it in a world where the best computer on the planet couldn’t keep up with the PC you have in your garage gathering rust. Even then, the DSKY wasn’t even that computer. It ran with a 12 microsecond clock speed and had a whopping 72 kB of memory — most of it not writable.

The DSKY is a popular computer to recreate. We’ve run quite a few posts about replica DSKYs and their internals.

101 thoughts on “Apollo 11 Trig Was Brief

    1. Lol I have very low hope for private space doing it AT ALL, let alone Mars. The SpaceX concept is a joke when considering manned spaceflight. It’s very inspiring and impressive for laymen, but the people I’ve known in NASA and aerospace from the old days all scoff at it. Back when the plan was to use nukes to push the incredible mass of an adequately-stocked interplanetary manned habitat. Not to mention the huge amount of radiation shielding needed for months above the Allen belts, plus the radiation leaking through the shadow shield of a barely-contained reactor pushing it all. Or an Orion nuclear pulse drive, my god. Musk’s single-launch chemical rocket is an obvious farce.

      1. Granted, we’ll have computers on board far more powerful than a calculator wristwatch. But that won’t give you any better specific impulse or lower payload mass. The rocket equation is a cruel mistress. One needs a nationalized endeavor and nuclear fire to get to other planets. It’s an order of magnitude harder than the moon, and that already needed a state program. It needed two competing ones, in fact. It’s telling that manned exploration pretty much stopped once the Soviets gave up. Turns out that motivation was essential. Nukes are important in all things! It’s amazing we lived through the eighties.

        1. You know why they’re really trying to get there?

          There are only a handful of billlionaires who know that despite their fabulous wealth, they couldn’t make the other 7-8 billion people disappear or behave.

          The richest people are the tip of the pyramid, but the foundation stones are crumbling due to overpopulation, climate change, and the exhaustion of resources and land. So they’re trying to create fully automated closed loop farming, mining, manufacturing and processing equipment so they wouldn’t have to depend on other people – and they’re doing this using other people’s money and resources under various excuses from scientific interest to national pride. Whatever sells.

          When the job is done, they can shut themselves in gated communities and leave the rest of the humanity outside to die in misery. Money loses meaning when you don’t need to pay wages to anyone to get things done. Society collapses to overpopulation and the formerly rich people shut themselves in monasteries…

          Their only problem is, a gate can be broken and a wall can be taken down, and the other people can come in and take the cornucopia away. So, you take your cornucopia to where other people can’t go – to another planet entirely.

          1. Think of the ending scenes of Elysium. The orbital colony suddenly accepts all the humanity as citizens, and sends down drop-ships to provide medical attention with technology that can literally revive the dead and rebuild your body from scratch.

            At that point, the planet was already under severe global warming and over-population.What do you think happens next?

            a) everyone lived happily ever-after
            b) a fascistic/communist/utilitarian/etc. dictatorship arose that found it necessary to liquidate half the global population in a thermonuclear war in order to restore habitability

          2. > I knew that you were either lying, ignorant, or both.

            Humanity uses 40% of the global available land area to farming, and we’re exhausting fresh ground water supplies at an exponential rates for irrigation. Fertilizers are almost exclusively produced out of fossil fuels because nothing else comes cheap enough to do it. Billions of people globally need more meat because they’re suffering from protein deficiencies, trying to survive on cheap cereal crops that provide more calories per acre.

            Lying? I wish. Ignorant – look in the mirror.

          3. >Chris Maple

            The thing is, you’re part of the 10-20% of humanity that has it all. We’re using something around a third of the world’s cheaply available resources to have the living standards we have, and we’re giving the finger to the rest.

            We cannot provide even the lowest basic living standards of our own societies to the other 80% because the marginal cost of production means it’s less efficient to make five times more stuff. On the financial side, if the top 500 richest people gave all their money away, it would do absolutely jack s**t because all that money is only worth anything in potential future work “owed” to these people, which cannot be materialized. It is not real.

            We are not rich and powerful – we only pretend to be in order to live at the expense of all the rest.

          4. Luke, I may be missing a fine distinction somewhere, but it sounds like you’re saying that the ultra-rich people who are suddenly trying to make space travel work, are doing so because they’d rather live permanently indoors, surrounded by a desert that will kill you if anything goes wrong, than continue living among people.

          5. > than continue living among people.

            Yes. Well, they’ll be living among themselves of course, but the point is to get away from the rest of the humanity. All their money can’t solve the upcoming Malthusian catastrophe, whether by good or evil, so they’re doing the next best thing: get out of Dodge.

          6. Let’s look at it from a slightly different perspective: when rich people talk about making humanity into a two planet species to hedge our bets, what they’re really saying is: “When the asteroid or global thermonuclear war hits, we will be on the other planet, because we had the money to pay the ticket and ship ourselves over. That will be money we cheated and swindled out of you guys. Thanks.”

          7. Here’s an interesting bit:

            https://en.wikipedia.org/wiki/Peak_phosphorus

            >Phosphorus is a finite (limited) resource that is widespread in the Earth’s crust and in living organisms but is relatively scarce in concentrated forms. The only cost-effective production method to date is the mining of phosphate rock.
            >Earth’s commercial and affordable phosphorus reserves are expected to be depleted in 50–100 years and peak phosphorus to be reached in approximately 2030.

            It’s an important fertilizer. When phosphorous starts running out, food prices go up. Solving this issue needs completely closed cycle farming to stop the nutrient run-off. Anyone without the technology will be unable to farm in the long term and most will die of hunger because soils will become too poor to sustain industrial scale agriculture.

          1. Think of it more in terms of the Puritans leaving England because they weren’t allowed to be bigoted enough to their liking. The people who will go, will go for a reason.

      2. I’m almost sure that the “aerospace from the old days” also scoffed at the idea of propulsive landing of a first stage of a two stage ORBITAL rocket like “Theoretically it is possible but there would be no margin for the second stage to carry any meaningful payload.. blah blah”.

        I can also very lively imagine the “aerospace from the old days” say something like “The full-flow staged combustion engine is a holy grail but we would need infinitely large budget to develop it. Even the Russians abandoned it after N1. It is just not worth it.”
        Yet SpaceX has test flown such engine. Even if Starship fails, they have this holy grail quite maturely developed and can strap it to some more conventionally-uncoventional rocket.

        1. Theoretically, they’re right. The Falcon reusable rocket loses 2/3 of the kinetic energy of the upper stages to return the first. It basically means that they have to build a rocket that is 3+ times bigger for the same payload in order to recycle the first stage.

          That’s why they have to re-use it 10-12 times (Musk’s own estimate) before it breaks even. However, if they need to lift any more cargo up there, or go to a higher orbit, they have to use up all the fuel and expend the first stage. Another probability is the industry average 2% launch failure rate, which can destroy the first stage.

          What that means, it’s highly likely that none of the rockets actually turn out any cheaper than regular disposable boosters. None of the SpaceX boosters have flown enough times to prove that they can even meet the break-even point in terms of reliability.

          1. You do not understand. It is not at all about being cheaper as a direct consequence of not having to build a new rocket.
            – It’s about ability to explore uncrashed flown hardware and test how various optimizations hold. Side efect is lowering cost while keeping or improving reliability.
            – Then it is also aboud rapid turnaround.

            What do you mean by break even? As in to keep up in reliability with new pristine boosters? SX has had only two LossOfMission/Payload. Both on new boosters.

          2. All true, but we were sold a cheaper rocket, to lower the cost of payload to orbit.That’s kinda the point of the whole company, unless you start shifting goalposts for Musk.

            >What do you mean by break even?

            Cost less than launching an appropriately sized single-use rocket for the particular payload/orbit.

            SpaceX is trying to cater to two different markets: commercial satellite launches that send small payloads, and public money from NASA to send big payloads to the ISS. The commercial customers don’t need huge payloads and they hate waiting for other customers to fill the bus, and NASA alone doesn’t sustain a private rocket business, so they’re trying to use one rocket to act in both roles. Kinda like delivering milk out of an 18-wheeler.

    2. Good gods people, when will you realize, it was NEVER about the arms race. It was ALWAYS about “our team” vs. “the other team”. Sure, the politicians were scared shitless about 100 megaton thermo-nukes, but THAT never inspired the dreamers. Every time the metric vs. customary units discussion comes up, something that ALWAYS comes into the conversation is “says the people that never went to the Moon”. Never mind how expensive space is, was, and ever shall be, because what capitalism REALLY means is that if you can get enough people behind your ideas, money is no object! Never mind weak arguments about how “space research helps us with real world problems”. It’s NOT ABOUT THAT. It’s about striving for things that we can be PROUD of. We choose to do these things not because they are easy, but BECAUSE they are hard. LISTEN to what people are talking about. World. Hell. Handbasket. But oh — did that manned space launch go off? We have been living in national shame for a decade, because we’ve had to buy tickets to our own gold-plated space station from the fucking Russians, of all people. And I don’t say that just to be vulgar – the whole world calls them “fucking Russians”. I realize that when black lives really MUST matter, and viruses can can make us choose between people and the world’s economy, it seems like space is a luxury. ARE YOU FUCKING KIDDING? Do you KNOW what was going on in the world in nineteen-baby-making-sixty-nine? The world was in a shitstorm that makes this current year look like a mild case of constipation. People are EXCITED again, because American industry is demonstrating that is CAN, just POSSIBLY, get its SHIT together again, and show the world how to get a difficult job done. It’s not that it doesn’t matter what the job is; it matters that the job is something that nobody ELSE can seem to get right, either. And yeah, it’s been a while since we were the go-to guys when it came to tough jobs, but people are LAUGHING about Elon Musk launching his CAR into space, because finally people are showing evidence of having a clue about what scale means. You know, like, when it costs dollars per gram to throw things into orbit, YOU MIGHT AS WELL be launching sports cars. I mean, yeah, you can go ahead and put chunks of concrete into orbit to test your launch systems, but the extra cost is insignificant, so why not show some STYLE while you’re at it? Boeing is old school, and yeah, there’s a time for old school, like when the only reason there’s been ANY way in the world of getting people into orbit for the last DECADE is that the (fucking) Russians have been so poor all this time, they never threw away their 1960s systems. SpaceX is new school, and about time, too. And if you don’t think that the chemical rocket approach will work, okay, that’s fair: SHOW ME THE MATH, or get the HELL off my lawn. Where the GOD damned fuck did I put my drink?

      1. “f…ing Russians” :-) …Well, I guess they deserve some “American respect”. …Valid points though. …and don’t discount the “f…ing Russians”. They proved time and time that they can handle shit. If this trigger another space race …I’ll take it. Got my popcorn ready. Actually I’m happy to see them pissed at SpaceX. This is how they get their motivation.

        1. Russians could handle their s**t when Korolev was running the show. After that, they’ve just rehashed the same designs. Communism killed all the people who were too intelligent for the system, and the moment the cold war was over, the rest fled to the west.

          There’s an old Ukrainian party trick that involves a tea bag. You start by telling a story about the Russian army ordering a new ballistic missile – but since they were too cheap, they decided to leave out the fuse and just light it by hand (You pull off the string from the teabag). When the missile arrived, they found out that it was also missing the warhead (You pull off the little staple that keeps the teabag together). When they took it to the launch pad, the truck was out of diesel so they had to use the fuel to get it running (You tip out the tea from the bag and roll it into a tube). Finally, they got it set up on the launch pad and world war 3 breaks loose! Putin calls, so they did what they could and launched the rocket.

          At that point you place the loosely tube-shaped teabag standing on the table and light it from the top. The tube proceeds to burn and lifts up from the table, raining down on the party guests in a disappointing shower of ashes.

      1. Americans were getting bored with the Apollo program after the first couple of missions. With all the modern day distractions, they will care even less. Maybe a new mission will get a 7 minute slot on morning TV, and then we’ll quickly switch to some exciting news about the Kardashians or something.

        1. Some Americans I am sure. This American enjoys watching and keeping up with space news. And I am in the energy industry — not affiliated with space endeavoring companies. Never boring, always interesting. Even the ‘mole’ problem on Mars is interesting. Most everyone in my circle like to hear about the latest landing or launch or whatever even if they aren’t an avid follower.

          1. Sure, but you’re reading hackaday, so you have little in common with the average American. Next time, ask a cashier in the supermarket or a bartender about the latest rocket launch.

          2. > Next time, ask a cashier in the supermarket or a bartender

            It’s likely they’re college educated if not graduated, and reading the same media as you.

          3. A cashier or a waiter is likely to be college educated if not graduated, and reading the same media as you. If you want to make a point, pick an occupation that requires vocational skill, such as a welder, a plumber, or an electrician – or the other end of the spectrum that requires no skill or training at all such as a social media figure or a youtube celebrity.

        2. The label “bored” is an euphemism for all the human rights activism that went on in the 60’s. The space shot was a distraction, and when the novelty started wearing out the attention turned back to the social issues.

        3. Not bored, exactly, more like annoyed. Like, “okay, show us something you DIDN’T just show us a few months ago, or put my soaps back on. If you were there, you know that depending on how developed an area you lived in, you had between ONE and seven TV channels, period. This meant that a) people who had no interest were incovenienced, and b) NASA and the news networks had to dumb everything down to fifth-grade level. Today we have Scott Manley to explain to us – should we care for this kind of detail – how a full-flow staged combustion rocket engine works.

  1. “When we land on the moon again, soon” aaah the good old space mantra inherited from and at the time powered from the cold war.
    Less and less inspiring while Anthropocene and mass extinction is unfolding before your eyes at geological dramatical speed.

    1. If we go to the Moon and other planets again, I truly believe it will be after using nuclear launch stages becomes acceptable because we’ve already irradiated our biosphere. That certainly enables some cheat codes. We will be desperately escaping the anthropocene, not defeating it. And we’ll still probably fail. But I still believe in humans somehow. Perhaps I simply have to.

      An Orion drive rising from desertified fallout might be our last hurrah. Or else we’ll just post on Twitter until the rising sea floods our datacenters. One of those. At least the first is less pitiful.

      1. The bit I don’t get about the “escape the earth” thing. Earth is quite habitable. You could even say we evolved to live in its environment. Mars is cold, deserty, and full of horrible dust storms.

        If we can just barely terraform LA, even by diverting 1/3 of the flow of the Colorado, what chance do we have on Mars? How is that in any way better than what we’ve got?

        1. Lack of war is one way it’s better. Hitler said it best in mein kampf although i haven’t read it, that nobody remembers the armenians and implied that altruism is dead among humanity because anyone who acts like that gets eliminated. capitalism and altruism are incompatible. capitalism relies on competing to produce the most energy or work regardless of the environmental effects and the loser does not survive or reproduce. altruism is what’s necessary to stablize the atmosphere through renewable energy and the self sacrifice of population restriction.
          In an artificial space habitat there’s no short term advantage to destabilizing the environmental systems and this is selected against through mortality. there’s no need for economic systems which are motivated by competition and war so participants can be more productive.

          1. >capitalism relies on competing to produce the most energy or work regardless of the environmental effects

            The point of capitalism is to provide a feedback mechanism that guides production without central control. The production of stuff isn’t an end onto itself, but the efficiency of production where competition among providers ensures that nobody is paid too much over the value of the things they do, and everyone must do something in order to live.

            What you’re describing is the Malthusian Trap, or the tendency of people to fill all niches and consume all resources anyways. People will multiply until most are poor, and they will consume until it starts to hurt, and there are so many people already that you can’t do anything about it. Capitalism, communism, fascism, makes no difference. If you try to stop people from doing it, they will destroy you before they destroy themselves.

          2. It was a serious question though.

            If you can’t be more productive in material terms, because your resources are (self) limited, and you can’t be more productive in human terms because of the same reason, when what are you supposed to do? Even developing science and technology mainly serves the first two points, and the rest of it is of no interest to the majority, and besides, what would you do with the information anyhow?

            Nietzsche described the Last Man:

            “The lives of the last men are pacifist and comfortable. There is no longer a distinction between ruler and ruled, strong over weak, or supreme over the mediocre. Social conflict and challenges are minimized. Every individual lives equally and in “superficial” harmony.The last man is possible only by mankind’s having bred an apathetic creature who has no great passion or commitment, who is unable to dream, who merely earns his living and keeps warm.The last men claim to have discovered happiness, but blink every time they say so.”

          3. Equating poorly implemented Capitalism with poorly understood Social Darwinism is inaccurate and less than honest. Capitalism is the protection of human rights viewed from an economic standpoint; it includes the right of property owners not to have their property damaged by polluters.

          4. Hm…. Let’s for a second assume that the few really doing this to escape and leave the rest to suffer.
            Personally I think that on a planet with no biosphere and lack of atmosphere ect
            even a terraforming project ( that take serious amount of years to archive ) will end up fail.
            Look at the Boisphere 1 project.
            Put a few people into a self sustainable world ( it could have being sucess ) Look how
            those few peoples begaviour end up splitting them into teams that fight against each other.
            ( thats why it went wrong ), they didn’t solve the problems together . they could but all the fight
            about who was in command and that seperating into groups totally destroy any chance to
            actually solve the problems.
            I think if they have managed to work together from the very start , they would also be able
            to solve the problems with lack of oxygen to food produce to … U name it…
            But the behavior of humans is typically driven by a ‘ Im the leader ‘ ‘ I own ‘ ect
            charecter / mental state.
            Go back in history , When have humans archived anything colectively ?
            NEVER, They never have.
            If one culture sucess build up a society another come and conquere / destroy it.
            And even inside those cultures it was all driven by who was the strongest to take
            control and leading the rest by enslaving them.
            It’s the same today.
            I don’t think humans ever change the behavoiur thats so deep within them.
            Humans is destructive / self destructive by nature ( sadly enough )
            There will ALWAYS be a few who try gain control and power at the expense of the rest.
            Show me one time in history that didn’t happen.
            That sadly doesn’t exist.
            Only the power and control you will find through history despite even countless of
            times other humans warning against this in different ways.
            So I think that a project to put a few people into such a Mars ‘ Biosphere’ is doomed
            to fail from the very start , based alone on human behaviour.
            Biosphere a total failure and that was here on earth …

          5. Well, when you’re looking at the outcomes of closed system settlement experiments done on Earth, you have to consider that in all such cases, there was an option to “return” to Earth, so people have much lesser incentive to make it work at all cost.

          6. >Look at the Boisphere 1 project

            The Biospheres failed because of a design flaw: the biosphere was not closed from the bottom, so they had an excess of oxygen-consuming soil bacteria that messed up with the experiment.

            Of course, the first colonists to Mars will be “ordinary people” who are sent there as guinea pigs to see that it all works. If it doesn’t and they all die, well, live and learn. If it does work however, it will become the ultimate gated community for the rich. Everything will be provided by automation and they can expand freely – a whole planet just for them.

          1. It may well be that a bottom up approach of constructing a biosphere teaches a lot about how we need to save one from the top down as it were.

      1. As did I. The computer was the Apollo Guidance Computer (AGC); the DSKY is/was a “dumb” display.

        Watch Curious Marc’s series on YouTube about the restoration of the AGC, and using it to fly a simulated Apollo 11 landing on the 50th anniversary. Beautiful engineering stuff.

      1. Yeah. I suspect that was a deciding factor. They had advanced mathematics, that part was just fine. In fact I believe there was a higher rate of deep mathematical literacy than today. They needed it to wring every drop of usefulness from those first solid-state computers. It’s like how Russian hackers were the best in the world for a good while because the iron curtain kept their computing hardware primitive. Sometimes genius is motivated by restrictions, not plenty.

        1. quert’s last sentence rings a bell.
          When I worked at Michelin Research, after a very successful approach to thermal analysis of tires, I complained that the lack of funding is very frustrating. The French boss said: “Throwing money at problems does not solve any, that is why we hired you!”.

    1. And of course you DO want to optimizer for -pi/2 < a < pi/2, because you can get everything else by reflection. And double-precision floats are hilarious in this context, since the error for such an approximation is well within the range of single-precision anyway. NONE of which matters because this is close enough for short-term work. There's really no point calculating to half a hair on a gnat's ass, when you are using thrust motors that take milliseconds to turn on or off, with standard deviations also in milliseconds. You're trying to measure things with a micrometer that can only be effected with a hand-swung axe aimed at a chalk-marked target.

      1. Right, but if your input variable is just outside the -pi/2 .. pi/2 range, you may want to evaluate the polynomial directly to save time, rather than calling the full range function with reflections. Since I did not know the context, I wanted to leave that open as a possibility.

        And the designers did care about precision, because they also had a set of double precision trig functions in the AGC code.

        Intermediate results often need more precision than the final output.

        1. By the way, if you look at “Approximations for Digital Computers”, by Cecil Hastings, page 138, the coefficients used in the AGC code appear to have been taken from there. These were the “single precision” coefficients, which are only good to about three decimal digits of precision. The higher precision approximation takes four coefficients, and are good for about six digits.

      1. Without access to a computer, trial and error and successive approximation with hand calculations. If I were a good mathematician, I could probably speed up the process with techniques that have been known for over a century.

        With computer access, automated error reduction is an easy approach.

      2. I would not expect Taylor series, just like I would not expect Taylor series in a modern implementation. Taylor approximations are optimal at a point, not over a range.

        I would guess that they used the Remez algorithm, which was 30 years old at the time.

  2. Very much this. Something in me (still?) gets excited at rockets and space travel, but the sad fact is that we’re still learning how to keep a wonderfully terraformed planet in order.

    Once we master that, we can start talking about actually terraforming another planet.

    1. Very actually very much UN-LEARNED about terraforming since a few hundreds of years. Much of the amazonian and north american forests were actually engineered for long periods by human settlements for maximize food source. Caribou herds are nothing natural but are the product of these long-term sustainable practices.

      1. Although it could be thought that medieval warm period and little ice age were anthropogenically caused climate events. The Inca/Maya/Aztec and Mississippian/mound builder cultures could have had enough deforestation going on to cause a warm period, then the rapid collapse and the forests re-establishing could have caused the correction the other way.

      2. While Caribou herds might be inflated by nomadic human cultures, their original reason was avoiding other predators such as wolves, which would multiply if the herd stayed in one place too long, and the exhaustion of grazing lands if the herd stays in one place for too long.

  3. Anyone but me annoyed at the stupid political crap that popped up about this post on sin and cos?
    Early computing is really interesting. I was looking at some old Byte magazines on archive.org and they had an article writing your own floating point routines. It is interesting how in some of those early magnetizes the content was so deep because it had to be. Truth is that it is not that the knowledge is any-less wide spread in actual numbers. You probably have the same number of people that understand that if not more than you did in the 1960s-early 80s it is just you have a lot more people that use and know enough about computers to use them and even write applications than you did then because it it is easier so the average knowledge level of the user-base has decreased while the user-base size increased.

    1. The sin/cos code was not particularly impressive, to be honest, just a standard polynomial approximation with 3 terms, implemented in a straightforward way using built-in multiply/add instructions.

        1. When the silicon for an FPU costs pennies and consumes microamps per megahertz, the niche for software floating point is rather narrow. Combine that with the existence of fairly good libraries for the common processors that don’t have hardware floating point, and the niche for write-your-own software floating point is vanishingly small. It’s about as impressive as the fact that most people today have never started their car engine with a hand crank; technology enabled us to focus our time and effort elsewhere.

          1. Also, the reason to do your own floating point on a micro is that you’d take more time to make sure the libraries are doing what you want them to do, than simply implementing the routines yourself.

            Using opaque blobs of code that you don’t understand is the Arduino way though. Doesn’t matter if it makes your code 200x slower or introduces submarine bugs that you don’t know how to solve.

          2. If you roll your own code, you’re more likely to end up with a mistake than with the standard libraries.

            And if you are worried about performance, getting a more powerful CPU is usually a better choice than writing your own optimized math code.

          3. There aren’t that many applications that need to run 5 years on a battery, but demand high performance floating point.

            Even so, a modern powerful CPU may very well end up using less power overall than a slower CPU.

            > At least it’s a mistake you can fix easily

            You’ll have to find it first. It could be a mistake that only happens with some rare input combination.

          4. > It could be a mistake that only happens with some rare input combination.

            The fun thing about math algorithms is that they’re provable. You can show that the bug exists or not without trying all the inputs.

          5. Luke: “The fun thing about math algorithms is that they’re provable. You can show that the bug exists or not without trying all the inputs.”

            No, you can’t. You can prove the ALGORITHM, but not the IMPLEMENTATION of the algorithm. The algorithm is a mathematical construct; the implementation is a computer program, susceptible to all the kinds of bugs that all computer programs are.

  4. Very likely, the programmers who devised these subroutines use “Approximations for Digital Computers” by Cecil Hastings, Princeton University Press, 1955, at least for reference, if not for the actual polynomials used. Google the title – Researchgate has a free download.

  5. I went to the code, to see if it really did use the polynomials given in “Approximations for Digital Computers”, and found it to be incomplete in two ways: the 35 lines of code do not include the coefficients, nor do they include the additional subroutine “POLLEY” required to evaluate the polynomial.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.