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

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


double f_of(float a, float b, float c, float __attribute__((unused)) d) {
        float r15359 = a;
        float r15360 = atan(r15359);
        float r15361 = sqrt(r15360);
        float r15362 = b;
        float r15363 = hypot(r15361, r15362);
        float r15364 = c;
        float r15365 = r15364 * r15359;
        float r15366 = r15363 - r15365;
        return r15366;
}

double f_od(double a, double b, double c, double __attribute__((unused)) d) {
        double r15367 = a;
        double r15368 = atan(r15367);
        double r15369 = sqrt(r15368);
        double r15370 = b;
        double r15371 = hypot(r15369, r15370);
        double r15372 = c;
        double r15373 = r15372 * r15367;
        double r15374 = r15371 - r15373;
        return r15374;
}

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 r15375, r15376, r15377, r15378, r15379, r15380, r15381, r15382;

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

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

static mpfr_t r15383, r15384, r15385, r15386, r15387, r15388, r15389, r15390;

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

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

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

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

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

