#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 r15675 = d;
        float r15676 = log(r15675);
        float r15677 = c;
        float r15678 = fabs(r15677);
        float r15679 = r15676 + r15678;
        float r15680 = tan(r15675);
        float r15681 = r15679 * r15680;
        return r15681;
}

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


double f_of(float __attribute__((unused)) a, float __attribute__((unused)) b, float c, float d) {
        float r15689 = d;
        float r15690 = log(r15689);
        float r15691 = c;
        float r15692 = fabs(r15691);
        float r15693 = r15690 + r15692;
        float r15694 = tan(r15689);
        float r15695 = r15693 * r15694;
        return r15695;
}

double f_od(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        double r15696 = d;
        double r15697 = log(r15696);
        double r15698 = c;
        double r15699 = fabs(r15698);
        double r15700 = r15697 + r15699;
        double r15701 = tan(r15696);
        double r15702 = r15700 * r15701;
        return r15702;
}

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 r15703, r15704, r15705, r15706, r15707, r15708, r15709;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15703);
        mpfr_init(r15704);
        mpfr_init(r15705);
        mpfr_init(r15706);
        mpfr_init(r15707);
        mpfr_init(r15708);
        mpfr_init(r15709);
}

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

static mpfr_t r15710, r15711, r15712, r15713, r15714, r15715, r15716;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15710);
        mpfr_init(r15711);
        mpfr_init(r15712);
        mpfr_init(r15713);
        mpfr_init(r15714);
        mpfr_init(r15715);
        mpfr_init(r15716);
}

double f_fm(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15710, d, MPFR_RNDN);
        mpfr_log(r15711, r15710, MPFR_RNDN);
        mpfr_set_d(r15712, c, MPFR_RNDN);
        mpfr_abs(r15713, r15712, MPFR_RNDN);
        mpfr_add(r15714, r15711, r15713, MPFR_RNDN);
        mpfr_tan(r15715, r15710, MPFR_RNDN);
        mpfr_mul(r15716, r15714, r15715, MPFR_RNDN);
        return mpfr_get_d(r15716, MPFR_RNDN);
}

static mpfr_t r15717, r15718, r15719, r15720, r15721, r15722, r15723;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15717);
        mpfr_init(r15718);
        mpfr_init(r15719);
        mpfr_init(r15720);
        mpfr_init(r15721);
        mpfr_init(r15722);
        mpfr_init(r15723);
}

double f_dm(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15717, d, MPFR_RNDN);
        mpfr_log(r15718, r15717, MPFR_RNDN);
        mpfr_set_d(r15719, c, MPFR_RNDN);
        mpfr_abs(r15720, r15719, MPFR_RNDN);
        mpfr_add(r15721, r15718, r15720, MPFR_RNDN);
        mpfr_tan(r15722, r15717, MPFR_RNDN);
        mpfr_mul(r15723, r15721, r15722, MPFR_RNDN);
        return mpfr_get_d(r15723, MPFR_RNDN);
}

