#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 r15574 = d;
        float r15575 = log(r15574);
        float r15576 = c;
        float r15577 = fabs(r15576);
        float r15578 = r15575 + r15577;
        float r15579 = tan(r15574);
        float r15580 = r15578 * r15579;
        return r15580;
}

double f_id(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        double r15581 = d;
        double r15582 = log(r15581);
        double r15583 = c;
        double r15584 = fabs(r15583);
        double r15585 = r15582 + r15584;
        double r15586 = tan(r15581);
        double r15587 = r15585 * r15586;
        return r15587;
}


double f_of(float __attribute__((unused)) a, float __attribute__((unused)) b, float c, float d) {
        float r15588 = d;
        float r15589 = log(r15588);
        float r15590 = c;
        float r15591 = fabs(r15590);
        float r15592 = r15589 + r15591;
        float r15593 = tan(r15588);
        float r15594 = r15592 * r15593;
        return r15594;
}

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

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 r15602, r15603, r15604, r15605, r15606, r15607, r15608;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15602);
        mpfr_init(r15603);
        mpfr_init(r15604);
        mpfr_init(r15605);
        mpfr_init(r15606);
        mpfr_init(r15607);
        mpfr_init(r15608);
}

double f_im(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15602, d, MPFR_RNDN);
        mpfr_log(r15603, r15602, MPFR_RNDN);
        mpfr_set_d(r15604, c, MPFR_RNDN);
        mpfr_abs(r15605, r15604, MPFR_RNDN);
        mpfr_add(r15606, r15603, r15605, MPFR_RNDN);
        mpfr_tan(r15607, r15602, MPFR_RNDN);
        mpfr_mul(r15608, r15606, r15607, MPFR_RNDN);
        return mpfr_get_d(r15608, MPFR_RNDN);
}

static mpfr_t r15609, r15610, r15611, r15612, r15613, r15614, r15615;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15609);
        mpfr_init(r15610);
        mpfr_init(r15611);
        mpfr_init(r15612);
        mpfr_init(r15613);
        mpfr_init(r15614);
        mpfr_init(r15615);
}

double f_fm(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15609, d, MPFR_RNDN);
        mpfr_log(r15610, r15609, MPFR_RNDN);
        mpfr_set_d(r15611, c, MPFR_RNDN);
        mpfr_abs(r15612, r15611, MPFR_RNDN);
        mpfr_add(r15613, r15610, r15612, MPFR_RNDN);
        mpfr_tan(r15614, r15609, MPFR_RNDN);
        mpfr_mul(r15615, r15613, r15614, MPFR_RNDN);
        return mpfr_get_d(r15615, MPFR_RNDN);
}

static mpfr_t r15616, r15617, r15618, r15619, r15620, r15621, r15622;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15616);
        mpfr_init(r15617);
        mpfr_init(r15618);
        mpfr_init(r15619);
        mpfr_init(r15620);
        mpfr_init(r15621);
        mpfr_init(r15622);
}

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

