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

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


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

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

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 r15619, r15620, r15621, r15622, r15623, r15624, r15625;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15619);
        mpfr_init(r15620);
        mpfr_init(r15621);
        mpfr_init(r15622);
        mpfr_init(r15623);
        mpfr_init(r15624);
        mpfr_init(r15625);
}

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

static mpfr_t r15626, r15627, r15628, r15629, r15630, r15631, r15632;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15626);
        mpfr_init(r15627);
        mpfr_init(r15628);
        mpfr_init(r15629);
        mpfr_init(r15630);
        mpfr_init(r15631);
        mpfr_init(r15632);
}

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

static mpfr_t r15633, r15634, r15635, r15636, r15637, r15638, r15639;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15633);
        mpfr_init(r15634);
        mpfr_init(r15635);
        mpfr_init(r15636);
        mpfr_init(r15637);
        mpfr_init(r15638);
        mpfr_init(r15639);
}

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

