#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 r18065 = x;
        float r18066 = y;
        float r18067 = r18065 + r18066;
        float r18068 = z;
        float r18069 = r18067 + r18068;
        float r18070 = r18066 + r18068;
        float r18071 = r18065 + r18070;
        float r18072 = r18069 - r18071;
        return r18072;
}

double f_id(double x, double y, double z) {
        double r18073 = x;
        double r18074 = y;
        double r18075 = r18073 + r18074;
        double r18076 = z;
        double r18077 = r18075 + r18076;
        double r18078 = r18074 + r18076;
        double r18079 = r18073 + r18078;
        double r18080 = r18077 - r18079;
        return r18080;
}


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

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

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 r18083, r18084, r18085, r18086, r18087, r18088, r18089, r18090;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r18083);
        mpfr_init(r18084);
        mpfr_init(r18085);
        mpfr_init(r18086);
        mpfr_init(r18087);
        mpfr_init(r18088);
        mpfr_init(r18089);
        mpfr_init(r18090);
}

double f_im(double x, double y, double z) {
        mpfr_set_d(r18083, x, MPFR_RNDN);
        mpfr_set_d(r18084, y, MPFR_RNDN);
        mpfr_add(r18085, r18083, r18084, MPFR_RNDN);
        mpfr_set_d(r18086, z, MPFR_RNDN);
        mpfr_add(r18087, r18085, r18086, MPFR_RNDN);
        mpfr_add(r18088, r18084, r18086, MPFR_RNDN);
        mpfr_add(r18089, r18083, r18088, MPFR_RNDN);
        mpfr_sub(r18090, r18087, r18089, MPFR_RNDN);
        return mpfr_get_d(r18090, MPFR_RNDN);
}

static mpfr_t r18091;

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

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

static mpfr_t r18092;

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

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

