
(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 16 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
(if (<= a_m 1.8e-77)
(/
(*
180.0
(atan
(-
0.0
(/
(*
y-scale
(cos (* (sqrt PI) (* (* 0.005555555555555556 angle) (sqrt PI)))))
(* x-scale (sin (* 0.005555555555555556 (* angle PI))))))))
PI)
(*
(atan
(*
(/ y-scale x-scale)
(tan (* (sqrt PI) (* 0.005555555555555556 (* angle (sqrt PI)))))))
(/ 180.0 PI))))a_m = fabs(a);
double code(double a_m, double b, double angle, double x_45_scale, double y_45_scale) {
double tmp;
if (a_m <= 1.8e-77) {
tmp = (180.0 * atan((0.0 - ((y_45_scale * cos((sqrt(((double) M_PI)) * ((0.005555555555555556 * angle) * sqrt(((double) M_PI)))))) / (x_45_scale * sin((0.005555555555555556 * (angle * ((double) M_PI))))))))) / ((double) M_PI);
} else {
tmp = atan(((y_45_scale / x_45_scale) * tan((sqrt(((double) M_PI)) * (0.005555555555555556 * (angle * sqrt(((double) M_PI)))))))) * (180.0 / ((double) M_PI));
}
return tmp;
}
a_m = Math.abs(a);
public static double code(double a_m, double b, double angle, double x_45_scale, double y_45_scale) {
double tmp;
if (a_m <= 1.8e-77) {
tmp = (180.0 * Math.atan((0.0 - ((y_45_scale * Math.cos((Math.sqrt(Math.PI) * ((0.005555555555555556 * angle) * Math.sqrt(Math.PI))))) / (x_45_scale * Math.sin((0.005555555555555556 * (angle * Math.PI)))))))) / Math.PI;
} else {
tmp = Math.atan(((y_45_scale / x_45_scale) * Math.tan((Math.sqrt(Math.PI) * (0.005555555555555556 * (angle * Math.sqrt(Math.PI))))))) * (180.0 / Math.PI);
}
return tmp;
}
a_m = math.fabs(a) def code(a_m, b, angle, x_45_scale, y_45_scale): tmp = 0 if a_m <= 1.8e-77: tmp = (180.0 * math.atan((0.0 - ((y_45_scale * math.cos((math.sqrt(math.pi) * ((0.005555555555555556 * angle) * math.sqrt(math.pi))))) / (x_45_scale * math.sin((0.005555555555555556 * (angle * math.pi)))))))) / math.pi else: tmp = math.atan(((y_45_scale / x_45_scale) * math.tan((math.sqrt(math.pi) * (0.005555555555555556 * (angle * math.sqrt(math.pi))))))) * (180.0 / math.pi) return tmp
a_m = abs(a) function code(a_m, b, angle, x_45_scale, y_45_scale) tmp = 0.0 if (a_m <= 1.8e-77) tmp = Float64(Float64(180.0 * atan(Float64(0.0 - Float64(Float64(y_45_scale * cos(Float64(sqrt(pi) * Float64(Float64(0.005555555555555556 * angle) * sqrt(pi))))) / Float64(x_45_scale * sin(Float64(0.005555555555555556 * Float64(angle * pi)))))))) / pi); else tmp = Float64(atan(Float64(Float64(y_45_scale / x_45_scale) * tan(Float64(sqrt(pi) * Float64(0.005555555555555556 * Float64(angle * sqrt(pi))))))) * Float64(180.0 / pi)); end return tmp end
a_m = abs(a); function tmp_2 = code(a_m, b, angle, x_45_scale, y_45_scale) tmp = 0.0; if (a_m <= 1.8e-77) tmp = (180.0 * atan((0.0 - ((y_45_scale * cos((sqrt(pi) * ((0.005555555555555556 * angle) * sqrt(pi))))) / (x_45_scale * sin((0.005555555555555556 * (angle * pi)))))))) / pi; else tmp = atan(((y_45_scale / x_45_scale) * tan((sqrt(pi) * (0.005555555555555556 * (angle * sqrt(pi))))))) * (180.0 / pi); end tmp_2 = tmp; end
a_m = N[Abs[a], $MachinePrecision] code[a$95$m_, b_, angle_, x$45$scale_, y$45$scale_] := If[LessEqual[a$95$m, 1.8e-77], N[(N[(180.0 * N[ArcTan[N[(0.0 - N[(N[(y$45$scale * N[Cos[N[(N[Sqrt[Pi], $MachinePrecision] * N[(N[(0.005555555555555556 * angle), $MachinePrecision] * N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(x$45$scale * N[Sin[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], N[(N[ArcTan[N[(N[(y$45$scale / x$45$scale), $MachinePrecision] * N[Tan[N[(N[Sqrt[Pi], $MachinePrecision] * N[(0.005555555555555556 * N[(angle * N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(180.0 / Pi), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
a_m = \left|a\right|
\\
\begin{array}{l}
\mathbf{if}\;a\_m \leq 1.8 \cdot 10^{-77}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(0 - \frac{y-scale \cdot \cos \left(\sqrt{\pi} \cdot \left(\left(0.005555555555555556 \cdot angle\right) \cdot \sqrt{\pi}\right)\right)}{x-scale \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\tan^{-1} \left(\frac{y-scale}{x-scale} \cdot \tan \left(\sqrt{\pi} \cdot \left(0.005555555555555556 \cdot \left(angle \cdot \sqrt{\pi}\right)\right)\right)\right) \cdot \frac{180}{\pi}\\
\end{array}
\end{array}
if a < 1.8e-77Initial program 15.9%
Simplified13.3%
Taylor expanded in x-scale around 0
Simplified25.3%
Taylor expanded in a around 0
mul-1-negN/A
neg-lowering-neg.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6441.3%
Simplified41.3%
associate-*r*N/A
add-sqr-sqrtN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
PI-lowering-PI.f64N/A
sqrt-lowering-sqrt.f64N/A
PI-lowering-PI.f6445.5%
Applied egg-rr45.5%
if 1.8e-77 < a Initial program 6.7%
Simplified6.8%
Taylor expanded in x-scale around 0
Simplified22.8%
Taylor expanded in a around inf
/-lowering-/.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6459.4%
Simplified59.4%
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
Applied egg-rr60.6%
associate-*r*N/A
add-sqr-sqrtN/A
associate-*l*N/A
*-lowering-*.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
PI-lowering-PI.f64N/A
sqrt-lowering-sqrt.f64N/A
PI-lowering-PI.f6460.1%
Applied egg-rr60.1%
Final simplification49.9%
a_m = (fabs.f64 a)
(FPCore (a_m b angle x-scale y-scale)
:precision binary64
(if (<= a_m 7.8e-25)
(/
(*
180.0
(atan
(/
y-scale
(*
(sin (* (sqrt PI) (* (* 0.005555555555555556 angle) (sqrt PI))))
(- 0.0 x-scale)))))
PI)
(*
(atan
(*
(/ y-scale x-scale)
(tan (* (sqrt PI) (* 0.005555555555555556 (* angle (sqrt PI)))))))
(/ 180.0 PI))))a_m = fabs(a);
double code(double a_m, double b, double angle, double x_45_scale, double y_45_scale) {
double tmp;
if (a_m <= 7.8e-25) {
tmp = (180.0 * atan((y_45_scale / (sin((sqrt(((double) M_PI)) * ((0.005555555555555556 * angle) * sqrt(((double) M_PI))))) * (0.0 - x_45_scale))))) / ((double) M_PI);
} else {
tmp = atan(((y_45_scale / x_45_scale) * tan((sqrt(((double) M_PI)) * (0.005555555555555556 * (angle * sqrt(((double) M_PI)))))))) * (180.0 / ((double) M_PI));
}
return tmp;
}
a_m = Math.abs(a);
public static double code(double a_m, double b, double angle, double x_45_scale, double y_45_scale) {
double tmp;
if (a_m <= 7.8e-25) {
tmp = (180.0 * Math.atan((y_45_scale / (Math.sin((Math.sqrt(Math.PI) * ((0.005555555555555556 * angle) * Math.sqrt(Math.PI)))) * (0.0 - x_45_scale))))) / Math.PI;
} else {
tmp = Math.atan(((y_45_scale / x_45_scale) * Math.tan((Math.sqrt(Math.PI) * (0.005555555555555556 * (angle * Math.sqrt(Math.PI))))))) * (180.0 / Math.PI);
}
return tmp;
}
a_m = math.fabs(a) def code(a_m, b, angle, x_45_scale, y_45_scale): tmp = 0 if a_m <= 7.8e-25: tmp = (180.0 * math.atan((y_45_scale / (math.sin((math.sqrt(math.pi) * ((0.005555555555555556 * angle) * math.sqrt(math.pi)))) * (0.0 - x_45_scale))))) / math.pi else: tmp = math.atan(((y_45_scale / x_45_scale) * math.tan((math.sqrt(math.pi) * (0.005555555555555556 * (angle * math.sqrt(math.pi))))))) * (180.0 / math.pi) return tmp
a_m = abs(a) function code(a_m, b, angle, x_45_scale, y_45_scale) tmp = 0.0 if (a_m <= 7.8e-25) tmp = Float64(Float64(180.0 * atan(Float64(y_45_scale / Float64(sin(Float64(sqrt(pi) * Float64(Float64(0.005555555555555556 * angle) * sqrt(pi)))) * Float64(0.0 - x_45_scale))))) / pi); else tmp = Float64(atan(Float64(Float64(y_45_scale / x_45_scale) * tan(Float64(sqrt(pi) * Float64(0.005555555555555556 * Float64(angle * sqrt(pi))))))) * Float64(180.0 / pi)); end return tmp end
a_m = abs(a); function tmp_2 = code(a_m, b, angle, x_45_scale, y_45_scale) tmp = 0.0; if (a_m <= 7.8e-25) tmp = (180.0 * atan((y_45_scale / (sin((sqrt(pi) * ((0.005555555555555556 * angle) * sqrt(pi)))) * (0.0 - x_45_scale))))) / pi; else tmp = atan(((y_45_scale / x_45_scale) * tan((sqrt(pi) * (0.005555555555555556 * (angle * sqrt(pi))))))) * (180.0 / pi); end tmp_2 = tmp; end
a_m = N[Abs[a], $MachinePrecision] code[a$95$m_, b_, angle_, x$45$scale_, y$45$scale_] := If[LessEqual[a$95$m, 7.8e-25], N[(N[(180.0 * N[ArcTan[N[(y$45$scale / N[(N[Sin[N[(N[Sqrt[Pi], $MachinePrecision] * N[(N[(0.005555555555555556 * angle), $MachinePrecision] * N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(0.0 - x$45$scale), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], N[(N[ArcTan[N[(N[(y$45$scale / x$45$scale), $MachinePrecision] * N[Tan[N[(N[Sqrt[Pi], $MachinePrecision] * N[(0.005555555555555556 * N[(angle * N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(180.0 / Pi), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
a_m = \left|a\right|
\\
\begin{array}{l}
\mathbf{if}\;a\_m \leq 7.8 \cdot 10^{-25}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{y-scale}{\sin \left(\sqrt{\pi} \cdot \left(\left(0.005555555555555556 \cdot angle\right) \cdot \sqrt{\pi}\right)\right) \cdot \left(0 - x-scale\right)}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\tan^{-1} \left(\frac{y-scale}{x-scale} \cdot \tan \left(\sqrt{\pi} \cdot \left(0.005555555555555556 \cdot \left(angle \cdot \sqrt{\pi}\right)\right)\right)\right) \cdot \frac{180}{\pi}\\
\end{array}
\end{array}
if a < 7.8e-25Initial program 16.3%
Simplified12.8%
Taylor expanded in x-scale around 0
Simplified25.8%
Taylor expanded in a around 0
mul-1-negN/A
neg-lowering-neg.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6441.8%
Simplified41.8%
associate-*r*N/A
add-sqr-sqrtN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
PI-lowering-PI.f64N/A
sqrt-lowering-sqrt.f64N/A
PI-lowering-PI.f6441.1%
Applied egg-rr41.1%
Taylor expanded in angle around 0
Simplified42.5%
if 7.8e-25 < a Initial program 4.6%
Simplified7.6%
Taylor expanded in x-scale around 0
Simplified21.0%
Taylor expanded in a around inf
/-lowering-/.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6463.1%
Simplified63.1%
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
Applied egg-rr64.5%
associate-*r*N/A
add-sqr-sqrtN/A
associate-*l*N/A
*-lowering-*.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
PI-lowering-PI.f64N/A
sqrt-lowering-sqrt.f64N/A
PI-lowering-PI.f6462.4%
Applied egg-rr62.4%
Final simplification48.0%
a_m = (fabs.f64 a)
(FPCore (a_m b angle x-scale y-scale)
:precision binary64
(if (<= a_m 9.8e-26)
(/
(*
180.0
(atan
(/
(* y-scale (cos (* angle (* 0.005555555555555556 PI))))
(* (sin (* 0.005555555555555556 (* angle PI))) (- 0.0 x-scale)))))
PI)
(*
(atan
(*
(/ y-scale x-scale)
(tan (* (sqrt PI) (* 0.005555555555555556 (* angle (sqrt PI)))))))
(/ 180.0 PI))))a_m = fabs(a);
double code(double a_m, double b, double angle, double x_45_scale, double y_45_scale) {
double tmp;
if (a_m <= 9.8e-26) {
tmp = (180.0 * atan(((y_45_scale * cos((angle * (0.005555555555555556 * ((double) M_PI))))) / (sin((0.005555555555555556 * (angle * ((double) M_PI)))) * (0.0 - x_45_scale))))) / ((double) M_PI);
} else {
tmp = atan(((y_45_scale / x_45_scale) * tan((sqrt(((double) M_PI)) * (0.005555555555555556 * (angle * sqrt(((double) M_PI)))))))) * (180.0 / ((double) M_PI));
}
return tmp;
}
a_m = Math.abs(a);
public static double code(double a_m, double b, double angle, double x_45_scale, double y_45_scale) {
double tmp;
if (a_m <= 9.8e-26) {
tmp = (180.0 * Math.atan(((y_45_scale * Math.cos((angle * (0.005555555555555556 * Math.PI)))) / (Math.sin((0.005555555555555556 * (angle * Math.PI))) * (0.0 - x_45_scale))))) / Math.PI;
} else {
tmp = Math.atan(((y_45_scale / x_45_scale) * Math.tan((Math.sqrt(Math.PI) * (0.005555555555555556 * (angle * Math.sqrt(Math.PI))))))) * (180.0 / Math.PI);
}
return tmp;
}
a_m = math.fabs(a) def code(a_m, b, angle, x_45_scale, y_45_scale): tmp = 0 if a_m <= 9.8e-26: tmp = (180.0 * math.atan(((y_45_scale * math.cos((angle * (0.005555555555555556 * math.pi)))) / (math.sin((0.005555555555555556 * (angle * math.pi))) * (0.0 - x_45_scale))))) / math.pi else: tmp = math.atan(((y_45_scale / x_45_scale) * math.tan((math.sqrt(math.pi) * (0.005555555555555556 * (angle * math.sqrt(math.pi))))))) * (180.0 / math.pi) return tmp
a_m = abs(a) function code(a_m, b, angle, x_45_scale, y_45_scale) tmp = 0.0 if (a_m <= 9.8e-26) tmp = Float64(Float64(180.0 * atan(Float64(Float64(y_45_scale * cos(Float64(angle * Float64(0.005555555555555556 * pi)))) / Float64(sin(Float64(0.005555555555555556 * Float64(angle * pi))) * Float64(0.0 - x_45_scale))))) / pi); else tmp = Float64(atan(Float64(Float64(y_45_scale / x_45_scale) * tan(Float64(sqrt(pi) * Float64(0.005555555555555556 * Float64(angle * sqrt(pi))))))) * Float64(180.0 / pi)); end return tmp end
a_m = abs(a); function tmp_2 = code(a_m, b, angle, x_45_scale, y_45_scale) tmp = 0.0; if (a_m <= 9.8e-26) tmp = (180.0 * atan(((y_45_scale * cos((angle * (0.005555555555555556 * pi)))) / (sin((0.005555555555555556 * (angle * pi))) * (0.0 - x_45_scale))))) / pi; else tmp = atan(((y_45_scale / x_45_scale) * tan((sqrt(pi) * (0.005555555555555556 * (angle * sqrt(pi))))))) * (180.0 / pi); end tmp_2 = tmp; end
a_m = N[Abs[a], $MachinePrecision] code[a$95$m_, b_, angle_, x$45$scale_, y$45$scale_] := If[LessEqual[a$95$m, 9.8e-26], N[(N[(180.0 * N[ArcTan[N[(N[(y$45$scale * N[Cos[N[(angle * N[(0.005555555555555556 * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(N[Sin[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(0.0 - x$45$scale), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], N[(N[ArcTan[N[(N[(y$45$scale / x$45$scale), $MachinePrecision] * N[Tan[N[(N[Sqrt[Pi], $MachinePrecision] * N[(0.005555555555555556 * N[(angle * N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(180.0 / Pi), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
a_m = \left|a\right|
\\
\begin{array}{l}
\mathbf{if}\;a\_m \leq 9.8 \cdot 10^{-26}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{y-scale \cdot \cos \left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right)}{\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(0 - x-scale\right)}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\tan^{-1} \left(\frac{y-scale}{x-scale} \cdot \tan \left(\sqrt{\pi} \cdot \left(0.005555555555555556 \cdot \left(angle \cdot \sqrt{\pi}\right)\right)\right)\right) \cdot \frac{180}{\pi}\\
\end{array}
\end{array}
if a < 9.7999999999999998e-26Initial program 16.3%
Simplified12.8%
Taylor expanded in x-scale around 0
Simplified25.8%
Taylor expanded in a around 0
mul-1-negN/A
neg-lowering-neg.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6441.8%
Simplified41.8%
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6444.3%
Applied egg-rr44.3%
if 9.7999999999999998e-26 < a Initial program 4.6%
Simplified7.6%
Taylor expanded in x-scale around 0
Simplified21.0%
Taylor expanded in a around inf
/-lowering-/.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6463.1%
Simplified63.1%
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
Applied egg-rr64.5%
associate-*r*N/A
add-sqr-sqrtN/A
associate-*l*N/A
*-lowering-*.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
PI-lowering-PI.f64N/A
sqrt-lowering-sqrt.f64N/A
PI-lowering-PI.f6462.4%
Applied egg-rr62.4%
Final simplification49.2%
a_m = (fabs.f64 a)
(FPCore (a_m b angle x-scale y-scale)
:precision binary64
(let* ((t_0 (* 0.005555555555555556 (* angle PI))))
(if (<= a_m 4.6e-45)
(/ (* 180.0 (atan (/ -1.0 (* (tan t_0) (/ x-scale y-scale))))) PI)
(/ (* 180.0 (atan (/ (* (sin t_0) (/ y-scale 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 = 0.005555555555555556 * (angle * ((double) M_PI));
double tmp;
if (a_m <= 4.6e-45) {
tmp = (180.0 * atan((-1.0 / (tan(t_0) * (x_45_scale / y_45_scale))))) / ((double) M_PI);
} else {
tmp = (180.0 * atan(((sin(t_0) * (y_45_scale / 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 = 0.005555555555555556 * (angle * Math.PI);
double tmp;
if (a_m <= 4.6e-45) {
tmp = (180.0 * Math.atan((-1.0 / (Math.tan(t_0) * (x_45_scale / y_45_scale))))) / Math.PI;
} else {
tmp = (180.0 * Math.atan(((Math.sin(t_0) * (y_45_scale / 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 = 0.005555555555555556 * (angle * math.pi) tmp = 0 if a_m <= 4.6e-45: tmp = (180.0 * math.atan((-1.0 / (math.tan(t_0) * (x_45_scale / y_45_scale))))) / math.pi else: tmp = (180.0 * math.atan(((math.sin(t_0) * (y_45_scale / 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(0.005555555555555556 * Float64(angle * pi)) tmp = 0.0 if (a_m <= 4.6e-45) tmp = Float64(Float64(180.0 * atan(Float64(-1.0 / Float64(tan(t_0) * Float64(x_45_scale / y_45_scale))))) / pi); else tmp = Float64(Float64(180.0 * atan(Float64(Float64(sin(t_0) * Float64(y_45_scale / 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 = 0.005555555555555556 * (angle * pi); tmp = 0.0; if (a_m <= 4.6e-45) tmp = (180.0 * atan((-1.0 / (tan(t_0) * (x_45_scale / y_45_scale))))) / pi; else tmp = (180.0 * atan(((sin(t_0) * (y_45_scale / 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[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a$95$m, 4.6e-45], N[(N[(180.0 * N[ArcTan[N[(-1.0 / N[(N[Tan[t$95$0], $MachinePrecision] * N[(x$45$scale / y$45$scale), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], N[(N[(180.0 * N[ArcTan[N[(N[(N[Sin[t$95$0], $MachinePrecision] * N[(y$45$scale / x$45$scale), $MachinePrecision]), $MachinePrecision] / N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision]]]
\begin{array}{l}
a_m = \left|a\right|
\\
\begin{array}{l}
t_0 := 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\\
\mathbf{if}\;a\_m \leq 4.6 \cdot 10^{-45}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{-1}{\tan t\_0 \cdot \frac{x-scale}{y-scale}}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{\sin t\_0 \cdot \frac{y-scale}{x-scale}}{\cos t\_0}\right)}{\pi}\\
\end{array}
\end{array}
if a < 4.59999999999999983e-45Initial program 16.1%
Simplified13.0%
Taylor expanded in x-scale around 0
Simplified25.3%
Taylor expanded in a around 0
mul-1-negN/A
neg-lowering-neg.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6442.1%
Simplified42.1%
clear-numN/A
/-lowering-/.f64N/A
*-commutativeN/A
*-commutativeN/A
times-fracN/A
*-lowering-*.f64N/A
quot-tanN/A
tan-lowering-tan.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
/-lowering-/.f6447.2%
Applied egg-rr47.2%
if 4.59999999999999983e-45 < a Initial program 5.7%
Simplified7.2%
Taylor expanded in x-scale around 0
Simplified22.6%
Taylor expanded in a around inf
/-lowering-/.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6462.5%
Simplified62.5%
times-fracN/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6463.7%
Applied egg-rr63.7%
Final simplification52.0%
a_m = (fabs.f64 a)
(FPCore (a_m b angle x-scale y-scale)
:precision binary64
(let* ((t_0 (tan (* 0.005555555555555556 (* angle PI)))))
(if (<= a_m 5.3e-45)
(/ (* 180.0 (atan (/ -1.0 (* t_0 (/ x-scale y-scale))))) PI)
(* (/ 180.0 PI) (atan (* (/ y-scale x-scale) t_0))))))a_m = fabs(a);
double code(double a_m, double b, double angle, double x_45_scale, double y_45_scale) {
double t_0 = tan((0.005555555555555556 * (angle * ((double) M_PI))));
double tmp;
if (a_m <= 5.3e-45) {
tmp = (180.0 * atan((-1.0 / (t_0 * (x_45_scale / y_45_scale))))) / ((double) M_PI);
} else {
tmp = (180.0 / ((double) M_PI)) * atan(((y_45_scale / x_45_scale) * t_0));
}
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.tan((0.005555555555555556 * (angle * Math.PI)));
double tmp;
if (a_m <= 5.3e-45) {
tmp = (180.0 * Math.atan((-1.0 / (t_0 * (x_45_scale / y_45_scale))))) / Math.PI;
} else {
tmp = (180.0 / Math.PI) * Math.atan(((y_45_scale / x_45_scale) * t_0));
}
return tmp;
}
a_m = math.fabs(a) def code(a_m, b, angle, x_45_scale, y_45_scale): t_0 = math.tan((0.005555555555555556 * (angle * math.pi))) tmp = 0 if a_m <= 5.3e-45: tmp = (180.0 * math.atan((-1.0 / (t_0 * (x_45_scale / y_45_scale))))) / math.pi else: tmp = (180.0 / math.pi) * math.atan(((y_45_scale / x_45_scale) * t_0)) return tmp
a_m = abs(a) function code(a_m, b, angle, x_45_scale, y_45_scale) t_0 = tan(Float64(0.005555555555555556 * Float64(angle * pi))) tmp = 0.0 if (a_m <= 5.3e-45) tmp = Float64(Float64(180.0 * atan(Float64(-1.0 / Float64(t_0 * Float64(x_45_scale / y_45_scale))))) / pi); else tmp = Float64(Float64(180.0 / pi) * atan(Float64(Float64(y_45_scale / x_45_scale) * t_0))); end return tmp end
a_m = abs(a); function tmp_2 = code(a_m, b, angle, x_45_scale, y_45_scale) t_0 = tan((0.005555555555555556 * (angle * pi))); tmp = 0.0; if (a_m <= 5.3e-45) tmp = (180.0 * atan((-1.0 / (t_0 * (x_45_scale / y_45_scale))))) / pi; else tmp = (180.0 / pi) * atan(((y_45_scale / x_45_scale) * t_0)); 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[Tan[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[a$95$m, 5.3e-45], N[(N[(180.0 * N[ArcTan[N[(-1.0 / N[(t$95$0 * N[(x$45$scale / y$45$scale), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], N[(N[(180.0 / Pi), $MachinePrecision] * N[ArcTan[N[(N[(y$45$scale / x$45$scale), $MachinePrecision] * t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
a_m = \left|a\right|
\\
\begin{array}{l}
t_0 := \tan \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\\
\mathbf{if}\;a\_m \leq 5.3 \cdot 10^{-45}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{-1}{t\_0 \cdot \frac{x-scale}{y-scale}}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(\frac{y-scale}{x-scale} \cdot t\_0\right)\\
\end{array}
\end{array}
if a < 5.2999999999999997e-45Initial program 16.1%
Simplified13.0%
Taylor expanded in x-scale around 0
Simplified25.3%
Taylor expanded in a around 0
mul-1-negN/A
neg-lowering-neg.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6442.1%
Simplified42.1%
clear-numN/A
/-lowering-/.f64N/A
*-commutativeN/A
*-commutativeN/A
times-fracN/A
*-lowering-*.f64N/A
quot-tanN/A
tan-lowering-tan.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
/-lowering-/.f6447.2%
Applied egg-rr47.2%
if 5.2999999999999997e-45 < a Initial program 5.7%
Simplified7.2%
Taylor expanded in x-scale around 0
Simplified22.6%
Taylor expanded in a around inf
/-lowering-/.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6462.5%
Simplified62.5%
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
Applied egg-rr63.7%
Final simplification52.0%
a_m = (fabs.f64 a)
(FPCore (a_m b angle x-scale y-scale)
:precision binary64
(let* ((t_0 (tan (* 0.005555555555555556 (* angle PI)))))
(if (<= a_m 5.3e-45)
(/ (* 180.0 (atan (* (/ y-scale x-scale) (/ -1.0 t_0)))) PI)
(* (/ 180.0 PI) (atan (* (/ y-scale x-scale) t_0))))))a_m = fabs(a);
double code(double a_m, double b, double angle, double x_45_scale, double y_45_scale) {
double t_0 = tan((0.005555555555555556 * (angle * ((double) M_PI))));
double tmp;
if (a_m <= 5.3e-45) {
tmp = (180.0 * atan(((y_45_scale / x_45_scale) * (-1.0 / t_0)))) / ((double) M_PI);
} else {
tmp = (180.0 / ((double) M_PI)) * atan(((y_45_scale / x_45_scale) * t_0));
}
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.tan((0.005555555555555556 * (angle * Math.PI)));
double tmp;
if (a_m <= 5.3e-45) {
tmp = (180.0 * Math.atan(((y_45_scale / x_45_scale) * (-1.0 / t_0)))) / Math.PI;
} else {
tmp = (180.0 / Math.PI) * Math.atan(((y_45_scale / x_45_scale) * t_0));
}
return tmp;
}
a_m = math.fabs(a) def code(a_m, b, angle, x_45_scale, y_45_scale): t_0 = math.tan((0.005555555555555556 * (angle * math.pi))) tmp = 0 if a_m <= 5.3e-45: tmp = (180.0 * math.atan(((y_45_scale / x_45_scale) * (-1.0 / t_0)))) / math.pi else: tmp = (180.0 / math.pi) * math.atan(((y_45_scale / x_45_scale) * t_0)) return tmp
a_m = abs(a) function code(a_m, b, angle, x_45_scale, y_45_scale) t_0 = tan(Float64(0.005555555555555556 * Float64(angle * pi))) tmp = 0.0 if (a_m <= 5.3e-45) tmp = Float64(Float64(180.0 * atan(Float64(Float64(y_45_scale / x_45_scale) * Float64(-1.0 / t_0)))) / pi); else tmp = Float64(Float64(180.0 / pi) * atan(Float64(Float64(y_45_scale / x_45_scale) * t_0))); end return tmp end
a_m = abs(a); function tmp_2 = code(a_m, b, angle, x_45_scale, y_45_scale) t_0 = tan((0.005555555555555556 * (angle * pi))); tmp = 0.0; if (a_m <= 5.3e-45) tmp = (180.0 * atan(((y_45_scale / x_45_scale) * (-1.0 / t_0)))) / pi; else tmp = (180.0 / pi) * atan(((y_45_scale / x_45_scale) * t_0)); 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[Tan[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[a$95$m, 5.3e-45], N[(N[(180.0 * N[ArcTan[N[(N[(y$45$scale / x$45$scale), $MachinePrecision] * N[(-1.0 / t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], N[(N[(180.0 / Pi), $MachinePrecision] * N[ArcTan[N[(N[(y$45$scale / x$45$scale), $MachinePrecision] * t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
a_m = \left|a\right|
\\
\begin{array}{l}
t_0 := \tan \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\\
\mathbf{if}\;a\_m \leq 5.3 \cdot 10^{-45}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{y-scale}{x-scale} \cdot \frac{-1}{t\_0}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(\frac{y-scale}{x-scale} \cdot t\_0\right)\\
\end{array}
\end{array}
if a < 5.2999999999999997e-45Initial program 16.1%
Simplified13.0%
Taylor expanded in x-scale around 0
Simplified25.3%
Taylor expanded in a around 0
mul-1-negN/A
neg-lowering-neg.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6442.1%
Simplified42.1%
times-fracN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
clear-numN/A
/-lowering-/.f64N/A
quot-tanN/A
tan-lowering-tan.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6446.7%
Applied egg-rr46.7%
if 5.2999999999999997e-45 < a Initial program 5.7%
Simplified7.2%
Taylor expanded in x-scale around 0
Simplified22.6%
Taylor expanded in a around inf
/-lowering-/.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6462.5%
Simplified62.5%
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
Applied egg-rr63.7%
Final simplification51.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 1.3e-23)
(/ (* 180.0 (atan (/ y-scale (* (sin t_0) (- 0.0 x-scale))))) PI)
(* (/ 180.0 PI) (atan (* (/ y-scale x-scale) (tan t_0)))))))a_m = fabs(a);
double code(double a_m, double b, double angle, double x_45_scale, double y_45_scale) {
double t_0 = 0.005555555555555556 * (angle * ((double) M_PI));
double tmp;
if (a_m <= 1.3e-23) {
tmp = (180.0 * atan((y_45_scale / (sin(t_0) * (0.0 - x_45_scale))))) / ((double) M_PI);
} else {
tmp = (180.0 / ((double) M_PI)) * atan(((y_45_scale / x_45_scale) * tan(t_0)));
}
return tmp;
}
a_m = Math.abs(a);
public static double code(double a_m, double b, double angle, double x_45_scale, double y_45_scale) {
double t_0 = 0.005555555555555556 * (angle * Math.PI);
double tmp;
if (a_m <= 1.3e-23) {
tmp = (180.0 * Math.atan((y_45_scale / (Math.sin(t_0) * (0.0 - x_45_scale))))) / Math.PI;
} else {
tmp = (180.0 / Math.PI) * Math.atan(((y_45_scale / x_45_scale) * Math.tan(t_0)));
}
return tmp;
}
a_m = math.fabs(a) def code(a_m, b, angle, x_45_scale, y_45_scale): t_0 = 0.005555555555555556 * (angle * math.pi) tmp = 0 if a_m <= 1.3e-23: tmp = (180.0 * math.atan((y_45_scale / (math.sin(t_0) * (0.0 - x_45_scale))))) / math.pi else: tmp = (180.0 / math.pi) * math.atan(((y_45_scale / x_45_scale) * math.tan(t_0))) return tmp
a_m = abs(a) function code(a_m, b, angle, x_45_scale, y_45_scale) t_0 = Float64(0.005555555555555556 * Float64(angle * pi)) tmp = 0.0 if (a_m <= 1.3e-23) tmp = Float64(Float64(180.0 * atan(Float64(y_45_scale / Float64(sin(t_0) * Float64(0.0 - x_45_scale))))) / pi); else tmp = Float64(Float64(180.0 / pi) * atan(Float64(Float64(y_45_scale / x_45_scale) * tan(t_0)))); end return tmp end
a_m = abs(a); function tmp_2 = code(a_m, b, angle, x_45_scale, y_45_scale) t_0 = 0.005555555555555556 * (angle * pi); tmp = 0.0; if (a_m <= 1.3e-23) tmp = (180.0 * atan((y_45_scale / (sin(t_0) * (0.0 - x_45_scale))))) / pi; else tmp = (180.0 / pi) * atan(((y_45_scale / x_45_scale) * tan(t_0))); end tmp_2 = tmp; end
a_m = N[Abs[a], $MachinePrecision]
code[a$95$m_, b_, angle_, x$45$scale_, y$45$scale_] := Block[{t$95$0 = N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a$95$m, 1.3e-23], N[(N[(180.0 * N[ArcTan[N[(y$45$scale / N[(N[Sin[t$95$0], $MachinePrecision] * N[(0.0 - x$45$scale), $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[t$95$0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
a_m = \left|a\right|
\\
\begin{array}{l}
t_0 := 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\\
\mathbf{if}\;a\_m \leq 1.3 \cdot 10^{-23}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{y-scale}{\sin t\_0 \cdot \left(0 - x-scale\right)}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(\frac{y-scale}{x-scale} \cdot \tan t\_0\right)\\
\end{array}
\end{array}
if a < 1.3e-23Initial program 16.3%
Simplified12.8%
Taylor expanded in x-scale around 0
Simplified25.8%
Taylor expanded in a around 0
mul-1-negN/A
neg-lowering-neg.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6441.8%
Simplified41.8%
Taylor expanded in angle around 0
Simplified43.1%
if 1.3e-23 < a Initial program 4.6%
Simplified7.6%
Taylor expanded in x-scale around 0
Simplified21.0%
Taylor expanded in a around inf
/-lowering-/.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6463.1%
Simplified63.1%
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
Applied egg-rr64.5%
Final simplification48.9%
a_m = (fabs.f64 a)
(FPCore (a_m b angle x-scale y-scale)
:precision binary64
(if (<= a_m 7.4e-51)
(*
180.0
(/
(atan (/ (/ (* -180.0 (* y-scale b)) (* angle (* PI x-scale))) (- b a_m)))
PI))
(*
(/ 180.0 PI)
(atan
(* (/ y-scale x-scale) (tan (* 0.005555555555555556 (* angle 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 <= 7.4e-51) {
tmp = 180.0 * (atan((((-180.0 * (y_45_scale * b)) / (angle * (((double) M_PI) * x_45_scale))) / (b - a_m))) / ((double) M_PI));
} else {
tmp = (180.0 / ((double) M_PI)) * atan(((y_45_scale / x_45_scale) * tan((0.005555555555555556 * (angle * ((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 <= 7.4e-51) {
tmp = 180.0 * (Math.atan((((-180.0 * (y_45_scale * b)) / (angle * (Math.PI * x_45_scale))) / (b - a_m))) / Math.PI);
} else {
tmp = (180.0 / Math.PI) * Math.atan(((y_45_scale / x_45_scale) * Math.tan((0.005555555555555556 * (angle * 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 <= 7.4e-51: tmp = 180.0 * (math.atan((((-180.0 * (y_45_scale * b)) / (angle * (math.pi * x_45_scale))) / (b - a_m))) / math.pi) else: tmp = (180.0 / math.pi) * math.atan(((y_45_scale / x_45_scale) * math.tan((0.005555555555555556 * (angle * 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 <= 7.4e-51) tmp = Float64(180.0 * Float64(atan(Float64(Float64(Float64(-180.0 * Float64(y_45_scale * b)) / Float64(angle * Float64(pi * x_45_scale))) / Float64(b - a_m))) / pi)); else tmp = Float64(Float64(180.0 / pi) * atan(Float64(Float64(y_45_scale / x_45_scale) * tan(Float64(0.005555555555555556 * Float64(angle * 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 <= 7.4e-51) tmp = 180.0 * (atan((((-180.0 * (y_45_scale * b)) / (angle * (pi * x_45_scale))) / (b - a_m))) / pi); else tmp = (180.0 / pi) * atan(((y_45_scale / x_45_scale) * tan((0.005555555555555556 * (angle * 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, 7.4e-51], N[(180.0 * N[(N[ArcTan[N[(N[(N[(-180.0 * N[(y$45$scale * b), $MachinePrecision]), $MachinePrecision] / N[(angle * N[(Pi * x$45$scale), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(b - a$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(N[(180.0 / Pi), $MachinePrecision] * N[ArcTan[N[(N[(y$45$scale / x$45$scale), $MachinePrecision] * N[Tan[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
a_m = \left|a\right|
\\
\begin{array}{l}
\mathbf{if}\;a\_m \leq 7.4 \cdot 10^{-51}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\frac{-180 \cdot \left(y-scale \cdot b\right)}{angle \cdot \left(\pi \cdot x-scale\right)}}{b - a\_m}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(\frac{y-scale}{x-scale} \cdot \tan \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\\
\end{array}
\end{array}
if a < 7.39999999999999946e-51Initial program 15.6%
Taylor expanded in angle around 0
associate-*r/N/A
/-lowering-/.f64N/A
Simplified9.2%
frac-2negN/A
distribute-frac-negN/A
neg-lowering-neg.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
neg-sub0N/A
--lowering--.f64N/A
*-lowering-*.f649.2%
Applied egg-rr9.2%
associate-/r*N/A
difference-of-squaresN/A
+-commutativeN/A
associate-/r*N/A
/-lowering-/.f64N/A
Applied egg-rr19.2%
Taylor expanded in a around 0
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
PI-lowering-PI.f6442.9%
Simplified42.9%
if 7.39999999999999946e-51 < a Initial program 7.0%
Simplified7.1%
Taylor expanded in x-scale around 0
Simplified23.7%
Taylor expanded in a around inf
/-lowering-/.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6461.7%
Simplified61.7%
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
Applied egg-rr62.9%
Final simplification48.8%
a_m = (fabs.f64 a)
(FPCore (a_m b angle x-scale y-scale)
:precision binary64
(if (<= a_m 1.2e-29)
(*
180.0
(/
(atan (/ (/ (* -180.0 (* y-scale b)) (* angle (* PI x-scale))) (- b a_m)))
PI))
(/
(*
180.0
(atan (* 0.005555555555555556 (* angle (/ (* 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 <= 1.2e-29) {
tmp = 180.0 * (atan((((-180.0 * (y_45_scale * b)) / (angle * (((double) M_PI) * x_45_scale))) / (b - a_m))) / ((double) M_PI));
} else {
tmp = (180.0 * atan((0.005555555555555556 * (angle * ((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 <= 1.2e-29) {
tmp = 180.0 * (Math.atan((((-180.0 * (y_45_scale * b)) / (angle * (Math.PI * x_45_scale))) / (b - a_m))) / Math.PI);
} else {
tmp = (180.0 * Math.atan((0.005555555555555556 * (angle * ((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 <= 1.2e-29: tmp = 180.0 * (math.atan((((-180.0 * (y_45_scale * b)) / (angle * (math.pi * x_45_scale))) / (b - a_m))) / math.pi) else: tmp = (180.0 * math.atan((0.005555555555555556 * (angle * ((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 <= 1.2e-29) tmp = Float64(180.0 * Float64(atan(Float64(Float64(Float64(-180.0 * Float64(y_45_scale * b)) / Float64(angle * Float64(pi * x_45_scale))) / Float64(b - a_m))) / pi)); else tmp = Float64(Float64(180.0 * atan(Float64(0.005555555555555556 * Float64(angle * Float64(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 <= 1.2e-29) tmp = 180.0 * (atan((((-180.0 * (y_45_scale * b)) / (angle * (pi * x_45_scale))) / (b - a_m))) / pi); else tmp = (180.0 * atan((0.005555555555555556 * (angle * ((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, 1.2e-29], N[(180.0 * N[(N[ArcTan[N[(N[(N[(-180.0 * N[(y$45$scale * b), $MachinePrecision]), $MachinePrecision] / N[(angle * N[(Pi * x$45$scale), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(b - a$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(N[(180.0 * N[ArcTan[N[(0.005555555555555556 * N[(angle * N[(N[(y$45$scale * Pi), $MachinePrecision] / x$45$scale), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision]]
\begin{array}{l}
a_m = \left|a\right|
\\
\begin{array}{l}
\mathbf{if}\;a\_m \leq 1.2 \cdot 10^{-29}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\frac{-180 \cdot \left(y-scale \cdot b\right)}{angle \cdot \left(\pi \cdot x-scale\right)}}{b - a\_m}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(0.005555555555555556 \cdot \left(angle \cdot \frac{y-scale \cdot \pi}{x-scale}\right)\right)}{\pi}\\
\end{array}
\end{array}
if a < 1.19999999999999996e-29Initial program 16.4%
Taylor expanded in angle around 0
associate-*r/N/A
/-lowering-/.f64N/A
Simplified9.5%
frac-2negN/A
distribute-frac-negN/A
neg-lowering-neg.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
neg-sub0N/A
--lowering--.f64N/A
*-lowering-*.f649.6%
Applied egg-rr9.6%
associate-/r*N/A
difference-of-squaresN/A
+-commutativeN/A
associate-/r*N/A
/-lowering-/.f64N/A
Applied egg-rr19.3%
Taylor expanded in a around 0
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
PI-lowering-PI.f6443.1%
Simplified43.1%
if 1.19999999999999996e-29 < a Initial program 4.6%
Simplified7.5%
Taylor expanded in x-scale around 0
Simplified20.8%
Taylor expanded in a around inf
/-lowering-/.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6462.3%
Simplified62.3%
Taylor expanded in angle around 0
*-lowering-*.f64N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6458.4%
Simplified58.4%
a_m = (fabs.f64 a)
(FPCore (a_m b angle x-scale y-scale)
:precision binary64
(if (<= a_m 3.3e-28)
(* 180.0 (/ (atan (/ (/ (* y-scale -180.0) (* PI x-scale)) angle)) PI))
(/
(*
180.0
(atan (* 0.005555555555555556 (* angle (/ (* 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 <= 3.3e-28) {
tmp = 180.0 * (atan((((y_45_scale * -180.0) / (((double) M_PI) * x_45_scale)) / angle)) / ((double) M_PI));
} else {
tmp = (180.0 * atan((0.005555555555555556 * (angle * ((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 <= 3.3e-28) {
tmp = 180.0 * (Math.atan((((y_45_scale * -180.0) / (Math.PI * x_45_scale)) / angle)) / Math.PI);
} else {
tmp = (180.0 * Math.atan((0.005555555555555556 * (angle * ((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 <= 3.3e-28: tmp = 180.0 * (math.atan((((y_45_scale * -180.0) / (math.pi * x_45_scale)) / angle)) / math.pi) else: tmp = (180.0 * math.atan((0.005555555555555556 * (angle * ((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 <= 3.3e-28) tmp = Float64(180.0 * Float64(atan(Float64(Float64(Float64(y_45_scale * -180.0) / Float64(pi * x_45_scale)) / angle)) / pi)); else tmp = Float64(Float64(180.0 * atan(Float64(0.005555555555555556 * Float64(angle * Float64(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 <= 3.3e-28) tmp = 180.0 * (atan((((y_45_scale * -180.0) / (pi * x_45_scale)) / angle)) / pi); else tmp = (180.0 * atan((0.005555555555555556 * (angle * ((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, 3.3e-28], N[(180.0 * N[(N[ArcTan[N[(N[(N[(y$45$scale * -180.0), $MachinePrecision] / N[(Pi * x$45$scale), $MachinePrecision]), $MachinePrecision] / angle), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(N[(180.0 * N[ArcTan[N[(0.005555555555555556 * N[(angle * N[(N[(y$45$scale * Pi), $MachinePrecision] / x$45$scale), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision]]
\begin{array}{l}
a_m = \left|a\right|
\\
\begin{array}{l}
\mathbf{if}\;a\_m \leq 3.3 \cdot 10^{-28}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\frac{y-scale \cdot -180}{\pi \cdot x-scale}}{angle}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(0.005555555555555556 \cdot \left(angle \cdot \frac{y-scale \cdot \pi}{x-scale}\right)\right)}{\pi}\\
\end{array}
\end{array}
if a < 3.3000000000000002e-28Initial program 16.4%
Taylor expanded in angle around 0
associate-*r/N/A
/-lowering-/.f64N/A
Simplified9.5%
Taylor expanded in a around 0
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6435.8%
Simplified35.8%
associate-*r/N/A
*-commutativeN/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6440.4%
Applied egg-rr40.4%
if 3.3000000000000002e-28 < a Initial program 4.6%
Simplified7.5%
Taylor expanded in x-scale around 0
Simplified20.8%
Taylor expanded in a around inf
/-lowering-/.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6462.3%
Simplified62.3%
Taylor expanded in angle around 0
*-lowering-*.f64N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6458.4%
Simplified58.4%
Final simplification45.4%
a_m = (fabs.f64 a)
(FPCore (a_m b angle x-scale y-scale)
:precision binary64
(if (<= a_m 9.5e-28)
(* 180.0 (/ (atan (/ (/ (* y-scale -180.0) (* PI x-scale)) angle)) PI))
(*
(/ 180.0 PI)
(atan (* (* 0.005555555555555556 (* angle PI)) (/ y-scale x-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 <= 9.5e-28) {
tmp = 180.0 * (atan((((y_45_scale * -180.0) / (((double) M_PI) * x_45_scale)) / angle)) / ((double) M_PI));
} else {
tmp = (180.0 / ((double) M_PI)) * atan(((0.005555555555555556 * (angle * ((double) M_PI))) * (y_45_scale / x_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 <= 9.5e-28) {
tmp = 180.0 * (Math.atan((((y_45_scale * -180.0) / (Math.PI * x_45_scale)) / angle)) / Math.PI);
} else {
tmp = (180.0 / Math.PI) * Math.atan(((0.005555555555555556 * (angle * Math.PI)) * (y_45_scale / x_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 <= 9.5e-28: tmp = 180.0 * (math.atan((((y_45_scale * -180.0) / (math.pi * x_45_scale)) / angle)) / math.pi) else: tmp = (180.0 / math.pi) * math.atan(((0.005555555555555556 * (angle * math.pi)) * (y_45_scale / x_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 <= 9.5e-28) tmp = Float64(180.0 * Float64(atan(Float64(Float64(Float64(y_45_scale * -180.0) / Float64(pi * x_45_scale)) / angle)) / pi)); else tmp = Float64(Float64(180.0 / pi) * atan(Float64(Float64(0.005555555555555556 * Float64(angle * pi)) * Float64(y_45_scale / x_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 <= 9.5e-28) tmp = 180.0 * (atan((((y_45_scale * -180.0) / (pi * x_45_scale)) / angle)) / pi); else tmp = (180.0 / pi) * atan(((0.005555555555555556 * (angle * pi)) * (y_45_scale / x_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, 9.5e-28], N[(180.0 * N[(N[ArcTan[N[(N[(N[(y$45$scale * -180.0), $MachinePrecision] / N[(Pi * x$45$scale), $MachinePrecision]), $MachinePrecision] / angle), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(N[(180.0 / Pi), $MachinePrecision] * N[ArcTan[N[(N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision] * N[(y$45$scale / x$45$scale), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
a_m = \left|a\right|
\\
\begin{array}{l}
\mathbf{if}\;a\_m \leq 9.5 \cdot 10^{-28}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\frac{y-scale \cdot -180}{\pi \cdot x-scale}}{angle}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(\left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \frac{y-scale}{x-scale}\right)\\
\end{array}
\end{array}
if a < 9.50000000000000001e-28Initial program 16.4%
Taylor expanded in angle around 0
associate-*r/N/A
/-lowering-/.f64N/A
Simplified9.5%
Taylor expanded in a around 0
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6435.8%
Simplified35.8%
associate-*r/N/A
*-commutativeN/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6440.4%
Applied egg-rr40.4%
if 9.50000000000000001e-28 < a Initial program 4.6%
Simplified7.5%
Taylor expanded in x-scale around 0
Simplified20.8%
Taylor expanded in a around inf
/-lowering-/.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6462.3%
Simplified62.3%
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
Applied egg-rr63.6%
Taylor expanded in angle around 0
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6458.3%
Simplified58.3%
Final simplification45.4%
a_m = (fabs.f64 a) (FPCore (a_m b angle x-scale y-scale) :precision binary64 (* 180.0 (/ (atan (/ (/ (* y-scale -180.0) (* PI x-scale)) 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 * -180.0) / (((double) M_PI) * x_45_scale)) / 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 * -180.0) / (Math.PI * x_45_scale)) / 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 * -180.0) / (math.pi * x_45_scale)) / 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(Float64(y_45_scale * -180.0) / Float64(pi * x_45_scale)) / 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 * -180.0) / (pi * x_45_scale)) / 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[(N[(y$45$scale * -180.0), $MachinePrecision] / N[(Pi * x$45$scale), $MachinePrecision]), $MachinePrecision] / angle), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
180 \cdot \frac{\tan^{-1} \left(\frac{\frac{y-scale \cdot -180}{\pi \cdot x-scale}}{angle}\right)}{\pi}
\end{array}
Initial program 13.1%
Taylor expanded in angle around 0
associate-*r/N/A
/-lowering-/.f64N/A
Simplified7.9%
Taylor expanded in a around 0
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6432.5%
Simplified32.5%
associate-*r/N/A
*-commutativeN/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6437.3%
Applied egg-rr37.3%
Final simplification37.3%
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(Float64(Float64(y_45_scale / angle) / 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[(N[(N[(y$45$scale / angle), $MachinePrecision] / Pi), $MachinePrecision] / x$45$scale), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
180 \cdot \frac{\tan^{-1} \left(-180 \cdot \frac{\frac{\frac{y-scale}{angle}}{\pi}}{x-scale}\right)}{\pi}
\end{array}
Initial program 13.1%
Taylor expanded in angle around 0
associate-*r/N/A
/-lowering-/.f64N/A
Simplified7.9%
Taylor expanded in a around 0
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6432.5%
Simplified32.5%
associate-/r*N/A
*-commutativeN/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
PI-lowering-PI.f6432.5%
Applied egg-rr32.5%
a_m = (fabs.f64 a) (FPCore (a_m b angle x-scale y-scale) :precision binary64 (* 180.0 (/ (atan (* -180.0 (/ (/ (/ y-scale 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) {
return 180.0 * (atan((-180.0 * (((y_45_scale / angle) / x_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 * (((y_45_scale / angle) / x_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 * (((y_45_scale / angle) / x_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(Float64(Float64(y_45_scale / angle) / x_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 * (((y_45_scale / angle) / x_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[(N[(N[(y$45$scale / angle), $MachinePrecision] / x$45$scale), $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
180 \cdot \frac{\tan^{-1} \left(-180 \cdot \frac{\frac{\frac{y-scale}{angle}}{x-scale}}{\pi}\right)}{\pi}
\end{array}
Initial program 13.1%
Taylor expanded in angle around 0
associate-*r/N/A
/-lowering-/.f64N/A
Simplified7.9%
Taylor expanded in a around 0
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6432.5%
Simplified32.5%
associate-/r*N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
PI-lowering-PI.f6432.5%
Applied egg-rr32.5%
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 13.1%
Taylor expanded in angle around 0
associate-*r/N/A
/-lowering-/.f64N/A
Simplified7.9%
Taylor expanded in a around 0
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6432.5%
Simplified32.5%
Final simplification32.5%
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 13.1%
Taylor expanded in angle around 0
associate-*r/N/A
/-lowering-/.f64N/A
Simplified7.9%
Taylor expanded in a around inf
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6410.2%
Simplified10.2%
herbie shell --seed 2024150
(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)))