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

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


double f_of(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_od(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;
}

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 r15346, r15347, r15348, r15349, r15350, r15351, r15352, r15353;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15346);
        mpfr_init(r15347);
        mpfr_init(r15348);
        mpfr_init(r15349);
        mpfr_init(r15350);
        mpfr_init(r15351);
        mpfr_init(r15352);
        mpfr_init(r15353);
}

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

static mpfr_t r15354, r15355, r15356, r15357, r15358, r15359, r15360, r15361;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15354);
        mpfr_init(r15355);
        mpfr_init(r15356);
        mpfr_init(r15357);
        mpfr_init(r15358);
        mpfr_init(r15359);
        mpfr_init(r15360);
        mpfr_init(r15361);
}

double f_fm(double a, double b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15354, a, MPFR_RNDN);
        mpfr_atan(r15355, r15354, MPFR_RNDN);
        mpfr_sqrt(r15356, r15355, MPFR_RNDN);
        mpfr_set_d(r15357, b, MPFR_RNDN);
        mpfr_hypot(r15358, r15356, r15357, MPFR_RNDN);
        mpfr_set_d(r15359, c, MPFR_RNDN);
        mpfr_mul(r15360, r15359, r15354, MPFR_RNDN);
        mpfr_sub(r15361, r15358, r15360, MPFR_RNDN);
        return mpfr_get_d(r15361, MPFR_RNDN);
}

static mpfr_t r15362, r15363, r15364, r15365, r15366, r15367, r15368, r15369;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15362);
        mpfr_init(r15363);
        mpfr_init(r15364);
        mpfr_init(r15365);
        mpfr_init(r15366);
        mpfr_init(r15367);
        mpfr_init(r15368);
        mpfr_init(r15369);
}

double f_dm(double a, double b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15362, a, MPFR_RNDN);
        mpfr_atan(r15363, r15362, MPFR_RNDN);
        mpfr_sqrt(r15364, r15363, MPFR_RNDN);
        mpfr_set_d(r15365, b, MPFR_RNDN);
        mpfr_hypot(r15366, r15364, r15365, MPFR_RNDN);
        mpfr_set_d(r15367, c, MPFR_RNDN);
        mpfr_mul(r15368, r15367, r15362, MPFR_RNDN);
        mpfr_sub(r15369, r15366, r15368, MPFR_RNDN);
        return mpfr_get_d(r15369, MPFR_RNDN);
}

