function sign_0_positive(x){ // Math.sign like with no 0 option
    if(x >= 0)
        return 1.0;
    return -1.0;
}

function underflow_padded(x){
    if(Math.abs(x) < 1.e-5) // pixel-size input error is ok, so we don't want much precision anyway
        return 1.e-5 * sign_0_positive(x);
    return x;
}

function solved_linear(A, B, n){
    var X = [];
    for (var i = 0; i < n; ++i)
        X[i] = 0.0;

    // triangulize
    for (var i = 0; i < n-1; ++i)
        for (var j = 0; j < i+1; ++j) {
        