# mathematics

Abdhilahi Wabwire

03/01/2024, 4:58 AM
Has anyone here ever written a mathematics engine in Kotlin? If so, describe your implementation or provide a code snippet. I am using mathematical algorithms as references. I am currently building a mathematics engine to challenge Microsoft Math Solver but Open Source. How have you used KMath?

Gleb Minaev

03/01/2024, 10:41 AM
What do you mean "engine"? KMath is just a library that solves some mathemtical computational problems. As an example, it can find derivative of a function, but it cannot solve polynomial (systems of) equations. Usually, programs, that solve such problems, are just piles of heuristics that can solve some small subset of all possible math problems. And usually, they are proprietary. If you have an algorithmic way to solve some set of nath problems that you would like to implement, you can create an issue in KMath repo on GItHub. And there is a chance it will be added into KMath.
👍 1

Abdhilahi Wabwire

03/01/2024, 11:19 AM
That is very helpful, thank you. By engine I meant the proprietary mathematics engine powering Microsoft Math Solver, probably with heuristics and algorithms. Like translating mathematics textbooks directly into code. Returning the answer and steps to solving the problem. I am reading through the KMath code and I am building an open source alternative to Microsoft Math Solver


03/01/2024, 3:58 PM
You a talking about a bunch of different problems, including natural language processing and symbolic algebras. I checked Microsoft Math Solver and it is basically a small interface to OpenAI engine with some additional mathematical tools. It would be great to have something like this, but I do not think you can do it in Kotlin from scratch. You need to rely on some kind of LLM API.
💯 2

Abdhilahi Wabwire

03/02/2024, 1:54 AM
I only need to replicate the mathematics tools and step description tools. The rest is an LLM API but that is not the portion I am interested in because Math Solver existed before Microsoft purchased OpenAI. The step description tools have changed a lot since Microsoft purchased Open AI but I have no interest in AI at all.