#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 r15438 = a;
        float r15439 = atan(r15438);
        float r15440 = sqrt(r15439);
        float r15441 = b;
        float r15442 = hypot(r15440, r15441);
        float r15443 = c;
        float r15444 = r15443 * r15438;
        float r15445 = r15442 - r15444;
        return r15445;
}

double f_id(double a, double b, double c, double __attribute__((unused)) d) {
        double r15446 = a;
        double r15447 = atan(r15446);
        double r15448 = sqrt(r15447);
        double r15449 = b;
        double r15450 = hypot(r15448, r15449);
        double r15451 = c;
        double r15452 = r15451 * r15446;
        double r15453 = r15450 - r15452;
        return r15453;
}


double f_of(float a, float b, float c, float __attribute__((unused)) d) {
        float r15454 = a;
        float r15455 = atan(r15454);
        float r15456 = sqrt(r15455);
        float r15457 = sqrt(r15456);
        float r15458 = r15457 * r15457;
        float r15459 = b;
        float r15460 = hypot(r15458, r15459);
        float r15461 = c;
        float r15462 = r15461 * r15454;
        float r15463 = r15460 - r15462;
        return r15463;
}

double f_od(double a, double b, double c, double __attribute__((unused)) d) {
        double r15464 = a;
        double r15465 = atan(r15464);
        double r15466 = sqrt(r15465);
        double r15467 = sqrt(r15466);
        double r15468 = r15467 * r15467;
        double r15469 = b;
        double r15470 = hypot(r15468, r15469);
        double r15471 = c;
        double r15472 = r15471 * r15464;
        double r15473 = r15470 - r15472;
        return r15473;
}

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 r15474, r15475, r15476, r15477, r15478, r15479, r15480, r15481;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15474);
        mpfr_init(r15475);
        mpfr_init(r15476);
        mpfr_init(r15477);
        mpfr_init(r15478);
        mpfr_init(r15479);
        mpfr_init(r15480);
        mpfr_init(r15481);
}

double f_im(double a, double b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15474, a, MPFR_RNDN);
        mpfr_atan(r15475, r15474, MPFR_RNDN);
        mpfr_sqrt(r15476, r15475, MPFR_RNDN);
        mpfr_set_d(r15477, b, MPFR_RNDN);
        mpfr_hypot(r15478, r15476, r15477, MPFR_RNDN);
        mpfr_set_d(r15479, c, MPFR_RNDN);
        mpfr_mul(r15480, r15479, r15474, MPFR_RNDN);
        mpfr_sub(r15481, r15478, r15480, MPFR_RNDN);
        return mpfr_get_d(r15481, MPFR_RNDN);
}

static mpfr_t r15482, r15483, r15484, r15485, r15486, r15487, r15488, r15489, r15490, r15491;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15482);
        mpfr_init(r15483);
        mpfr_init(r15484);
        mpfr_init(r15485);
        mpfr_init(r15486);
        mpfr_init(r15487);
        mpfr_init(r15488);
        mpfr_init(r15489);
        mpfr_init(r15490);
        mpfr_init(r15491);
}

double f_fm(double a, double b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15482, a, MPFR_RNDN);
        mpfr_atan(r15483, r15482, MPFR_RNDN);
        mpfr_sqrt(r15484, r15483, MPFR_RNDN);
        mpfr_sqrt(r15485, r15484, MPFR_RNDN);
        mpfr_sqr(r15486, r15485, MPFR_RNDN);
        mpfr_set_d(r15487, b, MPFR_RNDN);
        mpfr_hypot(r15488, r15486, r15487, MPFR_RNDN);
        mpfr_set_d(r15489, c, MPFR_RNDN);
        mpfr_mul(r15490, r15489, r15482, MPFR_RNDN);
        mpfr_sub(r15491, r15488, r15490, MPFR_RNDN);
        return mpfr_get_d(r15491, MPFR_RNDN);
}

static mpfr_t r15492, r15493, r15494, r15495, r15496, r15497, r15498, r15499, r15500, r15501;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15492);
        mpfr_init(r15493);
        mpfr_init(r15494);
        mpfr_init(r15495);
        mpfr_init(r15496);
        mpfr_init(r15497);
        mpfr_init(r15498);
        mpfr_init(r15499);
        mpfr_init(r15500);
        mpfr_init(r15501);
}

double f_dm(double a, double b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15492, a, MPFR_RNDN);
        mpfr_atan(r15493, r15492, MPFR_RNDN);
        mpfr_sqrt(r15494, r15493, MPFR_RNDN);
        mpfr_sqrt(r15495, r15494, MPFR_RNDN);
        mpfr_sqr(r15496, r15495, MPFR_RNDN);
        mpfr_set_d(r15497, b, MPFR_RNDN);
        mpfr_hypot(r15498, r15496, r15497, MPFR_RNDN);
        mpfr_set_d(r15499, c, MPFR_RNDN);
        mpfr_mul(r15500, r15499, r15492, MPFR_RNDN);
        mpfr_sub(r15501, r15498, r15500, MPFR_RNDN);
        return mpfr_get_d(r15501, MPFR_RNDN);
}

