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

char *name = "(* (+ (log d) (fabs c)) (tan d))";

double f_if(float __attribute__((unused)) a, float __attribute__((unused)) b, float c, float d) {
        float r15603 = d;
        float r15604 = log(r15603);
        float r15605 = c;
        float r15606 = fabs(r15605);
        float r15607 = r15604 + r15606;
        float r15608 = tan(r15603);
        float r15609 = r15607 * r15608;
        return r15609;
}

double f_id(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        double r15610 = d;
        double r15611 = log(r15610);
        double r15612 = c;
        double r15613 = fabs(r15612);
        double r15614 = r15611 + r15613;
        double r15615 = tan(r15610);
        double r15616 = r15614 * r15615;
        return r15616;
}


double f_of(float __attribute__((unused)) a, float __attribute__((unused)) b, float c, float d) {
        float r15617 = d;
        float r15618 = log(r15617);
        float r15619 = c;
        float r15620 = fabs(r15619);
        float r15621 = r15618 + r15620;
        float r15622 = tan(r15617);
        float r15623 = r15621 * r15622;
        return r15623;
}

double f_od(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        double r15624 = d;
        double r15625 = log(r15624);
        double r15626 = c;
        double r15627 = fabs(r15626);
        double r15628 = r15625 + r15627;
        double r15629 = tan(r15624);
        double r15630 = r15628 * r15629;
        return r15630;
}

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 r15631, r15632, r15633, r15634, r15635, r15636, r15637;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15631);
        mpfr_init(r15632);
        mpfr_init(r15633);
        mpfr_init(r15634);
        mpfr_init(r15635);
        mpfr_init(r15636);
        mpfr_init(r15637);
}

double f_im(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15631, d, MPFR_RNDN);
        mpfr_log(r15632, r15631, MPFR_RNDN);
        mpfr_set_d(r15633, c, MPFR_RNDN);
        mpfr_abs(r15634, r15633, MPFR_RNDN);
        mpfr_add(r15635, r15632, r15634, MPFR_RNDN);
        mpfr_tan(r15636, r15631, MPFR_RNDN);
        mpfr_mul(r15637, r15635, r15636, MPFR_RNDN);
        return mpfr_get_d(r15637, MPFR_RNDN);
}

static mpfr_t r15638, r15639, r15640, r15641, r15642, r15643, r15644;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15638);
        mpfr_init(r15639);
        mpfr_init(r15640);
        mpfr_init(r15641);
        mpfr_init(r15642);
        mpfr_init(r15643);
        mpfr_init(r15644);
}

double f_fm(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15638, d, MPFR_RNDN);
        mpfr_log(r15639, r15638, MPFR_RNDN);
        mpfr_set_d(r15640, c, MPFR_RNDN);
        mpfr_abs(r15641, r15640, MPFR_RNDN);
        mpfr_add(r15642, r15639, r15641, MPFR_RNDN);
        mpfr_tan(r15643, r15638, MPFR_RNDN);
        mpfr_mul(r15644, r15642, r15643, MPFR_RNDN);
        return mpfr_get_d(r15644, MPFR_RNDN);
}

static mpfr_t r15645, r15646, r15647, r15648, r15649, r15650, r15651;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15645);
        mpfr_init(r15646);
        mpfr_init(r15647);
        mpfr_init(r15648);
        mpfr_init(r15649);
        mpfr_init(r15650);
        mpfr_init(r15651);
}

double f_dm(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15645, d, MPFR_RNDN);
        mpfr_log(r15646, r15645, MPFR_RNDN);
        mpfr_set_d(r15647, c, MPFR_RNDN);
        mpfr_abs(r15648, r15647, MPFR_RNDN);
        mpfr_add(r15649, r15646, r15648, MPFR_RNDN);
        mpfr_tan(r15650, r15645, MPFR_RNDN);
        mpfr_mul(r15651, r15649, r15650, MPFR_RNDN);
        return mpfr_get_d(r15651, MPFR_RNDN);
}

