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

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


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

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

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 r15354, r15355, r15356, r15357, r15358, r15359, r15360, r15361;

void setup_mpfr_f_im() {
        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_im(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_fm() {
        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_fm(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);
}

static mpfr_t r15370, r15371, r15372, r15373, r15374, r15375, r15376, r15377;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15370);
        mpfr_init(r15371);
        mpfr_init(r15372);
        mpfr_init(r15373);
        mpfr_init(r15374);
        mpfr_init(r15375);
        mpfr_init(r15376);
        mpfr_init(r15377);
}

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

