#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 r15566 = d;
        float r15567 = log(r15566);
        float r15568 = c;
        float r15569 = fabs(r15568);
        float r15570 = r15567 + r15569;
        float r15571 = tan(r15566);
        float r15572 = r15570 * r15571;
        return r15572;
}

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


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

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

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 r15594, r15595, r15596, r15597, r15598, r15599, r15600;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15594);
        mpfr_init(r15595);
        mpfr_init(r15596);
        mpfr_init(r15597);
        mpfr_init(r15598);
        mpfr_init(r15599);
        mpfr_init(r15600);
}

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

static mpfr_t r15601, r15602, r15603, r15604, r15605, r15606, r15607;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15601);
        mpfr_init(r15602);
        mpfr_init(r15603);
        mpfr_init(r15604);
        mpfr_init(r15605);
        mpfr_init(r15606);
        mpfr_init(r15607);
}

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

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

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15608);
        mpfr_init(r15609);
        mpfr_init(r15610);
        mpfr_init(r15611);
        mpfr_init(r15612);
        mpfr_init(r15613);
        mpfr_init(r15614);
}

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

