
(FPCore (a b angle x-scale y-scale)
:precision binary64
(let* ((t_0 (* (/ angle 180.0) PI))
(t_1 (cos t_0))
(t_2 (sin t_0))
(t_3
(/
(/ (* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) t_2) t_1) x-scale)
y-scale))
(t_4
(/ (/ (+ (pow (* a t_1) 2.0) (pow (* b t_2) 2.0)) y-scale) y-scale))
(t_5
(/ (/ (+ (pow (* a t_2) 2.0) (pow (* b t_1) 2.0)) x-scale) x-scale)))
(*
180.0
(/
(atan
(/ (- (- t_4 t_5) (sqrt (+ (pow (- t_5 t_4) 2.0) (pow t_3 2.0)))) t_3))
PI))))
double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
double t_0 = (angle / 180.0) * ((double) M_PI);
double t_1 = cos(t_0);
double t_2 = sin(t_0);
double t_3 = ((((2.0 * (pow(b, 2.0) - pow(a, 2.0))) * t_2) * t_1) / x_45_scale) / y_45_scale;
double t_4 = ((pow((a * t_1), 2.0) + pow((b * t_2), 2.0)) / y_45_scale) / y_45_scale;
double t_5 = ((pow((a * t_2), 2.0) + pow((b * t_1), 2.0)) / x_45_scale) / x_45_scale;
return 180.0 * (atan((((t_4 - t_5) - sqrt((pow((t_5 - t_4), 2.0) + pow(t_3, 2.0)))) / t_3)) / ((double) M_PI));
}
public static double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
double t_0 = (angle / 180.0) * Math.PI;
double t_1 = Math.cos(t_0);
double t_2 = Math.sin(t_0);
double t_3 = ((((2.0 * (Math.pow(b, 2.0) - Math.pow(a, 2.0))) * t_2) * t_1) / x_45_scale) / y_45_scale;
double t_4 = ((Math.pow((a * t_1), 2.0) + Math.pow((b * t_2), 2.0)) / y_45_scale) / y_45_scale;
double t_5 = ((Math.pow((a * t_2), 2.0) + Math.pow((b * t_1), 2.0)) / x_45_scale) / x_45_scale;
return 180.0 * (Math.atan((((t_4 - t_5) - Math.sqrt((Math.pow((t_5 - t_4), 2.0) + Math.pow(t_3, 2.0)))) / t_3)) / Math.PI);
}
def code(a, b, angle, x_45_scale, y_45_scale): t_0 = (angle / 180.0) * math.pi t_1 = math.cos(t_0) t_2 = math.sin(t_0) t_3 = ((((2.0 * (math.pow(b, 2.0) - math.pow(a, 2.0))) * t_2) * t_1) / x_45_scale) / y_45_scale t_4 = ((math.pow((a * t_1), 2.0) + math.pow((b * t_2), 2.0)) / y_45_scale) / y_45_scale t_5 = ((math.pow((a * t_2), 2.0) + math.pow((b * t_1), 2.0)) / x_45_scale) / x_45_scale return 180.0 * (math.atan((((t_4 - t_5) - math.sqrt((math.pow((t_5 - t_4), 2.0) + math.pow(t_3, 2.0)))) / t_3)) / math.pi)
function code(a, b, angle, x_45_scale, y_45_scale) t_0 = Float64(Float64(angle / 180.0) * pi) t_1 = cos(t_0) t_2 = sin(t_0) t_3 = Float64(Float64(Float64(Float64(Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))) * t_2) * t_1) / x_45_scale) / y_45_scale) t_4 = Float64(Float64(Float64((Float64(a * t_1) ^ 2.0) + (Float64(b * t_2) ^ 2.0)) / y_45_scale) / y_45_scale) t_5 = Float64(Float64(Float64((Float64(a * t_2) ^ 2.0) + (Float64(b * t_1) ^ 2.0)) / x_45_scale) / x_45_scale) return Float64(180.0 * Float64(atan(Float64(Float64(Float64(t_4 - t_5) - sqrt(Float64((Float64(t_5 - t_4) ^ 2.0) + (t_3 ^ 2.0)))) / t_3)) / pi)) end
function tmp = code(a, b, angle, x_45_scale, y_45_scale) t_0 = (angle / 180.0) * pi; t_1 = cos(t_0); t_2 = sin(t_0); t_3 = ((((2.0 * ((b ^ 2.0) - (a ^ 2.0))) * t_2) * t_1) / x_45_scale) / y_45_scale; t_4 = ((((a * t_1) ^ 2.0) + ((b * t_2) ^ 2.0)) / y_45_scale) / y_45_scale; t_5 = ((((a * t_2) ^ 2.0) + ((b * t_1) ^ 2.0)) / x_45_scale) / x_45_scale; tmp = 180.0 * (atan((((t_4 - t_5) - sqrt((((t_5 - t_4) ^ 2.0) + (t_3 ^ 2.0)))) / t_3)) / pi); end
code[a_, b_, angle_, x$45$scale_, y$45$scale_] := Block[{t$95$0 = N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]}, Block[{t$95$1 = N[Cos[t$95$0], $MachinePrecision]}, Block[{t$95$2 = N[Sin[t$95$0], $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(N[(N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision] * t$95$1), $MachinePrecision] / x$45$scale), $MachinePrecision] / y$45$scale), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(N[Power[N[(a * t$95$1), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * t$95$2), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / y$45$scale), $MachinePrecision] / y$45$scale), $MachinePrecision]}, Block[{t$95$5 = N[(N[(N[(N[Power[N[(a * t$95$2), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * t$95$1), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / x$45$scale), $MachinePrecision] / x$45$scale), $MachinePrecision]}, N[(180.0 * N[(N[ArcTan[N[(N[(N[(t$95$4 - t$95$5), $MachinePrecision] - N[Sqrt[N[(N[Power[N[(t$95$5 - t$95$4), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[t$95$3, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / t$95$3), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{angle}{180} \cdot \pi\\
t_1 := \cos t\_0\\
t_2 := \sin t\_0\\
t_3 := \frac{\frac{\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot t\_2\right) \cdot t\_1}{x-scale}}{y-scale}\\
t_4 := \frac{\frac{{\left(a \cdot t\_1\right)}^{2} + {\left(b \cdot t\_2\right)}^{2}}{y-scale}}{y-scale}\\
t_5 := \frac{\frac{{\left(a \cdot t\_2\right)}^{2} + {\left(b \cdot t\_1\right)}^{2}}{x-scale}}{x-scale}\\
180 \cdot \frac{\tan^{-1} \left(\frac{\left(t\_4 - t\_5\right) - \sqrt{{\left(t\_5 - t\_4\right)}^{2} + {t\_3}^{2}}}{t\_3}\right)}{\pi}
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (a b angle x-scale y-scale)
:precision binary64
(let* ((t_0 (* (/ angle 180.0) PI))
(t_1 (cos t_0))
(t_2 (sin t_0))
(t_3
(/
(/ (* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) t_2) t_1) x-scale)
y-scale))
(t_4
(/ (/ (+ (pow (* a t_1) 2.0) (pow (* b t_2) 2.0)) y-scale) y-scale))
(t_5
(/ (/ (+ (pow (* a t_2) 2.0) (pow (* b t_1) 2.0)) x-scale) x-scale)))
(*
180.0
(/
(atan
(/ (- (- t_4 t_5) (sqrt (+ (pow (- t_5 t_4) 2.0) (pow t_3 2.0)))) t_3))
PI))))
double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
double t_0 = (angle / 180.0) * ((double) M_PI);
double t_1 = cos(t_0);
double t_2 = sin(t_0);
double t_3 = ((((2.0 * (pow(b, 2.0) - pow(a, 2.0))) * t_2) * t_1) / x_45_scale) / y_45_scale;
double t_4 = ((pow((a * t_1), 2.0) + pow((b * t_2), 2.0)) / y_45_scale) / y_45_scale;
double t_5 = ((pow((a * t_2), 2.0) + pow((b * t_1), 2.0)) / x_45_scale) / x_45_scale;
return 180.0 * (atan((((t_4 - t_5) - sqrt((pow((t_5 - t_4), 2.0) + pow(t_3, 2.0)))) / t_3)) / ((double) M_PI));
}
public static double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
double t_0 = (angle / 180.0) * Math.PI;
double t_1 = Math.cos(t_0);
double t_2 = Math.sin(t_0);
double t_3 = ((((2.0 * (Math.pow(b, 2.0) - Math.pow(a, 2.0))) * t_2) * t_1) / x_45_scale) / y_45_scale;
double t_4 = ((Math.pow((a * t_1), 2.0) + Math.pow((b * t_2), 2.0)) / y_45_scale) / y_45_scale;
double t_5 = ((Math.pow((a * t_2), 2.0) + Math.pow((b * t_1), 2.0)) / x_45_scale) / x_45_scale;
return 180.0 * (Math.atan((((t_4 - t_5) - Math.sqrt((Math.pow((t_5 - t_4), 2.0) + Math.pow(t_3, 2.0)))) / t_3)) / Math.PI);
}
def code(a, b, angle, x_45_scale, y_45_scale): t_0 = (angle / 180.0) * math.pi t_1 = math.cos(t_0) t_2 = math.sin(t_0) t_3 = ((((2.0 * (math.pow(b, 2.0) - math.pow(a, 2.0))) * t_2) * t_1) / x_45_scale) / y_45_scale t_4 = ((math.pow((a * t_1), 2.0) + math.pow((b * t_2), 2.0)) / y_45_scale) / y_45_scale t_5 = ((math.pow((a * t_2), 2.0) + math.pow((b * t_1), 2.0)) / x_45_scale) / x_45_scale return 180.0 * (math.atan((((t_4 - t_5) - math.sqrt((math.pow((t_5 - t_4), 2.0) + math.pow(t_3, 2.0)))) / t_3)) / math.pi)
function code(a, b, angle, x_45_scale, y_45_scale) t_0 = Float64(Float64(angle / 180.0) * pi) t_1 = cos(t_0) t_2 = sin(t_0) t_3 = Float64(Float64(Float64(Float64(Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))) * t_2) * t_1) / x_45_scale) / y_45_scale) t_4 = Float64(Float64(Float64((Float64(a * t_1) ^ 2.0) + (Float64(b * t_2) ^ 2.0)) / y_45_scale) / y_45_scale) t_5 = Float64(Float64(Float64((Float64(a * t_2) ^ 2.0) + (Float64(b * t_1) ^ 2.0)) / x_45_scale) / x_45_scale) return Float64(180.0 * Float64(atan(Float64(Float64(Float64(t_4 - t_5) - sqrt(Float64((Float64(t_5 - t_4) ^ 2.0) + (t_3 ^ 2.0)))) / t_3)) / pi)) end
function tmp = code(a, b, angle, x_45_scale, y_45_scale) t_0 = (angle / 180.0) * pi; t_1 = cos(t_0); t_2 = sin(t_0); t_3 = ((((2.0 * ((b ^ 2.0) - (a ^ 2.0))) * t_2) * t_1) / x_45_scale) / y_45_scale; t_4 = ((((a * t_1) ^ 2.0) + ((b * t_2) ^ 2.0)) / y_45_scale) / y_45_scale; t_5 = ((((a * t_2) ^ 2.0) + ((b * t_1) ^ 2.0)) / x_45_scale) / x_45_scale; tmp = 180.0 * (atan((((t_4 - t_5) - sqrt((((t_5 - t_4) ^ 2.0) + (t_3 ^ 2.0)))) / t_3)) / pi); end
code[a_, b_, angle_, x$45$scale_, y$45$scale_] := Block[{t$95$0 = N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]}, Block[{t$95$1 = N[Cos[t$95$0], $MachinePrecision]}, Block[{t$95$2 = N[Sin[t$95$0], $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(N[(N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision] * t$95$1), $MachinePrecision] / x$45$scale), $MachinePrecision] / y$45$scale), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(N[Power[N[(a * t$95$1), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * t$95$2), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / y$45$scale), $MachinePrecision] / y$45$scale), $MachinePrecision]}, Block[{t$95$5 = N[(N[(N[(N[Power[N[(a * t$95$2), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * t$95$1), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / x$45$scale), $MachinePrecision] / x$45$scale), $MachinePrecision]}, N[(180.0 * N[(N[ArcTan[N[(N[(N[(t$95$4 - t$95$5), $MachinePrecision] - N[Sqrt[N[(N[Power[N[(t$95$5 - t$95$4), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[t$95$3, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / t$95$3), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{angle}{180} \cdot \pi\\
t_1 := \cos t\_0\\
t_2 := \sin t\_0\\
t_3 := \frac{\frac{\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot t\_2\right) \cdot t\_1}{x-scale}}{y-scale}\\
t_4 := \frac{\frac{{\left(a \cdot t\_1\right)}^{2} + {\left(b \cdot t\_2\right)}^{2}}{y-scale}}{y-scale}\\
t_5 := \frac{\frac{{\left(a \cdot t\_2\right)}^{2} + {\left(b \cdot t\_1\right)}^{2}}{x-scale}}{x-scale}\\
180 \cdot \frac{\tan^{-1} \left(\frac{\left(t\_4 - t\_5\right) - \sqrt{{\left(t\_5 - t\_4\right)}^{2} + {t\_3}^{2}}}{t\_3}\right)}{\pi}
\end{array}
\end{array}
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))
(t_2 (cos t_0))
(t_3 (* PI (* 0.005555555555555556 angle))))
(if (<= b_m 3.7e-91)
(* 180.0 (/ (atan (/ (* y-scale t_1) (* x-scale t_2))) PI))
(if (<= b_m 3.5e+61)
(*
180.0
(/
(atan
(*
-0.5
(*
y-scale
(*
(/ 2.0 x-scale)
(/
(+ (pow (* t_1 a) 2.0) (pow (* b_m t_2) 2.0))
(* t_2 (* t_1 (- (pow b_m 2.0) (pow a 2.0)))))))))
PI))
(if (<= b_m 3e+109)
(*
180.0
(/ (atan (* y-scale (/ (sin t_3) (* x-scale (cos t_3))))) PI))
(*
180.0
(pow
(cbrt
(/
(atan
(*
(/ y-scale x-scale)
(/
1.0
(tan
(*
(* 0.005555555555555556 angle)
(* (cbrt PI) (pow (cbrt PI) 2.0)))))))
(- PI)))
3.0)))))))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 t_2 = cos(t_0);
double t_3 = ((double) M_PI) * (0.005555555555555556 * angle);
double tmp;
if (b_m <= 3.7e-91) {
tmp = 180.0 * (atan(((y_45_scale * t_1) / (x_45_scale * t_2))) / ((double) M_PI));
} else if (b_m <= 3.5e+61) {
tmp = 180.0 * (atan((-0.5 * (y_45_scale * ((2.0 / x_45_scale) * ((pow((t_1 * a), 2.0) + pow((b_m * t_2), 2.0)) / (t_2 * (t_1 * (pow(b_m, 2.0) - pow(a, 2.0))))))))) / ((double) M_PI));
} else if (b_m <= 3e+109) {
tmp = 180.0 * (atan((y_45_scale * (sin(t_3) / (x_45_scale * cos(t_3))))) / ((double) M_PI));
} else {
tmp = 180.0 * pow(cbrt((atan(((y_45_scale / x_45_scale) * (1.0 / tan(((0.005555555555555556 * angle) * (cbrt(((double) M_PI)) * pow(cbrt(((double) M_PI)), 2.0))))))) / -((double) M_PI))), 3.0);
}
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 t_2 = Math.cos(t_0);
double t_3 = Math.PI * (0.005555555555555556 * angle);
double tmp;
if (b_m <= 3.7e-91) {
tmp = 180.0 * (Math.atan(((y_45_scale * t_1) / (x_45_scale * t_2))) / Math.PI);
} else if (b_m <= 3.5e+61) {
tmp = 180.0 * (Math.atan((-0.5 * (y_45_scale * ((2.0 / x_45_scale) * ((Math.pow((t_1 * a), 2.0) + Math.pow((b_m * t_2), 2.0)) / (t_2 * (t_1 * (Math.pow(b_m, 2.0) - Math.pow(a, 2.0))))))))) / Math.PI);
} else if (b_m <= 3e+109) {
tmp = 180.0 * (Math.atan((y_45_scale * (Math.sin(t_3) / (x_45_scale * Math.cos(t_3))))) / Math.PI);
} else {
tmp = 180.0 * Math.pow(Math.cbrt((Math.atan(((y_45_scale / x_45_scale) * (1.0 / Math.tan(((0.005555555555555556 * angle) * (Math.cbrt(Math.PI) * Math.pow(Math.cbrt(Math.PI), 2.0))))))) / -Math.PI)), 3.0);
}
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) t_2 = cos(t_0) t_3 = Float64(pi * Float64(0.005555555555555556 * angle)) tmp = 0.0 if (b_m <= 3.7e-91) tmp = Float64(180.0 * Float64(atan(Float64(Float64(y_45_scale * t_1) / Float64(x_45_scale * t_2))) / pi)); elseif (b_m <= 3.5e+61) tmp = Float64(180.0 * Float64(atan(Float64(-0.5 * Float64(y_45_scale * Float64(Float64(2.0 / x_45_scale) * Float64(Float64((Float64(t_1 * a) ^ 2.0) + (Float64(b_m * t_2) ^ 2.0)) / Float64(t_2 * Float64(t_1 * Float64((b_m ^ 2.0) - (a ^ 2.0))))))))) / pi)); elseif (b_m <= 3e+109) tmp = Float64(180.0 * Float64(atan(Float64(y_45_scale * Float64(sin(t_3) / Float64(x_45_scale * cos(t_3))))) / pi)); else tmp = Float64(180.0 * (cbrt(Float64(atan(Float64(Float64(y_45_scale / x_45_scale) * Float64(1.0 / tan(Float64(Float64(0.005555555555555556 * angle) * Float64(cbrt(pi) * (cbrt(pi) ^ 2.0))))))) / Float64(-pi))) ^ 3.0)); 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[Sin[t$95$0], $MachinePrecision]}, Block[{t$95$2 = N[Cos[t$95$0], $MachinePrecision]}, Block[{t$95$3 = N[(Pi * N[(0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b$95$m, 3.7e-91], N[(180.0 * N[(N[ArcTan[N[(N[(y$45$scale * t$95$1), $MachinePrecision] / N[(x$45$scale * t$95$2), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[b$95$m, 3.5e+61], N[(180.0 * N[(N[ArcTan[N[(-0.5 * N[(y$45$scale * N[(N[(2.0 / x$45$scale), $MachinePrecision] * N[(N[(N[Power[N[(t$95$1 * a), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b$95$m * t$95$2), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / N[(t$95$2 * N[(t$95$1 * N[(N[Power[b$95$m, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[b$95$m, 3e+109], N[(180.0 * N[(N[ArcTan[N[(y$45$scale * N[(N[Sin[t$95$3], $MachinePrecision] / N[(x$45$scale * N[Cos[t$95$3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[Power[N[Power[N[(N[ArcTan[N[(N[(y$45$scale / x$45$scale), $MachinePrecision] * N[(1.0 / N[Tan[N[(N[(0.005555555555555556 * angle), $MachinePrecision] * N[(N[Power[Pi, 1/3], $MachinePrecision] * N[Power[N[Power[Pi, 1/3], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / (-Pi)), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $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\\
t_2 := \cos t\_0\\
t_3 := \pi \cdot \left(0.005555555555555556 \cdot angle\right)\\
\mathbf{if}\;b\_m \leq 3.7 \cdot 10^{-91}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{y-scale \cdot t\_1}{x-scale \cdot t\_2}\right)}{\pi}\\
\mathbf{elif}\;b\_m \leq 3.5 \cdot 10^{+61}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \left(y-scale \cdot \left(\frac{2}{x-scale} \cdot \frac{{\left(t\_1 \cdot a\right)}^{2} + {\left(b\_m \cdot t\_2\right)}^{2}}{t\_2 \cdot \left(t\_1 \cdot \left({b\_m}^{2} - {a}^{2}\right)\right)}\right)\right)\right)}{\pi}\\
\mathbf{elif}\;b\_m \leq 3 \cdot 10^{+109}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(y-scale \cdot \frac{\sin t\_3}{x-scale \cdot \cos t\_3}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot {\left(\sqrt[3]{\frac{\tan^{-1} \left(\frac{y-scale}{x-scale} \cdot \frac{1}{\tan \left(\left(0.005555555555555556 \cdot angle\right) \cdot \left(\sqrt[3]{\pi} \cdot {\left(\sqrt[3]{\pi}\right)}^{2}\right)\right)}\right)}{-\pi}}\right)}^{3}\\
\end{array}
\end{array}
if b < 3.7000000000000002e-91Initial program 11.8%
Simplified13.2%
Taylor expanded in x-scale around 0 25.8%
Simplified30.6%
Taylor expanded in a around inf 51.2%
if 3.7000000000000002e-91 < b < 3.50000000000000018e61Initial program 26.3%
Simplified18.9%
Taylor expanded in x-scale around 0 42.7%
Simplified50.4%
times-frac50.4%
associate-*r*50.4%
Applied egg-rr50.4%
associate-*r*50.4%
Simplified50.4%
if 3.50000000000000018e61 < b < 3.00000000000000015e109Initial program 16.7%
Simplified16.7%
Taylor expanded in a around inf 16.7%
Taylor expanded in y-scale around inf 68.1%
associate-*r/68.1%
Simplified68.1%
Taylor expanded in x-scale around 0 68.1%
associate-/l*83.6%
associate-*r*83.6%
*-commutative83.6%
associate-*r*100.0%
*-commutative100.0%
Simplified100.0%
if 3.00000000000000015e109 < b Initial program 4.1%
Simplified2.7%
Taylor expanded in x-scale around 0 8.6%
Simplified8.7%
Taylor expanded in a around 0 66.5%
mul-1-neg66.5%
times-frac62.9%
Simplified62.9%
add-cube-cbrt62.2%
pow362.2%
Applied egg-rr63.0%
add-cube-cbrt68.0%
pow268.0%
Applied egg-rr68.0%
Final simplification55.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 (sin t_0))
(t_2 (* PI (* 0.005555555555555556 angle)))
(t_3 (cos t_0)))
(if (<= b_m 1.25e-9)
(* 180.0 (/ (atan (/ (* y-scale t_1) (* x-scale t_3))) PI))
(if (<= b_m 1.35e+63)
(*
180.0
(/
(atan
(/
(*
(pow (cos (* angle (* PI (cbrt 1.7146776406035666e-7)))) 2.0)
(- y-scale))
(* x-scale (* t_1 t_3))))
PI))
(if (<= b_m 4.2e+109)
(*
180.0
(/ (atan (* y-scale (/ (sin t_2) (* x-scale (cos t_2))))) PI))
(*
180.0
(pow
(cbrt
(/
(atan
(*
(/ y-scale x-scale)
(/
1.0
(tan
(*
(* 0.005555555555555556 angle)
(* (cbrt PI) (pow (cbrt PI) 2.0)))))))
(- PI)))
3.0)))))))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 t_2 = ((double) M_PI) * (0.005555555555555556 * angle);
double t_3 = cos(t_0);
double tmp;
if (b_m <= 1.25e-9) {
tmp = 180.0 * (atan(((y_45_scale * t_1) / (x_45_scale * t_3))) / ((double) M_PI));
} else if (b_m <= 1.35e+63) {
tmp = 180.0 * (atan(((pow(cos((angle * (((double) M_PI) * cbrt(1.7146776406035666e-7)))), 2.0) * -y_45_scale) / (x_45_scale * (t_1 * t_3)))) / ((double) M_PI));
} else if (b_m <= 4.2e+109) {
tmp = 180.0 * (atan((y_45_scale * (sin(t_2) / (x_45_scale * cos(t_2))))) / ((double) M_PI));
} else {
tmp = 180.0 * pow(cbrt((atan(((y_45_scale / x_45_scale) * (1.0 / tan(((0.005555555555555556 * angle) * (cbrt(((double) M_PI)) * pow(cbrt(((double) M_PI)), 2.0))))))) / -((double) M_PI))), 3.0);
}
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 t_2 = Math.PI * (0.005555555555555556 * angle);
double t_3 = Math.cos(t_0);
double tmp;
if (b_m <= 1.25e-9) {
tmp = 180.0 * (Math.atan(((y_45_scale * t_1) / (x_45_scale * t_3))) / Math.PI);
} else if (b_m <= 1.35e+63) {
tmp = 180.0 * (Math.atan(((Math.pow(Math.cos((angle * (Math.PI * Math.cbrt(1.7146776406035666e-7)))), 2.0) * -y_45_scale) / (x_45_scale * (t_1 * t_3)))) / Math.PI);
} else if (b_m <= 4.2e+109) {
tmp = 180.0 * (Math.atan((y_45_scale * (Math.sin(t_2) / (x_45_scale * Math.cos(t_2))))) / Math.PI);
} else {
tmp = 180.0 * Math.pow(Math.cbrt((Math.atan(((y_45_scale / x_45_scale) * (1.0 / Math.tan(((0.005555555555555556 * angle) * (Math.cbrt(Math.PI) * Math.pow(Math.cbrt(Math.PI), 2.0))))))) / -Math.PI)), 3.0);
}
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) t_2 = Float64(pi * Float64(0.005555555555555556 * angle)) t_3 = cos(t_0) tmp = 0.0 if (b_m <= 1.25e-9) tmp = Float64(180.0 * Float64(atan(Float64(Float64(y_45_scale * t_1) / Float64(x_45_scale * t_3))) / pi)); elseif (b_m <= 1.35e+63) tmp = Float64(180.0 * Float64(atan(Float64(Float64((cos(Float64(angle * Float64(pi * cbrt(1.7146776406035666e-7)))) ^ 2.0) * Float64(-y_45_scale)) / Float64(x_45_scale * Float64(t_1 * t_3)))) / pi)); elseif (b_m <= 4.2e+109) tmp = Float64(180.0 * Float64(atan(Float64(y_45_scale * Float64(sin(t_2) / Float64(x_45_scale * cos(t_2))))) / pi)); else tmp = Float64(180.0 * (cbrt(Float64(atan(Float64(Float64(y_45_scale / x_45_scale) * Float64(1.0 / tan(Float64(Float64(0.005555555555555556 * angle) * Float64(cbrt(pi) * (cbrt(pi) ^ 2.0))))))) / Float64(-pi))) ^ 3.0)); 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[Sin[t$95$0], $MachinePrecision]}, Block[{t$95$2 = N[(Pi * N[(0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Cos[t$95$0], $MachinePrecision]}, If[LessEqual[b$95$m, 1.25e-9], N[(180.0 * N[(N[ArcTan[N[(N[(y$45$scale * t$95$1), $MachinePrecision] / N[(x$45$scale * t$95$3), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[b$95$m, 1.35e+63], N[(180.0 * N[(N[ArcTan[N[(N[(N[Power[N[Cos[N[(angle * N[(Pi * N[Power[1.7146776406035666e-7, 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision] * (-y$45$scale)), $MachinePrecision] / N[(x$45$scale * N[(t$95$1 * t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[b$95$m, 4.2e+109], N[(180.0 * N[(N[ArcTan[N[(y$45$scale * N[(N[Sin[t$95$2], $MachinePrecision] / N[(x$45$scale * N[Cos[t$95$2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[Power[N[Power[N[(N[ArcTan[N[(N[(y$45$scale / x$45$scale), $MachinePrecision] * N[(1.0 / N[Tan[N[(N[(0.005555555555555556 * angle), $MachinePrecision] * N[(N[Power[Pi, 1/3], $MachinePrecision] * N[Power[N[Power[Pi, 1/3], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / (-Pi)), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $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\\
t_2 := \pi \cdot \left(0.005555555555555556 \cdot angle\right)\\
t_3 := \cos t\_0\\
\mathbf{if}\;b\_m \leq 1.25 \cdot 10^{-9}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{y-scale \cdot t\_1}{x-scale \cdot t\_3}\right)}{\pi}\\
\mathbf{elif}\;b\_m \leq 1.35 \cdot 10^{+63}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{{\cos \left(angle \cdot \left(\pi \cdot \sqrt[3]{1.7146776406035666 \cdot 10^{-7}}\right)\right)}^{2} \cdot \left(-y-scale\right)}{x-scale \cdot \left(t\_1 \cdot t\_3\right)}\right)}{\pi}\\
\mathbf{elif}\;b\_m \leq 4.2 \cdot 10^{+109}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(y-scale \cdot \frac{\sin t\_2}{x-scale \cdot \cos t\_2}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot {\left(\sqrt[3]{\frac{\tan^{-1} \left(\frac{y-scale}{x-scale} \cdot \frac{1}{\tan \left(\left(0.005555555555555556 \cdot angle\right) \cdot \left(\sqrt[3]{\pi} \cdot {\left(\sqrt[3]{\pi}\right)}^{2}\right)\right)}\right)}{-\pi}}\right)}^{3}\\
\end{array}
\end{array}
if b < 1.25e-9Initial program 12.8%
Simplified13.1%
Taylor expanded in x-scale around 0 26.9%
Simplified32.3%
Taylor expanded in a around inf 50.6%
if 1.25e-9 < b < 1.35000000000000009e63Initial program 30.3%
Simplified30.6%
Taylor expanded in x-scale around 0 52.2%
Simplified52.2%
add-cbrt-cube41.5%
Applied egg-rr41.5%
Taylor expanded in a around 0 53.7%
if 1.35000000000000009e63 < b < 4.2000000000000003e109Initial program 16.7%
Simplified16.7%
Taylor expanded in a around inf 16.7%
Taylor expanded in y-scale around inf 68.1%
associate-*r/68.1%
Simplified68.1%
Taylor expanded in x-scale around 0 68.1%
associate-/l*83.6%
associate-*r*83.6%
*-commutative83.6%
associate-*r*100.0%
*-commutative100.0%
Simplified100.0%
if 4.2000000000000003e109 < b Initial program 4.1%
Simplified2.7%
Taylor expanded in x-scale around 0 8.6%
Simplified8.7%
Taylor expanded in a around 0 66.5%
mul-1-neg66.5%
times-frac62.9%
Simplified62.9%
add-cube-cbrt62.2%
pow362.2%
Applied egg-rr63.0%
add-cube-cbrt68.0%
pow268.0%
Applied egg-rr68.0%
Final simplification55.3%
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale y-scale)
:precision binary64
(let* ((t_0 (* 0.005555555555555556 (* angle PI))))
(if (<= b_m 0.0275)
(* 180.0 (/ (atan (/ (* y-scale (sin t_0)) (* x-scale (cos t_0)))) PI))
(*
180.0
(pow
(cbrt
(/
(atan
(*
(/ y-scale x-scale)
(/
1.0
(tan (* (* 0.005555555555555556 angle) (cbrt (pow PI 3.0)))))))
(- PI)))
3.0)))))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 tmp;
if (b_m <= 0.0275) {
tmp = 180.0 * (atan(((y_45_scale * sin(t_0)) / (x_45_scale * cos(t_0)))) / ((double) M_PI));
} else {
tmp = 180.0 * pow(cbrt((atan(((y_45_scale / x_45_scale) * (1.0 / tan(((0.005555555555555556 * angle) * cbrt(pow(((double) M_PI), 3.0))))))) / -((double) M_PI))), 3.0);
}
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 tmp;
if (b_m <= 0.0275) {
tmp = 180.0 * (Math.atan(((y_45_scale * Math.sin(t_0)) / (x_45_scale * Math.cos(t_0)))) / Math.PI);
} else {
tmp = 180.0 * Math.pow(Math.cbrt((Math.atan(((y_45_scale / x_45_scale) * (1.0 / Math.tan(((0.005555555555555556 * angle) * Math.cbrt(Math.pow(Math.PI, 3.0))))))) / -Math.PI)), 3.0);
}
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)) tmp = 0.0 if (b_m <= 0.0275) tmp = Float64(180.0 * Float64(atan(Float64(Float64(y_45_scale * sin(t_0)) / Float64(x_45_scale * cos(t_0)))) / pi)); else tmp = Float64(180.0 * (cbrt(Float64(atan(Float64(Float64(y_45_scale / x_45_scale) * Float64(1.0 / tan(Float64(Float64(0.005555555555555556 * angle) * cbrt((pi ^ 3.0))))))) / Float64(-pi))) ^ 3.0)); 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]}, If[LessEqual[b$95$m, 0.0275], N[(180.0 * N[(N[ArcTan[N[(N[(y$45$scale * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision] / N[(x$45$scale * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[Power[N[Power[N[(N[ArcTan[N[(N[(y$45$scale / x$45$scale), $MachinePrecision] * N[(1.0 / N[Tan[N[(N[(0.005555555555555556 * angle), $MachinePrecision] * N[Power[N[Power[Pi, 3.0], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / (-Pi)), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
t_0 := 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\\
\mathbf{if}\;b\_m \leq 0.0275:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{y-scale \cdot \sin t\_0}{x-scale \cdot \cos t\_0}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot {\left(\sqrt[3]{\frac{\tan^{-1} \left(\frac{y-scale}{x-scale} \cdot \frac{1}{\tan \left(\left(0.005555555555555556 \cdot angle\right) \cdot \sqrt[3]{{\pi}^{3}}\right)}\right)}{-\pi}}\right)}^{3}\\
\end{array}
\end{array}
if b < 0.0275000000000000001Initial program 12.8%
Simplified13.1%
Taylor expanded in x-scale around 0 26.9%
Simplified32.3%
Taylor expanded in a around inf 50.6%
if 0.0275000000000000001 < b Initial program 9.2%
Simplified8.2%
Taylor expanded in x-scale around 0 20.4%
Simplified22.2%
Taylor expanded in a around 0 64.5%
mul-1-neg64.5%
times-frac63.4%
Simplified63.4%
add-cube-cbrt62.7%
pow362.7%
Applied egg-rr60.4%
add-cbrt-cube65.8%
pow365.8%
Applied egg-rr65.8%
Final simplification54.5%
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale y-scale)
:precision binary64
(let* ((t_0 (* 0.005555555555555556 (* angle PI))))
(if (<= b_m 9.5e-10)
(* 180.0 (/ (atan (/ (* y-scale (sin t_0)) (* x-scale (cos t_0)))) PI))
(* 180.0 (/ (atan (/ y-scale (* x-scale (tan 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 tmp;
if (b_m <= 9.5e-10) {
tmp = 180.0 * (atan(((y_45_scale * sin(t_0)) / (x_45_scale * cos(t_0)))) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((y_45_scale / (x_45_scale * tan(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 tmp;
if (b_m <= 9.5e-10) {
tmp = 180.0 * (Math.atan(((y_45_scale * Math.sin(t_0)) / (x_45_scale * Math.cos(t_0)))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((y_45_scale / (x_45_scale * Math.tan(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) tmp = 0 if b_m <= 9.5e-10: tmp = 180.0 * (math.atan(((y_45_scale * math.sin(t_0)) / (x_45_scale * math.cos(t_0)))) / math.pi) else: tmp = 180.0 * (math.atan((y_45_scale / (x_45_scale * math.tan(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)) tmp = 0.0 if (b_m <= 9.5e-10) tmp = Float64(180.0 * Float64(atan(Float64(Float64(y_45_scale * sin(t_0)) / Float64(x_45_scale * cos(t_0)))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(y_45_scale / Float64(x_45_scale * tan(t_0)))) / Float64(-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); tmp = 0.0; if (b_m <= 9.5e-10) tmp = 180.0 * (atan(((y_45_scale * sin(t_0)) / (x_45_scale * cos(t_0)))) / pi); else tmp = 180.0 * (atan((y_45_scale / (x_45_scale * tan(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]}, If[LessEqual[b$95$m, 9.5e-10], N[(180.0 * N[(N[ArcTan[N[(N[(y$45$scale * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision] / N[(x$45$scale * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(y$45$scale / N[(x$45$scale * N[Tan[t$95$0], $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)\\
\mathbf{if}\;b\_m \leq 9.5 \cdot 10^{-10}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{y-scale \cdot \sin t\_0}{x-scale \cdot \cos 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 b < 9.50000000000000028e-10Initial program 12.8%
Simplified13.1%
Taylor expanded in x-scale around 0 26.9%
Simplified32.3%
Taylor expanded in a around inf 50.6%
if 9.50000000000000028e-10 < b Initial program 9.2%
Simplified8.2%
Taylor expanded in x-scale around 0 20.4%
Simplified22.2%
Taylor expanded in a around 0 64.5%
mul-1-neg64.5%
times-frac63.4%
Simplified63.4%
log1p-expm1-u63.4%
log1p-undefine63.4%
Applied egg-rr63.4%
atan-neg63.4%
clear-num63.4%
associate-*r*62.3%
log1p-define62.3%
log1p-expm1-u62.3%
associate-*r*61.1%
tan-quot61.1%
Applied egg-rr63.4%
neg-sub063.4%
associate-/r*64.5%
Simplified64.5%
Final simplification54.2%
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale y-scale)
:precision binary64
(let* ((t_0 (* PI (* 0.005555555555555556 angle))))
(if (<= b_m 8e-10)
(* 180.0 (/ (atan (* y-scale (/ (sin t_0) (* x-scale (cos t_0))))) PI))
(*
180.0
(/
(atan
(/ y-scale (* x-scale (tan (* 0.005555555555555556 (* angle PI))))))
(- 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 = ((double) M_PI) * (0.005555555555555556 * angle);
double tmp;
if (b_m <= 8e-10) {
tmp = 180.0 * (atan((y_45_scale * (sin(t_0) / (x_45_scale * cos(t_0))))) / ((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;
}
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 = Math.PI * (0.005555555555555556 * angle);
double tmp;
if (b_m <= 8e-10) {
tmp = 180.0 * (Math.atan((y_45_scale * (Math.sin(t_0) / (x_45_scale * Math.cos(t_0))))) / 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;
}
b_m = math.fabs(b) def code(a, b_m, angle, x_45_scale, y_45_scale): t_0 = math.pi * (0.005555555555555556 * angle) tmp = 0 if b_m <= 8e-10: tmp = 180.0 * (math.atan((y_45_scale * (math.sin(t_0) / (x_45_scale * math.cos(t_0))))) / 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
b_m = abs(b) function code(a, b_m, angle, x_45_scale, y_45_scale) t_0 = Float64(pi * Float64(0.005555555555555556 * angle)) tmp = 0.0 if (b_m <= 8e-10) tmp = Float64(180.0 * Float64(atan(Float64(y_45_scale * Float64(sin(t_0) / Float64(x_45_scale * cos(t_0))))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(y_45_scale / Float64(x_45_scale * tan(Float64(0.005555555555555556 * Float64(angle * pi)))))) / Float64(-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 = pi * (0.005555555555555556 * angle); tmp = 0.0; if (b_m <= 8e-10) tmp = 180.0 * (atan((y_45_scale * (sin(t_0) / (x_45_scale * cos(t_0))))) / pi); else tmp = 180.0 * (atan((y_45_scale / (x_45_scale * tan((0.005555555555555556 * (angle * 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_] := Block[{t$95$0 = N[(Pi * N[(0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b$95$m, 8e-10], N[(180.0 * N[(N[ArcTan[N[(y$45$scale * N[(N[Sin[t$95$0], $MachinePrecision] / N[(x$45$scale * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(y$45$scale / N[(x$45$scale * N[Tan[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / (-Pi)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
t_0 := \pi \cdot \left(0.005555555555555556 \cdot angle\right)\\
\mathbf{if}\;b\_m \leq 8 \cdot 10^{-10}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(y-scale \cdot \frac{\sin t\_0}{x-scale \cdot \cos t\_0}\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 b < 8.00000000000000029e-10Initial program 12.8%
Simplified13.1%
Taylor expanded in a around inf 20.0%
Taylor expanded in y-scale around inf 39.1%
associate-*r/39.1%
Simplified39.1%
Taylor expanded in x-scale around 0 50.6%
associate-/l*49.7%
associate-*r*49.2%
*-commutative49.2%
associate-*r*49.4%
*-commutative49.4%
Simplified49.4%
if 8.00000000000000029e-10 < b Initial program 9.2%
Simplified8.2%
Taylor expanded in x-scale around 0 20.4%
Simplified22.2%
Taylor expanded in a around 0 64.5%
mul-1-neg64.5%
times-frac63.4%
Simplified63.4%
log1p-expm1-u63.4%
log1p-undefine63.4%
Applied egg-rr63.4%
atan-neg63.4%
clear-num63.4%
associate-*r*62.3%
log1p-define62.3%
log1p-expm1-u62.3%
associate-*r*61.1%
tan-quot61.1%
Applied egg-rr63.4%
neg-sub063.4%
associate-/r*64.5%
Simplified64.5%
Final simplification53.3%
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale y-scale)
:precision binary64
(if (<= b_m 2.35e+109)
(*
180.0
(/
(atan (* 0.005555555555555556 (* angle (* y-scale (/ PI x-scale)))))
PI))
(*
-180.0
(/
(atan (/ y-scale (* x-scale (tan (* PI (* 0.005555555555555556 angle))))))
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.35e+109) {
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 * tan((((double) M_PI) * (0.005555555555555556 * angle)))))) / ((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.35e+109) {
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 * Math.tan((Math.PI * (0.005555555555555556 * angle)))))) / 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.35e+109: 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 * math.tan((math.pi * (0.005555555555555556 * angle)))))) / 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.35e+109) 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(y_45_scale / Float64(x_45_scale * tan(Float64(pi * Float64(0.005555555555555556 * angle)))))) / 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.35e+109) 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 * tan((pi * (0.005555555555555556 * angle)))))) / 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.35e+109], 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[(y$45$scale / N[(x$45$scale * N[Tan[N[(Pi * N[(0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
\mathbf{if}\;b\_m \leq 2.35 \cdot 10^{+109}:\\
\;\;\;\;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 \tan \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right)}\right)}{\pi}\\
\end{array}
\end{array}
if b < 2.34999999999999999e109Initial program 13.8%
Simplified14.1%
Taylor expanded in a around inf 19.5%
Taylor expanded in y-scale around inf 39.2%
associate-*r/39.2%
Simplified39.2%
Taylor expanded in angle around 0 43.1%
associate-/l*49.1%
associate-/l*49.1%
Simplified49.1%
if 2.34999999999999999e109 < b Initial program 4.1%
Simplified2.7%
Taylor expanded in x-scale around 0 8.6%
Simplified8.7%
Taylor expanded in a around 0 66.5%
mul-1-neg66.5%
times-frac62.9%
Simplified62.9%
add-cube-cbrt62.2%
pow362.2%
Applied egg-rr63.0%
Taylor expanded in y-scale around 0 66.5%
associate-*r/66.5%
rem-cube-cbrt66.5%
associate-/r*62.9%
*-commutative62.9%
neg-mul-162.9%
associate-/l*62.9%
distribute-frac-neg62.9%
distribute-rgt-neg-out62.9%
distribute-lft-neg-in62.9%
metadata-eval62.9%
Simplified67.4%
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale y-scale)
:precision binary64
(if (<= b_m 3.9e+109)
(*
180.0
(/
(atan (* 0.005555555555555556 (* angle (* y-scale (/ PI x-scale)))))
PI))
(* 180.0 (/ (atan (* -180.0 (/ (/ y-scale angle) (* PI 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 tmp;
if (b_m <= 3.9e+109) {
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) / (((double) M_PI) * 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 tmp;
if (b_m <= 3.9e+109) {
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) / (Math.PI * x_45_scale)))) / 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 <= 3.9e+109: 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) / (math.pi * x_45_scale)))) / 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 <= 3.9e+109) 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(Float64(y_45_scale / angle) / Float64(pi * 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) tmp = 0.0; if (b_m <= 3.9e+109) 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) / (pi * 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_] := If[LessEqual[b$95$m, 3.9e+109], 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[(N[(y$45$scale / angle), $MachinePrecision] / N[(Pi * x$45$scale), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
\mathbf{if}\;b\_m \leq 3.9 \cdot 10^{+109}:\\
\;\;\;\;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{\frac{y-scale}{angle}}{\pi \cdot x-scale}\right)}{\pi}\\
\end{array}
\end{array}
if b < 3.90000000000000016e109Initial program 13.8%
Simplified14.1%
Taylor expanded in a around inf 19.5%
Taylor expanded in y-scale around inf 39.2%
associate-*r/39.2%
Simplified39.2%
Taylor expanded in angle around 0 43.1%
associate-/l*49.1%
associate-/l*49.1%
Simplified49.1%
if 3.90000000000000016e109 < b Initial program 4.1%
Simplified2.7%
Taylor expanded in angle around 0 4.4%
associate-*r/4.4%
distribute-lft-out--4.4%
Simplified4.4%
Taylor expanded in a around 0 61.8%
associate-/r*61.8%
Simplified61.8%
Final simplification51.6%
b_m = (fabs.f64 b) (FPCore (a b_m angle x-scale y-scale) :precision binary64 (* 180.0 (/ (atan (* -180.0 (/ (/ y-scale (* PI x-scale)) angle))) 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 / (((double) M_PI) * x_45_scale)) / angle))) / ((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 / (Math.PI * x_45_scale)) / angle))) / 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 / (math.pi * x_45_scale)) / angle))) / 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(Float64(y_45_scale / Float64(pi * x_45_scale)) / angle))) / 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 / (pi * x_45_scale)) / angle))) / 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[(N[(y$45$scale / N[(Pi * x$45$scale), $MachinePrecision]), $MachinePrecision] / angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
b_m = \left|b\right|
\\
180 \cdot \frac{\tan^{-1} \left(-180 \cdot \frac{\frac{y-scale}{\pi \cdot x-scale}}{angle}\right)}{\pi}
\end{array}
Initial program 11.9%
Simplified11.8%
Taylor expanded in x-scale around 0 25.2%
Simplified29.7%
Taylor expanded in a around 0 46.5%
mul-1-neg46.5%
times-frac47.5%
Simplified47.5%
log1p-expm1-u47.5%
log1p-undefine47.5%
Applied egg-rr47.5%
Taylor expanded in angle around 0 41.0%
*-commutative41.0%
associate-/r*42.1%
*-commutative42.1%
Simplified42.1%
b_m = (fabs.f64 b) (FPCore (a b_m angle x-scale y-scale) :precision binary64 (* 180.0 (/ (atan (* -180.0 (/ (/ y-scale angle) (* PI x-scale)))) 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) / (((double) M_PI) * x_45_scale)))) / ((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) / (Math.PI * x_45_scale)))) / 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) / (math.pi * x_45_scale)))) / 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(Float64(y_45_scale / angle) / Float64(pi * x_45_scale)))) / 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) / (pi * x_45_scale)))) / 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[(N[(y$45$scale / angle), $MachinePrecision] / N[(Pi * x$45$scale), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
b_m = \left|b\right|
\\
180 \cdot \frac{\tan^{-1} \left(-180 \cdot \frac{\frac{y-scale}{angle}}{\pi \cdot x-scale}\right)}{\pi}
\end{array}
Initial program 11.9%
Simplified11.8%
Taylor expanded in angle around 0 9.1%
associate-*r/9.1%
distribute-lft-out--9.1%
Simplified9.1%
Taylor expanded in a around 0 41.0%
associate-/r*41.1%
Simplified41.1%
Final simplification41.1%
b_m = (fabs.f64 b) (FPCore (a b_m angle x-scale y-scale) :precision binary64 (* 180.0 (/ (atan (* -180.0 (/ y-scale (* angle (* PI x-scale))))) 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 * (((double) M_PI) * x_45_scale))))) / ((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 * (Math.PI * x_45_scale))))) / 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 * (math.pi * x_45_scale))))) / 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(pi * x_45_scale))))) / 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 * (pi * x_45_scale))))) / 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[(Pi * x$45$scale), $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(\pi \cdot x-scale\right)}\right)}{\pi}
\end{array}
Initial program 11.9%
Simplified11.8%
Taylor expanded in angle around 0 9.1%
associate-*r/9.1%
distribute-lft-out--9.1%
Simplified9.1%
Taylor expanded in a around 0 41.0%
Final simplification41.0%
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.9%
Simplified11.8%
Taylor expanded in angle around 0 9.1%
associate-*r/9.1%
distribute-lft-out--9.1%
Simplified9.1%
Taylor expanded in a around inf 13.9%
herbie shell --seed 2024180
(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)))