#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 r15622 = d;
        float r15623 = log(r15622);
        float r15624 = c;
        float r15625 = fabs(r15624);
        float r15626 = r15623 + r15625;
        float r15627 = tan(r15622);
        float r15628 = r15626 * r15627;
        return r15628;
}

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


double f_of(float __attribute__((unused)) a, float __attribute__((unused)) b, float c, float d) {
        float r15636 = d;
        float r15637 = log(r15636);
        float r15638 = c;
        float r15639 = fabs(r15638);
        float r15640 = r15637 + r15639;
        float r15641 = tan(r15636);
        float r15642 = r15640 * r15641;
        return r15642;
}

double f_od(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        double r15643 = d;
        double r15644 = log(r15643);
        double r15645 = c;
        double r15646 = fabs(r15645);
        double r15647 = r15644 + r15646;
        double r15648 = tan(r15643);
        double r15649 = r15647 * r15648;
        return r15649;
}

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 r15650, r15651, r15652, r15653, r15654, r15655, r15656;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15650);
        mpfr_init(r15651);
        mpfr_init(r15652);
        mpfr_init(r15653);
        mpfr_init(r15654);
        mpfr_init(r15655);
        mpfr_init(r15656);
}

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

static mpfr_t r15657, r15658, r15659, r15660, r15661, r15662, r15663;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15657);
        mpfr_init(r15658);
        mpfr_init(r15659);
        mpfr_init(r15660);
        mpfr_init(r15661);
        mpfr_init(r15662);
        mpfr_init(r15663);
}

double f_fm(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15657, d, MPFR_RNDN);
        mpfr_log(r15658, r15657, MPFR_RNDN);
        mpfr_set_d(r15659, c, MPFR_RNDN);
        mpfr_abs(r15660, r15659, MPFR_RNDN);
        mpfr_add(r15661, r15658, r15660, MPFR_RNDN);
        mpfr_tan(r15662, r15657, MPFR_RNDN);
        mpfr_mul(r15663, r15661, r15662, MPFR_RNDN);
        return mpfr_get_d(r15663, MPFR_RNDN);
}

static mpfr_t r15664, r15665, r15666, r15667, r15668, r15669, r15670;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15664);
        mpfr_init(r15665);
        mpfr_init(r15666);
        mpfr_init(r15667);
        mpfr_init(r15668);
        mpfr_init(r15669);
        mpfr_init(r15670);
}

double f_dm(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15664, d, MPFR_RNDN);
        mpfr_log(r15665, r15664, MPFR_RNDN);
        mpfr_set_d(r15666, c, MPFR_RNDN);
        mpfr_abs(r15667, r15666, MPFR_RNDN);
        mpfr_add(r15668, r15665, r15667, MPFR_RNDN);
        mpfr_tan(r15669, r15664, MPFR_RNDN);
        mpfr_mul(r15670, r15668, r15669, MPFR_RNDN);
        return mpfr_get_d(r15670, MPFR_RNDN);
}

