#include <tgmath.h>
#include <gmp.h>
#include <mpfr.h>
#include <stdio.h>
#include <stdbool.h>

char *name = "(- (hypot (sqrt (atan a)) b) (* c a))";

double f_if(float a, float b, float c, float __attribute__((unused)) d) {
        float r15350 = a;
        float r15351 = atan(r15350);
        float r15352 = sqrt(r15351);
        float r15353 = b;
        float r15354 = hypot(r15352, r15353);
        float r15355 = c;
        float r15356 = r15355 * r15350;
        float r15357 = r15354 - r15356;
        return r15357;
}

double f_id(double a, double b, double c, double __attribute__((unused)) d) {
        double r15358 = a;
        double r15359 = atan(r15358);
        double r15360 = sqrt(r15359);
        double r15361 = b;
        double r15362 = hypot(r15360, r15361);
        double r15363 = c;
        double r15364 = r15363 * r15358;
        double r15365 = r15362 - r15364;
        return r15365;
}


double f_of(float a, float b, float c, float __attribute__((unused)) d) {
        float r15366 = a;
        float r15367 = atan(r15366);
        float r15368 = sqrt(r15367);
        float r15369 = sqrt(r15368);
        float r15370 = r15369 * r15369;
        float r15371 = b;
        float r15372 = hypot(r15370, r15371);
        float r15373 = c;
        float r15374 = r15373 * r15366;
        float r15375 = r15372 - r15374;
        return r15375;
}

double f_od(double a, double b, double c, double __attribute__((unused)) d) {
        double r15376 = a;
        double r15377 = atan(r15376);
        double r15378 = sqrt(r15377);
        double r15379 = sqrt(r15378);
        double r15380 = r15379 * r15379;
        double r15381 = b;
        double r15382 = hypot(r15380, r15381);
        double r15383 = c;
        double r15384 = r15383 * r15376;
        double r15385 = r15382 - r15384;
        return r15385;
}

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 r15386, r15387, r15388, r15389, r15390, r15391, r15392, r15393;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15386);
        mpfr_init(r15387);
        mpfr_init(r15388);
        mpfr_init(r15389);
        mpfr_init(r15390);
        mpfr_init(r15391);
        mpfr_init(r15392);
        mpfr_init(r15393);
}

double f_im(double a, double b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15386, a, MPFR_RNDN);
        mpfr_atan(r15387, r15386, MPFR_RNDN);
        mpfr_sqrt(r15388, r15387, MPFR_RNDN);
        mpfr_set_d(r15389, b, MPFR_RNDN);
        mpfr_hypot(r15390, r15388, r15389, MPFR_RNDN);
        mpfr_set_d(r15391, c, MPFR_RNDN);
        mpfr_mul(r15392, r15391, r15386, MPFR_RNDN);
        mpfr_sub(r15393, r15390, r15392, MPFR_RNDN);
        return mpfr_get_d(r15393, MPFR_RNDN);
}

static mpfr_t r15394, r15395, r15396, r15397, r15398, r15399, r15400, r15401, r15402, r15403;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15394);
        mpfr_init(r15395);
        mpfr_init(r15396);
        mpfr_init(r15397);
        mpfr_init(r15398);
        mpfr_init(r15399);
        mpfr_init(r15400);
        mpfr_init(r15401);
        mpfr_init(r15402);
        mpfr_init(r15403);
}

double f_fm(double a, double b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15394, a, MPFR_RNDN);
        mpfr_atan(r15395, r15394, MPFR_RNDN);
        mpfr_sqrt(r15396, r15395, MPFR_RNDN);
        mpfr_sqrt(r15397, r15396, MPFR_RNDN);
        mpfr_sqr(r15398, r15397, MPFR_RNDN);
        mpfr_set_d(r15399, b, MPFR_RNDN);
        mpfr_hypot(r15400, r15398, r15399, MPFR_RNDN);
        mpfr_set_d(r15401, c, MPFR_RNDN);
        mpfr_mul(r15402, r15401, r15394, MPFR_RNDN);
        mpfr_sub(r15403, r15400, r15402, MPFR_RNDN);
        return mpfr_get_d(r15403, MPFR_RNDN);
}

static mpfr_t r15404, r15405, r15406, r15407, r15408, r15409, r15410, r15411, r15412, r15413;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15404);
        mpfr_init(r15405);
        mpfr_init(r15406);
        mpfr_init(r15407);
        mpfr_init(r15408);
        mpfr_init(r15409);
        mpfr_init(r15410);
        mpfr_init(r15411);
        mpfr_init(r15412);
        mpfr_init(r15413);
}

double f_dm(double a, double b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15404, a, MPFR_RNDN);
        mpfr_atan(r15405, r15404, MPFR_RNDN);
        mpfr_sqrt(r15406, r15405, MPFR_RNDN);
        mpfr_sqrt(r15407, r15406, MPFR_RNDN);
        mpfr_sqr(r15408, r15407, MPFR_RNDN);
        mpfr_set_d(r15409, b, MPFR_RNDN);
        mpfr_hypot(r15410, r15408, r15409, MPFR_RNDN);
        mpfr_set_d(r15411, c, MPFR_RNDN);
        mpfr_mul(r15412, r15411, r15404, MPFR_RNDN);
        mpfr_sub(r15413, r15410, r15412, MPFR_RNDN);
        return mpfr_get_d(r15413, MPFR_RNDN);
}

