x404.co.uk
http://x404.co.uk/forum/

Why computers suck at maths
http://x404.co.uk/forum/viewtopic.php?f=3&t=3767
Page 1 of 2

Author:  rustybucket [ Thu Oct 29, 2009 3:30 pm ]
Post subject:  Why computers suck at maths

A thought-triggering article

http://www.techradar.com/news/computing ... ths-644771

Author:  davrosG5 [ Thu Oct 29, 2009 6:51 pm ]
Post subject:  Re: Why computers suck at maths

The bit about the patriot missile system was a little alarming.

Author:  JJW009 [ Thu Oct 29, 2009 10:44 pm ]
Post subject:  Re: Why computers suck at maths

Quote:
it's probably more accurate to say that computer programmers suck at maths – or at least some of them do.

At least the summary isn't misleading.

When writing multi-million pound life endangering mission critical control systems, it would be best if the programmer can maths. Sadly, such people are in short supply. It's amazing how few people understand fully the sometimes dramatic consequences of rounding off, and how they may often be avoided by simply doing a calculation in a different order.

Even when a true professional writes code, there are often time and budget constraints which mean it's released before it's ready. When code runs into millions of lines, it's not possible to guarantee 100% accuracy because it would be obsolete before the tests were complete. Some bugs are inevitable. However, something like that incremental clock bug in the Patriot targeting system was just idiotic by design.

I suspect the fatal overflow in the Ariane V was probably brought about by trying to stretch the performance of the available hardware to the limits. *wikis*

wiki wrote:
A data conversion from 64-bit floating point value to 16-bit signed integer value to be stored in a variable representing horizontal bias caused a processor trap (operand error) because the floating point value was too large to be represented by a 16-bit signed integer. The software was originally written for the Ariane 4 where efficiency considerations (the computer running the software had an 80% maximum workload requirement) led to 4 variables being protected with a handler while 3 others, including the horizontal bias variable, were left unprotected because it was thought that they were "physically limited or that there was a large margin of error".


In other words, the computer wasn't fast enough to do it more thoroughly. There are often compromises on the bleeding edge of technology, and the logic sounds acceptable.

However:

wiki wrote:
The software, written in Ada, was included in the Ariane 5 through the reuse of an entire Ariane 4 subsystem despite the fact that the particular software containing the bug, which was just a part of the subsystem, was not required by the Ariane 5 because it has a different preparation sequence[8] than the Ariane 4.


LOLWTF. :?

Author:  rustybucket [ Thu Oct 29, 2009 11:42 pm ]
Post subject:  Re: Why computers suck at maths

wiki wrote:
The software, written in Ada, was included in the Ariane 5 through the reuse of an entire Ariane 4 subsystem despite the fact that the particular software containing the bug, which was just a part of the subsystem, was not required by the Ariane 5 because it has a different preparation sequence[8] than the Ariane 4.

Given that Ada is a piece is of piss to debug, how the hell was this missed?

:o

Author:  JJW009 [ Thu Oct 29, 2009 11:45 pm ]
Post subject:  Re: Why computers suck at maths

rustybucket wrote:
wiki wrote:
The software, written in Ada, was included in the Ariane 5 through the reuse of an entire Ariane 4 subsystem despite the fact that the particular software containing the bug, which was just a part of the subsystem, was not required by the Ariane 5 because it has a different preparation sequence[8] than the Ariane 4.

Given that Ada is a piece is of piss to debug, how the hell was this missed?

:o

Because the code wasn't even looked at. It was a known working subsystem with a proven track record. It was treated as a black box.

People often use library routines which contain redundant code, and it usually doesn't matter.

Author:  rustybucket [ Fri Oct 30, 2009 12:38 am ]
Post subject:  Re: Why computers suck at maths

JJW009 wrote:
rustybucket wrote:
wiki wrote:
The software, written in Ada, was included in the Ariane 5 through the reuse of an entire Ariane 4 subsystem despite the fact that the particular software containing the bug, which was just a part of the subsystem, was not required by the Ariane 5 because it has a different preparation sequence[8] than the Ariane 4.

Given that Ada is a piece is of piss to debug, how the hell was this missed?

:o

Because the code wasn't even looked at. It was a known working subsystem with a proven track record. It was treated as a black box.

