#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 r15371 = a;
        float r15372 = atan(r15371);
        float r15373 = sqrt(r15372);
        float r15374 = b;
        float r15375 = hypot(r15373, r15374);
        float r15376 = c;
        float r15377 = r15376 * r15371;
        float r15378 = r15375 - r15377;
        return r15378;
}

double f_id(double a, double b, double c, double __attribute__((unused)) d) {
        double r15379 = a;
        double r15380 = atan(r15379);
        double r15381 = sqrt(r15380);
        double r15382 = b;
        double r15383 = hypot(r15381, r15382);
        double r15384 = c;
        double r15385 = r15384 * r15379;
        double r15386 = r15383 - r15385;
        return r15386;
}


double f_of(float a, float b, float c, float __attribute__((unused)) d) {
        float r15387 = a;
        float r15388 = atan(r15387);
        float r15389 = sqrt(r15388);
        float r15390 = b;
        float r15391 = hypot(r15389, r15390);
        float r15392 = c;
        float r15393 = r15392 * r15387;
        float r15394 = r15391 - r15393;
        return r15394;
}

double f_od(double a, double b, double c, double __attribute__((unused)) d) {
        double r15395 = a;
        double r15396 = atan(r15395);
        double r15397 = sqrt(r15396);
        double r15398 = b;
        double r15399 = hypot(r15397, r15398);
        double r15400 = c;
        double r15401 = r15400 * r15395;
        double r15402 = r15399 - r15401;
        return r15402;
}

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 r15403, r15404, r15405, r15406, r15407, r15408, r15409, r15410;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15403);
        mpfr_init(r15404);
        mpfr_init(r15405);
        mpfr_init(r15406);
        mpfr_init(r15407);
        mpfr_init(r15408);
        mpfr_init(r15409);
        mpfr_init(r15410);
}

double f_im(double a, double b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15403, a, MPFR_RNDN);
        mpfr_atan(r15404, r15403, MPFR_RNDN);
        mpfr_sqrt(r15405, r15404, MPFR_RNDN);
        mpfr_set_d(r15406, b, MPFR_RNDN);
        mpfr_hypot(r15407, r15405, r15406, MPFR_RNDN);
        mpfr_set_d(r15408, c, MPFR_RNDN);
        mpfr_mul(r15409, r15408, r15403, MPFR_RNDN);
        mpfr_sub(r15410, r15407, r15409, MPFR_RNDN);
        return mpfr_get_d(r15410, MPFR_RNDN);
}

static mpfr_t r15411, r15412, r15413, r15414, r15415, r15416, r15417, r15418;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15411);
        mpfr_init(r15412);
        mpfr_init(r15413);
        mpfr_init(r15414);
        mpfr_init(r15415);
        mpfr_init(r15416);
        mpfr_init(r15417);
        mpfr_init(r15418);
}

double f_fm(double a, double b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15411, a, MPFR_RNDN);
        mpfr_atan(r15412, r15411, MPFR_RNDN);
        mpfr_sqrt(r15413, r15412, MPFR_RNDN);
        mpfr_set_d(r15414, b, MPFR_RNDN);
        mpfr_hypot(r15415, r15413, r15414, MPFR_RNDN);
        mpfr_set_d(r15416, c, MPFR_RNDN);
        mpfr_mul(r15417, r15416, r15411, MPFR_RNDN);
        mpfr_sub(r15418, r15415, r15417, MPFR_RNDN);
        return mpfr_get_d(r15418, MPFR_RNDN);
}

static mpfr_t r15419, r15420, r15421, r15422, r15423, r15424, r15425, r15426;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15419);
        mpfr_init(r15420);
        mpfr_init(r15421);
        mpfr_init(r15422);
        mpfr_init(r15423);
        mpfr_init(r15424);
        mpfr_init(r15425);
        mpfr_init(r15426);
}

double f_dm(double a, double b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15419, a, MPFR_RNDN);
        mpfr_atan(r15420, r15419, MPFR_RNDN);
        mpfr_sqrt(r15421, r15420, MPFR_RNDN);
        mpfr_set_d(r15422, b, MPFR_RNDN);
        mpfr_hypot(r15423, r15421, r15422, MPFR_RNDN);
        mpfr_set_d(r15424, c, MPFR_RNDN);
        mpfr_mul(r15425, r15424, r15419, MPFR_RNDN);
        mpfr_sub(r15426, r15423, r15425, MPFR_RNDN);
        return mpfr_get_d(r15426, MPFR_RNDN);
}

