#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 r15330 = a;
        float r15331 = atan(r15330);
        float r15332 = sqrt(r15331);
        float r15333 = b;
        float r15334 = hypot(r15332, r15333);
        float r15335 = c;
        float r15336 = r15335 * r15330;
        float r15337 = r15334 - r15336;
        return r15337;
}

double f_id(double a, double b, double c, double __attribute__((unused)) d) {
        double r15338 = a;
        double r15339 = atan(r15338);
        double r15340 = sqrt(r15339);
        double r15341 = b;
        double r15342 = hypot(r15340, r15341);
        double r15343 = c;
        double r15344 = r15343 * r15338;
        double r15345 = r15342 - r15344;
        return r15345;
}


double f_of(float a, float b, float c, float __attribute__((unused)) d) {
        float r15346 = a;
        float r15347 = atan(r15346);
        float r15348 = sqrt(r15347);
        float r15349 = sqrt(r15348);
        float r15350 = r15349 * r15349;
        float r15351 = b;
        float r15352 = hypot(r15350, r15351);
        float r15353 = c;
        float r15354 = r15353 * r15346;
        float r15355 = r15352 - r15354;
        return r15355;
}

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

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 r15366, r15367, r15368, r15369, r15370, r15371, r15372, r15373;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15366);
        mpfr_init(r15367);
        mpfr_init(r15368);
        mpfr_init(r15369);
        mpfr_init(r15370);
        mpfr_init(r15371);
        mpfr_init(r15372);
        mpfr_init(r15373);
}

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

static mpfr_t r15374, r15375, r15376, r15377, r15378, r15379, r15380, r15381, r15382, r15383;

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

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

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

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15384);
        mpfr_init(r15385);
        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_dm(double a, double b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15384, a, MPFR_RNDN);
        mpfr_atan(r15385, r15384, MPFR_RNDN);
        mpfr_sqrt(r15386, r15385, MPFR_RNDN);
        mpfr_sqrt(r15387, r15386, MPFR_RNDN);
        mpfr_sqr(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, r15384, MPFR_RNDN);
        mpfr_sub(r15393, r15390, r15392, MPFR_RNDN);
        return mpfr_get_d(r15393, MPFR_RNDN);
}

