#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 r15311 = a;
        float r15312 = atan(r15311);
        float r15313 = sqrt(r15312);
        float r15314 = b;
        float r15315 = hypot(r15313, r15314);
        float r15316 = c;
        float r15317 = r15316 * r15311;
        float r15318 = r15315 - r15317;
        return r15318;
}

double f_id(double a, double b, double c, double __attribute__((unused)) d) {
        double r15319 = a;
        double r15320 = atan(r15319);
        double r15321 = sqrt(r15320);
        double r15322 = b;
        double r15323 = hypot(r15321, r15322);
        double r15324 = c;
        double r15325 = r15324 * r15319;
        double r15326 = r15323 - r15325;
        return r15326;
}


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

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

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 r15343, r15344, r15345, r15346, r15347, r15348, r15349, r15350;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15343);
        mpfr_init(r15344);
        mpfr_init(r15345);
        mpfr_init(r15346);
        mpfr_init(r15347);
        mpfr_init(r15348);
        mpfr_init(r15349);
        mpfr_init(r15350);
}

double f_im(double a, double b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15343, a, MPFR_RNDN);
        mpfr_atan(r15344, r15343, MPFR_RNDN);
        mpfr_sqrt(r15345, r15344, MPFR_RNDN);
        mpfr_set_d(r15346, b, MPFR_RNDN);
        mpfr_hypot(r15347, r15345, r15346, MPFR_RNDN);
        mpfr_set_d(r15348, c, MPFR_RNDN);
        mpfr_mul(r15349, r15348, r15343, MPFR_RNDN);
        mpfr_sub(r15350, r15347, r15349, MPFR_RNDN);
        return mpfr_get_d(r15350, MPFR_RNDN);
}

static mpfr_t r15351, r15352, r15353, r15354, r15355, r15356, r15357, r15358;

void setup_mpfr_f_fm() {
        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_fm(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_dm() {
        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_dm(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);
}

