#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 r15775 = d;
        float r15776 = log(r15775);
        float r15777 = c;
        float r15778 = fabs(r15777);
        float r15779 = r15776 + r15778;
        float r15780 = tan(r15775);
        float r15781 = r15779 * r15780;
        return r15781;
}

double f_id(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        double r15782 = d;
        double r15783 = log(r15782);
        double r15784 = c;
        double r15785 = fabs(r15784);
        double r15786 = r15783 + r15785;
        double r15787 = tan(r15782);
        double r15788 = r15786 * r15787;
        return r15788;
}


double f_of(float __attribute__((unused)) a, float __attribute__((unused)) b, float c, float d) {
        float r15789 = d;
        float r15790 = log(r15789);
        float r15791 = c;
        float r15792 = fabs(r15791);
        float r15793 = r15790 + r15792;
        float r15794 = tan(r15789);
        float r15795 = r15793 * r15794;
        return r15795;
}

double f_od(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        double r15796 = d;
        double r15797 = log(r15796);
        double r15798 = c;
        double r15799 = fabs(r15798);
        double r15800 = r15797 + r15799;
        double r15801 = tan(r15796);
        double r15802 = r15800 * r15801;
        return r15802;
}

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 r15803, r15804, r15805, r15806, r15807, r15808, r15809;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15803);
        mpfr_init(r15804);
        mpfr_init(r15805);
        mpfr_init(r15806);
        mpfr_init(r15807);
        mpfr_init(r15808);
        mpfr_init(r15809);
}

double f_im(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15803, d, MPFR_RNDN);
        mpfr_log(r15804, r15803, MPFR_RNDN);
        mpfr_set_d(r15805, c, MPFR_RNDN);
        mpfr_abs(r15806, r15805, MPFR_RNDN);
        mpfr_add(r15807, r15804, r15806, MPFR_RNDN);
        mpfr_tan(r15808, r15803, MPFR_RNDN);
        mpfr_mul(r15809, r15807, r15808, MPFR_RNDN);
        return mpfr_get_d(r15809, MPFR_RNDN);
}

static mpfr_t r15810, r15811, r15812, r15813, r15814, r15815, r15816;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15810);
        mpfr_init(r15811);
        mpfr_init(r15812);
        mpfr_init(r15813);
        mpfr_init(r15814);
        mpfr_init(r15815);
        mpfr_init(r15816);
}

double f_fm(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15810, d, MPFR_RNDN);
        mpfr_log(r15811, r15810, MPFR_RNDN);
        mpfr_set_d(r15812, c, MPFR_RNDN);
        mpfr_abs(r15813, r15812, MPFR_RNDN);
        mpfr_add(r15814, r15811, r15813, MPFR_RNDN);
        mpfr_tan(r15815, r15810, MPFR_RNDN);
        mpfr_mul(r15816, r15814, r15815, MPFR_RNDN);
        return mpfr_get_d(r15816, MPFR_RNDN);
}

static mpfr_t r15817, r15818, r15819, r15820, r15821, r15822, r15823;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15817);
        mpfr_init(r15818);
        mpfr_init(r15819);
        mpfr_init(r15820);
        mpfr_init(r15821);
        mpfr_init(r15822);
        mpfr_init(r15823);
}

double f_dm(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15817, d, MPFR_RNDN);
        mpfr_log(r15818, r15817, MPFR_RNDN);
        mpfr_set_d(r15819, c, MPFR_RNDN);
        mpfr_abs(r15820, r15819, MPFR_RNDN);
        mpfr_add(r15821, r15818, r15820, MPFR_RNDN);
        mpfr_tan(r15822, r15817, MPFR_RNDN);
        mpfr_mul(r15823, r15821, r15822, MPFR_RNDN);
        return mpfr_get_d(r15823, MPFR_RNDN);
}

