#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 r15562 = d;
        float r15563 = log(r15562);
        float r15564 = c;
        float r15565 = fabs(r15564);
        float r15566 = r15563 + r15565;
        float r15567 = tan(r15562);
        float r15568 = r15566 * r15567;
        return r15568;
}

double f_id(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        double r15569 = d;
        double r15570 = log(r15569);
        double r15571 = c;
        double r15572 = fabs(r15571);
        double r15573 = r15570 + r15572;
        double r15574 = tan(r15569);
        double r15575 = r15573 * r15574;
        return r15575;
}


double f_of(float __attribute__((unused)) a, float __attribute__((unused)) b, float c, float d) {
        float r15576 = d;
        float r15577 = log(r15576);
        float r15578 = c;
        float r15579 = fabs(r15578);
        float r15580 = r15577 + r15579;
        float r15581 = tan(r15576);
        float r15582 = r15580 * r15581;
        return r15582;
}

double f_od(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        double r15583 = d;
        double r15584 = log(r15583);
        double r15585 = c;
        double r15586 = fabs(r15585);
        double r15587 = r15584 + r15586;
        double r15588 = tan(r15583);
        double r15589 = r15587 * r15588;
        return r15589;
}

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 r15590, r15591, r15592, r15593, r15594, r15595, r15596;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15590);
        mpfr_init(r15591);
        mpfr_init(r15592);
        mpfr_init(r15593);
        mpfr_init(r15594);
        mpfr_init(r15595);
        mpfr_init(r15596);
}

double f_im(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15590, d, MPFR_RNDN);
        mpfr_log(r15591, r15590, MPFR_RNDN);
        mpfr_set_d(r15592, c, MPFR_RNDN);
        mpfr_abs(r15593, r15592, MPFR_RNDN);
        mpfr_add(r15594, r15591, r15593, MPFR_RNDN);
        mpfr_tan(r15595, r15590, MPFR_RNDN);
        mpfr_mul(r15596, r15594, r15595, MPFR_RNDN);
        return mpfr_get_d(r15596, MPFR_RNDN);
}

static mpfr_t r15597, r15598, r15599, r15600, r15601, r15602, r15603;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15597);
        mpfr_init(r15598);
        mpfr_init(r15599);
        mpfr_init(r15600);
        mpfr_init(r15601);
        mpfr_init(r15602);
        mpfr_init(r15603);
}

double f_fm(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15597, d, MPFR_RNDN);
        mpfr_log(r15598, r15597, MPFR_RNDN);
        mpfr_set_d(r15599, c, MPFR_RNDN);
        mpfr_abs(r15600, r15599, MPFR_RNDN);
        mpfr_add(r15601, r15598, r15600, MPFR_RNDN);
        mpfr_tan(r15602, r15597, MPFR_RNDN);
        mpfr_mul(r15603, r15601, r15602, MPFR_RNDN);
        return mpfr_get_d(r15603, MPFR_RNDN);
}

static mpfr_t r15604, r15605, r15606, r15607, r15608, r15609, r15610;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15604);
        mpfr_init(r15605);
        mpfr_init(r15606);
        mpfr_init(r15607);
        mpfr_init(r15608);
        mpfr_init(r15609);
        mpfr_init(r15610);
}

double f_dm(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15604, d, MPFR_RNDN);
        mpfr_log(r15605, r15604, MPFR_RNDN);
        mpfr_set_d(r15606, c, MPFR_RNDN);
        mpfr_abs(r15607, r15606, MPFR_RNDN);
        mpfr_add(r15608, r15605, r15607, MPFR_RNDN);
        mpfr_tan(r15609, r15604, MPFR_RNDN);
        mpfr_mul(r15610, r15608, r15609, MPFR_RNDN);
        return mpfr_get_d(r15610, MPFR_RNDN);
}

