#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 r15731 = d;
        float r15732 = log(r15731);
        float r15733 = c;
        float r15734 = fabs(r15733);
        float r15735 = r15732 + r15734;
        float r15736 = tan(r15731);
        float r15737 = r15735 * r15736;
        return r15737;
}

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


double f_of(float __attribute__((unused)) a, float __attribute__((unused)) b, float c, float d) {
        float r15745 = d;
        float r15746 = log(r15745);
        float r15747 = c;
        float r15748 = fabs(r15747);
        float r15749 = r15746 + r15748;
        float r15750 = tan(r15745);
        float r15751 = r15749 * r15750;
        return r15751;
}

double f_od(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        double r15752 = d;
        double r15753 = log(r15752);
        double r15754 = c;
        double r15755 = fabs(r15754);
        double r15756 = r15753 + r15755;
        double r15757 = tan(r15752);
        double r15758 = r15756 * r15757;
        return r15758;
}

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 r15759, r15760, r15761, r15762, r15763, r15764, r15765;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15759);
        mpfr_init(r15760);
        mpfr_init(r15761);
        mpfr_init(r15762);
        mpfr_init(r15763);
        mpfr_init(r15764);
        mpfr_init(r15765);
}

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

static mpfr_t r15766, r15767, r15768, r15769, r15770, r15771, r15772;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15766);
        mpfr_init(r15767);
        mpfr_init(r15768);
        mpfr_init(r15769);
        mpfr_init(r15770);
        mpfr_init(r15771);
        mpfr_init(r15772);
}

double f_fm(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15766, d, MPFR_RNDN);
        mpfr_log(r15767, r15766, MPFR_RNDN);
        mpfr_set_d(r15768, c, MPFR_RNDN);
        mpfr_abs(r15769, r15768, MPFR_RNDN);
        mpfr_add(r15770, r15767, r15769, MPFR_RNDN);
        mpfr_tan(r15771, r15766, MPFR_RNDN);
        mpfr_mul(r15772, r15770, r15771, MPFR_RNDN);
        return mpfr_get_d(r15772, MPFR_RNDN);
}

static mpfr_t r15773, r15774, r15775, r15776, r15777, r15778, r15779;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15773);
        mpfr_init(r15774);
        mpfr_init(r15775);
        mpfr_init(r15776);
        mpfr_init(r15777);
        mpfr_init(r15778);
        mpfr_init(r15779);
}

double f_dm(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15773, d, MPFR_RNDN);
        mpfr_log(r15774, r15773, MPFR_RNDN);
        mpfr_set_d(r15775, c, MPFR_RNDN);
        mpfr_abs(r15776, r15775, MPFR_RNDN);
        mpfr_add(r15777, r15774, r15776, MPFR_RNDN);
        mpfr_tan(r15778, r15773, MPFR_RNDN);
        mpfr_mul(r15779, r15777, r15778, MPFR_RNDN);
        return mpfr_get_d(r15779, MPFR_RNDN);
}

