#include <tgmath.h>
#include <gmp.h>
#include <mpfr.h>
#include <stdio.h>
#include <stdbool.h>

char *name = "Commute and associate";

double f_if(float x, float y, float z) {
        float r21670 = x;
        float r21671 = y;
        float r21672 = r21670 + r21671;
        float r21673 = z;
        float r21674 = r21672 + r21673;
        float r21675 = r21671 + r21673;
        float r21676 = r21670 + r21675;
        float r21677 = r21674 - r21676;
        return r21677;
}

double f_id(double x, double y, double z) {
        double r21678 = x;
        double r21679 = y;
        double r21680 = r21678 + r21679;
        double r21681 = z;
        double r21682 = r21680 + r21681;
        double r21683 = r21679 + r21681;
        double r21684 = r21678 + r21683;
        double r21685 = r21682 - r21684;
        return r21685;
}


double f_of(float __attribute__((unused)) x, float __attribute__((unused)) y, float __attribute__((unused)) z) {
        float r21686 = 0;
        return r21686;
}

double f_od(double __attribute__((unused)) x, double __attribute__((unused)) y, double __attribute__((unused)) z) {
        double r21687 = 0;
        return r21687;
}

void mpfr_fmod2(mpfr_t r, mpfr_t n, mpfr_t d, mpfr_rnd_t rmd) {
        mpfr_fmod(r, n, d, rmd);
        if (mpfr_cmp_ui(r, 0) < 0) mpfr_add(r, r, d, rmd);
}


static mpfr_t r21688, r21689, r21690, r21691, r21692, r21693, r21694, r21695;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(2128);
        mpfr_init(r21688);
        mpfr_init(r21689);
        mpfr_init(r21690);
        mpfr_init(r21691);
        mpfr_init(r21692);
        mpfr_init(r21693);
        mpfr_init(r21694);
        mpfr_init(r21695);
}

double f_im(double x, double y, double z) {
        mpfr_set_d(r21688, x, MPFR_RNDN);
        mpfr_set_d(r21689, y, MPFR_RNDN);
        mpfr_add(r21690, r21688, r21689, MPFR_RNDN);
        mpfr_set_d(r21691, z, MPFR_RNDN);
        mpfr_add(r21692, r21690, r21691, MPFR_RNDN);
        mpfr_add(r21693, r21689, r21691, MPFR_RNDN);
        mpfr_add(r21694, r21688, r21693, MPFR_RNDN);
        mpfr_sub(r21695, r21692, r21694, MPFR_RNDN);
        return mpfr_get_d(r21695, MPFR_RNDN);
}

static mpfr_t r21696;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(2128);
        mpfr_init_set_str(r21696, "0", 10, MPFR_RNDN);
}

double f_fm(double __attribute__((unused)) x, double __attribute__((unused)) y, double __attribute__((unused)) z) {
        ;
        return mpfr_get_d(r21696, MPFR_RNDN);
}

static mpfr_t r21697;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(2128);
        mpfr_init_set_str(r21697, "0", 10, MPFR_RNDN);
}

double f_dm(double __attribute__((unused)) x, double __attribute__((unused)) y, double __attribute__((unused)) z) {
        ;
        return mpfr_get_d(r21697, MPFR_RNDN);
}

