#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 r15354 = a;
        float r15355 = atan(r15354);
        float r15356 = sqrt(r15355);
        float r15357 = b;
        float r15358 = hypot(r15356, r15357);
        float r15359 = c;
        float r15360 = r15359 * r15354;
        float r15361 = r15358 - r15360;
        return r15361;
}

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


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

double f_od(double a, double b, double c, double __attribute__((unused)) d) {
        double r15380 = a;
        double r15381 = atan(r15380);
        double r15382 = sqrt(r15381);
        double r15383 = sqrt(r15382);
        double r15384 = r15383 * r15383;
        double r15385 = b;
        double r15386 = hypot(r15384, r15385);
        double r15387 = c;
        double r15388 = r15387 * r15380;
        double r15389 = r15386 - r15388;
        return r15389;
}

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 r15390, r15391, r15392, r15393, r15394, r15395, r15396, r15397;

void setup_mpfr_f_im() {
        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);
}

double f_im(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_set_d(r15393, b, MPFR_RNDN);
        mpfr_hypot(r15394, r15392, r15393, MPFR_RNDN);
        mpfr_set_d(r15395, c, MPFR_RNDN);
        mpfr_mul(r15396, r15395, r15390, MPFR_RNDN);
        mpfr_sub(r15397, r15394, r15396, MPFR_RNDN);
        return mpfr_get_d(r15397, MPFR_RNDN);
}

static mpfr_t r15398, r15399, r15400, r15401, r15402, r15403, r15404, r15405, r15406, r15407;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15398);
        mpfr_init(r15399);
        mpfr_init(r15400);
        mpfr_init(r15401);
        mpfr_init(r15402);
        mpfr_init(r15403);
        mpfr_init(r15404);
        mpfr_init(r15405);
        mpfr_init(r15406);
        mpfr_init(r15407);
}

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

static mpfr_t r15408, r15409, r15410, r15411, r15412, r15413, r15414, r15415, r15416, r15417;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15408);
        mpfr_init(r15409);
        mpfr_init(r15410);
        mpfr_init(r15411);
        mpfr_init(r15412);
        mpfr_init(r15413);
        mpfr_init(r15414);
        mpfr_init(r15415);
        mpfr_init(r15416);
        mpfr_init(r15417);
}

double f_dm(double a, double b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15408, a, MPFR_RNDN);
        mpfr_atan(r15409, r15408, MPFR_RNDN);
        mpfr_sqrt(r15410, r15409, MPFR_RNDN);
        mpfr_sqrt(r15411, r15410, MPFR_RNDN);
        mpfr_sqr(r15412, r15411, MPFR_RNDN);
        mpfr_set_d(r15413, b, MPFR_RNDN);
        mpfr_hypot(r15414, r15412, r15413, MPFR_RNDN);
        mpfr_set_d(r15415, c, MPFR_RNDN);
        mpfr_mul(r15416, r15415, r15408, MPFR_RNDN);
        mpfr_sub(r15417, r15414, r15416, MPFR_RNDN);
        return mpfr_get_d(r15417, MPFR_RNDN);
}

