
(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 12 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}
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale y-scale)
:precision binary64
(let* ((t_0 (* (* 0.005555555555555556 angle) PI))
(t_1
(*
(* 0.005555555555555556 angle)
(* (cbrt PI) (* (cbrt PI) (cbrt PI)))))
(t_2 (* 0.005555555555555556 (* angle PI)))
(t_3 (cos t_2))
(t_4 (sin t_0)))
(if (<= b_m 2.05e-7)
(* 180.0 (/ (atan (* (/ y-scale x-scale) (/ (sin t_1) t_3))) PI))
(if (<= b_m 2.75e+82)
(cbrt
(pow
(*
180.0
(/
(atan
(*
(* y-scale -0.5)
(*
2.0
(/
(pow (hypot (* t_4 a) (* b_m (cos t_0))) 2.0)
(*
(* x-scale (* t_4 (cos t_1)))
(- (pow b_m 2.0) (pow a 2.0)))))))
PI))
3.0))
(*
180.0
(/
(atan (* -0.5 (* y-scale (* 2.0 (/ t_3 (* x-scale (sin t_2)))))))
PI))))))b_m = fabs(b);
double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
double t_0 = (0.005555555555555556 * angle) * ((double) M_PI);
double t_1 = (0.005555555555555556 * angle) * (cbrt(((double) M_PI)) * (cbrt(((double) M_PI)) * cbrt(((double) M_PI))));
double t_2 = 0.005555555555555556 * (angle * ((double) M_PI));
double t_3 = cos(t_2);
double t_4 = sin(t_0);
double tmp;
if (b_m <= 2.05e-7) {
tmp = 180.0 * (atan(((y_45_scale / x_45_scale) * (sin(t_1) / t_3))) / ((double) M_PI));
} else if (b_m <= 2.75e+82) {
tmp = cbrt(pow((180.0 * (atan(((y_45_scale * -0.5) * (2.0 * (pow(hypot((t_4 * a), (b_m * cos(t_0))), 2.0) / ((x_45_scale * (t_4 * cos(t_1))) * (pow(b_m, 2.0) - pow(a, 2.0))))))) / ((double) M_PI))), 3.0));
} else {
tmp = 180.0 * (atan((-0.5 * (y_45_scale * (2.0 * (t_3 / (x_45_scale * sin(t_2))))))) / ((double) M_PI));
}
return tmp;
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
double t_0 = (0.005555555555555556 * angle) * Math.PI;
double t_1 = (0.005555555555555556 * angle) * (Math.cbrt(Math.PI) * (Math.cbrt(Math.PI) * Math.cbrt(Math.PI)));
double t_2 = 0.005555555555555556 * (angle * Math.PI);
double t_3 = Math.cos(t_2);
double t_4 = Math.sin(t_0);
double tmp;
if (b_m <= 2.05e-7) {
tmp = 180.0 * (Math.atan(((y_45_scale / x_45_scale) * (Math.sin(t_1) / t_3))) / Math.PI);
} else if (b_m <= 2.75e+82) {
tmp = Math.cbrt(Math.pow((180.0 * (Math.atan(((y_45_scale * -0.5) * (2.0 * (Math.pow(Math.hypot((t_4 * a), (b_m * Math.cos(t_0))), 2.0) / ((x_45_scale * (t_4 * Math.cos(t_1))) * (Math.pow(b_m, 2.0) - Math.pow(a, 2.0))))))) / Math.PI)), 3.0));
} else {
tmp = 180.0 * (Math.atan((-0.5 * (y_45_scale * (2.0 * (t_3 / (x_45_scale * Math.sin(t_2))))))) / Math.PI);
}
return tmp;
}
b_m = abs(b) function code(a, b_m, angle, x_45_scale, y_45_scale) t_0 = Float64(Float64(0.005555555555555556 * angle) * pi) t_1 = Float64(Float64(0.005555555555555556 * angle) * Float64(cbrt(pi) * Float64(cbrt(pi) * cbrt(pi)))) t_2 = Float64(0.005555555555555556 * Float64(angle * pi)) t_3 = cos(t_2) t_4 = sin(t_0) tmp = 0.0 if (b_m <= 2.05e-7) tmp = Float64(180.0 * Float64(atan(Float64(Float64(y_45_scale / x_45_scale) * Float64(sin(t_1) / t_3))) / pi)); elseif (b_m <= 2.75e+82) tmp = cbrt((Float64(180.0 * Float64(atan(Float64(Float64(y_45_scale * -0.5) * Float64(2.0 * Float64((hypot(Float64(t_4 * a), Float64(b_m * cos(t_0))) ^ 2.0) / Float64(Float64(x_45_scale * Float64(t_4 * cos(t_1))) * Float64((b_m ^ 2.0) - (a ^ 2.0))))))) / pi)) ^ 3.0)); else tmp = Float64(180.0 * Float64(atan(Float64(-0.5 * Float64(y_45_scale * Float64(2.0 * Float64(t_3 / Float64(x_45_scale * sin(t_2))))))) / pi)); end return tmp end
b_m = N[Abs[b], $MachinePrecision]
code[a_, b$95$m_, angle_, x$45$scale_, y$45$scale_] := Block[{t$95$0 = N[(N[(0.005555555555555556 * angle), $MachinePrecision] * Pi), $MachinePrecision]}, Block[{t$95$1 = N[(N[(0.005555555555555556 * angle), $MachinePrecision] * N[(N[Power[Pi, 1/3], $MachinePrecision] * N[(N[Power[Pi, 1/3], $MachinePrecision] * N[Power[Pi, 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Cos[t$95$2], $MachinePrecision]}, Block[{t$95$4 = N[Sin[t$95$0], $MachinePrecision]}, If[LessEqual[b$95$m, 2.05e-7], N[(180.0 * N[(N[ArcTan[N[(N[(y$45$scale / x$45$scale), $MachinePrecision] * N[(N[Sin[t$95$1], $MachinePrecision] / t$95$3), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[b$95$m, 2.75e+82], N[Power[N[Power[N[(180.0 * N[(N[ArcTan[N[(N[(y$45$scale * -0.5), $MachinePrecision] * N[(2.0 * N[(N[Power[N[Sqrt[N[(t$95$4 * a), $MachinePrecision] ^ 2 + N[(b$95$m * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision], 2.0], $MachinePrecision] / N[(N[(x$45$scale * N[(t$95$4 * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Power[b$95$m, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision], 1/3], $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(-0.5 * N[(y$45$scale * N[(2.0 * N[(t$95$3 / N[(x$45$scale * N[Sin[t$95$2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
t_0 := \left(0.005555555555555556 \cdot angle\right) \cdot \pi\\
t_1 := \left(0.005555555555555556 \cdot angle\right) \cdot \left(\sqrt[3]{\pi} \cdot \left(\sqrt[3]{\pi} \cdot \sqrt[3]{\pi}\right)\right)\\
t_2 := 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\\
t_3 := \cos t\_2\\
t_4 := \sin t\_0\\
\mathbf{if}\;b\_m \leq 2.05 \cdot 10^{-7}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{y-scale}{x-scale} \cdot \frac{\sin t\_1}{t\_3}\right)}{\pi}\\
\mathbf{elif}\;b\_m \leq 2.75 \cdot 10^{+82}:\\
\;\;\;\;\sqrt[3]{{\left(180 \cdot \frac{\tan^{-1} \left(\left(y-scale \cdot -0.5\right) \cdot \left(2 \cdot \frac{{\left(\mathsf{hypot}\left(t\_4 \cdot a, b\_m \cdot \cos t\_0\right)\right)}^{2}}{\left(x-scale \cdot \left(t\_4 \cdot \cos t\_1\right)\right) \cdot \left({b\_m}^{2} - {a}^{2}\right)}\right)\right)}{\pi}\right)}^{3}}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \left(y-scale \cdot \left(2 \cdot \frac{t\_3}{x-scale \cdot \sin t\_2}\right)\right)\right)}{\pi}\\
\end{array}
\end{array}
if b < 2.05e-7Initial program 9.5%
Simplified11.4%
Taylor expanded in x-scale around 0 28.3%
Simplified30.5%
Taylor expanded in a around inf 49.0%
times-frac50.0%
Simplified50.0%
associate-*r*51.8%
pow151.8%
Applied egg-rr51.8%
add-cube-cbrt56.5%
Applied egg-rr56.5%
if 2.05e-7 < b < 2.74999999999999998e82Initial program 28.4%
Simplified12.9%
Taylor expanded in x-scale around 0 38.3%
Simplified38.7%
pow138.7%
Applied egg-rr38.8%
unpow138.8%
Simplified38.8%
Applied egg-rr48.0%
add-cube-cbrt40.5%
Applied egg-rr53.1%
if 2.74999999999999998e82 < b Initial program 11.0%
Simplified2.3%
Taylor expanded in x-scale around 0 21.9%
Simplified21.9%
Taylor expanded in a around 0 69.6%
Final simplification58.6%
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale y-scale)
:precision binary64
(let* ((t_0 (* 0.005555555555555556 (* angle PI))) (t_1 (cos t_0)))
(if (<= b_m 0.015)
(*
180.0
(/
(atan
(*
(/ y-scale x-scale)
(/
(sin
(*
(* 0.005555555555555556 angle)
(* (cbrt PI) (* (cbrt PI) (cbrt PI)))))
t_1)))
PI))
(* 180.0 (/ (atan (/ (* y-scale t_1) (* (sin t_0) (- x-scale)))) PI)))))b_m = fabs(b);
double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
double t_0 = 0.005555555555555556 * (angle * ((double) M_PI));
double t_1 = cos(t_0);
double tmp;
if (b_m <= 0.015) {
tmp = 180.0 * (atan(((y_45_scale / x_45_scale) * (sin(((0.005555555555555556 * angle) * (cbrt(((double) M_PI)) * (cbrt(((double) M_PI)) * cbrt(((double) M_PI)))))) / t_1))) / ((double) M_PI));
} else {
tmp = 180.0 * (atan(((y_45_scale * t_1) / (sin(t_0) * -x_45_scale))) / ((double) M_PI));
}
return tmp;
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
double t_0 = 0.005555555555555556 * (angle * Math.PI);
double t_1 = Math.cos(t_0);
double tmp;
if (b_m <= 0.015) {
tmp = 180.0 * (Math.atan(((y_45_scale / x_45_scale) * (Math.sin(((0.005555555555555556 * angle) * (Math.cbrt(Math.PI) * (Math.cbrt(Math.PI) * Math.cbrt(Math.PI))))) / t_1))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(((y_45_scale * t_1) / (Math.sin(t_0) * -x_45_scale))) / Math.PI);
}
return tmp;
}
b_m = abs(b) function code(a, b_m, angle, x_45_scale, y_45_scale) t_0 = Float64(0.005555555555555556 * Float64(angle * pi)) t_1 = cos(t_0) tmp = 0.0 if (b_m <= 0.015) tmp = Float64(180.0 * Float64(atan(Float64(Float64(y_45_scale / x_45_scale) * Float64(sin(Float64(Float64(0.005555555555555556 * angle) * Float64(cbrt(pi) * Float64(cbrt(pi) * cbrt(pi))))) / t_1))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(y_45_scale * t_1) / Float64(sin(t_0) * Float64(-x_45_scale)))) / pi)); end return tmp end
b_m = N[Abs[b], $MachinePrecision]
code[a_, b$95$m_, angle_, x$45$scale_, y$45$scale_] := Block[{t$95$0 = N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Cos[t$95$0], $MachinePrecision]}, If[LessEqual[b$95$m, 0.015], N[(180.0 * N[(N[ArcTan[N[(N[(y$45$scale / x$45$scale), $MachinePrecision] * N[(N[Sin[N[(N[(0.005555555555555556 * angle), $MachinePrecision] * N[(N[Power[Pi, 1/3], $MachinePrecision] * N[(N[Power[Pi, 1/3], $MachinePrecision] * N[Power[Pi, 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(y$45$scale * t$95$1), $MachinePrecision] / N[(N[Sin[t$95$0], $MachinePrecision] * (-x$45$scale)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
t_0 := 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\\
t_1 := \cos t\_0\\
\mathbf{if}\;b\_m \leq 0.015:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{y-scale}{x-scale} \cdot \frac{\sin \left(\left(0.005555555555555556 \cdot angle\right) \cdot \left(\sqrt[3]{\pi} \cdot \left(\sqrt[3]{\pi} \cdot \sqrt[3]{\pi}\right)\right)\right)}{t\_1}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{y-scale \cdot t\_1}{\sin t\_0 \cdot \left(-x-scale\right)}\right)}{\pi}\\
\end{array}
\end{array}
if b < 0.014999999999999999Initial program 9.5%
Simplified11.4%
Taylor expanded in x-scale around 0 28.3%
Simplified30.5%
Taylor expanded in a around inf 49.0%
times-frac50.0%
Simplified50.0%
associate-*r*51.8%
pow151.8%
Applied egg-rr51.8%
add-cube-cbrt56.5%
Applied egg-rr56.5%
if 0.014999999999999999 < b Initial program 16.1%
Simplified5.4%
Taylor expanded in x-scale around 0 26.7%
Simplified26.8%
Taylor expanded in a around 0 59.3%
Final simplification57.2%
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale y-scale)
:precision binary64
(let* ((t_0 (* 0.005555555555555556 (* angle PI))) (t_1 (cos t_0)))
(if (<= b_m 1.75e+109)
(*
180.0
(/
(atan
(*
(/ y-scale x-scale)
(/
(sin (* (* 0.005555555555555556 angle) (* (sqrt PI) (sqrt PI))))
t_1)))
PI))
(*
180.0
(/
(atan (* -0.5 (* y-scale (* 2.0 (/ t_1 (* x-scale (sin t_0)))))))
PI)))))b_m = fabs(b);
double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
double t_0 = 0.005555555555555556 * (angle * ((double) M_PI));
double t_1 = cos(t_0);
double tmp;
if (b_m <= 1.75e+109) {
tmp = 180.0 * (atan(((y_45_scale / x_45_scale) * (sin(((0.005555555555555556 * angle) * (sqrt(((double) M_PI)) * sqrt(((double) M_PI))))) / t_1))) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((-0.5 * (y_45_scale * (2.0 * (t_1 / (x_45_scale * sin(t_0))))))) / ((double) M_PI));
}
return tmp;
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
double t_0 = 0.005555555555555556 * (angle * Math.PI);
double t_1 = Math.cos(t_0);
double tmp;
if (b_m <= 1.75e+109) {
tmp = 180.0 * (Math.atan(((y_45_scale / x_45_scale) * (Math.sin(((0.005555555555555556 * angle) * (Math.sqrt(Math.PI) * Math.sqrt(Math.PI)))) / t_1))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((-0.5 * (y_45_scale * (2.0 * (t_1 / (x_45_scale * Math.sin(t_0))))))) / Math.PI);
}
return tmp;
}
b_m = math.fabs(b) def code(a, b_m, angle, x_45_scale, y_45_scale): t_0 = 0.005555555555555556 * (angle * math.pi) t_1 = math.cos(t_0) tmp = 0 if b_m <= 1.75e+109: tmp = 180.0 * (math.atan(((y_45_scale / x_45_scale) * (math.sin(((0.005555555555555556 * angle) * (math.sqrt(math.pi) * math.sqrt(math.pi)))) / t_1))) / math.pi) else: tmp = 180.0 * (math.atan((-0.5 * (y_45_scale * (2.0 * (t_1 / (x_45_scale * math.sin(t_0))))))) / math.pi) return tmp
b_m = abs(b) function code(a, b_m, angle, x_45_scale, y_45_scale) t_0 = Float64(0.005555555555555556 * Float64(angle * pi)) t_1 = cos(t_0) tmp = 0.0 if (b_m <= 1.75e+109) tmp = Float64(180.0 * Float64(atan(Float64(Float64(y_45_scale / x_45_scale) * Float64(sin(Float64(Float64(0.005555555555555556 * angle) * Float64(sqrt(pi) * sqrt(pi)))) / t_1))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(-0.5 * Float64(y_45_scale * Float64(2.0 * Float64(t_1 / Float64(x_45_scale * sin(t_0))))))) / pi)); end return tmp end
b_m = abs(b); function tmp_2 = code(a, b_m, angle, x_45_scale, y_45_scale) t_0 = 0.005555555555555556 * (angle * pi); t_1 = cos(t_0); tmp = 0.0; if (b_m <= 1.75e+109) tmp = 180.0 * (atan(((y_45_scale / x_45_scale) * (sin(((0.005555555555555556 * angle) * (sqrt(pi) * sqrt(pi)))) / t_1))) / pi); else tmp = 180.0 * (atan((-0.5 * (y_45_scale * (2.0 * (t_1 / (x_45_scale * sin(t_0))))))) / pi); end tmp_2 = tmp; end
b_m = N[Abs[b], $MachinePrecision]
code[a_, b$95$m_, angle_, x$45$scale_, y$45$scale_] := Block[{t$95$0 = N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Cos[t$95$0], $MachinePrecision]}, If[LessEqual[b$95$m, 1.75e+109], N[(180.0 * N[(N[ArcTan[N[(N[(y$45$scale / x$45$scale), $MachinePrecision] * N[(N[Sin[N[(N[(0.005555555555555556 * angle), $MachinePrecision] * N[(N[Sqrt[Pi], $MachinePrecision] * N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(-0.5 * N[(y$45$scale * N[(2.0 * N[(t$95$1 / N[(x$45$scale * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
t_0 := 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\\
t_1 := \cos t\_0\\
\mathbf{if}\;b\_m \leq 1.75 \cdot 10^{+109}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{y-scale}{x-scale} \cdot \frac{\sin \left(\left(0.005555555555555556 \cdot angle\right) \cdot \left(\sqrt{\pi} \cdot \sqrt{\pi}\right)\right)}{t\_1}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \left(y-scale \cdot \left(2 \cdot \frac{t\_1}{x-scale \cdot \sin t\_0}\right)\right)\right)}{\pi}\\
\end{array}
\end{array}
if b < 1.74999999999999992e109Initial program 11.6%
Simplified11.0%
Taylor expanded in x-scale around 0 29.7%
Simplified31.7%
Taylor expanded in a around inf 49.8%
times-frac50.7%
Simplified50.7%
associate-*r*52.7%
pow152.7%
Applied egg-rr52.7%
add-sqr-sqrt54.0%
Applied egg-rr54.0%
if 1.74999999999999992e109 < b Initial program 8.5%
Simplified2.9%
Taylor expanded in x-scale around 0 16.8%
Simplified16.8%
Taylor expanded in a around 0 73.9%
Final simplification56.8%
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale y-scale)
:precision binary64
(let* ((t_0 (* 0.005555555555555556 (* angle PI))) (t_1 (sin t_0)))
(if (<= b_m 3.5e-185)
(*
180.0
(/
(atan (* 0.005555555555555556 (* angle (* y-scale (/ PI x-scale)))))
PI))
(if (<= b_m 2.15e+49)
(* 180.0 (/ (atan (* (/ y-scale x-scale) t_1)) PI))
(*
180.0
(/
(atan (* -0.5 (* y-scale (* 2.0 (/ (cos t_0) (* x-scale t_1))))))
PI))))))b_m = fabs(b);
double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
double t_0 = 0.005555555555555556 * (angle * ((double) M_PI));
double t_1 = sin(t_0);
double tmp;
if (b_m <= 3.5e-185) {
tmp = 180.0 * (atan((0.005555555555555556 * (angle * (y_45_scale * (((double) M_PI) / x_45_scale))))) / ((double) M_PI));
} else if (b_m <= 2.15e+49) {
tmp = 180.0 * (atan(((y_45_scale / x_45_scale) * t_1)) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((-0.5 * (y_45_scale * (2.0 * (cos(t_0) / (x_45_scale * t_1)))))) / ((double) M_PI));
}
return tmp;
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
double t_0 = 0.005555555555555556 * (angle * Math.PI);
double t_1 = Math.sin(t_0);
double tmp;
if (b_m <= 3.5e-185) {
tmp = 180.0 * (Math.atan((0.005555555555555556 * (angle * (y_45_scale * (Math.PI / x_45_scale))))) / Math.PI);
} else if (b_m <= 2.15e+49) {
tmp = 180.0 * (Math.atan(((y_45_scale / x_45_scale) * t_1)) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((-0.5 * (y_45_scale * (2.0 * (Math.cos(t_0) / (x_45_scale * t_1)))))) / Math.PI);
}
return tmp;
}
b_m = math.fabs(b) def code(a, b_m, angle, x_45_scale, y_45_scale): t_0 = 0.005555555555555556 * (angle * math.pi) t_1 = math.sin(t_0) tmp = 0 if b_m <= 3.5e-185: tmp = 180.0 * (math.atan((0.005555555555555556 * (angle * (y_45_scale * (math.pi / x_45_scale))))) / math.pi) elif b_m <= 2.15e+49: tmp = 180.0 * (math.atan(((y_45_scale / x_45_scale) * t_1)) / math.pi) else: tmp = 180.0 * (math.atan((-0.5 * (y_45_scale * (2.0 * (math.cos(t_0) / (x_45_scale * t_1)))))) / math.pi) return tmp
b_m = abs(b) function code(a, b_m, angle, x_45_scale, y_45_scale) t_0 = Float64(0.005555555555555556 * Float64(angle * pi)) t_1 = sin(t_0) tmp = 0.0 if (b_m <= 3.5e-185) tmp = Float64(180.0 * Float64(atan(Float64(0.005555555555555556 * Float64(angle * Float64(y_45_scale * Float64(pi / x_45_scale))))) / pi)); elseif (b_m <= 2.15e+49) tmp = Float64(180.0 * Float64(atan(Float64(Float64(y_45_scale / x_45_scale) * t_1)) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(-0.5 * Float64(y_45_scale * Float64(2.0 * Float64(cos(t_0) / Float64(x_45_scale * t_1)))))) / pi)); end return tmp end
b_m = abs(b); function tmp_2 = code(a, b_m, angle, x_45_scale, y_45_scale) t_0 = 0.005555555555555556 * (angle * pi); t_1 = sin(t_0); tmp = 0.0; if (b_m <= 3.5e-185) tmp = 180.0 * (atan((0.005555555555555556 * (angle * (y_45_scale * (pi / x_45_scale))))) / pi); elseif (b_m <= 2.15e+49) tmp = 180.0 * (atan(((y_45_scale / x_45_scale) * t_1)) / pi); else tmp = 180.0 * (atan((-0.5 * (y_45_scale * (2.0 * (cos(t_0) / (x_45_scale * t_1)))))) / pi); end tmp_2 = tmp; end
b_m = N[Abs[b], $MachinePrecision]
code[a_, b$95$m_, angle_, x$45$scale_, y$45$scale_] := Block[{t$95$0 = N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sin[t$95$0], $MachinePrecision]}, If[LessEqual[b$95$m, 3.5e-185], N[(180.0 * N[(N[ArcTan[N[(0.005555555555555556 * N[(angle * N[(y$45$scale * N[(Pi / x$45$scale), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[b$95$m, 2.15e+49], N[(180.0 * N[(N[ArcTan[N[(N[(y$45$scale / x$45$scale), $MachinePrecision] * t$95$1), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(-0.5 * N[(y$45$scale * N[(2.0 * N[(N[Cos[t$95$0], $MachinePrecision] / N[(x$45$scale * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
t_0 := 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\\
t_1 := \sin t\_0\\
\mathbf{if}\;b\_m \leq 3.5 \cdot 10^{-185}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(0.005555555555555556 \cdot \left(angle \cdot \left(y-scale \cdot \frac{\pi}{x-scale}\right)\right)\right)}{\pi}\\
\mathbf{elif}\;b\_m \leq 2.15 \cdot 10^{+49}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{y-scale}{x-scale} \cdot t\_1\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \left(y-scale \cdot \left(2 \cdot \frac{\cos t\_0}{x-scale \cdot t\_1}\right)\right)\right)}{\pi}\\
\end{array}
\end{array}
if b < 3.4999999999999998e-185Initial program 8.3%
Simplified10.2%
Taylor expanded in x-scale around 0 25.0%
Simplified26.0%
Taylor expanded in a around inf 44.9%
times-frac46.2%
Simplified46.2%
associate-*r*47.9%
pow147.9%
Applied egg-rr47.9%
Taylor expanded in angle around 0 43.7%
associate-/l*48.3%
associate-/l*48.3%
Simplified48.3%
if 3.4999999999999998e-185 < b < 2.15e49Initial program 15.8%
Simplified15.7%
Taylor expanded in x-scale around 0 35.8%
Simplified40.5%
Taylor expanded in a around inf 59.7%
times-frac59.7%
Simplified59.7%
Taylor expanded in angle around 0 65.3%
if 2.15e49 < b Initial program 13.4%
Simplified2.1%
Taylor expanded in x-scale around 0 26.5%
Simplified26.6%
Taylor expanded in a around 0 66.5%
Final simplification56.1%
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale y-scale)
:precision binary64
(let* ((t_0 (* 0.005555555555555556 (* angle PI))) (t_1 (sin t_0)))
(if (<= b_m 6.2e-183)
(*
180.0
(/
(atan (* 0.005555555555555556 (* angle (* y-scale (/ PI x-scale)))))
PI))
(if (<= b_m 3.2e+50)
(* 180.0 (/ (atan (* (/ y-scale x-scale) t_1)) PI))
(*
180.0
(/ (atan (/ (* y-scale (cos t_0)) (* t_1 (- x-scale)))) PI))))))b_m = fabs(b);
double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
double t_0 = 0.005555555555555556 * (angle * ((double) M_PI));
double t_1 = sin(t_0);
double tmp;
if (b_m <= 6.2e-183) {
tmp = 180.0 * (atan((0.005555555555555556 * (angle * (y_45_scale * (((double) M_PI) / x_45_scale))))) / ((double) M_PI));
} else if (b_m <= 3.2e+50) {
tmp = 180.0 * (atan(((y_45_scale / x_45_scale) * t_1)) / ((double) M_PI));
} else {
tmp = 180.0 * (atan(((y_45_scale * cos(t_0)) / (t_1 * -x_45_scale))) / ((double) M_PI));
}
return tmp;
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
double t_0 = 0.005555555555555556 * (angle * Math.PI);
double t_1 = Math.sin(t_0);
double tmp;
if (b_m <= 6.2e-183) {
tmp = 180.0 * (Math.atan((0.005555555555555556 * (angle * (y_45_scale * (Math.PI / x_45_scale))))) / Math.PI);
} else if (b_m <= 3.2e+50) {
tmp = 180.0 * (Math.atan(((y_45_scale / x_45_scale) * t_1)) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(((y_45_scale * Math.cos(t_0)) / (t_1 * -x_45_scale))) / Math.PI);
}
return tmp;
}
b_m = math.fabs(b) def code(a, b_m, angle, x_45_scale, y_45_scale): t_0 = 0.005555555555555556 * (angle * math.pi) t_1 = math.sin(t_0) tmp = 0 if b_m <= 6.2e-183: tmp = 180.0 * (math.atan((0.005555555555555556 * (angle * (y_45_scale * (math.pi / x_45_scale))))) / math.pi) elif b_m <= 3.2e+50: tmp = 180.0 * (math.atan(((y_45_scale / x_45_scale) * t_1)) / math.pi) else: tmp = 180.0 * (math.atan(((y_45_scale * math.cos(t_0)) / (t_1 * -x_45_scale))) / math.pi) return tmp
b_m = abs(b) function code(a, b_m, angle, x_45_scale, y_45_scale) t_0 = Float64(0.005555555555555556 * Float64(angle * pi)) t_1 = sin(t_0) tmp = 0.0 if (b_m <= 6.2e-183) tmp = Float64(180.0 * Float64(atan(Float64(0.005555555555555556 * Float64(angle * Float64(y_45_scale * Float64(pi / x_45_scale))))) / pi)); elseif (b_m <= 3.2e+50) tmp = Float64(180.0 * Float64(atan(Float64(Float64(y_45_scale / x_45_scale) * t_1)) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(y_45_scale * cos(t_0)) / Float64(t_1 * Float64(-x_45_scale)))) / pi)); end return tmp end
b_m = abs(b); function tmp_2 = code(a, b_m, angle, x_45_scale, y_45_scale) t_0 = 0.005555555555555556 * (angle * pi); t_1 = sin(t_0); tmp = 0.0; if (b_m <= 6.2e-183) tmp = 180.0 * (atan((0.005555555555555556 * (angle * (y_45_scale * (pi / x_45_scale))))) / pi); elseif (b_m <= 3.2e+50) tmp = 180.0 * (atan(((y_45_scale / x_45_scale) * t_1)) / pi); else tmp = 180.0 * (atan(((y_45_scale * cos(t_0)) / (t_1 * -x_45_scale))) / pi); end tmp_2 = tmp; end
b_m = N[Abs[b], $MachinePrecision]
code[a_, b$95$m_, angle_, x$45$scale_, y$45$scale_] := Block[{t$95$0 = N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sin[t$95$0], $MachinePrecision]}, If[LessEqual[b$95$m, 6.2e-183], N[(180.0 * N[(N[ArcTan[N[(0.005555555555555556 * N[(angle * N[(y$45$scale * N[(Pi / x$45$scale), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[b$95$m, 3.2e+50], N[(180.0 * N[(N[ArcTan[N[(N[(y$45$scale / x$45$scale), $MachinePrecision] * t$95$1), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(y$45$scale * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision] / N[(t$95$1 * (-x$45$scale)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
t_0 := 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\\
t_1 := \sin t\_0\\
\mathbf{if}\;b\_m \leq 6.2 \cdot 10^{-183}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(0.005555555555555556 \cdot \left(angle \cdot \left(y-scale \cdot \frac{\pi}{x-scale}\right)\right)\right)}{\pi}\\
\mathbf{elif}\;b\_m \leq 3.2 \cdot 10^{+50}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{y-scale}{x-scale} \cdot t\_1\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{y-scale \cdot \cos t\_0}{t\_1 \cdot \left(-x-scale\right)}\right)}{\pi}\\
\end{array}
\end{array}
if b < 6.19999999999999999e-183Initial program 8.3%
Simplified10.2%
Taylor expanded in x-scale around 0 25.0%
Simplified26.0%
Taylor expanded in a around inf 44.9%
times-frac46.2%
Simplified46.2%
associate-*r*47.9%
pow147.9%
Applied egg-rr47.9%
Taylor expanded in angle around 0 43.7%
associate-/l*48.3%
associate-/l*48.3%
Simplified48.3%
if 6.19999999999999999e-183 < b < 3.19999999999999983e50Initial program 15.8%
Simplified15.7%
Taylor expanded in x-scale around 0 35.8%
Simplified40.5%
Taylor expanded in a around inf 59.7%
times-frac59.7%
Simplified59.7%
Taylor expanded in angle around 0 65.3%
if 3.19999999999999983e50 < b Initial program 13.4%
Simplified2.1%
Taylor expanded in x-scale around 0 26.5%
Simplified26.6%
Taylor expanded in a around 0 66.5%
Final simplification56.1%
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale y-scale)
:precision binary64
(let* ((t_0 (* 0.005555555555555556 (* angle PI))) (t_1 (sin t_0)))
(if (<= b_m 5.5e-184)
(*
180.0
(/
(atan (* 0.005555555555555556 (* angle (* y-scale (/ PI x-scale)))))
PI))
(if (<= b_m 6.6e+49)
(* 180.0 (/ (atan (* (/ y-scale x-scale) t_1)) PI))
(*
180.0
(/ (atan (* (/ y-scale x-scale) (- (/ (cos t_0) t_1)))) PI))))))b_m = fabs(b);
double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
double t_0 = 0.005555555555555556 * (angle * ((double) M_PI));
double t_1 = sin(t_0);
double tmp;
if (b_m <= 5.5e-184) {
tmp = 180.0 * (atan((0.005555555555555556 * (angle * (y_45_scale * (((double) M_PI) / x_45_scale))))) / ((double) M_PI));
} else if (b_m <= 6.6e+49) {
tmp = 180.0 * (atan(((y_45_scale / x_45_scale) * t_1)) / ((double) M_PI));
} else {
tmp = 180.0 * (atan(((y_45_scale / x_45_scale) * -(cos(t_0) / t_1))) / ((double) M_PI));
}
return tmp;
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
double t_0 = 0.005555555555555556 * (angle * Math.PI);
double t_1 = Math.sin(t_0);
double tmp;
if (b_m <= 5.5e-184) {
tmp = 180.0 * (Math.atan((0.005555555555555556 * (angle * (y_45_scale * (Math.PI / x_45_scale))))) / Math.PI);
} else if (b_m <= 6.6e+49) {
tmp = 180.0 * (Math.atan(((y_45_scale / x_45_scale) * t_1)) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(((y_45_scale / x_45_scale) * -(Math.cos(t_0) / t_1))) / Math.PI);
}
return tmp;
}
b_m = math.fabs(b) def code(a, b_m, angle, x_45_scale, y_45_scale): t_0 = 0.005555555555555556 * (angle * math.pi) t_1 = math.sin(t_0) tmp = 0 if b_m <= 5.5e-184: tmp = 180.0 * (math.atan((0.005555555555555556 * (angle * (y_45_scale * (math.pi / x_45_scale))))) / math.pi) elif b_m <= 6.6e+49: tmp = 180.0 * (math.atan(((y_45_scale / x_45_scale) * t_1)) / math.pi) else: tmp = 180.0 * (math.atan(((y_45_scale / x_45_scale) * -(math.cos(t_0) / t_1))) / math.pi) return tmp
b_m = abs(b) function code(a, b_m, angle, x_45_scale, y_45_scale) t_0 = Float64(0.005555555555555556 * Float64(angle * pi)) t_1 = sin(t_0) tmp = 0.0 if (b_m <= 5.5e-184) tmp = Float64(180.0 * Float64(atan(Float64(0.005555555555555556 * Float64(angle * Float64(y_45_scale * Float64(pi / x_45_scale))))) / pi)); elseif (b_m <= 6.6e+49) tmp = Float64(180.0 * Float64(atan(Float64(Float64(y_45_scale / x_45_scale) * t_1)) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(y_45_scale / x_45_scale) * Float64(-Float64(cos(t_0) / t_1)))) / pi)); end return tmp end
b_m = abs(b); function tmp_2 = code(a, b_m, angle, x_45_scale, y_45_scale) t_0 = 0.005555555555555556 * (angle * pi); t_1 = sin(t_0); tmp = 0.0; if (b_m <= 5.5e-184) tmp = 180.0 * (atan((0.005555555555555556 * (angle * (y_45_scale * (pi / x_45_scale))))) / pi); elseif (b_m <= 6.6e+49) tmp = 180.0 * (atan(((y_45_scale / x_45_scale) * t_1)) / pi); else tmp = 180.0 * (atan(((y_45_scale / x_45_scale) * -(cos(t_0) / t_1))) / pi); end tmp_2 = tmp; end
b_m = N[Abs[b], $MachinePrecision]
code[a_, b$95$m_, angle_, x$45$scale_, y$45$scale_] := Block[{t$95$0 = N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sin[t$95$0], $MachinePrecision]}, If[LessEqual[b$95$m, 5.5e-184], N[(180.0 * N[(N[ArcTan[N[(0.005555555555555556 * N[(angle * N[(y$45$scale * N[(Pi / x$45$scale), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[b$95$m, 6.6e+49], N[(180.0 * N[(N[ArcTan[N[(N[(y$45$scale / x$45$scale), $MachinePrecision] * t$95$1), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(y$45$scale / x$45$scale), $MachinePrecision] * (-N[(N[Cos[t$95$0], $MachinePrecision] / t$95$1), $MachinePrecision])), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
t_0 := 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\\
t_1 := \sin t\_0\\
\mathbf{if}\;b\_m \leq 5.5 \cdot 10^{-184}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(0.005555555555555556 \cdot \left(angle \cdot \left(y-scale \cdot \frac{\pi}{x-scale}\right)\right)\right)}{\pi}\\
\mathbf{elif}\;b\_m \leq 6.6 \cdot 10^{+49}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{y-scale}{x-scale} \cdot t\_1\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{y-scale}{x-scale} \cdot \left(-\frac{\cos t\_0}{t\_1}\right)\right)}{\pi}\\
\end{array}
\end{array}
if b < 5.4999999999999999e-184Initial program 8.3%
Simplified10.2%
Taylor expanded in x-scale around 0 25.0%
Simplified26.0%
Taylor expanded in a around inf 44.9%
times-frac46.2%
Simplified46.2%
associate-*r*47.9%
pow147.9%
Applied egg-rr47.9%
Taylor expanded in angle around 0 43.7%
associate-/l*48.3%
associate-/l*48.3%
Simplified48.3%
if 5.4999999999999999e-184 < b < 6.5999999999999997e49Initial program 15.8%
Simplified15.7%
Taylor expanded in x-scale around 0 35.8%
Simplified40.5%
Taylor expanded in a around inf 59.7%
times-frac59.7%
Simplified59.7%
Taylor expanded in angle around 0 65.3%
if 6.5999999999999997e49 < b Initial program 13.4%
Simplified2.1%
Taylor expanded in x-scale around 0 26.5%
Simplified26.6%
Taylor expanded in a around 0 66.5%
mul-1-neg66.5%
times-frac64.8%
Simplified64.8%
Final simplification55.8%
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale y-scale)
:precision binary64
(if (<= b_m 2.9e-183)
(*
180.0
(/
(atan (* 0.005555555555555556 (* angle (* y-scale (/ PI x-scale)))))
PI))
(if (<= b_m 1.2e+63)
(*
180.0
(/
(atan
(* (/ y-scale x-scale) (sin (* 0.005555555555555556 (* angle PI)))))
PI))
(* 180.0 (/ (atan (* (/ y-scale (* x-scale angle)) (/ -180.0 PI))) PI)))))b_m = fabs(b);
double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
double tmp;
if (b_m <= 2.9e-183) {
tmp = 180.0 * (atan((0.005555555555555556 * (angle * (y_45_scale * (((double) M_PI) / x_45_scale))))) / ((double) M_PI));
} else if (b_m <= 1.2e+63) {
tmp = 180.0 * (atan(((y_45_scale / x_45_scale) * sin((0.005555555555555556 * (angle * ((double) M_PI)))))) / ((double) M_PI));
} else {
tmp = 180.0 * (atan(((y_45_scale / (x_45_scale * angle)) * (-180.0 / ((double) M_PI)))) / ((double) M_PI));
}
return tmp;
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
double tmp;
if (b_m <= 2.9e-183) {
tmp = 180.0 * (Math.atan((0.005555555555555556 * (angle * (y_45_scale * (Math.PI / x_45_scale))))) / Math.PI);
} else if (b_m <= 1.2e+63) {
tmp = 180.0 * (Math.atan(((y_45_scale / x_45_scale) * Math.sin((0.005555555555555556 * (angle * Math.PI))))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(((y_45_scale / (x_45_scale * angle)) * (-180.0 / Math.PI))) / Math.PI);
}
return tmp;
}
b_m = math.fabs(b) def code(a, b_m, angle, x_45_scale, y_45_scale): tmp = 0 if b_m <= 2.9e-183: tmp = 180.0 * (math.atan((0.005555555555555556 * (angle * (y_45_scale * (math.pi / x_45_scale))))) / math.pi) elif b_m <= 1.2e+63: tmp = 180.0 * (math.atan(((y_45_scale / x_45_scale) * math.sin((0.005555555555555556 * (angle * math.pi))))) / math.pi) else: tmp = 180.0 * (math.atan(((y_45_scale / (x_45_scale * angle)) * (-180.0 / math.pi))) / math.pi) return tmp
b_m = abs(b) function code(a, b_m, angle, x_45_scale, y_45_scale) tmp = 0.0 if (b_m <= 2.9e-183) tmp = Float64(180.0 * Float64(atan(Float64(0.005555555555555556 * Float64(angle * Float64(y_45_scale * Float64(pi / x_45_scale))))) / pi)); elseif (b_m <= 1.2e+63) tmp = Float64(180.0 * Float64(atan(Float64(Float64(y_45_scale / x_45_scale) * sin(Float64(0.005555555555555556 * Float64(angle * pi))))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(y_45_scale / Float64(x_45_scale * angle)) * Float64(-180.0 / pi))) / pi)); end return tmp end
b_m = abs(b); function tmp_2 = code(a, b_m, angle, x_45_scale, y_45_scale) tmp = 0.0; if (b_m <= 2.9e-183) tmp = 180.0 * (atan((0.005555555555555556 * (angle * (y_45_scale * (pi / x_45_scale))))) / pi); elseif (b_m <= 1.2e+63) tmp = 180.0 * (atan(((y_45_scale / x_45_scale) * sin((0.005555555555555556 * (angle * pi))))) / pi); else tmp = 180.0 * (atan(((y_45_scale / (x_45_scale * angle)) * (-180.0 / pi))) / pi); end tmp_2 = tmp; end
b_m = N[Abs[b], $MachinePrecision] code[a_, b$95$m_, angle_, x$45$scale_, y$45$scale_] := If[LessEqual[b$95$m, 2.9e-183], N[(180.0 * N[(N[ArcTan[N[(0.005555555555555556 * N[(angle * N[(y$45$scale * N[(Pi / x$45$scale), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[b$95$m, 1.2e+63], N[(180.0 * N[(N[ArcTan[N[(N[(y$45$scale / x$45$scale), $MachinePrecision] * N[Sin[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(y$45$scale / N[(x$45$scale * angle), $MachinePrecision]), $MachinePrecision] * N[(-180.0 / Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
\mathbf{if}\;b\_m \leq 2.9 \cdot 10^{-183}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(0.005555555555555556 \cdot \left(angle \cdot \left(y-scale \cdot \frac{\pi}{x-scale}\right)\right)\right)}{\pi}\\
\mathbf{elif}\;b\_m \leq 1.2 \cdot 10^{+63}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{y-scale}{x-scale} \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{y-scale}{x-scale \cdot angle} \cdot \frac{-180}{\pi}\right)}{\pi}\\
\end{array}
\end{array}
if b < 2.9e-183Initial program 8.3%
Simplified10.2%
Taylor expanded in x-scale around 0 25.0%
Simplified26.0%
Taylor expanded in a around inf 44.9%
times-frac46.2%
Simplified46.2%
associate-*r*47.9%
pow147.9%
Applied egg-rr47.9%
Taylor expanded in angle around 0 43.7%
associate-/l*48.3%
associate-/l*48.3%
Simplified48.3%
if 2.9e-183 < b < 1.2e63Initial program 15.3%
Simplified15.2%
Taylor expanded in x-scale around 0 36.3%
Simplified40.9%
Taylor expanded in a around inf 59.4%
times-frac59.4%
Simplified59.4%
Taylor expanded in angle around 0 64.9%
if 1.2e63 < b Initial program 13.9%
Simplified2.2%
Taylor expanded in angle around 0 13.9%
associate-*r/13.9%
associate-*r*13.8%
distribute-lft-out--13.8%
associate-*r*13.8%
Simplified13.8%
Taylor expanded in a around 0 70.5%
associate-*r/70.5%
associate-/r*70.6%
Applied egg-rr70.6%
associate-*r/70.6%
associate-/r*70.5%
associate-/l*70.5%
*-commutative70.5%
associate-*r*70.5%
times-frac70.5%
Simplified70.5%
Final simplification56.8%
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale y-scale)
:precision binary64
(if (<= b_m 5.2e+59)
(/
(*
180.0
(atan
(* (/ y-scale x-scale) (tan (* (* 0.005555555555555556 angle) PI)))))
PI)
(* 180.0 (/ (atan (* (/ y-scale (* x-scale angle)) (/ -180.0 PI))) PI))))b_m = fabs(b);
double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
double tmp;
if (b_m <= 5.2e+59) {
tmp = (180.0 * atan(((y_45_scale / x_45_scale) * tan(((0.005555555555555556 * angle) * ((double) M_PI)))))) / ((double) M_PI);
} else {
tmp = 180.0 * (atan(((y_45_scale / (x_45_scale * angle)) * (-180.0 / ((double) M_PI)))) / ((double) M_PI));
}
return tmp;
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
double tmp;
if (b_m <= 5.2e+59) {
tmp = (180.0 * Math.atan(((y_45_scale / x_45_scale) * Math.tan(((0.005555555555555556 * angle) * Math.PI))))) / Math.PI;
} else {
tmp = 180.0 * (Math.atan(((y_45_scale / (x_45_scale * angle)) * (-180.0 / Math.PI))) / Math.PI);
}
return tmp;
}
b_m = math.fabs(b) def code(a, b_m, angle, x_45_scale, y_45_scale): tmp = 0 if b_m <= 5.2e+59: tmp = (180.0 * math.atan(((y_45_scale / x_45_scale) * math.tan(((0.005555555555555556 * angle) * math.pi))))) / math.pi else: tmp = 180.0 * (math.atan(((y_45_scale / (x_45_scale * angle)) * (-180.0 / math.pi))) / math.pi) return tmp
b_m = abs(b) function code(a, b_m, angle, x_45_scale, y_45_scale) tmp = 0.0 if (b_m <= 5.2e+59) tmp = Float64(Float64(180.0 * atan(Float64(Float64(y_45_scale / x_45_scale) * tan(Float64(Float64(0.005555555555555556 * angle) * pi))))) / pi); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(y_45_scale / Float64(x_45_scale * angle)) * Float64(-180.0 / pi))) / pi)); end return tmp end
b_m = abs(b); function tmp_2 = code(a, b_m, angle, x_45_scale, y_45_scale) tmp = 0.0; if (b_m <= 5.2e+59) tmp = (180.0 * atan(((y_45_scale / x_45_scale) * tan(((0.005555555555555556 * angle) * pi))))) / pi; else tmp = 180.0 * (atan(((y_45_scale / (x_45_scale * angle)) * (-180.0 / pi))) / pi); end tmp_2 = tmp; end
b_m = N[Abs[b], $MachinePrecision] code[a_, b$95$m_, angle_, x$45$scale_, y$45$scale_] := If[LessEqual[b$95$m, 5.2e+59], N[(N[(180.0 * N[ArcTan[N[(N[(y$45$scale / x$45$scale), $MachinePrecision] * N[Tan[N[(N[(0.005555555555555556 * angle), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(y$45$scale / N[(x$45$scale * angle), $MachinePrecision]), $MachinePrecision] * N[(-180.0 / Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
\mathbf{if}\;b\_m \leq 5.2 \cdot 10^{+59}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{y-scale}{x-scale} \cdot \tan \left(\left(0.005555555555555556 \cdot angle\right) \cdot \pi\right)\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{y-scale}{x-scale \cdot angle} \cdot \frac{-180}{\pi}\right)}{\pi}\\
\end{array}
\end{array}
if b < 5.19999999999999999e59Initial program 10.5%
Simplified11.8%
Taylor expanded in x-scale around 0 28.5%
Simplified30.6%
Taylor expanded in a around inf 49.3%
times-frac50.3%
Simplified50.3%
associate-*r/50.3%
quot-tan50.3%
associate-*r*52.1%
Applied egg-rr52.1%
if 5.19999999999999999e59 < b Initial program 13.9%
Simplified2.2%
Taylor expanded in angle around 0 13.9%
associate-*r/13.9%
associate-*r*13.8%
distribute-lft-out--13.8%
associate-*r*13.8%
Simplified13.8%
Taylor expanded in a around 0 70.5%
associate-*r/70.5%
associate-/r*70.6%
Applied egg-rr70.6%
associate-*r/70.6%
associate-/r*70.5%
associate-/l*70.5%
*-commutative70.5%
associate-*r*70.5%
times-frac70.5%
Simplified70.5%
Final simplification55.8%
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale y-scale)
:precision binary64
(if (<= b_m 0.056)
(*
180.0
(/
(atan (* 0.005555555555555556 (* angle (* y-scale (/ PI x-scale)))))
PI))
(* 180.0 (/ (atan (* (/ y-scale (* x-scale angle)) (/ -180.0 PI))) PI))))b_m = fabs(b);
double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
double tmp;
if (b_m <= 0.056) {
tmp = 180.0 * (atan((0.005555555555555556 * (angle * (y_45_scale * (((double) M_PI) / x_45_scale))))) / ((double) M_PI));
} else {
tmp = 180.0 * (atan(((y_45_scale / (x_45_scale * angle)) * (-180.0 / ((double) M_PI)))) / ((double) M_PI));
}
return tmp;
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
double tmp;
if (b_m <= 0.056) {
tmp = 180.0 * (Math.atan((0.005555555555555556 * (angle * (y_45_scale * (Math.PI / x_45_scale))))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(((y_45_scale / (x_45_scale * angle)) * (-180.0 / Math.PI))) / Math.PI);
}
return tmp;
}
b_m = math.fabs(b) def code(a, b_m, angle, x_45_scale, y_45_scale): tmp = 0 if b_m <= 0.056: tmp = 180.0 * (math.atan((0.005555555555555556 * (angle * (y_45_scale * (math.pi / x_45_scale))))) / math.pi) else: tmp = 180.0 * (math.atan(((y_45_scale / (x_45_scale * angle)) * (-180.0 / math.pi))) / math.pi) return tmp
b_m = abs(b) function code(a, b_m, angle, x_45_scale, y_45_scale) tmp = 0.0 if (b_m <= 0.056) tmp = Float64(180.0 * Float64(atan(Float64(0.005555555555555556 * Float64(angle * Float64(y_45_scale * Float64(pi / x_45_scale))))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(y_45_scale / Float64(x_45_scale * angle)) * Float64(-180.0 / pi))) / pi)); end return tmp end
b_m = abs(b); function tmp_2 = code(a, b_m, angle, x_45_scale, y_45_scale) tmp = 0.0; if (b_m <= 0.056) tmp = 180.0 * (atan((0.005555555555555556 * (angle * (y_45_scale * (pi / x_45_scale))))) / pi); else tmp = 180.0 * (atan(((y_45_scale / (x_45_scale * angle)) * (-180.0 / pi))) / pi); end tmp_2 = tmp; end
b_m = N[Abs[b], $MachinePrecision] code[a_, b$95$m_, angle_, x$45$scale_, y$45$scale_] := If[LessEqual[b$95$m, 0.056], N[(180.0 * N[(N[ArcTan[N[(0.005555555555555556 * N[(angle * N[(y$45$scale * N[(Pi / x$45$scale), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(y$45$scale / N[(x$45$scale * angle), $MachinePrecision]), $MachinePrecision] * N[(-180.0 / Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
\mathbf{if}\;b\_m \leq 0.056:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(0.005555555555555556 \cdot \left(angle \cdot \left(y-scale \cdot \frac{\pi}{x-scale}\right)\right)\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{y-scale}{x-scale \cdot angle} \cdot \frac{-180}{\pi}\right)}{\pi}\\
\end{array}
\end{array}
if b < 0.0560000000000000012Initial program 9.5%
Simplified11.4%
Taylor expanded in x-scale around 0 28.3%
Simplified30.5%
Taylor expanded in a around inf 49.0%
times-frac50.0%
Simplified50.0%
associate-*r*51.8%
pow151.8%
Applied egg-rr51.8%
Taylor expanded in angle around 0 48.4%
associate-/l*51.8%
associate-/l*51.8%
Simplified51.8%
if 0.0560000000000000012 < b Initial program 16.1%
Simplified5.4%
Taylor expanded in angle around 0 15.8%
associate-*r/15.8%
associate-*r*15.7%
distribute-lft-out--15.7%
associate-*r*15.8%
Simplified15.8%
Taylor expanded in a around 0 63.6%
associate-*r/63.6%
associate-/r*63.6%
Applied egg-rr63.6%
associate-*r/63.6%
associate-/r*63.6%
associate-/l*63.6%
*-commutative63.6%
associate-*r*63.6%
times-frac63.6%
Simplified63.6%
Final simplification54.8%
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale y-scale)
:precision binary64
(if (<= b_m 0.00038)
(*
180.0
(/
(atan (* 0.005555555555555556 (* angle (* y-scale (/ PI x-scale)))))
PI))
(* 180.0 (/ (atan (* -180.0 (/ y-scale (* angle (* x-scale PI))))) PI))))b_m = fabs(b);
double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
double tmp;
if (b_m <= 0.00038) {
tmp = 180.0 * (atan((0.005555555555555556 * (angle * (y_45_scale * (((double) M_PI) / x_45_scale))))) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((-180.0 * (y_45_scale / (angle * (x_45_scale * ((double) M_PI)))))) / ((double) M_PI));
}
return tmp;
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
double tmp;
if (b_m <= 0.00038) {
tmp = 180.0 * (Math.atan((0.005555555555555556 * (angle * (y_45_scale * (Math.PI / x_45_scale))))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((-180.0 * (y_45_scale / (angle * (x_45_scale * Math.PI))))) / Math.PI);
}
return tmp;
}
b_m = math.fabs(b) def code(a, b_m, angle, x_45_scale, y_45_scale): tmp = 0 if b_m <= 0.00038: tmp = 180.0 * (math.atan((0.005555555555555556 * (angle * (y_45_scale * (math.pi / x_45_scale))))) / math.pi) else: tmp = 180.0 * (math.atan((-180.0 * (y_45_scale / (angle * (x_45_scale * math.pi))))) / math.pi) return tmp
b_m = abs(b) function code(a, b_m, angle, x_45_scale, y_45_scale) tmp = 0.0 if (b_m <= 0.00038) tmp = Float64(180.0 * Float64(atan(Float64(0.005555555555555556 * Float64(angle * Float64(y_45_scale * Float64(pi / x_45_scale))))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(-180.0 * Float64(y_45_scale / Float64(angle * Float64(x_45_scale * pi))))) / pi)); end return tmp end
b_m = abs(b); function tmp_2 = code(a, b_m, angle, x_45_scale, y_45_scale) tmp = 0.0; if (b_m <= 0.00038) tmp = 180.0 * (atan((0.005555555555555556 * (angle * (y_45_scale * (pi / x_45_scale))))) / pi); else tmp = 180.0 * (atan((-180.0 * (y_45_scale / (angle * (x_45_scale * pi))))) / pi); end tmp_2 = tmp; end
b_m = N[Abs[b], $MachinePrecision] code[a_, b$95$m_, angle_, x$45$scale_, y$45$scale_] := If[LessEqual[b$95$m, 0.00038], N[(180.0 * N[(N[ArcTan[N[(0.005555555555555556 * N[(angle * N[(y$45$scale * N[(Pi / x$45$scale), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], 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}
b_m = \left|b\right|
\\
\begin{array}{l}
\mathbf{if}\;b\_m \leq 0.00038:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(0.005555555555555556 \cdot \left(angle \cdot \left(y-scale \cdot \frac{\pi}{x-scale}\right)\right)\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-180 \cdot \frac{y-scale}{angle \cdot \left(x-scale \cdot \pi\right)}\right)}{\pi}\\
\end{array}
\end{array}
if b < 3.8000000000000002e-4Initial program 9.5%
Simplified11.4%
Taylor expanded in x-scale around 0 28.3%
Simplified30.5%
Taylor expanded in a around inf 49.0%
times-frac50.0%
Simplified50.0%
associate-*r*51.8%
pow151.8%
Applied egg-rr51.8%
Taylor expanded in angle around 0 48.4%
associate-/l*51.8%
associate-/l*51.8%
Simplified51.8%
if 3.8000000000000002e-4 < b Initial program 16.1%
Simplified5.4%
Taylor expanded in angle around 0 15.8%
associate-*r/15.8%
associate-*r*15.7%
distribute-lft-out--15.7%
associate-*r*15.8%
Simplified15.8%
Taylor expanded in a around 0 63.6%
b_m = (fabs.f64 b) (FPCore (a b_m angle x-scale y-scale) :precision binary64 (* 180.0 (/ (atan (* -180.0 (/ y-scale (* angle (* x-scale PI))))) PI)))
b_m = fabs(b);
double code(double a, double b_m, 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));
}
b_m = Math.abs(b);
public static double code(double a, double b_m, 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);
}
b_m = math.fabs(b) def code(a, b_m, 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)
b_m = abs(b) function code(a, b_m, 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
b_m = abs(b); function tmp = code(a, b_m, angle, x_45_scale, y_45_scale) tmp = 180.0 * (atan((-180.0 * (y_45_scale / (angle * (x_45_scale * pi))))) / pi); end
b_m = N[Abs[b], $MachinePrecision] code[a_, b$95$m_, 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}
b_m = \left|b\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 11.2%
Simplified9.9%
Taylor expanded in angle around 0 9.5%
associate-*r/9.5%
associate-*r*8.9%
distribute-lft-out--8.9%
associate-*r*8.9%
Simplified8.9%
Taylor expanded in a around 0 37.8%
b_m = (fabs.f64 b) (FPCore (a b_m angle x-scale y-scale) :precision binary64 (* 180.0 (/ (atan (* -180.0 (/ x-scale (* angle (* y-scale PI))))) PI)))
b_m = fabs(b);
double code(double a, double b_m, 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));
}
b_m = Math.abs(b);
public static double code(double a, double b_m, 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);
}
b_m = math.fabs(b) def code(a, b_m, 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)
b_m = abs(b) function code(a, b_m, 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
b_m = abs(b); function tmp = code(a, b_m, angle, x_45_scale, y_45_scale) tmp = 180.0 * (atan((-180.0 * (x_45_scale / (angle * (y_45_scale * pi))))) / pi); end
b_m = N[Abs[b], $MachinePrecision] code[a_, b$95$m_, 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}
b_m = \left|b\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 11.2%
Simplified9.9%
Taylor expanded in angle around 0 9.5%
associate-*r/9.5%
associate-*r*8.9%
distribute-lft-out--8.9%
associate-*r*8.9%
Simplified8.9%
Taylor expanded in a around inf 13.5%
herbie shell --seed 2024146
(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)))