AFC - Abacus Formula Compiler for Java

Decompiled Code For SMALL( C903, D903 )

The expression

=SMALL( C903, D903 )

is compiled to the following class(es):

package org.formulacompiler.gen;
import org.formulacompiler.runtime.Computation;
import org.formulacompiler.runtime.internal.Environment;
import org.formulacompiler.runtime.internal.RuntimeDouble_v2;
import org.formulacompiler.runtime.internal.Runtime_v2;
import org.formulacompiler.tests.reference.base.Inputs;
import org.formulacompiler.tests.reference.base.Outputs;

final class $Root extends Outputs implements Computation
{
    private final Inputs $inputs;
    final Environment $environment;

    $Root(Inputs inputs, Environment environment) {
        $environment = environment;
        $inputs = inputs;
    }

    final double get$0() {
        double d;
        if (!(get$2() <= 1.0) || get$2() < 1.0) {
            Runtime_v2
                .fun_ERROR("#NUM! because not 1 <= k <= n in SMALL/LARGE");
            d = (double) -1;
        } else {
            double d_0_;
            d = get$3(d_0_ = get$2());
        }
        return d;
    }

    public final double dbl() {
        return get$0();
    }

    final double get$3(double d) {
        double d_1_ = -1.7976931348623157E308;
        double d_2_ = 1.0;
        d_1_ = d_2_ > d ? d_1_ : get$4(d_2_, d_1_);
        d_2_++;
        return d_1_;
    }

    final double get$4(double d, double d_3_) {
        double d_4_ = 1.7976931348623157E308;
        double d_5_ = 0.0;
        d_4_ = get$1() > d_3_ ? RuntimeDouble_v2.min(get$1(), d_4_) : d_4_;
        d_5_ = get$1() <= d_3_ ? d_5_ + 1.0 : d_5_;
        return d_5_ >= d ? d_3_ : d_4_;
    }

    final double get$1() {
        return $inputs.dbl(0);
    }

    final double get$2() {
        return $inputs.dbl(1);
    }
}