A Reliable Scientific Calculator

Scientific Calculator Reliability

So,  imagine that your Scientific Calculator’s    code  is just one piece of a large app that computes all the different kinds of cool things — ie, imagine it’s Meta Calculator. To your knowledge the code works great, but then, someone emails you about a bug. In this case, someone emailed that typing “—5″ into the Scientific Calc didn’t produce the expected value of “-5″ .

Ok, first off, if you’re wondering who would ever actually type “—5″ into a calculator, you’re asking an understandable , but flawed, question.  The point is not ‘why focus on weird, unrealistic, use-cases’.  But rather that a flaw in scientific calculator’s parser existed. There was a good chance ,  after all, that no one would ever go to our site and type those characters on purpose! In fact, the guy who reported the bug was purposefully looking for bugs  (and it was the only one that he could find).

So, now you’re in the situation of knowing that all of your code works for the countless math expressions but your parser misses one situation. Now, it’s not just the scientific calc that uses the parser–so does our client side graphing calculator ,  the one that we license out to several companies.

Ok, so what do you do? You get that bug fixed!

Darnit–here’s the dilemma:

How do you know that  your bug fix does not introduce new errors in some other part of the calculator? This is called a  regression bug–when you fix one bug, only to introduce a new one somewhere else.

And here’s the solution: Enter unit testing and a battery of  tests that  new algorithms for the scientific or graphing calcs must pass before we push them out to the site. So that every time that you make a change to anything under the hood, you submit the new algorithm to hundreds and hundreds of test calculations to make sure that the app  always arrives at the correct solutions.  In the case of Meta Calculator, currently there are over 1,100 unit tests that we test before pushing out a change to the live site. Let’s look at one unit test– Consider, for instance, the expression  “3 * sin(30)” . We use excel or some other reliable tool to determine an expected resulting value of 1.5 (assuming we’re in degrees). Then we see if the calculator gets the same result (taking, rounding error into consideration of course). This process occurs for each and every unit test. Each unit test involves creating a test expression like 3 * sin(30) and as well as the true answer like 1.5 .

Here are some other screen shots of successful set of tests looks like. As you can see in screen shot below, 1,126 assertions or ‘tests’ passed and there were no errors. When this happens, we know that changes that were made to the calculator did not introduce any other new bugs.




Posted in Online Tagged with: , ,

Graphing Explicit vs Implicit Equations

There has been a lot of interest in licensing meta calculator. Our company, Engaging Edu , has licensed various IP over the last few years, and, of late, our scientific/graphing calc  has been in hot demand–whether it’s from companies that want to buy it or companies that want to license it.

A recurring issue in the process of licensing the app is how to handle the graphing calculator’s server based requests, but –before going any further let ‘s make sure we’ve defined two important ‘mathy’ phrases:

  • explicit equations-these are the equations that  any graphing calculator is expected to be able to handle and they look like
    • y = x^2 (parabola)
    • y = 2x +3 (line)
    • y = log(x) + 2x + x^3
  • implicit equations -These equations are studied in high school but  are rarely supported in graphing calculators.
    • x * y = 1 (hyperbola)
    • x^2 + y ^2 = 25 (circle with radius of 5)
    • sin(x) = cos(y) (funky cool graph that has no name)


Why draw a distinction between these two types of equations?

Because it is much, much tricker, and computationally expensive to graph implicit equations .  On the other hand, explicit equations, are relatively straight forward to graph and do not need anywhere near the same level of CPU power.

Most graphing Calculators  only graph explicit equations!

For instance, your typical high school level Texas Instruments graphing calculator can only do explicit equations (Even the TI-89, I think , can only graph explicit equations).

What about meta-calculator?

It can graph explicit equations and implicit; however, to be able to do all the intense math that is required for graphing implicit , we cannot rely on your browser–which would probably freeze up if it tried to handle certain graphs . Instead, the app sends  a request to our server app .

However,  there is no need to use the server for explicit equations.  One of the improvements that we were planning on rolling out this fall is to graph explicit ones in your browser–an improvement which can only speed things up since the app wouldn’t need to communicate with a server  and the server would also get fewer requests so it could dedicate its number crunching to those equations that require it.

Therefore, this month we are working on moving the graphing of explicit equations to your browser! A change that will , I imagine , go unnoticed by the 1,000’s of users that graph equations daily; however, these sorts of small improvements, in combination,  start adding up to a tangibly more performant app.

Posted in Online

Graphing Calculator Server Fixed!

Ok, if you tried using our online graphing app over the last week or two, you might have unfortunately experienced  some disappointment. Basically, if you hit the ‘graph’ button, then you might have had the very anti-climactic experience of having…. absolutely nothing happen!

