(FPCore (a b angle x-scale y-scale)
:precision binary64
(*
180.0
(/
(atan
(/
(-
(-
(/
(/
(+
(pow (* a (cos (* (/ angle 180.0) PI))) 2.0)
(pow (* b (sin (* (/ angle 180.0) PI))) 2.0))
y-scale)
y-scale)
(/
(/
(+
(pow (* a (sin (* (/ angle 180.0) PI))) 2.0)
(pow (* b (cos (* (/ angle 180.0) PI))) 2.0))
x-scale)
x-scale))
(sqrt
(+
(pow
(-
(/
(/
(+
(pow (* a (sin (* (/ angle 180.0) PI))) 2.0)
(pow (* b (cos (* (/ angle 180.0) PI))) 2.0))
x-scale)
x-scale)
(/
(/
(+
(pow (* a (cos (* (/ angle 180.0) PI))) 2.0)
(pow (* b (sin (* (/ angle 180.0) PI))) 2.0))
y-scale)
y-scale))
2.0)
(pow
(/
(/
(*
(*
(* 2.0 (- (pow b 2.0) (pow a 2.0)))
(sin (* (/ angle 180.0) PI)))
(cos (* (/ angle 180.0) PI)))
x-scale)
y-scale)
2.0))))
(/
(/
(*
(* (* 2.0 (- (pow b 2.0) (pow a 2.0))) (sin (* (/ angle 180.0) PI)))
(cos (* (/ angle 180.0) PI)))
x-scale)
y-scale)))
PI)))(FPCore (a b angle x-scale y-scale)
:precision binary64
(let* ((t_0 (* angle (* PI 0.005555555555555556)))
(t_1 (* 0.005555555555555556 (* angle PI)))
(t_2 (sin t_1))
(t_3 (sin t_0))
(t_4
(*
180.0
(/
(atan
(*
x-scale
(*
(/ (pow (cos t_0) 2.0) (* x-scale x-scale))
(/ (- y-scale) t_3))))
PI))))
(if (<= b -2.1e+120)
t_4
(if (<= b -4.4e+88)
(* 180.0 (/ (atan (/ (* y-scale t_2) x-scale)) PI))
(if (<= b -1.75e-6)
(*
180.0
(/
(atan
(*
x-scale
(/
(* y-scale (- (pow (cos t_1) 2.0)))
(* t_2 (pow x-scale 2.0)))))
PI))
(if (<= b -6.4e-43)
(*
180.0
(/
(atan
(*
x-scale
(*
0.005555555555555556
(* (/ PI x-scale) (/ angle (/ x-scale y-scale))))))
PI))
(if (<= b -1.7e-82)
t_4
(if (<= b 3e-237)
(* 180.0 (/ (atan (* t_3 (/ y-scale x-scale))) PI))
(if (<= b 1.25e+39)
(* 180.0 (/ (atan (* t_0 (/ y-scale x-scale))) PI))
t_4)))))))))double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
return 180.0 * (atan(((((((pow((a * cos(((angle / 180.0) * ((double) M_PI)))), 2.0) + pow((b * sin(((angle / 180.0) * ((double) M_PI)))), 2.0)) / y_45_scale) / y_45_scale) - (((pow((a * sin(((angle / 180.0) * ((double) M_PI)))), 2.0) + pow((b * cos(((angle / 180.0) * ((double) M_PI)))), 2.0)) / x_45_scale) / x_45_scale)) - sqrt((pow(((((pow((a * sin(((angle / 180.0) * ((double) M_PI)))), 2.0) + pow((b * cos(((angle / 180.0) * ((double) M_PI)))), 2.0)) / x_45_scale) / x_45_scale) - (((pow((a * cos(((angle / 180.0) * ((double) M_PI)))), 2.0) + pow((b * sin(((angle / 180.0) * ((double) M_PI)))), 2.0)) / y_45_scale) / y_45_scale)), 2.0) + pow((((((2.0 * (pow(b, 2.0) - pow(a, 2.0))) * sin(((angle / 180.0) * ((double) M_PI)))) * cos(((angle / 180.0) * ((double) M_PI)))) / x_45_scale) / y_45_scale), 2.0)))) / (((((2.0 * (pow(b, 2.0) - pow(a, 2.0))) * sin(((angle / 180.0) * ((double) M_PI)))) * cos(((angle / 180.0) * ((double) M_PI)))) / x_45_scale) / y_45_scale))) / ((double) M_PI));
}
double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
double t_0 = angle * (((double) M_PI) * 0.005555555555555556);
double t_1 = 0.005555555555555556 * (angle * ((double) M_PI));
double t_2 = sin(t_1);
double t_3 = sin(t_0);
double t_4 = 180.0 * (atan((x_45_scale * ((pow(cos(t_0), 2.0) / (x_45_scale * x_45_scale)) * (-y_45_scale / t_3)))) / ((double) M_PI));
double tmp;
if (b <= -2.1e+120) {
tmp = t_4;
} else if (b <= -4.4e+88) {
tmp = 180.0 * (atan(((y_45_scale * t_2) / x_45_scale)) / ((double) M_PI));
} else if (b <= -1.75e-6) {
tmp = 180.0 * (atan((x_45_scale * ((y_45_scale * -pow(cos(t_1), 2.0)) / (t_2 * pow(x_45_scale, 2.0))))) / ((double) M_PI));
} else if (b <= -6.4e-43) {
tmp = 180.0 * (atan((x_45_scale * (0.005555555555555556 * ((((double) M_PI) / x_45_scale) * (angle / (x_45_scale / y_45_scale)))))) / ((double) M_PI));
} else if (b <= -1.7e-82) {
tmp = t_4;
} else if (b <= 3e-237) {
tmp = 180.0 * (atan((t_3 * (y_45_scale / x_45_scale))) / ((double) M_PI));
} else if (b <= 1.25e+39) {
tmp = 180.0 * (atan((t_0 * (y_45_scale / x_45_scale))) / ((double) M_PI));
} else {
tmp = t_4;
}
return tmp;
}
public static double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
return 180.0 * (Math.atan(((((((Math.pow((a * Math.cos(((angle / 180.0) * Math.PI))), 2.0) + Math.pow((b * Math.sin(((angle / 180.0) * Math.PI))), 2.0)) / y_45_scale) / y_45_scale) - (((Math.pow((a * Math.sin(((angle / 180.0) * Math.PI))), 2.0) + Math.pow((b * Math.cos(((angle / 180.0) * Math.PI))), 2.0)) / x_45_scale) / x_45_scale)) - Math.sqrt((Math.pow(((((Math.pow((a * Math.sin(((angle / 180.0) * Math.PI))), 2.0) + Math.pow((b * Math.cos(((angle / 180.0) * Math.PI))), 2.0)) / x_45_scale) / x_45_scale) - (((Math.pow((a * Math.cos(((angle / 180.0) * Math.PI))), 2.0) + Math.pow((b * Math.sin(((angle / 180.0) * Math.PI))), 2.0)) / y_45_scale) / y_45_scale)), 2.0) + Math.pow((((((2.0 * (Math.pow(b, 2.0) - Math.pow(a, 2.0))) * Math.sin(((angle / 180.0) * Math.PI))) * Math.cos(((angle / 180.0) * Math.PI))) / x_45_scale) / y_45_scale), 2.0)))) / (((((2.0 * (Math.pow(b, 2.0) - Math.pow(a, 2.0))) * Math.sin(((angle / 180.0) * Math.PI))) * Math.cos(((angle / 180.0) * Math.PI))) / x_45_scale) / y_45_scale))) / Math.PI);
}
public static double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
double t_0 = angle * (Math.PI * 0.005555555555555556);
double t_1 = 0.005555555555555556 * (angle * Math.PI);
double t_2 = Math.sin(t_1);
double t_3 = Math.sin(t_0);
double t_4 = 180.0 * (Math.atan((x_45_scale * ((Math.pow(Math.cos(t_0), 2.0) / (x_45_scale * x_45_scale)) * (-y_45_scale / t_3)))) / Math.PI);
double tmp;
if (b <= -2.1e+120) {
tmp = t_4;
} else if (b <= -4.4e+88) {
tmp = 180.0 * (Math.atan(((y_45_scale * t_2) / x_45_scale)) / Math.PI);
} else if (b <= -1.75e-6) {
tmp = 180.0 * (Math.atan((x_45_scale * ((y_45_scale * -Math.pow(Math.cos(t_1), 2.0)) / (t_2 * Math.pow(x_45_scale, 2.0))))) / Math.PI);
} else if (b <= -6.4e-43) {
tmp = 180.0 * (Math.atan((x_45_scale * (0.005555555555555556 * ((Math.PI / x_45_scale) * (angle / (x_45_scale / y_45_scale)))))) / Math.PI);
} else if (b <= -1.7e-82) {
tmp = t_4;
} else if (b <= 3e-237) {
tmp = 180.0 * (Math.atan((t_3 * (y_45_scale / x_45_scale))) / Math.PI);
} else if (b <= 1.25e+39) {
tmp = 180.0 * (Math.atan((t_0 * (y_45_scale / x_45_scale))) / Math.PI);
} else {
tmp = t_4;
}
return tmp;
}
def code(a, b, angle, x_45_scale, y_45_scale): return 180.0 * (math.atan(((((((math.pow((a * math.cos(((angle / 180.0) * math.pi))), 2.0) + math.pow((b * math.sin(((angle / 180.0) * math.pi))), 2.0)) / y_45_scale) / y_45_scale) - (((math.pow((a * math.sin(((angle / 180.0) * math.pi))), 2.0) + math.pow((b * math.cos(((angle / 180.0) * math.pi))), 2.0)) / x_45_scale) / x_45_scale)) - math.sqrt((math.pow(((((math.pow((a * math.sin(((angle / 180.0) * math.pi))), 2.0) + math.pow((b * math.cos(((angle / 180.0) * math.pi))), 2.0)) / x_45_scale) / x_45_scale) - (((math.pow((a * math.cos(((angle / 180.0) * math.pi))), 2.0) + math.pow((b * math.sin(((angle / 180.0) * math.pi))), 2.0)) / y_45_scale) / y_45_scale)), 2.0) + math.pow((((((2.0 * (math.pow(b, 2.0) - math.pow(a, 2.0))) * math.sin(((angle / 180.0) * math.pi))) * math.cos(((angle / 180.0) * math.pi))) / x_45_scale) / y_45_scale), 2.0)))) / (((((2.0 * (math.pow(b, 2.0) - math.pow(a, 2.0))) * math.sin(((angle / 180.0) * math.pi))) * math.cos(((angle / 180.0) * math.pi))) / x_45_scale) / y_45_scale))) / math.pi)
def code(a, b, angle, x_45_scale, y_45_scale): t_0 = angle * (math.pi * 0.005555555555555556) t_1 = 0.005555555555555556 * (angle * math.pi) t_2 = math.sin(t_1) t_3 = math.sin(t_0) t_4 = 180.0 * (math.atan((x_45_scale * ((math.pow(math.cos(t_0), 2.0) / (x_45_scale * x_45_scale)) * (-y_45_scale / t_3)))) / math.pi) tmp = 0 if b <= -2.1e+120: tmp = t_4 elif b <= -4.4e+88: tmp = 180.0 * (math.atan(((y_45_scale * t_2) / x_45_scale)) / math.pi) elif b <= -1.75e-6: tmp = 180.0 * (math.atan((x_45_scale * ((y_45_scale * -math.pow(math.cos(t_1), 2.0)) / (t_2 * math.pow(x_45_scale, 2.0))))) / math.pi) elif b <= -6.4e-43: tmp = 180.0 * (math.atan((x_45_scale * (0.005555555555555556 * ((math.pi / x_45_scale) * (angle / (x_45_scale / y_45_scale)))))) / math.pi) elif b <= -1.7e-82: tmp = t_4 elif b <= 3e-237: tmp = 180.0 * (math.atan((t_3 * (y_45_scale / x_45_scale))) / math.pi) elif b <= 1.25e+39: tmp = 180.0 * (math.atan((t_0 * (y_45_scale / x_45_scale))) / math.pi) else: tmp = t_4 return tmp
function code(a, b, angle, x_45_scale, y_45_scale) return Float64(180.0 * Float64(atan(Float64(Float64(Float64(Float64(Float64(Float64((Float64(a * cos(Float64(Float64(angle / 180.0) * pi))) ^ 2.0) + (Float64(b * sin(Float64(Float64(angle / 180.0) * pi))) ^ 2.0)) / y_45_scale) / y_45_scale) - Float64(Float64(Float64((Float64(a * sin(Float64(Float64(angle / 180.0) * pi))) ^ 2.0) + (Float64(b * cos(Float64(Float64(angle / 180.0) * pi))) ^ 2.0)) / x_45_scale) / x_45_scale)) - sqrt(Float64((Float64(Float64(Float64(Float64((Float64(a * sin(Float64(Float64(angle / 180.0) * pi))) ^ 2.0) + (Float64(b * cos(Float64(Float64(angle / 180.0) * pi))) ^ 2.0)) / x_45_scale) / x_45_scale) - Float64(Float64(Float64((Float64(a * cos(Float64(Float64(angle / 180.0) * pi))) ^ 2.0) + (Float64(b * sin(Float64(Float64(angle / 180.0) * pi))) ^ 2.0)) / y_45_scale) / y_45_scale)) ^ 2.0) + (Float64(Float64(Float64(Float64(Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))) * sin(Float64(Float64(angle / 180.0) * pi))) * cos(Float64(Float64(angle / 180.0) * pi))) / x_45_scale) / y_45_scale) ^ 2.0)))) / Float64(Float64(Float64(Float64(Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))) * sin(Float64(Float64(angle / 180.0) * pi))) * cos(Float64(Float64(angle / 180.0) * pi))) / x_45_scale) / y_45_scale))) / pi)) end
function code(a, b, angle, x_45_scale, y_45_scale) t_0 = Float64(angle * Float64(pi * 0.005555555555555556)) t_1 = Float64(0.005555555555555556 * Float64(angle * pi)) t_2 = sin(t_1) t_3 = sin(t_0) t_4 = Float64(180.0 * Float64(atan(Float64(x_45_scale * Float64(Float64((cos(t_0) ^ 2.0) / Float64(x_45_scale * x_45_scale)) * Float64(Float64(-y_45_scale) / t_3)))) / pi)) tmp = 0.0 if (b <= -2.1e+120) tmp = t_4; elseif (b <= -4.4e+88) tmp = Float64(180.0 * Float64(atan(Float64(Float64(y_45_scale * t_2) / x_45_scale)) / pi)); elseif (b <= -1.75e-6) tmp = Float64(180.0 * Float64(atan(Float64(x_45_scale * Float64(Float64(y_45_scale * Float64(-(cos(t_1) ^ 2.0))) / Float64(t_2 * (x_45_scale ^ 2.0))))) / pi)); elseif (b <= -6.4e-43) tmp = Float64(180.0 * Float64(atan(Float64(x_45_scale * Float64(0.005555555555555556 * Float64(Float64(pi / x_45_scale) * Float64(angle / Float64(x_45_scale / y_45_scale)))))) / pi)); elseif (b <= -1.7e-82) tmp = t_4; elseif (b <= 3e-237) tmp = Float64(180.0 * Float64(atan(Float64(t_3 * Float64(y_45_scale / x_45_scale))) / pi)); elseif (b <= 1.25e+39) tmp = Float64(180.0 * Float64(atan(Float64(t_0 * Float64(y_45_scale / x_45_scale))) / pi)); else tmp = t_4; end return tmp end
function tmp = code(a, b, angle, x_45_scale, y_45_scale) tmp = 180.0 * (atan(((((((((a * cos(((angle / 180.0) * pi))) ^ 2.0) + ((b * sin(((angle / 180.0) * pi))) ^ 2.0)) / y_45_scale) / y_45_scale) - (((((a * sin(((angle / 180.0) * pi))) ^ 2.0) + ((b * cos(((angle / 180.0) * pi))) ^ 2.0)) / x_45_scale) / x_45_scale)) - sqrt(((((((((a * sin(((angle / 180.0) * pi))) ^ 2.0) + ((b * cos(((angle / 180.0) * pi))) ^ 2.0)) / x_45_scale) / x_45_scale) - (((((a * cos(((angle / 180.0) * pi))) ^ 2.0) + ((b * sin(((angle / 180.0) * pi))) ^ 2.0)) / y_45_scale) / y_45_scale)) ^ 2.0) + ((((((2.0 * ((b ^ 2.0) - (a ^ 2.0))) * sin(((angle / 180.0) * pi))) * cos(((angle / 180.0) * pi))) / x_45_scale) / y_45_scale) ^ 2.0)))) / (((((2.0 * ((b ^ 2.0) - (a ^ 2.0))) * sin(((angle / 180.0) * pi))) * cos(((angle / 180.0) * pi))) / x_45_scale) / y_45_scale))) / pi); end
function tmp_2 = code(a, b, angle, x_45_scale, y_45_scale) t_0 = angle * (pi * 0.005555555555555556); t_1 = 0.005555555555555556 * (angle * pi); t_2 = sin(t_1); t_3 = sin(t_0); t_4 = 180.0 * (atan((x_45_scale * (((cos(t_0) ^ 2.0) / (x_45_scale * x_45_scale)) * (-y_45_scale / t_3)))) / pi); tmp = 0.0; if (b <= -2.1e+120) tmp = t_4; elseif (b <= -4.4e+88) tmp = 180.0 * (atan(((y_45_scale * t_2) / x_45_scale)) / pi); elseif (b <= -1.75e-6) tmp = 180.0 * (atan((x_45_scale * ((y_45_scale * -(cos(t_1) ^ 2.0)) / (t_2 * (x_45_scale ^ 2.0))))) / pi); elseif (b <= -6.4e-43) tmp = 180.0 * (atan((x_45_scale * (0.005555555555555556 * ((pi / x_45_scale) * (angle / (x_45_scale / y_45_scale)))))) / pi); elseif (b <= -1.7e-82) tmp = t_4; elseif (b <= 3e-237) tmp = 180.0 * (atan((t_3 * (y_45_scale / x_45_scale))) / pi); elseif (b <= 1.25e+39) tmp = 180.0 * (atan((t_0 * (y_45_scale / x_45_scale))) / pi); else tmp = t_4; end tmp_2 = tmp; end
code[a_, b_, angle_, x$45$scale_, y$45$scale_] := N[(180.0 * N[(N[ArcTan[N[(N[(N[(N[(N[(N[(N[Power[N[(a * N[Cos[N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Sin[N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / y$45$scale), $MachinePrecision] / y$45$scale), $MachinePrecision] - N[(N[(N[(N[Power[N[(a * N[Sin[N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Cos[N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / x$45$scale), $MachinePrecision] / x$45$scale), $MachinePrecision]), $MachinePrecision] - N[Sqrt[N[(N[Power[N[(N[(N[(N[(N[Power[N[(a * N[Sin[N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Cos[N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / x$45$scale), $MachinePrecision] / x$45$scale), $MachinePrecision] - N[(N[(N[(N[Power[N[(a * N[Cos[N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Sin[N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / y$45$scale), $MachinePrecision] / y$45$scale), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(N[(N[(N[(N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Cos[N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / x$45$scale), $MachinePrecision] / y$45$scale), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(N[(N[(N[(N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Cos[N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / x$45$scale), $MachinePrecision] / y$45$scale), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]
code[a_, b_, angle_, x$45$scale_, y$45$scale_] := Block[{t$95$0 = N[(angle * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sin[t$95$1], $MachinePrecision]}, Block[{t$95$3 = N[Sin[t$95$0], $MachinePrecision]}, Block[{t$95$4 = N[(180.0 * N[(N[ArcTan[N[(x$45$scale * N[(N[(N[Power[N[Cos[t$95$0], $MachinePrecision], 2.0], $MachinePrecision] / N[(x$45$scale * x$45$scale), $MachinePrecision]), $MachinePrecision] * N[((-y$45$scale) / t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -2.1e+120], t$95$4, If[LessEqual[b, -4.4e+88], N[(180.0 * N[(N[ArcTan[N[(N[(y$45$scale * t$95$2), $MachinePrecision] / x$45$scale), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -1.75e-6], N[(180.0 * N[(N[ArcTan[N[(x$45$scale * N[(N[(y$45$scale * (-N[Power[N[Cos[t$95$1], $MachinePrecision], 2.0], $MachinePrecision])), $MachinePrecision] / N[(t$95$2 * N[Power[x$45$scale, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -6.4e-43], N[(180.0 * N[(N[ArcTan[N[(x$45$scale * N[(0.005555555555555556 * N[(N[(Pi / x$45$scale), $MachinePrecision] * N[(angle / N[(x$45$scale / y$45$scale), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -1.7e-82], t$95$4, If[LessEqual[b, 3e-237], N[(180.0 * N[(N[ArcTan[N[(t$95$3 * N[(y$45$scale / x$45$scale), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.25e+39], N[(180.0 * N[(N[ArcTan[N[(t$95$0 * N[(y$45$scale / x$45$scale), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], t$95$4]]]]]]]]]]]]
180 \cdot \frac{\tan^{-1} \left(\frac{\left(\frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{y-scale}}{y-scale} - \frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{x-scale}}{x-scale}\right) - \sqrt{{\left(\frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{x-scale}}{x-scale} - \frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{y-scale}}{y-scale}\right)}^{2} + {\left(\frac{\frac{\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)}{x-scale}}{y-scale}\right)}^{2}}}{\frac{\frac{\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)}{x-scale}}{y-scale}}\right)}{\pi}
\begin{array}{l}
t_0 := angle \cdot \left(\pi \cdot 0.005555555555555556\right)\\
t_1 := 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\\
t_2 := \sin t_1\\
t_3 := \sin t_0\\
t_4 := 180 \cdot \frac{\tan^{-1} \left(x-scale \cdot \left(\frac{{\cos t_0}^{2}}{x-scale \cdot x-scale} \cdot \frac{-y-scale}{t_3}\right)\right)}{\pi}\\
\mathbf{if}\;b \leq -2.1 \cdot 10^{+120}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;b \leq -4.4 \cdot 10^{+88}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{y-scale \cdot t_2}{x-scale}\right)}{\pi}\\
\mathbf{elif}\;b \leq -1.75 \cdot 10^{-6}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(x-scale \cdot \frac{y-scale \cdot \left(-{\cos t_1}^{2}\right)}{t_2 \cdot {x-scale}^{2}}\right)}{\pi}\\
\mathbf{elif}\;b \leq -6.4 \cdot 10^{-43}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(x-scale \cdot \left(0.005555555555555556 \cdot \left(\frac{\pi}{x-scale} \cdot \frac{angle}{\frac{x-scale}{y-scale}}\right)\right)\right)}{\pi}\\
\mathbf{elif}\;b \leq -1.7 \cdot 10^{-82}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;b \leq 3 \cdot 10^{-237}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(t_3 \cdot \frac{y-scale}{x-scale}\right)}{\pi}\\
\mathbf{elif}\;b \leq 1.25 \cdot 10^{+39}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(t_0 \cdot \frac{y-scale}{x-scale}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;t_4\\
\end{array}



Bits error versus a



Bits error versus b



Bits error versus angle



Bits error versus x-scale



Bits error versus y-scale
Results
if b < -2.1e120 or -6.3999999999999997e-43 < b < -1.69999999999999988e-82 or 1.25000000000000004e39 < b Initial program 58.4
Simplified57.3
Taylor expanded in y-scale around inf 56.3
Simplified51.3
Taylor expanded in angle around 0 51.3
Taylor expanded in b around inf 31.9
Simplified31.7
if -2.1e120 < b < -4.40000000000000017e88Initial program 50.6
Simplified49.4
Taylor expanded in y-scale around inf 44.8
Simplified39.2
Taylor expanded in angle around 0 40.7
Taylor expanded in b around 0 41.6
Simplified40.8
Taylor expanded in x-scale around 0 39.2
if -4.40000000000000017e88 < b < -1.74999999999999997e-6Initial program 48.5
Simplified46.1
Taylor expanded in y-scale around inf 43.4
Simplified38.8
Taylor expanded in angle around 0 40.0
Taylor expanded in b around inf 38.0
if -1.74999999999999997e-6 < b < -6.3999999999999997e-43Initial program 49.1
Simplified47.8
Taylor expanded in y-scale around inf 43.1
Simplified39.6
Taylor expanded in angle around 0 37.8
Taylor expanded in b around 0 36.7
Simplified36.0
Taylor expanded in angle around 0 37.0
Simplified34.4
if -1.69999999999999988e-82 < b < 3.00000000000000024e-237Initial program 56.2
Simplified54.0
Taylor expanded in y-scale around inf 51.9
Simplified46.3
Taylor expanded in angle around 0 46.2
Taylor expanded in b around 0 31.1
Simplified30.0
Taylor expanded in x-scale around 0 26.3
Simplified24.3
if 3.00000000000000024e-237 < b < 1.25000000000000004e39Initial program 50.5
Simplified48.5
Taylor expanded in y-scale around inf 46.7
Simplified41.2
Taylor expanded in angle around 0 42.2
Taylor expanded in b around 0 34.8
Simplified33.7
Taylor expanded in angle around 0 34.0
Simplified30.3
Final simplification30.4
herbie shell --seed 2022169
(FPCore (a b angle x-scale y-scale)
:name "raw-angle from scale-rotated-ellipse"
:precision binary64
(* 180.0 (/ (atan (/ (- (- (/ (/ (+ (pow (* a (cos (* (/ angle 180.0) PI))) 2.0) (pow (* b (sin (* (/ angle 180.0) PI))) 2.0)) y-scale) y-scale) (/ (/ (+ (pow (* a (sin (* (/ angle 180.0) PI))) 2.0) (pow (* b (cos (* (/ angle 180.0) PI))) 2.0)) x-scale) x-scale)) (sqrt (+ (pow (- (/ (/ (+ (pow (* a (sin (* (/ angle 180.0) PI))) 2.0) (pow (* b (cos (* (/ angle 180.0) PI))) 2.0)) x-scale) x-scale) (/ (/ (+ (pow (* a (cos (* (/ angle 180.0) PI))) 2.0) (pow (* b (sin (* (/ angle 180.0) PI))) 2.0)) y-scale) y-scale)) 2.0) (pow (/ (/ (* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) (sin (* (/ angle 180.0) PI))) (cos (* (/ angle 180.0) PI))) x-scale) y-scale) 2.0)))) (/ (/ (* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) (sin (* (/ angle 180.0) PI))) (cos (* (/ angle 180.0) PI))) x-scale) y-scale))) PI)))