#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 r15570 = d;
        float r15571 = log(r15570);
        float r15572 = c;
        float r15573 = fabs(r15572);
        float r15574 = r15571 + r15573;
        float r15575 = tan(r15570);
        float r15576 = r15574 * r15575;
        return r15576;
}

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


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

double f_od(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        double r15591 = d;
        double r15592 = log(r15591);
        double r15593 = c;
        double r15594 = fabs(r15593);
        double r15595 = r15592 + r15594;
        double r15596 = tan(r15591);
        double r15597 = r15595 * r15596;
        return r15597;
}

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 r15598, r15599, r15600, r15601, r15602, r15603, r15604;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15598);
        mpfr_init(r15599);
        mpfr_init(r15600);
        mpfr_init(r15601);
        mpfr_init(r15602);
        mpfr_init(r15603);
        mpfr_init(r15604);
}

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

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

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15605);
        mpfr_init(r15606);
        mpfr_init(r15607);
        mpfr_init(r15608);
        mpfr_init(r15609);
        mpfr_init(r15610);
        mpfr_init(r15611);
}

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

static mpfr_t r15612, r15613, r15614, r15615, r15616, r15617, r15618;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15612);
        mpfr_init(r15613);
        mpfr_init(r15614);
        mpfr_init(r15615);
        mpfr_init(r15616);
        mpfr_init(r15617);
        mpfr_init(r15618);
}

double f_dm(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15612, d, MPFR_RNDN);
        mpfr_log(r15613, r15612, MPFR_RNDN);
        mpfr_set_d(r15614, c, MPFR_RNDN);
        mpfr_abs(r15615, r15614, MPFR_RNDN);
        mpfr_add(r15616, r15613, r15615, MPFR_RNDN);
        mpfr_tan(r15617, r15612, MPFR_RNDN);
        mpfr_mul(r15618, r15616, r15617, MPFR_RNDN);
        return mpfr_get_d(r15618, MPFR_RNDN);
}

