#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 r15719 = d;
        float r15720 = log(r15719);
        float r15721 = c;
        float r15722 = fabs(r15721);
        float r15723 = r15720 + r15722;
        float r15724 = tan(r15719);
        float r15725 = r15723 * r15724;
        return r15725;
}

double f_id(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        double r15726 = d;
        double r15727 = log(r15726);
        double r15728 = c;
        double r15729 = fabs(r15728);
        double r15730 = r15727 + r15729;
        double r15731 = tan(r15726);
        double r15732 = r15730 * r15731;
        return r15732;
}


double f_of(float __attribute__((unused)) a, float __attribute__((unused)) b, float c, float d) {
        float r15733 = d;
        float r15734 = log(r15733);
        float r15735 = c;
        float r15736 = fabs(r15735);
        float r15737 = r15734 + r15736;
        float r15738 = tan(r15733);
        float r15739 = r15737 * r15738;
        return r15739;
}

double f_od(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        double r15740 = d;
        double r15741 = log(r15740);
        double r15742 = c;
        double r15743 = fabs(r15742);
        double r15744 = r15741 + r15743;
        double r15745 = tan(r15740);
        double r15746 = r15744 * r15745;
        return r15746;
}

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 r15747, r15748, r15749, r15750, r15751, r15752, r15753;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15747);
        mpfr_init(r15748);
        mpfr_init(r15749);
        mpfr_init(r15750);
        mpfr_init(r15751);
        mpfr_init(r15752);
        mpfr_init(r15753);
}

double f_im(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15747, d, MPFR_RNDN);
        mpfr_log(r15748, r15747, MPFR_RNDN);
        mpfr_set_d(r15749, c, MPFR_RNDN);
        mpfr_abs(r15750, r15749, MPFR_RNDN);
        mpfr_add(r15751, r15748, r15750, MPFR_RNDN);
        mpfr_tan(r15752, r15747, MPFR_RNDN);
        mpfr_mul(r15753, r15751, r15752, MPFR_RNDN);
        return mpfr_get_d(r15753, MPFR_RNDN);
}

static mpfr_t r15754, r15755, r15756, r15757, r15758, r15759, r15760;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15754);
        mpfr_init(r15755);
        mpfr_init(r15756);
        mpfr_init(r15757);
        mpfr_init(r15758);
        mpfr_init(r15759);
        mpfr_init(r15760);
}

double f_fm(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15754, d, MPFR_RNDN);
        mpfr_log(r15755, r15754, MPFR_RNDN);
        mpfr_set_d(r15756, c, MPFR_RNDN);
        mpfr_abs(r15757, r15756, MPFR_RNDN);
        mpfr_add(r15758, r15755, r15757, MPFR_RNDN);
        mpfr_tan(r15759, r15754, MPFR_RNDN);
        mpfr_mul(r15760, r15758, r15759, MPFR_RNDN);
        return mpfr_get_d(r15760, MPFR_RNDN);
}

static mpfr_t r15761, r15762, r15763, r15764, r15765, r15766, r15767;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15761);
        mpfr_init(r15762);
        mpfr_init(r15763);
        mpfr_init(r15764);
        mpfr_init(r15765);
        mpfr_init(r15766);
        mpfr_init(r15767);
}

double f_dm(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15761, d, MPFR_RNDN);
        mpfr_log(r15762, r15761, MPFR_RNDN);
        mpfr_set_d(r15763, c, MPFR_RNDN);
        mpfr_abs(r15764, r15763, MPFR_RNDN);
        mpfr_add(r15765, r15762, r15764, MPFR_RNDN);
        mpfr_tan(r15766, r15761, MPFR_RNDN);
        mpfr_mul(r15767, r15765, r15766, MPFR_RNDN);
        return mpfr_get_d(r15767, MPFR_RNDN);
}

