#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 r15337 = a;
        float r15338 = atan(r15337);
        float r15339 = sqrt(r15338);
        float r15340 = b;
        float r15341 = hypot(r15339, r15340);
        float r15342 = c;
        float r15343 = r15342 * r15337;
        float r15344 = r15341 - r15343;
        return r15344;
}

double f_id(double a, double b, double c, double __attribute__((unused)) d) {
        double r15345 = a;
        double r15346 = atan(r15345);
        double r15347 = sqrt(r15346);
        double r15348 = b;
        double r15349 = hypot(r15347, r15348);
        double r15350 = c;
        double r15351 = r15350 * r15345;
        double r15352 = r15349 - r15351;
        return r15352;
}


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

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

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 r15369, r15370, r15371, r15372, r15373, r15374, r15375, r15376;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15369);
        mpfr_init(r15370);
        mpfr_init(r15371);
        mpfr_init(r15372);
        mpfr_init(r15373);
        mpfr_init(r15374);
        mpfr_init(r15375);
        mpfr_init(r15376);
}

double f_im(double a, double b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15369, a, MPFR_RNDN);
        mpfr_atan(r15370, r15369, MPFR_RNDN);
        mpfr_sqrt(r15371, r15370, MPFR_RNDN);
        mpfr_set_d(r15372, b, MPFR_RNDN);
        mpfr_hypot(r15373, r15371, r15372, MPFR_RNDN);
        mpfr_set_d(r15374, c, MPFR_RNDN);
        mpfr_mul(r15375, r15374, r15369, MPFR_RNDN);
        mpfr_sub(r15376, r15373, r15375, MPFR_RNDN);
        return mpfr_get_d(r15376, MPFR_RNDN);
}

static mpfr_t r15377, r15378, r15379, r15380, r15381, r15382, r15383, r15384;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15377);
        mpfr_init(r15378);
        mpfr_init(r15379);
        mpfr_init(r15380);
        mpfr_init(r15381);
        mpfr_init(r15382);
        mpfr_init(r15383);
        mpfr_init(r15384);
}

double f_fm(double a, double b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15377, a, MPFR_RNDN);
        mpfr_atan(r15378, r15377, MPFR_RNDN);
        mpfr_sqrt(r15379, r15378, MPFR_RNDN);
        mpfr_set_d(r15380, b, MPFR_RNDN);
        mpfr_hypot(r15381, r15379, r15380, MPFR_RNDN);
        mpfr_set_d(r15382, c, MPFR_RNDN);
        mpfr_mul(r15383, r15382, r15377, MPFR_RNDN);
        mpfr_sub(r15384, r15381, r15383, MPFR_RNDN);
        return mpfr_get_d(r15384, MPFR_RNDN);
}

static mpfr_t r15385, r15386, r15387, r15388, r15389, r15390, r15391, r15392;

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

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

