#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 r15558 = d;
        float r15559 = log(r15558);
        float r15560 = c;
        float r15561 = fabs(r15560);
        float r15562 = r15559 + r15561;
        float r15563 = tan(r15558);
        float r15564 = r15562 * r15563;
        return r15564;
}

double f_id(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        double r15565 = d;
        double r15566 = log(r15565);
        double r15567 = c;
        double r15568 = fabs(r15567);
        double r15569 = r15566 + r15568;
        double r15570 = tan(r15565);
        double r15571 = r15569 * r15570;
        return r15571;
}


double f_of(float __attribute__((unused)) a, float __attribute__((unused)) b, float c, float d) {
        float r15572 = d;
        float r15573 = log(r15572);
        float r15574 = c;
        float r15575 = fabs(r15574);
        float r15576 = r15573 + r15575;
        float r15577 = tan(r15572);
        float r15578 = r15576 * r15577;
        return r15578;
}

double f_od(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        double r15579 = d;
        double r15580 = log(r15579);
        double r15581 = c;
        double r15582 = fabs(r15581);
        double r15583 = r15580 + r15582;
        double r15584 = tan(r15579);
        double r15585 = r15583 * r15584;
        return r15585;
}

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 r15586, r15587, r15588, r15589, r15590, r15591, r15592;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15586);
        mpfr_init(r15587);
        mpfr_init(r15588);
        mpfr_init(r15589);
        mpfr_init(r15590);
        mpfr_init(r15591);
        mpfr_init(r15592);
}

double f_im(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15586, d, MPFR_RNDN);
        mpfr_log(r15587, r15586, MPFR_RNDN);
        mpfr_set_d(r15588, c, MPFR_RNDN);
        mpfr_abs(r15589, r15588, MPFR_RNDN);
        mpfr_add(r15590, r15587, r15589, MPFR_RNDN);
        mpfr_tan(r15591, r15586, MPFR_RNDN);
        mpfr_mul(r15592, r15590, r15591, MPFR_RNDN);
        return mpfr_get_d(r15592, MPFR_RNDN);
}

static mpfr_t r15593, r15594, r15595, r15596, r15597, r15598, r15599;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15593);
        mpfr_init(r15594);
        mpfr_init(r15595);
        mpfr_init(r15596);
        mpfr_init(r15597);
        mpfr_init(r15598);
        mpfr_init(r15599);
}

double f_fm(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15593, d, MPFR_RNDN);
        mpfr_log(r15594, r15593, MPFR_RNDN);
        mpfr_set_d(r15595, c, MPFR_RNDN);
        mpfr_abs(r15596, r15595, MPFR_RNDN);
        mpfr_add(r15597, r15594, r15596, MPFR_RNDN);
        mpfr_tan(r15598, r15593, MPFR_RNDN);
        mpfr_mul(r15599, r15597, r15598, MPFR_RNDN);
        return mpfr_get_d(r15599, MPFR_RNDN);
}

static mpfr_t r15600, r15601, r15602, r15603, r15604, r15605, r15606;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15600);
        mpfr_init(r15601);
        mpfr_init(r15602);
        mpfr_init(r15603);
        mpfr_init(r15604);
        mpfr_init(r15605);
        mpfr_init(r15606);
}

double f_dm(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15600, d, MPFR_RNDN);
        mpfr_log(r15601, r15600, MPFR_RNDN);
        mpfr_set_d(r15602, c, MPFR_RNDN);
        mpfr_abs(r15603, r15602, MPFR_RNDN);
        mpfr_add(r15604, r15601, r15603, MPFR_RNDN);
        mpfr_tan(r15605, r15600, MPFR_RNDN);
        mpfr_mul(r15606, r15604, r15605, MPFR_RNDN);
        return mpfr_get_d(r15606, MPFR_RNDN);
}

