#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 r15634 = d;
        float r15635 = log(r15634);
        float r15636 = c;
        float r15637 = fabs(r15636);
        float r15638 = r15635 + r15637;
        float r15639 = tan(r15634);
        float r15640 = r15638 * r15639;
        return r15640;
}

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


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

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

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 r15662, r15663, r15664, r15665, r15666, r15667, r15668;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15662);
        mpfr_init(r15663);
        mpfr_init(r15664);
        mpfr_init(r15665);
        mpfr_init(r15666);
        mpfr_init(r15667);
        mpfr_init(r15668);
}

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

static mpfr_t r15669, r15670, r15671, r15672, r15673, r15674, r15675;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15669);
        mpfr_init(r15670);
        mpfr_init(r15671);
        mpfr_init(r15672);
        mpfr_init(r15673);
        mpfr_init(r15674);
        mpfr_init(r15675);
}

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

static mpfr_t r15676, r15677, r15678, r15679, r15680, r15681, r15682;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15676);
        mpfr_init(r15677);
        mpfr_init(r15678);
        mpfr_init(r15679);
        mpfr_init(r15680);
        mpfr_init(r15681);
        mpfr_init(r15682);
}

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

