question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

simplify differences between 1.2 and 1.3

See original GitHub issue

For some rational polynomial expressions, I’m seeing worse simplification results with version 1.3.1 than with 1.2. Additionally, the results take much longer to compute:

function run(e){console.time(e);try { return Algebrite.run(e)} finally{console.timeEnd(e)}}

with 1.2.0

simplify((x^2+8x-3)/(x^2-1)-(x^2+8x-3)/((x-1)*(x+1))): 334.2421875 ms
0

simplify((x^2+12x-5)/(x^2-2) - (5-12x-x^2)/(2-x^2)): 120.877197265625 ms
0

with 1.3.1

simplify((x^2+8x-3)/(x^2-1)-(x^2+8x-3)/((x-1)*(x+1))): 1446.41796875 ms
3*(1/(x^2-1)+1/(-x^2+1))

simplify((x^2+12x-5)/(x^2-2) - (5-12x-x^2)/(2-x^2)): 3286.921875 ms
x*(12/(x^2-2)+12/(-x^2+2)+x/(x^2-2)+x/(-x^2+2))

I’m also seeing many expressions that used to run quickly evaluating much slower. It seems possible this is from the rational simplification. Maybe that should be a separate function? Or have a way to turn it off for quicker results.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
28rainingcommented, Dec 21, 2022

Hey Yaffle, awesome, your lib works! These equations are coming from a matrix inverse operation*

Would be super helpful if you can support variable name like R1 - I just created an issue on your git.

var matrix = ExpressionParser.parse(‘-1/(ab(-1/(ab)-1/(ac)-1/(bc)))-1/(ac(-1/(ab)-1/(ac)-1/(bc)))’);

*inverse matrix is part of MNA, which I’m building a web tool around https://lpsa.swarthmore.edu/Systems/Electrical/mna/MNA2.html

image

0reactions
Yafflecommented, Dec 19, 2022

@28raining , you can try my lib , but it has its own issues. Are your use cases all “rational polynomial expressions” as well?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Write two irrational numbers between 1.2 and 1.3? - Quora
Just add the two numbers and divide the result by 2:- 1.2+1.3=2.5 2.5÷2=1.25 So 1.2, 1.25, 1.3 Now between 1.25 nd 1.3 (1.25+1.3)÷2=1.275...
Read more >
Simplify Fractions Calculator - CalcuNation.com
This Simplify Fractions Calculator will help with reducing fractions to their simplest form. ... The fraction 33 /99 reduced to the simplest form...
Read more >
Simplifying Ratios Involving Decimals and Fractions - YouTube
In this video, the ratios involve decimals and fractions. You will learn how to simplify such creatures.
Read more >
Livestream - Chapter 1: Algebraic expressions (1.1, 1.2, 1.3)
The beginning of a summer series on AS/year 12 content for the new GCE specification.(I am in no way affiliated with Pearson or ......
Read more >
1.3 Evaluate, Simplify, and Translate Expressions – Basic ...
Simplify expressions by combining like terms; Translate word phrases to algebraic expressions. Evaluate Algebraic Expressions. In the last section, we ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found