
(FPCore (a b angle) :precision binary64 (let* ((t_0 (* PI (/ angle 180.0)))) (* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) (sin t_0)) (cos t_0))))
double code(double a, double b, double angle) {
double t_0 = ((double) M_PI) * (angle / 180.0);
return ((2.0 * (pow(b, 2.0) - pow(a, 2.0))) * sin(t_0)) * cos(t_0);
}
public static double code(double a, double b, double angle) {
double t_0 = Math.PI * (angle / 180.0);
return ((2.0 * (Math.pow(b, 2.0) - Math.pow(a, 2.0))) * Math.sin(t_0)) * Math.cos(t_0);
}
def code(a, b, angle): t_0 = math.pi * (angle / 180.0) return ((2.0 * (math.pow(b, 2.0) - math.pow(a, 2.0))) * math.sin(t_0)) * math.cos(t_0)
function code(a, b, angle) t_0 = Float64(pi * Float64(angle / 180.0)) return Float64(Float64(Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))) * sin(t_0)) * cos(t_0)) end
function tmp = code(a, b, angle) t_0 = pi * (angle / 180.0); tmp = ((2.0 * ((b ^ 2.0) - (a ^ 2.0))) * sin(t_0)) * cos(t_0); end
code[a_, b_, angle_] := Block[{t$95$0 = N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \pi \cdot \frac{angle}{180}\\
\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin t_0\right) \cdot \cos t_0
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (a b angle) :precision binary64 (let* ((t_0 (* PI (/ angle 180.0)))) (* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) (sin t_0)) (cos t_0))))
double code(double a, double b, double angle) {
double t_0 = ((double) M_PI) * (angle / 180.0);
return ((2.0 * (pow(b, 2.0) - pow(a, 2.0))) * sin(t_0)) * cos(t_0);
}
public static double code(double a, double b, double angle) {
double t_0 = Math.PI * (angle / 180.0);
return ((2.0 * (Math.pow(b, 2.0) - Math.pow(a, 2.0))) * Math.sin(t_0)) * Math.cos(t_0);
}
def code(a, b, angle): t_0 = math.pi * (angle / 180.0) return ((2.0 * (math.pow(b, 2.0) - math.pow(a, 2.0))) * math.sin(t_0)) * math.cos(t_0)
function code(a, b, angle) t_0 = Float64(pi * Float64(angle / 180.0)) return Float64(Float64(Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))) * sin(t_0)) * cos(t_0)) end
function tmp = code(a, b, angle) t_0 = pi * (angle / 180.0); tmp = ((2.0 * ((b ^ 2.0) - (a ^ 2.0))) * sin(t_0)) * cos(t_0); end
code[a_, b_, angle_] := Block[{t$95$0 = N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \pi \cdot \frac{angle}{180}\\
\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin t_0\right) \cdot \cos t_0
\end{array}
\end{array}
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(let* ((t_0 (* PI (* 0.005555555555555556 angle_m)))
(t_1 (* (* (- b a) (+ b a)) (sin t_0))))
(*
angle_s
(if (<= (pow a 2.0) 2e-194)
(* 2.0 (* t_1 (cos (expm1 (log1p t_0)))))
(* 2.0 (* t_1 (cos (* 0.005555555555555556 (* angle_m PI)))))))))angle_m = fabs(angle);
angle_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double t_0 = ((double) M_PI) * (0.005555555555555556 * angle_m);
double t_1 = ((b - a) * (b + a)) * sin(t_0);
double tmp;
if (pow(a, 2.0) <= 2e-194) {
tmp = 2.0 * (t_1 * cos(expm1(log1p(t_0))));
} else {
tmp = 2.0 * (t_1 * cos((0.005555555555555556 * (angle_m * ((double) M_PI)))));
}
return angle_s * tmp;
}
angle_m = Math.abs(angle);
angle_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
double t_0 = Math.PI * (0.005555555555555556 * angle_m);
double t_1 = ((b - a) * (b + a)) * Math.sin(t_0);
double tmp;
if (Math.pow(a, 2.0) <= 2e-194) {
tmp = 2.0 * (t_1 * Math.cos(Math.expm1(Math.log1p(t_0))));
} else {
tmp = 2.0 * (t_1 * Math.cos((0.005555555555555556 * (angle_m * Math.PI))));
}
return angle_s * tmp;
}
angle_m = math.fabs(angle) angle_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): t_0 = math.pi * (0.005555555555555556 * angle_m) t_1 = ((b - a) * (b + a)) * math.sin(t_0) tmp = 0 if math.pow(a, 2.0) <= 2e-194: tmp = 2.0 * (t_1 * math.cos(math.expm1(math.log1p(t_0)))) else: tmp = 2.0 * (t_1 * math.cos((0.005555555555555556 * (angle_m * math.pi)))) return angle_s * tmp
angle_m = abs(angle) angle_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) t_0 = Float64(pi * Float64(0.005555555555555556 * angle_m)) t_1 = Float64(Float64(Float64(b - a) * Float64(b + a)) * sin(t_0)) tmp = 0.0 if ((a ^ 2.0) <= 2e-194) tmp = Float64(2.0 * Float64(t_1 * cos(expm1(log1p(t_0))))); else tmp = Float64(2.0 * Float64(t_1 * cos(Float64(0.005555555555555556 * Float64(angle_m * pi))))); end return Float64(angle_s * tmp) end
angle_m = N[Abs[angle], $MachinePrecision]
angle_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[(Pi * N[(0.005555555555555556 * angle$95$m), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(b - a), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[Power[a, 2.0], $MachinePrecision], 2e-194], N[(2.0 * N[(t$95$1 * N[Cos[N[(Exp[N[Log[1 + t$95$0], $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(t$95$1 * N[Cos[N[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
angle_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \pi \cdot \left(0.005555555555555556 \cdot angle_m\right)\\
t_1 := \left(\left(b - a\right) \cdot \left(b + a\right)\right) \cdot \sin t_0\\
angle_s \cdot \begin{array}{l}
\mathbf{if}\;{a}^{2} \leq 2 \cdot 10^{-194}:\\
\;\;\;\;2 \cdot \left(t_1 \cdot \cos \left(\mathsf{expm1}\left(\mathsf{log1p}\left(t_0\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(t_1 \cdot \cos \left(0.005555555555555556 \cdot \left(angle_m \cdot \pi\right)\right)\right)\\
\end{array}
\end{array}
\end{array}
if (pow.f64 a 2) < 2.00000000000000004e-194Initial program 56.1%
associate-*l*56.1%
associate-*l*56.1%
Simplified56.1%
unpow256.1%
unpow256.1%
difference-of-squares56.1%
Applied egg-rr56.1%
Taylor expanded in angle around inf 55.0%
*-commutative55.0%
+-commutative55.0%
associate-*r*56.2%
*-commutative56.2%
*-commutative56.2%
*-commutative56.2%
+-commutative56.2%
*-commutative56.2%
Simplified56.2%
div-inv56.5%
metadata-eval56.5%
expm1-log1p-u44.6%
Applied egg-rr44.6%
if 2.00000000000000004e-194 < (pow.f64 a 2) Initial program 48.1%
associate-*l*48.1%
associate-*l*48.1%
Simplified48.1%
unpow248.1%
unpow248.1%
difference-of-squares56.6%
Applied egg-rr56.6%
Taylor expanded in angle around inf 56.3%
*-commutative56.3%
+-commutative56.3%
associate-*r*56.0%
*-commutative56.0%
*-commutative56.0%
*-commutative56.0%
+-commutative56.0%
*-commutative56.0%
Simplified56.0%
Taylor expanded in angle around inf 59.9%
Final simplification54.7%
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(let* ((t_0 (* PI (/ angle_m 180.0))) (t_1 (* (- b a) (+ b a))))
(*
angle_s
(if (<=
(* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) (sin t_0)) (cos t_0))
2e+93)
(*
2.0
(*
(* t_1 (sin (* PI (* 0.005555555555555556 angle_m))))
(cos (/ PI (/ 180.0 angle_m)))))
(* 2.0 (* t_1 (sin (* (/ angle_m 180.0) (pow (sqrt PI) 2.0)))))))))angle_m = fabs(angle);
angle_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double t_0 = ((double) M_PI) * (angle_m / 180.0);
double t_1 = (b - a) * (b + a);
double tmp;
if ((((2.0 * (pow(b, 2.0) - pow(a, 2.0))) * sin(t_0)) * cos(t_0)) <= 2e+93) {
tmp = 2.0 * ((t_1 * sin((((double) M_PI) * (0.005555555555555556 * angle_m)))) * cos((((double) M_PI) / (180.0 / angle_m))));
} else {
tmp = 2.0 * (t_1 * sin(((angle_m / 180.0) * pow(sqrt(((double) M_PI)), 2.0))));
}
return angle_s * tmp;
}
angle_m = Math.abs(angle);
angle_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
double t_0 = Math.PI * (angle_m / 180.0);
double t_1 = (b - a) * (b + a);
double tmp;
if ((((2.0 * (Math.pow(b, 2.0) - Math.pow(a, 2.0))) * Math.sin(t_0)) * Math.cos(t_0)) <= 2e+93) {
tmp = 2.0 * ((t_1 * Math.sin((Math.PI * (0.005555555555555556 * angle_m)))) * Math.cos((Math.PI / (180.0 / angle_m))));
} else {
tmp = 2.0 * (t_1 * Math.sin(((angle_m / 180.0) * Math.pow(Math.sqrt(Math.PI), 2.0))));
}
return angle_s * tmp;
}
angle_m = math.fabs(angle) angle_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): t_0 = math.pi * (angle_m / 180.0) t_1 = (b - a) * (b + a) tmp = 0 if (((2.0 * (math.pow(b, 2.0) - math.pow(a, 2.0))) * math.sin(t_0)) * math.cos(t_0)) <= 2e+93: tmp = 2.0 * ((t_1 * math.sin((math.pi * (0.005555555555555556 * angle_m)))) * math.cos((math.pi / (180.0 / angle_m)))) else: tmp = 2.0 * (t_1 * math.sin(((angle_m / 180.0) * math.pow(math.sqrt(math.pi), 2.0)))) return angle_s * tmp
angle_m = abs(angle) angle_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) t_0 = Float64(pi * Float64(angle_m / 180.0)) t_1 = Float64(Float64(b - a) * Float64(b + a)) tmp = 0.0 if (Float64(Float64(Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))) * sin(t_0)) * cos(t_0)) <= 2e+93) tmp = Float64(2.0 * Float64(Float64(t_1 * sin(Float64(pi * Float64(0.005555555555555556 * angle_m)))) * cos(Float64(pi / Float64(180.0 / angle_m))))); else tmp = Float64(2.0 * Float64(t_1 * sin(Float64(Float64(angle_m / 180.0) * (sqrt(pi) ^ 2.0))))); end return Float64(angle_s * tmp) end
angle_m = abs(angle); angle_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b, angle_m) t_0 = pi * (angle_m / 180.0); t_1 = (b - a) * (b + a); tmp = 0.0; if ((((2.0 * ((b ^ 2.0) - (a ^ 2.0))) * sin(t_0)) * cos(t_0)) <= 2e+93) tmp = 2.0 * ((t_1 * sin((pi * (0.005555555555555556 * angle_m)))) * cos((pi / (180.0 / angle_m)))); else tmp = 2.0 * (t_1 * sin(((angle_m / 180.0) * (sqrt(pi) ^ 2.0)))); end tmp_2 = angle_s * tmp; end
angle_m = N[Abs[angle], $MachinePrecision]
angle_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(b - a), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(N[(N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision], 2e+93], N[(2.0 * N[(N[(t$95$1 * N[Sin[N[(Pi * N[(0.005555555555555556 * angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Cos[N[(Pi / N[(180.0 / angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(t$95$1 * N[Sin[N[(N[(angle$95$m / 180.0), $MachinePrecision] * N[Power[N[Sqrt[Pi], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
angle_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \pi \cdot \frac{angle_m}{180}\\
t_1 := \left(b - a\right) \cdot \left(b + a\right)\\
angle_s \cdot \begin{array}{l}
\mathbf{if}\;\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin t_0\right) \cdot \cos t_0 \leq 2 \cdot 10^{+93}:\\
\;\;\;\;2 \cdot \left(\left(t_1 \cdot \sin \left(\pi \cdot \left(0.005555555555555556 \cdot angle_m\right)\right)\right) \cdot \cos \left(\frac{\pi}{\frac{180}{angle_m}}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(t_1 \cdot \sin \left(\frac{angle_m}{180} \cdot {\left(\sqrt{\pi}\right)}^{2}\right)\right)\\
\end{array}
\end{array}
\end{array}
if (*.f64 (*.f64 (*.f64 2 (-.f64 (pow.f64 b 2) (pow.f64 a 2))) (sin.f64 (*.f64 (PI.f64) (/.f64 angle 180)))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle 180)))) < 2.00000000000000009e93Initial program 58.1%
associate-*l*58.1%
associate-*l*58.1%
Simplified58.1%
unpow258.1%
unpow258.1%
difference-of-squares58.1%
Applied egg-rr58.1%
Taylor expanded in angle around inf 57.0%
*-commutative57.0%
+-commutative57.0%
associate-*r*57.6%
*-commutative57.6%
*-commutative57.6%
*-commutative57.6%
+-commutative57.6%
*-commutative57.6%
Simplified57.6%
clear-num55.6%
un-div-inv56.3%
Applied egg-rr58.8%
if 2.00000000000000009e93 < (*.f64 (*.f64 (*.f64 2 (-.f64 (pow.f64 b 2) (pow.f64 a 2))) (sin.f64 (*.f64 (PI.f64) (/.f64 angle 180)))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle 180)))) Initial program 39.3%
associate-*l*39.3%
associate-*l*39.3%
Simplified39.3%
unpow239.3%
unpow239.3%
difference-of-squares53.8%
Applied egg-rr53.8%
Taylor expanded in angle around 0 52.9%
add-sqr-sqrt50.4%
pow250.4%
Applied egg-rr50.4%
Final simplification55.6%
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(*
angle_s
(*
2.0
(*
(* (* (- b a) (+ b a)) (sin (* 0.005555555555555556 (* angle_m PI))))
(cos (pow (cbrt (* PI (* 0.005555555555555556 angle_m))) 3.0))))))angle_m = fabs(angle);
angle_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
return angle_s * (2.0 * ((((b - a) * (b + a)) * sin((0.005555555555555556 * (angle_m * ((double) M_PI))))) * cos(pow(cbrt((((double) M_PI) * (0.005555555555555556 * angle_m))), 3.0))));
}
angle_m = Math.abs(angle);
angle_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
return angle_s * (2.0 * ((((b - a) * (b + a)) * Math.sin((0.005555555555555556 * (angle_m * Math.PI)))) * Math.cos(Math.pow(Math.cbrt((Math.PI * (0.005555555555555556 * angle_m))), 3.0))));
}
angle_m = abs(angle) angle_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) return Float64(angle_s * Float64(2.0 * Float64(Float64(Float64(Float64(b - a) * Float64(b + a)) * sin(Float64(0.005555555555555556 * Float64(angle_m * pi)))) * cos((cbrt(Float64(pi * Float64(0.005555555555555556 * angle_m))) ^ 3.0))))) end
angle_m = N[Abs[angle], $MachinePrecision]
angle_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * N[(2.0 * N[(N[(N[(N[(b - a), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Cos[N[Power[N[Power[N[(Pi * N[(0.005555555555555556 * angle$95$m), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|
\\
angle_s = \mathsf{copysign}\left(1, angle\right)
\\
angle_s \cdot \left(2 \cdot \left(\left(\left(\left(b - a\right) \cdot \left(b + a\right)\right) \cdot \sin \left(0.005555555555555556 \cdot \left(angle_m \cdot \pi\right)\right)\right) \cdot \cos \left({\left(\sqrt[3]{\pi \cdot \left(0.005555555555555556 \cdot angle_m\right)}\right)}^{3}\right)\right)\right)
\end{array}
Initial program 50.8%
associate-*l*50.8%
associate-*l*50.8%
Simplified50.8%
unpow250.8%
unpow250.8%
difference-of-squares56.4%
Applied egg-rr56.4%
add-cbrt-cube57.4%
pow357.4%
Applied egg-rr57.4%
add-cube-cbrt53.4%
pow354.0%
div-inv55.1%
metadata-eval55.1%
*-commutative55.1%
*-commutative55.1%
Applied egg-rr55.1%
Taylor expanded in angle around inf 58.7%
Final simplification58.7%
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(let* ((t_0 (* (- b a) (+ b a))))
(*
angle_s
(if (<= (pow a 2.0) 5e+262)
(*
2.0
(*
(* t_0 (sin (* 0.005555555555555556 (* angle_m PI))))
(cos (* PI (/ angle_m 180.0)))))
(* (* angle_m 0.011111111111111112) (* t_0 PI))))))angle_m = fabs(angle);
angle_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double t_0 = (b - a) * (b + a);
double tmp;
if (pow(a, 2.0) <= 5e+262) {
tmp = 2.0 * ((t_0 * sin((0.005555555555555556 * (angle_m * ((double) M_PI))))) * cos((((double) M_PI) * (angle_m / 180.0))));
} else {
tmp = (angle_m * 0.011111111111111112) * (t_0 * ((double) M_PI));
}
return angle_s * tmp;
}
angle_m = Math.abs(angle);
angle_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
double t_0 = (b - a) * (b + a);
double tmp;
if (Math.pow(a, 2.0) <= 5e+262) {
tmp = 2.0 * ((t_0 * Math.sin((0.005555555555555556 * (angle_m * Math.PI)))) * Math.cos((Math.PI * (angle_m / 180.0))));
} else {
tmp = (angle_m * 0.011111111111111112) * (t_0 * Math.PI);
}
return angle_s * tmp;
}
angle_m = math.fabs(angle) angle_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): t_0 = (b - a) * (b + a) tmp = 0 if math.pow(a, 2.0) <= 5e+262: tmp = 2.0 * ((t_0 * math.sin((0.005555555555555556 * (angle_m * math.pi)))) * math.cos((math.pi * (angle_m / 180.0)))) else: tmp = (angle_m * 0.011111111111111112) * (t_0 * math.pi) return angle_s * tmp
angle_m = abs(angle) angle_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) t_0 = Float64(Float64(b - a) * Float64(b + a)) tmp = 0.0 if ((a ^ 2.0) <= 5e+262) tmp = Float64(2.0 * Float64(Float64(t_0 * sin(Float64(0.005555555555555556 * Float64(angle_m * pi)))) * cos(Float64(pi * Float64(angle_m / 180.0))))); else tmp = Float64(Float64(angle_m * 0.011111111111111112) * Float64(t_0 * pi)); end return Float64(angle_s * tmp) end
angle_m = abs(angle); angle_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b, angle_m) t_0 = (b - a) * (b + a); tmp = 0.0; if ((a ^ 2.0) <= 5e+262) tmp = 2.0 * ((t_0 * sin((0.005555555555555556 * (angle_m * pi)))) * cos((pi * (angle_m / 180.0)))); else tmp = (angle_m * 0.011111111111111112) * (t_0 * pi); end tmp_2 = angle_s * tmp; end
angle_m = N[Abs[angle], $MachinePrecision]
angle_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[(N[(b - a), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[Power[a, 2.0], $MachinePrecision], 5e+262], N[(2.0 * N[(N[(t$95$0 * N[Sin[N[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Cos[N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(angle$95$m * 0.011111111111111112), $MachinePrecision] * N[(t$95$0 * Pi), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
angle_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \left(b - a\right) \cdot \left(b + a\right)\\
angle_s \cdot \begin{array}{l}
\mathbf{if}\;{a}^{2} \leq 5 \cdot 10^{+262}:\\
\;\;\;\;2 \cdot \left(\left(t_0 \cdot \sin \left(0.005555555555555556 \cdot \left(angle_m \cdot \pi\right)\right)\right) \cdot \cos \left(\pi \cdot \frac{angle_m}{180}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(angle_m \cdot 0.011111111111111112\right) \cdot \left(t_0 \cdot \pi\right)\\
\end{array}
\end{array}
\end{array}
if (pow.f64 a 2) < 5.00000000000000008e262Initial program 56.4%
associate-*l*56.4%
associate-*l*56.4%
Simplified56.4%
unpow256.4%
unpow256.4%
difference-of-squares56.4%
Applied egg-rr56.4%
Taylor expanded in angle around inf 56.2%
if 5.00000000000000008e262 < (pow.f64 a 2) Initial program 37.8%
associate-*l*37.8%
associate-*l*37.8%
Simplified37.8%
unpow237.8%
unpow237.8%
difference-of-squares56.4%
Applied egg-rr56.4%
Taylor expanded in angle around 0 59.0%
Taylor expanded in angle around 0 61.4%
Taylor expanded in angle around 0 61.4%
associate-*r*61.4%
Simplified61.4%
Final simplification57.8%
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(let* ((t_0 (* (- b a) (+ b a))))
(*
angle_s
(if (<= (pow a 2.0) 5e+262)
(*
2.0
(*
(cos (* PI (/ angle_m 180.0)))
(* t_0 (sin (* angle_m (* 0.005555555555555556 PI))))))
(* (* angle_m 0.011111111111111112) (* t_0 PI))))))angle_m = fabs(angle);
angle_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double t_0 = (b - a) * (b + a);
double tmp;
if (pow(a, 2.0) <= 5e+262) {
tmp = 2.0 * (cos((((double) M_PI) * (angle_m / 180.0))) * (t_0 * sin((angle_m * (0.005555555555555556 * ((double) M_PI))))));
} else {
tmp = (angle_m * 0.011111111111111112) * (t_0 * ((double) M_PI));
}
return angle_s * tmp;
}
angle_m = Math.abs(angle);
angle_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
double t_0 = (b - a) * (b + a);
double tmp;
if (Math.pow(a, 2.0) <= 5e+262) {
tmp = 2.0 * (Math.cos((Math.PI * (angle_m / 180.0))) * (t_0 * Math.sin((angle_m * (0.005555555555555556 * Math.PI)))));
} else {
tmp = (angle_m * 0.011111111111111112) * (t_0 * Math.PI);
}
return angle_s * tmp;
}
angle_m = math.fabs(angle) angle_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): t_0 = (b - a) * (b + a) tmp = 0 if math.pow(a, 2.0) <= 5e+262: tmp = 2.0 * (math.cos((math.pi * (angle_m / 180.0))) * (t_0 * math.sin((angle_m * (0.005555555555555556 * math.pi))))) else: tmp = (angle_m * 0.011111111111111112) * (t_0 * math.pi) return angle_s * tmp
angle_m = abs(angle) angle_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) t_0 = Float64(Float64(b - a) * Float64(b + a)) tmp = 0.0 if ((a ^ 2.0) <= 5e+262) tmp = Float64(2.0 * Float64(cos(Float64(pi * Float64(angle_m / 180.0))) * Float64(t_0 * sin(Float64(angle_m * Float64(0.005555555555555556 * pi)))))); else tmp = Float64(Float64(angle_m * 0.011111111111111112) * Float64(t_0 * pi)); end return Float64(angle_s * tmp) end
angle_m = abs(angle); angle_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b, angle_m) t_0 = (b - a) * (b + a); tmp = 0.0; if ((a ^ 2.0) <= 5e+262) tmp = 2.0 * (cos((pi * (angle_m / 180.0))) * (t_0 * sin((angle_m * (0.005555555555555556 * pi))))); else tmp = (angle_m * 0.011111111111111112) * (t_0 * pi); end tmp_2 = angle_s * tmp; end
angle_m = N[Abs[angle], $MachinePrecision]
angle_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[(N[(b - a), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[Power[a, 2.0], $MachinePrecision], 5e+262], N[(2.0 * N[(N[Cos[N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(t$95$0 * N[Sin[N[(angle$95$m * N[(0.005555555555555556 * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(angle$95$m * 0.011111111111111112), $MachinePrecision] * N[(t$95$0 * Pi), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
angle_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \left(b - a\right) \cdot \left(b + a\right)\\
angle_s \cdot \begin{array}{l}
\mathbf{if}\;{a}^{2} \leq 5 \cdot 10^{+262}:\\
\;\;\;\;2 \cdot \left(\cos \left(\pi \cdot \frac{angle_m}{180}\right) \cdot \left(t_0 \cdot \sin \left(angle_m \cdot \left(0.005555555555555556 \cdot \pi\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(angle_m \cdot 0.011111111111111112\right) \cdot \left(t_0 \cdot \pi\right)\\
\end{array}
\end{array}
\end{array}
if (pow.f64 a 2) < 5.00000000000000008e262Initial program 56.4%
associate-*l*56.4%
associate-*l*56.4%
Simplified56.4%
unpow256.4%
unpow256.4%
difference-of-squares56.4%
Applied egg-rr56.4%
Taylor expanded in angle around inf 56.2%
*-commutative56.2%
associate-*l*56.5%
Simplified56.5%
if 5.00000000000000008e262 < (pow.f64 a 2) Initial program 37.8%
associate-*l*37.8%
associate-*l*37.8%
Simplified37.8%
unpow237.8%
unpow237.8%
difference-of-squares56.4%
Applied egg-rr56.4%
Taylor expanded in angle around 0 59.0%
Taylor expanded in angle around 0 61.4%
Taylor expanded in angle around 0 61.4%
associate-*r*61.4%
Simplified61.4%
Final simplification58.0%
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(*
angle_s
(*
2.0
(*
(cos (* 0.005555555555555556 (* angle_m PI)))
(* (* (- b a) (+ b a)) (sin (* PI (/ angle_m 180.0))))))))angle_m = fabs(angle);
angle_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
return angle_s * (2.0 * (cos((0.005555555555555556 * (angle_m * ((double) M_PI)))) * (((b - a) * (b + a)) * sin((((double) M_PI) * (angle_m / 180.0))))));
}
angle_m = Math.abs(angle);
angle_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
return angle_s * (2.0 * (Math.cos((0.005555555555555556 * (angle_m * Math.PI))) * (((b - a) * (b + a)) * Math.sin((Math.PI * (angle_m / 180.0))))));
}
angle_m = math.fabs(angle) angle_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): return angle_s * (2.0 * (math.cos((0.005555555555555556 * (angle_m * math.pi))) * (((b - a) * (b + a)) * math.sin((math.pi * (angle_m / 180.0))))))
angle_m = abs(angle) angle_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) return Float64(angle_s * Float64(2.0 * Float64(cos(Float64(0.005555555555555556 * Float64(angle_m * pi))) * Float64(Float64(Float64(b - a) * Float64(b + a)) * sin(Float64(pi * Float64(angle_m / 180.0))))))) end
angle_m = abs(angle); angle_s = sign(angle) * abs(1.0); function tmp = code(angle_s, a, b, angle_m) tmp = angle_s * (2.0 * (cos((0.005555555555555556 * (angle_m * pi))) * (((b - a) * (b + a)) * sin((pi * (angle_m / 180.0)))))); end
angle_m = N[Abs[angle], $MachinePrecision]
angle_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * N[(2.0 * N[(N[Cos[N[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(N[(b - a), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|
\\
angle_s = \mathsf{copysign}\left(1, angle\right)
\\
angle_s \cdot \left(2 \cdot \left(\cos \left(0.005555555555555556 \cdot \left(angle_m \cdot \pi\right)\right) \cdot \left(\left(\left(b - a\right) \cdot \left(b + a\right)\right) \cdot \sin \left(\pi \cdot \frac{angle_m}{180}\right)\right)\right)\right)
\end{array}
Initial program 50.8%
associate-*l*50.8%
associate-*l*50.8%
Simplified50.8%
unpow250.8%
unpow250.8%
difference-of-squares56.4%
Applied egg-rr56.4%
Taylor expanded in angle around inf 56.6%
Final simplification56.6%
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(*
angle_s
(*
2.0
(*
(* (* (- b a) (+ b a)) (sin (* PI (/ angle_m 180.0))))
(cos (* angle_m (* 0.005555555555555556 PI)))))))angle_m = fabs(angle);
angle_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
return angle_s * (2.0 * ((((b - a) * (b + a)) * sin((((double) M_PI) * (angle_m / 180.0)))) * cos((angle_m * (0.005555555555555556 * ((double) M_PI))))));
}
angle_m = Math.abs(angle);
angle_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
return angle_s * (2.0 * ((((b - a) * (b + a)) * Math.sin((Math.PI * (angle_m / 180.0)))) * Math.cos((angle_m * (0.005555555555555556 * Math.PI)))));
}
angle_m = math.fabs(angle) angle_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): return angle_s * (2.0 * ((((b - a) * (b + a)) * math.sin((math.pi * (angle_m / 180.0)))) * math.cos((angle_m * (0.005555555555555556 * math.pi)))))
angle_m = abs(angle) angle_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) return Float64(angle_s * Float64(2.0 * Float64(Float64(Float64(Float64(b - a) * Float64(b + a)) * sin(Float64(pi * Float64(angle_m / 180.0)))) * cos(Float64(angle_m * Float64(0.005555555555555556 * pi)))))) end
angle_m = abs(angle); angle_s = sign(angle) * abs(1.0); function tmp = code(angle_s, a, b, angle_m) tmp = angle_s * (2.0 * ((((b - a) * (b + a)) * sin((pi * (angle_m / 180.0)))) * cos((angle_m * (0.005555555555555556 * pi))))); end
angle_m = N[Abs[angle], $MachinePrecision]
angle_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * N[(2.0 * N[(N[(N[(N[(b - a), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Cos[N[(angle$95$m * N[(0.005555555555555556 * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|
\\
angle_s = \mathsf{copysign}\left(1, angle\right)
\\
angle_s \cdot \left(2 \cdot \left(\left(\left(\left(b - a\right) \cdot \left(b + a\right)\right) \cdot \sin \left(\pi \cdot \frac{angle_m}{180}\right)\right) \cdot \cos \left(angle_m \cdot \left(0.005555555555555556 \cdot \pi\right)\right)\right)\right)
\end{array}
Initial program 50.8%
associate-*l*50.8%
associate-*l*50.8%
Simplified50.8%
unpow250.8%
unpow250.8%
difference-of-squares56.4%
Applied egg-rr56.4%
Taylor expanded in angle around inf 56.6%
*-commutative56.6%
associate-*l*56.9%
Simplified56.9%
Final simplification56.9%
angle_m = (fabs.f64 angle) angle_s = (copysign.f64 1 angle) (FPCore (angle_s a b angle_m) :precision binary64 (let* ((t_0 (* 0.005555555555555556 (* angle_m PI)))) (* angle_s (* 2.0 (* (* (* (- b a) (+ b a)) (sin t_0)) (cos t_0))))))
angle_m = fabs(angle);
angle_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double t_0 = 0.005555555555555556 * (angle_m * ((double) M_PI));
return angle_s * (2.0 * ((((b - a) * (b + a)) * sin(t_0)) * cos(t_0)));
}
angle_m = Math.abs(angle);
angle_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
double t_0 = 0.005555555555555556 * (angle_m * Math.PI);
return angle_s * (2.0 * ((((b - a) * (b + a)) * Math.sin(t_0)) * Math.cos(t_0)));
}
angle_m = math.fabs(angle) angle_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): t_0 = 0.005555555555555556 * (angle_m * math.pi) return angle_s * (2.0 * ((((b - a) * (b + a)) * math.sin(t_0)) * math.cos(t_0)))
angle_m = abs(angle) angle_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) t_0 = Float64(0.005555555555555556 * Float64(angle_m * pi)) return Float64(angle_s * Float64(2.0 * Float64(Float64(Float64(Float64(b - a) * Float64(b + a)) * sin(t_0)) * cos(t_0)))) end
angle_m = abs(angle); angle_s = sign(angle) * abs(1.0); function tmp = code(angle_s, a, b, angle_m) t_0 = 0.005555555555555556 * (angle_m * pi); tmp = angle_s * (2.0 * ((((b - a) * (b + a)) * sin(t_0)) * cos(t_0))); end
angle_m = N[Abs[angle], $MachinePrecision]
angle_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * N[(2.0 * N[(N[(N[(N[(b - a), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
angle_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := 0.005555555555555556 \cdot \left(angle_m \cdot \pi\right)\\
angle_s \cdot \left(2 \cdot \left(\left(\left(\left(b - a\right) \cdot \left(b + a\right)\right) \cdot \sin t_0\right) \cdot \cos t_0\right)\right)
\end{array}
\end{array}
Initial program 50.8%
associate-*l*50.8%
associate-*l*50.8%
Simplified50.8%
unpow250.8%
unpow250.8%
difference-of-squares56.4%
Applied egg-rr56.4%
Taylor expanded in angle around inf 55.8%
*-commutative55.8%
+-commutative55.8%
associate-*r*56.1%
*-commutative56.1%
*-commutative56.1%
*-commutative56.1%
+-commutative56.1%
*-commutative56.1%
Simplified56.1%
Taylor expanded in angle around inf 57.4%
Taylor expanded in angle around inf 57.5%
Final simplification57.5%
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(let* ((t_0 (* (- b a) (+ b a))))
(*
angle_s
(if (<= (/ angle_m 180.0) 4e+205)
(* 2.0 (* t_0 (* angle_m (* 0.005555555555555556 PI))))
(* 2.0 (* t_0 (sin (* 0.005555555555555556 (* angle_m PI)))))))))angle_m = fabs(angle);
angle_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double t_0 = (b - a) * (b + a);
double tmp;
if ((angle_m / 180.0) <= 4e+205) {
tmp = 2.0 * (t_0 * (angle_m * (0.005555555555555556 * ((double) M_PI))));
} else {
tmp = 2.0 * (t_0 * sin((0.005555555555555556 * (angle_m * ((double) M_PI)))));
}
return angle_s * tmp;
}
angle_m = Math.abs(angle);
angle_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
double t_0 = (b - a) * (b + a);
double tmp;
if ((angle_m / 180.0) <= 4e+205) {
tmp = 2.0 * (t_0 * (angle_m * (0.005555555555555556 * Math.PI)));
} else {
tmp = 2.0 * (t_0 * Math.sin((0.005555555555555556 * (angle_m * Math.PI))));
}
return angle_s * tmp;
}
angle_m = math.fabs(angle) angle_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): t_0 = (b - a) * (b + a) tmp = 0 if (angle_m / 180.0) <= 4e+205: tmp = 2.0 * (t_0 * (angle_m * (0.005555555555555556 * math.pi))) else: tmp = 2.0 * (t_0 * math.sin((0.005555555555555556 * (angle_m * math.pi)))) return angle_s * tmp
angle_m = abs(angle) angle_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) t_0 = Float64(Float64(b - a) * Float64(b + a)) tmp = 0.0 if (Float64(angle_m / 180.0) <= 4e+205) tmp = Float64(2.0 * Float64(t_0 * Float64(angle_m * Float64(0.005555555555555556 * pi)))); else tmp = Float64(2.0 * Float64(t_0 * sin(Float64(0.005555555555555556 * Float64(angle_m * pi))))); end return Float64(angle_s * tmp) end
angle_m = abs(angle); angle_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b, angle_m) t_0 = (b - a) * (b + a); tmp = 0.0; if ((angle_m / 180.0) <= 4e+205) tmp = 2.0 * (t_0 * (angle_m * (0.005555555555555556 * pi))); else tmp = 2.0 * (t_0 * sin((0.005555555555555556 * (angle_m * pi)))); end tmp_2 = angle_s * tmp; end
angle_m = N[Abs[angle], $MachinePrecision]
angle_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[(N[(b - a), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 4e+205], N[(2.0 * N[(t$95$0 * N[(angle$95$m * N[(0.005555555555555556 * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(t$95$0 * N[Sin[N[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
angle_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \left(b - a\right) \cdot \left(b + a\right)\\
angle_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle_m}{180} \leq 4 \cdot 10^{+205}:\\
\;\;\;\;2 \cdot \left(t_0 \cdot \left(angle_m \cdot \left(0.005555555555555556 \cdot \pi\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(t_0 \cdot \sin \left(0.005555555555555556 \cdot \left(angle_m \cdot \pi\right)\right)\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle 180) < 4.00000000000000007e205Initial program 51.5%
associate-*l*51.5%
associate-*l*51.5%
Simplified51.5%
unpow251.5%
unpow251.5%
difference-of-squares56.9%
Applied egg-rr56.9%
Taylor expanded in angle around 0 56.0%
Taylor expanded in angle around 0 56.2%
*-commutative56.2%
associate-*l*56.2%
Simplified56.2%
if 4.00000000000000007e205 < (/.f64 angle 180) Initial program 45.1%
associate-*l*45.1%
associate-*l*45.1%
Simplified45.1%
unpow245.1%
unpow245.1%
difference-of-squares52.2%
Applied egg-rr52.2%
Taylor expanded in angle around 0 37.3%
Taylor expanded in angle around inf 41.0%
Final simplification54.5%
angle_m = (fabs.f64 angle) angle_s = (copysign.f64 1 angle) (FPCore (angle_s a b angle_m) :precision binary64 (* angle_s (* 2.0 (* (* (- b a) (+ b a)) (sin (/ PI (/ 180.0 angle_m)))))))
angle_m = fabs(angle);
angle_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
return angle_s * (2.0 * (((b - a) * (b + a)) * sin((((double) M_PI) / (180.0 / angle_m)))));
}
angle_m = Math.abs(angle);
angle_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
return angle_s * (2.0 * (((b - a) * (b + a)) * Math.sin((Math.PI / (180.0 / angle_m)))));
}
angle_m = math.fabs(angle) angle_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): return angle_s * (2.0 * (((b - a) * (b + a)) * math.sin((math.pi / (180.0 / angle_m)))))
angle_m = abs(angle) angle_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) return Float64(angle_s * Float64(2.0 * Float64(Float64(Float64(b - a) * Float64(b + a)) * sin(Float64(pi / Float64(180.0 / angle_m)))))) end
angle_m = abs(angle); angle_s = sign(angle) * abs(1.0); function tmp = code(angle_s, a, b, angle_m) tmp = angle_s * (2.0 * (((b - a) * (b + a)) * sin((pi / (180.0 / angle_m))))); end
angle_m = N[Abs[angle], $MachinePrecision]
angle_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * N[(2.0 * N[(N[(N[(b - a), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(Pi / N[(180.0 / angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|
\\
angle_s = \mathsf{copysign}\left(1, angle\right)
\\
angle_s \cdot \left(2 \cdot \left(\left(\left(b - a\right) \cdot \left(b + a\right)\right) \cdot \sin \left(\frac{\pi}{\frac{180}{angle_m}}\right)\right)\right)
\end{array}
Initial program 50.8%
associate-*l*50.8%
associate-*l*50.8%
Simplified50.8%
unpow250.8%
unpow250.8%
difference-of-squares56.4%
Applied egg-rr56.4%
Taylor expanded in angle around 0 54.0%
clear-num55.1%
un-div-inv55.1%
Applied egg-rr55.1%
Final simplification55.1%
angle_m = (fabs.f64 angle) angle_s = (copysign.f64 1 angle) (FPCore (angle_s a b angle_m) :precision binary64 (* angle_s (* 2.0 (* (* (- b a) (+ b a)) (* 0.005555555555555556 (* angle_m PI))))))
angle_m = fabs(angle);
angle_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
return angle_s * (2.0 * (((b - a) * (b + a)) * (0.005555555555555556 * (angle_m * ((double) M_PI)))));
}
angle_m = Math.abs(angle);
angle_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
return angle_s * (2.0 * (((b - a) * (b + a)) * (0.005555555555555556 * (angle_m * Math.PI))));
}
angle_m = math.fabs(angle) angle_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): return angle_s * (2.0 * (((b - a) * (b + a)) * (0.005555555555555556 * (angle_m * math.pi))))
angle_m = abs(angle) angle_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) return Float64(angle_s * Float64(2.0 * Float64(Float64(Float64(b - a) * Float64(b + a)) * Float64(0.005555555555555556 * Float64(angle_m * pi))))) end
angle_m = abs(angle); angle_s = sign(angle) * abs(1.0); function tmp = code(angle_s, a, b, angle_m) tmp = angle_s * (2.0 * (((b - a) * (b + a)) * (0.005555555555555556 * (angle_m * pi)))); end
angle_m = N[Abs[angle], $MachinePrecision]
angle_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * N[(2.0 * N[(N[(N[(b - a), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|
\\
angle_s = \mathsf{copysign}\left(1, angle\right)
\\
angle_s \cdot \left(2 \cdot \left(\left(\left(b - a\right) \cdot \left(b + a\right)\right) \cdot \left(0.005555555555555556 \cdot \left(angle_m \cdot \pi\right)\right)\right)\right)
\end{array}
Initial program 50.8%
associate-*l*50.8%
associate-*l*50.8%
Simplified50.8%
unpow250.8%
unpow250.8%
difference-of-squares56.4%
Applied egg-rr56.4%
Taylor expanded in angle around 0 54.0%
Taylor expanded in angle around 0 53.4%
Final simplification53.4%
angle_m = (fabs.f64 angle) angle_s = (copysign.f64 1 angle) (FPCore (angle_s a b angle_m) :precision binary64 (* angle_s (* 2.0 (* (* (- b a) (+ b a)) (* angle_m (* 0.005555555555555556 PI))))))
angle_m = fabs(angle);
angle_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
return angle_s * (2.0 * (((b - a) * (b + a)) * (angle_m * (0.005555555555555556 * ((double) M_PI)))));
}
angle_m = Math.abs(angle);
angle_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
return angle_s * (2.0 * (((b - a) * (b + a)) * (angle_m * (0.005555555555555556 * Math.PI))));
}
angle_m = math.fabs(angle) angle_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): return angle_s * (2.0 * (((b - a) * (b + a)) * (angle_m * (0.005555555555555556 * math.pi))))
angle_m = abs(angle) angle_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) return Float64(angle_s * Float64(2.0 * Float64(Float64(Float64(b - a) * Float64(b + a)) * Float64(angle_m * Float64(0.005555555555555556 * pi))))) end
angle_m = abs(angle); angle_s = sign(angle) * abs(1.0); function tmp = code(angle_s, a, b, angle_m) tmp = angle_s * (2.0 * (((b - a) * (b + a)) * (angle_m * (0.005555555555555556 * pi)))); end
angle_m = N[Abs[angle], $MachinePrecision]
angle_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * N[(2.0 * N[(N[(N[(b - a), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[(angle$95$m * N[(0.005555555555555556 * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|
\\
angle_s = \mathsf{copysign}\left(1, angle\right)
\\
angle_s \cdot \left(2 \cdot \left(\left(\left(b - a\right) \cdot \left(b + a\right)\right) \cdot \left(angle_m \cdot \left(0.005555555555555556 \cdot \pi\right)\right)\right)\right)
\end{array}
Initial program 50.8%
associate-*l*50.8%
associate-*l*50.8%
Simplified50.8%
unpow250.8%
unpow250.8%
difference-of-squares56.4%
Applied egg-rr56.4%
Taylor expanded in angle around 0 54.0%
Taylor expanded in angle around 0 53.4%
*-commutative53.4%
associate-*l*53.4%
Simplified53.4%
Final simplification53.4%
angle_m = (fabs.f64 angle) angle_s = (copysign.f64 1 angle) (FPCore (angle_s a b angle_m) :precision binary64 (* angle_s (* 0.011111111111111112 (* angle_m (* (* (- b a) (+ b a)) PI)))))
angle_m = fabs(angle);
angle_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
return angle_s * (0.011111111111111112 * (angle_m * (((b - a) * (b + a)) * ((double) M_PI))));
}
angle_m = Math.abs(angle);
angle_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
return angle_s * (0.011111111111111112 * (angle_m * (((b - a) * (b + a)) * Math.PI)));
}
angle_m = math.fabs(angle) angle_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): return angle_s * (0.011111111111111112 * (angle_m * (((b - a) * (b + a)) * math.pi)))
angle_m = abs(angle) angle_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) return Float64(angle_s * Float64(0.011111111111111112 * Float64(angle_m * Float64(Float64(Float64(b - a) * Float64(b + a)) * pi)))) end
angle_m = abs(angle); angle_s = sign(angle) * abs(1.0); function tmp = code(angle_s, a, b, angle_m) tmp = angle_s * (0.011111111111111112 * (angle_m * (((b - a) * (b + a)) * pi))); end
angle_m = N[Abs[angle], $MachinePrecision]
angle_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * N[(0.011111111111111112 * N[(angle$95$m * N[(N[(N[(b - a), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|
\\
angle_s = \mathsf{copysign}\left(1, angle\right)
\\
angle_s \cdot \left(0.011111111111111112 \cdot \left(angle_m \cdot \left(\left(\left(b - a\right) \cdot \left(b + a\right)\right) \cdot \pi\right)\right)\right)
\end{array}
Initial program 50.8%
associate-*l*50.8%
associate-*l*50.8%
Simplified50.8%
unpow250.8%
unpow250.8%
difference-of-squares56.4%
Applied egg-rr56.4%
Taylor expanded in angle around 0 54.0%
Taylor expanded in angle around 0 53.3%
Taylor expanded in angle around 0 53.3%
Final simplification53.3%
angle_m = (fabs.f64 angle) angle_s = (copysign.f64 1 angle) (FPCore (angle_s a b angle_m) :precision binary64 (* angle_s (* (* angle_m 0.011111111111111112) (* (* (- b a) (+ b a)) PI))))
angle_m = fabs(angle);
angle_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
return angle_s * ((angle_m * 0.011111111111111112) * (((b - a) * (b + a)) * ((double) M_PI)));
}
angle_m = Math.abs(angle);
angle_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
return angle_s * ((angle_m * 0.011111111111111112) * (((b - a) * (b + a)) * Math.PI));
}
angle_m = math.fabs(angle) angle_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): return angle_s * ((angle_m * 0.011111111111111112) * (((b - a) * (b + a)) * math.pi))
angle_m = abs(angle) angle_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) return Float64(angle_s * Float64(Float64(angle_m * 0.011111111111111112) * Float64(Float64(Float64(b - a) * Float64(b + a)) * pi))) end
angle_m = abs(angle); angle_s = sign(angle) * abs(1.0); function tmp = code(angle_s, a, b, angle_m) tmp = angle_s * ((angle_m * 0.011111111111111112) * (((b - a) * (b + a)) * pi)); end
angle_m = N[Abs[angle], $MachinePrecision]
angle_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * N[(N[(angle$95$m * 0.011111111111111112), $MachinePrecision] * N[(N[(N[(b - a), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|
\\
angle_s = \mathsf{copysign}\left(1, angle\right)
\\
angle_s \cdot \left(\left(angle_m \cdot 0.011111111111111112\right) \cdot \left(\left(\left(b - a\right) \cdot \left(b + a\right)\right) \cdot \pi\right)\right)
\end{array}
Initial program 50.8%
associate-*l*50.8%
associate-*l*50.8%
Simplified50.8%
unpow250.8%
unpow250.8%
difference-of-squares56.4%
Applied egg-rr56.4%
Taylor expanded in angle around 0 54.0%
Taylor expanded in angle around 0 53.3%
Taylor expanded in angle around 0 53.3%
associate-*r*53.3%
Simplified53.3%
Final simplification53.3%
herbie shell --seed 2024017
(FPCore (a b angle)
:name "ab-angle->ABCF B"
:precision binary64
(* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) (sin (* PI (/ angle 180.0)))) (cos (* PI (/ angle 180.0)))))