#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 r15711 = d;
        float r15712 = log(r15711);
        float r15713 = c;
        float r15714 = fabs(r15713);
        float r15715 = r15712 + r15714;
        float r15716 = tan(r15711);
        float r15717 = r15715 * r15716;
        return r15717;
}

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


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

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

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 r15739, r15740, r15741, r15742, r15743, r15744, r15745;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15739);
        mpfr_init(r15740);
        mpfr_init(r15741);
        mpfr_init(r15742);
        mpfr_init(r15743);
        mpfr_init(r15744);
        mpfr_init(r15745);
}

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

static mpfr_t r15746, r15747, r15748, r15749, r15750, r15751, r15752;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15746);
        mpfr_init(r15747);
        mpfr_init(r15748);
        mpfr_init(r15749);
        mpfr_init(r15750);
        mpfr_init(r15751);
        mpfr_init(r15752);
}

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

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

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15753);
        mpfr_init(r15754);
        mpfr_init(r15755);
        mpfr_init(r15756);
        mpfr_init(r15757);
        mpfr_init(r15758);
        mpfr_init(r15759);
}

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

