#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 r15610 = d;
        float r15611 = log(r15610);
        float r15612 = c;
        float r15613 = fabs(r15612);
        float r15614 = r15611 + r15613;
        float r15615 = tan(r15610);
        float r15616 = r15614 * r15615;
        return r15616;
}

double f_id(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        double r15617 = d;
        double r15618 = log(r15617);
        double r15619 = c;
        double r15620 = fabs(r15619);
        double r15621 = r15618 + r15620;
        double r15622 = tan(r15617);
        double r15623 = r15621 * r15622;
        return r15623;
}


double f_of(float __attribute__((unused)) a, float __attribute__((unused)) b, float c, float d) {
        float r15624 = d;
        float r15625 = log(r15624);
        float r15626 = c;
        float r15627 = fabs(r15626);
        float r15628 = r15625 + r15627;
        float r15629 = tan(r15624);
        float r15630 = r15628 * r15629;
        return r15630;
}

double f_od(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        double r15631 = d;
        double r15632 = log(r15631);
        double r15633 = c;
        double r15634 = fabs(r15633);
        double r15635 = r15632 + r15634;
        double r15636 = tan(r15631);
        double r15637 = r15635 * r15636;
        return r15637;
}

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 r15638, r15639, r15640, r15641, r15642, r15643, r15644;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15638);
        mpfr_init(r15639);
        mpfr_init(r15640);
        mpfr_init(r15641);
        mpfr_init(r15642);
        mpfr_init(r15643);
        mpfr_init(r15644);
}

double f_im(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15638, d, MPFR_RNDN);
        mpfr_log(r15639, r15638, MPFR_RNDN);
        mpfr_set_d(r15640, c, MPFR_RNDN);
        mpfr_abs(r15641, r15640, MPFR_RNDN);
        mpfr_add(r15642, r15639, r15641, MPFR_RNDN);
        mpfr_tan(r15643, r15638, MPFR_RNDN);
        mpfr_mul(r15644, r15642, r15643, MPFR_RNDN);
        return mpfr_get_d(r15644, MPFR_RNDN);
}

static mpfr_t r15645, r15646, r15647, r15648, r15649, r15650, r15651;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15645);
        mpfr_init(r15646);
        mpfr_init(r15647);
        mpfr_init(r15648);
        mpfr_init(r15649);
        mpfr_init(r15650);
        mpfr_init(r15651);
}

double f_fm(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15645, d, MPFR_RNDN);
        mpfr_log(r15646, r15645, MPFR_RNDN);
        mpfr_set_d(r15647, c, MPFR_RNDN);
        mpfr_abs(r15648, r15647, MPFR_RNDN);
        mpfr_add(r15649, r15646, r15648, MPFR_RNDN);
        mpfr_tan(r15650, r15645, MPFR_RNDN);
        mpfr_mul(r15651, r15649, r15650, MPFR_RNDN);
        return mpfr_get_d(r15651, MPFR_RNDN);
}

static mpfr_t r15652, r15653, r15654, r15655, r15656, r15657, r15658;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15652);
        mpfr_init(r15653);
        mpfr_init(r15654);
        mpfr_init(r15655);
        mpfr_init(r15656);
        mpfr_init(r15657);
        mpfr_init(r15658);
}

double f_dm(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15652, d, MPFR_RNDN);
        mpfr_log(r15653, r15652, MPFR_RNDN);
        mpfr_set_d(r15654, c, MPFR_RNDN);
        mpfr_abs(r15655, r15654, MPFR_RNDN);
        mpfr_add(r15656, r15653, r15655, MPFR_RNDN);
        mpfr_tan(r15657, r15652, MPFR_RNDN);
        mpfr_mul(r15658, r15656, r15657, MPFR_RNDN);
        return mpfr_get_d(r15658, MPFR_RNDN);
}