Sorry folks, the problem had to do with 1 small bug in the server side code that produces the actual graphs. This bug  was exacerbated by the high levels of traffic that the site gets. Each month, we get more …except, of course, when school is out and then the traffic is pretty light.

The good new is that now, you should have no trouble graphing any kinds of equations.

Posted in Online Tagged with: ,

What is a Graphing Calculator to do?

That Pesky Cube Root Graph

I have heard from users both on our facebook page and in emails that the graphing calculator does provide the expected graph for equations like y = x^(1/3) .


The  equation y = x^(1/3) , it just happens , is particularly tricky to graph–at least when it comes to computers. Most of us think of the graph of  y = x(^1/3) as an S-shaped curve that exists in both Quadrant I and Quadrant III, like you can see in the picture on the right.

Right now, our online calculator only graphs the equation in quadrant 1. This is also, by the way, exactly what Wolfram Alpha does (try plotting the graph of y = x^(1/3) ) and you will indeed see what I mean.

The basic problem  is this: Before  a point in any equation can be graphed, the x value of that point must first be evaluated (ie parsed by the calculator) according to good old PEMDAS and when the graphing calculator  sees ‘1/3′ , it  listens to good old PEMDAS and first does division which  translates 1/3  to ‘.3333333′. Now, computers can only hold a finite number of decimal points so we lose the ‘1/3′ and replace it with an approximation and that loss of precision prevents negative numbers in Quadrant III from appearing in the graph.

So, what is a graphing calculator to do?

Well, we’ve solved the problem with the iOs graphing calculator by  re-writing the math parser so that you get the graphs that you expect . The update has already been submitted to Apple!  The online app will also get a similar update after some other features that are in development are done . Right now though, we’re working on adding a different feature to the online calculator-letting you save your favorite graphs and statistics data to our server so that you can bookmark and reuse your favorites without having to re-type equations , stat lists each time you open up the app.

It’s funny how something so seemingly small requires a complete rewrite of the way that the graphing calculator parses and renders each equation!



Posted in iOs Tagged with:

Acceptable hand held calculators …for standardized tests

So you have to take a standardized test and you want to know what calculator you can actually bring to the test. Here are some helpful links for students


  1. Calculators for the SAT   (Pretty flexible here. Looks like they even take a TI-89 calculator)
  2. New York State Regents Exam (TI-84, TI-85 are indeed allowed but no Ti-89’s)
  3. AP Calculus( ab , bc)

These lists have been pretty stable for the last several years so I don’t see them changing much any time soon.  Of course, these lists and the inability to use a cell phone calculator is also a major reason why TI has done so little to improve upon its calculators for the last 10 years.



Posted in Hand Held Tagged with: , , , ,

Graphing Calculator now draws more accurate graphs!

We pushed out an updated version of Meta Calculator to the app. This update comes with a new and improved graphing calculator that provides cleaner, more accurate graphs. The  app has an improved algorithm for rendering  ‘tricky’ graphs. By ‘tricky’ I mean ones that have asymptotes like the y = tan(x) or a hyperbola like y = 1/x   These types of equations are often rendered incorrectly by graphing calculators.  It was no easy or  small task to solve the problem, and we tried a few different approaches  before settling on an algorithm that was intelligent enough to figure out when something was an asymptote and couldn’t be drawn.

Pictures can indeed be worth a 1000 words, so here are some before and after pics. Notice the lack of asymptotes in both examples even the bottom pic has a hard to see aymptote at x  = 0, something that is no longer drawn in the new version.

Graph of Tangent before and after the change

Before: Now:

Graph of a Hyperbola before and after the change


Before: Now:

As an aside,  most Texas Instruments graphing calculators , for some time, demonstrate this exact same bug. From what I understand, any TI-84+ Operating System V 2.40, or onward no longer has this problem (though I haven’t’ personally verified that.)

Ok, so how does this new version work? Let me give you a peek under the hood. The first version version of the graphing calculator used a fixed number of points to render a graph. Let’s say that number is 200 points, for argument’s sake.  This situation does not affect graphs of lines lines have a constant slope, but the slope of a curve can change greatly over the graph’s path throughout a screen.  So   200 points would be fine for lines and for rendering most equations; however, the equations of some curves at certain times , like when the y = tan(x) graph starts zooming way up vertically  for instance, the distance between any 2 points was much larger than other graphs that only gradually changed. This mean that it was difficult for the calculator to know about the asymptote because 1 point would be before the asymptote and the next point would be after the asymptote and the calc would just connect the two points!

So, how does the new one work? Well, instead of a fixed number of points, the graphing calculator now uses and interpolated number of points. This means that as a line starts to curve more, the calculator increases the number of points–this makes it much easier for the calculator to detect an asymptote.

