AFC - Abacus Formula Compiler for Java

Decompiled Code For PERCENTRANK( C819:E819, F819, G819 )

The expression

=PERCENTRANK( C819:E819, F819, G819 )

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$5() < 1.0) {
            Runtime_v2
                .fun_ERROR("#NUM! because significance < 1 in PERCENTRANK");
            d = (double) -1;
        } else {
            double d_0_;
            double d_1_;
            d = get$6(d_0_ = get$5(), d_1_ = get$4());
        }
        return d;
    }

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

    final double get$6(double d, double d_2_) {
        double d_3_ = 0.0;
        double d_4_ = 1.7976931348623157E308;
        double d_5_ = -1.7976931348623157E308;
        double d_6_ = 1.7976931348623157E308;
        double d_7_ = -1.7976931348623157E308;
        d_3_ = get$1() < d_2_ ? d_3_ + 1.0 : d_3_;
        d_4_ = get$1() >= d_2_ ? RuntimeDouble_v2.min(get$1(), d_4_) : d_4_;
        d_5_ = get$1() <= d_2_ ? RuntimeDouble_v2.max(get$1(), d_5_) : d_5_;
        d_6_ = RuntimeDouble_v2.min(d_6_, get$1());
        d_7_ = RuntimeDouble_v2.max(d_7_, get$1());
        d_3_ = get$2() < d_2_ ? d_3_ + 1.0 : d_3_;
        d_4_ = get$2() >= d_2_ ? RuntimeDouble_v2.min(get$2(), d_4_) : d_4_;
        d_5_ = get$2() <= d_2_ ? RuntimeDouble_v2.max(get$2(), d_5_) : d_5_;
        d_6_ = RuntimeDouble_v2.min(d_6_, get$2());
        d_7_ = RuntimeDouble_v2.max(d_7_, get$2());
        d_3_ = get$3() < d_2_ ? d_3_ + 1.0 : d_3_;
        d_4_ = get$3() >= d_2_ ? RuntimeDouble_v2.min(get$3(), d_4_) : d_4_;
        d_5_ = get$3() <= d_2_ ? RuntimeDouble_v2.max(get$3(), d_5_) : d_5_;
        d_6_ = RuntimeDouble_v2.min(d_6_, get$3());
        d_7_ = RuntimeDouble_v2.max(d_7_, get$3());
        double d_8_;
        if (d_4_ == d_2_)
            d_8_
                = 3.0 == 1.0 ? 1.0 : RuntimeDouble_v2.trunc(d_3_ / (3.0 - 1.0),
                                                            (int) d);
        else if (!(d_2_ >= d_6_) || d_2_ > d_7_) {
            Runtime_v2.fun_NA();
            d_8_ = (double) -1;
        } else {
            double d_9_;
            d_8_
                = RuntimeDouble_v2.trunc(((d_3_ - 1.0
                                           + (d_9_
                                              = (d_2_ - d_5_) / (d_4_ - d_5_)))
                                          / (3.0 - 1.0)),
                                         (int) d);
        }
        return d_8_;
    }

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

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

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

    final double get$4() {
        return $inputs.dbl(3);
    }

    final double get$5() {
        return $inputs.dbl(4);
    }
}