Decompiled Code For PERCENTRANK( C809:E809, F809 )
The expression
=PERCENTRANK( C809:E809, F809 )
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; double d_0_; return get$5(d = 3.0, d_0_ = get$4()); } public final double dbl() { return get$0(); } final double get$5(double d, double d_1_) { double d_2_ = 0.0; double d_3_ = 1.7976931348623157E308; double d_4_ = -1.7976931348623157E308; double d_5_ = 1.7976931348623157E308; double d_6_ = -1.7976931348623157E308; d_2_ = get$1() < d_1_ ? d_2_ + 1.0 : d_2_; d_3_ = get$1() >= d_1_ ? RuntimeDouble_v2.min(get$1(), d_3_) : d_3_; d_4_ = get$1() <= d_1_ ? RuntimeDouble_v2.max(get$1(), d_4_) : d_4_; d_5_ = RuntimeDouble_v2.min(d_5_, get$1()); d_6_ = RuntimeDouble_v2.max(d_6_, get$1()); d_2_ = get$2() < d_1_ ? d_2_ + 1.0 : d_2_; d_3_ = get$2() >= d_1_ ? RuntimeDouble_v2.min(get$2(), d_3_) : d_3_; d_4_ = get$2() <= d_1_ ? RuntimeDouble_v2.max(get$2(), d_4_) : d_4_; d_5_ = RuntimeDouble_v2.min(d_5_, get$2()); d_6_ = RuntimeDouble_v2.max(d_6_, get$2()); d_2_ = get$3() < d_1_ ? d_2_ + 1.0 : d_2_; d_3_ = get$3() >= d_1_ ? RuntimeDouble_v2.min(get$3(), d_3_) : d_3_; d_4_ = get$3() <= d_1_ ? RuntimeDouble_v2.max(get$3(), d_4_) : d_4_; d_5_ = RuntimeDouble_v2.min(d_5_, get$3()); d_6_ = RuntimeDouble_v2.max(d_6_, get$3()); double d_7_; if (d_3_ == d_1_) d_7_ = 3.0 == 1.0 ? 1.0 : RuntimeDouble_v2.trunc(d_2_ / (3.0 - 1.0), (int) d); else if (!(d_1_ >= d_5_) || d_1_ > d_6_) { Runtime_v2.fun_NA(); d_7_ = (double) -1; } else { double d_8_; d_7_ = RuntimeDouble_v2.trunc(((d_2_ - 1.0 + (d_8_ = (d_1_ - d_4_) / (d_3_ - d_4_))) / (3.0 - 1.0)), (int) d); } return d_7_; } 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); } }