#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 r15466 = a;
        float r15467 = atan(r15466);
        float r15468 = sqrt(r15467);
        float r15469 = b;
        float r15470 = hypot(r15468, r15469);
        float r15471 = c;
        float r15472 = r15471 * r15466;
        float r15473 = r15470 - r15472;
        return r15473;
}

double f_id(double a, double b, double c, double __attribute__((unused)) d) {
        double r15474 = a;
        double r15475 = atan(r15474);
        double r15476 = sqrt(r15475);
        double r15477 = b;
        double r15478 = hypot(r15476, r15477);
        double r15479 = c;
        double r15480 = r15479 * r15474;
        double r15481 = r15478 - r15480;
        return r15481;
}


double f_of(float a, float b, float c, float __attribute__((unused)) d) {
        float r15482 = a;
        float r15483 = atan(r15482);
        float r15484 = sqrt(r15483);
        float r15485 = sqrt(r15484);
        float r15486 = r15485 * r15485;
        float r15487 = b;
        float r15488 = hypot(r15486, r15487);
        float r15489 = c;
        float r15490 = r15489 * r15482;
        float r15491 = r15488 - r15490;
        return r15491;
}

double f_od(double a, double b, double c, double __attribute__((unused)) d) {
        double r15492 = a;
        double r15493 = atan(r15492);
        double r15494 = sqrt(r15493);
        double r15495 = sqrt(r15494);
        double r15496 = r15495 * r15495;
        double r15497 = b;
        double r15498 = hypot(r15496, r15497);
        double r15499 = c;
        double r15500 = r15499 * r15492;
        double r15501 = r15498 - r15500;
        return r15501;
}

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 r15502, r15503, r15504, r15505, r15506, r15507, r15508, r15509;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15502);
        mpfr_init(r15503);
        mpfr_init(r15504);
        mpfr_init(r15505);
        mpfr_init(r15506);
        mpfr_init(r15507);
        mpfr_init(r15508);
        mpfr_init(r15509);
}

double f_im(double a, double b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15502, a, MPFR_RNDN);
        mpfr_atan(r15503, r15502, MPFR_RNDN);
        mpfr_sqrt(r15504, r15503, MPFR_RNDN);
        mpfr_set_d(r15505, b, MPFR_RNDN);
        mpfr_hypot(r15506, r15504, r15505, MPFR_RNDN);
        mpfr_set_d(r15507, c, MPFR_RNDN);
        mpfr_mul(r15508, r15507, r15502, MPFR_RNDN);
        mpfr_sub(r15509, r15506, r15508, MPFR_RNDN);
        return mpfr_get_d(r15509, MPFR_RNDN);
}

static mpfr_t r15510, r15511, r15512, r15513, r15514, r15515, r15516, r15517, r15518, r15519;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15510);
        mpfr_init(r15511);
        mpfr_init(r15512);
        mpfr_init(r15513);
        mpfr_init(r15514);
        mpfr_init(r15515);
        mpfr_init(r15516);
        mpfr_init(r15517);
        mpfr_init(r15518);
        mpfr_init(r15519);
}

double f_fm(double a, double b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15510, a, MPFR_RNDN);
        mpfr_atan(r15511, r15510, MPFR_RNDN);
        mpfr_sqrt(r15512, r15511, MPFR_RNDN);
        mpfr_sqrt(r15513, r15512, MPFR_RNDN);
        mpfr_sqr(r15514, r15513, MPFR_RNDN);
        mpfr_set_d(r15515, b, MPFR_RNDN);
        mpfr_hypot(r15516, r15514, r15515, MPFR_RNDN);
        mpfr_set_d(r15517, c, MPFR_RNDN);
        mpfr_mul(r15518, r15517, r15510, MPFR_RNDN);
        mpfr_sub(r15519, r15516, r15518, MPFR_RNDN);
        return mpfr_get_d(r15519, MPFR_RNDN);
}

static mpfr_t r15520, r15521, r15522, r15523, r15524, r15525, r15526, r15527, r15528, r15529;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15520);
        mpfr_init(r15521);
        mpfr_init(r15522);
        mpfr_init(r15523);
        mpfr_init(r15524);
        mpfr_init(r15525);
        mpfr_init(r15526);
        mpfr_init(r15527);
        mpfr_init(r15528);
        mpfr_init(r15529);
}

double f_dm(double a, double b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15520, a, MPFR_RNDN);
        mpfr_atan(r15521, r15520, MPFR_RNDN);
        mpfr_sqrt(r15522, r15521, MPFR_RNDN);
        mpfr_sqrt(r15523, r15522, MPFR_RNDN);
        mpfr_sqr(r15524, r15523, MPFR_RNDN);
        mpfr_set_d(r15525, b, MPFR_RNDN);
        mpfr_hypot(r15526, r15524, r15525, MPFR_RNDN);
        mpfr_set_d(r15527, c, MPFR_RNDN);
        mpfr_mul(r15528, r15527, r15520, MPFR_RNDN);
        mpfr_sub(r15529, r15526, r15528, MPFR_RNDN);
        return mpfr_get_d(r15529, MPFR_RNDN);
}

