
(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 9 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 (* (/ y-scale x-scale) -2.0)))
(if (<= b_m 1.82e+19)
(*
(atan
(*
(*
(tan (* (* (sqrt PI) (sqrt PI)) (* 0.005555555555555556 angle)))
t_0)
-0.5))
(* (/ 1.0 PI) 180.0))
(if (<= b_m 3e+112)
(*
(/
(atan
(*
90.0
(/
(/ (* (/ (* (* b_m b_m) y-scale) x-scale) -2.0) (* PI angle))
(* (+ a b_m) (- b_m a)))))
PI)
180.0)
(if (<= b_m 7.5e+153)
(/
1.0
(/
PI
(*
(atan (* (* (* (* PI angle) 0.005555555555555556) t_0) -0.5))
180.0)))
(*
(/ (atan (* (* (/ y-scale (* (* PI x-scale) angle)) -2.0) 90.0)) PI)
180.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 = (y_45_scale / x_45_scale) * -2.0;
double tmp;
if (b_m <= 1.82e+19) {
tmp = atan(((tan(((sqrt(((double) M_PI)) * sqrt(((double) M_PI))) * (0.005555555555555556 * angle))) * t_0) * -0.5)) * ((1.0 / ((double) M_PI)) * 180.0);
} else if (b_m <= 3e+112) {
tmp = (atan((90.0 * ((((((b_m * b_m) * y_45_scale) / x_45_scale) * -2.0) / (((double) M_PI) * angle)) / ((a + b_m) * (b_m - a))))) / ((double) M_PI)) * 180.0;
} else if (b_m <= 7.5e+153) {
tmp = 1.0 / (((double) M_PI) / (atan(((((((double) M_PI) * angle) * 0.005555555555555556) * t_0) * -0.5)) * 180.0));
} else {
tmp = (atan((((y_45_scale / ((((double) M_PI) * x_45_scale) * angle)) * -2.0) * 90.0)) / ((double) M_PI)) * 180.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 = (y_45_scale / x_45_scale) * -2.0;
double tmp;
if (b_m <= 1.82e+19) {
tmp = Math.atan(((Math.tan(((Math.sqrt(Math.PI) * Math.sqrt(Math.PI)) * (0.005555555555555556 * angle))) * t_0) * -0.5)) * ((1.0 / Math.PI) * 180.0);
} else if (b_m <= 3e+112) {
tmp = (Math.atan((90.0 * ((((((b_m * b_m) * y_45_scale) / x_45_scale) * -2.0) / (Math.PI * angle)) / ((a + b_m) * (b_m - a))))) / Math.PI) * 180.0;
} else if (b_m <= 7.5e+153) {
tmp = 1.0 / (Math.PI / (Math.atan(((((Math.PI * angle) * 0.005555555555555556) * t_0) * -0.5)) * 180.0));
} else {
tmp = (Math.atan((((y_45_scale / ((Math.PI * x_45_scale) * angle)) * -2.0) * 90.0)) / Math.PI) * 180.0;
}
return tmp;
}
b_m = math.fabs(b) def code(a, b_m, angle, x_45_scale, y_45_scale): t_0 = (y_45_scale / x_45_scale) * -2.0 tmp = 0 if b_m <= 1.82e+19: tmp = math.atan(((math.tan(((math.sqrt(math.pi) * math.sqrt(math.pi)) * (0.005555555555555556 * angle))) * t_0) * -0.5)) * ((1.0 / math.pi) * 180.0) elif b_m <= 3e+112: tmp = (math.atan((90.0 * ((((((b_m * b_m) * y_45_scale) / x_45_scale) * -2.0) / (math.pi * angle)) / ((a + b_m) * (b_m - a))))) / math.pi) * 180.0 elif b_m <= 7.5e+153: tmp = 1.0 / (math.pi / (math.atan(((((math.pi * angle) * 0.005555555555555556) * t_0) * -0.5)) * 180.0)) else: tmp = (math.atan((((y_45_scale / ((math.pi * x_45_scale) * angle)) * -2.0) * 90.0)) / math.pi) * 180.0 return tmp
b_m = abs(b) function code(a, b_m, angle, x_45_scale, y_45_scale) t_0 = Float64(Float64(y_45_scale / x_45_scale) * -2.0) tmp = 0.0 if (b_m <= 1.82e+19) tmp = Float64(atan(Float64(Float64(tan(Float64(Float64(sqrt(pi) * sqrt(pi)) * Float64(0.005555555555555556 * angle))) * t_0) * -0.5)) * Float64(Float64(1.0 / pi) * 180.0)); elseif (b_m <= 3e+112) tmp = Float64(Float64(atan(Float64(90.0 * Float64(Float64(Float64(Float64(Float64(Float64(b_m * b_m) * y_45_scale) / x_45_scale) * -2.0) / Float64(pi * angle)) / Float64(Float64(a + b_m) * Float64(b_m - a))))) / pi) * 180.0); elseif (b_m <= 7.5e+153) tmp = Float64(1.0 / Float64(pi / Float64(atan(Float64(Float64(Float64(Float64(pi * angle) * 0.005555555555555556) * t_0) * -0.5)) * 180.0))); else tmp = Float64(Float64(atan(Float64(Float64(Float64(y_45_scale / Float64(Float64(pi * x_45_scale) * angle)) * -2.0) * 90.0)) / pi) * 180.0); end return tmp end
b_m = abs(b); function tmp_2 = code(a, b_m, angle, x_45_scale, y_45_scale) t_0 = (y_45_scale / x_45_scale) * -2.0; tmp = 0.0; if (b_m <= 1.82e+19) tmp = atan(((tan(((sqrt(pi) * sqrt(pi)) * (0.005555555555555556 * angle))) * t_0) * -0.5)) * ((1.0 / pi) * 180.0); elseif (b_m <= 3e+112) tmp = (atan((90.0 * ((((((b_m * b_m) * y_45_scale) / x_45_scale) * -2.0) / (pi * angle)) / ((a + b_m) * (b_m - a))))) / pi) * 180.0; elseif (b_m <= 7.5e+153) tmp = 1.0 / (pi / (atan(((((pi * angle) * 0.005555555555555556) * t_0) * -0.5)) * 180.0)); else tmp = (atan((((y_45_scale / ((pi * x_45_scale) * angle)) * -2.0) * 90.0)) / pi) * 180.0; 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[(N[(y$45$scale / x$45$scale), $MachinePrecision] * -2.0), $MachinePrecision]}, If[LessEqual[b$95$m, 1.82e+19], N[(N[ArcTan[N[(N[(N[Tan[N[(N[(N[Sqrt[Pi], $MachinePrecision] * N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision] * N[(0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision] * -0.5), $MachinePrecision]], $MachinePrecision] * N[(N[(1.0 / Pi), $MachinePrecision] * 180.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[b$95$m, 3e+112], N[(N[(N[ArcTan[N[(90.0 * N[(N[(N[(N[(N[(N[(b$95$m * b$95$m), $MachinePrecision] * y$45$scale), $MachinePrecision] / x$45$scale), $MachinePrecision] * -2.0), $MachinePrecision] / N[(Pi * angle), $MachinePrecision]), $MachinePrecision] / N[(N[(a + b$95$m), $MachinePrecision] * N[(b$95$m - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision] * 180.0), $MachinePrecision], If[LessEqual[b$95$m, 7.5e+153], N[(1.0 / N[(Pi / N[(N[ArcTan[N[(N[(N[(N[(Pi * angle), $MachinePrecision] * 0.005555555555555556), $MachinePrecision] * t$95$0), $MachinePrecision] * -0.5), $MachinePrecision]], $MachinePrecision] * 180.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[ArcTan[N[(N[(N[(y$45$scale / N[(N[(Pi * x$45$scale), $MachinePrecision] * angle), $MachinePrecision]), $MachinePrecision] * -2.0), $MachinePrecision] * 90.0), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision] * 180.0), $MachinePrecision]]]]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
t_0 := \frac{y-scale}{x-scale} \cdot -2\\
\mathbf{if}\;b\_m \leq 1.82 \cdot 10^{+19}:\\
\;\;\;\;\tan^{-1} \left(\left(\tan \left(\left(\sqrt{\pi} \cdot \sqrt{\pi}\right) \cdot \left(0.005555555555555556 \cdot angle\right)\right) \cdot t\_0\right) \cdot -0.5\right) \cdot \left(\frac{1}{\pi} \cdot 180\right)\\
\mathbf{elif}\;b\_m \leq 3 \cdot 10^{+112}:\\
\;\;\;\;\frac{\tan^{-1} \left(90 \cdot \frac{\frac{\frac{\left(b\_m \cdot b\_m\right) \cdot y-scale}{x-scale} \cdot -2}{\pi \cdot angle}}{\left(a + b\_m\right) \cdot \left(b\_m - a\right)}\right)}{\pi} \cdot 180\\
\mathbf{elif}\;b\_m \leq 7.5 \cdot 10^{+153}:\\
\;\;\;\;\frac{1}{\frac{\pi}{\tan^{-1} \left(\left(\left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556\right) \cdot t\_0\right) \cdot -0.5\right) \cdot 180}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\tan^{-1} \left(\left(\frac{y-scale}{\left(\pi \cdot x-scale\right) \cdot angle} \cdot -2\right) \cdot 90\right)}{\pi} \cdot 180\\
\end{array}
\end{array}
if b < 1.82e19Initial program 15.9%
Taylor expanded in x-scale around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites30.1%
Taylor expanded in b around 0
Applied rewrites52.0%
Applied rewrites54.0%
Applied rewrites56.0%
if 1.82e19 < b < 2.99999999999999979e112Initial program 50.5%
Taylor expanded in angle around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites50.2%
Applied rewrites56.7%
Taylor expanded in b around inf
Applied rewrites64.9%
if 2.99999999999999979e112 < b < 7.50000000000000065e153Initial program 25.0%
Taylor expanded in x-scale around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites25.7%
Taylor expanded in b around 0
Applied rewrites39.1%
Applied rewrites50.8%
Taylor expanded in angle around 0
Applied rewrites75.4%
if 7.50000000000000065e153 < b Initial program 0.0%
Taylor expanded in angle around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites0.0%
Taylor expanded in b around inf
Applied rewrites66.5%
Final simplification58.2%
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale y-scale)
:precision binary64
(let* ((t_0 (* (* PI angle) 0.005555555555555556)))
(if (<= b_m 1.4e+19)
(*
(* (/ 1.0 PI) 180.0)
(atan
(*
(*
(tan (* (* 0.005555555555555556 angle) (cbrt (* (* PI PI) PI))))
(* (/ y-scale x-scale) -2.0))
-0.5)))
(*
(/
(atan (* (* (* (/ (cos t_0) (* (sin t_0) x-scale)) y-scale) 2.0) -0.5))
PI)
180.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 = (((double) M_PI) * angle) * 0.005555555555555556;
double tmp;
if (b_m <= 1.4e+19) {
tmp = ((1.0 / ((double) M_PI)) * 180.0) * atan(((tan(((0.005555555555555556 * angle) * cbrt(((((double) M_PI) * ((double) M_PI)) * ((double) M_PI))))) * ((y_45_scale / x_45_scale) * -2.0)) * -0.5));
} else {
tmp = (atan(((((cos(t_0) / (sin(t_0) * x_45_scale)) * y_45_scale) * 2.0) * -0.5)) / ((double) M_PI)) * 180.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 = (Math.PI * angle) * 0.005555555555555556;
double tmp;
if (b_m <= 1.4e+19) {
tmp = ((1.0 / Math.PI) * 180.0) * Math.atan(((Math.tan(((0.005555555555555556 * angle) * Math.cbrt(((Math.PI * Math.PI) * Math.PI)))) * ((y_45_scale / x_45_scale) * -2.0)) * -0.5));
} else {
tmp = (Math.atan(((((Math.cos(t_0) / (Math.sin(t_0) * x_45_scale)) * y_45_scale) * 2.0) * -0.5)) / Math.PI) * 180.0;
}
return tmp;
}
b_m = abs(b) function code(a, b_m, angle, x_45_scale, y_45_scale) t_0 = Float64(Float64(pi * angle) * 0.005555555555555556) tmp = 0.0 if (b_m <= 1.4e+19) tmp = Float64(Float64(Float64(1.0 / pi) * 180.0) * atan(Float64(Float64(tan(Float64(Float64(0.005555555555555556 * angle) * cbrt(Float64(Float64(pi * pi) * pi)))) * Float64(Float64(y_45_scale / x_45_scale) * -2.0)) * -0.5))); else tmp = Float64(Float64(atan(Float64(Float64(Float64(Float64(cos(t_0) / Float64(sin(t_0) * x_45_scale)) * y_45_scale) * 2.0) * -0.5)) / pi) * 180.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[(N[(Pi * angle), $MachinePrecision] * 0.005555555555555556), $MachinePrecision]}, If[LessEqual[b$95$m, 1.4e+19], N[(N[(N[(1.0 / Pi), $MachinePrecision] * 180.0), $MachinePrecision] * N[ArcTan[N[(N[(N[Tan[N[(N[(0.005555555555555556 * angle), $MachinePrecision] * N[Power[N[(N[(Pi * Pi), $MachinePrecision] * Pi), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(y$45$scale / x$45$scale), $MachinePrecision] * -2.0), $MachinePrecision]), $MachinePrecision] * -0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[ArcTan[N[(N[(N[(N[(N[Cos[t$95$0], $MachinePrecision] / N[(N[Sin[t$95$0], $MachinePrecision] * x$45$scale), $MachinePrecision]), $MachinePrecision] * y$45$scale), $MachinePrecision] * 2.0), $MachinePrecision] * -0.5), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision] * 180.0), $MachinePrecision]]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
t_0 := \left(\pi \cdot angle\right) \cdot 0.005555555555555556\\
\mathbf{if}\;b\_m \leq 1.4 \cdot 10^{+19}:\\
\;\;\;\;\left(\frac{1}{\pi} \cdot 180\right) \cdot \tan^{-1} \left(\left(\tan \left(\left(0.005555555555555556 \cdot angle\right) \cdot \sqrt[3]{\left(\pi \cdot \pi\right) \cdot \pi}\right) \cdot \left(\frac{y-scale}{x-scale} \cdot -2\right)\right) \cdot -0.5\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\tan^{-1} \left(\left(\left(\frac{\cos t\_0}{\sin t\_0 \cdot x-scale} \cdot y-scale\right) \cdot 2\right) \cdot -0.5\right)}{\pi} \cdot 180\\
\end{array}
\end{array}
if b < 1.4e19Initial program 15.9%
Taylor expanded in x-scale around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites30.1%
Taylor expanded in b around 0
Applied rewrites52.0%
Applied rewrites54.0%
Applied rewrites56.0%
if 1.4e19 < b Initial program 20.2%
Taylor expanded in x-scale around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites22.9%
Taylor expanded in b around 0
Applied rewrites26.7%
Taylor expanded in b around inf
Applied rewrites58.8%
Final simplification56.5%
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale y-scale)
:precision binary64
(let* ((t_0 (* (* PI angle) 0.005555555555555556)))
(if (<= b_m 1.4e+19)
(*
(atan
(*
(*
(tan (* (* (sqrt PI) (sqrt PI)) (* 0.005555555555555556 angle)))
(* (/ y-scale x-scale) -2.0))
-0.5))
(* (/ 1.0 PI) 180.0))
(*
(/
(atan (* (* (* (/ (cos t_0) (* (sin t_0) x-scale)) y-scale) 2.0) -0.5))
PI)
180.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 = (((double) M_PI) * angle) * 0.005555555555555556;
double tmp;
if (b_m <= 1.4e+19) {
tmp = atan(((tan(((sqrt(((double) M_PI)) * sqrt(((double) M_PI))) * (0.005555555555555556 * angle))) * ((y_45_scale / x_45_scale) * -2.0)) * -0.5)) * ((1.0 / ((double) M_PI)) * 180.0);
} else {
tmp = (atan(((((cos(t_0) / (sin(t_0) * x_45_scale)) * y_45_scale) * 2.0) * -0.5)) / ((double) M_PI)) * 180.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 = (Math.PI * angle) * 0.005555555555555556;
double tmp;
if (b_m <= 1.4e+19) {
tmp = Math.atan(((Math.tan(((Math.sqrt(Math.PI) * Math.sqrt(Math.PI)) * (0.005555555555555556 * angle))) * ((y_45_scale / x_45_scale) * -2.0)) * -0.5)) * ((1.0 / Math.PI) * 180.0);
} else {
tmp = (Math.atan(((((Math.cos(t_0) / (Math.sin(t_0) * x_45_scale)) * y_45_scale) * 2.0) * -0.5)) / Math.PI) * 180.0;
}
return tmp;
}
b_m = math.fabs(b) def code(a, b_m, angle, x_45_scale, y_45_scale): t_0 = (math.pi * angle) * 0.005555555555555556 tmp = 0 if b_m <= 1.4e+19: tmp = math.atan(((math.tan(((math.sqrt(math.pi) * math.sqrt(math.pi)) * (0.005555555555555556 * angle))) * ((y_45_scale / x_45_scale) * -2.0)) * -0.5)) * ((1.0 / math.pi) * 180.0) else: tmp = (math.atan(((((math.cos(t_0) / (math.sin(t_0) * x_45_scale)) * y_45_scale) * 2.0) * -0.5)) / math.pi) * 180.0 return tmp
b_m = abs(b) function code(a, b_m, angle, x_45_scale, y_45_scale) t_0 = Float64(Float64(pi * angle) * 0.005555555555555556) tmp = 0.0 if (b_m <= 1.4e+19) tmp = Float64(atan(Float64(Float64(tan(Float64(Float64(sqrt(pi) * sqrt(pi)) * Float64(0.005555555555555556 * angle))) * Float64(Float64(y_45_scale / x_45_scale) * -2.0)) * -0.5)) * Float64(Float64(1.0 / pi) * 180.0)); else tmp = Float64(Float64(atan(Float64(Float64(Float64(Float64(cos(t_0) / Float64(sin(t_0) * x_45_scale)) * y_45_scale) * 2.0) * -0.5)) / pi) * 180.0); 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 * angle) * 0.005555555555555556; tmp = 0.0; if (b_m <= 1.4e+19) tmp = atan(((tan(((sqrt(pi) * sqrt(pi)) * (0.005555555555555556 * angle))) * ((y_45_scale / x_45_scale) * -2.0)) * -0.5)) * ((1.0 / pi) * 180.0); else tmp = (atan(((((cos(t_0) / (sin(t_0) * x_45_scale)) * y_45_scale) * 2.0) * -0.5)) / pi) * 180.0; 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[(N[(Pi * angle), $MachinePrecision] * 0.005555555555555556), $MachinePrecision]}, If[LessEqual[b$95$m, 1.4e+19], N[(N[ArcTan[N[(N[(N[Tan[N[(N[(N[Sqrt[Pi], $MachinePrecision] * N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision] * N[(0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(y$45$scale / x$45$scale), $MachinePrecision] * -2.0), $MachinePrecision]), $MachinePrecision] * -0.5), $MachinePrecision]], $MachinePrecision] * N[(N[(1.0 / Pi), $MachinePrecision] * 180.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[ArcTan[N[(N[(N[(N[(N[Cos[t$95$0], $MachinePrecision] / N[(N[Sin[t$95$0], $MachinePrecision] * x$45$scale), $MachinePrecision]), $MachinePrecision] * y$45$scale), $MachinePrecision] * 2.0), $MachinePrecision] * -0.5), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision] * 180.0), $MachinePrecision]]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
t_0 := \left(\pi \cdot angle\right) \cdot 0.005555555555555556\\
\mathbf{if}\;b\_m \leq 1.4 \cdot 10^{+19}:\\
\;\;\;\;\tan^{-1} \left(\left(\tan \left(\left(\sqrt{\pi} \cdot \sqrt{\pi}\right) \cdot \left(0.005555555555555556 \cdot angle\right)\right) \cdot \left(\frac{y-scale}{x-scale} \cdot -2\right)\right) \cdot -0.5\right) \cdot \left(\frac{1}{\pi} \cdot 180\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\tan^{-1} \left(\left(\left(\frac{\cos t\_0}{\sin t\_0 \cdot x-scale} \cdot y-scale\right) \cdot 2\right) \cdot -0.5\right)}{\pi} \cdot 180\\
\end{array}
\end{array}
if b < 1.4e19Initial program 15.9%
Taylor expanded in x-scale around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites30.1%
Taylor expanded in b around 0
Applied rewrites52.0%
Applied rewrites54.0%
Applied rewrites56.0%
if 1.4e19 < b Initial program 20.2%
Taylor expanded in x-scale around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites22.9%
Taylor expanded in b around 0
Applied rewrites26.7%
Taylor expanded in b around inf
Applied rewrites58.8%
Final simplification56.6%
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale y-scale)
:precision binary64
(let* ((t_0
(atan
(*
(*
(* (* PI angle) 0.005555555555555556)
(* (/ y-scale x-scale) -2.0))
-0.5))))
(if (<= b_m 8e+18)
(* t_0 (* (/ 1.0 PI) 180.0))
(if (<= b_m 3e+112)
(*
(/
(atan
(*
90.0
(/
(/ (* (/ (* (* b_m b_m) y-scale) x-scale) -2.0) (* PI angle))
(* (+ a b_m) (- b_m a)))))
PI)
180.0)
(if (<= b_m 7.5e+153)
(/ 1.0 (/ PI (* t_0 180.0)))
(*
(/ (atan (* (* (/ y-scale (* (* PI x-scale) angle)) -2.0) 90.0)) PI)
180.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 = atan(((((((double) M_PI) * angle) * 0.005555555555555556) * ((y_45_scale / x_45_scale) * -2.0)) * -0.5));
double tmp;
if (b_m <= 8e+18) {
tmp = t_0 * ((1.0 / ((double) M_PI)) * 180.0);
} else if (b_m <= 3e+112) {
tmp = (atan((90.0 * ((((((b_m * b_m) * y_45_scale) / x_45_scale) * -2.0) / (((double) M_PI) * angle)) / ((a + b_m) * (b_m - a))))) / ((double) M_PI)) * 180.0;
} else if (b_m <= 7.5e+153) {
tmp = 1.0 / (((double) M_PI) / (t_0 * 180.0));
} else {
tmp = (atan((((y_45_scale / ((((double) M_PI) * x_45_scale) * angle)) * -2.0) * 90.0)) / ((double) M_PI)) * 180.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 = Math.atan(((((Math.PI * angle) * 0.005555555555555556) * ((y_45_scale / x_45_scale) * -2.0)) * -0.5));
double tmp;
if (b_m <= 8e+18) {
tmp = t_0 * ((1.0 / Math.PI) * 180.0);
} else if (b_m <= 3e+112) {
tmp = (Math.atan((90.0 * ((((((b_m * b_m) * y_45_scale) / x_45_scale) * -2.0) / (Math.PI * angle)) / ((a + b_m) * (b_m - a))))) / Math.PI) * 180.0;
} else if (b_m <= 7.5e+153) {
tmp = 1.0 / (Math.PI / (t_0 * 180.0));
} else {
tmp = (Math.atan((((y_45_scale / ((Math.PI * x_45_scale) * angle)) * -2.0) * 90.0)) / Math.PI) * 180.0;
}
return tmp;
}
b_m = math.fabs(b) def code(a, b_m, angle, x_45_scale, y_45_scale): t_0 = math.atan(((((math.pi * angle) * 0.005555555555555556) * ((y_45_scale / x_45_scale) * -2.0)) * -0.5)) tmp = 0 if b_m <= 8e+18: tmp = t_0 * ((1.0 / math.pi) * 180.0) elif b_m <= 3e+112: tmp = (math.atan((90.0 * ((((((b_m * b_m) * y_45_scale) / x_45_scale) * -2.0) / (math.pi * angle)) / ((a + b_m) * (b_m - a))))) / math.pi) * 180.0 elif b_m <= 7.5e+153: tmp = 1.0 / (math.pi / (t_0 * 180.0)) else: tmp = (math.atan((((y_45_scale / ((math.pi * x_45_scale) * angle)) * -2.0) * 90.0)) / math.pi) * 180.0 return tmp
b_m = abs(b) function code(a, b_m, angle, x_45_scale, y_45_scale) t_0 = atan(Float64(Float64(Float64(Float64(pi * angle) * 0.005555555555555556) * Float64(Float64(y_45_scale / x_45_scale) * -2.0)) * -0.5)) tmp = 0.0 if (b_m <= 8e+18) tmp = Float64(t_0 * Float64(Float64(1.0 / pi) * 180.0)); elseif (b_m <= 3e+112) tmp = Float64(Float64(atan(Float64(90.0 * Float64(Float64(Float64(Float64(Float64(Float64(b_m * b_m) * y_45_scale) / x_45_scale) * -2.0) / Float64(pi * angle)) / Float64(Float64(a + b_m) * Float64(b_m - a))))) / pi) * 180.0); elseif (b_m <= 7.5e+153) tmp = Float64(1.0 / Float64(pi / Float64(t_0 * 180.0))); else tmp = Float64(Float64(atan(Float64(Float64(Float64(y_45_scale / Float64(Float64(pi * x_45_scale) * angle)) * -2.0) * 90.0)) / pi) * 180.0); end return tmp end
b_m = abs(b); function tmp_2 = code(a, b_m, angle, x_45_scale, y_45_scale) t_0 = atan(((((pi * angle) * 0.005555555555555556) * ((y_45_scale / x_45_scale) * -2.0)) * -0.5)); tmp = 0.0; if (b_m <= 8e+18) tmp = t_0 * ((1.0 / pi) * 180.0); elseif (b_m <= 3e+112) tmp = (atan((90.0 * ((((((b_m * b_m) * y_45_scale) / x_45_scale) * -2.0) / (pi * angle)) / ((a + b_m) * (b_m - a))))) / pi) * 180.0; elseif (b_m <= 7.5e+153) tmp = 1.0 / (pi / (t_0 * 180.0)); else tmp = (atan((((y_45_scale / ((pi * x_45_scale) * angle)) * -2.0) * 90.0)) / pi) * 180.0; 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[ArcTan[N[(N[(N[(N[(Pi * angle), $MachinePrecision] * 0.005555555555555556), $MachinePrecision] * N[(N[(y$45$scale / x$45$scale), $MachinePrecision] * -2.0), $MachinePrecision]), $MachinePrecision] * -0.5), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[b$95$m, 8e+18], N[(t$95$0 * N[(N[(1.0 / Pi), $MachinePrecision] * 180.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[b$95$m, 3e+112], N[(N[(N[ArcTan[N[(90.0 * N[(N[(N[(N[(N[(N[(b$95$m * b$95$m), $MachinePrecision] * y$45$scale), $MachinePrecision] / x$45$scale), $MachinePrecision] * -2.0), $MachinePrecision] / N[(Pi * angle), $MachinePrecision]), $MachinePrecision] / N[(N[(a + b$95$m), $MachinePrecision] * N[(b$95$m - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision] * 180.0), $MachinePrecision], If[LessEqual[b$95$m, 7.5e+153], N[(1.0 / N[(Pi / N[(t$95$0 * 180.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[ArcTan[N[(N[(N[(y$45$scale / N[(N[(Pi * x$45$scale), $MachinePrecision] * angle), $MachinePrecision]), $MachinePrecision] * -2.0), $MachinePrecision] * 90.0), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision] * 180.0), $MachinePrecision]]]]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
t_0 := \tan^{-1} \left(\left(\left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556\right) \cdot \left(\frac{y-scale}{x-scale} \cdot -2\right)\right) \cdot -0.5\right)\\
\mathbf{if}\;b\_m \leq 8 \cdot 10^{+18}:\\
\;\;\;\;t\_0 \cdot \left(\frac{1}{\pi} \cdot 180\right)\\
\mathbf{elif}\;b\_m \leq 3 \cdot 10^{+112}:\\
\;\;\;\;\frac{\tan^{-1} \left(90 \cdot \frac{\frac{\frac{\left(b\_m \cdot b\_m\right) \cdot y-scale}{x-scale} \cdot -2}{\pi \cdot angle}}{\left(a + b\_m\right) \cdot \left(b\_m - a\right)}\right)}{\pi} \cdot 180\\
\mathbf{elif}\;b\_m \leq 7.5 \cdot 10^{+153}:\\
\;\;\;\;\frac{1}{\frac{\pi}{t\_0 \cdot 180}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\tan^{-1} \left(\left(\frac{y-scale}{\left(\pi \cdot x-scale\right) \cdot angle} \cdot -2\right) \cdot 90\right)}{\pi} \cdot 180\\
\end{array}
\end{array}
if b < 8e18Initial program 15.9%
Taylor expanded in x-scale around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites30.1%
Taylor expanded in b around 0
Applied rewrites52.0%
Applied rewrites54.0%
Taylor expanded in angle around 0
Applied rewrites55.3%
if 8e18 < b < 2.99999999999999979e112Initial program 50.5%
Taylor expanded in angle around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites50.2%
Applied rewrites56.7%
Taylor expanded in b around inf
Applied rewrites64.9%
if 2.99999999999999979e112 < b < 7.50000000000000065e153Initial program 25.0%
Taylor expanded in x-scale around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites25.7%
Taylor expanded in b around 0
Applied rewrites39.1%
Applied rewrites50.8%
Taylor expanded in angle around 0
Applied rewrites75.4%
if 7.50000000000000065e153 < b Initial program 0.0%
Taylor expanded in angle around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites0.0%
Taylor expanded in b around inf
Applied rewrites66.5%
Final simplification57.7%
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale y-scale)
:precision binary64
(let* ((t_0
(atan
(*
(*
(* (* PI angle) 0.005555555555555556)
(* (/ y-scale x-scale) -2.0))
-0.5))))
(if (<= b_m 1550000000.0)
(* t_0 (* (/ 1.0 PI) 180.0))
(if (<= b_m 3e+112)
(*
(/
(atan
(*
(/
(* (/ (* (* b_m b_m) y-scale) x-scale) -2.0)
(* (* (+ a b_m) (- b_m a)) (* PI angle)))
90.0))
PI)
180.0)
(if (<= b_m 7.5e+153)
(/ 1.0 (/ PI (* t_0 180.0)))
(*
(/ (atan (* (* (/ y-scale (* (* PI x-scale) angle)) -2.0) 90.0)) PI)
180.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 = atan(((((((double) M_PI) * angle) * 0.005555555555555556) * ((y_45_scale / x_45_scale) * -2.0)) * -0.5));
double tmp;
if (b_m <= 1550000000.0) {
tmp = t_0 * ((1.0 / ((double) M_PI)) * 180.0);
} else if (b_m <= 3e+112) {
tmp = (atan(((((((b_m * b_m) * y_45_scale) / x_45_scale) * -2.0) / (((a + b_m) * (b_m - a)) * (((double) M_PI) * angle))) * 90.0)) / ((double) M_PI)) * 180.0;
} else if (b_m <= 7.5e+153) {
tmp = 1.0 / (((double) M_PI) / (t_0 * 180.0));
} else {
tmp = (atan((((y_45_scale / ((((double) M_PI) * x_45_scale) * angle)) * -2.0) * 90.0)) / ((double) M_PI)) * 180.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 = Math.atan(((((Math.PI * angle) * 0.005555555555555556) * ((y_45_scale / x_45_scale) * -2.0)) * -0.5));
double tmp;
if (b_m <= 1550000000.0) {
tmp = t_0 * ((1.0 / Math.PI) * 180.0);
} else if (b_m <= 3e+112) {
tmp = (Math.atan(((((((b_m * b_m) * y_45_scale) / x_45_scale) * -2.0) / (((a + b_m) * (b_m - a)) * (Math.PI * angle))) * 90.0)) / Math.PI) * 180.0;
} else if (b_m <= 7.5e+153) {
tmp = 1.0 / (Math.PI / (t_0 * 180.0));
} else {
tmp = (Math.atan((((y_45_scale / ((Math.PI * x_45_scale) * angle)) * -2.0) * 90.0)) / Math.PI) * 180.0;
}
return tmp;
}
b_m = math.fabs(b) def code(a, b_m, angle, x_45_scale, y_45_scale): t_0 = math.atan(((((math.pi * angle) * 0.005555555555555556) * ((y_45_scale / x_45_scale) * -2.0)) * -0.5)) tmp = 0 if b_m <= 1550000000.0: tmp = t_0 * ((1.0 / math.pi) * 180.0) elif b_m <= 3e+112: tmp = (math.atan(((((((b_m * b_m) * y_45_scale) / x_45_scale) * -2.0) / (((a + b_m) * (b_m - a)) * (math.pi * angle))) * 90.0)) / math.pi) * 180.0 elif b_m <= 7.5e+153: tmp = 1.0 / (math.pi / (t_0 * 180.0)) else: tmp = (math.atan((((y_45_scale / ((math.pi * x_45_scale) * angle)) * -2.0) * 90.0)) / math.pi) * 180.0 return tmp
b_m = abs(b) function code(a, b_m, angle, x_45_scale, y_45_scale) t_0 = atan(Float64(Float64(Float64(Float64(pi * angle) * 0.005555555555555556) * Float64(Float64(y_45_scale / x_45_scale) * -2.0)) * -0.5)) tmp = 0.0 if (b_m <= 1550000000.0) tmp = Float64(t_0 * Float64(Float64(1.0 / pi) * 180.0)); elseif (b_m <= 3e+112) tmp = Float64(Float64(atan(Float64(Float64(Float64(Float64(Float64(Float64(b_m * b_m) * y_45_scale) / x_45_scale) * -2.0) / Float64(Float64(Float64(a + b_m) * Float64(b_m - a)) * Float64(pi * angle))) * 90.0)) / pi) * 180.0); elseif (b_m <= 7.5e+153) tmp = Float64(1.0 / Float64(pi / Float64(t_0 * 180.0))); else tmp = Float64(Float64(atan(Float64(Float64(Float64(y_45_scale / Float64(Float64(pi * x_45_scale) * angle)) * -2.0) * 90.0)) / pi) * 180.0); end return tmp end
b_m = abs(b); function tmp_2 = code(a, b_m, angle, x_45_scale, y_45_scale) t_0 = atan(((((pi * angle) * 0.005555555555555556) * ((y_45_scale / x_45_scale) * -2.0)) * -0.5)); tmp = 0.0; if (b_m <= 1550000000.0) tmp = t_0 * ((1.0 / pi) * 180.0); elseif (b_m <= 3e+112) tmp = (atan(((((((b_m * b_m) * y_45_scale) / x_45_scale) * -2.0) / (((a + b_m) * (b_m - a)) * (pi * angle))) * 90.0)) / pi) * 180.0; elseif (b_m <= 7.5e+153) tmp = 1.0 / (pi / (t_0 * 180.0)); else tmp = (atan((((y_45_scale / ((pi * x_45_scale) * angle)) * -2.0) * 90.0)) / pi) * 180.0; 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[ArcTan[N[(N[(N[(N[(Pi * angle), $MachinePrecision] * 0.005555555555555556), $MachinePrecision] * N[(N[(y$45$scale / x$45$scale), $MachinePrecision] * -2.0), $MachinePrecision]), $MachinePrecision] * -0.5), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[b$95$m, 1550000000.0], N[(t$95$0 * N[(N[(1.0 / Pi), $MachinePrecision] * 180.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[b$95$m, 3e+112], N[(N[(N[ArcTan[N[(N[(N[(N[(N[(N[(b$95$m * b$95$m), $MachinePrecision] * y$45$scale), $MachinePrecision] / x$45$scale), $MachinePrecision] * -2.0), $MachinePrecision] / N[(N[(N[(a + b$95$m), $MachinePrecision] * N[(b$95$m - a), $MachinePrecision]), $MachinePrecision] * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 90.0), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision] * 180.0), $MachinePrecision], If[LessEqual[b$95$m, 7.5e+153], N[(1.0 / N[(Pi / N[(t$95$0 * 180.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[ArcTan[N[(N[(N[(y$45$scale / N[(N[(Pi * x$45$scale), $MachinePrecision] * angle), $MachinePrecision]), $MachinePrecision] * -2.0), $MachinePrecision] * 90.0), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision] * 180.0), $MachinePrecision]]]]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
t_0 := \tan^{-1} \left(\left(\left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556\right) \cdot \left(\frac{y-scale}{x-scale} \cdot -2\right)\right) \cdot -0.5\right)\\
\mathbf{if}\;b\_m \leq 1550000000:\\
\;\;\;\;t\_0 \cdot \left(\frac{1}{\pi} \cdot 180\right)\\
\mathbf{elif}\;b\_m \leq 3 \cdot 10^{+112}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{\frac{\left(b\_m \cdot b\_m\right) \cdot y-scale}{x-scale} \cdot -2}{\left(\left(a + b\_m\right) \cdot \left(b\_m - a\right)\right) \cdot \left(\pi \cdot angle\right)} \cdot 90\right)}{\pi} \cdot 180\\
\mathbf{elif}\;b\_m \leq 7.5 \cdot 10^{+153}:\\
\;\;\;\;\frac{1}{\frac{\pi}{t\_0 \cdot 180}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\tan^{-1} \left(\left(\frac{y-scale}{\left(\pi \cdot x-scale\right) \cdot angle} \cdot -2\right) \cdot 90\right)}{\pi} \cdot 180\\
\end{array}
\end{array}
if b < 1.55e9Initial program 16.1%
Taylor expanded in x-scale around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites29.9%
Taylor expanded in b around 0
Applied rewrites52.0%
Applied rewrites54.0%
Taylor expanded in angle around 0
Applied rewrites55.4%
if 1.55e9 < b < 2.99999999999999979e112Initial program 45.1%
Taylor expanded in angle around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites50.2%
Taylor expanded in b around inf
Applied rewrites57.9%
if 2.99999999999999979e112 < b < 7.50000000000000065e153Initial program 25.0%
Taylor expanded in x-scale around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites25.7%
Taylor expanded in b around 0
Applied rewrites39.1%
Applied rewrites50.8%
Taylor expanded in angle around 0
Applied rewrites75.4%
if 7.50000000000000065e153 < b Initial program 0.0%
Taylor expanded in angle around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites0.0%
Taylor expanded in b around inf
Applied rewrites66.5%
Final simplification57.3%
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale y-scale)
:precision binary64
(let* ((t_0
(atan
(*
(*
(* (* PI angle) 0.005555555555555556)
(* (/ y-scale x-scale) -2.0))
-0.5))))
(if (<= b_m 8e+18)
(* t_0 (* (/ 1.0 PI) 180.0))
(if (<= b_m 2.9e+112)
(*
(/
(atan
(*
(/
(* 360.0 (* (* b_m b_m) y-scale))
(* (* (* (+ a b_m) PI) (- b_m a)) (* x-scale angle)))
-0.5))
PI)
180.0)
(if (<= b_m 7.5e+153)
(/ 1.0 (/ PI (* t_0 180.0)))
(*
(/ (atan (* (* (/ y-scale (* (* PI x-scale) angle)) -2.0) 90.0)) PI)
180.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 = atan(((((((double) M_PI) * angle) * 0.005555555555555556) * ((y_45_scale / x_45_scale) * -2.0)) * -0.5));
double tmp;
if (b_m <= 8e+18) {
tmp = t_0 * ((1.0 / ((double) M_PI)) * 180.0);
} else if (b_m <= 2.9e+112) {
tmp = (atan((((360.0 * ((b_m * b_m) * y_45_scale)) / ((((a + b_m) * ((double) M_PI)) * (b_m - a)) * (x_45_scale * angle))) * -0.5)) / ((double) M_PI)) * 180.0;
} else if (b_m <= 7.5e+153) {
tmp = 1.0 / (((double) M_PI) / (t_0 * 180.0));
} else {
tmp = (atan((((y_45_scale / ((((double) M_PI) * x_45_scale) * angle)) * -2.0) * 90.0)) / ((double) M_PI)) * 180.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 = Math.atan(((((Math.PI * angle) * 0.005555555555555556) * ((y_45_scale / x_45_scale) * -2.0)) * -0.5));
double tmp;
if (b_m <= 8e+18) {
tmp = t_0 * ((1.0 / Math.PI) * 180.0);
} else if (b_m <= 2.9e+112) {
tmp = (Math.atan((((360.0 * ((b_m * b_m) * y_45_scale)) / ((((a + b_m) * Math.PI) * (b_m - a)) * (x_45_scale * angle))) * -0.5)) / Math.PI) * 180.0;
} else if (b_m <= 7.5e+153) {
tmp = 1.0 / (Math.PI / (t_0 * 180.0));
} else {
tmp = (Math.atan((((y_45_scale / ((Math.PI * x_45_scale) * angle)) * -2.0) * 90.0)) / Math.PI) * 180.0;
}
return tmp;
}
b_m = math.fabs(b) def code(a, b_m, angle, x_45_scale, y_45_scale): t_0 = math.atan(((((math.pi * angle) * 0.005555555555555556) * ((y_45_scale / x_45_scale) * -2.0)) * -0.5)) tmp = 0 if b_m <= 8e+18: tmp = t_0 * ((1.0 / math.pi) * 180.0) elif b_m <= 2.9e+112: tmp = (math.atan((((360.0 * ((b_m * b_m) * y_45_scale)) / ((((a + b_m) * math.pi) * (b_m - a)) * (x_45_scale * angle))) * -0.5)) / math.pi) * 180.0 elif b_m <= 7.5e+153: tmp = 1.0 / (math.pi / (t_0 * 180.0)) else: tmp = (math.atan((((y_45_scale / ((math.pi * x_45_scale) * angle)) * -2.0) * 90.0)) / math.pi) * 180.0 return tmp
b_m = abs(b) function code(a, b_m, angle, x_45_scale, y_45_scale) t_0 = atan(Float64(Float64(Float64(Float64(pi * angle) * 0.005555555555555556) * Float64(Float64(y_45_scale / x_45_scale) * -2.0)) * -0.5)) tmp = 0.0 if (b_m <= 8e+18) tmp = Float64(t_0 * Float64(Float64(1.0 / pi) * 180.0)); elseif (b_m <= 2.9e+112) tmp = Float64(Float64(atan(Float64(Float64(Float64(360.0 * Float64(Float64(b_m * b_m) * y_45_scale)) / Float64(Float64(Float64(Float64(a + b_m) * pi) * Float64(b_m - a)) * Float64(x_45_scale * angle))) * -0.5)) / pi) * 180.0); elseif (b_m <= 7.5e+153) tmp = Float64(1.0 / Float64(pi / Float64(t_0 * 180.0))); else tmp = Float64(Float64(atan(Float64(Float64(Float64(y_45_scale / Float64(Float64(pi * x_45_scale) * angle)) * -2.0) * 90.0)) / pi) * 180.0); end return tmp end
b_m = abs(b); function tmp_2 = code(a, b_m, angle, x_45_scale, y_45_scale) t_0 = atan(((((pi * angle) * 0.005555555555555556) * ((y_45_scale / x_45_scale) * -2.0)) * -0.5)); tmp = 0.0; if (b_m <= 8e+18) tmp = t_0 * ((1.0 / pi) * 180.0); elseif (b_m <= 2.9e+112) tmp = (atan((((360.0 * ((b_m * b_m) * y_45_scale)) / ((((a + b_m) * pi) * (b_m - a)) * (x_45_scale * angle))) * -0.5)) / pi) * 180.0; elseif (b_m <= 7.5e+153) tmp = 1.0 / (pi / (t_0 * 180.0)); else tmp = (atan((((y_45_scale / ((pi * x_45_scale) * angle)) * -2.0) * 90.0)) / pi) * 180.0; 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[ArcTan[N[(N[(N[(N[(Pi * angle), $MachinePrecision] * 0.005555555555555556), $MachinePrecision] * N[(N[(y$45$scale / x$45$scale), $MachinePrecision] * -2.0), $MachinePrecision]), $MachinePrecision] * -0.5), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[b$95$m, 8e+18], N[(t$95$0 * N[(N[(1.0 / Pi), $MachinePrecision] * 180.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[b$95$m, 2.9e+112], N[(N[(N[ArcTan[N[(N[(N[(360.0 * N[(N[(b$95$m * b$95$m), $MachinePrecision] * y$45$scale), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(N[(a + b$95$m), $MachinePrecision] * Pi), $MachinePrecision] * N[(b$95$m - a), $MachinePrecision]), $MachinePrecision] * N[(x$45$scale * angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -0.5), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision] * 180.0), $MachinePrecision], If[LessEqual[b$95$m, 7.5e+153], N[(1.0 / N[(Pi / N[(t$95$0 * 180.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[ArcTan[N[(N[(N[(y$45$scale / N[(N[(Pi * x$45$scale), $MachinePrecision] * angle), $MachinePrecision]), $MachinePrecision] * -2.0), $MachinePrecision] * 90.0), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision] * 180.0), $MachinePrecision]]]]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
t_0 := \tan^{-1} \left(\left(\left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556\right) \cdot \left(\frac{y-scale}{x-scale} \cdot -2\right)\right) \cdot -0.5\right)\\
\mathbf{if}\;b\_m \leq 8 \cdot 10^{+18}:\\
\;\;\;\;t\_0 \cdot \left(\frac{1}{\pi} \cdot 180\right)\\
\mathbf{elif}\;b\_m \leq 2.9 \cdot 10^{+112}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{360 \cdot \left(\left(b\_m \cdot b\_m\right) \cdot y-scale\right)}{\left(\left(\left(a + b\_m\right) \cdot \pi\right) \cdot \left(b\_m - a\right)\right) \cdot \left(x-scale \cdot angle\right)} \cdot -0.5\right)}{\pi} \cdot 180\\
\mathbf{elif}\;b\_m \leq 7.5 \cdot 10^{+153}:\\
\;\;\;\;\frac{1}{\frac{\pi}{t\_0 \cdot 180}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\tan^{-1} \left(\left(\frac{y-scale}{\left(\pi \cdot x-scale\right) \cdot angle} \cdot -2\right) \cdot 90\right)}{\pi} \cdot 180\\
\end{array}
\end{array}
if b < 8e18Initial program 15.9%
Taylor expanded in x-scale around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites30.1%
Taylor expanded in b around 0
Applied rewrites52.0%
Applied rewrites54.0%
Taylor expanded in angle around 0
Applied rewrites55.3%
if 8e18 < b < 2.9000000000000002e112Initial program 50.5%
Taylor expanded in x-scale around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites58.8%
Taylor expanded in b around 0
Applied rewrites20.6%
Taylor expanded in angle around 0
Applied rewrites58.1%
if 2.9000000000000002e112 < b < 7.50000000000000065e153Initial program 25.0%
Taylor expanded in x-scale around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites25.7%
Taylor expanded in b around 0
Applied rewrites39.1%
Applied rewrites50.8%
Taylor expanded in angle around 0
Applied rewrites75.4%
if 7.50000000000000065e153 < b Initial program 0.0%
Taylor expanded in angle around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites0.0%
Taylor expanded in b around inf
Applied rewrites66.5%
Final simplification57.3%
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale y-scale)
:precision binary64
(if (<= b_m 1.4e+19)
(*
(atan
(*
(* (* (* PI angle) 0.005555555555555556) (* (/ y-scale x-scale) -2.0))
-0.5))
(* (/ 1.0 PI) 180.0))
(*
(/ (atan (* (* (/ y-scale (* (* PI x-scale) angle)) -2.0) 90.0)) PI)
180.0)))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 <= 1.4e+19) {
tmp = atan(((((((double) M_PI) * angle) * 0.005555555555555556) * ((y_45_scale / x_45_scale) * -2.0)) * -0.5)) * ((1.0 / ((double) M_PI)) * 180.0);
} else {
tmp = (atan((((y_45_scale / ((((double) M_PI) * x_45_scale) * angle)) * -2.0) * 90.0)) / ((double) M_PI)) * 180.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 tmp;
if (b_m <= 1.4e+19) {
tmp = Math.atan(((((Math.PI * angle) * 0.005555555555555556) * ((y_45_scale / x_45_scale) * -2.0)) * -0.5)) * ((1.0 / Math.PI) * 180.0);
} else {
tmp = (Math.atan((((y_45_scale / ((Math.PI * x_45_scale) * angle)) * -2.0) * 90.0)) / Math.PI) * 180.0;
}
return tmp;
}
b_m = math.fabs(b) def code(a, b_m, angle, x_45_scale, y_45_scale): tmp = 0 if b_m <= 1.4e+19: tmp = math.atan(((((math.pi * angle) * 0.005555555555555556) * ((y_45_scale / x_45_scale) * -2.0)) * -0.5)) * ((1.0 / math.pi) * 180.0) else: tmp = (math.atan((((y_45_scale / ((math.pi * x_45_scale) * angle)) * -2.0) * 90.0)) / math.pi) * 180.0 return tmp
b_m = abs(b) function code(a, b_m, angle, x_45_scale, y_45_scale) tmp = 0.0 if (b_m <= 1.4e+19) tmp = Float64(atan(Float64(Float64(Float64(Float64(pi * angle) * 0.005555555555555556) * Float64(Float64(y_45_scale / x_45_scale) * -2.0)) * -0.5)) * Float64(Float64(1.0 / pi) * 180.0)); else tmp = Float64(Float64(atan(Float64(Float64(Float64(y_45_scale / Float64(Float64(pi * x_45_scale) * angle)) * -2.0) * 90.0)) / pi) * 180.0); 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 <= 1.4e+19) tmp = atan(((((pi * angle) * 0.005555555555555556) * ((y_45_scale / x_45_scale) * -2.0)) * -0.5)) * ((1.0 / pi) * 180.0); else tmp = (atan((((y_45_scale / ((pi * x_45_scale) * angle)) * -2.0) * 90.0)) / pi) * 180.0; 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, 1.4e+19], N[(N[ArcTan[N[(N[(N[(N[(Pi * angle), $MachinePrecision] * 0.005555555555555556), $MachinePrecision] * N[(N[(y$45$scale / x$45$scale), $MachinePrecision] * -2.0), $MachinePrecision]), $MachinePrecision] * -0.5), $MachinePrecision]], $MachinePrecision] * N[(N[(1.0 / Pi), $MachinePrecision] * 180.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[ArcTan[N[(N[(N[(y$45$scale / N[(N[(Pi * x$45$scale), $MachinePrecision] * angle), $MachinePrecision]), $MachinePrecision] * -2.0), $MachinePrecision] * 90.0), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision] * 180.0), $MachinePrecision]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
\mathbf{if}\;b\_m \leq 1.4 \cdot 10^{+19}:\\
\;\;\;\;\tan^{-1} \left(\left(\left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556\right) \cdot \left(\frac{y-scale}{x-scale} \cdot -2\right)\right) \cdot -0.5\right) \cdot \left(\frac{1}{\pi} \cdot 180\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\tan^{-1} \left(\left(\frac{y-scale}{\left(\pi \cdot x-scale\right) \cdot angle} \cdot -2\right) \cdot 90\right)}{\pi} \cdot 180\\
\end{array}
\end{array}
if b < 1.4e19Initial program 15.9%
Taylor expanded in x-scale around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites30.1%
Taylor expanded in b around 0
Applied rewrites52.0%
Applied rewrites54.0%
Taylor expanded in angle around 0
Applied rewrites55.3%
if 1.4e19 < b Initial program 20.2%
Taylor expanded in angle around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites18.1%
Taylor expanded in b around inf
Applied rewrites52.7%
Final simplification54.8%
b_m = (fabs.f64 b) (FPCore (a b_m angle x-scale y-scale) :precision binary64 (* (/ (atan (* (* (/ y-scale (* (* PI x-scale) angle)) -2.0) 90.0)) PI) 180.0))
b_m = fabs(b);
double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
return (atan((((y_45_scale / ((((double) M_PI) * x_45_scale) * angle)) * -2.0) * 90.0)) / ((double) M_PI)) * 180.0;
}
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 (Math.atan((((y_45_scale / ((Math.PI * x_45_scale) * angle)) * -2.0) * 90.0)) / Math.PI) * 180.0;
}
b_m = math.fabs(b) def code(a, b_m, angle, x_45_scale, y_45_scale): return (math.atan((((y_45_scale / ((math.pi * x_45_scale) * angle)) * -2.0) * 90.0)) / math.pi) * 180.0
b_m = abs(b) function code(a, b_m, angle, x_45_scale, y_45_scale) return Float64(Float64(atan(Float64(Float64(Float64(y_45_scale / Float64(Float64(pi * x_45_scale) * angle)) * -2.0) * 90.0)) / pi) * 180.0) end
b_m = abs(b); function tmp = code(a, b_m, angle, x_45_scale, y_45_scale) tmp = (atan((((y_45_scale / ((pi * x_45_scale) * angle)) * -2.0) * 90.0)) / pi) * 180.0; end
b_m = N[Abs[b], $MachinePrecision] code[a_, b$95$m_, angle_, x$45$scale_, y$45$scale_] := N[(N[(N[ArcTan[N[(N[(N[(y$45$scale / N[(N[(Pi * x$45$scale), $MachinePrecision] * angle), $MachinePrecision]), $MachinePrecision] * -2.0), $MachinePrecision] * 90.0), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision] * 180.0), $MachinePrecision]
\begin{array}{l}
b_m = \left|b\right|
\\
\frac{\tan^{-1} \left(\left(\frac{y-scale}{\left(\pi \cdot x-scale\right) \cdot angle} \cdot -2\right) \cdot 90\right)}{\pi} \cdot 180
\end{array}
Initial program 16.7%
Taylor expanded in angle around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites11.9%
Taylor expanded in b around inf
Applied rewrites31.9%
Final simplification31.9%
b_m = (fabs.f64 b) (FPCore (a b_m angle x-scale y-scale) :precision binary64 (* (/ (atan (* -180.0 (/ x-scale (* (* PI y-scale) angle)))) PI) 180.0))
b_m = fabs(b);
double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
return (atan((-180.0 * (x_45_scale / ((((double) M_PI) * y_45_scale) * angle)))) / ((double) M_PI)) * 180.0;
}
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 (Math.atan((-180.0 * (x_45_scale / ((Math.PI * y_45_scale) * angle)))) / Math.PI) * 180.0;
}
b_m = math.fabs(b) def code(a, b_m, angle, x_45_scale, y_45_scale): return (math.atan((-180.0 * (x_45_scale / ((math.pi * y_45_scale) * angle)))) / math.pi) * 180.0
b_m = abs(b) function code(a, b_m, angle, x_45_scale, y_45_scale) return Float64(Float64(atan(Float64(-180.0 * Float64(x_45_scale / Float64(Float64(pi * y_45_scale) * angle)))) / pi) * 180.0) end
b_m = abs(b); function tmp = code(a, b_m, angle, x_45_scale, y_45_scale) tmp = (atan((-180.0 * (x_45_scale / ((pi * y_45_scale) * angle)))) / pi) * 180.0; end
b_m = N[Abs[b], $MachinePrecision] code[a_, b$95$m_, angle_, x$45$scale_, y$45$scale_] := N[(N[(N[ArcTan[N[(-180.0 * N[(x$45$scale / N[(N[(Pi * y$45$scale), $MachinePrecision] * angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision] * 180.0), $MachinePrecision]
\begin{array}{l}
b_m = \left|b\right|
\\
\frac{\tan^{-1} \left(-180 \cdot \frac{x-scale}{\left(\pi \cdot y-scale\right) \cdot angle}\right)}{\pi} \cdot 180
\end{array}
Initial program 16.7%
Taylor expanded in a around inf
Applied rewrites18.5%
Applied rewrites11.4%
Taylor expanded in angle around 0
Applied rewrites13.6%
Applied rewrites13.6%
Final simplification13.6%
herbie shell --seed 2024240
(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)))