#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 r32197 = x;
        float r32198 = y;
        float r32199 = r32197 + r32198;
        float r32200 = z;
        float r32201 = r32199 + r32200;
        float r32202 = r32198 + r32200;
        float r32203 = r32197 + r32202;
        float r32204 = r32201 - r32203;
        return r32204;
}

double f_id(double x, double y, double z) {
        double r32205 = x;
        double r32206 = y;
        double r32207 = r32205 + r32206;
        double r32208 = z;
        double r32209 = r32207 + r32208;
        double r32210 = r32206 + r32208;
        double r32211 = r32205 + r32210;
        double r32212 = r32209 - r32211;
        return r32212;
}


double f_of(float __attribute__((unused)) x, float __attribute__((unused)) y, float __attribute__((unused)) z) {
        float r32213 = 0.0f;
        return r32213;
}

double f_od(double __attribute__((unused)) x, double __attribute__((unused)) y, double __attribute__((unused)) z) {
        double r32214 = 0.0;
        return r32214;
}

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 r32215, r32216, r32217, r32218, r32219, r32220, r32221, r32222;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r32215);
        mpfr_init(r32216);
        mpfr_init(r32217);
        mpfr_init(r32218);
        mpfr_init(r32219);
        mpfr_init(r32220);
        mpfr_init(r32221);
        mpfr_init(r32222);
}

double f_im(double x, double y, double z) {
        mpfr_set_d(r32215, x, MPFR_RNDN);
        mpfr_set_d(r32216, y, MPFR_RNDN);
        mpfr_add(r32217, r32215, r32216, MPFR_RNDN);
        mpfr_set_d(r32218, z, MPFR_RNDN);
        mpfr_add(r32219, r32217, r32218, MPFR_RNDN);
        mpfr_add(r32220, r32216, r32218, MPFR_RNDN);
        mpfr_add(r32221, r32215, r32220, MPFR_RNDN);
        mpfr_sub(r32222, r32219, r32221, MPFR_RNDN);
        return mpfr_get_d(r32222, MPFR_RNDN);
}

static mpfr_t r32223;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init_set_str(r32223, "0", 10, MPFR_RNDN);
}

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

static mpfr_t r32224;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init_set_str(r32224, "0", 10, MPFR_RNDN);
}

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

