
(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 (* (* 0.005555555555555556 angle) PI)))
(if (<= a_m 5e+54)
(*
180.0
(*
(atan
(/
(* y-scale (/ (pow (cos t_0) 2.0) x-scale))
(*
(sin t_0)
(- (cos (* (* 0.005555555555555556 angle) (cbrt (pow PI 3.0))))))))
(/ 1.0 PI)))
(*
180.0
(/
(atan
(* y-scale (/ (sin (* 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 t_0 = (0.005555555555555556 * angle) * ((double) M_PI);
double tmp;
if (a_m <= 5e+54) {
tmp = 180.0 * (atan(((y_45_scale * (pow(cos(t_0), 2.0) / x_45_scale)) / (sin(t_0) * -cos(((0.005555555555555556 * angle) * cbrt(pow(((double) M_PI), 3.0))))))) * (1.0 / ((double) M_PI)));
} else {
tmp = 180.0 * (atan((y_45_scale * (sin((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 t_0 = (0.005555555555555556 * angle) * Math.PI;
double tmp;
if (a_m <= 5e+54) {
tmp = 180.0 * (Math.atan(((y_45_scale * (Math.pow(Math.cos(t_0), 2.0) / x_45_scale)) / (Math.sin(t_0) * -Math.cos(((0.005555555555555556 * angle) * Math.cbrt(Math.pow(Math.PI, 3.0))))))) * (1.0 / Math.PI));
} else {
tmp = 180.0 * (Math.atan((y_45_scale * (Math.sin((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) t_0 = Float64(Float64(0.005555555555555556 * angle) * pi) tmp = 0.0 if (a_m <= 5e+54) tmp = Float64(180.0 * Float64(atan(Float64(Float64(y_45_scale * Float64((cos(t_0) ^ 2.0) / x_45_scale)) / Float64(sin(t_0) * Float64(-cos(Float64(Float64(0.005555555555555556 * angle) * cbrt((pi ^ 3.0)))))))) * Float64(1.0 / pi))); else tmp = Float64(180.0 * Float64(atan(Float64(y_45_scale * Float64(sin(Float64(0.005555555555555556 * Float64(angle * pi))) / x_45_scale))) / 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[(N[(0.005555555555555556 * angle), $MachinePrecision] * Pi), $MachinePrecision]}, If[LessEqual[a$95$m, 5e+54], N[(180.0 * N[(N[ArcTan[N[(N[(y$45$scale * N[(N[Power[N[Cos[t$95$0], $MachinePrecision], 2.0], $MachinePrecision] / x$45$scale), $MachinePrecision]), $MachinePrecision] / N[(N[Sin[t$95$0], $MachinePrecision] * (-N[Cos[N[(N[(0.005555555555555556 * angle), $MachinePrecision] * N[Power[N[Power[Pi, 3.0], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 / Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(y$45$scale * N[(N[Sin[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}
t_0 := \left(0.005555555555555556 \cdot angle\right) \cdot \pi\\
\mathbf{if}\;a\_m \leq 5 \cdot 10^{+54}:\\
\;\;\;\;180 \cdot \left(\tan^{-1} \left(\frac{y-scale \cdot \frac{{\cos t\_0}^{2}}{x-scale}}{\sin t\_0 \cdot \left(-\cos \left(\left(0.005555555555555556 \cdot angle\right) \cdot \sqrt[3]{{\pi}^{3}}\right)\right)}\right) \cdot \frac{1}{\pi}\right)\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(y-scale \cdot \frac{\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}{x-scale}\right)}{\pi}\\
\end{array}
\end{array}
if a < 5.00000000000000005e54Initial program 20.1%
Simplified16.3%
Taylor expanded in b around inf 21.8%
associate-*r/21.8%
Simplified19.4%
Taylor expanded in x-scale around 0 51.3%
associate-/l*51.4%
Simplified51.4%
div-inv51.4%
Applied egg-rr50.9%
add-cbrt-cube54.8%
pow354.8%
Applied egg-rr54.8%
if 5.00000000000000005e54 < a Initial program 6.3%
Simplified6.4%
Taylor expanded in x-scale around 0 10.7%
Simplified18.4%
Taylor expanded in angle around 0 22.8%
Taylor expanded in a around inf 60.8%
associate-/l*63.6%
Simplified63.6%
Final simplification57.1%
a_m = (fabs.f64 a)
(FPCore (a_m b angle x-scale y-scale)
:precision binary64
(let* ((t_0 (sin (* 0.005555555555555556 (* angle PI)))))
(if (<= a_m 6.1e+54)
(*
180.0
(/
(atan
(/
(* 0.5 (* -2.0 (* y-scale (/ 1.0 x-scale))))
(*
t_0
(cos
(*
0.005555555555555556
(* angle (* (cbrt PI) (pow (cbrt PI) 2.0))))))))
PI))
(* 180.0 (/ (atan (* y-scale (/ t_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 = sin((0.005555555555555556 * (angle * ((double) M_PI))));
double tmp;
if (a_m <= 6.1e+54) {
tmp = 180.0 * (atan(((0.5 * (-2.0 * (y_45_scale * (1.0 / x_45_scale)))) / (t_0 * cos((0.005555555555555556 * (angle * (cbrt(((double) M_PI)) * pow(cbrt(((double) M_PI)), 2.0)))))))) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((y_45_scale * (t_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 = Math.sin((0.005555555555555556 * (angle * Math.PI)));
double tmp;
if (a_m <= 6.1e+54) {
tmp = 180.0 * (Math.atan(((0.5 * (-2.0 * (y_45_scale * (1.0 / x_45_scale)))) / (t_0 * Math.cos((0.005555555555555556 * (angle * (Math.cbrt(Math.PI) * Math.pow(Math.cbrt(Math.PI), 2.0)))))))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((y_45_scale * (t_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 = sin(Float64(0.005555555555555556 * Float64(angle * pi))) tmp = 0.0 if (a_m <= 6.1e+54) tmp = Float64(180.0 * Float64(atan(Float64(Float64(0.5 * Float64(-2.0 * Float64(y_45_scale * Float64(1.0 / x_45_scale)))) / Float64(t_0 * cos(Float64(0.005555555555555556 * Float64(angle * Float64(cbrt(pi) * (cbrt(pi) ^ 2.0)))))))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(y_45_scale * Float64(t_0 / x_45_scale))) / 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[Sin[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[a$95$m, 6.1e+54], N[(180.0 * N[(N[ArcTan[N[(N[(0.5 * N[(-2.0 * N[(y$45$scale * N[(1.0 / x$45$scale), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t$95$0 * N[Cos[N[(0.005555555555555556 * N[(angle * N[(N[Power[Pi, 1/3], $MachinePrecision] * N[Power[N[Power[Pi, 1/3], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(y$45$scale * N[(t$95$0 / x$45$scale), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
a_m = \left|a\right|
\\
\begin{array}{l}
t_0 := \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\\
\mathbf{if}\;a\_m \leq 6.1 \cdot 10^{+54}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{0.5 \cdot \left(-2 \cdot \left(y-scale \cdot \frac{1}{x-scale}\right)\right)}{t\_0 \cdot \cos \left(0.005555555555555556 \cdot \left(angle \cdot \left(\sqrt[3]{\pi} \cdot {\left(\sqrt[3]{\pi}\right)}^{2}\right)\right)\right)}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(y-scale \cdot \frac{t\_0}{x-scale}\right)}{\pi}\\
\end{array}
\end{array}
if a < 6.0999999999999998e54Initial program 20.1%
Simplified16.3%
Taylor expanded in b around inf 21.8%
associate-*r/21.8%
Simplified19.4%
Taylor expanded in x-scale around 0 51.3%
associate-/l*51.4%
Simplified51.4%
add-cube-cbrt54.4%
pow254.4%
Applied egg-rr54.4%
Taylor expanded in angle around 0 53.5%
if 6.0999999999999998e54 < a Initial program 6.3%
Simplified6.4%
Taylor expanded in x-scale around 0 10.7%
Simplified18.4%
Taylor expanded in angle around 0 22.8%
Taylor expanded in a around inf 60.8%
associate-/l*63.6%
Simplified63.6%
Final simplification56.1%
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 (sin t_0)))
(if (<= a_m 4e+54)
(*
180.0
(/ (atan (/ (* (pow (cos t_0) 2.0) (- y-scale)) (* x-scale t_1))) PI))
(* 180.0 (/ (atan (* y-scale (/ t_1 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 = 0.005555555555555556 * (angle * ((double) M_PI));
double t_1 = sin(t_0);
double tmp;
if (a_m <= 4e+54) {
tmp = 180.0 * (atan(((pow(cos(t_0), 2.0) * -y_45_scale) / (x_45_scale * t_1))) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((y_45_scale * (t_1 / 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 = 0.005555555555555556 * (angle * Math.PI);
double t_1 = Math.sin(t_0);
double tmp;
if (a_m <= 4e+54) {
tmp = 180.0 * (Math.atan(((Math.pow(Math.cos(t_0), 2.0) * -y_45_scale) / (x_45_scale * t_1))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((y_45_scale * (t_1 / 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 = 0.005555555555555556 * (angle * math.pi) t_1 = math.sin(t_0) tmp = 0 if a_m <= 4e+54: tmp = 180.0 * (math.atan(((math.pow(math.cos(t_0), 2.0) * -y_45_scale) / (x_45_scale * t_1))) / math.pi) else: tmp = 180.0 * (math.atan((y_45_scale * (t_1 / 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(0.005555555555555556 * Float64(angle * pi)) t_1 = sin(t_0) tmp = 0.0 if (a_m <= 4e+54) tmp = Float64(180.0 * Float64(atan(Float64(Float64((cos(t_0) ^ 2.0) * Float64(-y_45_scale)) / Float64(x_45_scale * t_1))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(y_45_scale * Float64(t_1 / 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 = 0.005555555555555556 * (angle * pi); t_1 = sin(t_0); tmp = 0.0; if (a_m <= 4e+54) tmp = 180.0 * (atan((((cos(t_0) ^ 2.0) * -y_45_scale) / (x_45_scale * t_1))) / pi); else tmp = 180.0 * (atan((y_45_scale * (t_1 / 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[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sin[t$95$0], $MachinePrecision]}, If[LessEqual[a$95$m, 4e+54], N[(180.0 * N[(N[ArcTan[N[(N[(N[Power[N[Cos[t$95$0], $MachinePrecision], 2.0], $MachinePrecision] * (-y$45$scale)), $MachinePrecision] / N[(x$45$scale * t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(y$45$scale * N[(t$95$1 / x$45$scale), $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 := \sin t\_0\\
\mathbf{if}\;a\_m \leq 4 \cdot 10^{+54}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{{\cos t\_0}^{2} \cdot \left(-y-scale\right)}{x-scale \cdot t\_1}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(y-scale \cdot \frac{t\_1}{x-scale}\right)}{\pi}\\
\end{array}
\end{array}
if a < 4.0000000000000003e54Initial program 20.1%
Simplified16.3%
Taylor expanded in x-scale around 0 31.5%
Simplified37.7%
Taylor expanded in angle around 0 38.7%
Taylor expanded in a around 0 50.1%
associate-*r/50.1%
neg-mul-150.1%
*-commutative50.1%
distribute-rgt-neg-in50.1%
Simplified50.1%
if 4.0000000000000003e54 < a Initial program 6.3%
Simplified6.4%
Taylor expanded in x-scale around 0 10.7%
Simplified18.4%
Taylor expanded in angle around 0 22.8%
Taylor expanded in a around inf 60.8%
associate-/l*63.6%
Simplified63.6%
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 8e+54)
(*
180.0
(/
(atan (* y-scale (/ (pow (cos t_0) 2.0) (* (sin t_0) (- x-scale)))))
PI))
(*
180.0
(/
(atan
(* y-scale (/ (sin (* 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 t_0 = (0.005555555555555556 * angle) * ((double) M_PI);
double tmp;
if (a_m <= 8e+54) {
tmp = 180.0 * (atan((y_45_scale * (pow(cos(t_0), 2.0) / (sin(t_0) * -x_45_scale)))) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((y_45_scale * (sin((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 t_0 = (0.005555555555555556 * angle) * Math.PI;
double tmp;
if (a_m <= 8e+54) {
tmp = 180.0 * (Math.atan((y_45_scale * (Math.pow(Math.cos(t_0), 2.0) / (Math.sin(t_0) * -x_45_scale)))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((y_45_scale * (Math.sin((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): t_0 = (0.005555555555555556 * angle) * math.pi tmp = 0 if a_m <= 8e+54: tmp = 180.0 * (math.atan((y_45_scale * (math.pow(math.cos(t_0), 2.0) / (math.sin(t_0) * -x_45_scale)))) / math.pi) else: tmp = 180.0 * (math.atan((y_45_scale * (math.sin((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) t_0 = Float64(Float64(0.005555555555555556 * angle) * pi) tmp = 0.0 if (a_m <= 8e+54) tmp = Float64(180.0 * Float64(atan(Float64(y_45_scale * Float64((cos(t_0) ^ 2.0) / Float64(sin(t_0) * Float64(-x_45_scale))))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(y_45_scale * Float64(sin(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) t_0 = (0.005555555555555556 * angle) * pi; tmp = 0.0; if (a_m <= 8e+54) tmp = 180.0 * (atan((y_45_scale * ((cos(t_0) ^ 2.0) / (sin(t_0) * -x_45_scale)))) / pi); else tmp = 180.0 * (atan((y_45_scale * (sin((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_] := Block[{t$95$0 = N[(N[(0.005555555555555556 * angle), $MachinePrecision] * Pi), $MachinePrecision]}, If[LessEqual[a$95$m, 8e+54], N[(180.0 * N[(N[ArcTan[N[(y$45$scale * N[(N[Power[N[Cos[t$95$0], $MachinePrecision], 2.0], $MachinePrecision] / N[(N[Sin[t$95$0], $MachinePrecision] * (-x$45$scale)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(y$45$scale * N[(N[Sin[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}
t_0 := \left(0.005555555555555556 \cdot angle\right) \cdot \pi\\
\mathbf{if}\;a\_m \leq 8 \cdot 10^{+54}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(y-scale \cdot \frac{{\cos t\_0}^{2}}{\sin t\_0 \cdot \left(-x-scale\right)}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(y-scale \cdot \frac{\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}{x-scale}\right)}{\pi}\\
\end{array}
\end{array}
if a < 8.0000000000000006e54Initial program 20.1%
Simplified16.3%
Taylor expanded in x-scale around 0 31.5%
Simplified37.7%
Taylor expanded in angle around 0 38.7%
Taylor expanded in a around 0 50.1%
mul-1-neg50.1%
associate-/l*50.1%
associate-*r*50.0%
*-commutative50.0%
associate-*r*50.9%
*-commutative50.9%
Simplified50.9%
if 8.0000000000000006e54 < a Initial program 6.3%
Simplified6.4%
Taylor expanded in x-scale around 0 10.7%
Simplified18.4%
Taylor expanded in angle around 0 22.8%
Taylor expanded in a around inf 60.8%
associate-/l*63.6%
Simplified63.6%
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))) (t_1 (sin t_0)))
(if (<= a_m 4.3e+54)
(* 180.0 (/ (atan (* y-scale (/ (/ (cos t_0) x-scale) (- t_1)))) PI))
(* 180.0 (/ (atan (* y-scale (/ t_1 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 = 0.005555555555555556 * (angle * ((double) M_PI));
double t_1 = sin(t_0);
double tmp;
if (a_m <= 4.3e+54) {
tmp = 180.0 * (atan((y_45_scale * ((cos(t_0) / x_45_scale) / -t_1))) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((y_45_scale * (t_1 / 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 = 0.005555555555555556 * (angle * Math.PI);
double t_1 = Math.sin(t_0);
double tmp;
if (a_m <= 4.3e+54) {
tmp = 180.0 * (Math.atan((y_45_scale * ((Math.cos(t_0) / x_45_scale) / -t_1))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((y_45_scale * (t_1 / 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 = 0.005555555555555556 * (angle * math.pi) t_1 = math.sin(t_0) tmp = 0 if a_m <= 4.3e+54: tmp = 180.0 * (math.atan((y_45_scale * ((math.cos(t_0) / x_45_scale) / -t_1))) / math.pi) else: tmp = 180.0 * (math.atan((y_45_scale * (t_1 / 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(0.005555555555555556 * Float64(angle * pi)) t_1 = sin(t_0) tmp = 0.0 if (a_m <= 4.3e+54) tmp = Float64(180.0 * Float64(atan(Float64(y_45_scale * Float64(Float64(cos(t_0) / x_45_scale) / Float64(-t_1)))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(y_45_scale * Float64(t_1 / 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 = 0.005555555555555556 * (angle * pi); t_1 = sin(t_0); tmp = 0.0; if (a_m <= 4.3e+54) tmp = 180.0 * (atan((y_45_scale * ((cos(t_0) / x_45_scale) / -t_1))) / pi); else tmp = 180.0 * (atan((y_45_scale * (t_1 / 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[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sin[t$95$0], $MachinePrecision]}, If[LessEqual[a$95$m, 4.3e+54], N[(180.0 * N[(N[ArcTan[N[(y$45$scale * N[(N[(N[Cos[t$95$0], $MachinePrecision] / x$45$scale), $MachinePrecision] / (-t$95$1)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(y$45$scale * N[(t$95$1 / x$45$scale), $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 := \sin t\_0\\
\mathbf{if}\;a\_m \leq 4.3 \cdot 10^{+54}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(y-scale \cdot \frac{\frac{\cos t\_0}{x-scale}}{-t\_1}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(y-scale \cdot \frac{t\_1}{x-scale}\right)}{\pi}\\
\end{array}
\end{array}
if a < 4.29999999999999976e54Initial program 20.1%
Simplified16.3%
Taylor expanded in x-scale around 0 31.5%
Simplified37.7%
Taylor expanded in a around 0 50.5%
mul-1-neg50.5%
associate-/l*50.5%
associate-/r*50.5%
Simplified50.5%
if 4.29999999999999976e54 < a Initial program 6.3%
Simplified6.4%
Taylor expanded in x-scale around 0 10.7%
Simplified18.4%
Taylor expanded in angle around 0 22.8%
Taylor expanded in a around inf 60.8%
associate-/l*63.6%
Simplified63.6%
Final simplification53.9%
a_m = (fabs.f64 a)
(FPCore (a_m b angle x-scale y-scale)
:precision binary64
(if (<= a_m 1.85e-93)
(* 180.0 (/ (atan (/ (* y-scale -180.0) (* angle (* PI x-scale)))) PI))
(*
180.0
(/
(atan (* y-scale (/ (sin (* 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 <= 1.85e-93) {
tmp = 180.0 * (atan(((y_45_scale * -180.0) / (angle * (((double) M_PI) * x_45_scale)))) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((y_45_scale * (sin((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 <= 1.85e-93) {
tmp = 180.0 * (Math.atan(((y_45_scale * -180.0) / (angle * (Math.PI * x_45_scale)))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((y_45_scale * (Math.sin((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 <= 1.85e-93: tmp = 180.0 * (math.atan(((y_45_scale * -180.0) / (angle * (math.pi * x_45_scale)))) / math.pi) else: tmp = 180.0 * (math.atan((y_45_scale * (math.sin((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 <= 1.85e-93) tmp = Float64(180.0 * Float64(atan(Float64(Float64(y_45_scale * -180.0) / Float64(angle * Float64(pi * x_45_scale)))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(y_45_scale * Float64(sin(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 <= 1.85e-93) tmp = 180.0 * (atan(((y_45_scale * -180.0) / (angle * (pi * x_45_scale)))) / pi); else tmp = 180.0 * (atan((y_45_scale * (sin((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, 1.85e-93], N[(180.0 * N[(N[ArcTan[N[(N[(y$45$scale * -180.0), $MachinePrecision] / N[(angle * N[(Pi * x$45$scale), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(y$45$scale * N[(N[Sin[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 1.85 \cdot 10^{-93}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{y-scale \cdot -180}{angle \cdot \left(\pi \cdot x-scale\right)}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(y-scale \cdot \frac{\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}{x-scale}\right)}{\pi}\\
\end{array}
\end{array}
if a < 1.85000000000000001e-93Initial program 20.4%
Simplified16.1%
Taylor expanded in b around inf 21.7%
associate-*r/21.7%
Simplified19.0%
Taylor expanded in x-scale around 0 51.4%
associate-/l*51.4%
Simplified51.4%
Taylor expanded in angle around 0 49.9%
associate-*r/49.9%
*-commutative49.9%
Simplified49.9%
if 1.85000000000000001e-93 < a Initial program 9.3%
Simplified9.3%
Taylor expanded in x-scale around 0 16.9%
Simplified24.3%
Taylor expanded in angle around 0 27.5%
Taylor expanded in a around inf 55.3%
associate-/l*57.5%
Simplified57.5%
Final simplification52.6%
a_m = (fabs.f64 a) (FPCore (a_m b angle x-scale y-scale) :precision binary64 (* 180.0 (/ (atan (* -180.0 (/ 1.0 (* angle (/ (* PI x-scale) y-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 * (1.0 / (angle * ((((double) M_PI) * x_45_scale) / y_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 * (1.0 / (angle * ((Math.PI * x_45_scale) / y_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 * (1.0 / (angle * ((math.pi * x_45_scale) / y_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(1.0 / Float64(angle * Float64(Float64(pi * x_45_scale) / y_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 * (1.0 / (angle * ((pi * x_45_scale) / y_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[(1.0 / N[(angle * N[(N[(Pi * x$45$scale), $MachinePrecision] / y$45$scale), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
180 \cdot \frac{\tan^{-1} \left(-180 \cdot \frac{1}{angle \cdot \frac{\pi \cdot x-scale}{y-scale}}\right)}{\pi}
\end{array}
Initial program 16.5%
Simplified13.7%
Taylor expanded in angle around 0 14.0%
associate-*r/14.0%
associate-*r*13.8%
distribute-lft-out--13.8%
associate-*r*13.8%
Simplified13.8%
Taylor expanded in a around 0 41.6%
*-commutative41.6%
Simplified41.6%
clear-num42.1%
inv-pow42.1%
Applied egg-rr42.1%
unpow-142.1%
associate-/l*42.9%
Simplified42.9%
a_m = (fabs.f64 a) (FPCore (a_m b angle x-scale y-scale) :precision binary64 (* 180.0 (/ 1.0 (/ PI (atan (* (/ y-scale (* PI x-scale)) (/ -180.0 angle)))))))
a_m = fabs(a);
double code(double a_m, double b, double angle, double x_45_scale, double y_45_scale) {
return 180.0 * (1.0 / (((double) M_PI) / atan(((y_45_scale / (((double) M_PI) * x_45_scale)) * (-180.0 / angle)))));
}
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 * (1.0 / (Math.PI / Math.atan(((y_45_scale / (Math.PI * x_45_scale)) * (-180.0 / angle)))));
}
a_m = math.fabs(a) def code(a_m, b, angle, x_45_scale, y_45_scale): return 180.0 * (1.0 / (math.pi / math.atan(((y_45_scale / (math.pi * x_45_scale)) * (-180.0 / angle)))))
a_m = abs(a) function code(a_m, b, angle, x_45_scale, y_45_scale) return Float64(180.0 * Float64(1.0 / Float64(pi / atan(Float64(Float64(y_45_scale / Float64(pi * x_45_scale)) * Float64(-180.0 / angle)))))) end
a_m = abs(a); function tmp = code(a_m, b, angle, x_45_scale, y_45_scale) tmp = 180.0 * (1.0 / (pi / atan(((y_45_scale / (pi * x_45_scale)) * (-180.0 / angle))))); end
a_m = N[Abs[a], $MachinePrecision] code[a$95$m_, b_, angle_, x$45$scale_, y$45$scale_] := N[(180.0 * N[(1.0 / N[(Pi / N[ArcTan[N[(N[(y$45$scale / N[(Pi * x$45$scale), $MachinePrecision]), $MachinePrecision] * N[(-180.0 / angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
180 \cdot \frac{1}{\frac{\pi}{\tan^{-1} \left(\frac{y-scale}{\pi \cdot x-scale} \cdot \frac{-180}{angle}\right)}}
\end{array}
Initial program 16.5%
Simplified13.7%
Taylor expanded in angle around 0 14.0%
associate-*r/14.0%
associate-*r*13.8%
distribute-lft-out--13.8%
associate-*r*13.8%
Simplified13.8%
Taylor expanded in a around 0 41.6%
*-commutative41.6%
Simplified41.6%
clear-num41.8%
inv-pow41.8%
associate-/r*41.8%
Applied egg-rr41.8%
unpow-141.8%
*-commutative41.8%
associate-/r*41.8%
associate-*r/41.8%
*-commutative41.8%
*-commutative41.8%
*-commutative41.8%
times-frac42.2%
Simplified42.2%
a_m = (fabs.f64 a) (FPCore (a_m b angle x-scale y-scale) :precision binary64 (* 180.0 (/ (atan (* (/ y-scale (* PI x-scale)) (/ -180.0 angle))) 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(((y_45_scale / (((double) M_PI) * x_45_scale)) * (-180.0 / angle))) / ((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(((y_45_scale / (Math.PI * x_45_scale)) * (-180.0 / angle))) / Math.PI);
}
a_m = math.fabs(a) def code(a_m, b, angle, x_45_scale, y_45_scale): return 180.0 * (math.atan(((y_45_scale / (math.pi * x_45_scale)) * (-180.0 / angle))) / 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(y_45_scale / Float64(pi * x_45_scale)) * Float64(-180.0 / angle))) / pi)) end
a_m = abs(a); function tmp = code(a_m, b, angle, x_45_scale, y_45_scale) tmp = 180.0 * (atan(((y_45_scale / (pi * x_45_scale)) * (-180.0 / angle))) / 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[(y$45$scale / N[(Pi * x$45$scale), $MachinePrecision]), $MachinePrecision] * N[(-180.0 / angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
180 \cdot \frac{\tan^{-1} \left(\frac{y-scale}{\pi \cdot x-scale} \cdot \frac{-180}{angle}\right)}{\pi}
\end{array}
Initial program 16.5%
Simplified13.7%
Taylor expanded in b around inf 20.0%
associate-*r/20.0%
Simplified18.2%
Taylor expanded in x-scale around 0 46.3%
associate-/l*46.3%
Simplified46.3%
add-cube-cbrt48.4%
pow248.4%
Applied egg-rr48.4%
Taylor expanded in angle around 0 41.6%
associate-*r/41.6%
*-commutative41.6%
*-commutative41.6%
*-commutative41.6%
times-frac42.2%
Simplified42.2%
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 16.5%
Simplified13.7%
Taylor expanded in angle around 0 14.0%
associate-*r/14.0%
associate-*r*13.8%
distribute-lft-out--13.8%
associate-*r*13.8%
Simplified13.8%
Taylor expanded in a around 0 41.6%
*-commutative41.6%
Simplified41.6%
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 16.5%
Simplified13.7%
Taylor expanded in angle around 0 14.0%
associate-*r/14.0%
associate-*r*13.8%
distribute-lft-out--13.8%
associate-*r*13.8%
Simplified13.8%
Taylor expanded in a around inf 10.9%
herbie shell --seed 2024136
(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)))