#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 r15595 = d;
        float r15596 = log(r15595);
        float r15597 = c;
        float r15598 = fabs(r15597);
        float r15599 = r15596 + r15598;
        float r15600 = tan(r15595);
        float r15601 = r15599 * r15600;
        return r15601;
}

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


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

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

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 r15623, r15624, r15625, r15626, r15627, r15628, r15629;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15623);
        mpfr_init(r15624);
        mpfr_init(r15625);
        mpfr_init(r15626);
        mpfr_init(r15627);
        mpfr_init(r15628);
        mpfr_init(r15629);
}

double f_im(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15623, d, MPFR_RNDN);
        mpfr_log(r15624, r15623, MPFR_RNDN);
        mpfr_set_d(r15625, c, MPFR_RNDN);
        mpfr_abs(r15626, r15625, MPFR_RNDN);
        mpfr_add(r15627, r15624, r15626, MPFR_RNDN);
        mpfr_tan(r15628, r15623, MPFR_RNDN);
        mpfr_mul(r15629, r15627, r15628, MPFR_RNDN);
        return mpfr_get_d(r15629, MPFR_RNDN);
}

static mpfr_t r15630, r15631, r15632, r15633, r15634, r15635, r15636;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15630);
        mpfr_init(r15631);
        mpfr_init(r15632);
        mpfr_init(r15633);
        mpfr_init(r15634);
        mpfr_init(r15635);
        mpfr_init(r15636);
}

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

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

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15637);
        mpfr_init(r15638);
        mpfr_init(r15639);
        mpfr_init(r15640);
        mpfr_init(r15641);
        mpfr_init(r15642);
        mpfr_init(r15643);
}

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

