
(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}
Herbie found 15 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 7.2e-65)
(*
180.0
(/
(atan
(*
-1.0
(*
(/ y-scale x-scale)
(/
(pow
(sin (* angle (fma 0.005555555555555556 PI (* 0.5 (/ PI angle)))))
2.0)
(* (cos t_0) (sin t_0))))))
PI))
(* 180.0 (/ (atan (* (/ y-scale x-scale) (tan 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 <= 7.2e-65) {
tmp = 180.0 * (atan((-1.0 * ((y_45_scale / x_45_scale) * (pow(sin((angle * fma(0.005555555555555556, ((double) M_PI), (0.5 * (((double) M_PI) / angle))))), 2.0) / (cos(t_0) * sin(t_0)))))) / ((double) M_PI));
} else {
tmp = 180.0 * (atan(((y_45_scale / x_45_scale) * tan(t_0))) / ((double) M_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 <= 7.2e-65) tmp = Float64(180.0 * Float64(atan(Float64(-1.0 * Float64(Float64(y_45_scale / x_45_scale) * Float64((sin(Float64(angle * fma(0.005555555555555556, pi, Float64(0.5 * Float64(pi / angle))))) ^ 2.0) / Float64(cos(t_0) * sin(t_0)))))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(y_45_scale / x_45_scale) * tan(t_0))) / pi)); end return tmp end
a_m = N[Abs[a], $MachinePrecision]
code[a$95$m_, b_, angle_, x$45$scale_, y$45$scale_] := Block[{t$95$0 = N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a$95$m, 7.2e-65], N[(180.0 * N[(N[ArcTan[N[(-1.0 * N[(N[(y$45$scale / x$45$scale), $MachinePrecision] * N[(N[Power[N[Sin[N[(angle * N[(0.005555555555555556 * Pi + N[(0.5 * N[(Pi / angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision] / N[(N[Cos[t$95$0], $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(y$45$scale / x$45$scale), $MachinePrecision] * N[Tan[t$95$0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\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 7.2 \cdot 10^{-65}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-1 \cdot \left(\frac{y-scale}{x-scale} \cdot \frac{{\sin \left(angle \cdot \mathsf{fma}\left(0.005555555555555556, \pi, 0.5 \cdot \frac{\pi}{angle}\right)\right)}^{2}}{\cos t\_0 \cdot \sin t\_0}\right)\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{y-scale}{x-scale} \cdot \tan t\_0\right)}{\pi}\\
\end{array}
\end{array}
if a < 7.1999999999999996e-65Initial program 18.8%
Taylor expanded in x-scale around 0
Applied rewrites34.6%
lift-cos.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
sin-+PI/2-revN/A
lower-sin.f64N/A
lower-fma.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lower-/.f64N/A
lift-PI.f6434.7
Applied rewrites34.7%
Taylor expanded in a around 0
lower-*.f64N/A
times-fracN/A
lift-/.f64N/A
Applied rewrites57.4%
Taylor expanded in angle around inf
lower-*.f64N/A
lower-fma.f64N/A
lift-PI.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lift-PI.f6457.4
Applied rewrites57.4%
if 7.1999999999999996e-65 < a Initial program 10.2%
Taylor expanded in x-scale around 0
Applied rewrites30.5%
Taylor expanded in a around inf
times-fracN/A
lower-*.f64N/A
lift-/.f64N/A
quot-tanN/A
lower-tan.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f6456.6
Applied rewrites56.6%
a_m = (fabs.f64 a)
(FPCore (a_m b angle x-scale y-scale)
:precision binary64
(let* ((t_0 (* (/ angle 180.0) PI))
(t_1 (cos t_0))
(t_2 (sin t_0))
(t_3
(/
(/ (* (* (* 2.0 (- (pow b 2.0) (pow a_m 2.0))) t_2) t_1) x-scale)
y-scale))
(t_4
(/ (/ (+ (pow (* a_m t_1) 2.0) (pow (* b t_2) 2.0)) y-scale) y-scale))
(t_5
(/
(/ (+ (pow (* a_m t_2) 2.0) (pow (* b t_1) 2.0)) x-scale)
x-scale)))
(if (<=
(*
180.0
(/
(atan
(/
(- (- t_4 t_5) (sqrt (+ (pow (- t_5 t_4) 2.0) (pow t_3 2.0))))
t_3))
PI))
100.0)
(*
180.0
(/
(atan
(*
90.0
(*
(/ x-scale angle)
(/
(* y-scale (* -2.0 (* (/ b x-scale) (/ b x-scale))))
(* PI (- (* b b) (* a_m a_m)))))))
PI))
(*
180.0
(/
(atan
(*
0.5
(*
x-scale
(* -360.0 (/ y-scale (* angle (* (* x-scale x-scale) PI)))))))
PI)))))a_m = fabs(a);
double code(double a_m, double b, double angle, double x_45_scale, double y_45_scale) {
double 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_m, 2.0))) * t_2) * t_1) / x_45_scale) / y_45_scale;
double t_4 = ((pow((a_m * t_1), 2.0) + pow((b * t_2), 2.0)) / y_45_scale) / y_45_scale;
double t_5 = ((pow((a_m * t_2), 2.0) + pow((b * t_1), 2.0)) / x_45_scale) / x_45_scale;
double tmp;
if ((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))) <= 100.0) {
tmp = 180.0 * (atan((90.0 * ((x_45_scale / angle) * ((y_45_scale * (-2.0 * ((b / x_45_scale) * (b / x_45_scale)))) / (((double) M_PI) * ((b * b) - (a_m * a_m))))))) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((0.5 * (x_45_scale * (-360.0 * (y_45_scale / (angle * ((x_45_scale * x_45_scale) * ((double) M_PI)))))))) / ((double) M_PI));
}
return tmp;
}
a_m = Math.abs(a);
public static double code(double a_m, double b, double angle, double x_45_scale, double y_45_scale) {
double 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_m, 2.0))) * t_2) * t_1) / x_45_scale) / y_45_scale;
double t_4 = ((Math.pow((a_m * t_1), 2.0) + Math.pow((b * t_2), 2.0)) / y_45_scale) / y_45_scale;
double t_5 = ((Math.pow((a_m * t_2), 2.0) + Math.pow((b * t_1), 2.0)) / x_45_scale) / x_45_scale;
double tmp;
if ((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)) <= 100.0) {
tmp = 180.0 * (Math.atan((90.0 * ((x_45_scale / angle) * ((y_45_scale * (-2.0 * ((b / x_45_scale) * (b / x_45_scale)))) / (Math.PI * ((b * b) - (a_m * a_m))))))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((0.5 * (x_45_scale * (-360.0 * (y_45_scale / (angle * ((x_45_scale * x_45_scale) * Math.PI))))))) / Math.PI);
}
return tmp;
}
a_m = math.fabs(a) def code(a_m, b, angle, x_45_scale, y_45_scale): 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_m, 2.0))) * t_2) * t_1) / x_45_scale) / y_45_scale t_4 = ((math.pow((a_m * t_1), 2.0) + math.pow((b * t_2), 2.0)) / y_45_scale) / y_45_scale t_5 = ((math.pow((a_m * t_2), 2.0) + math.pow((b * t_1), 2.0)) / x_45_scale) / x_45_scale tmp = 0 if (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)) <= 100.0: tmp = 180.0 * (math.atan((90.0 * ((x_45_scale / angle) * ((y_45_scale * (-2.0 * ((b / x_45_scale) * (b / x_45_scale)))) / (math.pi * ((b * b) - (a_m * a_m))))))) / math.pi) else: tmp = 180.0 * (math.atan((0.5 * (x_45_scale * (-360.0 * (y_45_scale / (angle * ((x_45_scale * x_45_scale) * math.pi))))))) / math.pi) return tmp
a_m = abs(a) function code(a_m, b, angle, x_45_scale, y_45_scale) 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_m ^ 2.0))) * t_2) * t_1) / x_45_scale) / y_45_scale) t_4 = Float64(Float64(Float64((Float64(a_m * t_1) ^ 2.0) + (Float64(b * t_2) ^ 2.0)) / y_45_scale) / y_45_scale) t_5 = Float64(Float64(Float64((Float64(a_m * t_2) ^ 2.0) + (Float64(b * t_1) ^ 2.0)) / x_45_scale) / x_45_scale) tmp = 0.0 if (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)) <= 100.0) tmp = Float64(180.0 * Float64(atan(Float64(90.0 * Float64(Float64(x_45_scale / angle) * Float64(Float64(y_45_scale * Float64(-2.0 * Float64(Float64(b / x_45_scale) * Float64(b / x_45_scale)))) / Float64(pi * Float64(Float64(b * b) - Float64(a_m * a_m))))))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(0.5 * Float64(x_45_scale * Float64(-360.0 * Float64(y_45_scale / Float64(angle * Float64(Float64(x_45_scale * x_45_scale) * pi))))))) / pi)); end return tmp end
a_m = abs(a); function tmp_2 = code(a_m, b, angle, x_45_scale, y_45_scale) t_0 = (angle / 180.0) * pi; t_1 = cos(t_0); t_2 = sin(t_0); t_3 = ((((2.0 * ((b ^ 2.0) - (a_m ^ 2.0))) * t_2) * t_1) / x_45_scale) / y_45_scale; t_4 = ((((a_m * t_1) ^ 2.0) + ((b * t_2) ^ 2.0)) / y_45_scale) / y_45_scale; t_5 = ((((a_m * t_2) ^ 2.0) + ((b * t_1) ^ 2.0)) / x_45_scale) / x_45_scale; tmp = 0.0; if ((180.0 * (atan((((t_4 - t_5) - sqrt((((t_5 - t_4) ^ 2.0) + (t_3 ^ 2.0)))) / t_3)) / pi)) <= 100.0) tmp = 180.0 * (atan((90.0 * ((x_45_scale / angle) * ((y_45_scale * (-2.0 * ((b / x_45_scale) * (b / x_45_scale)))) / (pi * ((b * b) - (a_m * a_m))))))) / pi); else tmp = 180.0 * (atan((0.5 * (x_45_scale * (-360.0 * (y_45_scale / (angle * ((x_45_scale * x_45_scale) * pi))))))) / pi); end tmp_2 = tmp; end
a_m = N[Abs[a], $MachinePrecision]
code[a$95$m_, b_, angle_, x$45$scale_, y$45$scale_] := 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$95$m, 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$95$m * 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$95$m * 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]}, If[LessEqual[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], 100.0], N[(180.0 * N[(N[ArcTan[N[(90.0 * N[(N[(x$45$scale / angle), $MachinePrecision] * N[(N[(y$45$scale * N[(-2.0 * N[(N[(b / x$45$scale), $MachinePrecision] * N[(b / x$45$scale), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(Pi * N[(N[(b * b), $MachinePrecision] - N[(a$95$m * a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(0.5 * N[(x$45$scale * N[(-360.0 * N[(y$45$scale / N[(angle * N[(N[(x$45$scale * x$45$scale), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
a_m = \left|a\right|
\\
\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\_m}^{2}\right)\right) \cdot t\_2\right) \cdot t\_1}{x-scale}}{y-scale}\\
t_4 := \frac{\frac{{\left(a\_m \cdot t\_1\right)}^{2} + {\left(b \cdot t\_2\right)}^{2}}{y-scale}}{y-scale}\\
t_5 := \frac{\frac{{\left(a\_m \cdot t\_2\right)}^{2} + {\left(b \cdot t\_1\right)}^{2}}{x-scale}}{x-scale}\\
\mathbf{if}\;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} \leq 100:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(90 \cdot \left(\frac{x-scale}{angle} \cdot \frac{y-scale \cdot \left(-2 \cdot \left(\frac{b}{x-scale} \cdot \frac{b}{x-scale}\right)\right)}{\pi \cdot \left(b \cdot b - a\_m \cdot a\_m\right)}\right)\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \left(x-scale \cdot \left(-360 \cdot \frac{y-scale}{angle \cdot \left(\left(x-scale \cdot x-scale\right) \cdot \pi\right)}\right)\right)\right)}{\pi}\\
\end{array}
\end{array}
if (*.f64 #s(literal 180 binary64) (/.f64 (atan.f64 (/.f64 (-.f64 (-.f64 (/.f64 (/.f64 (+.f64 (pow.f64 (*.f64 a (cos.f64 (*.f64 (/.f64 angle #s(literal 180 binary64)) (PI.f64)))) #s(literal 2 binary64)) (pow.f64 (*.f64 b (sin.f64 (*.f64 (/.f64 angle #s(literal 180 binary64)) (PI.f64)))) #s(literal 2 binary64))) y-scale) y-scale) (/.f64 (/.f64 (+.f64 (pow.f64 (*.f64 a (sin.f64 (*.f64 (/.f64 angle #s(literal 180 binary64)) (PI.f64)))) #s(literal 2 binary64)) (pow.f64 (*.f64 b (cos.f64 (*.f64 (/.f64 angle #s(literal 180 binary64)) (PI.f64)))) #s(literal 2 binary64))) x-scale) x-scale)) (sqrt.f64 (+.f64 (pow.f64 (-.f64 (/.f64 (/.f64 (+.f64 (pow.f64 (*.f64 a (sin.f64 (*.f64 (/.f64 angle #s(literal 180 binary64)) (PI.f64)))) #s(literal 2 binary64)) (pow.f64 (*.f64 b (cos.f64 (*.f64 (/.f64 angle #s(literal 180 binary64)) (PI.f64)))) #s(literal 2 binary64))) x-scale) x-scale) (/.f64 (/.f64 (+.f64 (pow.f64 (*.f64 a (cos.f64 (*.f64 (/.f64 angle #s(literal 180 binary64)) (PI.f64)))) #s(literal 2 binary64)) (pow.f64 (*.f64 b (sin.f64 (*.f64 (/.f64 angle #s(literal 180 binary64)) (PI.f64)))) #s(literal 2 binary64))) y-scale) y-scale)) #s(literal 2 binary64)) (pow.f64 (/.f64 (/.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) (sin.f64 (*.f64 (/.f64 angle #s(literal 180 binary64)) (PI.f64)))) (cos.f64 (*.f64 (/.f64 angle #s(literal 180 binary64)) (PI.f64)))) x-scale) y-scale) #s(literal 2 binary64))))) (/.f64 (/.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) (sin.f64 (*.f64 (/.f64 angle #s(literal 180 binary64)) (PI.f64)))) (cos.f64 (*.f64 (/.f64 angle #s(literal 180 binary64)) (PI.f64)))) x-scale) y-scale))) (PI.f64))) < 100Initial program 50.6%
Taylor expanded in angle around 0
Applied rewrites32.4%
Taylor expanded in a around 0
lower-*.f64N/A
pow2N/A
pow2N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6440.4
Applied rewrites40.4%
if 100 < (*.f64 #s(literal 180 binary64) (/.f64 (atan.f64 (/.f64 (-.f64 (-.f64 (/.f64 (/.f64 (+.f64 (pow.f64 (*.f64 a (cos.f64 (*.f64 (/.f64 angle #s(literal 180 binary64)) (PI.f64)))) #s(literal 2 binary64)) (pow.f64 (*.f64 b (sin.f64 (*.f64 (/.f64 angle #s(literal 180 binary64)) (PI.f64)))) #s(literal 2 binary64))) y-scale) y-scale) (/.f64 (/.f64 (+.f64 (pow.f64 (*.f64 a (sin.f64 (*.f64 (/.f64 angle #s(literal 180 binary64)) (PI.f64)))) #s(literal 2 binary64)) (pow.f64 (*.f64 b (cos.f64 (*.f64 (/.f64 angle #s(literal 180 binary64)) (PI.f64)))) #s(literal 2 binary64))) x-scale) x-scale)) (sqrt.f64 (+.f64 (pow.f64 (-.f64 (/.f64 (/.f64 (+.f64 (pow.f64 (*.f64 a (sin.f64 (*.f64 (/.f64 angle #s(literal 180 binary64)) (PI.f64)))) #s(literal 2 binary64)) (pow.f64 (*.f64 b (cos.f64 (*.f64 (/.f64 angle #s(literal 180 binary64)) (PI.f64)))) #s(literal 2 binary64))) x-scale) x-scale) (/.f64 (/.f64 (+.f64 (pow.f64 (*.f64 a (cos.f64 (*.f64 (/.f64 angle #s(literal 180 binary64)) (PI.f64)))) #s(literal 2 binary64)) (pow.f64 (*.f64 b (sin.f64 (*.f64 (/.f64 angle #s(literal 180 binary64)) (PI.f64)))) #s(literal 2 binary64))) y-scale) y-scale)) #s(literal 2 binary64)) (pow.f64 (/.f64 (/.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) (sin.f64 (*.f64 (/.f64 angle #s(literal 180 binary64)) (PI.f64)))) (cos.f64 (*.f64 (/.f64 angle #s(literal 180 binary64)) (PI.f64)))) x-scale) y-scale) #s(literal 2 binary64))))) (/.f64 (/.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) (sin.f64 (*.f64 (/.f64 angle #s(literal 180 binary64)) (PI.f64)))) (cos.f64 (*.f64 (/.f64 angle #s(literal 180 binary64)) (PI.f64)))) x-scale) y-scale))) (PI.f64))) Initial program 0.0%
Taylor expanded in b around inf
Applied rewrites24.2%
Taylor expanded in angle around 0
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lift-PI.f6439.3
Applied rewrites39.3%
Taylor expanded in angle around 0
Applied rewrites40.4%
a_m = (fabs.f64 a)
(FPCore (a_m b angle x-scale y-scale)
:precision binary64
(let* ((t_0 (* (/ angle 180.0) PI))
(t_1 (cos t_0))
(t_2 (sin t_0))
(t_3
(/
(/ (* (* (* 2.0 (- (pow b 2.0) (pow a_m 2.0))) t_2) t_1) x-scale)
y-scale))
(t_4
(/ (/ (+ (pow (* a_m t_1) 2.0) (pow (* b t_2) 2.0)) y-scale) y-scale))
(t_5
(/
(/ (+ (pow (* a_m t_2) 2.0) (pow (* b t_1) 2.0)) x-scale)
x-scale)))
(if (<=
(*
180.0
(/
(atan
(/
(- (- t_4 t_5) (sqrt (+ (pow (- t_5 t_4) 2.0) (pow t_3 2.0))))
t_3))
PI))
100.0)
(*
180.0
(/
(atan
(*
90.0
(*
(/ x-scale angle)
(*
-2.0
(*
(* (/ b x-scale) (/ b x-scale))
(/ y-scale (* PI (- (* b b) (* a_m a_m)))))))))
PI))
(*
180.0
(/
(atan
(*
0.5
(*
x-scale
(* -360.0 (/ y-scale (* angle (* (* x-scale x-scale) PI)))))))
PI)))))a_m = fabs(a);
double code(double a_m, double b, double angle, double x_45_scale, double y_45_scale) {
double 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_m, 2.0))) * t_2) * t_1) / x_45_scale) / y_45_scale;
double t_4 = ((pow((a_m * t_1), 2.0) + pow((b * t_2), 2.0)) / y_45_scale) / y_45_scale;
double t_5 = ((pow((a_m * t_2), 2.0) + pow((b * t_1), 2.0)) / x_45_scale) / x_45_scale;
double tmp;
if ((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))) <= 100.0) {
tmp = 180.0 * (atan((90.0 * ((x_45_scale / angle) * (-2.0 * (((b / x_45_scale) * (b / x_45_scale)) * (y_45_scale / (((double) M_PI) * ((b * b) - (a_m * a_m))))))))) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((0.5 * (x_45_scale * (-360.0 * (y_45_scale / (angle * ((x_45_scale * x_45_scale) * ((double) M_PI)))))))) / ((double) M_PI));
}
return tmp;
}
a_m = Math.abs(a);
public static double code(double a_m, double b, double angle, double x_45_scale, double y_45_scale) {
double 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_m, 2.0))) * t_2) * t_1) / x_45_scale) / y_45_scale;
double t_4 = ((Math.pow((a_m * t_1), 2.0) + Math.pow((b * t_2), 2.0)) / y_45_scale) / y_45_scale;
double t_5 = ((Math.pow((a_m * t_2), 2.0) + Math.pow((b * t_1), 2.0)) / x_45_scale) / x_45_scale;
double tmp;
if ((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)) <= 100.0) {
tmp = 180.0 * (Math.atan((90.0 * ((x_45_scale / angle) * (-2.0 * (((b / x_45_scale) * (b / x_45_scale)) * (y_45_scale / (Math.PI * ((b * b) - (a_m * a_m))))))))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((0.5 * (x_45_scale * (-360.0 * (y_45_scale / (angle * ((x_45_scale * x_45_scale) * Math.PI))))))) / Math.PI);
}
return tmp;
}
a_m = math.fabs(a) def code(a_m, b, angle, x_45_scale, y_45_scale): 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_m, 2.0))) * t_2) * t_1) / x_45_scale) / y_45_scale t_4 = ((math.pow((a_m * t_1), 2.0) + math.pow((b * t_2), 2.0)) / y_45_scale) / y_45_scale t_5 = ((math.pow((a_m * t_2), 2.0) + math.pow((b * t_1), 2.0)) / x_45_scale) / x_45_scale tmp = 0 if (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)) <= 100.0: tmp = 180.0 * (math.atan((90.0 * ((x_45_scale / angle) * (-2.0 * (((b / x_45_scale) * (b / x_45_scale)) * (y_45_scale / (math.pi * ((b * b) - (a_m * a_m))))))))) / math.pi) else: tmp = 180.0 * (math.atan((0.5 * (x_45_scale * (-360.0 * (y_45_scale / (angle * ((x_45_scale * x_45_scale) * math.pi))))))) / math.pi) return tmp
a_m = abs(a) function code(a_m, b, angle, x_45_scale, y_45_scale) 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_m ^ 2.0))) * t_2) * t_1) / x_45_scale) / y_45_scale) t_4 = Float64(Float64(Float64((Float64(a_m * t_1) ^ 2.0) + (Float64(b * t_2) ^ 2.0)) / y_45_scale) / y_45_scale) t_5 = Float64(Float64(Float64((Float64(a_m * t_2) ^ 2.0) + (Float64(b * t_1) ^ 2.0)) / x_45_scale) / x_45_scale) tmp = 0.0 if (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)) <= 100.0) tmp = Float64(180.0 * Float64(atan(Float64(90.0 * Float64(Float64(x_45_scale / angle) * Float64(-2.0 * Float64(Float64(Float64(b / x_45_scale) * Float64(b / x_45_scale)) * Float64(y_45_scale / Float64(pi * Float64(Float64(b * b) - Float64(a_m * a_m))))))))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(0.5 * Float64(x_45_scale * Float64(-360.0 * Float64(y_45_scale / Float64(angle * Float64(Float64(x_45_scale * x_45_scale) * pi))))))) / pi)); end return tmp end
a_m = abs(a); function tmp_2 = code(a_m, b, angle, x_45_scale, y_45_scale) t_0 = (angle / 180.0) * pi; t_1 = cos(t_0); t_2 = sin(t_0); t_3 = ((((2.0 * ((b ^ 2.0) - (a_m ^ 2.0))) * t_2) * t_1) / x_45_scale) / y_45_scale; t_4 = ((((a_m * t_1) ^ 2.0) + ((b * t_2) ^ 2.0)) / y_45_scale) / y_45_scale; t_5 = ((((a_m * t_2) ^ 2.0) + ((b * t_1) ^ 2.0)) / x_45_scale) / x_45_scale; tmp = 0.0; if ((180.0 * (atan((((t_4 - t_5) - sqrt((((t_5 - t_4) ^ 2.0) + (t_3 ^ 2.0)))) / t_3)) / pi)) <= 100.0) tmp = 180.0 * (atan((90.0 * ((x_45_scale / angle) * (-2.0 * (((b / x_45_scale) * (b / x_45_scale)) * (y_45_scale / (pi * ((b * b) - (a_m * a_m))))))))) / pi); else tmp = 180.0 * (atan((0.5 * (x_45_scale * (-360.0 * (y_45_scale / (angle * ((x_45_scale * x_45_scale) * pi))))))) / pi); end tmp_2 = tmp; end
a_m = N[Abs[a], $MachinePrecision]
code[a$95$m_, b_, angle_, x$45$scale_, y$45$scale_] := 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$95$m, 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$95$m * 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$95$m * 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]}, If[LessEqual[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], 100.0], N[(180.0 * N[(N[ArcTan[N[(90.0 * N[(N[(x$45$scale / angle), $MachinePrecision] * N[(-2.0 * N[(N[(N[(b / x$45$scale), $MachinePrecision] * N[(b / x$45$scale), $MachinePrecision]), $MachinePrecision] * N[(y$45$scale / N[(Pi * N[(N[(b * b), $MachinePrecision] - N[(a$95$m * a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(0.5 * N[(x$45$scale * N[(-360.0 * N[(y$45$scale / N[(angle * N[(N[(x$45$scale * x$45$scale), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
a_m = \left|a\right|
\\
\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\_m}^{2}\right)\right) \cdot t\_2\right) \cdot t\_1}{x-scale}}{y-scale}\\
t_4 := \frac{\frac{{\left(a\_m \cdot t\_1\right)}^{2} + {\left(b \cdot t\_2\right)}^{2}}{y-scale}}{y-scale}\\
t_5 := \frac{\frac{{\left(a\_m \cdot t\_2\right)}^{2} + {\left(b \cdot t\_1\right)}^{2}}{x-scale}}{x-scale}\\
\mathbf{if}\;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} \leq 100:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(90 \cdot \left(\frac{x-scale}{angle} \cdot \left(-2 \cdot \left(\left(\frac{b}{x-scale} \cdot \frac{b}{x-scale}\right) \cdot \frac{y-scale}{\pi \cdot \left(b \cdot b - a\_m \cdot a\_m\right)}\right)\right)\right)\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \left(x-scale \cdot \left(-360 \cdot \frac{y-scale}{angle \cdot \left(\left(x-scale \cdot x-scale\right) \cdot \pi\right)}\right)\right)\right)}{\pi}\\
\end{array}
\end{array}
if (*.f64 #s(literal 180 binary64) (/.f64 (atan.f64 (/.f64 (-.f64 (-.f64 (/.f64 (/.f64 (+.f64 (pow.f64 (*.f64 a (cos.f64 (*.f64 (/.f64 angle #s(literal 180 binary64)) (PI.f64)))) #s(literal 2 binary64)) (pow.f64 (*.f64 b (sin.f64 (*.f64 (/.f64 angle #s(literal 180 binary64)) (PI.f64)))) #s(literal 2 binary64))) y-scale) y-scale) (/.f64 (/.f64 (+.f64 (pow.f64 (*.f64 a (sin.f64 (*.f64 (/.f64 angle #s(literal 180 binary64)) (PI.f64)))) #s(literal 2 binary64)) (pow.f64 (*.f64 b (cos.f64 (*.f64 (/.f64 angle #s(literal 180 binary64)) (PI.f64)))) #s(literal 2 binary64))) x-scale) x-scale)) (sqrt.f64 (+.f64 (pow.f64 (-.f64 (/.f64 (/.f64 (+.f64 (pow.f64 (*.f64 a (sin.f64 (*.f64 (/.f64 angle #s(literal 180 binary64)) (PI.f64)))) #s(literal 2 binary64)) (pow.f64 (*.f64 b (cos.f64 (*.f64 (/.f64 angle #s(literal 180 binary64)) (PI.f64)))) #s(literal 2 binary64))) x-scale) x-scale) (/.f64 (/.f64 (+.f64 (pow.f64 (*.f64 a (cos.f64 (*.f64 (/.f64 angle #s(literal 180 binary64)) (PI.f64)))) #s(literal 2 binary64)) (pow.f64 (*.f64 b (sin.f64 (*.f64 (/.f64 angle #s(literal 180 binary64)) (PI.f64)))) #s(literal 2 binary64))) y-scale) y-scale)) #s(literal 2 binary64)) (pow.f64 (/.f64 (/.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) (sin.f64 (*.f64 (/.f64 angle #s(literal 180 binary64)) (PI.f64)))) (cos.f64 (*.f64 (/.f64 angle #s(literal 180 binary64)) (PI.f64)))) x-scale) y-scale) #s(literal 2 binary64))))) (/.f64 (/.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) (sin.f64 (*.f64 (/.f64 angle #s(literal 180 binary64)) (PI.f64)))) (cos.f64 (*.f64 (/.f64 angle #s(literal 180 binary64)) (PI.f64)))) x-scale) y-scale))) (PI.f64))) < 100Initial program 50.6%
Taylor expanded in angle around 0
Applied rewrites32.4%
Taylor expanded in x-scale around 0
lower-*.f64N/A
times-fracN/A
lower-*.f64N/A
pow2N/A
pow2N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower--.f64N/A
pow2N/A
lift-*.f64N/A
pow2N/A
lift-*.f64N/A
lift-*.f64N/A
Applied rewrites39.5%
if 100 < (*.f64 #s(literal 180 binary64) (/.f64 (atan.f64 (/.f64 (-.f64 (-.f64 (/.f64 (/.f64 (+.f64 (pow.f64 (*.f64 a (cos.f64 (*.f64 (/.f64 angle #s(literal 180 binary64)) (PI.f64)))) #s(literal 2 binary64)) (pow.f64 (*.f64 b (sin.f64 (*.f64 (/.f64 angle #s(literal 180 binary64)) (PI.f64)))) #s(literal 2 binary64))) y-scale) y-scale) (/.f64 (/.f64 (+.f64 (pow.f64 (*.f64 a (sin.f64 (*.f64 (/.f64 angle #s(literal 180 binary64)) (PI.f64)))) #s(literal 2 binary64)) (pow.f64 (*.f64 b (cos.f64 (*.f64 (/.f64 angle #s(literal 180 binary64)) (PI.f64)))) #s(literal 2 binary64))) x-scale) x-scale)) (sqrt.f64 (+.f64 (pow.f64 (-.f64 (/.f64 (/.f64 (+.f64 (pow.f64 (*.f64 a (sin.f64 (*.f64 (/.f64 angle #s(literal 180 binary64)) (PI.f64)))) #s(literal 2 binary64)) (pow.f64 (*.f64 b (cos.f64 (*.f64 (/.f64 angle #s(literal 180 binary64)) (PI.f64)))) #s(literal 2 binary64))) x-scale) x-scale) (/.f64 (/.f64 (+.f64 (pow.f64 (*.f64 a (cos.f64 (*.f64 (/.f64 angle #s(literal 180 binary64)) (PI.f64)))) #s(literal 2 binary64)) (pow.f64 (*.f64 b (sin.f64 (*.f64 (/.f64 angle #s(literal 180 binary64)) (PI.f64)))) #s(literal 2 binary64))) y-scale) y-scale)) #s(literal 2 binary64)) (pow.f64 (/.f64 (/.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) (sin.f64 (*.f64 (/.f64 angle #s(literal 180 binary64)) (PI.f64)))) (cos.f64 (*.f64 (/.f64 angle #s(literal 180 binary64)) (PI.f64)))) x-scale) y-scale) #s(literal 2 binary64))))) (/.f64 (/.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) (sin.f64 (*.f64 (/.f64 angle #s(literal 180 binary64)) (PI.f64)))) (cos.f64 (*.f64 (/.f64 angle #s(literal 180 binary64)) (PI.f64)))) x-scale) y-scale))) (PI.f64))) Initial program 0.0%
Taylor expanded in b around inf
Applied rewrites24.2%
Taylor expanded in angle around 0
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lift-PI.f6439.3
Applied rewrites39.3%
Taylor expanded in angle around 0
Applied rewrites40.4%
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 7.2e-65)
(*
180.0
(/
(atan
(*
-1.0
(*
(/ y-scale x-scale)
(/
(pow (sin (fma 0.005555555555555556 (* angle PI) (* 0.5 PI))) 2.0)
(* (cos t_0) (sin t_0))))))
PI))
(* 180.0 (/ (atan (* (/ y-scale x-scale) (tan 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 <= 7.2e-65) {
tmp = 180.0 * (atan((-1.0 * ((y_45_scale / x_45_scale) * (pow(sin(fma(0.005555555555555556, (angle * ((double) M_PI)), (0.5 * ((double) M_PI)))), 2.0) / (cos(t_0) * sin(t_0)))))) / ((double) M_PI));
} else {
tmp = 180.0 * (atan(((y_45_scale / x_45_scale) * tan(t_0))) / ((double) M_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 <= 7.2e-65) tmp = Float64(180.0 * Float64(atan(Float64(-1.0 * Float64(Float64(y_45_scale / x_45_scale) * Float64((sin(fma(0.005555555555555556, Float64(angle * pi), Float64(0.5 * pi))) ^ 2.0) / Float64(cos(t_0) * sin(t_0)))))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(y_45_scale / x_45_scale) * tan(t_0))) / pi)); end return tmp end
a_m = N[Abs[a], $MachinePrecision]
code[a$95$m_, b_, angle_, x$45$scale_, y$45$scale_] := Block[{t$95$0 = N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a$95$m, 7.2e-65], N[(180.0 * N[(N[ArcTan[N[(-1.0 * N[(N[(y$45$scale / x$45$scale), $MachinePrecision] * N[(N[Power[N[Sin[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision] + N[(0.5 * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision] / N[(N[Cos[t$95$0], $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(y$45$scale / x$45$scale), $MachinePrecision] * N[Tan[t$95$0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\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 7.2 \cdot 10^{-65}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-1 \cdot \left(\frac{y-scale}{x-scale} \cdot \frac{{\sin \left(\mathsf{fma}\left(0.005555555555555556, angle \cdot \pi, 0.5 \cdot \pi\right)\right)}^{2}}{\cos t\_0 \cdot \sin t\_0}\right)\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{y-scale}{x-scale} \cdot \tan t\_0\right)}{\pi}\\
\end{array}
\end{array}
if a < 7.1999999999999996e-65Initial program 18.8%
Taylor expanded in x-scale around 0
Applied rewrites34.6%
lift-cos.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
sin-+PI/2-revN/A
lower-sin.f64N/A
lower-fma.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lower-/.f64N/A
lift-PI.f6434.7
Applied rewrites34.7%
Taylor expanded in a around 0
lower-*.f64N/A
times-fracN/A
lift-/.f64N/A
Applied rewrites57.4%
if 7.1999999999999996e-65 < a Initial program 10.2%
Taylor expanded in x-scale around 0
Applied rewrites30.5%
Taylor expanded in a around inf
times-fracN/A
lower-*.f64N/A
lift-/.f64N/A
quot-tanN/A
lower-tan.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f6456.6
Applied rewrites56.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 7.2e-65)
(*
180.0
(/
(atan
(*
-1.0
(*
(/ y-scale x-scale)
(/ (pow (sin (* 0.5 PI)) 2.0) (* (cos t_0) (sin t_0))))))
PI))
(* 180.0 (/ (atan (* (/ y-scale x-scale) (tan 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 <= 7.2e-65) {
tmp = 180.0 * (atan((-1.0 * ((y_45_scale / x_45_scale) * (pow(sin((0.5 * ((double) M_PI))), 2.0) / (cos(t_0) * sin(t_0)))))) / ((double) M_PI));
} else {
tmp = 180.0 * (atan(((y_45_scale / x_45_scale) * tan(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 <= 7.2e-65) {
tmp = 180.0 * (Math.atan((-1.0 * ((y_45_scale / x_45_scale) * (Math.pow(Math.sin((0.5 * Math.PI)), 2.0) / (Math.cos(t_0) * Math.sin(t_0)))))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(((y_45_scale / x_45_scale) * Math.tan(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 <= 7.2e-65: tmp = 180.0 * (math.atan((-1.0 * ((y_45_scale / x_45_scale) * (math.pow(math.sin((0.5 * math.pi)), 2.0) / (math.cos(t_0) * math.sin(t_0)))))) / math.pi) else: tmp = 180.0 * (math.atan(((y_45_scale / x_45_scale) * math.tan(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 <= 7.2e-65) tmp = Float64(180.0 * Float64(atan(Float64(-1.0 * Float64(Float64(y_45_scale / x_45_scale) * Float64((sin(Float64(0.5 * pi)) ^ 2.0) / Float64(cos(t_0) * sin(t_0)))))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(y_45_scale / x_45_scale) * tan(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 <= 7.2e-65) tmp = 180.0 * (atan((-1.0 * ((y_45_scale / x_45_scale) * ((sin((0.5 * pi)) ^ 2.0) / (cos(t_0) * sin(t_0)))))) / pi); else tmp = 180.0 * (atan(((y_45_scale / x_45_scale) * tan(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, 7.2e-65], N[(180.0 * N[(N[ArcTan[N[(-1.0 * N[(N[(y$45$scale / x$45$scale), $MachinePrecision] * N[(N[Power[N[Sin[N[(0.5 * Pi), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision] / N[(N[Cos[t$95$0], $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(y$45$scale / x$45$scale), $MachinePrecision] * N[Tan[t$95$0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\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 7.2 \cdot 10^{-65}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-1 \cdot \left(\frac{y-scale}{x-scale} \cdot \frac{{\sin \left(0.5 \cdot \pi\right)}^{2}}{\cos t\_0 \cdot \sin t\_0}\right)\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{y-scale}{x-scale} \cdot \tan t\_0\right)}{\pi}\\
\end{array}
\end{array}
if a < 7.1999999999999996e-65Initial program 18.8%
Taylor expanded in x-scale around 0
Applied rewrites34.6%
lift-cos.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
sin-+PI/2-revN/A
lower-sin.f64N/A
lower-fma.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lower-/.f64N/A
lift-PI.f6434.7
Applied rewrites34.7%
Taylor expanded in a around 0
lower-*.f64N/A
times-fracN/A
lift-/.f64N/A
Applied rewrites57.4%
Taylor expanded in angle around 0
lift-*.f64N/A
lift-PI.f6456.9
Applied rewrites56.9%
if 7.1999999999999996e-65 < a Initial program 10.2%
Taylor expanded in x-scale around 0
Applied rewrites30.5%
Taylor expanded in a around inf
times-fracN/A
lower-*.f64N/A
lift-/.f64N/A
quot-tanN/A
lower-tan.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f6456.6
Applied rewrites56.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 7.2e-65)
(*
180.0
(/ (atan (* -1.0 (* (/ y-scale x-scale) (/ (cos t_0) (sin t_0))))) PI))
(* 180.0 (/ (atan (* (/ y-scale x-scale) (tan 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 <= 7.2e-65) {
tmp = 180.0 * (atan((-1.0 * ((y_45_scale / x_45_scale) * (cos(t_0) / sin(t_0))))) / ((double) M_PI));
} else {
tmp = 180.0 * (atan(((y_45_scale / x_45_scale) * tan(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 <= 7.2e-65) {
tmp = 180.0 * (Math.atan((-1.0 * ((y_45_scale / x_45_scale) * (Math.cos(t_0) / Math.sin(t_0))))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(((y_45_scale / x_45_scale) * Math.tan(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 <= 7.2e-65: tmp = 180.0 * (math.atan((-1.0 * ((y_45_scale / x_45_scale) * (math.cos(t_0) / math.sin(t_0))))) / math.pi) else: tmp = 180.0 * (math.atan(((y_45_scale / x_45_scale) * math.tan(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 <= 7.2e-65) tmp = Float64(180.0 * Float64(atan(Float64(-1.0 * Float64(Float64(y_45_scale / x_45_scale) * Float64(cos(t_0) / sin(t_0))))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(y_45_scale / x_45_scale) * tan(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 <= 7.2e-65) tmp = 180.0 * (atan((-1.0 * ((y_45_scale / x_45_scale) * (cos(t_0) / sin(t_0))))) / pi); else tmp = 180.0 * (atan(((y_45_scale / x_45_scale) * tan(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, 7.2e-65], N[(180.0 * N[(N[ArcTan[N[(-1.0 * N[(N[(y$45$scale / x$45$scale), $MachinePrecision] * N[(N[Cos[t$95$0], $MachinePrecision] / N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(y$45$scale / x$45$scale), $MachinePrecision] * N[Tan[t$95$0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\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 7.2 \cdot 10^{-65}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-1 \cdot \left(\frac{y-scale}{x-scale} \cdot \frac{\cos t\_0}{\sin t\_0}\right)\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{y-scale}{x-scale} \cdot \tan t\_0\right)}{\pi}\\
\end{array}
\end{array}
if a < 7.1999999999999996e-65Initial program 18.8%
Taylor expanded in b around inf
Applied rewrites32.5%
Taylor expanded in x-scale around 0
lower-*.f64N/A
times-fracN/A
lower-*.f64N/A
Applied rewrites57.4%
if 7.1999999999999996e-65 < a Initial program 10.2%
Taylor expanded in x-scale around 0
Applied rewrites30.5%
Taylor expanded in a around inf
times-fracN/A
lower-*.f64N/A
lift-/.f64N/A
quot-tanN/A
lower-tan.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f6456.6
Applied rewrites56.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 7.2e-65)
(*
180.0
(/ (atan (* -1.0 (/ (* y-scale (cos t_0)) (* x-scale (sin t_0))))) PI))
(* 180.0 (/ (atan (* (/ y-scale x-scale) (tan 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 <= 7.2e-65) {
tmp = 180.0 * (atan((-1.0 * ((y_45_scale * cos(t_0)) / (x_45_scale * sin(t_0))))) / ((double) M_PI));
} else {
tmp = 180.0 * (atan(((y_45_scale / x_45_scale) * tan(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 <= 7.2e-65) {
tmp = 180.0 * (Math.atan((-1.0 * ((y_45_scale * Math.cos(t_0)) / (x_45_scale * Math.sin(t_0))))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(((y_45_scale / x_45_scale) * Math.tan(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 <= 7.2e-65: tmp = 180.0 * (math.atan((-1.0 * ((y_45_scale * math.cos(t_0)) / (x_45_scale * math.sin(t_0))))) / math.pi) else: tmp = 180.0 * (math.atan(((y_45_scale / x_45_scale) * math.tan(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 <= 7.2e-65) tmp = Float64(180.0 * Float64(atan(Float64(-1.0 * Float64(Float64(y_45_scale * cos(t_0)) / Float64(x_45_scale * sin(t_0))))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(y_45_scale / x_45_scale) * tan(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 <= 7.2e-65) tmp = 180.0 * (atan((-1.0 * ((y_45_scale * cos(t_0)) / (x_45_scale * sin(t_0))))) / pi); else tmp = 180.0 * (atan(((y_45_scale / x_45_scale) * tan(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, 7.2e-65], N[(180.0 * N[(N[ArcTan[N[(-1.0 * N[(N[(y$45$scale * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision] / N[(x$45$scale * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(y$45$scale / x$45$scale), $MachinePrecision] * N[Tan[t$95$0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\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 7.2 \cdot 10^{-65}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-1 \cdot \frac{y-scale \cdot \cos t\_0}{x-scale \cdot \sin t\_0}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{y-scale}{x-scale} \cdot \tan t\_0\right)}{\pi}\\
\end{array}
\end{array}
if a < 7.1999999999999996e-65Initial program 18.8%
Taylor expanded in b around inf
Applied rewrites32.5%
Taylor expanded in x-scale around 0
lower-*.f64N/A
times-fracN/A
lower-*.f64N/A
Applied rewrites57.4%
lift-*.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
frac-timesN/A
lower-/.f64N/A
Applied rewrites57.8%
if 7.1999999999999996e-65 < a Initial program 10.2%
Taylor expanded in x-scale around 0
Applied rewrites30.5%
Taylor expanded in a around inf
times-fracN/A
lower-*.f64N/A
lift-/.f64N/A
quot-tanN/A
lower-tan.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f6456.6
Applied rewrites56.6%
a_m = (fabs.f64 a)
(FPCore (a_m b angle x-scale y-scale)
:precision binary64
(if (<= a_m 1.3e-63)
(*
180.0
(/
(atan
(*
-1.0
(*
(/ y-scale x-scale)
(/
(fma
(* angle angle)
(- (* -0.002777777777777778 PI) (* -0.000925925925925926 PI))
(* 180.0 (pow PI -1.0)))
angle))))
PI))
(*
180.0
(/
(atan (* (/ y-scale x-scale) (tan (* 0.005555555555555556 (* angle PI)))))
PI))))a_m = fabs(a);
double code(double a_m, double b, double angle, double x_45_scale, double y_45_scale) {
double tmp;
if (a_m <= 1.3e-63) {
tmp = 180.0 * (atan((-1.0 * ((y_45_scale / x_45_scale) * (fma((angle * angle), ((-0.002777777777777778 * ((double) M_PI)) - (-0.000925925925925926 * ((double) M_PI))), (180.0 * pow(((double) M_PI), -1.0))) / angle)))) / ((double) M_PI));
} else {
tmp = 180.0 * (atan(((y_45_scale / x_45_scale) * tan((0.005555555555555556 * (angle * ((double) M_PI)))))) / ((double) M_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.3e-63) tmp = Float64(180.0 * Float64(atan(Float64(-1.0 * Float64(Float64(y_45_scale / x_45_scale) * Float64(fma(Float64(angle * angle), Float64(Float64(-0.002777777777777778 * pi) - Float64(-0.000925925925925926 * pi)), Float64(180.0 * (pi ^ -1.0))) / angle)))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(y_45_scale / x_45_scale) * tan(Float64(0.005555555555555556 * Float64(angle * pi))))) / pi)); end return 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.3e-63], N[(180.0 * N[(N[ArcTan[N[(-1.0 * N[(N[(y$45$scale / x$45$scale), $MachinePrecision] * N[(N[(N[(angle * angle), $MachinePrecision] * N[(N[(-0.002777777777777778 * Pi), $MachinePrecision] - N[(-0.000925925925925926 * Pi), $MachinePrecision]), $MachinePrecision] + N[(180.0 * N[Power[Pi, -1.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(y$45$scale / x$45$scale), $MachinePrecision] * N[Tan[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
a_m = \left|a\right|
\\
\begin{array}{l}
\mathbf{if}\;a\_m \leq 1.3 \cdot 10^{-63}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-1 \cdot \left(\frac{y-scale}{x-scale} \cdot \frac{\mathsf{fma}\left(angle \cdot angle, -0.002777777777777778 \cdot \pi - -0.000925925925925926 \cdot \pi, 180 \cdot {\pi}^{-1}\right)}{angle}\right)\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{y-scale}{x-scale} \cdot \tan \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)}{\pi}\\
\end{array}
\end{array}
if a < 1.3000000000000001e-63Initial program 18.9%
Taylor expanded in b around inf
Applied rewrites32.5%
Taylor expanded in x-scale around 0
lower-*.f64N/A
times-fracN/A
lower-*.f64N/A
Applied rewrites57.3%
Taylor expanded in angle around 0
lower-/.f64N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-PI.f64N/A
lower-*.f64N/A
lift-PI.f64N/A
lower-*.f64N/A
inv-powN/A
lower-pow.f64N/A
lift-PI.f6451.7
Applied rewrites51.7%
if 1.3000000000000001e-63 < a Initial program 10.1%
Taylor expanded in x-scale around 0
Applied rewrites30.4%
Taylor expanded in a around inf
times-fracN/A
lower-*.f64N/A
lift-/.f64N/A
quot-tanN/A
lower-tan.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f6456.6
Applied rewrites56.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.4e-63)
(* 180.0 (/ (atan (* -1.0 (* (/ y-scale x-scale) (/ 1.0 (sin t_0))))) PI))
(* 180.0 (/ (atan (* (/ y-scale x-scale) (tan t_0))) PI)))))a_m = fabs(a);
double code(double a_m, double b, double angle, double x_45_scale, double y_45_scale) {
double t_0 = 0.005555555555555556 * (angle * ((double) M_PI));
double tmp;
if (a_m <= 1.4e-63) {
tmp = 180.0 * (atan((-1.0 * ((y_45_scale / x_45_scale) * (1.0 / sin(t_0))))) / ((double) M_PI));
} else {
tmp = 180.0 * (atan(((y_45_scale / x_45_scale) * tan(t_0))) / ((double) M_PI));
}
return tmp;
}
a_m = Math.abs(a);
public static double code(double a_m, double b, double angle, double x_45_scale, double y_45_scale) {
double t_0 = 0.005555555555555556 * (angle * Math.PI);
double tmp;
if (a_m <= 1.4e-63) {
tmp = 180.0 * (Math.atan((-1.0 * ((y_45_scale / x_45_scale) * (1.0 / Math.sin(t_0))))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(((y_45_scale / x_45_scale) * Math.tan(t_0))) / Math.PI);
}
return tmp;
}
a_m = math.fabs(a) def code(a_m, b, angle, x_45_scale, y_45_scale): t_0 = 0.005555555555555556 * (angle * math.pi) tmp = 0 if a_m <= 1.4e-63: tmp = 180.0 * (math.atan((-1.0 * ((y_45_scale / x_45_scale) * (1.0 / math.sin(t_0))))) / math.pi) else: tmp = 180.0 * (math.atan(((y_45_scale / x_45_scale) * math.tan(t_0))) / math.pi) return tmp
a_m = abs(a) function code(a_m, b, angle, x_45_scale, y_45_scale) t_0 = Float64(0.005555555555555556 * Float64(angle * pi)) tmp = 0.0 if (a_m <= 1.4e-63) tmp = Float64(180.0 * Float64(atan(Float64(-1.0 * Float64(Float64(y_45_scale / x_45_scale) * Float64(1.0 / sin(t_0))))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(y_45_scale / x_45_scale) * tan(t_0))) / pi)); end return tmp end
a_m = abs(a); function tmp_2 = code(a_m, b, angle, x_45_scale, y_45_scale) t_0 = 0.005555555555555556 * (angle * pi); tmp = 0.0; if (a_m <= 1.4e-63) tmp = 180.0 * (atan((-1.0 * ((y_45_scale / x_45_scale) * (1.0 / sin(t_0))))) / pi); else tmp = 180.0 * (atan(((y_45_scale / x_45_scale) * tan(t_0))) / pi); end tmp_2 = tmp; end
a_m = N[Abs[a], $MachinePrecision]
code[a$95$m_, b_, angle_, x$45$scale_, y$45$scale_] := Block[{t$95$0 = N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a$95$m, 1.4e-63], N[(180.0 * N[(N[ArcTan[N[(-1.0 * N[(N[(y$45$scale / x$45$scale), $MachinePrecision] * N[(1.0 / N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(y$45$scale / x$45$scale), $MachinePrecision] * N[Tan[t$95$0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\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.4 \cdot 10^{-63}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-1 \cdot \left(\frac{y-scale}{x-scale} \cdot \frac{1}{\sin t\_0}\right)\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{y-scale}{x-scale} \cdot \tan t\_0\right)}{\pi}\\
\end{array}
\end{array}
if a < 1.4000000000000001e-63Initial program 18.9%
Taylor expanded in b around inf
Applied rewrites32.5%
Taylor expanded in x-scale around 0
lower-*.f64N/A
times-fracN/A
lower-*.f64N/A
Applied rewrites57.4%
Taylor expanded in angle around 0
Applied rewrites57.5%
if 1.4000000000000001e-63 < a Initial program 10.1%
Taylor expanded in x-scale around 0
Applied rewrites30.4%
Taylor expanded in a around inf
times-fracN/A
lower-*.f64N/A
lift-/.f64N/A
quot-tanN/A
lower-tan.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f6456.6
Applied rewrites56.6%
a_m = (fabs.f64 a)
(FPCore (a_m b angle x-scale y-scale)
:precision binary64
(if (<= a_m 7e-65)
(*
180.0
(/
(atan
(*
0.5
(*
x-scale
(* -360.0 (/ y-scale (* angle (* (* x-scale x-scale) PI)))))))
PI))
(*
180.0
(/
(atan (* (/ y-scale x-scale) (tan (* 0.005555555555555556 (* angle PI)))))
PI))))a_m = fabs(a);
double code(double a_m, double b, double angle, double x_45_scale, double y_45_scale) {
double tmp;
if (a_m <= 7e-65) {
tmp = 180.0 * (atan((0.5 * (x_45_scale * (-360.0 * (y_45_scale / (angle * ((x_45_scale * x_45_scale) * ((double) M_PI)))))))) / ((double) M_PI));
} else {
tmp = 180.0 * (atan(((y_45_scale / x_45_scale) * tan((0.005555555555555556 * (angle * ((double) M_PI)))))) / ((double) M_PI));
}
return tmp;
}
a_m = Math.abs(a);
public static double code(double a_m, double b, double angle, double x_45_scale, double y_45_scale) {
double tmp;
if (a_m <= 7e-65) {
tmp = 180.0 * (Math.atan((0.5 * (x_45_scale * (-360.0 * (y_45_scale / (angle * ((x_45_scale * x_45_scale) * Math.PI))))))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(((y_45_scale / x_45_scale) * Math.tan((0.005555555555555556 * (angle * Math.PI))))) / Math.PI);
}
return tmp;
}
a_m = math.fabs(a) def code(a_m, b, angle, x_45_scale, y_45_scale): tmp = 0 if a_m <= 7e-65: tmp = 180.0 * (math.atan((0.5 * (x_45_scale * (-360.0 * (y_45_scale / (angle * ((x_45_scale * x_45_scale) * math.pi))))))) / math.pi) else: tmp = 180.0 * (math.atan(((y_45_scale / x_45_scale) * math.tan((0.005555555555555556 * (angle * math.pi))))) / math.pi) return tmp
a_m = abs(a) function code(a_m, b, angle, x_45_scale, y_45_scale) tmp = 0.0 if (a_m <= 7e-65) tmp = Float64(180.0 * Float64(atan(Float64(0.5 * Float64(x_45_scale * Float64(-360.0 * Float64(y_45_scale / Float64(angle * Float64(Float64(x_45_scale * x_45_scale) * pi))))))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(y_45_scale / x_45_scale) * tan(Float64(0.005555555555555556 * Float64(angle * pi))))) / pi)); end return tmp end
a_m = abs(a); function tmp_2 = code(a_m, b, angle, x_45_scale, y_45_scale) tmp = 0.0; if (a_m <= 7e-65) tmp = 180.0 * (atan((0.5 * (x_45_scale * (-360.0 * (y_45_scale / (angle * ((x_45_scale * x_45_scale) * pi))))))) / pi); else tmp = 180.0 * (atan(((y_45_scale / x_45_scale) * tan((0.005555555555555556 * (angle * pi))))) / pi); end tmp_2 = tmp; end
a_m = N[Abs[a], $MachinePrecision] code[a$95$m_, b_, angle_, x$45$scale_, y$45$scale_] := If[LessEqual[a$95$m, 7e-65], N[(180.0 * N[(N[ArcTan[N[(0.5 * N[(x$45$scale * N[(-360.0 * N[(y$45$scale / N[(angle * N[(N[(x$45$scale * x$45$scale), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(y$45$scale / x$45$scale), $MachinePrecision] * N[Tan[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
a_m = \left|a\right|
\\
\begin{array}{l}
\mathbf{if}\;a\_m \leq 7 \cdot 10^{-65}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \left(x-scale \cdot \left(-360 \cdot \frac{y-scale}{angle \cdot \left(\left(x-scale \cdot x-scale\right) \cdot \pi\right)}\right)\right)\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{y-scale}{x-scale} \cdot \tan \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)}{\pi}\\
\end{array}
\end{array}
if a < 7.00000000000000009e-65Initial program 18.8%
Taylor expanded in b around inf
Applied rewrites32.5%
Taylor expanded in angle around 0
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lift-PI.f6447.7
Applied rewrites47.7%
Taylor expanded in angle around 0
Applied rewrites48.9%
if 7.00000000000000009e-65 < a Initial program 10.2%
Taylor expanded in x-scale around 0
Applied rewrites30.5%
Taylor expanded in a around inf
times-fracN/A
lower-*.f64N/A
lift-/.f64N/A
quot-tanN/A
lower-tan.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f6456.6
Applied rewrites56.6%
a_m = (fabs.f64 a)
(FPCore (a_m b angle x-scale y-scale)
:precision binary64
(let* ((t_0 (/ (* y-scale PI) x-scale)))
(if (<= x-scale -7.1e+103)
(*
180.0
(/ (atan (* -1.0 (* (/ y-scale x-scale) (/ 180.0 (* angle PI))))) PI))
(if (<= x-scale 3.9e-148)
(*
180.0
(/
(atan
(*
0.5
(*
(+
x-scale
(* 1.54320987654321e-5 (* (* angle angle) (* x-scale (* PI PI)))))
(* -360.0 (/ y-scale (* angle (* (* x-scale x-scale) PI)))))))
PI))
(*
180.0
(/
(atan
(*
-1.0
(/
(fma
180.0
(/ y-scale (* x-scale PI))
(*
(* angle angle)
(- (* -0.002777777777777778 t_0) (* -0.000925925925925926 t_0))))
angle)))
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 = (y_45_scale * ((double) M_PI)) / x_45_scale;
double tmp;
if (x_45_scale <= -7.1e+103) {
tmp = 180.0 * (atan((-1.0 * ((y_45_scale / x_45_scale) * (180.0 / (angle * ((double) M_PI)))))) / ((double) M_PI));
} else if (x_45_scale <= 3.9e-148) {
tmp = 180.0 * (atan((0.5 * ((x_45_scale + (1.54320987654321e-5 * ((angle * angle) * (x_45_scale * (((double) M_PI) * ((double) M_PI)))))) * (-360.0 * (y_45_scale / (angle * ((x_45_scale * x_45_scale) * ((double) M_PI)))))))) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((-1.0 * (fma(180.0, (y_45_scale / (x_45_scale * ((double) M_PI))), ((angle * angle) * ((-0.002777777777777778 * t_0) - (-0.000925925925925926 * t_0)))) / angle))) / ((double) M_PI));
}
return tmp;
}
a_m = abs(a) function code(a_m, b, angle, x_45_scale, y_45_scale) t_0 = Float64(Float64(y_45_scale * pi) / x_45_scale) tmp = 0.0 if (x_45_scale <= -7.1e+103) tmp = Float64(180.0 * Float64(atan(Float64(-1.0 * Float64(Float64(y_45_scale / x_45_scale) * Float64(180.0 / Float64(angle * pi))))) / pi)); elseif (x_45_scale <= 3.9e-148) tmp = Float64(180.0 * Float64(atan(Float64(0.5 * Float64(Float64(x_45_scale + Float64(1.54320987654321e-5 * Float64(Float64(angle * angle) * Float64(x_45_scale * Float64(pi * pi))))) * Float64(-360.0 * Float64(y_45_scale / Float64(angle * Float64(Float64(x_45_scale * x_45_scale) * pi))))))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(-1.0 * Float64(fma(180.0, Float64(y_45_scale / Float64(x_45_scale * pi)), Float64(Float64(angle * angle) * Float64(Float64(-0.002777777777777778 * t_0) - Float64(-0.000925925925925926 * t_0)))) / angle))) / 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[(y$45$scale * Pi), $MachinePrecision] / x$45$scale), $MachinePrecision]}, If[LessEqual[x$45$scale, -7.1e+103], N[(180.0 * N[(N[ArcTan[N[(-1.0 * N[(N[(y$45$scale / x$45$scale), $MachinePrecision] * N[(180.0 / N[(angle * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[x$45$scale, 3.9e-148], N[(180.0 * N[(N[ArcTan[N[(0.5 * N[(N[(x$45$scale + N[(1.54320987654321e-5 * N[(N[(angle * angle), $MachinePrecision] * N[(x$45$scale * N[(Pi * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(-360.0 * N[(y$45$scale / N[(angle * N[(N[(x$45$scale * x$45$scale), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(-1.0 * N[(N[(180.0 * N[(y$45$scale / N[(x$45$scale * Pi), $MachinePrecision]), $MachinePrecision] + N[(N[(angle * angle), $MachinePrecision] * N[(N[(-0.002777777777777778 * t$95$0), $MachinePrecision] - N[(-0.000925925925925926 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
a_m = \left|a\right|
\\
\begin{array}{l}
t_0 := \frac{y-scale \cdot \pi}{x-scale}\\
\mathbf{if}\;x-scale \leq -7.1 \cdot 10^{+103}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-1 \cdot \left(\frac{y-scale}{x-scale} \cdot \frac{180}{angle \cdot \pi}\right)\right)}{\pi}\\
\mathbf{elif}\;x-scale \leq 3.9 \cdot 10^{-148}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \left(\left(x-scale + 1.54320987654321 \cdot 10^{-5} \cdot \left(\left(angle \cdot angle\right) \cdot \left(x-scale \cdot \left(\pi \cdot \pi\right)\right)\right)\right) \cdot \left(-360 \cdot \frac{y-scale}{angle \cdot \left(\left(x-scale \cdot x-scale\right) \cdot \pi\right)}\right)\right)\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-1 \cdot \frac{\mathsf{fma}\left(180, \frac{y-scale}{x-scale \cdot \pi}, \left(angle \cdot angle\right) \cdot \left(-0.002777777777777778 \cdot t\_0 - -0.000925925925925926 \cdot t\_0\right)\right)}{angle}\right)}{\pi}\\
\end{array}
\end{array}
if x-scale < -7.1000000000000002e103Initial program 5.3%
Taylor expanded in b around inf
Applied rewrites16.8%
Taylor expanded in x-scale around 0
lower-*.f64N/A
times-fracN/A
lower-*.f64N/A
Applied rewrites49.9%
Taylor expanded in angle around 0
lower-/.f64N/A
lift-*.f64N/A
lift-PI.f6445.9
Applied rewrites45.9%
if -7.1000000000000002e103 < x-scale < 3.89999999999999994e-148Initial program 17.2%
Taylor expanded in b around inf
Applied rewrites33.0%
Taylor expanded in angle around 0
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lift-PI.f6439.7
Applied rewrites39.7%
Taylor expanded in angle around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lift-PI.f64N/A
lift-PI.f6442.9
Applied rewrites42.9%
if 3.89999999999999994e-148 < x-scale Initial program 12.8%
Taylor expanded in b around inf
Applied rewrites23.8%
Taylor expanded in x-scale around 0
lower-*.f64N/A
times-fracN/A
lower-*.f64N/A
Applied rewrites44.0%
Taylor expanded in angle around 0
lower-/.f64N/A
Applied rewrites36.5%
a_m = (fabs.f64 a)
(FPCore (a_m b angle x-scale y-scale)
:precision binary64
(*
180.0
(/
(atan
(*
0.5
(* x-scale (* -360.0 (/ y-scale (* angle (* (* x-scale 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((0.5 * (x_45_scale * (-360.0 * (y_45_scale / (angle * ((x_45_scale * 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((0.5 * (x_45_scale * (-360.0 * (y_45_scale / (angle * ((x_45_scale * 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((0.5 * (x_45_scale * (-360.0 * (y_45_scale / (angle * ((x_45_scale * 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(0.5 * Float64(x_45_scale * Float64(-360.0 * Float64(y_45_scale / Float64(angle * Float64(Float64(x_45_scale * 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((0.5 * (x_45_scale * (-360.0 * (y_45_scale / (angle * ((x_45_scale * 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[(0.5 * N[(x$45$scale * N[(-360.0 * N[(y$45$scale / N[(angle * N[(N[(x$45$scale * x$45$scale), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \left(x-scale \cdot \left(-360 \cdot \frac{y-scale}{angle \cdot \left(\left(x-scale \cdot x-scale\right) \cdot \pi\right)}\right)\right)\right)}{\pi}
\end{array}
Initial program 13.6%
Taylor expanded in b around inf
Applied rewrites26.9%
Taylor expanded in angle around 0
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lift-PI.f6439.0
Applied rewrites39.0%
Taylor expanded in angle around 0
Applied rewrites40.0%
a_m = (fabs.f64 a) (FPCore (a_m b angle x-scale y-scale) :precision binary64 (* 180.0 (/ (atan (* -1.0 (* (/ y-scale x-scale) (/ 180.0 (* angle 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((-1.0 * ((y_45_scale / x_45_scale) * (180.0 / (angle * ((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((-1.0 * ((y_45_scale / x_45_scale) * (180.0 / (angle * 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((-1.0 * ((y_45_scale / x_45_scale) * (180.0 / (angle * 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(-1.0 * Float64(Float64(y_45_scale / x_45_scale) * Float64(180.0 / Float64(angle * pi))))) / pi)) end
a_m = abs(a); function tmp = code(a_m, b, angle, x_45_scale, y_45_scale) tmp = 180.0 * (atan((-1.0 * ((y_45_scale / x_45_scale) * (180.0 / (angle * 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[(-1.0 * N[(N[(y$45$scale / x$45$scale), $MachinePrecision] * N[(180.0 / N[(angle * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
180 \cdot \frac{\tan^{-1} \left(-1 \cdot \left(\frac{y-scale}{x-scale} \cdot \frac{180}{angle \cdot \pi}\right)\right)}{\pi}
\end{array}
Initial program 13.6%
Taylor expanded in b around inf
Applied rewrites26.9%
Taylor expanded in x-scale around 0
lower-*.f64N/A
times-fracN/A
lower-*.f64N/A
Applied rewrites45.2%
Taylor expanded in angle around 0
lower-/.f64N/A
lift-*.f64N/A
lift-PI.f6440.2
Applied rewrites40.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 (* 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(y_45_scale / Float64(angle * Float64(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[(y$45$scale / N[(angle * N[(x$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{y-scale}{angle \cdot \left(x-scale \cdot \pi\right)}\right)}{\pi}
\end{array}
Initial program 13.6%
Taylor expanded in angle around 0
Applied rewrites11.2%
Taylor expanded in a around 0
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lift-PI.f6438.5
Applied rewrites38.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.6%
Taylor expanded in angle around 0
Applied rewrites11.2%
Taylor expanded in a around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lift-PI.f6411.8
Applied rewrites11.8%
herbie shell --seed 2025107
(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)))