// Path: src/main/java/org/esa/s3tbx/ArrayMath.java
// public static double[] a_abs(double[] x, double[] y) {
//     Assert.argument(x.length == y.length);
//     double[] z = new double[x.length];
//     for (int i = 0; i < x.length; i++) {
//         z[i] = abs(x[i] - y[i]);
//     }
//     return z;
// }
// 
// Path: src/main/java/org/esa/s3tbx/ArrayMath.java
// public static double[] a_exp(double[] x) {
//     return DoubleStream.of(x).map(Math::exp).toArray();
// }
// 
// Path: src/main/java/org/esa/s3tbx/ArrayMath.java
// public static double a_max(double[] x) {
//     double max = Double.NEGATIVE_INFINITY;
//     for (double v : x) {
//         max = Math.max(max, v);
//     }
//     return max;
// }
// 
// Path: src/main/java/org/esa/s3tbx/ArrayMath.java
// public static double a_sumx(double[] x,int anf, int ende) {
//     double suma; //= new double; //Double.NEGATIVE_INFINITY;
//     suma= 0.0;
//     for (int i=anf; i < (ende+1); i++) {
//         suma = suma+x[i];
//     }
//     return suma;
// }


import org.esa.snap.core.nn.NNffbpAlphaTabFast;
import org.esa.snap.core.util.BitSetter;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.StandardOpenOption;
import java.util.ArrayList;
import java.util.Arrays;
import static java.lang.Math.PI;
import static java.lang.Math.abs;
import static java.lang.Math.acos;
import static java.lang.Math.cos;
import static java.lang.Math.exp;
import static java.lang.Math.log;
import static java.lang.Math.max;
import static java.lang.Math.pow;
import static java.lang.Math.sin;
import static java.lang.Math.toDegrees;
import static java.lang.Math.toRadians;
import static org.esa.s3tbx.ArrayMath.a_abs;
import static org.esa.s3tbx.ArrayMath.a_exp;
import static org.esa.s3tbx.ArrayMath.a_max;
import static org.esa.s3tbx.ArrayMath.a_sumx;
            text = "";
            while (true) {
                String line = reader.readLine();
                if (line == null) {
                    break;
                }
                text += line + "\n";
            }
        }
        return text;
    }

    /**
     * Structure for returning the algorithm's result.
     */
    public static class Result {

        public final double[] r_toa;
        public final double[] r_tosa;
        public final double[] rtosa_aann;
        public final double rtosa_oos;
        public final double[] rpath_nn;
        public final double[] transd_nn;
        public final double[] transu_nn;
        public final double[] rwa;
        public final double rwa_oos;
        public final double[] rwn;
        public final double[] iops_nn;
        public final double kd489_nn;
        public final double kdmin_nn;
// Path: src/main/java/org/esa/s3tbx/ArrayMath.java
// public static double[] a_abs(double[] x, double[] y) {
//     Assert.argument(x.length == y.length);
//     double[] z = new double[x.length];
//     for (int i = 0; i < x.length; i++) {
//         z[i] = abs(x[i] - y[i]);
//     }
//     return z;
// }
// 
// Path: src/main/java/org/esa/s3tbx/ArrayMath.java
// public static double[] a_exp(double[] x) {
//     return DoubleStream.of(x).map(Math::exp).toArray();
// }
// 
// Path: src/main/java/org/esa/s3tbx/ArrayMath.java
// public static double a_max(double[] x) {
//     double max = Double.NEGATIVE_INFINITY;
//     for (double v : x) {
//         max = Math.max(max, v);
//     }
//     return max;
// }
// 
// Path: src/main/java/org/esa/s3tbx/ArrayMath.java
// public static double a_sumx(double[] x,int anf, int ende) {
//     double suma; //= new double; //Double.NEGATIVE_INFINITY;
//     suma= 0.0;
//     for (int i=anf; i < (ende+1); i++) {
//         suma = suma+x[i];
//     }
//     return suma;
// }


// Path: src/main/java/org/esa/s3tbx/c2rcc/meris4/C2rccMeris4Algorithm.java
import org.esa.snap.core.nn.NNffbpAlphaTabFast;
import org.esa.snap.core.util.BitSetter;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.StandardOpenOption;
import java.util.ArrayList;
import java.util.Arrays;
import static java.lang.Math.PI;
import static java.lang.Math.abs;
import static java.lang.Math.acos;
import static java.lang.Math.cos;
import static java.lang.Math.exp;
import static java.lang.Math.log;
import static java.lang.Math.max;
import static java.lang.Math.pow;
import static java.lang.Math.sin;
import static java.lang.Math.toDegrees;
import static java.lang.Math.toRadians;
import static org.esa.s3tbx.ArrayMath.a_abs;
import static org.esa.s3tbx.ArrayMath.a_exp;
import static org.esa.s3tbx.ArrayMath.a_max;
import static org.esa.s3tbx.ArrayMath.a_sumx;

            text = "";
            while (true) {
                String line = reader.readLine();
                if (line == null) {
                    break;
                }
                text += line + "\n";
            }
        }
        return text;
    }

    /**
     * Structure for returning the algorithm's result.
     */
    public static class Result {

        public final double[] r_toa;
        public final double[] r_tosa;
        public final double[] rtosa_aann;
        public final double rtosa_oos;
        public final double[] rpath_nn;
        public final double[] transd_nn;
        public final double[] transu_nn;
        public final double[] rwa;
        public final double rwa_oos;
        public final double[] rwn;
        public final double[] iops_nn;
        public final double kd489_nn;
        public final double kdmin_nn;
        public final double[] unc_iop_abs;