#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 r15602 = d;
        float r15603 = log(r15602);
        float r15604 = c;
        float r15605 = fabs(r15604);
        float r15606 = r15603 + r15605;
        float r15607 = tan(r15602);
        float r15608 = r15606 * r15607;
        return r15608;
}

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


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

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

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

void setup_mpfr_f_im() {
        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_im(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_fm() {
        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_fm(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);
}

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

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

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

