#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 r15691 = d;
        float r15692 = log(r15691);
        float r15693 = c;
        float r15694 = fabs(r15693);
        float r15695 = r15692 + r15694;
        float r15696 = tan(r15691);
        float r15697 = r15695 * r15696;
        return r15697;
}

double f_id(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        double r15698 = d;
        double r15699 = log(r15698);
        double r15700 = c;
        double r15701 = fabs(r15700);
        double r15702 = r15699 + r15701;
        double r15703 = tan(r15698);
        double r15704 = r15702 * r15703;
        return r15704;
}


double f_of(float __attribute__((unused)) a, float __attribute__((unused)) b, float c, float d) {
        float r15705 = d;
        float r15706 = log(r15705);
        float r15707 = c;
        float r15708 = fabs(r15707);
        float r15709 = r15706 + r15708;
        float r15710 = tan(r15705);
        float r15711 = r15709 * r15710;
        return r15711;
}

double f_od(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        double r15712 = d;
        double r15713 = log(r15712);
        double r15714 = c;
        double r15715 = fabs(r15714);
        double r15716 = r15713 + r15715;
        double r15717 = tan(r15712);
        double r15718 = r15716 * r15717;
        return r15718;
}

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 r15719, r15720, r15721, r15722, r15723, r15724, r15725;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15719);
        mpfr_init(r15720);
        mpfr_init(r15721);
        mpfr_init(r15722);
        mpfr_init(r15723);
        mpfr_init(r15724);
        mpfr_init(r15725);
}

double f_im(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15719, d, MPFR_RNDN);
        mpfr_log(r15720, r15719, MPFR_RNDN);
        mpfr_set_d(r15721, c, MPFR_RNDN);
        mpfr_abs(r15722, r15721, MPFR_RNDN);
        mpfr_add(r15723, r15720, r15722, MPFR_RNDN);
        mpfr_tan(r15724, r15719, MPFR_RNDN);
        mpfr_mul(r15725, r15723, r15724, MPFR_RNDN);
        return mpfr_get_d(r15725, MPFR_RNDN);
}

static mpfr_t r15726, r15727, r15728, r15729, r15730, r15731, r15732;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15726);
        mpfr_init(r15727);
        mpfr_init(r15728);
        mpfr_init(r15729);
        mpfr_init(r15730);
        mpfr_init(r15731);
        mpfr_init(r15732);
}

double f_fm(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15726, d, MPFR_RNDN);
        mpfr_log(r15727, r15726, MPFR_RNDN);
        mpfr_set_d(r15728, c, MPFR_RNDN);
        mpfr_abs(r15729, r15728, MPFR_RNDN);
        mpfr_add(r15730, r15727, r15729, MPFR_RNDN);
        mpfr_tan(r15731, r15726, MPFR_RNDN);
        mpfr_mul(r15732, r15730, r15731, MPFR_RNDN);
        return mpfr_get_d(r15732, MPFR_RNDN);
}

static mpfr_t r15733, r15734, r15735, r15736, r15737, r15738, r15739;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15733);
        mpfr_init(r15734);
        mpfr_init(r15735);
        mpfr_init(r15736);
        mpfr_init(r15737);
        mpfr_init(r15738);
        mpfr_init(r15739);
}

double f_dm(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15733, d, MPFR_RNDN);
        mpfr_log(r15734, r15733, MPFR_RNDN);
        mpfr_set_d(r15735, c, MPFR_RNDN);
        mpfr_abs(r15736, r15735, MPFR_RNDN);
        mpfr_add(r15737, r15734, r15736, MPFR_RNDN);
        mpfr_tan(r15738, r15733, MPFR_RNDN);
        mpfr_mul(r15739, r15737, r15738, MPFR_RNDN);
        return mpfr_get_d(r15739, MPFR_RNDN);
}

