#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 r15554 = d;
        float r15555 = log(r15554);
        float r15556 = c;
        float r15557 = fabs(r15556);
        float r15558 = r15555 + r15557;
        float r15559 = tan(r15554);
        float r15560 = r15558 * r15559;
        return r15560;
}

double f_id(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        double r15561 = d;
        double r15562 = log(r15561);
        double r15563 = c;
        double r15564 = fabs(r15563);
        double r15565 = r15562 + r15564;
        double r15566 = tan(r15561);
        double r15567 = r15565 * r15566;
        return r15567;
}


double f_of(float __attribute__((unused)) a, float __attribute__((unused)) b, float c, float d) {
        float r15568 = d;
        float r15569 = log(r15568);
        float r15570 = c;
        float r15571 = fabs(r15570);
        float r15572 = r15569 + r15571;
        float r15573 = tan(r15568);
        float r15574 = r15572 * r15573;
        return r15574;
}

double f_od(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        double r15575 = d;
        double r15576 = log(r15575);
        double r15577 = c;
        double r15578 = fabs(r15577);
        double r15579 = r15576 + r15578;
        double r15580 = tan(r15575);
        double r15581 = r15579 * r15580;
        return r15581;
}

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 r15582, r15583, r15584, r15585, r15586, r15587, r15588;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15582);
        mpfr_init(r15583);
        mpfr_init(r15584);
        mpfr_init(r15585);
        mpfr_init(r15586);
        mpfr_init(r15587);
        mpfr_init(r15588);
}

double f_im(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15582, d, MPFR_RNDN);
        mpfr_log(r15583, r15582, MPFR_RNDN);
        mpfr_set_d(r15584, c, MPFR_RNDN);
        mpfr_abs(r15585, r15584, MPFR_RNDN);
        mpfr_add(r15586, r15583, r15585, MPFR_RNDN);
        mpfr_tan(r15587, r15582, MPFR_RNDN);
        mpfr_mul(r15588, r15586, r15587, MPFR_RNDN);
        return mpfr_get_d(r15588, MPFR_RNDN);
}

static mpfr_t r15589, r15590, r15591, r15592, r15593, r15594, r15595;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15589);
        mpfr_init(r15590);
        mpfr_init(r15591);
        mpfr_init(r15592);
        mpfr_init(r15593);
        mpfr_init(r15594);
        mpfr_init(r15595);
}

double f_fm(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15589, d, MPFR_RNDN);
        mpfr_log(r15590, r15589, MPFR_RNDN);
        mpfr_set_d(r15591, c, MPFR_RNDN);
        mpfr_abs(r15592, r15591, MPFR_RNDN);
        mpfr_add(r15593, r15590, r15592, MPFR_RNDN);
        mpfr_tan(r15594, r15589, MPFR_RNDN);
        mpfr_mul(r15595, r15593, r15594, MPFR_RNDN);
        return mpfr_get_d(r15595, MPFR_RNDN);
}

static mpfr_t r15596, r15597, r15598, r15599, r15600, r15601, r15602;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15596);
        mpfr_init(r15597);
        mpfr_init(r15598);
        mpfr_init(r15599);
        mpfr_init(r15600);
        mpfr_init(r15601);
        mpfr_init(r15602);
}

double f_dm(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15596, d, MPFR_RNDN);
        mpfr_log(r15597, r15596, MPFR_RNDN);
        mpfr_set_d(r15598, c, MPFR_RNDN);
        mpfr_abs(r15599, r15598, MPFR_RNDN);
        mpfr_add(r15600, r15597, r15599, MPFR_RNDN);
        mpfr_tan(r15601, r15596, MPFR_RNDN);
        mpfr_mul(r15602, r15600, r15601, MPFR_RNDN);
        return mpfr_get_d(r15602, MPFR_RNDN);
}

