#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 r15319 = a;
        float r15320 = atan(r15319);
        float r15321 = sqrt(r15320);
        float r15322 = b;
        float r15323 = hypot(r15321, r15322);
        float r15324 = c;
        float r15325 = r15324 * r15319;
        float r15326 = r15323 - r15325;
        return r15326;
}

double f_id(double a, double b, double c, double __attribute__((unused)) d) {
        double r15327 = a;
        double r15328 = atan(r15327);
        double r15329 = sqrt(r15328);
        double r15330 = b;
        double r15331 = hypot(r15329, r15330);
        double r15332 = c;
        double r15333 = r15332 * r15327;
        double r15334 = r15331 - r15333;
        return r15334;
}


double f_of(float a, float b, float c, float __attribute__((unused)) d) {
        float r15335 = a;
        float r15336 = atan(r15335);
        float r15337 = sqrt(r15336);
        float r15338 = b;
        float r15339 = hypot(r15337, r15338);
        float r15340 = c;
        float r15341 = r15340 * r15335;
        float r15342 = r15339 - r15341;
        return r15342;
}

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

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 r15351, r15352, r15353, r15354, r15355, r15356, r15357, r15358;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15351);
        mpfr_init(r15352);
        mpfr_init(r15353);
        mpfr_init(r15354);
        mpfr_init(r15355);
        mpfr_init(r15356);
        mpfr_init(r15357);
        mpfr_init(r15358);
}

double f_im(double a, double b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15351, a, MPFR_RNDN);
        mpfr_atan(r15352, r15351, MPFR_RNDN);
        mpfr_sqrt(r15353, r15352, MPFR_RNDN);
        mpfr_set_d(r15354, b, MPFR_RNDN);
        mpfr_hypot(r15355, r15353, r15354, MPFR_RNDN);
        mpfr_set_d(r15356, c, MPFR_RNDN);
        mpfr_mul(r15357, r15356, r15351, MPFR_RNDN);
        mpfr_sub(r15358, r15355, r15357, MPFR_RNDN);
        return mpfr_get_d(r15358, MPFR_RNDN);
}

static mpfr_t r15359, r15360, r15361, r15362, r15363, r15364, r15365, r15366;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15359);
        mpfr_init(r15360);
        mpfr_init(r15361);
        mpfr_init(r15362);
        mpfr_init(r15363);
        mpfr_init(r15364);
        mpfr_init(r15365);
        mpfr_init(r15366);
}

double f_fm(double a, double b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15359, a, MPFR_RNDN);
        mpfr_atan(r15360, r15359, MPFR_RNDN);
        mpfr_sqrt(r15361, r15360, MPFR_RNDN);
        mpfr_set_d(r15362, b, MPFR_RNDN);
        mpfr_hypot(r15363, r15361, r15362, MPFR_RNDN);
        mpfr_set_d(r15364, c, MPFR_RNDN);
        mpfr_mul(r15365, r15364, r15359, MPFR_RNDN);
        mpfr_sub(r15366, r15363, r15365, MPFR_RNDN);
        return mpfr_get_d(r15366, MPFR_RNDN);
}

static mpfr_t r15367, r15368, r15369, r15370, r15371, r15372, r15373, r15374;

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

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

