#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 r15715 = d;
        float r15716 = log(r15715);
        float r15717 = c;
        float r15718 = fabs(r15717);
        float r15719 = r15716 + r15718;
        float r15720 = tan(r15715);
        float r15721 = r15719 * r15720;
        return r15721;
}

double f_id(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        double r15722 = d;
        double r15723 = log(r15722);
        double r15724 = c;
        double r15725 = fabs(r15724);
        double r15726 = r15723 + r15725;
        double r15727 = tan(r15722);
        double r15728 = r15726 * r15727;
        return r15728;
}


double f_of(float __attribute__((unused)) a, float __attribute__((unused)) b, float c, float d) {
        float r15729 = d;
        float r15730 = log(r15729);
        float r15731 = c;
        float r15732 = fabs(r15731);
        float r15733 = r15730 + r15732;
        float r15734 = tan(r15729);
        float r15735 = r15733 * r15734;
        return r15735;
}

double f_od(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        double r15736 = d;
        double r15737 = log(r15736);
        double r15738 = c;
        double r15739 = fabs(r15738);
        double r15740 = r15737 + r15739;
        double r15741 = tan(r15736);
        double r15742 = r15740 * r15741;
        return r15742;
}

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 r15743, r15744, r15745, r15746, r15747, r15748, r15749;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15743);
        mpfr_init(r15744);
        mpfr_init(r15745);
        mpfr_init(r15746);
        mpfr_init(r15747);
        mpfr_init(r15748);
        mpfr_init(r15749);
}

double f_im(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15743, d, MPFR_RNDN);
        mpfr_log(r15744, r15743, MPFR_RNDN);
        mpfr_set_d(r15745, c, MPFR_RNDN);
        mpfr_abs(r15746, r15745, MPFR_RNDN);
        mpfr_add(r15747, r15744, r15746, MPFR_RNDN);
        mpfr_tan(r15748, r15743, MPFR_RNDN);
        mpfr_mul(r15749, r15747, r15748, MPFR_RNDN);
        return mpfr_get_d(r15749, MPFR_RNDN);
}

static mpfr_t r15750, r15751, r15752, r15753, r15754, r15755, r15756;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15750);
        mpfr_init(r15751);
        mpfr_init(r15752);
        mpfr_init(r15753);
        mpfr_init(r15754);
        mpfr_init(r15755);
        mpfr_init(r15756);
}

double f_fm(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15750, d, MPFR_RNDN);
        mpfr_log(r15751, r15750, MPFR_RNDN);
        mpfr_set_d(r15752, c, MPFR_RNDN);
        mpfr_abs(r15753, r15752, MPFR_RNDN);
        mpfr_add(r15754, r15751, r15753, MPFR_RNDN);
        mpfr_tan(r15755, r15750, MPFR_RNDN);
        mpfr_mul(r15756, r15754, r15755, MPFR_RNDN);
        return mpfr_get_d(r15756, MPFR_RNDN);
}

static mpfr_t r15757, r15758, r15759, r15760, r15761, r15762, r15763;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15757);
        mpfr_init(r15758);
        mpfr_init(r15759);
        mpfr_init(r15760);
        mpfr_init(r15761);
        mpfr_init(r15762);
        mpfr_init(r15763);
}

double f_dm(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15757, d, MPFR_RNDN);
        mpfr_log(r15758, r15757, MPFR_RNDN);
        mpfr_set_d(r15759, c, MPFR_RNDN);
        mpfr_abs(r15760, r15759, MPFR_RNDN);
        mpfr_add(r15761, r15758, r15760, MPFR_RNDN);
        mpfr_tan(r15762, r15757, MPFR_RNDN);
        mpfr_mul(r15763, r15761, r15762, MPFR_RNDN);
        return mpfr_get_d(r15763, MPFR_RNDN);
}

