#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 r15530 = d;
        float r15531 = log(r15530);
        float r15532 = c;
        float r15533 = fabs(r15532);
        float r15534 = r15531 + r15533;
        float r15535 = tan(r15530);
        float r15536 = r15534 * r15535;
        return r15536;
}

double f_id(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        double r15537 = d;
        double r15538 = log(r15537);
        double r15539 = c;
        double r15540 = fabs(r15539);
        double r15541 = r15538 + r15540;
        double r15542 = tan(r15537);
        double r15543 = r15541 * r15542;
        return r15543;
}


double f_of(float __attribute__((unused)) a, float __attribute__((unused)) b, float c, float d) {
        float r15544 = d;
        float r15545 = log(r15544);
        float r15546 = c;
        float r15547 = fabs(r15546);
        float r15548 = r15545 + r15547;
        float r15549 = tan(r15544);
        float r15550 = r15548 * r15549;
        return r15550;
}

double f_od(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        double r15551 = d;
        double r15552 = log(r15551);
        double r15553 = c;
        double r15554 = fabs(r15553);
        double r15555 = r15552 + r15554;
        double r15556 = tan(r15551);
        double r15557 = r15555 * r15556;
        return r15557;
}

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 r15558, r15559, r15560, r15561, r15562, r15563, r15564;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15558);
        mpfr_init(r15559);
        mpfr_init(r15560);
        mpfr_init(r15561);
        mpfr_init(r15562);
        mpfr_init(r15563);
        mpfr_init(r15564);
}

double f_im(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15558, d, MPFR_RNDN);
        mpfr_log(r15559, r15558, MPFR_RNDN);
        mpfr_set_d(r15560, c, MPFR_RNDN);
        mpfr_abs(r15561, r15560, MPFR_RNDN);
        mpfr_add(r15562, r15559, r15561, MPFR_RNDN);
        mpfr_tan(r15563, r15558, MPFR_RNDN);
        mpfr_mul(r15564, r15562, r15563, MPFR_RNDN);
        return mpfr_get_d(r15564, MPFR_RNDN);
}

static mpfr_t r15565, r15566, r15567, r15568, r15569, r15570, r15571;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15565);
        mpfr_init(r15566);
        mpfr_init(r15567);
        mpfr_init(r15568);
        mpfr_init(r15569);
        mpfr_init(r15570);
        mpfr_init(r15571);
}

double f_fm(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15565, d, MPFR_RNDN);
        mpfr_log(r15566, r15565, MPFR_RNDN);
        mpfr_set_d(r15567, c, MPFR_RNDN);
        mpfr_abs(r15568, r15567, MPFR_RNDN);
        mpfr_add(r15569, r15566, r15568, MPFR_RNDN);
        mpfr_tan(r15570, r15565, MPFR_RNDN);
        mpfr_mul(r15571, r15569, r15570, MPFR_RNDN);
        return mpfr_get_d(r15571, MPFR_RNDN);
}

static mpfr_t r15572, r15573, r15574, r15575, r15576, r15577, r15578;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15572);
        mpfr_init(r15573);
        mpfr_init(r15574);
        mpfr_init(r15575);
        mpfr_init(r15576);
        mpfr_init(r15577);
        mpfr_init(r15578);
}

double f_dm(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15572, d, MPFR_RNDN);
        mpfr_log(r15573, r15572, MPFR_RNDN);
        mpfr_set_d(r15574, c, MPFR_RNDN);
        mpfr_abs(r15575, r15574, MPFR_RNDN);
        mpfr_add(r15576, r15573, r15575, MPFR_RNDN);
        mpfr_tan(r15577, r15572, MPFR_RNDN);
        mpfr_mul(r15578, r15576, r15577, MPFR_RNDN);
        return mpfr_get_d(r15578, MPFR_RNDN);
}