What are the side effects of our new graphing approach?

There is only 1 change that these new and more accurate graphs required–they will no longer be constantly rendered while you swipe around. The graph can still be swiped around the screen but it won’t re-render until you release . (This only means that while you drag a graph around the edged will not be filled in until you release). This behavior is consistent with how the online version  works and  we figured the improved accuracy was more than worth the fact the graph  no longer re-draws as you move.



Posted in iOs Tagged with: , , ,

New Features for Graphing Calculator !

Meta Calculator Online has some awesome new features coming to its graphing calculator .

  • Polar equations
  • Restricted domain/range control. For instance, you can set the range to  0<y< 3 if you only want to see its graph over that y interval
  • Ability to store equations and other data on our server. If you register with us, you will soon be able to save several equations , matrices and/or stats lists into your ‘favorites’ .

The first two features are almost done–as you can see in the picture on the right! The last one is going to take a bit longer, hopefully by January! Also, this release will fix bugs including the fact that inequalities are not being graphed (hope you’re using the old Flash version if you run into any of these issues)

Go here for the graphing calc.


Posted in Online Tagged with: ,

Why haven’t TI Graphing Calculators changed for the last 10 years?

If, like me,  you grew up using the classic Texas Instruments calculator as your primary graphing calculator, then the  title of this post might be exactly what you, yourself have wondered.  I mean, don’t get me wrong. I love the TI 84  and the Ti- 89 is amazing and comes full of features like the ability to take derivatives, to factor quadratics  and more.

However, let’s  focus on the core reason that many U.S. students buy and use TI calculators, and that’s to graph equations. And, on this front, there has been almost no change over the last 10 years. I mean– try graphing y  = tan(x) and it looks just like it did 10 years ago (the calc incorrectly draws the vertical asymptotes ).  Granted, that’s a relatively small problem and  many graphing calculators have the same bug . (In fact, right now we’re working on trying to fix this issue for our own  iPhone app–ie not drawing the actual asymptotes themselves. ). The only significant improvement that I know of is the ability to  graph equations  in the form of s x = k where k is an integer. In other words, you can graph vertical lines like x = 5 or  x =3.     However, that is a fairly limited use case. Let’s talk about implicit equations. There are several online calculators and app store apps that can render implicit equations.    You have to wonder why TI never bothered to implement such a handy features. I mean all of us, at some point, need to graph a circle, right? And, TI had about a decade or so jump on the rest of these modern day calculators that have this feature.

The answer, I believe, is simple–there is no competition.  Texas Instruments has a defacto monopoly in U.S. public and private schools.  Just look at what your friend’s kids use at school. Odds are its some kind of Texas Instruments brand.  Now, with the rise of iOs and Android, things, I am sure, are changing a bit. I know, for instance, that several of our users bought the iPhone app in lieu of a hand held calculator.  Nonetheless in terms of the class room, hand held calculators still dominate. My friends kids all, to a kid, has a calculator on their phone and also a hand held TI.

There is one major ‘advantage’ that hand held calculators have over any app, an advantage I don’t see going away any time soon.

No, it’s not some killer feature. Instead, it’s the fact that they do not connect to the internet, and the calculator’s ram can easily be cleared. Both of these features let teachers know that the student is not cheating and unfortunately seems to keep TI’s monopoly pretty safe…so I wouldn’t expect any cool new features from TI . They have no reason to to do it!

Posted in Hand Held Tagged with: ,

What is next for Meta-Calculator?

For the Online Calculator: 

There are a few different features that we might add including the creation of a user account system so you guys could save your data in the cloud and then reload it from any computer.  We’ll see how the poll on the home page goes–if enough people are interested in the idea, then we’ll look into doing it.


For the iOs Calculator: (link)

Improved graphing of equations with asymptotes, then polar equations


For the Windows 8 app: 

We’re going to create the graphing calculator first –with full support for all features including polar equations and implicit equations. The app should be live by mid January and will be available on all windows 8 devices–phone, tablets and desktops.


For Android:

No definite plans yet, but if you want to see an Android version cast your vote

Posted in iOs, Online, Windows 8 Tagged with: , , , , , ,

Windows 8. Here we come!

A first version of the app is being developed, right now for windows 8!  We’re going to start with just the graphing calculator, but we’re going to support all of the features of our online graphing app including

1) graphing explicit equation, inequalities etc.

3) axes in terms of pi2) polar equations

4) implicit equations.

Eventually, we will add the other calculators as well.

It should be submitted to windows 8 app store in mid January…so hopefully will be live and in the wild in February.

Posted in Windows 8 Tagged with: