#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 r15346 = a;
        float r15347 = atan(r15346);
        float r15348 = sqrt(r15347);
        float r15349 = b;
        float r15350 = hypot(r15348, r15349);
        float r15351 = c;
        float r15352 = r15351 * r15346;
        float r15353 = r15350 - r15352;
        return r15353;
}

double f_id(double a, double b, double c, double __attribute__((unused)) d) {
        double r15354 = a;
        double r15355 = atan(r15354);
        double r15356 = sqrt(r15355);
        double r15357 = b;
        double r15358 = hypot(r15356, r15357);
        double r15359 = c;
        double r15360 = r15359 * r15354;
        double r15361 = r15358 - r15360;
        return r15361;
}


double f_of(float a, float b, float c, float __attribute__((unused)) d) {
        float r15362 = a;
        float r15363 = atan(r15362);
        float r15364 = sqrt(r15363);
        float r15365 = sqrt(r15364);
        float r15366 = r15365 * r15365;
        float r15367 = b;
        float r15368 = hypot(r15366, r15367);
        float r15369 = c;
        float r15370 = r15369 * r15362;
        float r15371 = r15368 - r15370;
        return r15371;
}

double f_od(double a, double b, double c, double __attribute__((unused)) d) {
        double r15372 = a;
        double r15373 = atan(r15372);
        double r15374 = sqrt(r15373);
        double r15375 = sqrt(r15374);
        double r15376 = r15375 * r15375;
        double r15377 = b;
        double r15378 = hypot(r15376, r15377);
        double r15379 = c;
        double r15380 = r15379 * r15372;
        double r15381 = r15378 - r15380;
        return r15381;
}

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 r15382, r15383, r15384, r15385, r15386, r15387, r15388, r15389;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15382);
        mpfr_init(r15383);
        mpfr_init(r15384);
        mpfr_init(r15385);
        mpfr_init(r15386);
        mpfr_init(r15387);
        mpfr_init(r15388);
        mpfr_init(r15389);
}

double f_im(double a, double b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15382, a, MPFR_RNDN);
        mpfr_atan(r15383, r15382, MPFR_RNDN);
        mpfr_sqrt(r15384, r15383, MPFR_RNDN);
        mpfr_set_d(r15385, b, MPFR_RNDN);
        mpfr_hypot(r15386, r15384, r15385, MPFR_RNDN);
        mpfr_set_d(r15387, c, MPFR_RNDN);
        mpfr_mul(r15388, r15387, r15382, MPFR_RNDN);
        mpfr_sub(r15389, r15386, r15388, MPFR_RNDN);
        return mpfr_get_d(r15389, MPFR_RNDN);
}

static mpfr_t r15390, r15391, r15392, r15393, r15394, r15395, r15396, r15397, r15398, r15399;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15390);
        mpfr_init(r15391);
        mpfr_init(r15392);
        mpfr_init(r15393);
        mpfr_init(r15394);
        mpfr_init(r15395);
        mpfr_init(r15396);
        mpfr_init(r15397);
        mpfr_init(r15398);
        mpfr_init(r15399);
}

double f_fm(double a, double b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15390, a, MPFR_RNDN);
        mpfr_atan(r15391, r15390, MPFR_RNDN);
        mpfr_sqrt(r15392, r15391, MPFR_RNDN);
        mpfr_sqrt(r15393, r15392, MPFR_RNDN);
        mpfr_sqr(r15394, r15393, MPFR_RNDN);
        mpfr_set_d(r15395, b, MPFR_RNDN);
        mpfr_hypot(r15396, r15394, r15395, MPFR_RNDN);
        mpfr_set_d(r15397, c, MPFR_RNDN);
        mpfr_mul(r15398, r15397, r15390, MPFR_RNDN);
        mpfr_sub(r15399, r15396, r15398, MPFR_RNDN);
        return mpfr_get_d(r15399, MPFR_RNDN);
}

static mpfr_t r15400, r15401, r15402, r15403, r15404, r15405, r15406, r15407, r15408, r15409;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15400);
        mpfr_init(r15401);
        mpfr_init(r15402);
        mpfr_init(r15403);
        mpfr_init(r15404);
        mpfr_init(r15405);
        mpfr_init(r15406);
        mpfr_init(r15407);
        mpfr_init(r15408);
        mpfr_init(r15409);
}

double f_dm(double a, double b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15400, a, MPFR_RNDN);
        mpfr_atan(r15401, r15400, MPFR_RNDN);
        mpfr_sqrt(r15402, r15401, MPFR_RNDN);
        mpfr_sqrt(r15403, r15402, MPFR_RNDN);
        mpfr_sqr(r15404, r15403, MPFR_RNDN);
        mpfr_set_d(r15405, b, MPFR_RNDN);
        mpfr_hypot(r15406, r15404, r15405, MPFR_RNDN);
        mpfr_set_d(r15407, c, MPFR_RNDN);
        mpfr_mul(r15408, r15407, r15400, MPFR_RNDN);
        mpfr_sub(r15409, r15406, r15408, MPFR_RNDN);
        return mpfr_get_d(r15409, MPFR_RNDN);
}

