#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 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_id(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;
}


double f_of(float __attribute__((unused)) a, float __attribute__((unused)) b, float c, float d) {
        float r15650 = d;
        float r15651 = log(r15650);
        float r15652 = c;
        float r15653 = fabs(r15652);
        float r15654 = r15651 + r15653;
        float r15655 = tan(r15650);
        float r15656 = r15654 * r15655;
        return r15656;
}

double f_od(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        double r15657 = d;
        double r15658 = log(r15657);
        double r15659 = c;
        double r15660 = fabs(r15659);
        double r15661 = r15658 + r15660;
        double r15662 = tan(r15657);
        double r15663 = r15661 * r15662;
        return r15663;
}

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 r15664, r15665, r15666, r15667, r15668, r15669, r15670;

void setup_mpfr_f_im() {
        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_im(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);
}

static mpfr_t r15671, r15672, r15673, r15674, r15675, r15676, r15677;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15671);
        mpfr_init(r15672);
        mpfr_init(r15673);
        mpfr_init(r15674);
        mpfr_init(r15675);
        mpfr_init(r15676);
        mpfr_init(r15677);
}

double f_fm(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15671, d, MPFR_RNDN);
        mpfr_log(r15672, r15671, MPFR_RNDN);
        mpfr_set_d(r15673, c, MPFR_RNDN);
        mpfr_abs(r15674, r15673, MPFR_RNDN);
        mpfr_add(r15675, r15672, r15674, MPFR_RNDN);
        mpfr_tan(r15676, r15671, MPFR_RNDN);
        mpfr_mul(r15677, r15675, r15676, MPFR_RNDN);
        return mpfr_get_d(r15677, MPFR_RNDN);
}

static mpfr_t r15678, r15679, r15680, r15681, r15682, r15683, r15684;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15678);
        mpfr_init(r15679);
        mpfr_init(r15680);
        mpfr_init(r15681);
        mpfr_init(r15682);
        mpfr_init(r15683);
        mpfr_init(r15684);
}

double f_dm(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15678, d, MPFR_RNDN);
        mpfr_log(r15679, r15678, MPFR_RNDN);
        mpfr_set_d(r15680, c, MPFR_RNDN);
        mpfr_abs(r15681, r15680, MPFR_RNDN);
        mpfr_add(r15682, r15679, r15681, MPFR_RNDN);
        mpfr_tan(r15683, r15678, MPFR_RNDN);
        mpfr_mul(r15684, r15682, r15683, MPFR_RNDN);
        return mpfr_get_d(r15684, MPFR_RNDN);
}

