#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 r15578 = d;
        float r15579 = log(r15578);
        float r15580 = c;
        float r15581 = fabs(r15580);
        float r15582 = r15579 + r15581;
        float r15583 = tan(r15578);
        float r15584 = r15582 * r15583;
        return r15584;
}

double f_id(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        double r15585 = d;
        double r15586 = log(r15585);
        double r15587 = c;
        double r15588 = fabs(r15587);
        double r15589 = r15586 + r15588;
        double r15590 = tan(r15585);
        double r15591 = r15589 * r15590;
        return r15591;
}


double f_of(float __attribute__((unused)) a, float __attribute__((unused)) b, float c, float d) {
        float r15592 = d;
        float r15593 = log(r15592);
        float r15594 = c;
        float r15595 = fabs(r15594);
        float r15596 = r15593 + r15595;
        float r15597 = tan(r15592);
        float r15598 = r15596 * r15597;
        return r15598;
}

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

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 r15606, r15607, r15608, r15609, r15610, r15611, r15612;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15606);
        mpfr_init(r15607);
        mpfr_init(r15608);
        mpfr_init(r15609);
        mpfr_init(r15610);
        mpfr_init(r15611);
        mpfr_init(r15612);
}

double f_im(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15606, d, MPFR_RNDN);
        mpfr_log(r15607, r15606, MPFR_RNDN);
        mpfr_set_d(r15608, c, MPFR_RNDN);
        mpfr_abs(r15609, r15608, MPFR_RNDN);
        mpfr_add(r15610, r15607, r15609, MPFR_RNDN);
        mpfr_tan(r15611, r15606, MPFR_RNDN);
        mpfr_mul(r15612, r15610, r15611, MPFR_RNDN);
        return mpfr_get_d(r15612, MPFR_RNDN);
}

static mpfr_t r15613, r15614, r15615, r15616, r15617, r15618, r15619;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15613);
        mpfr_init(r15614);
        mpfr_init(r15615);
        mpfr_init(r15616);
        mpfr_init(r15617);
        mpfr_init(r15618);
        mpfr_init(r15619);
}

double f_fm(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15613, d, MPFR_RNDN);
        mpfr_log(r15614, r15613, MPFR_RNDN);
        mpfr_set_d(r15615, c, MPFR_RNDN);
        mpfr_abs(r15616, r15615, MPFR_RNDN);
        mpfr_add(r15617, r15614, r15616, MPFR_RNDN);
        mpfr_tan(r15618, r15613, MPFR_RNDN);
        mpfr_mul(r15619, r15617, r15618, MPFR_RNDN);
        return mpfr_get_d(r15619, MPFR_RNDN);
}

static mpfr_t r15620, r15621, r15622, r15623, r15624, r15625, r15626;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15620);
        mpfr_init(r15621);
        mpfr_init(r15622);
        mpfr_init(r15623);
        mpfr_init(r15624);
        mpfr_init(r15625);
        mpfr_init(r15626);
}

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

