
(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 13 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}
a_m = (fabs.f64 a)
(FPCore (a_m b angle x-scale y-scale)
:precision binary64
(let* ((t_0 (* 0.005555555555555556 (* angle PI)))
(t_1 (cos t_0))
(t_2 (pow (cbrt (* PI (* 0.005555555555555556 angle))) 3.0))
(t_3 (sin t_2)))
(if (<= a_m 3.6e-50)
(* 180.0 (/ (atan (* y-scale (/ t_1 (* (sin t_0) (- x-scale))))) PI))
(if (<= a_m 2.3e+181)
(* 180.0 (/ (atan (* (/ y-scale x-scale) (/ t_3 t_1))) PI))
(* 180.0 (/ (atan (* (/ y-scale x-scale) (/ t_3 (cos t_2)))) PI))))))a_m = fabs(a);
double code(double a_m, double b, double angle, double x_45_scale, double y_45_scale) {
double t_0 = 0.005555555555555556 * (angle * ((double) M_PI));
double t_1 = cos(t_0);
double t_2 = pow(cbrt((((double) M_PI) * (0.005555555555555556 * angle))), 3.0);
double t_3 = sin(t_2);
double tmp;
if (a_m <= 3.6e-50) {
tmp = 180.0 * (atan((y_45_scale * (t_1 / (sin(t_0) * -x_45_scale)))) / ((double) M_PI));
} else if (a_m <= 2.3e+181) {
tmp = 180.0 * (atan(((y_45_scale / x_45_scale) * (t_3 / t_1))) / ((double) M_PI));
} else {
tmp = 180.0 * (atan(((y_45_scale / x_45_scale) * (t_3 / cos(t_2)))) / ((double) M_PI));
}
return tmp;
}
a_m = Math.abs(a);
public static double code(double a_m, double b, double angle, double x_45_scale, double y_45_scale) {
double t_0 = 0.005555555555555556 * (angle * Math.PI);
double t_1 = Math.cos(t_0);
double t_2 = Math.pow(Math.cbrt((Math.PI * (0.005555555555555556 * angle))), 3.0);
double t_3 = Math.sin(t_2);
double tmp;
if (a_m <= 3.6e-50) {
tmp = 180.0 * (Math.atan((y_45_scale * (t_1 / (Math.sin(t_0) * -x_45_scale)))) / Math.PI);
} else if (a_m <= 2.3e+181) {
tmp = 180.0 * (Math.atan(((y_45_scale / x_45_scale) * (t_3 / t_1))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(((y_45_scale / x_45_scale) * (t_3 / Math.cos(t_2)))) / Math.PI);
}
return tmp;
}
a_m = abs(a) function code(a_m, b, angle, x_45_scale, y_45_scale) t_0 = Float64(0.005555555555555556 * Float64(angle * pi)) t_1 = cos(t_0) t_2 = cbrt(Float64(pi * Float64(0.005555555555555556 * angle))) ^ 3.0 t_3 = sin(t_2) tmp = 0.0 if (a_m <= 3.6e-50) tmp = Float64(180.0 * Float64(atan(Float64(y_45_scale * Float64(t_1 / Float64(sin(t_0) * Float64(-x_45_scale))))) / pi)); elseif (a_m <= 2.3e+181) tmp = Float64(180.0 * Float64(atan(Float64(Float64(y_45_scale / x_45_scale) * Float64(t_3 / t_1))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(y_45_scale / x_45_scale) * Float64(t_3 / cos(t_2)))) / pi)); end return tmp end
a_m = N[Abs[a], $MachinePrecision]
code[a$95$m_, b_, angle_, x$45$scale_, y$45$scale_] := Block[{t$95$0 = N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Cos[t$95$0], $MachinePrecision]}, Block[{t$95$2 = N[Power[N[Power[N[(Pi * N[(0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]}, Block[{t$95$3 = N[Sin[t$95$2], $MachinePrecision]}, If[LessEqual[a$95$m, 3.6e-50], N[(180.0 * N[(N[ArcTan[N[(y$45$scale * N[(t$95$1 / N[(N[Sin[t$95$0], $MachinePrecision] * (-x$45$scale)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[a$95$m, 2.3e+181], N[(180.0 * N[(N[ArcTan[N[(N[(y$45$scale / x$45$scale), $MachinePrecision] * N[(t$95$3 / t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(y$45$scale / x$45$scale), $MachinePrecision] * N[(t$95$3 / N[Cos[t$95$2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
a_m = \left|a\right|
\\
\begin{array}{l}
t_0 := 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\\
t_1 := \cos t\_0\\
t_2 := {\left(\sqrt[3]{\pi \cdot \left(0.005555555555555556 \cdot angle\right)}\right)}^{3}\\
t_3 := \sin t\_2\\
\mathbf{if}\;a\_m \leq 3.6 \cdot 10^{-50}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(y-scale \cdot \frac{t\_1}{\sin t\_0 \cdot \left(-x-scale\right)}\right)}{\pi}\\
\mathbf{elif}\;a\_m \leq 2.3 \cdot 10^{+181}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{y-scale}{x-scale} \cdot \frac{t\_3}{t\_1}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{y-scale}{x-scale} \cdot \frac{t\_3}{\cos t\_2}\right)}{\pi}\\
\end{array}
\end{array}
if a < 3.59999999999999979e-50Initial program 19.4%
Simplified19.3%
Taylor expanded in x-scale around 0 34.6%
Simplified38.7%
times-frac38.9%
associate-*l*38.9%
Applied egg-rr38.9%
Taylor expanded in a around 0 51.5%
mul-1-neg51.5%
associate-/l*51.5%
*-commutative51.5%
Simplified51.5%
if 3.59999999999999979e-50 < a < 2.2999999999999999e181Initial program 8.8%
Simplified7.0%
Taylor expanded in x-scale around 0 29.0%
Simplified33.9%
Taylor expanded in a around inf 49.7%
times-frac49.7%
Simplified49.7%
add-cube-cbrt52.3%
pow356.3%
associate-*r*56.6%
Applied egg-rr56.6%
if 2.2999999999999999e181 < a Initial program 0.0%
Simplified0.0%
Taylor expanded in x-scale around 0 0.0%
Simplified12.9%
Taylor expanded in a around inf 68.4%
times-frac73.9%
Simplified73.9%
add-cube-cbrt74.4%
pow373.9%
associate-*r*71.1%
Applied egg-rr71.1%
add-cube-cbrt74.4%
pow373.9%
associate-*r*71.1%
Applied egg-rr79.6%
Final simplification56.2%
a_m = (fabs.f64 a)
(FPCore (a_m b angle x-scale y-scale)
:precision binary64
(let* ((t_0 (* 0.005555555555555556 (* angle PI))) (t_1 (cos t_0)))
(if (<= a_m 1.12e-51)
(* 180.0 (/ (atan (* y-scale (/ t_1 (* (sin t_0) (- x-scale))))) PI))
(*
180.0
(/
(atan
(*
(/ y-scale x-scale)
(/ (sin (pow (cbrt (* PI (* 0.005555555555555556 angle))) 3.0)) t_1)))
PI)))))a_m = fabs(a);
double code(double a_m, double b, double angle, double x_45_scale, double y_45_scale) {
double t_0 = 0.005555555555555556 * (angle * ((double) M_PI));
double t_1 = cos(t_0);
double tmp;
if (a_m <= 1.12e-51) {
tmp = 180.0 * (atan((y_45_scale * (t_1 / (sin(t_0) * -x_45_scale)))) / ((double) M_PI));
} else {
tmp = 180.0 * (atan(((y_45_scale / x_45_scale) * (sin(pow(cbrt((((double) M_PI) * (0.005555555555555556 * angle))), 3.0)) / t_1))) / ((double) M_PI));
}
return tmp;
}
a_m = Math.abs(a);
public static double code(double a_m, double b, double angle, double x_45_scale, double y_45_scale) {
double t_0 = 0.005555555555555556 * (angle * Math.PI);
double t_1 = Math.cos(t_0);
double tmp;
if (a_m <= 1.12e-51) {
tmp = 180.0 * (Math.atan((y_45_scale * (t_1 / (Math.sin(t_0) * -x_45_scale)))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(((y_45_scale / x_45_scale) * (Math.sin(Math.pow(Math.cbrt((Math.PI * (0.005555555555555556 * angle))), 3.0)) / t_1))) / Math.PI);
}
return tmp;
}
a_m = abs(a) function code(a_m, b, angle, x_45_scale, y_45_scale) t_0 = Float64(0.005555555555555556 * Float64(angle * pi)) t_1 = cos(t_0) tmp = 0.0 if (a_m <= 1.12e-51) tmp = Float64(180.0 * Float64(atan(Float64(y_45_scale * Float64(t_1 / Float64(sin(t_0) * Float64(-x_45_scale))))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(y_45_scale / x_45_scale) * Float64(sin((cbrt(Float64(pi * Float64(0.005555555555555556 * angle))) ^ 3.0)) / t_1))) / pi)); end return tmp end
a_m = N[Abs[a], $MachinePrecision]
code[a$95$m_, b_, angle_, x$45$scale_, y$45$scale_] := Block[{t$95$0 = N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Cos[t$95$0], $MachinePrecision]}, If[LessEqual[a$95$m, 1.12e-51], N[(180.0 * N[(N[ArcTan[N[(y$45$scale * N[(t$95$1 / N[(N[Sin[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 / x$45$scale), $MachinePrecision] * N[(N[Sin[N[Power[N[Power[N[(Pi * N[(0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
a_m = \left|a\right|
\\
\begin{array}{l}
t_0 := 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\\
t_1 := \cos t\_0\\
\mathbf{if}\;a\_m \leq 1.12 \cdot 10^{-51}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(y-scale \cdot \frac{t\_1}{\sin t\_0 \cdot \left(-x-scale\right)}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{y-scale}{x-scale} \cdot \frac{\sin \left({\left(\sqrt[3]{\pi \cdot \left(0.005555555555555556 \cdot angle\right)}\right)}^{3}\right)}{t\_1}\right)}{\pi}\\
\end{array}
\end{array}
if a < 1.11999999999999998e-51Initial program 19.4%
Simplified19.3%
Taylor expanded in x-scale around 0 34.6%
Simplified38.7%
times-frac38.9%
associate-*l*38.9%
Applied egg-rr38.9%
Taylor expanded in a around 0 51.5%
mul-1-neg51.5%
associate-/l*51.5%
*-commutative51.5%
Simplified51.5%
if 1.11999999999999998e-51 < a Initial program 5.1%
Simplified4.1%
Taylor expanded in x-scale around 0 16.8%
Simplified25.1%
Taylor expanded in a around inf 57.6%
times-frac59.8%
Simplified59.8%
add-cube-cbrt61.6%
pow363.7%
associate-*r*62.7%
Applied egg-rr62.7%
Final simplification55.0%
a_m = (fabs.f64 a)
(FPCore (a_m b angle x-scale y-scale)
:precision binary64
(let* ((t_0 (* 0.005555555555555556 (* angle PI)))
(t_1 (cos t_0))
(t_2 (sin t_0)))
(if (<= a_m 2.3e-57)
(* 180.0 (/ (atan (* y-scale (/ t_1 (* t_2 (- x-scale))))) PI))
(* 180.0 (/ (atan (* (/ y-scale x-scale) (/ t_2 t_1))) PI)))))a_m = fabs(a);
double code(double a_m, double b, double angle, double x_45_scale, double y_45_scale) {
double t_0 = 0.005555555555555556 * (angle * ((double) M_PI));
double t_1 = cos(t_0);
double t_2 = sin(t_0);
double tmp;
if (a_m <= 2.3e-57) {
tmp = 180.0 * (atan((y_45_scale * (t_1 / (t_2 * -x_45_scale)))) / ((double) M_PI));
} else {
tmp = 180.0 * (atan(((y_45_scale / x_45_scale) * (t_2 / t_1))) / ((double) M_PI));
}
return tmp;
}
a_m = Math.abs(a);
public static double code(double a_m, double b, double angle, double x_45_scale, double y_45_scale) {
double t_0 = 0.005555555555555556 * (angle * Math.PI);
double t_1 = Math.cos(t_0);
double t_2 = Math.sin(t_0);
double tmp;
if (a_m <= 2.3e-57) {
tmp = 180.0 * (Math.atan((y_45_scale * (t_1 / (t_2 * -x_45_scale)))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(((y_45_scale / x_45_scale) * (t_2 / t_1))) / Math.PI);
}
return tmp;
}
a_m = math.fabs(a) def code(a_m, b, angle, x_45_scale, y_45_scale): t_0 = 0.005555555555555556 * (angle * math.pi) t_1 = math.cos(t_0) t_2 = math.sin(t_0) tmp = 0 if a_m <= 2.3e-57: tmp = 180.0 * (math.atan((y_45_scale * (t_1 / (t_2 * -x_45_scale)))) / math.pi) else: tmp = 180.0 * (math.atan(((y_45_scale / x_45_scale) * (t_2 / t_1))) / math.pi) return tmp
a_m = abs(a) function code(a_m, b, angle, x_45_scale, y_45_scale) t_0 = Float64(0.005555555555555556 * Float64(angle * pi)) t_1 = cos(t_0) t_2 = sin(t_0) tmp = 0.0 if (a_m <= 2.3e-57) tmp = Float64(180.0 * Float64(atan(Float64(y_45_scale * Float64(t_1 / Float64(t_2 * Float64(-x_45_scale))))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(y_45_scale / x_45_scale) * Float64(t_2 / t_1))) / pi)); end return tmp end
a_m = abs(a); function tmp_2 = code(a_m, b, angle, x_45_scale, y_45_scale) t_0 = 0.005555555555555556 * (angle * pi); t_1 = cos(t_0); t_2 = sin(t_0); tmp = 0.0; if (a_m <= 2.3e-57) tmp = 180.0 * (atan((y_45_scale * (t_1 / (t_2 * -x_45_scale)))) / pi); else tmp = 180.0 * (atan(((y_45_scale / x_45_scale) * (t_2 / t_1))) / pi); end tmp_2 = tmp; end
a_m = N[Abs[a], $MachinePrecision]
code[a$95$m_, b_, angle_, x$45$scale_, y$45$scale_] := Block[{t$95$0 = N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Cos[t$95$0], $MachinePrecision]}, Block[{t$95$2 = N[Sin[t$95$0], $MachinePrecision]}, If[LessEqual[a$95$m, 2.3e-57], N[(180.0 * N[(N[ArcTan[N[(y$45$scale * N[(t$95$1 / N[(t$95$2 * (-x$45$scale)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(y$45$scale / x$45$scale), $MachinePrecision] * N[(t$95$2 / t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
a_m = \left|a\right|
\\
\begin{array}{l}
t_0 := 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\\
t_1 := \cos t\_0\\
t_2 := \sin t\_0\\
\mathbf{if}\;a\_m \leq 2.3 \cdot 10^{-57}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(y-scale \cdot \frac{t\_1}{t\_2 \cdot \left(-x-scale\right)}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{y-scale}{x-scale} \cdot \frac{t\_2}{t\_1}\right)}{\pi}\\
\end{array}
\end{array}
if a < 2.3e-57Initial program 19.4%
Simplified19.3%
Taylor expanded in x-scale around 0 34.6%
Simplified38.7%
times-frac38.9%
associate-*l*38.9%
Applied egg-rr38.9%
Taylor expanded in a around 0 51.5%
mul-1-neg51.5%
associate-/l*51.5%
*-commutative51.5%
Simplified51.5%
if 2.3e-57 < a Initial program 5.1%
Simplified4.1%
Taylor expanded in x-scale around 0 16.8%
Simplified25.1%
Taylor expanded in a around inf 57.6%
times-frac59.8%
Simplified59.8%
Final simplification54.2%
a_m = (fabs.f64 a)
(FPCore (a_m b angle x-scale y-scale)
:precision binary64
(let* ((t_0 (* 0.005555555555555556 (* angle PI))))
(if (<= a_m 1.22e-57)
(/ (* 180.0 (atan (/ -180.0 (/ (* PI (* angle x-scale)) y-scale)))) PI)
(* 180.0 (/ (atan (* (/ y-scale x-scale) (/ (sin t_0) (cos t_0)))) PI)))))a_m = fabs(a);
double code(double a_m, double b, double angle, double x_45_scale, double y_45_scale) {
double t_0 = 0.005555555555555556 * (angle * ((double) M_PI));
double tmp;
if (a_m <= 1.22e-57) {
tmp = (180.0 * atan((-180.0 / ((((double) M_PI) * (angle * x_45_scale)) / y_45_scale)))) / ((double) M_PI);
} else {
tmp = 180.0 * (atan(((y_45_scale / x_45_scale) * (sin(t_0) / cos(t_0)))) / ((double) M_PI));
}
return tmp;
}
a_m = Math.abs(a);
public static double code(double a_m, double b, double angle, double x_45_scale, double y_45_scale) {
double t_0 = 0.005555555555555556 * (angle * Math.PI);
double tmp;
if (a_m <= 1.22e-57) {
tmp = (180.0 * Math.atan((-180.0 / ((Math.PI * (angle * x_45_scale)) / y_45_scale)))) / Math.PI;
} else {
tmp = 180.0 * (Math.atan(((y_45_scale / x_45_scale) * (Math.sin(t_0) / Math.cos(t_0)))) / Math.PI);
}
return tmp;
}
a_m = math.fabs(a) def code(a_m, b, angle, x_45_scale, y_45_scale): t_0 = 0.005555555555555556 * (angle * math.pi) tmp = 0 if a_m <= 1.22e-57: tmp = (180.0 * math.atan((-180.0 / ((math.pi * (angle * x_45_scale)) / y_45_scale)))) / math.pi else: tmp = 180.0 * (math.atan(((y_45_scale / x_45_scale) * (math.sin(t_0) / math.cos(t_0)))) / math.pi) return tmp
a_m = abs(a) function code(a_m, b, angle, x_45_scale, y_45_scale) t_0 = Float64(0.005555555555555556 * Float64(angle * pi)) tmp = 0.0 if (a_m <= 1.22e-57) tmp = Float64(Float64(180.0 * atan(Float64(-180.0 / Float64(Float64(pi * Float64(angle * x_45_scale)) / y_45_scale)))) / pi); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(y_45_scale / x_45_scale) * Float64(sin(t_0) / cos(t_0)))) / pi)); end return tmp end
a_m = abs(a); function tmp_2 = code(a_m, b, angle, x_45_scale, y_45_scale) t_0 = 0.005555555555555556 * (angle * pi); tmp = 0.0; if (a_m <= 1.22e-57) tmp = (180.0 * atan((-180.0 / ((pi * (angle * x_45_scale)) / y_45_scale)))) / pi; else tmp = 180.0 * (atan(((y_45_scale / x_45_scale) * (sin(t_0) / cos(t_0)))) / pi); end tmp_2 = tmp; end
a_m = N[Abs[a], $MachinePrecision]
code[a$95$m_, b_, angle_, x$45$scale_, y$45$scale_] := Block[{t$95$0 = N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a$95$m, 1.22e-57], N[(N[(180.0 * N[ArcTan[N[(-180.0 / N[(N[(Pi * N[(angle * x$45$scale), $MachinePrecision]), $MachinePrecision] / y$45$scale), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(y$45$scale / x$45$scale), $MachinePrecision] * N[(N[Sin[t$95$0], $MachinePrecision] / N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
a_m = \left|a\right|
\\
\begin{array}{l}
t_0 := 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\\
\mathbf{if}\;a\_m \leq 1.22 \cdot 10^{-57}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{-180}{\frac{\pi \cdot \left(angle \cdot x-scale\right)}{y-scale}}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{y-scale}{x-scale} \cdot \frac{\sin t\_0}{\cos t\_0}\right)}{\pi}\\
\end{array}
\end{array}
if a < 1.2200000000000001e-57Initial program 19.4%
Simplified19.3%
Taylor expanded in angle around 0 14.5%
associate-*r/14.5%
associate-*r*13.9%
distribute-lft-out--13.9%
associate-*r*13.9%
Simplified13.9%
Taylor expanded in a around 0 47.8%
associate-*r/47.8%
clear-num47.8%
un-div-inv47.8%
associate-*r*47.8%
Applied egg-rr47.8%
if 1.2200000000000001e-57 < a Initial program 5.1%
Simplified4.1%
Taylor expanded in x-scale around 0 16.8%
Simplified25.1%
Taylor expanded in a around inf 57.6%
times-frac59.8%
Simplified59.8%
Final simplification51.6%
a_m = (fabs.f64 a)
(FPCore (a_m b angle x-scale y-scale)
:precision binary64
(if (<= a_m 6.2e-56)
(/ (* 180.0 (atan (/ -180.0 (/ (* PI (* angle x-scale)) y-scale)))) PI)
(*
(/ 1.0 PI)
(*
180.0
(atan
(* (/ y-scale x-scale) (tan (* angle (* 0.005555555555555556 PI)))))))))a_m = fabs(a);
double code(double a_m, double b, double angle, double x_45_scale, double y_45_scale) {
double tmp;
if (a_m <= 6.2e-56) {
tmp = (180.0 * atan((-180.0 / ((((double) M_PI) * (angle * x_45_scale)) / y_45_scale)))) / ((double) M_PI);
} else {
tmp = (1.0 / ((double) M_PI)) * (180.0 * atan(((y_45_scale / x_45_scale) * tan((angle * (0.005555555555555556 * ((double) M_PI)))))));
}
return tmp;
}
a_m = Math.abs(a);
public static double code(double a_m, double b, double angle, double x_45_scale, double y_45_scale) {
double tmp;
if (a_m <= 6.2e-56) {
tmp = (180.0 * Math.atan((-180.0 / ((Math.PI * (angle * x_45_scale)) / y_45_scale)))) / Math.PI;
} else {
tmp = (1.0 / Math.PI) * (180.0 * Math.atan(((y_45_scale / x_45_scale) * Math.tan((angle * (0.005555555555555556 * Math.PI))))));
}
return tmp;
}
a_m = math.fabs(a) def code(a_m, b, angle, x_45_scale, y_45_scale): tmp = 0 if a_m <= 6.2e-56: tmp = (180.0 * math.atan((-180.0 / ((math.pi * (angle * x_45_scale)) / y_45_scale)))) / math.pi else: tmp = (1.0 / math.pi) * (180.0 * math.atan(((y_45_scale / x_45_scale) * math.tan((angle * (0.005555555555555556 * math.pi)))))) return tmp
a_m = abs(a) function code(a_m, b, angle, x_45_scale, y_45_scale) tmp = 0.0 if (a_m <= 6.2e-56) tmp = Float64(Float64(180.0 * atan(Float64(-180.0 / Float64(Float64(pi * Float64(angle * x_45_scale)) / y_45_scale)))) / pi); else tmp = Float64(Float64(1.0 / pi) * Float64(180.0 * atan(Float64(Float64(y_45_scale / x_45_scale) * tan(Float64(angle * Float64(0.005555555555555556 * pi))))))); end return tmp end
a_m = abs(a); function tmp_2 = code(a_m, b, angle, x_45_scale, y_45_scale) tmp = 0.0; if (a_m <= 6.2e-56) tmp = (180.0 * atan((-180.0 / ((pi * (angle * x_45_scale)) / y_45_scale)))) / pi; else tmp = (1.0 / pi) * (180.0 * atan(((y_45_scale / x_45_scale) * tan((angle * (0.005555555555555556 * pi)))))); end tmp_2 = tmp; end
a_m = N[Abs[a], $MachinePrecision] code[a$95$m_, b_, angle_, x$45$scale_, y$45$scale_] := If[LessEqual[a$95$m, 6.2e-56], N[(N[(180.0 * N[ArcTan[N[(-180.0 / N[(N[(Pi * N[(angle * x$45$scale), $MachinePrecision]), $MachinePrecision] / y$45$scale), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], N[(N[(1.0 / Pi), $MachinePrecision] * N[(180.0 * N[ArcTan[N[(N[(y$45$scale / x$45$scale), $MachinePrecision] * N[Tan[N[(angle * N[(0.005555555555555556 * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
a_m = \left|a\right|
\\
\begin{array}{l}
\mathbf{if}\;a\_m \leq 6.2 \cdot 10^{-56}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{-180}{\frac{\pi \cdot \left(angle \cdot x-scale\right)}{y-scale}}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\pi} \cdot \left(180 \cdot \tan^{-1} \left(\frac{y-scale}{x-scale} \cdot \tan \left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right)\right)\right)\\
\end{array}
\end{array}
if a < 6.19999999999999975e-56Initial program 19.4%
Simplified19.3%
Taylor expanded in angle around 0 14.5%
associate-*r/14.5%
associate-*r*13.9%
distribute-lft-out--13.9%
associate-*r*13.9%
Simplified13.9%
Taylor expanded in a around 0 47.8%
associate-*r/47.8%
clear-num47.8%
un-div-inv47.8%
associate-*r*47.8%
Applied egg-rr47.8%
if 6.19999999999999975e-56 < a Initial program 5.1%
Simplified4.1%
Taylor expanded in x-scale around 0 16.8%
Simplified25.1%
Taylor expanded in a around inf 57.6%
times-frac59.8%
Simplified59.8%
add-cube-cbrt61.6%
pow363.7%
associate-*r*62.7%
Applied egg-rr62.7%
associate-*r/62.7%
associate-*r/62.7%
rem-cube-cbrt61.1%
associate-*r*59.9%
*-commutative59.9%
clear-num59.8%
Applied egg-rr61.0%
associate-/r/61.1%
*-commutative61.1%
associate-*r/58.8%
associate-*r*57.6%
*-commutative57.6%
*-commutative57.6%
associate-*r*58.8%
associate-*r/61.1%
*-commutative61.1%
associate-*r*59.9%
*-commutative59.9%
associate-*r*59.3%
Simplified59.3%
Final simplification51.4%
a_m = (fabs.f64 a)
(FPCore (a_m b angle x-scale y-scale)
:precision binary64
(if (<= a_m 2.6e-57)
(/ (* 180.0 (atan (/ -180.0 (/ (* PI (* angle x-scale)) y-scale)))) PI)
(*
(atan (* (/ y-scale x-scale) (tan (* angle (* 0.005555555555555556 PI)))))
(/ 180.0 PI))))a_m = fabs(a);
double code(double a_m, double b, double angle, double x_45_scale, double y_45_scale) {
double tmp;
if (a_m <= 2.6e-57) {
tmp = (180.0 * atan((-180.0 / ((((double) M_PI) * (angle * x_45_scale)) / y_45_scale)))) / ((double) M_PI);
} else {
tmp = atan(((y_45_scale / x_45_scale) * tan((angle * (0.005555555555555556 * ((double) M_PI)))))) * (180.0 / ((double) M_PI));
}
return tmp;
}
a_m = Math.abs(a);
public static double code(double a_m, double b, double angle, double x_45_scale, double y_45_scale) {
double tmp;
if (a_m <= 2.6e-57) {
tmp = (180.0 * Math.atan((-180.0 / ((Math.PI * (angle * x_45_scale)) / y_45_scale)))) / Math.PI;
} else {
tmp = Math.atan(((y_45_scale / x_45_scale) * Math.tan((angle * (0.005555555555555556 * Math.PI))))) * (180.0 / Math.PI);
}
return tmp;
}
a_m = math.fabs(a) def code(a_m, b, angle, x_45_scale, y_45_scale): tmp = 0 if a_m <= 2.6e-57: tmp = (180.0 * math.atan((-180.0 / ((math.pi * (angle * x_45_scale)) / y_45_scale)))) / math.pi else: tmp = math.atan(((y_45_scale / x_45_scale) * math.tan((angle * (0.005555555555555556 * math.pi))))) * (180.0 / math.pi) return tmp
a_m = abs(a) function code(a_m, b, angle, x_45_scale, y_45_scale) tmp = 0.0 if (a_m <= 2.6e-57) tmp = Float64(Float64(180.0 * atan(Float64(-180.0 / Float64(Float64(pi * Float64(angle * x_45_scale)) / y_45_scale)))) / pi); else tmp = Float64(atan(Float64(Float64(y_45_scale / x_45_scale) * tan(Float64(angle * Float64(0.005555555555555556 * pi))))) * Float64(180.0 / pi)); end return tmp end
a_m = abs(a); function tmp_2 = code(a_m, b, angle, x_45_scale, y_45_scale) tmp = 0.0; if (a_m <= 2.6e-57) tmp = (180.0 * atan((-180.0 / ((pi * (angle * x_45_scale)) / y_45_scale)))) / pi; else tmp = atan(((y_45_scale / x_45_scale) * tan((angle * (0.005555555555555556 * pi))))) * (180.0 / pi); end tmp_2 = tmp; end
a_m = N[Abs[a], $MachinePrecision] code[a$95$m_, b_, angle_, x$45$scale_, y$45$scale_] := If[LessEqual[a$95$m, 2.6e-57], N[(N[(180.0 * N[ArcTan[N[(-180.0 / N[(N[(Pi * N[(angle * x$45$scale), $MachinePrecision]), $MachinePrecision] / y$45$scale), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], N[(N[ArcTan[N[(N[(y$45$scale / x$45$scale), $MachinePrecision] * N[Tan[N[(angle * N[(0.005555555555555556 * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(180.0 / Pi), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
a_m = \left|a\right|
\\
\begin{array}{l}
\mathbf{if}\;a\_m \leq 2.6 \cdot 10^{-57}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{-180}{\frac{\pi \cdot \left(angle \cdot x-scale\right)}{y-scale}}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\tan^{-1} \left(\frac{y-scale}{x-scale} \cdot \tan \left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right)\right) \cdot \frac{180}{\pi}\\
\end{array}
\end{array}
if a < 2.59999999999999985e-57Initial program 19.4%
Simplified19.3%
Taylor expanded in angle around 0 14.5%
associate-*r/14.5%
associate-*r*13.9%
distribute-lft-out--13.9%
associate-*r*13.9%
Simplified13.9%
Taylor expanded in a around 0 47.8%
associate-*r/47.8%
clear-num47.8%
un-div-inv47.8%
associate-*r*47.8%
Applied egg-rr47.8%
if 2.59999999999999985e-57 < a Initial program 5.1%
Simplified4.1%
Taylor expanded in x-scale around 0 16.8%
Simplified25.1%
Taylor expanded in a around inf 57.6%
times-frac59.8%
Simplified59.8%
add-cube-cbrt59.4%
pow359.3%
quot-tan59.3%
associate-*r*60.5%
Applied egg-rr60.5%
Taylor expanded in y-scale around 0 57.6%
*-commutative57.6%
associate-*r*58.8%
associate-*r/61.0%
*-commutative61.0%
metadata-eval61.0%
times-frac61.1%
*-commutative61.1%
times-frac61.0%
Simplified59.3%
Final simplification51.4%
a_m = (fabs.f64 a)
(FPCore (a_m b angle x-scale y-scale)
:precision binary64
(if (<= a_m 1.25e-57)
(/ (* 180.0 (atan (/ -180.0 (/ (* PI (* angle x-scale)) y-scale)))) PI)
(*
180.0
(/
(atan (* (/ y-scale x-scale) (tan (* angle (* 0.005555555555555556 PI)))))
PI))))a_m = fabs(a);
double code(double a_m, double b, double angle, double x_45_scale, double y_45_scale) {
double tmp;
if (a_m <= 1.25e-57) {
tmp = (180.0 * atan((-180.0 / ((((double) M_PI) * (angle * x_45_scale)) / y_45_scale)))) / ((double) M_PI);
} else {
tmp = 180.0 * (atan(((y_45_scale / x_45_scale) * tan((angle * (0.005555555555555556 * ((double) M_PI)))))) / ((double) M_PI));
}
return tmp;
}
a_m = Math.abs(a);
public static double code(double a_m, double b, double angle, double x_45_scale, double y_45_scale) {
double tmp;
if (a_m <= 1.25e-57) {
tmp = (180.0 * Math.atan((-180.0 / ((Math.PI * (angle * x_45_scale)) / y_45_scale)))) / Math.PI;
} else {
tmp = 180.0 * (Math.atan(((y_45_scale / x_45_scale) * Math.tan((angle * (0.005555555555555556 * Math.PI))))) / Math.PI);
}
return tmp;
}
a_m = math.fabs(a) def code(a_m, b, angle, x_45_scale, y_45_scale): tmp = 0 if a_m <= 1.25e-57: tmp = (180.0 * math.atan((-180.0 / ((math.pi * (angle * x_45_scale)) / y_45_scale)))) / math.pi else: tmp = 180.0 * (math.atan(((y_45_scale / x_45_scale) * math.tan((angle * (0.005555555555555556 * math.pi))))) / math.pi) return tmp
a_m = abs(a) function code(a_m, b, angle, x_45_scale, y_45_scale) tmp = 0.0 if (a_m <= 1.25e-57) tmp = Float64(Float64(180.0 * atan(Float64(-180.0 / Float64(Float64(pi * Float64(angle * x_45_scale)) / y_45_scale)))) / pi); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(y_45_scale / x_45_scale) * tan(Float64(angle * Float64(0.005555555555555556 * pi))))) / pi)); end return tmp end
a_m = abs(a); function tmp_2 = code(a_m, b, angle, x_45_scale, y_45_scale) tmp = 0.0; if (a_m <= 1.25e-57) tmp = (180.0 * atan((-180.0 / ((pi * (angle * x_45_scale)) / y_45_scale)))) / pi; else tmp = 180.0 * (atan(((y_45_scale / x_45_scale) * tan((angle * (0.005555555555555556 * pi))))) / pi); end tmp_2 = tmp; end
a_m = N[Abs[a], $MachinePrecision] code[a$95$m_, b_, angle_, x$45$scale_, y$45$scale_] := If[LessEqual[a$95$m, 1.25e-57], N[(N[(180.0 * N[ArcTan[N[(-180.0 / N[(N[(Pi * N[(angle * x$45$scale), $MachinePrecision]), $MachinePrecision] / y$45$scale), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(y$45$scale / x$45$scale), $MachinePrecision] * N[Tan[N[(angle * N[(0.005555555555555556 * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
a_m = \left|a\right|
\\
\begin{array}{l}
\mathbf{if}\;a\_m \leq 1.25 \cdot 10^{-57}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{-180}{\frac{\pi \cdot \left(angle \cdot x-scale\right)}{y-scale}}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{y-scale}{x-scale} \cdot \tan \left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right)\right)}{\pi}\\
\end{array}
\end{array}
if a < 1.25e-57Initial program 19.4%
Simplified19.3%
Taylor expanded in angle around 0 14.5%
associate-*r/14.5%
associate-*r*13.9%
distribute-lft-out--13.9%
associate-*r*13.9%
Simplified13.9%
Taylor expanded in a around 0 47.8%
associate-*r/47.8%
clear-num47.8%
un-div-inv47.8%
associate-*r*47.8%
Applied egg-rr47.8%
if 1.25e-57 < a Initial program 5.1%
Simplified4.1%
Taylor expanded in x-scale around 0 16.8%
Simplified25.1%
Taylor expanded in a around inf 57.6%
times-frac59.8%
Simplified59.8%
add-cube-cbrt59.4%
pow359.3%
quot-tan59.3%
associate-*r*60.5%
Applied egg-rr60.5%
Taylor expanded in y-scale around 0 57.6%
*-commutative57.6%
associate-*r*58.8%
associate-*r/61.0%
*-commutative61.0%
associate-*r*59.8%
*-commutative59.8%
associate-*r*59.3%
Simplified59.3%
Final simplification51.4%
a_m = (fabs.f64 a)
(FPCore (a_m b angle x-scale y-scale)
:precision binary64
(if (<= a_m 3.5e-51)
(/ (* 180.0 (atan (/ -180.0 (/ (* PI (* angle x-scale)) y-scale)))) PI)
(*
180.0
(/
(atan (* y-scale (/ (tan (* 0.005555555555555556 (* angle PI))) x-scale)))
PI))))a_m = fabs(a);
double code(double a_m, double b, double angle, double x_45_scale, double y_45_scale) {
double tmp;
if (a_m <= 3.5e-51) {
tmp = (180.0 * atan((-180.0 / ((((double) M_PI) * (angle * x_45_scale)) / y_45_scale)))) / ((double) M_PI);
} else {
tmp = 180.0 * (atan((y_45_scale * (tan((0.005555555555555556 * (angle * ((double) M_PI)))) / x_45_scale))) / ((double) M_PI));
}
return tmp;
}
a_m = Math.abs(a);
public static double code(double a_m, double b, double angle, double x_45_scale, double y_45_scale) {
double tmp;
if (a_m <= 3.5e-51) {
tmp = (180.0 * Math.atan((-180.0 / ((Math.PI * (angle * x_45_scale)) / y_45_scale)))) / Math.PI;
} else {
tmp = 180.0 * (Math.atan((y_45_scale * (Math.tan((0.005555555555555556 * (angle * Math.PI))) / x_45_scale))) / Math.PI);
}
return tmp;
}
a_m = math.fabs(a) def code(a_m, b, angle, x_45_scale, y_45_scale): tmp = 0 if a_m <= 3.5e-51: tmp = (180.0 * math.atan((-180.0 / ((math.pi * (angle * x_45_scale)) / y_45_scale)))) / math.pi else: tmp = 180.0 * (math.atan((y_45_scale * (math.tan((0.005555555555555556 * (angle * math.pi))) / x_45_scale))) / math.pi) return tmp
a_m = abs(a) function code(a_m, b, angle, x_45_scale, y_45_scale) tmp = 0.0 if (a_m <= 3.5e-51) tmp = Float64(Float64(180.0 * atan(Float64(-180.0 / Float64(Float64(pi * Float64(angle * x_45_scale)) / y_45_scale)))) / pi); else tmp = Float64(180.0 * Float64(atan(Float64(y_45_scale * Float64(tan(Float64(0.005555555555555556 * Float64(angle * pi))) / x_45_scale))) / pi)); end return tmp end
a_m = abs(a); function tmp_2 = code(a_m, b, angle, x_45_scale, y_45_scale) tmp = 0.0; if (a_m <= 3.5e-51) tmp = (180.0 * atan((-180.0 / ((pi * (angle * x_45_scale)) / y_45_scale)))) / pi; else tmp = 180.0 * (atan((y_45_scale * (tan((0.005555555555555556 * (angle * pi))) / x_45_scale))) / pi); end tmp_2 = tmp; end
a_m = N[Abs[a], $MachinePrecision] code[a$95$m_, b_, angle_, x$45$scale_, y$45$scale_] := If[LessEqual[a$95$m, 3.5e-51], N[(N[(180.0 * N[ArcTan[N[(-180.0 / N[(N[(Pi * N[(angle * x$45$scale), $MachinePrecision]), $MachinePrecision] / y$45$scale), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(y$45$scale * N[(N[Tan[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / x$45$scale), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
a_m = \left|a\right|
\\
\begin{array}{l}
\mathbf{if}\;a\_m \leq 3.5 \cdot 10^{-51}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{-180}{\frac{\pi \cdot \left(angle \cdot x-scale\right)}{y-scale}}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(y-scale \cdot \frac{\tan \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}{x-scale}\right)}{\pi}\\
\end{array}
\end{array}
if a < 3.4999999999999997e-51Initial program 19.4%
Simplified19.3%
Taylor expanded in angle around 0 14.5%
associate-*r/14.5%
associate-*r*13.9%
distribute-lft-out--13.9%
associate-*r*13.9%
Simplified13.9%
Taylor expanded in a around 0 47.8%
associate-*r/47.8%
clear-num47.8%
un-div-inv47.8%
associate-*r*47.8%
Applied egg-rr47.8%
if 3.4999999999999997e-51 < a Initial program 5.1%
Simplified4.1%
Taylor expanded in x-scale around 0 16.8%
Simplified25.1%
Taylor expanded in a around inf 57.6%
times-frac59.8%
Simplified59.8%
associate-*r/59.9%
quot-tan59.9%
associate-*r*61.1%
Applied egg-rr61.1%
associate-*r/61.0%
associate-*l/58.8%
associate-/l*57.7%
associate-*r*56.5%
Simplified56.5%
Final simplification50.5%
a_m = (fabs.f64 a)
(FPCore (a_m b angle x-scale y-scale)
:precision binary64
(if (<= b 3.2e+52)
(*
180.0
(/
(atan (* angle (* y-scale (/ (* 0.005555555555555556 PI) x-scale))))
PI))
(* 180.0 (/ (atan (/ (* y-scale -180.0) (* PI (* angle x-scale)))) PI))))a_m = fabs(a);
double code(double a_m, double b, double angle, double x_45_scale, double y_45_scale) {
double tmp;
if (b <= 3.2e+52) {
tmp = 180.0 * (atan((angle * (y_45_scale * ((0.005555555555555556 * ((double) M_PI)) / x_45_scale)))) / ((double) M_PI));
} else {
tmp = 180.0 * (atan(((y_45_scale * -180.0) / (((double) M_PI) * (angle * x_45_scale)))) / ((double) M_PI));
}
return tmp;
}
a_m = Math.abs(a);
public static double code(double a_m, double b, double angle, double x_45_scale, double y_45_scale) {
double tmp;
if (b <= 3.2e+52) {
tmp = 180.0 * (Math.atan((angle * (y_45_scale * ((0.005555555555555556 * Math.PI) / x_45_scale)))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(((y_45_scale * -180.0) / (Math.PI * (angle * x_45_scale)))) / Math.PI);
}
return tmp;
}
a_m = math.fabs(a) def code(a_m, b, angle, x_45_scale, y_45_scale): tmp = 0 if b <= 3.2e+52: tmp = 180.0 * (math.atan((angle * (y_45_scale * ((0.005555555555555556 * math.pi) / x_45_scale)))) / math.pi) else: tmp = 180.0 * (math.atan(((y_45_scale * -180.0) / (math.pi * (angle * x_45_scale)))) / math.pi) return tmp
a_m = abs(a) function code(a_m, b, angle, x_45_scale, y_45_scale) tmp = 0.0 if (b <= 3.2e+52) tmp = Float64(180.0 * Float64(atan(Float64(angle * Float64(y_45_scale * Float64(Float64(0.005555555555555556 * pi) / x_45_scale)))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(y_45_scale * -180.0) / Float64(pi * Float64(angle * x_45_scale)))) / pi)); end return tmp end
a_m = abs(a); function tmp_2 = code(a_m, b, angle, x_45_scale, y_45_scale) tmp = 0.0; if (b <= 3.2e+52) tmp = 180.0 * (atan((angle * (y_45_scale * ((0.005555555555555556 * pi) / x_45_scale)))) / pi); else tmp = 180.0 * (atan(((y_45_scale * -180.0) / (pi * (angle * x_45_scale)))) / pi); end tmp_2 = tmp; end
a_m = N[Abs[a], $MachinePrecision] code[a$95$m_, b_, angle_, x$45$scale_, y$45$scale_] := If[LessEqual[b, 3.2e+52], N[(180.0 * N[(N[ArcTan[N[(angle * N[(y$45$scale * N[(N[(0.005555555555555556 * Pi), $MachinePrecision] / x$45$scale), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(y$45$scale * -180.0), $MachinePrecision] / N[(Pi * N[(angle * x$45$scale), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
a_m = \left|a\right|
\\
\begin{array}{l}
\mathbf{if}\;b \leq 3.2 \cdot 10^{+52}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(angle \cdot \left(y-scale \cdot \frac{0.005555555555555556 \cdot \pi}{x-scale}\right)\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{y-scale \cdot -180}{\pi \cdot \left(angle \cdot x-scale\right)}\right)}{\pi}\\
\end{array}
\end{array}
if b < 3.2e52Initial program 18.1%
Simplified18.1%
Taylor expanded in x-scale around 0 31.5%
Simplified38.1%
Taylor expanded in a around inf 49.8%
times-frac52.9%
Simplified52.9%
add-cube-cbrt52.4%
pow354.2%
associate-*r*55.3%
Applied egg-rr55.3%
Taylor expanded in angle around 0 45.9%
associate-/l*53.7%
associate-/l*53.7%
rem-cube-cbrt53.9%
Simplified53.9%
if 3.2e52 < b Initial program 5.0%
Simplified3.3%
Taylor expanded in angle around 0 6.5%
associate-*r/6.5%
associate-*r*5.0%
distribute-lft-out--5.0%
associate-*r*5.0%
Simplified5.0%
Taylor expanded in a around 0 54.6%
associate-*r/54.6%
associate-*r*54.6%
Applied egg-rr54.6%
Final simplification54.1%
a_m = (fabs.f64 a)
(FPCore (a_m b angle x-scale y-scale)
:precision binary64
(if (<= b 3.1e+50)
(*
180.0
(/
(atan (* angle (* y-scale (/ (* 0.005555555555555556 PI) x-scale))))
PI))
(* 180.0 (/ (atan (* -180.0 (/ y-scale (* angle (* PI x-scale))))) PI))))a_m = fabs(a);
double code(double a_m, double b, double angle, double x_45_scale, double y_45_scale) {
double tmp;
if (b <= 3.1e+50) {
tmp = 180.0 * (atan((angle * (y_45_scale * ((0.005555555555555556 * ((double) M_PI)) / x_45_scale)))) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((-180.0 * (y_45_scale / (angle * (((double) M_PI) * x_45_scale))))) / ((double) M_PI));
}
return tmp;
}
a_m = Math.abs(a);
public static double code(double a_m, double b, double angle, double x_45_scale, double y_45_scale) {
double tmp;
if (b <= 3.1e+50) {
tmp = 180.0 * (Math.atan((angle * (y_45_scale * ((0.005555555555555556 * Math.PI) / x_45_scale)))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((-180.0 * (y_45_scale / (angle * (Math.PI * x_45_scale))))) / Math.PI);
}
return tmp;
}
a_m = math.fabs(a) def code(a_m, b, angle, x_45_scale, y_45_scale): tmp = 0 if b <= 3.1e+50: tmp = 180.0 * (math.atan((angle * (y_45_scale * ((0.005555555555555556 * math.pi) / x_45_scale)))) / math.pi) else: tmp = 180.0 * (math.atan((-180.0 * (y_45_scale / (angle * (math.pi * x_45_scale))))) / math.pi) return tmp
a_m = abs(a) function code(a_m, b, angle, x_45_scale, y_45_scale) tmp = 0.0 if (b <= 3.1e+50) tmp = Float64(180.0 * Float64(atan(Float64(angle * Float64(y_45_scale * Float64(Float64(0.005555555555555556 * pi) / x_45_scale)))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(-180.0 * Float64(y_45_scale / Float64(angle * Float64(pi * x_45_scale))))) / pi)); end return tmp end
a_m = abs(a); function tmp_2 = code(a_m, b, angle, x_45_scale, y_45_scale) tmp = 0.0; if (b <= 3.1e+50) tmp = 180.0 * (atan((angle * (y_45_scale * ((0.005555555555555556 * pi) / x_45_scale)))) / pi); else tmp = 180.0 * (atan((-180.0 * (y_45_scale / (angle * (pi * x_45_scale))))) / pi); end tmp_2 = tmp; end
a_m = N[Abs[a], $MachinePrecision] code[a$95$m_, b_, angle_, x$45$scale_, y$45$scale_] := If[LessEqual[b, 3.1e+50], N[(180.0 * N[(N[ArcTan[N[(angle * N[(y$45$scale * N[(N[(0.005555555555555556 * Pi), $MachinePrecision] / x$45$scale), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], 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}
a_m = \left|a\right|
\\
\begin{array}{l}
\mathbf{if}\;b \leq 3.1 \cdot 10^{+50}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(angle \cdot \left(y-scale \cdot \frac{0.005555555555555556 \cdot \pi}{x-scale}\right)\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-180 \cdot \frac{y-scale}{angle \cdot \left(\pi \cdot x-scale\right)}\right)}{\pi}\\
\end{array}
\end{array}
if b < 3.10000000000000003e50Initial program 18.1%
Simplified18.1%
Taylor expanded in x-scale around 0 31.5%
Simplified38.1%
Taylor expanded in a around inf 49.8%
times-frac52.9%
Simplified52.9%
add-cube-cbrt52.4%
pow354.2%
associate-*r*55.3%
Applied egg-rr55.3%
Taylor expanded in angle around 0 45.9%
associate-/l*53.7%
associate-/l*53.7%
rem-cube-cbrt53.9%
Simplified53.9%
if 3.10000000000000003e50 < b Initial program 5.0%
Simplified3.3%
Taylor expanded in angle around 0 6.5%
associate-*r/6.5%
associate-*r*5.0%
distribute-lft-out--5.0%
associate-*r*5.0%
Simplified5.0%
Taylor expanded in a around 0 54.6%
Final simplification54.1%
a_m = (fabs.f64 a)
(FPCore (a_m b angle x-scale y-scale)
:precision binary64
(if (<= b 8e+48)
(*
180.0
(/
(atan (* 0.005555555555555556 (* angle (/ (* y-scale PI) x-scale))))
PI))
(* 180.0 (/ (atan (* -180.0 (/ y-scale (* angle (* PI x-scale))))) PI))))a_m = fabs(a);
double code(double a_m, double b, double angle, double x_45_scale, double y_45_scale) {
double tmp;
if (b <= 8e+48) {
tmp = 180.0 * (atan((0.005555555555555556 * (angle * ((y_45_scale * ((double) M_PI)) / x_45_scale)))) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((-180.0 * (y_45_scale / (angle * (((double) M_PI) * x_45_scale))))) / ((double) M_PI));
}
return tmp;
}
a_m = Math.abs(a);
public static double code(double a_m, double b, double angle, double x_45_scale, double y_45_scale) {
double tmp;
if (b <= 8e+48) {
tmp = 180.0 * (Math.atan((0.005555555555555556 * (angle * ((y_45_scale * Math.PI) / x_45_scale)))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((-180.0 * (y_45_scale / (angle * (Math.PI * x_45_scale))))) / Math.PI);
}
return tmp;
}
a_m = math.fabs(a) def code(a_m, b, angle, x_45_scale, y_45_scale): tmp = 0 if b <= 8e+48: tmp = 180.0 * (math.atan((0.005555555555555556 * (angle * ((y_45_scale * math.pi) / x_45_scale)))) / math.pi) else: tmp = 180.0 * (math.atan((-180.0 * (y_45_scale / (angle * (math.pi * x_45_scale))))) / math.pi) return tmp
a_m = abs(a) function code(a_m, b, angle, x_45_scale, y_45_scale) tmp = 0.0 if (b <= 8e+48) tmp = Float64(180.0 * Float64(atan(Float64(0.005555555555555556 * Float64(angle * Float64(Float64(y_45_scale * pi) / x_45_scale)))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(-180.0 * Float64(y_45_scale / Float64(angle * Float64(pi * x_45_scale))))) / pi)); end return tmp end
a_m = abs(a); function tmp_2 = code(a_m, b, angle, x_45_scale, y_45_scale) tmp = 0.0; if (b <= 8e+48) tmp = 180.0 * (atan((0.005555555555555556 * (angle * ((y_45_scale * pi) / x_45_scale)))) / pi); else tmp = 180.0 * (atan((-180.0 * (y_45_scale / (angle * (pi * x_45_scale))))) / pi); end tmp_2 = tmp; end
a_m = N[Abs[a], $MachinePrecision] code[a$95$m_, b_, angle_, x$45$scale_, y$45$scale_] := If[LessEqual[b, 8e+48], N[(180.0 * N[(N[ArcTan[N[(0.005555555555555556 * N[(angle * N[(N[(y$45$scale * Pi), $MachinePrecision] / x$45$scale), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], 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}
a_m = \left|a\right|
\\
\begin{array}{l}
\mathbf{if}\;b \leq 8 \cdot 10^{+48}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(0.005555555555555556 \cdot \left(angle \cdot \frac{y-scale \cdot \pi}{x-scale}\right)\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-180 \cdot \frac{y-scale}{angle \cdot \left(\pi \cdot x-scale\right)}\right)}{\pi}\\
\end{array}
\end{array}
if b < 8.00000000000000035e48Initial program 18.1%
Simplified18.1%
Taylor expanded in x-scale around 0 31.5%
Simplified38.1%
Taylor expanded in a around inf 49.8%
times-frac52.9%
Simplified52.9%
Taylor expanded in y-scale around 0 49.8%
Simplified52.9%
Taylor expanded in angle around 0 46.1%
associate-/l*53.5%
Simplified53.5%
if 8.00000000000000035e48 < b Initial program 5.0%
Simplified3.3%
Taylor expanded in angle around 0 6.5%
associate-*r/6.5%
associate-*r*5.0%
distribute-lft-out--5.0%
associate-*r*5.0%
Simplified5.0%
Taylor expanded in a around 0 54.6%
Final simplification53.7%
a_m = (fabs.f64 a) (FPCore (a_m b angle x-scale y-scale) :precision binary64 (* 180.0 (/ (atan (* -180.0 (/ y-scale (* angle (* PI x-scale))))) PI)))
a_m = fabs(a);
double code(double a_m, double b, 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));
}
a_m = Math.abs(a);
public static double code(double a_m, double b, 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);
}
a_m = math.fabs(a) def code(a_m, b, 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)
a_m = abs(a) function code(a_m, b, 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
a_m = abs(a); function tmp = code(a_m, b, angle, x_45_scale, y_45_scale) tmp = 180.0 * (atan((-180.0 * (y_45_scale / (angle * (pi * x_45_scale))))) / pi); end
a_m = N[Abs[a], $MachinePrecision] code[a$95$m_, b_, 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}
a_m = \left|a\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 14.9%
Simplified14.5%
Taylor expanded in angle around 0 11.7%
associate-*r/11.7%
associate-*r*11.1%
distribute-lft-out--11.1%
associate-*r*11.1%
Simplified11.1%
Taylor expanded in a around 0 40.9%
Final simplification40.9%
a_m = (fabs.f64 a) (FPCore (a_m b angle x-scale y-scale) :precision binary64 (* 180.0 (/ (atan (* -180.0 (/ x-scale (* angle (* y-scale PI))))) PI)))
a_m = fabs(a);
double code(double a_m, double b, 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));
}
a_m = Math.abs(a);
public static double code(double a_m, double b, 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);
}
a_m = math.fabs(a) def code(a_m, b, 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)
a_m = abs(a) function code(a_m, b, 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
a_m = abs(a); function tmp = code(a_m, b, angle, x_45_scale, y_45_scale) tmp = 180.0 * (atan((-180.0 * (x_45_scale / (angle * (y_45_scale * pi))))) / pi); end
a_m = N[Abs[a], $MachinePrecision] code[a$95$m_, b_, 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}
a_m = \left|a\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 14.9%
Simplified14.5%
Taylor expanded in angle around 0 11.7%
associate-*r/11.7%
associate-*r*11.1%
distribute-lft-out--11.1%
associate-*r*11.1%
Simplified11.1%
Taylor expanded in a around inf 11.0%
herbie shell --seed 2024149
(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)))