#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 r15707 = d;
        float r15708 = log(r15707);
        float r15709 = c;
        float r15710 = fabs(r15709);
        float r15711 = r15708 + r15710;
        float r15712 = tan(r15707);
        float r15713 = r15711 * r15712;
        return r15713;
}

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


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

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

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 r15735, r15736, r15737, r15738, r15739, r15740, r15741;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15735);
        mpfr_init(r15736);
        mpfr_init(r15737);
        mpfr_init(r15738);
        mpfr_init(r15739);
        mpfr_init(r15740);
        mpfr_init(r15741);
}

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

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

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15742);
        mpfr_init(r15743);
        mpfr_init(r15744);
        mpfr_init(r15745);
        mpfr_init(r15746);
        mpfr_init(r15747);
        mpfr_init(r15748);
}

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

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

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15749);
        mpfr_init(r15750);
        mpfr_init(r15751);
        mpfr_init(r15752);
        mpfr_init(r15753);
        mpfr_init(r15754);
        mpfr_init(r15755);
}

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

