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

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


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

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

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 r15727, r15728, r15729, r15730, r15731, r15732, r15733;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15727);
        mpfr_init(r15728);
        mpfr_init(r15729);
        mpfr_init(r15730);
        mpfr_init(r15731);
        mpfr_init(r15732);
        mpfr_init(r15733);
}

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

static mpfr_t r15734, r15735, r15736, r15737, r15738, r15739, r15740;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15734);
        mpfr_init(r15735);
        mpfr_init(r15736);
        mpfr_init(r15737);
        mpfr_init(r15738);
        mpfr_init(r15739);
        mpfr_init(r15740);
}

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

static mpfr_t r15741, r15742, r15743, r15744, r15745, r15746, r15747;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15741);
        mpfr_init(r15742);
        mpfr_init(r15743);
        mpfr_init(r15744);
        mpfr_init(r15745);
        mpfr_init(r15746);
        mpfr_init(r15747);
}

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

