#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 r15687 = d;
        float r15688 = log(r15687);
        float r15689 = c;
        float r15690 = fabs(r15689);
        float r15691 = r15688 + r15690;
        float r15692 = tan(r15687);
        float r15693 = r15691 * r15692;
        return r15693;
}

double f_id(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        double r15694 = d;
        double r15695 = log(r15694);
        double r15696 = c;
        double r15697 = fabs(r15696);
        double r15698 = r15695 + r15697;
        double r15699 = tan(r15694);
        double r15700 = r15698 * r15699;
        return r15700;
}


double f_of(float __attribute__((unused)) a, float __attribute__((unused)) b, float c, float d) {
        float r15701 = d;
        float r15702 = log(r15701);
        float r15703 = c;
        float r15704 = fabs(r15703);
        float r15705 = r15702 + r15704;
        float r15706 = tan(r15701);
        float r15707 = r15705 * r15706;
        return r15707;
}

double f_od(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        double r15708 = d;
        double r15709 = log(r15708);
        double r15710 = c;
        double r15711 = fabs(r15710);
        double r15712 = r15709 + r15711;
        double r15713 = tan(r15708);
        double r15714 = r15712 * r15713;
        return r15714;
}

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 r15715, r15716, r15717, r15718, r15719, r15720, r15721;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15715);
        mpfr_init(r15716);
        mpfr_init(r15717);
        mpfr_init(r15718);
        mpfr_init(r15719);
        mpfr_init(r15720);
        mpfr_init(r15721);
}

double f_im(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15715, d, MPFR_RNDN);
        mpfr_log(r15716, r15715, MPFR_RNDN);
        mpfr_set_d(r15717, c, MPFR_RNDN);
        mpfr_abs(r15718, r15717, MPFR_RNDN);
        mpfr_add(r15719, r15716, r15718, MPFR_RNDN);
        mpfr_tan(r15720, r15715, MPFR_RNDN);
        mpfr_mul(r15721, r15719, r15720, MPFR_RNDN);
        return mpfr_get_d(r15721, MPFR_RNDN);
}

static mpfr_t r15722, r15723, r15724, r15725, r15726, r15727, r15728;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15722);
        mpfr_init(r15723);
        mpfr_init(r15724);
        mpfr_init(r15725);
        mpfr_init(r15726);
        mpfr_init(r15727);
        mpfr_init(r15728);
}

double f_fm(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15722, d, MPFR_RNDN);
        mpfr_log(r15723, r15722, MPFR_RNDN);
        mpfr_set_d(r15724, c, MPFR_RNDN);
        mpfr_abs(r15725, r15724, MPFR_RNDN);
        mpfr_add(r15726, r15723, r15725, MPFR_RNDN);
        mpfr_tan(r15727, r15722, MPFR_RNDN);
        mpfr_mul(r15728, r15726, r15727, MPFR_RNDN);
        return mpfr_get_d(r15728, MPFR_RNDN);
}

static mpfr_t r15729, r15730, r15731, r15732, r15733, r15734, r15735;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15729);
        mpfr_init(r15730);
        mpfr_init(r15731);
        mpfr_init(r15732);
        mpfr_init(r15733);
        mpfr_init(r15734);
        mpfr_init(r15735);
}

double f_dm(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15729, d, MPFR_RNDN);
        mpfr_log(r15730, r15729, MPFR_RNDN);
        mpfr_set_d(r15731, c, MPFR_RNDN);
        mpfr_abs(r15732, r15731, MPFR_RNDN);
        mpfr_add(r15733, r15730, r15732, MPFR_RNDN);
        mpfr_tan(r15734, r15729, MPFR_RNDN);
        mpfr_mul(r15735, r15733, r15734, MPFR_RNDN);
        return mpfr_get_d(r15735, MPFR_RNDN);
}

