#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 r15606 = d;
        float r15607 = log(r15606);
        float r15608 = c;
        float r15609 = fabs(r15608);
        float r15610 = r15607 + r15609;
        float r15611 = tan(r15606);
        float r15612 = r15610 * r15611;
        return r15612;
}

double f_id(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        double r15613 = d;
        double r15614 = log(r15613);
        double r15615 = c;
        double r15616 = fabs(r15615);
        double r15617 = r15614 + r15616;
        double r15618 = tan(r15613);
        double r15619 = r15617 * r15618;
        return r15619;
}


double f_of(float __attribute__((unused)) a, float __attribute__((unused)) b, float c, float d) {
        float r15620 = d;
        float r15621 = log(r15620);
        float r15622 = c;
        float r15623 = fabs(r15622);
        float r15624 = r15621 + r15623;
        float r15625 = tan(r15620);
        float r15626 = r15624 * r15625;
        return r15626;
}

double f_od(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        double r15627 = d;
        double r15628 = log(r15627);
        double r15629 = c;
        double r15630 = fabs(r15629);
        double r15631 = r15628 + r15630;
        double r15632 = tan(r15627);
        double r15633 = r15631 * r15632;
        return r15633;
}

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 r15634, r15635, r15636, r15637, r15638, r15639, r15640;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15634);
        mpfr_init(r15635);
        mpfr_init(r15636);
        mpfr_init(r15637);
        mpfr_init(r15638);
        mpfr_init(r15639);
        mpfr_init(r15640);
}

double f_im(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15634, d, MPFR_RNDN);
        mpfr_log(r15635, r15634, MPFR_RNDN);
        mpfr_set_d(r15636, c, MPFR_RNDN);
        mpfr_abs(r15637, r15636, MPFR_RNDN);
        mpfr_add(r15638, r15635, r15637, MPFR_RNDN);
        mpfr_tan(r15639, r15634, MPFR_RNDN);
        mpfr_mul(r15640, r15638, r15639, MPFR_RNDN);
        return mpfr_get_d(r15640, MPFR_RNDN);
}

static mpfr_t r15641, r15642, r15643, r15644, r15645, r15646, r15647;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15641);
        mpfr_init(r15642);
        mpfr_init(r15643);
        mpfr_init(r15644);
        mpfr_init(r15645);
        mpfr_init(r15646);
        mpfr_init(r15647);
}

double f_fm(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15641, d, MPFR_RNDN);
        mpfr_log(r15642, r15641, MPFR_RNDN);
        mpfr_set_d(r15643, c, MPFR_RNDN);
        mpfr_abs(r15644, r15643, MPFR_RNDN);
        mpfr_add(r15645, r15642, r15644, MPFR_RNDN);
        mpfr_tan(r15646, r15641, MPFR_RNDN);
        mpfr_mul(r15647, r15645, r15646, MPFR_RNDN);
        return mpfr_get_d(r15647, MPFR_RNDN);
}

static mpfr_t r15648, r15649, r15650, r15651, r15652, r15653, r15654;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15648);
        mpfr_init(r15649);
        mpfr_init(r15650);
        mpfr_init(r15651);
        mpfr_init(r15652);
        mpfr_init(r15653);
        mpfr_init(r15654);
}

double f_dm(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15648, d, MPFR_RNDN);
        mpfr_log(r15649, r15648, MPFR_RNDN);
        mpfr_set_d(r15650, c, MPFR_RNDN);
        mpfr_abs(r15651, r15650, MPFR_RNDN);
        mpfr_add(r15652, r15649, r15651, MPFR_RNDN);
        mpfr_tan(r15653, r15648, MPFR_RNDN);
        mpfr_mul(r15654, r15652, r15653, MPFR_RNDN);
        return mpfr_get_d(r15654, MPFR_RNDN);
}

