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

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


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

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

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

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

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

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

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

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

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

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

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

