Removing unneeded and buggy simplifications.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Adsooi 2022-10-19 02:55:23 +02:00
parent ddb5156396
commit de1be925b0
Signed by: Ad5001
GPG key ID: 7251B1AF90B960F9

View file

@ -128,14 +128,14 @@ function textsub(text) {
function simplifyExpression(str) { function simplifyExpression(str) {
var replacements = [ var replacements = [
// Operations not done by parser. // Operations not done by parser.
[// Decomposition way 2 // [// Decomposition way 2
/(^|[+-] |\()([-.\d\w]+) ([*/]) \((([-.\d\w] [*/] )?[-\d\w.]+) ([+\-]) (([-.\d\w] [*/] )?[\d\w.+]+)\)($| [+-]|\))/g, // /(^|[+-] |\()([-.\d\w]+) ([*/]) \((([-.\d\w] [*/] )?[-\d\w.]+) ([+\-]) (([-.\d\w] [*/] )?[\d\w.+]+)\)($| [+-]|\))/g,
"$1$2 $3 $4 $6 $2 $3 $7$9" // "$1$2 $3 $4 $6 $2 $3 $7$9"
], // ],
[ // Decomposition way 2 // [ // Decomposition way 2
/(^|[+-] |\()\((([-.\d\w] [*/] )?[-\d\w.]+) ([+\-]) (([-.\d\w] [*/] )?[\d\w.+]+)\) ([*/]) ([-.\d\w]+)($| [+-]|\))/g, // /(^|[+-] |\()\((([-.\d\w] [*/] )?[-\d\w.]+) ([+\-]) (([-.\d\w] [*/] )?[\d\w.+]+)\) ([*/]) ([-.\d\w]+)($| [+-]|\))/g,
"$1$2 $7 $8 $4 $5 $7 $8$9" // "$1$2 $7 $8 $4 $5 $7 $8$9"
], // ],
[ // Factorisation of π elements. [ // Factorisation of π elements.
/(([-\d\w.]+ [*/] )*)(pi|π)(( [/*] [-\d\w.]+)*) ([+-]) (([-\d\w.]+ [*/] )*)(pi|π)(( [/*] [-\d\w.]+)*)?/g, /(([-\d\w.]+ [*/] )*)(pi|π)(( [/*] [-\d\w.]+)*) ([+-]) (([-\d\w.]+ [*/] )*)(pi|π)(( [/*] [-\d\w.]+)*)?/g,
function(match, m1, n1, pi1, m2, ope2, n2, opeM, m3, n3, pi2, m4, ope4, n4) { function(match, m1, n1, pi1, m2, ope2, n2, opeM, m3, n3, pi2, m4, ope4, n4) {