#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 r15696 = d;
        float r15697 = log(r15696);
        float r15698 = c;
        float r15699 = fabs(r15698);
        float r15700 = r15697 + r15699;
        float r15701 = tan(r15696);
        float r15702 = r15700 * r15701;
        return r15702;
}

double f_id(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        double r15703 = d;
        double r15704 = log(r15703);
        double r15705 = c;
        double r15706 = fabs(r15705);
        double r15707 = r15704 + r15706;
        double r15708 = tan(r15703);
        double r15709 = r15707 * r15708;
        return r15709;
}


double f_of(float __attribute__((unused)) a, float __attribute__((unused)) b, float c, float d) {
        float r15710 = d;
        float r15711 = log(r15710);
        float r15712 = c;
        float r15713 = fabs(r15712);
        float r15714 = r15711 + r15713;
        float r15715 = tan(r15710);
        float r15716 = r15714 * r15715;
        return r15716;
}

double f_od(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        double r15717 = d;
        double r15718 = log(r15717);
        double r15719 = c;
        double r15720 = fabs(r15719);
        double r15721 = r15718 + r15720;
        double r15722 = tan(r15717);
        double r15723 = r15721 * r15722;
        return r15723;
}

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 r15724, r15725, r15726, r15727, r15728, r15729, r15730;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15724);
        mpfr_init(r15725);
        mpfr_init(r15726);
        mpfr_init(r15727);
        mpfr_init(r15728);
        mpfr_init(r15729);
        mpfr_init(r15730);
}

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

static mpfr_t r15731, r15732, r15733, r15734, r15735, r15736, r15737;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15731);
        mpfr_init(r15732);
        mpfr_init(r15733);
        mpfr_init(r15734);
        mpfr_init(r15735);
        mpfr_init(r15736);
        mpfr_init(r15737);
}

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

static mpfr_t r15738, r15739, r15740, r15741, r15742, r15743, r15744;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15738);
        mpfr_init(r15739);
        mpfr_init(r15740);
        mpfr_init(r15741);
        mpfr_init(r15742);
        mpfr_init(r15743);
        mpfr_init(r15744);
}

double f_dm(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15738, d, MPFR_RNDN);
        mpfr_log(r15739, r15738, MPFR_RNDN);
        mpfr_set_d(r15740, c, MPFR_RNDN);
        mpfr_abs(r15741, r15740, MPFR_RNDN);
        mpfr_add(r15742, r15739, r15741, MPFR_RNDN);
        mpfr_tan(r15743, r15738, MPFR_RNDN);
        mpfr_mul(r15744, r15742, r15743, MPFR_RNDN);
        return mpfr_get_d(r15744, MPFR_RNDN);
}

