
(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 11 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 (/ angle (/ 180.0 PI))) (t_1 (* x-scale (cos t_0))))
(if (<= a_m 11500000000.0)
(/
(*
180.0
(atan
(*
(/ (* -0.5 y-scale) t_1)
(/
(+ 1.0 (* 2.0 (* 0.5 (cos (* (* angle PI) 0.011111111111111112)))))
(sin (* (* angle PI) 0.005555555555555556))))))
PI)
(if (<= a_m 6.8e+202)
(* 180.0 (/ (atan (* (/ y-scale x-scale) (sin t_0))) PI))
(/
(*
180.0
(atan
(/ (* y-scale (sin (* PI (* angle 0.005555555555555556)))) 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 = angle / (180.0 / ((double) M_PI));
double t_1 = x_45_scale * cos(t_0);
double tmp;
if (a_m <= 11500000000.0) {
tmp = (180.0 * atan((((-0.5 * y_45_scale) / t_1) * ((1.0 + (2.0 * (0.5 * cos(((angle * ((double) M_PI)) * 0.011111111111111112))))) / sin(((angle * ((double) M_PI)) * 0.005555555555555556)))))) / ((double) M_PI);
} else if (a_m <= 6.8e+202) {
tmp = 180.0 * (atan(((y_45_scale / x_45_scale) * sin(t_0))) / ((double) M_PI));
} else {
tmp = (180.0 * atan(((y_45_scale * sin((((double) M_PI) * (angle * 0.005555555555555556)))) / 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 = angle / (180.0 / Math.PI);
double t_1 = x_45_scale * Math.cos(t_0);
double tmp;
if (a_m <= 11500000000.0) {
tmp = (180.0 * Math.atan((((-0.5 * y_45_scale) / t_1) * ((1.0 + (2.0 * (0.5 * Math.cos(((angle * Math.PI) * 0.011111111111111112))))) / Math.sin(((angle * Math.PI) * 0.005555555555555556)))))) / Math.PI;
} else if (a_m <= 6.8e+202) {
tmp = 180.0 * (Math.atan(((y_45_scale / x_45_scale) * Math.sin(t_0))) / Math.PI);
} else {
tmp = (180.0 * Math.atan(((y_45_scale * Math.sin((Math.PI * (angle * 0.005555555555555556)))) / 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 = angle / (180.0 / math.pi) t_1 = x_45_scale * math.cos(t_0) tmp = 0 if a_m <= 11500000000.0: tmp = (180.0 * math.atan((((-0.5 * y_45_scale) / t_1) * ((1.0 + (2.0 * (0.5 * math.cos(((angle * math.pi) * 0.011111111111111112))))) / math.sin(((angle * math.pi) * 0.005555555555555556)))))) / math.pi elif a_m <= 6.8e+202: tmp = 180.0 * (math.atan(((y_45_scale / x_45_scale) * math.sin(t_0))) / math.pi) else: tmp = (180.0 * math.atan(((y_45_scale * math.sin((math.pi * (angle * 0.005555555555555556)))) / 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(angle / Float64(180.0 / pi)) t_1 = Float64(x_45_scale * cos(t_0)) tmp = 0.0 if (a_m <= 11500000000.0) tmp = Float64(Float64(180.0 * atan(Float64(Float64(Float64(-0.5 * y_45_scale) / t_1) * Float64(Float64(1.0 + Float64(2.0 * Float64(0.5 * cos(Float64(Float64(angle * pi) * 0.011111111111111112))))) / sin(Float64(Float64(angle * pi) * 0.005555555555555556)))))) / pi); elseif (a_m <= 6.8e+202) tmp = Float64(180.0 * Float64(atan(Float64(Float64(y_45_scale / x_45_scale) * sin(t_0))) / pi)); else tmp = Float64(Float64(180.0 * atan(Float64(Float64(y_45_scale * sin(Float64(pi * Float64(angle * 0.005555555555555556)))) / 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 = angle / (180.0 / pi); t_1 = x_45_scale * cos(t_0); tmp = 0.0; if (a_m <= 11500000000.0) tmp = (180.0 * atan((((-0.5 * y_45_scale) / t_1) * ((1.0 + (2.0 * (0.5 * cos(((angle * pi) * 0.011111111111111112))))) / sin(((angle * pi) * 0.005555555555555556)))))) / pi; elseif (a_m <= 6.8e+202) tmp = 180.0 * (atan(((y_45_scale / x_45_scale) * sin(t_0))) / pi); else tmp = (180.0 * atan(((y_45_scale * sin((pi * (angle * 0.005555555555555556)))) / 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[(angle / N[(180.0 / Pi), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x$45$scale * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a$95$m, 11500000000.0], N[(N[(180.0 * N[ArcTan[N[(N[(N[(-0.5 * y$45$scale), $MachinePrecision] / t$95$1), $MachinePrecision] * N[(N[(1.0 + N[(2.0 * N[(0.5 * N[Cos[N[(N[(angle * Pi), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sin[N[(N[(angle * Pi), $MachinePrecision] * 0.005555555555555556), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], If[LessEqual[a$95$m, 6.8e+202], N[(180.0 * N[(N[ArcTan[N[(N[(y$45$scale / x$45$scale), $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(N[(180.0 * N[ArcTan[N[(N[(y$45$scale * N[Sin[N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision]]]]]
\begin{array}{l}
a_m = \left|a\right|
\\
\begin{array}{l}
t_0 := \frac{angle}{\frac{180}{\pi}}\\
t_1 := x-scale \cdot \cos t\_0\\
\mathbf{if}\;a\_m \leq 11500000000:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{-0.5 \cdot y-scale}{t\_1} \cdot \frac{1 + 2 \cdot \left(0.5 \cdot \cos \left(\left(angle \cdot \pi\right) \cdot 0.011111111111111112\right)\right)}{\sin \left(\left(angle \cdot \pi\right) \cdot 0.005555555555555556\right)}\right)}{\pi}\\
\mathbf{elif}\;a\_m \leq 6.8 \cdot 10^{+202}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{y-scale}{x-scale} \cdot \sin t\_0\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{y-scale \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}{t\_1}\right)}{\pi}\\
\end{array}
\end{array}
if a < 1.15e10Initial program 13.7%
Simplified11.5%
Taylor expanded in x-scale around 0
Simplified30.2%
Applied egg-rr33.2%
Taylor expanded in a around 0
associate-*r/N/A
/-lowering-/.f64N/A
distribute-lft-inN/A
metadata-evalN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
sin-lowering-sin.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
Simplified52.9%
if 1.15e10 < a < 6.8e202Initial program 18.8%
Simplified21.0%
Taylor expanded in x-scale around 0
Simplified30.1%
Taylor expanded in a around inf
/-lowering-/.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6450.0%
Simplified50.0%
Taylor expanded in angle around 0
Simplified60.7%
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
Applied egg-rr61.5%
if 6.8e202 < a Initial program 0.0%
Simplified0.0%
Taylor expanded in x-scale around 0
Simplified0.0%
Taylor expanded in a around inf
/-lowering-/.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6472.6%
Simplified72.6%
associate-*r*N/A
cos-lowering-cos.f64N/A
associate-*r*N/A
*-commutativeN/A
metadata-evalN/A
div-invN/A
associate-/r/N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
PI-lowering-PI.f6489.0%
Applied egg-rr89.0%
Final simplification56.7%
a_m = (fabs.f64 a)
(FPCore (a_m b angle x-scale y-scale)
:precision binary64
(let* ((t_0 (* (* angle PI) 0.005555555555555556))
(t_1 (* PI (* angle 0.005555555555555556))))
(if (<= b 1.3e-33)
(*
180.0
(/ (atan (* (/ y-scale x-scale) (sin (/ angle (/ 180.0 PI))))) PI))
(if (<= b 1.32e+39)
(/
(*
180.0
(atan
(/
(*
y-scale
(+ -0.5 (* -0.5 (cos (* angle (* PI 0.011111111111111112))))))
(* (sin t_0) (* x-scale (cos t_0))))))
PI)
(if (<= b 1.95e+136)
(*
180.0
(/ (atan (* (/ y-scale x-scale) (tan (* PI (/ angle 180.0))))) PI))
(/
(*
180.0
(atan (/ (* y-scale (cos t_1)) (* (sin t_1) (- 0.0 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 t_0 = (angle * ((double) M_PI)) * 0.005555555555555556;
double t_1 = ((double) M_PI) * (angle * 0.005555555555555556);
double tmp;
if (b <= 1.3e-33) {
tmp = 180.0 * (atan(((y_45_scale / x_45_scale) * sin((angle / (180.0 / ((double) M_PI)))))) / ((double) M_PI));
} else if (b <= 1.32e+39) {
tmp = (180.0 * atan(((y_45_scale * (-0.5 + (-0.5 * cos((angle * (((double) M_PI) * 0.011111111111111112)))))) / (sin(t_0) * (x_45_scale * cos(t_0)))))) / ((double) M_PI);
} else if (b <= 1.95e+136) {
tmp = 180.0 * (atan(((y_45_scale / x_45_scale) * tan((((double) M_PI) * (angle / 180.0))))) / ((double) M_PI));
} else {
tmp = (180.0 * atan(((y_45_scale * cos(t_1)) / (sin(t_1) * (0.0 - 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 t_0 = (angle * Math.PI) * 0.005555555555555556;
double t_1 = Math.PI * (angle * 0.005555555555555556);
double tmp;
if (b <= 1.3e-33) {
tmp = 180.0 * (Math.atan(((y_45_scale / x_45_scale) * Math.sin((angle / (180.0 / Math.PI))))) / Math.PI);
} else if (b <= 1.32e+39) {
tmp = (180.0 * Math.atan(((y_45_scale * (-0.5 + (-0.5 * Math.cos((angle * (Math.PI * 0.011111111111111112)))))) / (Math.sin(t_0) * (x_45_scale * Math.cos(t_0)))))) / Math.PI;
} else if (b <= 1.95e+136) {
tmp = 180.0 * (Math.atan(((y_45_scale / x_45_scale) * Math.tan((Math.PI * (angle / 180.0))))) / Math.PI);
} else {
tmp = (180.0 * Math.atan(((y_45_scale * Math.cos(t_1)) / (Math.sin(t_1) * (0.0 - x_45_scale))))) / Math.PI;
}
return tmp;
}
a_m = math.fabs(a) def code(a_m, b, angle, x_45_scale, y_45_scale): t_0 = (angle * math.pi) * 0.005555555555555556 t_1 = math.pi * (angle * 0.005555555555555556) tmp = 0 if b <= 1.3e-33: tmp = 180.0 * (math.atan(((y_45_scale / x_45_scale) * math.sin((angle / (180.0 / math.pi))))) / math.pi) elif b <= 1.32e+39: tmp = (180.0 * math.atan(((y_45_scale * (-0.5 + (-0.5 * math.cos((angle * (math.pi * 0.011111111111111112)))))) / (math.sin(t_0) * (x_45_scale * math.cos(t_0)))))) / math.pi elif b <= 1.95e+136: tmp = 180.0 * (math.atan(((y_45_scale / x_45_scale) * math.tan((math.pi * (angle / 180.0))))) / math.pi) else: tmp = (180.0 * math.atan(((y_45_scale * math.cos(t_1)) / (math.sin(t_1) * (0.0 - x_45_scale))))) / math.pi return tmp
a_m = abs(a) function code(a_m, b, angle, x_45_scale, y_45_scale) t_0 = Float64(Float64(angle * pi) * 0.005555555555555556) t_1 = Float64(pi * Float64(angle * 0.005555555555555556)) tmp = 0.0 if (b <= 1.3e-33) tmp = Float64(180.0 * Float64(atan(Float64(Float64(y_45_scale / x_45_scale) * sin(Float64(angle / Float64(180.0 / pi))))) / pi)); elseif (b <= 1.32e+39) tmp = Float64(Float64(180.0 * atan(Float64(Float64(y_45_scale * Float64(-0.5 + Float64(-0.5 * cos(Float64(angle * Float64(pi * 0.011111111111111112)))))) / Float64(sin(t_0) * Float64(x_45_scale * cos(t_0)))))) / pi); elseif (b <= 1.95e+136) tmp = Float64(180.0 * Float64(atan(Float64(Float64(y_45_scale / x_45_scale) * tan(Float64(pi * Float64(angle / 180.0))))) / pi)); else tmp = Float64(Float64(180.0 * atan(Float64(Float64(y_45_scale * cos(t_1)) / Float64(sin(t_1) * Float64(0.0 - 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) t_0 = (angle * pi) * 0.005555555555555556; t_1 = pi * (angle * 0.005555555555555556); tmp = 0.0; if (b <= 1.3e-33) tmp = 180.0 * (atan(((y_45_scale / x_45_scale) * sin((angle / (180.0 / pi))))) / pi); elseif (b <= 1.32e+39) tmp = (180.0 * atan(((y_45_scale * (-0.5 + (-0.5 * cos((angle * (pi * 0.011111111111111112)))))) / (sin(t_0) * (x_45_scale * cos(t_0)))))) / pi; elseif (b <= 1.95e+136) tmp = 180.0 * (atan(((y_45_scale / x_45_scale) * tan((pi * (angle / 180.0))))) / pi); else tmp = (180.0 * atan(((y_45_scale * cos(t_1)) / (sin(t_1) * (0.0 - 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_] := Block[{t$95$0 = N[(N[(angle * Pi), $MachinePrecision] * 0.005555555555555556), $MachinePrecision]}, Block[{t$95$1 = N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, 1.3e-33], N[(180.0 * N[(N[ArcTan[N[(N[(y$45$scale / x$45$scale), $MachinePrecision] * N[Sin[N[(angle / N[(180.0 / Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.32e+39], N[(N[(180.0 * N[ArcTan[N[(N[(y$45$scale * N[(-0.5 + N[(-0.5 * N[Cos[N[(angle * N[(Pi * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[Sin[t$95$0], $MachinePrecision] * N[(x$45$scale * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], If[LessEqual[b, 1.95e+136], N[(180.0 * N[(N[ArcTan[N[(N[(y$45$scale / x$45$scale), $MachinePrecision] * N[Tan[N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(N[(180.0 * N[ArcTan[N[(N[(y$45$scale * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision] / N[(N[Sin[t$95$1], $MachinePrecision] * N[(0.0 - x$45$scale), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision]]]]]]
\begin{array}{l}
a_m = \left|a\right|
\\
\begin{array}{l}
t_0 := \left(angle \cdot \pi\right) \cdot 0.005555555555555556\\
t_1 := \pi \cdot \left(angle \cdot 0.005555555555555556\right)\\
\mathbf{if}\;b \leq 1.3 \cdot 10^{-33}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{y-scale}{x-scale} \cdot \sin \left(\frac{angle}{\frac{180}{\pi}}\right)\right)}{\pi}\\
\mathbf{elif}\;b \leq 1.32 \cdot 10^{+39}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{y-scale \cdot \left(-0.5 + -0.5 \cdot \cos \left(angle \cdot \left(\pi \cdot 0.011111111111111112\right)\right)\right)}{\sin t\_0 \cdot \left(x-scale \cdot \cos t\_0\right)}\right)}{\pi}\\
\mathbf{elif}\;b \leq 1.95 \cdot 10^{+136}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{y-scale}{x-scale} \cdot \tan \left(\pi \cdot \frac{angle}{180}\right)\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{y-scale \cdot \cos t\_1}{\sin t\_1 \cdot \left(0 - x-scale\right)}\right)}{\pi}\\
\end{array}
\end{array}
if b < 1.29999999999999997e-33Initial program 13.0%
Simplified11.3%
Taylor expanded in x-scale around 0
Simplified26.6%
Taylor expanded in a around inf
/-lowering-/.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6449.7%
Simplified49.7%
Taylor expanded in angle around 0
Simplified55.6%
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
Applied egg-rr56.0%
if 1.29999999999999997e-33 < b < 1.32e39Initial program 41.6%
Simplified41.5%
Taylor expanded in x-scale around 0
Simplified64.2%
Applied egg-rr58.7%
Taylor expanded in angle around inf
cos-lowering-cos.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6458.7%
Simplified58.7%
Taylor expanded in a around 0
Simplified63.0%
if 1.32e39 < b < 1.9500000000000001e136Initial program 5.6%
Simplified5.6%
Taylor expanded in x-scale around 0
Simplified39.2%
Taylor expanded in a around inf
/-lowering-/.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6473.4%
Simplified73.4%
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
Applied egg-rr57.0%
associate-/r/N/A
div-invN/A
metadata-evalN/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
metadata-evalN/A
div-invN/A
/-lowering-/.f64N/A
PI-lowering-PI.f6473.2%
Applied egg-rr73.2%
if 1.9500000000000001e136 < b Initial program 4.4%
Simplified3.8%
Taylor expanded in x-scale around 0
Simplified7.7%
Taylor expanded in a around 0
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6454.8%
Simplified54.8%
Final simplification57.6%
a_m = (fabs.f64 a)
(FPCore (a_m b angle x-scale y-scale)
:precision binary64
(let* ((t_0 (/ angle (/ 180.0 PI)))
(t_1 (* (* angle PI) 0.005555555555555556)))
(if (<= a_m 5800000000.0)
(/
(*
180.0
(atan
(*
(/ y-scale x-scale)
(/
(- (* (cos (* (* angle PI) 0.011111111111111112)) (- 0.0 0.5)) 0.5)
(* (sin t_1) (cos t_1))))))
PI)
(if (<= a_m 6.2e+202)
(* 180.0 (/ (atan (* (/ y-scale x-scale) (sin t_0))) PI))
(/
(*
180.0
(atan
(/
(* y-scale (sin (* PI (* angle 0.005555555555555556))))
(* x-scale (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 = angle / (180.0 / ((double) M_PI));
double t_1 = (angle * ((double) M_PI)) * 0.005555555555555556;
double tmp;
if (a_m <= 5800000000.0) {
tmp = (180.0 * atan(((y_45_scale / x_45_scale) * (((cos(((angle * ((double) M_PI)) * 0.011111111111111112)) * (0.0 - 0.5)) - 0.5) / (sin(t_1) * cos(t_1)))))) / ((double) M_PI);
} else if (a_m <= 6.2e+202) {
tmp = 180.0 * (atan(((y_45_scale / x_45_scale) * sin(t_0))) / ((double) M_PI));
} else {
tmp = (180.0 * atan(((y_45_scale * sin((((double) M_PI) * (angle * 0.005555555555555556)))) / (x_45_scale * 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 = angle / (180.0 / Math.PI);
double t_1 = (angle * Math.PI) * 0.005555555555555556;
double tmp;
if (a_m <= 5800000000.0) {
tmp = (180.0 * Math.atan(((y_45_scale / x_45_scale) * (((Math.cos(((angle * Math.PI) * 0.011111111111111112)) * (0.0 - 0.5)) - 0.5) / (Math.sin(t_1) * Math.cos(t_1)))))) / Math.PI;
} else if (a_m <= 6.2e+202) {
tmp = 180.0 * (Math.atan(((y_45_scale / x_45_scale) * Math.sin(t_0))) / Math.PI);
} else {
tmp = (180.0 * Math.atan(((y_45_scale * Math.sin((Math.PI * (angle * 0.005555555555555556)))) / (x_45_scale * 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 = angle / (180.0 / math.pi) t_1 = (angle * math.pi) * 0.005555555555555556 tmp = 0 if a_m <= 5800000000.0: tmp = (180.0 * math.atan(((y_45_scale / x_45_scale) * (((math.cos(((angle * math.pi) * 0.011111111111111112)) * (0.0 - 0.5)) - 0.5) / (math.sin(t_1) * math.cos(t_1)))))) / math.pi elif a_m <= 6.2e+202: tmp = 180.0 * (math.atan(((y_45_scale / x_45_scale) * math.sin(t_0))) / math.pi) else: tmp = (180.0 * math.atan(((y_45_scale * math.sin((math.pi * (angle * 0.005555555555555556)))) / (x_45_scale * 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(angle / Float64(180.0 / pi)) t_1 = Float64(Float64(angle * pi) * 0.005555555555555556) tmp = 0.0 if (a_m <= 5800000000.0) tmp = Float64(Float64(180.0 * atan(Float64(Float64(y_45_scale / x_45_scale) * Float64(Float64(Float64(cos(Float64(Float64(angle * pi) * 0.011111111111111112)) * Float64(0.0 - 0.5)) - 0.5) / Float64(sin(t_1) * cos(t_1)))))) / pi); elseif (a_m <= 6.2e+202) tmp = Float64(180.0 * Float64(atan(Float64(Float64(y_45_scale / x_45_scale) * sin(t_0))) / pi)); else tmp = Float64(Float64(180.0 * atan(Float64(Float64(y_45_scale * sin(Float64(pi * Float64(angle * 0.005555555555555556)))) / Float64(x_45_scale * 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 = angle / (180.0 / pi); t_1 = (angle * pi) * 0.005555555555555556; tmp = 0.0; if (a_m <= 5800000000.0) tmp = (180.0 * atan(((y_45_scale / x_45_scale) * (((cos(((angle * pi) * 0.011111111111111112)) * (0.0 - 0.5)) - 0.5) / (sin(t_1) * cos(t_1)))))) / pi; elseif (a_m <= 6.2e+202) tmp = 180.0 * (atan(((y_45_scale / x_45_scale) * sin(t_0))) / pi); else tmp = (180.0 * atan(((y_45_scale * sin((pi * (angle * 0.005555555555555556)))) / (x_45_scale * 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[(angle / N[(180.0 / Pi), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(angle * Pi), $MachinePrecision] * 0.005555555555555556), $MachinePrecision]}, If[LessEqual[a$95$m, 5800000000.0], N[(N[(180.0 * N[ArcTan[N[(N[(y$45$scale / x$45$scale), $MachinePrecision] * N[(N[(N[(N[Cos[N[(N[(angle * Pi), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]], $MachinePrecision] * N[(0.0 - 0.5), $MachinePrecision]), $MachinePrecision] - 0.5), $MachinePrecision] / N[(N[Sin[t$95$1], $MachinePrecision] * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], If[LessEqual[a$95$m, 6.2e+202], N[(180.0 * N[(N[ArcTan[N[(N[(y$45$scale / x$45$scale), $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(N[(180.0 * N[ArcTan[N[(N[(y$45$scale * N[Sin[N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(x$45$scale * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision]]]]]
\begin{array}{l}
a_m = \left|a\right|
\\
\begin{array}{l}
t_0 := \frac{angle}{\frac{180}{\pi}}\\
t_1 := \left(angle \cdot \pi\right) \cdot 0.005555555555555556\\
\mathbf{if}\;a\_m \leq 5800000000:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{y-scale}{x-scale} \cdot \frac{\cos \left(\left(angle \cdot \pi\right) \cdot 0.011111111111111112\right) \cdot \left(0 - 0.5\right) - 0.5}{\sin t\_1 \cdot \cos t\_1}\right)}{\pi}\\
\mathbf{elif}\;a\_m \leq 6.2 \cdot 10^{+202}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{y-scale}{x-scale} \cdot \sin t\_0\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{y-scale \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}{x-scale \cdot \cos t\_0}\right)}{\pi}\\
\end{array}
\end{array}
if a < 5.8e9Initial program 13.7%
Simplified11.5%
Taylor expanded in x-scale around 0
Simplified30.2%
Applied egg-rr33.2%
Taylor expanded in a around 0
mul-1-negN/A
times-fracN/A
distribute-lft-neg-inN/A
*-lowering-*.f64N/A
neg-lowering-neg.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
Simplified53.4%
if 5.8e9 < a < 6.19999999999999983e202Initial program 18.8%
Simplified21.0%
Taylor expanded in x-scale around 0
Simplified30.1%
Taylor expanded in a around inf
/-lowering-/.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6450.0%
Simplified50.0%
Taylor expanded in angle around 0
Simplified60.7%
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
Applied egg-rr61.5%
if 6.19999999999999983e202 < a Initial program 0.0%
Simplified0.0%
Taylor expanded in x-scale around 0
Simplified0.0%
Taylor expanded in a around inf
/-lowering-/.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6472.6%
Simplified72.6%
associate-*r*N/A
cos-lowering-cos.f64N/A
associate-*r*N/A
*-commutativeN/A
metadata-evalN/A
div-invN/A
associate-/r/N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
PI-lowering-PI.f6489.0%
Applied egg-rr89.0%
Final simplification57.1%
a_m = (fabs.f64 a)
(FPCore (a_m b angle x-scale y-scale)
:precision binary64
(let* ((t_0 (* PI (* angle 0.005555555555555556)))
(t_1
(/
(*
180.0
(atan (/ (* y-scale (cos t_0)) (* (sin t_0) (- 0.0 x-scale)))))
PI)))
(if (<= b 4.9e-34)
(*
180.0
(/ (atan (* (/ y-scale x-scale) (sin (/ angle (/ 180.0 PI))))) PI))
(if (<= b 1.5e+39)
t_1
(if (<= b 2.02e+136)
(*
180.0
(/ (atan (* (/ y-scale x-scale) (tan (* PI (/ angle 180.0))))) PI))
t_1)))))a_m = fabs(a);
double code(double a_m, double b, double angle, double x_45_scale, double y_45_scale) {
double t_0 = ((double) M_PI) * (angle * 0.005555555555555556);
double t_1 = (180.0 * atan(((y_45_scale * cos(t_0)) / (sin(t_0) * (0.0 - x_45_scale))))) / ((double) M_PI);
double tmp;
if (b <= 4.9e-34) {
tmp = 180.0 * (atan(((y_45_scale / x_45_scale) * sin((angle / (180.0 / ((double) M_PI)))))) / ((double) M_PI));
} else if (b <= 1.5e+39) {
tmp = t_1;
} else if (b <= 2.02e+136) {
tmp = 180.0 * (atan(((y_45_scale / x_45_scale) * tan((((double) M_PI) * (angle / 180.0))))) / ((double) M_PI));
} else {
tmp = t_1;
}
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 = Math.PI * (angle * 0.005555555555555556);
double t_1 = (180.0 * Math.atan(((y_45_scale * Math.cos(t_0)) / (Math.sin(t_0) * (0.0 - x_45_scale))))) / Math.PI;
double tmp;
if (b <= 4.9e-34) {
tmp = 180.0 * (Math.atan(((y_45_scale / x_45_scale) * Math.sin((angle / (180.0 / Math.PI))))) / Math.PI);
} else if (b <= 1.5e+39) {
tmp = t_1;
} else if (b <= 2.02e+136) {
tmp = 180.0 * (Math.atan(((y_45_scale / x_45_scale) * Math.tan((Math.PI * (angle / 180.0))))) / Math.PI);
} else {
tmp = t_1;
}
return tmp;
}
a_m = math.fabs(a) def code(a_m, b, angle, x_45_scale, y_45_scale): t_0 = math.pi * (angle * 0.005555555555555556) t_1 = (180.0 * math.atan(((y_45_scale * math.cos(t_0)) / (math.sin(t_0) * (0.0 - x_45_scale))))) / math.pi tmp = 0 if b <= 4.9e-34: tmp = 180.0 * (math.atan(((y_45_scale / x_45_scale) * math.sin((angle / (180.0 / math.pi))))) / math.pi) elif b <= 1.5e+39: tmp = t_1 elif b <= 2.02e+136: tmp = 180.0 * (math.atan(((y_45_scale / x_45_scale) * math.tan((math.pi * (angle / 180.0))))) / math.pi) else: tmp = t_1 return tmp
a_m = abs(a) function code(a_m, b, angle, x_45_scale, y_45_scale) t_0 = Float64(pi * Float64(angle * 0.005555555555555556)) t_1 = Float64(Float64(180.0 * atan(Float64(Float64(y_45_scale * cos(t_0)) / Float64(sin(t_0) * Float64(0.0 - x_45_scale))))) / pi) tmp = 0.0 if (b <= 4.9e-34) tmp = Float64(180.0 * Float64(atan(Float64(Float64(y_45_scale / x_45_scale) * sin(Float64(angle / Float64(180.0 / pi))))) / pi)); elseif (b <= 1.5e+39) tmp = t_1; elseif (b <= 2.02e+136) tmp = Float64(180.0 * Float64(atan(Float64(Float64(y_45_scale / x_45_scale) * tan(Float64(pi * Float64(angle / 180.0))))) / pi)); else tmp = t_1; end return tmp end
a_m = abs(a); function tmp_2 = code(a_m, b, angle, x_45_scale, y_45_scale) t_0 = pi * (angle * 0.005555555555555556); t_1 = (180.0 * atan(((y_45_scale * cos(t_0)) / (sin(t_0) * (0.0 - x_45_scale))))) / pi; tmp = 0.0; if (b <= 4.9e-34) tmp = 180.0 * (atan(((y_45_scale / x_45_scale) * sin((angle / (180.0 / pi))))) / pi); elseif (b <= 1.5e+39) tmp = t_1; elseif (b <= 2.02e+136) tmp = 180.0 * (atan(((y_45_scale / x_45_scale) * tan((pi * (angle / 180.0))))) / pi); else tmp = t_1; 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[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(180.0 * N[ArcTan[N[(N[(y$45$scale * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision] / N[(N[Sin[t$95$0], $MachinePrecision] * N[(0.0 - x$45$scale), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision]}, If[LessEqual[b, 4.9e-34], N[(180.0 * N[(N[ArcTan[N[(N[(y$45$scale / x$45$scale), $MachinePrecision] * N[Sin[N[(angle / N[(180.0 / Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.5e+39], t$95$1, If[LessEqual[b, 2.02e+136], N[(180.0 * N[(N[ArcTan[N[(N[(y$45$scale / x$45$scale), $MachinePrecision] * N[Tan[N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
a_m = \left|a\right|
\\
\begin{array}{l}
t_0 := \pi \cdot \left(angle \cdot 0.005555555555555556\right)\\
t_1 := \frac{180 \cdot \tan^{-1} \left(\frac{y-scale \cdot \cos t\_0}{\sin t\_0 \cdot \left(0 - x-scale\right)}\right)}{\pi}\\
\mathbf{if}\;b \leq 4.9 \cdot 10^{-34}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{y-scale}{x-scale} \cdot \sin \left(\frac{angle}{\frac{180}{\pi}}\right)\right)}{\pi}\\
\mathbf{elif}\;b \leq 1.5 \cdot 10^{+39}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 2.02 \cdot 10^{+136}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{y-scale}{x-scale} \cdot \tan \left(\pi \cdot \frac{angle}{180}\right)\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < 4.89999999999999962e-34Initial program 13.0%
Simplified11.3%
Taylor expanded in x-scale around 0
Simplified26.6%
Taylor expanded in a around inf
/-lowering-/.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6449.7%
Simplified49.7%
Taylor expanded in angle around 0
Simplified55.6%
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
Applied egg-rr56.0%
if 4.89999999999999962e-34 < b < 1.5e39 or 2.02000000000000002e136 < b Initial program 19.1%
Simplified18.7%
Taylor expanded in x-scale around 0
Simplified30.0%
Taylor expanded in a around 0
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6458.3%
Simplified58.3%
if 1.5e39 < b < 2.02000000000000002e136Initial program 5.6%
Simplified5.6%
Taylor expanded in x-scale around 0
Simplified39.2%
Taylor expanded in a around inf
/-lowering-/.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6473.4%
Simplified73.4%
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
Applied egg-rr57.0%
associate-/r/N/A
div-invN/A
metadata-evalN/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
metadata-evalN/A
div-invN/A
/-lowering-/.f64N/A
PI-lowering-PI.f6473.2%
Applied egg-rr73.2%
Final simplification57.6%
a_m = (fabs.f64 a) (FPCore (a_m b angle x-scale y-scale) :precision binary64 (if (<= b 9.8e+72) (* 180.0 (/ (atan (* (/ y-scale x-scale) (sin (/ angle (/ 180.0 PI))))) PI)) (/ (* 180.0 (atan (/ (* y-scale -180.0) (* angle (* x-scale 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 (b <= 9.8e+72) {
tmp = 180.0 * (atan(((y_45_scale / x_45_scale) * sin((angle / (180.0 / ((double) M_PI)))))) / ((double) M_PI));
} else {
tmp = (180.0 * atan(((y_45_scale * -180.0) / (angle * (x_45_scale * ((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 (b <= 9.8e+72) {
tmp = 180.0 * (Math.atan(((y_45_scale / x_45_scale) * Math.sin((angle / (180.0 / Math.PI))))) / Math.PI);
} else {
tmp = (180.0 * Math.atan(((y_45_scale * -180.0) / (angle * (x_45_scale * 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 b <= 9.8e+72: tmp = 180.0 * (math.atan(((y_45_scale / x_45_scale) * math.sin((angle / (180.0 / math.pi))))) / math.pi) else: tmp = (180.0 * math.atan(((y_45_scale * -180.0) / (angle * (x_45_scale * 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 (b <= 9.8e+72) tmp = Float64(180.0 * Float64(atan(Float64(Float64(y_45_scale / x_45_scale) * sin(Float64(angle / Float64(180.0 / pi))))) / pi)); else tmp = Float64(Float64(180.0 * atan(Float64(Float64(y_45_scale * -180.0) / Float64(angle * Float64(x_45_scale * 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 (b <= 9.8e+72) tmp = 180.0 * (atan(((y_45_scale / x_45_scale) * sin((angle / (180.0 / pi))))) / pi); else tmp = (180.0 * atan(((y_45_scale * -180.0) / (angle * (x_45_scale * 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[b, 9.8e+72], N[(180.0 * N[(N[ArcTan[N[(N[(y$45$scale / x$45$scale), $MachinePrecision] * N[Sin[N[(angle / N[(180.0 / Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(N[(180.0 * N[ArcTan[N[(N[(y$45$scale * -180.0), $MachinePrecision] / N[(angle * N[(x$45$scale * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision]]
\begin{array}{l}
a_m = \left|a\right|
\\
\begin{array}{l}
\mathbf{if}\;b \leq 9.8 \cdot 10^{+72}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{y-scale}{x-scale} \cdot \sin \left(\frac{angle}{\frac{180}{\pi}}\right)\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{y-scale \cdot -180}{angle \cdot \left(x-scale \cdot \pi\right)}\right)}{\pi}\\
\end{array}
\end{array}
if b < 9.80000000000000012e72Initial program 14.9%
Simplified13.4%
Taylor expanded in x-scale around 0
Simplified29.5%
Taylor expanded in a around inf
/-lowering-/.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6448.7%
Simplified48.7%
Taylor expanded in angle around 0
Simplified55.1%
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
Applied egg-rr55.8%
if 9.80000000000000012e72 < b Initial program 5.5%
Simplified5.2%
Taylor expanded in angle around 0
associate-*r/N/A
+-commutativeN/A
difference-of-squaresN/A
unpow2N/A
unpow2N/A
/-lowering-/.f64N/A
Simplified5.1%
Taylor expanded in a around 0
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6449.1%
Simplified49.1%
Final simplification54.8%
a_m = (fabs.f64 a)
(FPCore (a_m b angle x-scale y-scale)
:precision binary64
(if (<= a_m 2e+17)
(/ (* 180.0 (atan (/ (* y-scale -180.0) (* angle (* x-scale PI))))) PI)
(*
(/ 180.0 PI)
(atan (/ (tan (/ angle (/ 180.0 PI))) (/ x-scale y-scale))))))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 <= 2e+17) {
tmp = (180.0 * atan(((y_45_scale * -180.0) / (angle * (x_45_scale * ((double) M_PI)))))) / ((double) M_PI);
} else {
tmp = (180.0 / ((double) M_PI)) * atan((tan((angle / (180.0 / ((double) M_PI)))) / (x_45_scale / y_45_scale)));
}
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 <= 2e+17) {
tmp = (180.0 * Math.atan(((y_45_scale * -180.0) / (angle * (x_45_scale * Math.PI))))) / Math.PI;
} else {
tmp = (180.0 / Math.PI) * Math.atan((Math.tan((angle / (180.0 / Math.PI))) / (x_45_scale / y_45_scale)));
}
return tmp;
}
a_m = math.fabs(a) def code(a_m, b, angle, x_45_scale, y_45_scale): tmp = 0 if a_m <= 2e+17: tmp = (180.0 * math.atan(((y_45_scale * -180.0) / (angle * (x_45_scale * math.pi))))) / math.pi else: tmp = (180.0 / math.pi) * math.atan((math.tan((angle / (180.0 / math.pi))) / (x_45_scale / y_45_scale))) return tmp
a_m = abs(a) function code(a_m, b, angle, x_45_scale, y_45_scale) tmp = 0.0 if (a_m <= 2e+17) tmp = Float64(Float64(180.0 * atan(Float64(Float64(y_45_scale * -180.0) / Float64(angle * Float64(x_45_scale * pi))))) / pi); else tmp = Float64(Float64(180.0 / pi) * atan(Float64(tan(Float64(angle / Float64(180.0 / pi))) / Float64(x_45_scale / y_45_scale)))); 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 <= 2e+17) tmp = (180.0 * atan(((y_45_scale * -180.0) / (angle * (x_45_scale * pi))))) / pi; else tmp = (180.0 / pi) * atan((tan((angle / (180.0 / pi))) / (x_45_scale / y_45_scale))); 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, 2e+17], N[(N[(180.0 * N[ArcTan[N[(N[(y$45$scale * -180.0), $MachinePrecision] / N[(angle * N[(x$45$scale * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], N[(N[(180.0 / Pi), $MachinePrecision] * N[ArcTan[N[(N[Tan[N[(angle / N[(180.0 / Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(x$45$scale / y$45$scale), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
a_m = \left|a\right|
\\
\begin{array}{l}
\mathbf{if}\;a\_m \leq 2 \cdot 10^{+17}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{y-scale \cdot -180}{angle \cdot \left(x-scale \cdot \pi\right)}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(\frac{\tan \left(\frac{angle}{\frac{180}{\pi}}\right)}{\frac{x-scale}{y-scale}}\right)\\
\end{array}
\end{array}
if a < 2e17Initial program 13.7%
Simplified11.5%
Taylor expanded in angle around 0
associate-*r/N/A
+-commutativeN/A
difference-of-squaresN/A
unpow2N/A
unpow2N/A
/-lowering-/.f64N/A
Simplified11.4%
Taylor expanded in a around 0
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6444.1%
Simplified44.1%
if 2e17 < a Initial program 12.8%
Simplified14.4%
Taylor expanded in x-scale around 0
Simplified20.6%
Taylor expanded in a around inf
/-lowering-/.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6457.1%
Simplified57.1%
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
Applied egg-rr67.7%
associate-*l/N/A
associate-/l*N/A
*-lowering-*.f64N/A
atan-lowering-atan.f64N/A
*-commutativeN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
tan-lowering-tan.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
PI-lowering-PI.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
PI-lowering-PI.f6467.7%
Applied egg-rr67.7%
Final simplification49.4%
a_m = (fabs.f64 a)
(FPCore (a_m b angle x-scale y-scale)
:precision binary64
(if (<= a_m 1.32e+16)
(/ (* 180.0 (atan (/ (* y-scale -180.0) (* angle (* x-scale PI))))) PI)
(*
(/ 180.0 PI)
(atan (* (/ y-scale x-scale) (tan (/ angle (/ 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 <= 1.32e+16) {
tmp = (180.0 * atan(((y_45_scale * -180.0) / (angle * (x_45_scale * ((double) M_PI)))))) / ((double) M_PI);
} else {
tmp = (180.0 / ((double) M_PI)) * atan(((y_45_scale / x_45_scale) * tan((angle / (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 <= 1.32e+16) {
tmp = (180.0 * Math.atan(((y_45_scale * -180.0) / (angle * (x_45_scale * Math.PI))))) / Math.PI;
} else {
tmp = (180.0 / Math.PI) * Math.atan(((y_45_scale / x_45_scale) * Math.tan((angle / (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 <= 1.32e+16: tmp = (180.0 * math.atan(((y_45_scale * -180.0) / (angle * (x_45_scale * math.pi))))) / math.pi else: tmp = (180.0 / math.pi) * math.atan(((y_45_scale / x_45_scale) * math.tan((angle / (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 <= 1.32e+16) tmp = Float64(Float64(180.0 * atan(Float64(Float64(y_45_scale * -180.0) / Float64(angle * Float64(x_45_scale * pi))))) / pi); else tmp = Float64(Float64(180.0 / pi) * atan(Float64(Float64(y_45_scale / x_45_scale) * tan(Float64(angle / 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 <= 1.32e+16) tmp = (180.0 * atan(((y_45_scale * -180.0) / (angle * (x_45_scale * pi))))) / pi; else tmp = (180.0 / pi) * atan(((y_45_scale / x_45_scale) * tan((angle / (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, 1.32e+16], N[(N[(180.0 * N[ArcTan[N[(N[(y$45$scale * -180.0), $MachinePrecision] / N[(angle * N[(x$45$scale * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], N[(N[(180.0 / Pi), $MachinePrecision] * N[ArcTan[N[(N[(y$45$scale / x$45$scale), $MachinePrecision] * N[Tan[N[(angle / N[(180.0 / Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
a_m = \left|a\right|
\\
\begin{array}{l}
\mathbf{if}\;a\_m \leq 1.32 \cdot 10^{+16}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{y-scale \cdot -180}{angle \cdot \left(x-scale \cdot \pi\right)}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(\frac{y-scale}{x-scale} \cdot \tan \left(\frac{angle}{\frac{180}{\pi}}\right)\right)\\
\end{array}
\end{array}
if a < 1.32e16Initial program 13.7%
Simplified11.5%
Taylor expanded in angle around 0
associate-*r/N/A
+-commutativeN/A
difference-of-squaresN/A
unpow2N/A
unpow2N/A
/-lowering-/.f64N/A
Simplified11.4%
Taylor expanded in a around 0
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6444.1%
Simplified44.1%
if 1.32e16 < a Initial program 12.8%
Simplified14.4%
Taylor expanded in x-scale around 0
Simplified20.6%
Taylor expanded in a around inf
/-lowering-/.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6457.1%
Simplified57.1%
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
Applied egg-rr67.7%
Final simplification49.4%
a_m = (fabs.f64 a)
(FPCore (a_m b angle x-scale y-scale)
:precision binary64
(if (<= a_m 2800000000.0)
(/ (* 180.0 (atan (/ (* y-scale -180.0) (* angle (* x-scale PI))))) PI)
(/
(*
180.0
(atan (* angle (/ (* 0.005555555555555556 (* y-scale 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 <= 2800000000.0) {
tmp = (180.0 * atan(((y_45_scale * -180.0) / (angle * (x_45_scale * ((double) M_PI)))))) / ((double) M_PI);
} else {
tmp = (180.0 * atan((angle * ((0.005555555555555556 * (y_45_scale * ((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 <= 2800000000.0) {
tmp = (180.0 * Math.atan(((y_45_scale * -180.0) / (angle * (x_45_scale * Math.PI))))) / Math.PI;
} else {
tmp = (180.0 * Math.atan((angle * ((0.005555555555555556 * (y_45_scale * 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 <= 2800000000.0: tmp = (180.0 * math.atan(((y_45_scale * -180.0) / (angle * (x_45_scale * math.pi))))) / math.pi else: tmp = (180.0 * math.atan((angle * ((0.005555555555555556 * (y_45_scale * 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 <= 2800000000.0) tmp = Float64(Float64(180.0 * atan(Float64(Float64(y_45_scale * -180.0) / Float64(angle * Float64(x_45_scale * pi))))) / pi); else tmp = Float64(Float64(180.0 * atan(Float64(angle * Float64(Float64(0.005555555555555556 * Float64(y_45_scale * 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 <= 2800000000.0) tmp = (180.0 * atan(((y_45_scale * -180.0) / (angle * (x_45_scale * pi))))) / pi; else tmp = (180.0 * atan((angle * ((0.005555555555555556 * (y_45_scale * 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, 2800000000.0], N[(N[(180.0 * N[ArcTan[N[(N[(y$45$scale * -180.0), $MachinePrecision] / N[(angle * N[(x$45$scale * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], N[(N[(180.0 * N[ArcTan[N[(angle * N[(N[(0.005555555555555556 * N[(y$45$scale * Pi), $MachinePrecision]), $MachinePrecision] / x$45$scale), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision]]
\begin{array}{l}
a_m = \left|a\right|
\\
\begin{array}{l}
\mathbf{if}\;a\_m \leq 2800000000:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{y-scale \cdot -180}{angle \cdot \left(x-scale \cdot \pi\right)}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(angle \cdot \frac{0.005555555555555556 \cdot \left(y-scale \cdot \pi\right)}{x-scale}\right)}{\pi}\\
\end{array}
\end{array}
if a < 2.8e9Initial program 13.7%
Simplified11.5%
Taylor expanded in angle around 0
associate-*r/N/A
+-commutativeN/A
difference-of-squaresN/A
unpow2N/A
unpow2N/A
/-lowering-/.f64N/A
Simplified11.4%
Taylor expanded in a around 0
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6444.1%
Simplified44.1%
if 2.8e9 < a Initial program 12.8%
Simplified14.4%
Taylor expanded in x-scale around 0
Simplified20.6%
Taylor expanded in a around inf
/-lowering-/.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6457.1%
Simplified57.1%
Taylor expanded in angle around 0
Simplified62.1%
Taylor expanded in angle around 0
*-commutativeN/A
associate-/l*N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6462.7%
Simplified62.7%
Final simplification48.3%
a_m = (fabs.f64 a) (FPCore (a_m b angle x-scale y-scale) :precision binary64 (/ (* 180.0 (atan (* angle (/ (* 0.005555555555555556 (* y-scale 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((angle * ((0.005555555555555556 * (y_45_scale * ((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((angle * ((0.005555555555555556 * (y_45_scale * 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((angle * ((0.005555555555555556 * (y_45_scale * 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(Float64(180.0 * atan(Float64(angle * Float64(Float64(0.005555555555555556 * Float64(y_45_scale * 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((angle * ((0.005555555555555556 * (y_45_scale * 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[(N[(180.0 * N[ArcTan[N[(angle * N[(N[(0.005555555555555556 * N[(y$45$scale * Pi), $MachinePrecision]), $MachinePrecision] / x$45$scale), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
\frac{180 \cdot \tan^{-1} \left(angle \cdot \frac{0.005555555555555556 \cdot \left(y-scale \cdot \pi\right)}{x-scale}\right)}{\pi}
\end{array}
Initial program 13.5%
Simplified12.1%
Taylor expanded in x-scale around 0
Simplified28.1%
Taylor expanded in a around inf
/-lowering-/.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6447.8%
Simplified47.8%
Taylor expanded in angle around 0
Simplified51.6%
Taylor expanded in angle around 0
*-commutativeN/A
associate-/l*N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6446.2%
Simplified46.2%
a_m = (fabs.f64 a) (FPCore (a_m b angle x-scale y-scale) :precision binary64 (* 180.0 (/ (atan (* (* (* angle PI) 0.005555555555555556) (/ y-scale 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((((angle * ((double) M_PI)) * 0.005555555555555556) * (y_45_scale / 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((((angle * Math.PI) * 0.005555555555555556) * (y_45_scale / 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((((angle * math.pi) * 0.005555555555555556) * (y_45_scale / 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(Float64(Float64(angle * pi) * 0.005555555555555556) * Float64(y_45_scale / 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((((angle * pi) * 0.005555555555555556) * (y_45_scale / 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[(N[(N[(angle * Pi), $MachinePrecision] * 0.005555555555555556), $MachinePrecision] * N[(y$45$scale / x$45$scale), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
180 \cdot \frac{\tan^{-1} \left(\left(\left(angle \cdot \pi\right) \cdot 0.005555555555555556\right) \cdot \frac{y-scale}{x-scale}\right)}{\pi}
\end{array}
Initial program 13.5%
Simplified12.1%
Taylor expanded in x-scale around 0
Simplified28.1%
Taylor expanded in a around inf
/-lowering-/.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6447.8%
Simplified47.8%
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
Applied egg-rr49.5%
Taylor expanded in angle around 0
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6446.2%
Simplified46.2%
Final simplification46.2%
a_m = (fabs.f64 a) (FPCore (a_m b angle x-scale y-scale) :precision binary64 (* 180.0 (/ (atan (* angle (/ (* 0.005555555555555556 (* y-scale 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((angle * ((0.005555555555555556 * (y_45_scale * ((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((angle * ((0.005555555555555556 * (y_45_scale * 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((angle * ((0.005555555555555556 * (y_45_scale * 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(angle * Float64(Float64(0.005555555555555556 * Float64(y_45_scale * 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((angle * ((0.005555555555555556 * (y_45_scale * 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[(angle * N[(N[(0.005555555555555556 * N[(y$45$scale * Pi), $MachinePrecision]), $MachinePrecision] / x$45$scale), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
180 \cdot \frac{\tan^{-1} \left(angle \cdot \frac{0.005555555555555556 \cdot \left(y-scale \cdot \pi\right)}{x-scale}\right)}{\pi}
\end{array}
Initial program 13.5%
Simplified12.1%
Taylor expanded in x-scale around 0
Simplified28.1%
Taylor expanded in a around inf
/-lowering-/.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6447.8%
Simplified47.8%
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
Applied egg-rr49.5%
Taylor expanded in angle around 0
*-commutativeN/A
associate-/l*N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6446.1%
Simplified46.1%
Final simplification46.1%
herbie shell --seed 2024155
(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)))