
(FPCore (a b angle x-scale y-scale)
:precision binary64
(let* ((t_0 (* (/ angle 180.0) PI))
(t_1 (cos t_0))
(t_2 (sin t_0))
(t_3
(/
(/ (* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) t_2) t_1) x-scale)
y-scale))
(t_4
(/ (/ (+ (pow (* a t_1) 2.0) (pow (* b t_2) 2.0)) y-scale) y-scale))
(t_5
(/ (/ (+ (pow (* a t_2) 2.0) (pow (* b t_1) 2.0)) x-scale) x-scale)))
(*
180.0
(/
(atan
(/ (- (- t_4 t_5) (sqrt (+ (pow (- t_5 t_4) 2.0) (pow t_3 2.0)))) t_3))
PI))))
double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
double t_0 = (angle / 180.0) * ((double) M_PI);
double t_1 = cos(t_0);
double t_2 = sin(t_0);
double t_3 = ((((2.0 * (pow(b, 2.0) - pow(a, 2.0))) * t_2) * t_1) / x_45_scale) / y_45_scale;
double t_4 = ((pow((a * t_1), 2.0) + pow((b * t_2), 2.0)) / y_45_scale) / y_45_scale;
double t_5 = ((pow((a * t_2), 2.0) + pow((b * t_1), 2.0)) / x_45_scale) / x_45_scale;
return 180.0 * (atan((((t_4 - t_5) - sqrt((pow((t_5 - t_4), 2.0) + pow(t_3, 2.0)))) / t_3)) / ((double) M_PI));
}
public static double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
double t_0 = (angle / 180.0) * Math.PI;
double t_1 = Math.cos(t_0);
double t_2 = Math.sin(t_0);
double t_3 = ((((2.0 * (Math.pow(b, 2.0) - Math.pow(a, 2.0))) * t_2) * t_1) / x_45_scale) / y_45_scale;
double t_4 = ((Math.pow((a * t_1), 2.0) + Math.pow((b * t_2), 2.0)) / y_45_scale) / y_45_scale;
double t_5 = ((Math.pow((a * t_2), 2.0) + Math.pow((b * t_1), 2.0)) / x_45_scale) / x_45_scale;
return 180.0 * (Math.atan((((t_4 - t_5) - Math.sqrt((Math.pow((t_5 - t_4), 2.0) + Math.pow(t_3, 2.0)))) / t_3)) / Math.PI);
}
def code(a, b, angle, x_45_scale, y_45_scale): t_0 = (angle / 180.0) * math.pi t_1 = math.cos(t_0) t_2 = math.sin(t_0) t_3 = ((((2.0 * (math.pow(b, 2.0) - math.pow(a, 2.0))) * t_2) * t_1) / x_45_scale) / y_45_scale t_4 = ((math.pow((a * t_1), 2.0) + math.pow((b * t_2), 2.0)) / y_45_scale) / y_45_scale t_5 = ((math.pow((a * t_2), 2.0) + math.pow((b * t_1), 2.0)) / x_45_scale) / x_45_scale return 180.0 * (math.atan((((t_4 - t_5) - math.sqrt((math.pow((t_5 - t_4), 2.0) + math.pow(t_3, 2.0)))) / t_3)) / math.pi)
function code(a, b, angle, x_45_scale, y_45_scale) t_0 = Float64(Float64(angle / 180.0) * pi) t_1 = cos(t_0) t_2 = sin(t_0) t_3 = Float64(Float64(Float64(Float64(Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))) * t_2) * t_1) / x_45_scale) / y_45_scale) t_4 = Float64(Float64(Float64((Float64(a * t_1) ^ 2.0) + (Float64(b * t_2) ^ 2.0)) / y_45_scale) / y_45_scale) t_5 = Float64(Float64(Float64((Float64(a * t_2) ^ 2.0) + (Float64(b * t_1) ^ 2.0)) / x_45_scale) / x_45_scale) return Float64(180.0 * Float64(atan(Float64(Float64(Float64(t_4 - t_5) - sqrt(Float64((Float64(t_5 - t_4) ^ 2.0) + (t_3 ^ 2.0)))) / t_3)) / pi)) end
function tmp = code(a, b, angle, x_45_scale, y_45_scale) t_0 = (angle / 180.0) * pi; t_1 = cos(t_0); t_2 = sin(t_0); t_3 = ((((2.0 * ((b ^ 2.0) - (a ^ 2.0))) * t_2) * t_1) / x_45_scale) / y_45_scale; t_4 = ((((a * t_1) ^ 2.0) + ((b * t_2) ^ 2.0)) / y_45_scale) / y_45_scale; t_5 = ((((a * t_2) ^ 2.0) + ((b * t_1) ^ 2.0)) / x_45_scale) / x_45_scale; tmp = 180.0 * (atan((((t_4 - t_5) - sqrt((((t_5 - t_4) ^ 2.0) + (t_3 ^ 2.0)))) / t_3)) / pi); end
code[a_, b_, angle_, x$45$scale_, y$45$scale_] := Block[{t$95$0 = N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]}, Block[{t$95$1 = N[Cos[t$95$0], $MachinePrecision]}, Block[{t$95$2 = N[Sin[t$95$0], $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(N[(N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision] * t$95$1), $MachinePrecision] / x$45$scale), $MachinePrecision] / y$45$scale), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(N[Power[N[(a * t$95$1), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * t$95$2), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / y$45$scale), $MachinePrecision] / y$45$scale), $MachinePrecision]}, Block[{t$95$5 = N[(N[(N[(N[Power[N[(a * t$95$2), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * t$95$1), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / x$45$scale), $MachinePrecision] / x$45$scale), $MachinePrecision]}, N[(180.0 * N[(N[ArcTan[N[(N[(N[(t$95$4 - t$95$5), $MachinePrecision] - N[Sqrt[N[(N[Power[N[(t$95$5 - t$95$4), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[t$95$3, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / t$95$3), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{angle}{180} \cdot \pi\\
t_1 := \cos t\_0\\
t_2 := \sin t\_0\\
t_3 := \frac{\frac{\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot t\_2\right) \cdot t\_1}{x-scale}}{y-scale}\\
t_4 := \frac{\frac{{\left(a \cdot t\_1\right)}^{2} + {\left(b \cdot t\_2\right)}^{2}}{y-scale}}{y-scale}\\
t_5 := \frac{\frac{{\left(a \cdot t\_2\right)}^{2} + {\left(b \cdot t\_1\right)}^{2}}{x-scale}}{x-scale}\\
180 \cdot \frac{\tan^{-1} \left(\frac{\left(t\_4 - t\_5\right) - \sqrt{{\left(t\_5 - t\_4\right)}^{2} + {t\_3}^{2}}}{t\_3}\right)}{\pi}
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (a b angle x-scale y-scale)
:precision binary64
(let* ((t_0 (* (/ angle 180.0) PI))
(t_1 (cos t_0))
(t_2 (sin t_0))
(t_3
(/
(/ (* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) t_2) t_1) x-scale)
y-scale))
(t_4
(/ (/ (+ (pow (* a t_1) 2.0) (pow (* b t_2) 2.0)) y-scale) y-scale))
(t_5
(/ (/ (+ (pow (* a t_2) 2.0) (pow (* b t_1) 2.0)) x-scale) x-scale)))
(*
180.0
(/
(atan
(/ (- (- t_4 t_5) (sqrt (+ (pow (- t_5 t_4) 2.0) (pow t_3 2.0)))) t_3))
PI))))
double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
double t_0 = (angle / 180.0) * ((double) M_PI);
double t_1 = cos(t_0);
double t_2 = sin(t_0);
double t_3 = ((((2.0 * (pow(b, 2.0) - pow(a, 2.0))) * t_2) * t_1) / x_45_scale) / y_45_scale;
double t_4 = ((pow((a * t_1), 2.0) + pow((b * t_2), 2.0)) / y_45_scale) / y_45_scale;
double t_5 = ((pow((a * t_2), 2.0) + pow((b * t_1), 2.0)) / x_45_scale) / x_45_scale;
return 180.0 * (atan((((t_4 - t_5) - sqrt((pow((t_5 - t_4), 2.0) + pow(t_3, 2.0)))) / t_3)) / ((double) M_PI));
}
public static double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
double t_0 = (angle / 180.0) * Math.PI;
double t_1 = Math.cos(t_0);
double t_2 = Math.sin(t_0);
double t_3 = ((((2.0 * (Math.pow(b, 2.0) - Math.pow(a, 2.0))) * t_2) * t_1) / x_45_scale) / y_45_scale;
double t_4 = ((Math.pow((a * t_1), 2.0) + Math.pow((b * t_2), 2.0)) / y_45_scale) / y_45_scale;
double t_5 = ((Math.pow((a * t_2), 2.0) + Math.pow((b * t_1), 2.0)) / x_45_scale) / x_45_scale;
return 180.0 * (Math.atan((((t_4 - t_5) - Math.sqrt((Math.pow((t_5 - t_4), 2.0) + Math.pow(t_3, 2.0)))) / t_3)) / Math.PI);
}
def code(a, b, angle, x_45_scale, y_45_scale): t_0 = (angle / 180.0) * math.pi t_1 = math.cos(t_0) t_2 = math.sin(t_0) t_3 = ((((2.0 * (math.pow(b, 2.0) - math.pow(a, 2.0))) * t_2) * t_1) / x_45_scale) / y_45_scale t_4 = ((math.pow((a * t_1), 2.0) + math.pow((b * t_2), 2.0)) / y_45_scale) / y_45_scale t_5 = ((math.pow((a * t_2), 2.0) + math.pow((b * t_1), 2.0)) / x_45_scale) / x_45_scale return 180.0 * (math.atan((((t_4 - t_5) - math.sqrt((math.pow((t_5 - t_4), 2.0) + math.pow(t_3, 2.0)))) / t_3)) / math.pi)
function code(a, b, angle, x_45_scale, y_45_scale) t_0 = Float64(Float64(angle / 180.0) * pi) t_1 = cos(t_0) t_2 = sin(t_0) t_3 = Float64(Float64(Float64(Float64(Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))) * t_2) * t_1) / x_45_scale) / y_45_scale) t_4 = Float64(Float64(Float64((Float64(a * t_1) ^ 2.0) + (Float64(b * t_2) ^ 2.0)) / y_45_scale) / y_45_scale) t_5 = Float64(Float64(Float64((Float64(a * t_2) ^ 2.0) + (Float64(b * t_1) ^ 2.0)) / x_45_scale) / x_45_scale) return Float64(180.0 * Float64(atan(Float64(Float64(Float64(t_4 - t_5) - sqrt(Float64((Float64(t_5 - t_4) ^ 2.0) + (t_3 ^ 2.0)))) / t_3)) / pi)) end
function tmp = code(a, b, angle, x_45_scale, y_45_scale) t_0 = (angle / 180.0) * pi; t_1 = cos(t_0); t_2 = sin(t_0); t_3 = ((((2.0 * ((b ^ 2.0) - (a ^ 2.0))) * t_2) * t_1) / x_45_scale) / y_45_scale; t_4 = ((((a * t_1) ^ 2.0) + ((b * t_2) ^ 2.0)) / y_45_scale) / y_45_scale; t_5 = ((((a * t_2) ^ 2.0) + ((b * t_1) ^ 2.0)) / x_45_scale) / x_45_scale; tmp = 180.0 * (atan((((t_4 - t_5) - sqrt((((t_5 - t_4) ^ 2.0) + (t_3 ^ 2.0)))) / t_3)) / pi); end
code[a_, b_, angle_, x$45$scale_, y$45$scale_] := Block[{t$95$0 = N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]}, Block[{t$95$1 = N[Cos[t$95$0], $MachinePrecision]}, Block[{t$95$2 = N[Sin[t$95$0], $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(N[(N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision] * t$95$1), $MachinePrecision] / x$45$scale), $MachinePrecision] / y$45$scale), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(N[Power[N[(a * t$95$1), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * t$95$2), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / y$45$scale), $MachinePrecision] / y$45$scale), $MachinePrecision]}, Block[{t$95$5 = N[(N[(N[(N[Power[N[(a * t$95$2), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * t$95$1), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / x$45$scale), $MachinePrecision] / x$45$scale), $MachinePrecision]}, N[(180.0 * N[(N[ArcTan[N[(N[(N[(t$95$4 - t$95$5), $MachinePrecision] - N[Sqrt[N[(N[Power[N[(t$95$5 - t$95$4), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[t$95$3, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / t$95$3), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{angle}{180} \cdot \pi\\
t_1 := \cos t\_0\\
t_2 := \sin t\_0\\
t_3 := \frac{\frac{\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot t\_2\right) \cdot t\_1}{x-scale}}{y-scale}\\
t_4 := \frac{\frac{{\left(a \cdot t\_1\right)}^{2} + {\left(b \cdot t\_2\right)}^{2}}{y-scale}}{y-scale}\\
t_5 := \frac{\frac{{\left(a \cdot t\_2\right)}^{2} + {\left(b \cdot t\_1\right)}^{2}}{x-scale}}{x-scale}\\
180 \cdot \frac{\tan^{-1} \left(\frac{\left(t\_4 - t\_5\right) - \sqrt{{\left(t\_5 - t\_4\right)}^{2} + {t\_3}^{2}}}{t\_3}\right)}{\pi}
\end{array}
\end{array}
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale y-scale)
:precision binary64
(let* ((t_0 (* 0.005555555555555556 (* angle PI)))
(t_1 (* angle (* 0.005555555555555556 PI))))
(if (<= b_m 1.65e+19)
(* 180.0 (/ (atan (* y-scale (/ (sin t_1) (* (cos t_1) x-scale)))) PI))
(*
180.0
(/ (atan (* (/ (/ (cos t_0) x-scale) (sin t_0)) (- y-scale))) PI)))))b_m = fabs(b);
double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
double t_0 = 0.005555555555555556 * (angle * ((double) M_PI));
double t_1 = angle * (0.005555555555555556 * ((double) M_PI));
double tmp;
if (b_m <= 1.65e+19) {
tmp = 180.0 * (atan((y_45_scale * (sin(t_1) / (cos(t_1) * x_45_scale)))) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((((cos(t_0) / x_45_scale) / sin(t_0)) * -y_45_scale)) / ((double) M_PI));
}
return tmp;
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
double t_0 = 0.005555555555555556 * (angle * Math.PI);
double t_1 = angle * (0.005555555555555556 * Math.PI);
double tmp;
if (b_m <= 1.65e+19) {
tmp = 180.0 * (Math.atan((y_45_scale * (Math.sin(t_1) / (Math.cos(t_1) * x_45_scale)))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((((Math.cos(t_0) / x_45_scale) / Math.sin(t_0)) * -y_45_scale)) / Math.PI);
}
return tmp;
}
b_m = math.fabs(b) def code(a, b_m, angle, x_45_scale, y_45_scale): t_0 = 0.005555555555555556 * (angle * math.pi) t_1 = angle * (0.005555555555555556 * math.pi) tmp = 0 if b_m <= 1.65e+19: tmp = 180.0 * (math.atan((y_45_scale * (math.sin(t_1) / (math.cos(t_1) * x_45_scale)))) / math.pi) else: tmp = 180.0 * (math.atan((((math.cos(t_0) / x_45_scale) / math.sin(t_0)) * -y_45_scale)) / math.pi) return tmp
b_m = abs(b) function code(a, b_m, angle, x_45_scale, y_45_scale) t_0 = Float64(0.005555555555555556 * Float64(angle * pi)) t_1 = Float64(angle * Float64(0.005555555555555556 * pi)) tmp = 0.0 if (b_m <= 1.65e+19) tmp = Float64(180.0 * Float64(atan(Float64(y_45_scale * Float64(sin(t_1) / Float64(cos(t_1) * x_45_scale)))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(Float64(cos(t_0) / x_45_scale) / sin(t_0)) * Float64(-y_45_scale))) / pi)); end return tmp end
b_m = abs(b); function tmp_2 = code(a, b_m, angle, x_45_scale, y_45_scale) t_0 = 0.005555555555555556 * (angle * pi); t_1 = angle * (0.005555555555555556 * pi); tmp = 0.0; if (b_m <= 1.65e+19) tmp = 180.0 * (atan((y_45_scale * (sin(t_1) / (cos(t_1) * x_45_scale)))) / pi); else tmp = 180.0 * (atan((((cos(t_0) / x_45_scale) / sin(t_0)) * -y_45_scale)) / pi); end tmp_2 = tmp; end
b_m = N[Abs[b], $MachinePrecision]
code[a_, b$95$m_, angle_, x$45$scale_, y$45$scale_] := Block[{t$95$0 = N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(angle * N[(0.005555555555555556 * Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b$95$m, 1.65e+19], N[(180.0 * N[(N[ArcTan[N[(y$45$scale * N[(N[Sin[t$95$1], $MachinePrecision] / N[(N[Cos[t$95$1], $MachinePrecision] * x$45$scale), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(N[(N[Cos[t$95$0], $MachinePrecision] / x$45$scale), $MachinePrecision] / N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision] * (-y$45$scale)), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
t_0 := 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\\
t_1 := angle \cdot \left(0.005555555555555556 \cdot \pi\right)\\
\mathbf{if}\;b\_m \leq 1.65 \cdot 10^{+19}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(y-scale \cdot \frac{\sin t\_1}{\cos t\_1 \cdot x-scale}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\frac{\cos t\_0}{x-scale}}{\sin t\_0} \cdot \left(-y-scale\right)\right)}{\pi}\\
\end{array}
\end{array}
if b < 1.65e19Initial program 12.8%
Simplified14.0%
Taylor expanded in y-scale around inf 22.4%
add-sqr-sqrt21.2%
Applied egg-rr21.2%
Taylor expanded in a around inf 44.5%
associate-/l*44.5%
*-commutative44.5%
associate-*r*44.1%
*-commutative44.1%
*-commutative44.1%
*-commutative44.1%
associate-*r*46.2%
*-commutative46.2%
Simplified46.2%
if 1.65e19 < b Initial program 13.0%
Simplified7.8%
Taylor expanded in x-scale around 0 27.4%
Simplified27.6%
Taylor expanded in a around 0 55.6%
mul-1-neg55.6%
times-frac52.3%
Simplified52.3%
add-sqr-sqrt18.4%
Applied egg-rr50.1%
Taylor expanded in y-scale around 0 55.6%
associate-/l*55.6%
associate-/r*55.7%
Simplified55.7%
Final simplification48.2%
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale y-scale)
:precision binary64
(let* ((t_0 (* angle (* 0.005555555555555556 PI))))
(if (<= b_m 1.4e+19)
(* 180.0 (/ (atan (* y-scale (/ (sin t_0) (* (cos t_0) x-scale)))) PI))
(*
180.0
(/
(atan
(/
(* y-scale (/ -1.0 (tan (* 0.005555555555555556 (* angle PI)))))
x-scale))
PI)))))b_m = fabs(b);
double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
double t_0 = angle * (0.005555555555555556 * ((double) M_PI));
double tmp;
if (b_m <= 1.4e+19) {
tmp = 180.0 * (atan((y_45_scale * (sin(t_0) / (cos(t_0) * x_45_scale)))) / ((double) M_PI));
} else {
tmp = 180.0 * (atan(((y_45_scale * (-1.0 / tan((0.005555555555555556 * (angle * ((double) M_PI)))))) / x_45_scale)) / ((double) M_PI));
}
return tmp;
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
double t_0 = angle * (0.005555555555555556 * Math.PI);
double tmp;
if (b_m <= 1.4e+19) {
tmp = 180.0 * (Math.atan((y_45_scale * (Math.sin(t_0) / (Math.cos(t_0) * x_45_scale)))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(((y_45_scale * (-1.0 / Math.tan((0.005555555555555556 * (angle * Math.PI))))) / x_45_scale)) / Math.PI);
}
return tmp;
}
b_m = math.fabs(b) def code(a, b_m, angle, x_45_scale, y_45_scale): t_0 = angle * (0.005555555555555556 * math.pi) tmp = 0 if b_m <= 1.4e+19: tmp = 180.0 * (math.atan((y_45_scale * (math.sin(t_0) / (math.cos(t_0) * x_45_scale)))) / math.pi) else: tmp = 180.0 * (math.atan(((y_45_scale * (-1.0 / math.tan((0.005555555555555556 * (angle * math.pi))))) / x_45_scale)) / math.pi) return tmp
b_m = abs(b) function code(a, b_m, angle, x_45_scale, y_45_scale) t_0 = Float64(angle * Float64(0.005555555555555556 * pi)) tmp = 0.0 if (b_m <= 1.4e+19) tmp = Float64(180.0 * Float64(atan(Float64(y_45_scale * Float64(sin(t_0) / Float64(cos(t_0) * x_45_scale)))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(y_45_scale * Float64(-1.0 / tan(Float64(0.005555555555555556 * Float64(angle * pi))))) / x_45_scale)) / pi)); end return tmp end
b_m = abs(b); function tmp_2 = code(a, b_m, angle, x_45_scale, y_45_scale) t_0 = angle * (0.005555555555555556 * pi); tmp = 0.0; if (b_m <= 1.4e+19) tmp = 180.0 * (atan((y_45_scale * (sin(t_0) / (cos(t_0) * x_45_scale)))) / pi); else tmp = 180.0 * (atan(((y_45_scale * (-1.0 / tan((0.005555555555555556 * (angle * pi))))) / x_45_scale)) / pi); end tmp_2 = tmp; end
b_m = N[Abs[b], $MachinePrecision]
code[a_, b$95$m_, angle_, x$45$scale_, y$45$scale_] := Block[{t$95$0 = N[(angle * N[(0.005555555555555556 * Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b$95$m, 1.4e+19], N[(180.0 * N[(N[ArcTan[N[(y$45$scale * N[(N[Sin[t$95$0], $MachinePrecision] / N[(N[Cos[t$95$0], $MachinePrecision] * x$45$scale), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(y$45$scale * N[(-1.0 / N[Tan[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x$45$scale), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
t_0 := angle \cdot \left(0.005555555555555556 \cdot \pi\right)\\
\mathbf{if}\;b\_m \leq 1.4 \cdot 10^{+19}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(y-scale \cdot \frac{\sin t\_0}{\cos t\_0 \cdot x-scale}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{y-scale \cdot \frac{-1}{\tan \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}}{x-scale}\right)}{\pi}\\
\end{array}
\end{array}
if b < 1.4e19Initial program 12.8%
Simplified14.0%
Taylor expanded in y-scale around inf 22.4%
add-sqr-sqrt21.2%
Applied egg-rr21.2%
Taylor expanded in a around inf 44.5%
associate-/l*44.5%
*-commutative44.5%
associate-*r*44.1%
*-commutative44.1%
*-commutative44.1%
*-commutative44.1%
associate-*r*46.2%
*-commutative46.2%
Simplified46.2%
if 1.4e19 < b Initial program 13.0%
Simplified7.8%
Taylor expanded in x-scale around 0 27.4%
Simplified27.6%
Taylor expanded in a around 0 55.6%
mul-1-neg55.6%
times-frac52.3%
Simplified52.3%
associate-*l/55.7%
clear-num55.7%
quot-tan55.7%
Applied egg-rr55.7%
Final simplification48.2%
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale y-scale)
:precision binary64
(let* ((t_0 (* 0.005555555555555556 (* angle PI))))
(if (<= b_m 5e+106)
(* 180.0 (/ (+ (- 1.0 (atan (/ (/ y-scale x-scale) (sin t_0)))) -1.0) PI))
(* 180.0 (/ (atan (/ (* y-scale (/ -1.0 (tan t_0))) x-scale)) PI)))))b_m = fabs(b);
double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
double t_0 = 0.005555555555555556 * (angle * ((double) M_PI));
double tmp;
if (b_m <= 5e+106) {
tmp = 180.0 * (((1.0 - atan(((y_45_scale / x_45_scale) / sin(t_0)))) + -1.0) / ((double) M_PI));
} else {
tmp = 180.0 * (atan(((y_45_scale * (-1.0 / tan(t_0))) / x_45_scale)) / ((double) M_PI));
}
return tmp;
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
double t_0 = 0.005555555555555556 * (angle * Math.PI);
double tmp;
if (b_m <= 5e+106) {
tmp = 180.0 * (((1.0 - Math.atan(((y_45_scale / x_45_scale) / Math.sin(t_0)))) + -1.0) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(((y_45_scale * (-1.0 / Math.tan(t_0))) / x_45_scale)) / Math.PI);
}
return tmp;
}
b_m = math.fabs(b) def code(a, b_m, angle, x_45_scale, y_45_scale): t_0 = 0.005555555555555556 * (angle * math.pi) tmp = 0 if b_m <= 5e+106: tmp = 180.0 * (((1.0 - math.atan(((y_45_scale / x_45_scale) / math.sin(t_0)))) + -1.0) / math.pi) else: tmp = 180.0 * (math.atan(((y_45_scale * (-1.0 / math.tan(t_0))) / x_45_scale)) / math.pi) return tmp
b_m = abs(b) function code(a, b_m, angle, x_45_scale, y_45_scale) t_0 = Float64(0.005555555555555556 * Float64(angle * pi)) tmp = 0.0 if (b_m <= 5e+106) tmp = Float64(180.0 * Float64(Float64(Float64(1.0 - atan(Float64(Float64(y_45_scale / x_45_scale) / sin(t_0)))) + -1.0) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(y_45_scale * Float64(-1.0 / tan(t_0))) / x_45_scale)) / pi)); end return tmp end
b_m = abs(b); function tmp_2 = code(a, b_m, angle, x_45_scale, y_45_scale) t_0 = 0.005555555555555556 * (angle * pi); tmp = 0.0; if (b_m <= 5e+106) tmp = 180.0 * (((1.0 - atan(((y_45_scale / x_45_scale) / sin(t_0)))) + -1.0) / pi); else tmp = 180.0 * (atan(((y_45_scale * (-1.0 / tan(t_0))) / x_45_scale)) / pi); end tmp_2 = tmp; end
b_m = N[Abs[b], $MachinePrecision]
code[a_, b$95$m_, angle_, x$45$scale_, y$45$scale_] := Block[{t$95$0 = N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b$95$m, 5e+106], N[(180.0 * N[(N[(N[(1.0 - N[ArcTan[N[(N[(y$45$scale / x$45$scale), $MachinePrecision] / N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(y$45$scale * N[(-1.0 / N[Tan[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x$45$scale), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
t_0 := 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\\
\mathbf{if}\;b\_m \leq 5 \cdot 10^{+106}:\\
\;\;\;\;180 \cdot \frac{\left(1 - \tan^{-1} \left(\frac{\frac{y-scale}{x-scale}}{\sin t\_0}\right)\right) + -1}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{y-scale \cdot \frac{-1}{\tan t\_0}}{x-scale}\right)}{\pi}\\
\end{array}
\end{array}
if b < 4.9999999999999998e106Initial program 13.8%
Simplified14.0%
Taylor expanded in x-scale around 0 32.0%
Simplified36.7%
Taylor expanded in a around 0 38.7%
mul-1-neg38.7%
times-frac41.7%
Simplified41.7%
Taylor expanded in angle around 0 43.2%
expm1-log1p-u27.6%
expm1-undefine26.3%
atan-neg26.3%
un-div-inv26.3%
Applied egg-rr26.3%
sub-neg26.3%
log1p-undefine26.3%
rem-exp-log41.9%
unsub-neg41.9%
metadata-eval41.9%
Simplified41.9%
if 4.9999999999999998e106 < b Initial program 6.4%
Simplified3.3%
Taylor expanded in x-scale around 0 10.4%
Simplified10.6%
Taylor expanded in a around 0 58.6%
mul-1-neg58.6%
times-frac52.9%
Simplified52.9%
associate-*l/58.7%
clear-num58.7%
quot-tan58.7%
Applied egg-rr58.7%
Final simplification44.0%
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale y-scale)
:precision binary64
(if (<= b_m 1.42e+103)
(*
180.0
(/
(atan
(*
(/ y-scale x-scale)
(/ -1.0 (sin (* angle (* 0.005555555555555556 PI))))))
PI))
(*
180.0
(/
(atan
(/
(* y-scale (/ -1.0 (tan (* 0.005555555555555556 (* angle PI)))))
x-scale))
PI))))b_m = fabs(b);
double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
double tmp;
if (b_m <= 1.42e+103) {
tmp = 180.0 * (atan(((y_45_scale / x_45_scale) * (-1.0 / sin((angle * (0.005555555555555556 * ((double) M_PI))))))) / ((double) M_PI));
} else {
tmp = 180.0 * (atan(((y_45_scale * (-1.0 / tan((0.005555555555555556 * (angle * ((double) M_PI)))))) / x_45_scale)) / ((double) M_PI));
}
return tmp;
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
double tmp;
if (b_m <= 1.42e+103) {
tmp = 180.0 * (Math.atan(((y_45_scale / x_45_scale) * (-1.0 / Math.sin((angle * (0.005555555555555556 * Math.PI)))))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(((y_45_scale * (-1.0 / Math.tan((0.005555555555555556 * (angle * Math.PI))))) / x_45_scale)) / Math.PI);
}
return tmp;
}
b_m = math.fabs(b) def code(a, b_m, angle, x_45_scale, y_45_scale): tmp = 0 if b_m <= 1.42e+103: tmp = 180.0 * (math.atan(((y_45_scale / x_45_scale) * (-1.0 / math.sin((angle * (0.005555555555555556 * math.pi)))))) / math.pi) else: tmp = 180.0 * (math.atan(((y_45_scale * (-1.0 / math.tan((0.005555555555555556 * (angle * math.pi))))) / x_45_scale)) / math.pi) return tmp
b_m = abs(b) function code(a, b_m, angle, x_45_scale, y_45_scale) tmp = 0.0 if (b_m <= 1.42e+103) tmp = Float64(180.0 * Float64(atan(Float64(Float64(y_45_scale / x_45_scale) * Float64(-1.0 / sin(Float64(angle * Float64(0.005555555555555556 * pi)))))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(y_45_scale * Float64(-1.0 / tan(Float64(0.005555555555555556 * Float64(angle * pi))))) / x_45_scale)) / pi)); end return tmp end
b_m = abs(b); function tmp_2 = code(a, b_m, angle, x_45_scale, y_45_scale) tmp = 0.0; if (b_m <= 1.42e+103) tmp = 180.0 * (atan(((y_45_scale / x_45_scale) * (-1.0 / sin((angle * (0.005555555555555556 * pi)))))) / pi); else tmp = 180.0 * (atan(((y_45_scale * (-1.0 / tan((0.005555555555555556 * (angle * pi))))) / x_45_scale)) / pi); end tmp_2 = tmp; end
b_m = N[Abs[b], $MachinePrecision] code[a_, b$95$m_, angle_, x$45$scale_, y$45$scale_] := If[LessEqual[b$95$m, 1.42e+103], N[(180.0 * N[(N[ArcTan[N[(N[(y$45$scale / x$45$scale), $MachinePrecision] * N[(-1.0 / N[Sin[N[(angle * N[(0.005555555555555556 * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(y$45$scale * N[(-1.0 / N[Tan[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x$45$scale), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
\mathbf{if}\;b\_m \leq 1.42 \cdot 10^{+103}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{y-scale}{x-scale} \cdot \frac{-1}{\sin \left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right)}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{y-scale \cdot \frac{-1}{\tan \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}}{x-scale}\right)}{\pi}\\
\end{array}
\end{array}
if b < 1.42e103Initial program 13.8%
Simplified14.1%
Taylor expanded in x-scale around 0 32.2%
Simplified36.9%
Taylor expanded in a around 0 38.8%
mul-1-neg38.8%
times-frac41.8%
Simplified41.8%
Taylor expanded in angle around 0 43.4%
*-un-lft-identity43.4%
Applied egg-rr43.4%
*-lft-identity43.4%
*-commutative43.4%
associate-*r*43.9%
*-commutative43.9%
Simplified43.9%
if 1.42e103 < b Initial program 6.2%
Simplified3.2%
Taylor expanded in x-scale around 0 10.1%
Simplified10.3%
Taylor expanded in a around 0 57.4%
mul-1-neg57.4%
times-frac51.8%
Simplified51.8%
associate-*l/57.5%
clear-num57.5%
quot-tan57.5%
Applied egg-rr57.5%
Final simplification45.7%
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale y-scale)
:precision binary64
(let* ((t_0 (* 0.005555555555555556 (* angle PI))))
(if (<= x-scale -1e-265)
(* 180.0 (/ (atan (/ (/ y-scale x-scale) (tan t_0))) (- PI)))
(* 180.0 (/ (atan (* (/ y-scale x-scale) (/ -1.0 (sin t_0)))) PI)))))b_m = fabs(b);
double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
double t_0 = 0.005555555555555556 * (angle * ((double) M_PI));
double tmp;
if (x_45_scale <= -1e-265) {
tmp = 180.0 * (atan(((y_45_scale / x_45_scale) / tan(t_0))) / -((double) M_PI));
} else {
tmp = 180.0 * (atan(((y_45_scale / x_45_scale) * (-1.0 / sin(t_0)))) / ((double) M_PI));
}
return tmp;
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
double t_0 = 0.005555555555555556 * (angle * Math.PI);
double tmp;
if (x_45_scale <= -1e-265) {
tmp = 180.0 * (Math.atan(((y_45_scale / x_45_scale) / Math.tan(t_0))) / -Math.PI);
} else {
tmp = 180.0 * (Math.atan(((y_45_scale / x_45_scale) * (-1.0 / Math.sin(t_0)))) / Math.PI);
}
return tmp;
}
b_m = math.fabs(b) def code(a, b_m, angle, x_45_scale, y_45_scale): t_0 = 0.005555555555555556 * (angle * math.pi) tmp = 0 if x_45_scale <= -1e-265: tmp = 180.0 * (math.atan(((y_45_scale / x_45_scale) / math.tan(t_0))) / -math.pi) else: tmp = 180.0 * (math.atan(((y_45_scale / x_45_scale) * (-1.0 / math.sin(t_0)))) / math.pi) return tmp
b_m = abs(b) function code(a, b_m, angle, x_45_scale, y_45_scale) t_0 = Float64(0.005555555555555556 * Float64(angle * pi)) tmp = 0.0 if (x_45_scale <= -1e-265) tmp = Float64(180.0 * Float64(atan(Float64(Float64(y_45_scale / x_45_scale) / tan(t_0))) / Float64(-pi))); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(y_45_scale / x_45_scale) * Float64(-1.0 / sin(t_0)))) / pi)); end return tmp end
b_m = abs(b); function tmp_2 = code(a, b_m, angle, x_45_scale, y_45_scale) t_0 = 0.005555555555555556 * (angle * pi); tmp = 0.0; if (x_45_scale <= -1e-265) tmp = 180.0 * (atan(((y_45_scale / x_45_scale) / tan(t_0))) / -pi); else tmp = 180.0 * (atan(((y_45_scale / x_45_scale) * (-1.0 / sin(t_0)))) / pi); end tmp_2 = tmp; end
b_m = N[Abs[b], $MachinePrecision]
code[a_, b$95$m_, angle_, x$45$scale_, y$45$scale_] := Block[{t$95$0 = N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$45$scale, -1e-265], N[(180.0 * N[(N[ArcTan[N[(N[(y$45$scale / x$45$scale), $MachinePrecision] / N[Tan[t$95$0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / (-Pi)), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(y$45$scale / x$45$scale), $MachinePrecision] * N[(-1.0 / N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
t_0 := 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\\
\mathbf{if}\;x-scale \leq -1 \cdot 10^{-265}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\frac{y-scale}{x-scale}}{\tan t\_0}\right)}{-\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{y-scale}{x-scale} \cdot \frac{-1}{\sin t\_0}\right)}{\pi}\\
\end{array}
\end{array}
if x-scale < -9.99999999999999985e-266Initial program 12.4%
Simplified14.9%
Taylor expanded in x-scale around 0 31.6%
Simplified38.6%
Taylor expanded in a around 0 42.5%
mul-1-neg42.5%
times-frac46.1%
Simplified46.1%
add-sqr-sqrt23.2%
Applied egg-rr44.6%
atan-neg44.6%
clear-num44.6%
add-sqr-sqrt46.1%
quot-tan46.1%
Applied egg-rr46.1%
associate-*r/46.1%
*-rgt-identity46.1%
Simplified46.1%
if -9.99999999999999985e-266 < x-scale Initial program 13.1%
Simplified11.2%
Taylor expanded in x-scale around 0 27.7%
Simplified29.9%
Taylor expanded in a around 0 40.3%
mul-1-neg40.3%
times-frac40.9%
Simplified40.9%
Taylor expanded in angle around 0 46.4%
Final simplification46.3%
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale y-scale)
:precision binary64
(let* ((t_0 (* 0.005555555555555556 (* angle PI))))
(if (<= x-scale -1.4e-269)
(* 180.0 (/ (atan (/ (/ y-scale x-scale) (tan t_0))) (- PI)))
(* 180.0 (/ -1.0 (/ PI (atan (/ (/ y-scale x-scale) (sin t_0)))))))))b_m = fabs(b);
double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
double t_0 = 0.005555555555555556 * (angle * ((double) M_PI));
double tmp;
if (x_45_scale <= -1.4e-269) {
tmp = 180.0 * (atan(((y_45_scale / x_45_scale) / tan(t_0))) / -((double) M_PI));
} else {
tmp = 180.0 * (-1.0 / (((double) M_PI) / atan(((y_45_scale / x_45_scale) / sin(t_0)))));
}
return tmp;
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
double t_0 = 0.005555555555555556 * (angle * Math.PI);
double tmp;
if (x_45_scale <= -1.4e-269) {
tmp = 180.0 * (Math.atan(((y_45_scale / x_45_scale) / Math.tan(t_0))) / -Math.PI);
} else {
tmp = 180.0 * (-1.0 / (Math.PI / Math.atan(((y_45_scale / x_45_scale) / Math.sin(t_0)))));
}
return tmp;
}
b_m = math.fabs(b) def code(a, b_m, angle, x_45_scale, y_45_scale): t_0 = 0.005555555555555556 * (angle * math.pi) tmp = 0 if x_45_scale <= -1.4e-269: tmp = 180.0 * (math.atan(((y_45_scale / x_45_scale) / math.tan(t_0))) / -math.pi) else: tmp = 180.0 * (-1.0 / (math.pi / math.atan(((y_45_scale / x_45_scale) / math.sin(t_0))))) return tmp
b_m = abs(b) function code(a, b_m, angle, x_45_scale, y_45_scale) t_0 = Float64(0.005555555555555556 * Float64(angle * pi)) tmp = 0.0 if (x_45_scale <= -1.4e-269) tmp = Float64(180.0 * Float64(atan(Float64(Float64(y_45_scale / x_45_scale) / tan(t_0))) / Float64(-pi))); else tmp = Float64(180.0 * Float64(-1.0 / Float64(pi / atan(Float64(Float64(y_45_scale / x_45_scale) / sin(t_0)))))); end return tmp end
b_m = abs(b); function tmp_2 = code(a, b_m, angle, x_45_scale, y_45_scale) t_0 = 0.005555555555555556 * (angle * pi); tmp = 0.0; if (x_45_scale <= -1.4e-269) tmp = 180.0 * (atan(((y_45_scale / x_45_scale) / tan(t_0))) / -pi); else tmp = 180.0 * (-1.0 / (pi / atan(((y_45_scale / x_45_scale) / sin(t_0))))); end tmp_2 = tmp; end
b_m = N[Abs[b], $MachinePrecision]
code[a_, b$95$m_, angle_, x$45$scale_, y$45$scale_] := Block[{t$95$0 = N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$45$scale, -1.4e-269], N[(180.0 * N[(N[ArcTan[N[(N[(y$45$scale / x$45$scale), $MachinePrecision] / N[Tan[t$95$0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / (-Pi)), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(-1.0 / N[(Pi / N[ArcTan[N[(N[(y$45$scale / x$45$scale), $MachinePrecision] / N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
t_0 := 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\\
\mathbf{if}\;x-scale \leq -1.4 \cdot 10^{-269}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\frac{y-scale}{x-scale}}{\tan t\_0}\right)}{-\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{-1}{\frac{\pi}{\tan^{-1} \left(\frac{\frac{y-scale}{x-scale}}{\sin t\_0}\right)}}\\
\end{array}
\end{array}
if x-scale < -1.39999999999999997e-269Initial program 12.4%
Simplified14.9%
Taylor expanded in x-scale around 0 31.6%
Simplified38.6%
Taylor expanded in a around 0 42.5%
mul-1-neg42.5%
times-frac46.1%
Simplified46.1%
add-sqr-sqrt23.2%
Applied egg-rr44.6%
atan-neg44.6%
clear-num44.6%
add-sqr-sqrt46.1%
quot-tan46.1%
Applied egg-rr46.1%
associate-*r/46.1%
*-rgt-identity46.1%
Simplified46.1%
if -1.39999999999999997e-269 < x-scale Initial program 13.1%
Simplified11.2%
Taylor expanded in x-scale around 0 27.7%
Simplified29.9%
Taylor expanded in a around 0 40.3%
mul-1-neg40.3%
times-frac40.9%
Simplified40.9%
Taylor expanded in angle around 0 46.4%
clear-num46.4%
inv-pow46.4%
atan-neg46.4%
un-div-inv46.4%
Applied egg-rr46.4%
unpow-146.4%
distribute-frac-neg246.4%
distribute-neg-frac46.4%
Simplified46.4%
Final simplification46.3%
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale y-scale)
:precision binary64
(let* ((t_0 (* 0.005555555555555556 (* angle PI))))
(if (<= x-scale -6.4e-267)
(* 180.0 (/ (atan (/ (/ y-scale x-scale) (tan t_0))) (- PI)))
(/ (* (atan (/ (/ y-scale x-scale) (sin t_0))) -180.0) PI))))b_m = fabs(b);
double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
double t_0 = 0.005555555555555556 * (angle * ((double) M_PI));
double tmp;
if (x_45_scale <= -6.4e-267) {
tmp = 180.0 * (atan(((y_45_scale / x_45_scale) / tan(t_0))) / -((double) M_PI));
} else {
tmp = (atan(((y_45_scale / x_45_scale) / sin(t_0))) * -180.0) / ((double) M_PI);
}
return tmp;
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
double t_0 = 0.005555555555555556 * (angle * Math.PI);
double tmp;
if (x_45_scale <= -6.4e-267) {
tmp = 180.0 * (Math.atan(((y_45_scale / x_45_scale) / Math.tan(t_0))) / -Math.PI);
} else {
tmp = (Math.atan(((y_45_scale / x_45_scale) / Math.sin(t_0))) * -180.0) / Math.PI;
}
return tmp;
}
b_m = math.fabs(b) def code(a, b_m, angle, x_45_scale, y_45_scale): t_0 = 0.005555555555555556 * (angle * math.pi) tmp = 0 if x_45_scale <= -6.4e-267: tmp = 180.0 * (math.atan(((y_45_scale / x_45_scale) / math.tan(t_0))) / -math.pi) else: tmp = (math.atan(((y_45_scale / x_45_scale) / math.sin(t_0))) * -180.0) / math.pi return tmp
b_m = abs(b) function code(a, b_m, angle, x_45_scale, y_45_scale) t_0 = Float64(0.005555555555555556 * Float64(angle * pi)) tmp = 0.0 if (x_45_scale <= -6.4e-267) tmp = Float64(180.0 * Float64(atan(Float64(Float64(y_45_scale / x_45_scale) / tan(t_0))) / Float64(-pi))); else tmp = Float64(Float64(atan(Float64(Float64(y_45_scale / x_45_scale) / sin(t_0))) * -180.0) / pi); end return tmp end
b_m = abs(b); function tmp_2 = code(a, b_m, angle, x_45_scale, y_45_scale) t_0 = 0.005555555555555556 * (angle * pi); tmp = 0.0; if (x_45_scale <= -6.4e-267) tmp = 180.0 * (atan(((y_45_scale / x_45_scale) / tan(t_0))) / -pi); else tmp = (atan(((y_45_scale / x_45_scale) / sin(t_0))) * -180.0) / pi; end tmp_2 = tmp; end
b_m = N[Abs[b], $MachinePrecision]
code[a_, b$95$m_, angle_, x$45$scale_, y$45$scale_] := Block[{t$95$0 = N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$45$scale, -6.4e-267], N[(180.0 * N[(N[ArcTan[N[(N[(y$45$scale / x$45$scale), $MachinePrecision] / N[Tan[t$95$0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / (-Pi)), $MachinePrecision]), $MachinePrecision], N[(N[(N[ArcTan[N[(N[(y$45$scale / x$45$scale), $MachinePrecision] / N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * -180.0), $MachinePrecision] / Pi), $MachinePrecision]]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
t_0 := 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\\
\mathbf{if}\;x-scale \leq -6.4 \cdot 10^{-267}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\frac{y-scale}{x-scale}}{\tan t\_0}\right)}{-\pi}\\
\mathbf{else}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{\frac{y-scale}{x-scale}}{\sin t\_0}\right) \cdot -180}{\pi}\\
\end{array}
\end{array}
if x-scale < -6.39999999999999973e-267Initial program 12.4%
Simplified14.9%
Taylor expanded in x-scale around 0 31.6%
Simplified38.6%
Taylor expanded in a around 0 42.5%
mul-1-neg42.5%
times-frac46.1%
Simplified46.1%
add-sqr-sqrt23.2%
Applied egg-rr44.6%
atan-neg44.6%
clear-num44.6%
add-sqr-sqrt46.1%
quot-tan46.1%
Applied egg-rr46.1%
associate-*r/46.1%
*-rgt-identity46.1%
Simplified46.1%
if -6.39999999999999973e-267 < x-scale Initial program 13.1%
Simplified11.2%
Taylor expanded in x-scale around 0 27.7%
Simplified29.9%
Taylor expanded in a around 0 40.3%
mul-1-neg40.3%
times-frac40.9%
Simplified40.9%
Taylor expanded in angle around 0 46.4%
associate-*r/46.4%
atan-neg46.4%
un-div-inv46.4%
Applied egg-rr46.4%
distribute-rgt-neg-out46.4%
distribute-lft-neg-in46.4%
metadata-eval46.4%
Simplified46.4%
Final simplification46.3%
b_m = (fabs.f64 b) (FPCore (a b_m angle x-scale y-scale) :precision binary64 (/ (* (atan (/ (/ y-scale x-scale) (sin (* 0.005555555555555556 (* angle PI))))) -180.0) PI))
b_m = fabs(b);
double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
return (atan(((y_45_scale / x_45_scale) / sin((0.005555555555555556 * (angle * ((double) M_PI)))))) * -180.0) / ((double) M_PI);
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
return (Math.atan(((y_45_scale / x_45_scale) / Math.sin((0.005555555555555556 * (angle * Math.PI))))) * -180.0) / Math.PI;
}
b_m = math.fabs(b) def code(a, b_m, angle, x_45_scale, y_45_scale): return (math.atan(((y_45_scale / x_45_scale) / math.sin((0.005555555555555556 * (angle * math.pi))))) * -180.0) / math.pi
b_m = abs(b) function code(a, b_m, angle, x_45_scale, y_45_scale) return Float64(Float64(atan(Float64(Float64(y_45_scale / x_45_scale) / sin(Float64(0.005555555555555556 * Float64(angle * pi))))) * -180.0) / pi) end
b_m = abs(b); function tmp = code(a, b_m, angle, x_45_scale, y_45_scale) tmp = (atan(((y_45_scale / x_45_scale) / sin((0.005555555555555556 * (angle * pi))))) * -180.0) / pi; end
b_m = N[Abs[b], $MachinePrecision] code[a_, b$95$m_, angle_, x$45$scale_, y$45$scale_] := N[(N[(N[ArcTan[N[(N[(y$45$scale / x$45$scale), $MachinePrecision] / N[Sin[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * -180.0), $MachinePrecision] / Pi), $MachinePrecision]
\begin{array}{l}
b_m = \left|b\right|
\\
\frac{\tan^{-1} \left(\frac{\frac{y-scale}{x-scale}}{\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}\right) \cdot -180}{\pi}
\end{array}
Initial program 12.9%
Simplified12.7%
Taylor expanded in x-scale around 0 29.3%
Simplified33.5%
Taylor expanded in a around 0 41.2%
mul-1-neg41.2%
times-frac43.1%
Simplified43.1%
Taylor expanded in angle around 0 44.2%
associate-*r/44.2%
atan-neg44.2%
un-div-inv44.2%
Applied egg-rr44.2%
distribute-rgt-neg-out44.2%
distribute-lft-neg-in44.2%
metadata-eval44.2%
Simplified44.2%
Final simplification44.2%
b_m = (fabs.f64 b) (FPCore (a b_m angle x-scale y-scale) :precision binary64 (* 180.0 (/ (atan (* -180.0 (/ 1.0 (* angle (/ (* PI x-scale) y-scale))))) PI)))
b_m = fabs(b);
double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
return 180.0 * (atan((-180.0 * (1.0 / (angle * ((((double) M_PI) * x_45_scale) / y_45_scale))))) / ((double) M_PI));
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
return 180.0 * (Math.atan((-180.0 * (1.0 / (angle * ((Math.PI * x_45_scale) / y_45_scale))))) / Math.PI);
}
b_m = math.fabs(b) def code(a, b_m, angle, x_45_scale, y_45_scale): return 180.0 * (math.atan((-180.0 * (1.0 / (angle * ((math.pi * x_45_scale) / y_45_scale))))) / math.pi)
b_m = abs(b) function code(a, b_m, angle, x_45_scale, y_45_scale) return Float64(180.0 * Float64(atan(Float64(-180.0 * Float64(1.0 / Float64(angle * Float64(Float64(pi * x_45_scale) / y_45_scale))))) / pi)) end
b_m = abs(b); function tmp = code(a, b_m, angle, x_45_scale, y_45_scale) tmp = 180.0 * (atan((-180.0 * (1.0 / (angle * ((pi * x_45_scale) / y_45_scale))))) / pi); end
b_m = N[Abs[b], $MachinePrecision] code[a_, b$95$m_, angle_, x$45$scale_, y$45$scale_] := N[(180.0 * N[(N[ArcTan[N[(-180.0 * N[(1.0 / N[(angle * N[(N[(Pi * x$45$scale), $MachinePrecision] / y$45$scale), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
b_m = \left|b\right|
\\
180 \cdot \frac{\tan^{-1} \left(-180 \cdot \frac{1}{angle \cdot \frac{\pi \cdot x-scale}{y-scale}}\right)}{\pi}
\end{array}
Initial program 12.9%
Simplified12.7%
Taylor expanded in angle around 0 11.7%
associate-/l*11.7%
distribute-lft-out--11.7%
associate-*r*11.7%
Simplified11.7%
Taylor expanded in a around 0 35.9%
clear-num35.9%
inv-pow35.9%
Applied egg-rr35.9%
unpow-135.9%
associate-/l*37.8%
Simplified37.8%
Final simplification37.8%
b_m = (fabs.f64 b) (FPCore (a b_m angle x-scale y-scale) :precision binary64 (* 180.0 (/ (atan (* -180.0 (/ (/ y-scale angle) (* PI x-scale)))) PI)))
b_m = fabs(b);
double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
return 180.0 * (atan((-180.0 * ((y_45_scale / angle) / (((double) M_PI) * x_45_scale)))) / ((double) M_PI));
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
return 180.0 * (Math.atan((-180.0 * ((y_45_scale / angle) / (Math.PI * x_45_scale)))) / Math.PI);
}
b_m = math.fabs(b) def code(a, b_m, angle, x_45_scale, y_45_scale): return 180.0 * (math.atan((-180.0 * ((y_45_scale / angle) / (math.pi * x_45_scale)))) / math.pi)
b_m = abs(b) function code(a, b_m, angle, x_45_scale, y_45_scale) return Float64(180.0 * Float64(atan(Float64(-180.0 * Float64(Float64(y_45_scale / angle) / Float64(pi * x_45_scale)))) / pi)) end
b_m = abs(b); function tmp = code(a, b_m, angle, x_45_scale, y_45_scale) tmp = 180.0 * (atan((-180.0 * ((y_45_scale / angle) / (pi * x_45_scale)))) / pi); end
b_m = N[Abs[b], $MachinePrecision] code[a_, b$95$m_, angle_, x$45$scale_, y$45$scale_] := N[(180.0 * N[(N[ArcTan[N[(-180.0 * N[(N[(y$45$scale / angle), $MachinePrecision] / N[(Pi * x$45$scale), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
b_m = \left|b\right|
\\
180 \cdot \frac{\tan^{-1} \left(-180 \cdot \frac{\frac{y-scale}{angle}}{\pi \cdot x-scale}\right)}{\pi}
\end{array}
Initial program 12.9%
Simplified12.7%
Taylor expanded in x-scale around 0 29.3%
Simplified33.5%
Taylor expanded in a around 0 41.2%
mul-1-neg41.2%
times-frac43.1%
Simplified43.1%
Taylor expanded in angle around 0 44.2%
Taylor expanded in angle around 0 35.9%
*-commutative35.9%
associate-/r*35.9%
Simplified35.9%
Final simplification35.9%
b_m = (fabs.f64 b) (FPCore (a b_m angle x-scale y-scale) :precision binary64 (* 180.0 (/ (atan (* -180.0 (/ y-scale (* angle (* PI x-scale))))) PI)))
b_m = fabs(b);
double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
return 180.0 * (atan((-180.0 * (y_45_scale / (angle * (((double) M_PI) * x_45_scale))))) / ((double) M_PI));
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
return 180.0 * (Math.atan((-180.0 * (y_45_scale / (angle * (Math.PI * x_45_scale))))) / Math.PI);
}
b_m = math.fabs(b) def code(a, b_m, angle, x_45_scale, y_45_scale): return 180.0 * (math.atan((-180.0 * (y_45_scale / (angle * (math.pi * x_45_scale))))) / math.pi)
b_m = abs(b) function code(a, b_m, angle, x_45_scale, y_45_scale) return Float64(180.0 * Float64(atan(Float64(-180.0 * Float64(y_45_scale / Float64(angle * Float64(pi * x_45_scale))))) / pi)) end
b_m = abs(b); function tmp = code(a, b_m, angle, x_45_scale, y_45_scale) tmp = 180.0 * (atan((-180.0 * (y_45_scale / (angle * (pi * x_45_scale))))) / pi); end
b_m = N[Abs[b], $MachinePrecision] code[a_, b$95$m_, angle_, x$45$scale_, y$45$scale_] := N[(180.0 * N[(N[ArcTan[N[(-180.0 * N[(y$45$scale / N[(angle * N[(Pi * x$45$scale), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
b_m = \left|b\right|
\\
180 \cdot \frac{\tan^{-1} \left(-180 \cdot \frac{y-scale}{angle \cdot \left(\pi \cdot x-scale\right)}\right)}{\pi}
\end{array}
Initial program 12.9%
Simplified12.7%
Taylor expanded in angle around 0 11.7%
associate-/l*11.7%
distribute-lft-out--11.7%
associate-*r*11.7%
Simplified11.7%
Taylor expanded in a around 0 35.9%
Final simplification35.9%
b_m = (fabs.f64 b) (FPCore (a b_m angle x-scale y-scale) :precision binary64 (* 180.0 (/ (atan (* -180.0 (/ x-scale (* angle (* y-scale PI))))) PI)))
b_m = fabs(b);
double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
return 180.0 * (atan((-180.0 * (x_45_scale / (angle * (y_45_scale * ((double) M_PI)))))) / ((double) M_PI));
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
return 180.0 * (Math.atan((-180.0 * (x_45_scale / (angle * (y_45_scale * Math.PI))))) / Math.PI);
}
b_m = math.fabs(b) def code(a, b_m, angle, x_45_scale, y_45_scale): return 180.0 * (math.atan((-180.0 * (x_45_scale / (angle * (y_45_scale * math.pi))))) / math.pi)
b_m = abs(b) function code(a, b_m, angle, x_45_scale, y_45_scale) return Float64(180.0 * Float64(atan(Float64(-180.0 * Float64(x_45_scale / Float64(angle * Float64(y_45_scale * pi))))) / pi)) end
b_m = abs(b); function tmp = code(a, b_m, angle, x_45_scale, y_45_scale) tmp = 180.0 * (atan((-180.0 * (x_45_scale / (angle * (y_45_scale * pi))))) / pi); end
b_m = N[Abs[b], $MachinePrecision] code[a_, b$95$m_, angle_, x$45$scale_, y$45$scale_] := N[(180.0 * N[(N[ArcTan[N[(-180.0 * N[(x$45$scale / N[(angle * N[(y$45$scale * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
b_m = \left|b\right|
\\
180 \cdot \frac{\tan^{-1} \left(-180 \cdot \frac{x-scale}{angle \cdot \left(y-scale \cdot \pi\right)}\right)}{\pi}
\end{array}
Initial program 12.9%
Simplified12.7%
Taylor expanded in angle around 0 11.7%
associate-/l*11.7%
distribute-lft-out--11.7%
associate-*r*11.7%
Simplified11.7%
Taylor expanded in a around inf 10.5%
herbie shell --seed 2024113
(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)))