#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 r15615 = d;
        float r15616 = log(r15615);
        float r15617 = c;
        float r15618 = fabs(r15617);
        float r15619 = r15616 + r15618;
        float r15620 = tan(r15615);
        float r15621 = r15619 * r15620;
        return r15621;
}

double f_id(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        double r15622 = d;
        double r15623 = log(r15622);
        double r15624 = c;
        double r15625 = fabs(r15624);
        double r15626 = r15623 + r15625;
        double r15627 = tan(r15622);
        double r15628 = r15626 * r15627;
        return r15628;
}


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

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

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 r15643, r15644, r15645, r15646, r15647, r15648, r15649;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15643);
        mpfr_init(r15644);
        mpfr_init(r15645);
        mpfr_init(r15646);
        mpfr_init(r15647);
        mpfr_init(r15648);
        mpfr_init(r15649);
}

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

static mpfr_t r15650, r15651, r15652, r15653, r15654, r15655, r15656;

void setup_mpfr_f_fm() {
        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_fm(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_dm() {
        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_dm(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);
}

