#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 r15590 = d;
        float r15591 = log(r15590);
        float r15592 = c;
        float r15593 = fabs(r15592);
        float r15594 = r15591 + r15593;
        float r15595 = tan(r15590);
        float r15596 = r15594 * r15595;
        return r15596;
}

double f_id(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        double r15597 = d;
        double r15598 = log(r15597);
        double r15599 = c;
        double r15600 = fabs(r15599);
        double r15601 = r15598 + r15600;
        double r15602 = tan(r15597);
        double r15603 = r15601 * r15602;
        return r15603;
}


double f_of(float __attribute__((unused)) a, float __attribute__((unused)) b, float c, float d) {
        float r15604 = d;
        float r15605 = log(r15604);
        float r15606 = c;
        float r15607 = fabs(r15606);
        float r15608 = r15605 + r15607;
        float r15609 = tan(r15604);
        float r15610 = r15608 * r15609;
        return r15610;
}

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

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 r15618, r15619, r15620, r15621, r15622, r15623, r15624;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15618);
        mpfr_init(r15619);
        mpfr_init(r15620);
        mpfr_init(r15621);
        mpfr_init(r15622);
        mpfr_init(r15623);
        mpfr_init(r15624);
}

double f_im(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15618, d, MPFR_RNDN);
        mpfr_log(r15619, r15618, MPFR_RNDN);
        mpfr_set_d(r15620, c, MPFR_RNDN);
        mpfr_abs(r15621, r15620, MPFR_RNDN);
        mpfr_add(r15622, r15619, r15621, MPFR_RNDN);
        mpfr_tan(r15623, r15618, MPFR_RNDN);
        mpfr_mul(r15624, r15622, r15623, MPFR_RNDN);
        return mpfr_get_d(r15624, MPFR_RNDN);
}

static mpfr_t r15625, r15626, r15627, r15628, r15629, r15630, r15631;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15625);
        mpfr_init(r15626);
        mpfr_init(r15627);
        mpfr_init(r15628);
        mpfr_init(r15629);
        mpfr_init(r15630);
        mpfr_init(r15631);
}

double f_fm(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15625, d, MPFR_RNDN);
        mpfr_log(r15626, r15625, MPFR_RNDN);
        mpfr_set_d(r15627, c, MPFR_RNDN);
        mpfr_abs(r15628, r15627, MPFR_RNDN);
        mpfr_add(r15629, r15626, r15628, MPFR_RNDN);
        mpfr_tan(r15630, r15625, MPFR_RNDN);
        mpfr_mul(r15631, r15629, r15630, MPFR_RNDN);
        return mpfr_get_d(r15631, MPFR_RNDN);
}

static mpfr_t r15632, r15633, r15634, r15635, r15636, r15637, r15638;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15632);
        mpfr_init(r15633);
        mpfr_init(r15634);
        mpfr_init(r15635);
        mpfr_init(r15636);
        mpfr_init(r15637);
        mpfr_init(r15638);
}

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

