#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 r15663 = d;
        float r15664 = log(r15663);
        float r15665 = c;
        float r15666 = fabs(r15665);
        float r15667 = r15664 + r15666;
        float r15668 = tan(r15663);
        float r15669 = r15667 * r15668;
        return r15669;
}

double f_id(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        double r15670 = d;
        double r15671 = log(r15670);
        double r15672 = c;
        double r15673 = fabs(r15672);
        double r15674 = r15671 + r15673;
        double r15675 = tan(r15670);
        double r15676 = r15674 * r15675;
        return r15676;
}


double f_of(float __attribute__((unused)) a, float __attribute__((unused)) b, float c, float d) {
        float r15677 = d;
        float r15678 = log(r15677);
        float r15679 = c;
        float r15680 = fabs(r15679);
        float r15681 = r15678 + r15680;
        float r15682 = tan(r15677);
        float r15683 = r15681 * r15682;
        return r15683;
}

double f_od(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        double r15684 = d;
        double r15685 = log(r15684);
        double r15686 = c;
        double r15687 = fabs(r15686);
        double r15688 = r15685 + r15687;
        double r15689 = tan(r15684);
        double r15690 = r15688 * r15689;
        return r15690;
}

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 r15691, r15692, r15693, r15694, r15695, r15696, r15697;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15691);
        mpfr_init(r15692);
        mpfr_init(r15693);
        mpfr_init(r15694);
        mpfr_init(r15695);
        mpfr_init(r15696);
        mpfr_init(r15697);
}

double f_im(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15691, d, MPFR_RNDN);
        mpfr_log(r15692, r15691, MPFR_RNDN);
        mpfr_set_d(r15693, c, MPFR_RNDN);
        mpfr_abs(r15694, r15693, MPFR_RNDN);
        mpfr_add(r15695, r15692, r15694, MPFR_RNDN);
        mpfr_tan(r15696, r15691, MPFR_RNDN);
        mpfr_mul(r15697, r15695, r15696, MPFR_RNDN);
        return mpfr_get_d(r15697, MPFR_RNDN);
}

static mpfr_t r15698, r15699, r15700, r15701, r15702, r15703, r15704;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15698);
        mpfr_init(r15699);
        mpfr_init(r15700);
        mpfr_init(r15701);
        mpfr_init(r15702);
        mpfr_init(r15703);
        mpfr_init(r15704);
}

double f_fm(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15698, d, MPFR_RNDN);
        mpfr_log(r15699, r15698, MPFR_RNDN);
        mpfr_set_d(r15700, c, MPFR_RNDN);
        mpfr_abs(r15701, r15700, MPFR_RNDN);
        mpfr_add(r15702, r15699, r15701, MPFR_RNDN);
        mpfr_tan(r15703, r15698, MPFR_RNDN);
        mpfr_mul(r15704, r15702, r15703, MPFR_RNDN);
        return mpfr_get_d(r15704, MPFR_RNDN);
}

static mpfr_t r15705, r15706, r15707, r15708, r15709, r15710, r15711;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15705);
        mpfr_init(r15706);
        mpfr_init(r15707);
        mpfr_init(r15708);
        mpfr_init(r15709);
        mpfr_init(r15710);
        mpfr_init(r15711);
}

double f_dm(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15705, d, MPFR_RNDN);
        mpfr_log(r15706, r15705, MPFR_RNDN);
        mpfr_set_d(r15707, c, MPFR_RNDN);
        mpfr_abs(r15708, r15707, MPFR_RNDN);
        mpfr_add(r15709, r15706, r15708, MPFR_RNDN);
        mpfr_tan(r15710, r15705, MPFR_RNDN);
        mpfr_mul(r15711, r15709, r15710, MPFR_RNDN);
        return mpfr_get_d(r15711, MPFR_RNDN);
}