People often use library routines which contain redundant code, and it usually doesn't matter.

Reusing code is fine if you're talking about a device driver or a GUI but this wasn't. This was an aerospace subsystem written in a specialist language and installed in a multi-billion pound space vehicle.

If the vehicle was to be that important and expensive, short cuts should not have been acceptable.

Author:  finlay666 [ Fri Oct 30, 2009 12:55 am ]
Post subject:  Re: Why computers suck at maths

Given my dissertation/final year project is on test generation I can completely see why this was not discovered (as far as the google bug of 599 999 999 999 999 - 599 999 999 999 998 = 0 goes)

If you look at testing 2 integers where
a - b = c

Then you have 5 million possibilities for a, 5 million possibilities for b

Testing every possible combination, that gives over a quintillion (1 x10 ^ 18) possible combinations

Assuming each test is automated and takes 1 second to run each test you are looking at 32 billion years to run the tests JUST for a - b = c, that doesn't even include the time taken to verify each answer is correct.

Programmers take short cuts or use unsafe code. Always have and always will until they are made accountable for their errors

Author:  JJW009 [ Fri Oct 30, 2009 1:06 am ]
Post subject:  Re: Why computers suck at maths

rustybucket wrote:
Reusing code is fine if you're talking about a device driver or a GUI but this wasn't. This was an aerospace subsystem written in a specialist language and installed in a multi-billion pound space vehicle.

If the vehicle was to be that important and expensive, short cuts should not have been acceptable.

Clearly, you're quite correct.

To be honest, without knowing all the details of what the sub system actually did I don't think it's fair to judge the decisions made at the time. Frankly, even presented all the information there are few of us qualified to criticise it. However, on the surface it does appear likely that the decision was based on cost and time rather than best engineering practice. Unfortunately, I suspect these kind of shortcuts happen all too often - even in expensive and critical projects found in aerospace and other industries.

Lets hope the computer systems in our nuclear power stations aren't cobbled together from old bits of code to meet deadlines. Actually, let's hope they were mechanically engineered to be fail-safe regardless.

Coder: "I need a year to complete the project"
Manager: "We launch in 2 weeks"

Author:  EddArmitage [ Fri Oct 30, 2009 9:42 am ]
Post subject:  Re: Why computers suck at maths

Grrrr, I really want to comment here, but can't :(

Author:  JJW009 [ Fri Oct 30, 2009 5:52 pm ]
Post subject:  Re: Why computers suck at maths

EddArmitage wrote:
Grrrr, I really want to comment here, but can't :(

Because of the official secrets act, or can't you say?

Author:  rustybucket [ Fri Oct 30, 2009 5:57 pm ]
Post subject:  Re: Why computers suck at maths

He could tell you but then he'd have to kill you.

;)

Author:  finlay666 [ Sat Oct 31, 2009 12:41 am ]
Post subject:  Re: Why computers suck at maths

rustybucket wrote:
He could tell you but then he'd have to kill you.

;)


That's a risk I'm willing to take, he can tell us then kill JJ ;)

Author:  rustybucket [ Sat Oct 31, 2009 1:29 am ]
Post subject:  Re: Why computers suck at maths

finlay666 wrote:
rustybucket wrote:
He could tell you but then he'd have to kill you.

;)


That's a risk I'm willing to take, he can tell us then kill JJ ;)


rustybucket wrote:
He could tell thee but then he'd have to kill thee.

;)

Altered for clarity ;)

Author:  finlay666 [ Sat Oct 31, 2009 1:41 am ]
Post subject:  Re: Why computers suck at maths

rustybucket wrote:
rustybucket wrote:
He could tell thee but then he'd have to kill thee.

;)

Altered for clarity ;)


Tell everyone! It'll be like putting the ring video on youtube!

Author:  JJW009 [ Sun Nov 01, 2009 4:02 pm ]
Post subject:  Re: Why computers suck at maths

finlay666 wrote:
rustybucket wrote:
rustybucket wrote:
He could tell thee but then he'd have to kill thee.

;)

Altered for clarity ;)


Tell everyone! It'll be like putting the ring video on youtube!

I'm guessing you've seen this, so for those who have not:

Image

Page 1 of 2 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/