
(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 10 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 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(let* ((t_0 (* angle_m (* PI 0.005555555555555556)))
(t_1 (cos t_0))
(t_2 (sin t_0))
(t_3 (* (- b a) (+ b a)))
(t_4 (cbrt (pow PI 3.0))))
(*
angle_s
(if (<= (/ angle_m 180.0) 3e-101)
(fma
a
(fma (* 2.0 t_1) (* t_2 0.0) (* (* a -2.0) (* t_1 t_2)))
(* 2.0 (* (* angle_m 0.005555555555555556) (* (pow b 2.0) PI))))
(if (<= (/ angle_m 180.0) 1e+259)
(*
t_3
(*
2.0
(*
(cos (* PI (/ angle_m 180.0)))
(sin (* 0.005555555555555556 (* PI angle_m))))))
(*
t_3
(*
2.0
(*
(sin (* 0.005555555555555556 (* angle_m t_4)))
(cos (* (/ angle_m 180.0) t_4))))))))))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 = angle_m * (((double) M_PI) * 0.005555555555555556);
double t_1 = cos(t_0);
double t_2 = sin(t_0);
double t_3 = (b - a) * (b + a);
double t_4 = cbrt(pow(((double) M_PI), 3.0));
double tmp;
if ((angle_m / 180.0) <= 3e-101) {
tmp = fma(a, fma((2.0 * t_1), (t_2 * 0.0), ((a * -2.0) * (t_1 * t_2))), (2.0 * ((angle_m * 0.005555555555555556) * (pow(b, 2.0) * ((double) M_PI)))));
} else if ((angle_m / 180.0) <= 1e+259) {
tmp = t_3 * (2.0 * (cos((((double) M_PI) * (angle_m / 180.0))) * sin((0.005555555555555556 * (((double) M_PI) * angle_m)))));
} else {
tmp = t_3 * (2.0 * (sin((0.005555555555555556 * (angle_m * t_4))) * cos(((angle_m / 180.0) * t_4))));
}
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(angle_m * Float64(pi * 0.005555555555555556)) t_1 = cos(t_0) t_2 = sin(t_0) t_3 = Float64(Float64(b - a) * Float64(b + a)) t_4 = cbrt((pi ^ 3.0)) tmp = 0.0 if (Float64(angle_m / 180.0) <= 3e-101) tmp = fma(a, fma(Float64(2.0 * t_1), Float64(t_2 * 0.0), Float64(Float64(a * -2.0) * Float64(t_1 * t_2))), Float64(2.0 * Float64(Float64(angle_m * 0.005555555555555556) * Float64((b ^ 2.0) * pi)))); elseif (Float64(angle_m / 180.0) <= 1e+259) tmp = Float64(t_3 * Float64(2.0 * Float64(cos(Float64(pi * Float64(angle_m / 180.0))) * sin(Float64(0.005555555555555556 * Float64(pi * angle_m)))))); else tmp = Float64(t_3 * Float64(2.0 * Float64(sin(Float64(0.005555555555555556 * Float64(angle_m * t_4))) * cos(Float64(Float64(angle_m / 180.0) * t_4))))); 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[(angle$95$m * N[(Pi * 0.005555555555555556), $MachinePrecision]), $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[(b - a), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[Power[N[Power[Pi, 3.0], $MachinePrecision], 1/3], $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 3e-101], N[(a * N[(N[(2.0 * t$95$1), $MachinePrecision] * N[(t$95$2 * 0.0), $MachinePrecision] + N[(N[(a * -2.0), $MachinePrecision] * N[(t$95$1 * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[(N[(angle$95$m * 0.005555555555555556), $MachinePrecision] * N[(N[Power[b, 2.0], $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e+259], N[(t$95$3 * N[(2.0 * N[(N[Cos[N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(0.005555555555555556 * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$3 * N[(2.0 * N[(N[Sin[N[(0.005555555555555556 * N[(angle$95$m * t$95$4), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(N[(angle$95$m / 180.0), $MachinePrecision] * t$95$4), $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 := angle\_m \cdot \left(\pi \cdot 0.005555555555555556\right)\\
t_1 := \cos t\_0\\
t_2 := \sin t\_0\\
t_3 := \left(b - a\right) \cdot \left(b + a\right)\\
t_4 := \sqrt[3]{{\pi}^{3}}\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 3 \cdot 10^{-101}:\\
\;\;\;\;\mathsf{fma}\left(a, \mathsf{fma}\left(2 \cdot t\_1, t\_2 \cdot 0, \left(a \cdot -2\right) \cdot \left(t\_1 \cdot t\_2\right)\right), 2 \cdot \left(\left(angle\_m \cdot 0.005555555555555556\right) \cdot \left({b}^{2} \cdot \pi\right)\right)\right)\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 10^{+259}:\\
\;\;\;\;t\_3 \cdot \left(2 \cdot \left(\cos \left(\pi \cdot \frac{angle\_m}{180}\right) \cdot \sin \left(0.005555555555555556 \cdot \left(\pi \cdot angle\_m\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_3 \cdot \left(2 \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle\_m \cdot t\_4\right)\right) \cdot \cos \left(\frac{angle\_m}{180} \cdot t\_4\right)\right)\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 3.0000000000000003e-101Initial program 56.7%
associate-*l*56.7%
*-commutative56.7%
associate-*l*56.7%
Simplified56.7%
Taylor expanded in angle around inf 58.2%
*-commutative58.2%
Simplified58.2%
unpow258.2%
unpow258.2%
difference-of-squares61.7%
Applied egg-rr61.7%
Taylor expanded in a around 0 65.5%
+-commutative65.5%
fma-define66.6%
Simplified65.2%
Taylor expanded in angle around 0 62.1%
associate-*r*62.1%
Simplified62.1%
if 3.0000000000000003e-101 < (/.f64 angle #s(literal 180 binary64)) < 9.999999999999999e258Initial program 47.2%
associate-*l*47.2%
*-commutative47.2%
associate-*l*47.2%
Simplified47.2%
Taylor expanded in angle around inf 54.7%
*-commutative54.7%
Simplified54.7%
unpow254.7%
unpow254.7%
difference-of-squares56.1%
Applied egg-rr56.1%
if 9.999999999999999e258 < (/.f64 angle #s(literal 180 binary64)) Initial program 38.4%
associate-*l*38.4%
*-commutative38.4%
associate-*l*38.4%
Simplified38.4%
Taylor expanded in angle around inf 28.3%
*-commutative28.3%
Simplified28.3%
unpow228.3%
unpow228.3%
difference-of-squares28.3%
Applied egg-rr28.3%
add-cbrt-cube42.3%
pow342.3%
Applied egg-rr42.3%
add-cbrt-cube42.3%
pow342.3%
Applied egg-rr53.5%
Final simplification60.1%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(let* ((t_0 (* PI (/ angle_m 180.0)))
(t_1 (cbrt (pow PI 3.0)))
(t_2 (* angle_m (* PI 0.005555555555555556)))
(t_3 (sin t_2))
(t_4 (cos t_2)))
(*
angle_s
(if (<=
(* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) (sin t_0)) (cos t_0))
-2e+238)
(fma
a
(fma (* 2.0 t_4) (* t_3 0.0) (* (* a -2.0) (* t_4 t_3)))
(*
2.0
(* (pow b 2.0) (* t_4 (sin (* PI (* angle_m 0.005555555555555556)))))))
(*
(* (- b a) (+ b a))
(*
2.0
(*
(sin (* 0.005555555555555556 (* angle_m t_1)))
(cos (* (/ angle_m 180.0) t_1)))))))))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 = cbrt(pow(((double) M_PI), 3.0));
double t_2 = angle_m * (((double) M_PI) * 0.005555555555555556);
double t_3 = sin(t_2);
double t_4 = cos(t_2);
double tmp;
if ((((2.0 * (pow(b, 2.0) - pow(a, 2.0))) * sin(t_0)) * cos(t_0)) <= -2e+238) {
tmp = fma(a, fma((2.0 * t_4), (t_3 * 0.0), ((a * -2.0) * (t_4 * t_3))), (2.0 * (pow(b, 2.0) * (t_4 * sin((((double) M_PI) * (angle_m * 0.005555555555555556)))))));
} else {
tmp = ((b - a) * (b + a)) * (2.0 * (sin((0.005555555555555556 * (angle_m * t_1))) * cos(((angle_m / 180.0) * t_1))));
}
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 = cbrt((pi ^ 3.0)) t_2 = Float64(angle_m * Float64(pi * 0.005555555555555556)) t_3 = sin(t_2) t_4 = cos(t_2) tmp = 0.0 if (Float64(Float64(Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))) * sin(t_0)) * cos(t_0)) <= -2e+238) tmp = fma(a, fma(Float64(2.0 * t_4), Float64(t_3 * 0.0), Float64(Float64(a * -2.0) * Float64(t_4 * t_3))), Float64(2.0 * Float64((b ^ 2.0) * Float64(t_4 * sin(Float64(pi * Float64(angle_m * 0.005555555555555556))))))); else tmp = Float64(Float64(Float64(b - a) * Float64(b + a)) * Float64(2.0 * Float64(sin(Float64(0.005555555555555556 * Float64(angle_m * t_1))) * cos(Float64(Float64(angle_m / 180.0) * t_1))))); 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[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Power[N[Power[Pi, 3.0], $MachinePrecision], 1/3], $MachinePrecision]}, Block[{t$95$2 = N[(angle$95$m * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Sin[t$95$2], $MachinePrecision]}, Block[{t$95$4 = N[Cos[t$95$2], $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+238], N[(a * N[(N[(2.0 * t$95$4), $MachinePrecision] * N[(t$95$3 * 0.0), $MachinePrecision] + N[(N[(a * -2.0), $MachinePrecision] * N[(t$95$4 * t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] * N[(t$95$4 * N[Sin[N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b - a), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[(N[Sin[N[(0.005555555555555556 * N[(angle$95$m * t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(N[(angle$95$m / 180.0), $MachinePrecision] * t$95$1), $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 := \sqrt[3]{{\pi}^{3}}\\
t_2 := angle\_m \cdot \left(\pi \cdot 0.005555555555555556\right)\\
t_3 := \sin t\_2\\
t_4 := \cos t\_2\\
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^{+238}:\\
\;\;\;\;\mathsf{fma}\left(a, \mathsf{fma}\left(2 \cdot t\_4, t\_3 \cdot 0, \left(a \cdot -2\right) \cdot \left(t\_4 \cdot t\_3\right)\right), 2 \cdot \left({b}^{2} \cdot \left(t\_4 \cdot \sin \left(\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(b - a\right) \cdot \left(b + a\right)\right) \cdot \left(2 \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle\_m \cdot t\_1\right)\right) \cdot \cos \left(\frac{angle\_m}{180} \cdot t\_1\right)\right)\right)\\
\end{array}
\end{array}
\end{array}
if (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) (sin.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) < -2.0000000000000001e238Initial program 51.5%
associate-*l*51.6%
*-commutative51.6%
associate-*l*51.6%
Simplified51.6%
Taylor expanded in angle around inf 64.0%
*-commutative64.0%
Simplified64.0%
unpow264.0%
unpow264.0%
difference-of-squares64.0%
Applied egg-rr64.0%
Taylor expanded in a around 0 62.9%
+-commutative62.9%
fma-define62.9%
Simplified58.2%
*-commutative58.2%
associate-*l*60.6%
rem-cbrt-cube58.2%
*-un-lft-identity58.2%
rem-cbrt-cube60.6%
associate-*l*58.2%
*-commutative58.2%
associate-*r*63.3%
metadata-eval63.3%
div-inv63.3%
*-commutative63.3%
div-inv63.3%
metadata-eval63.3%
Applied egg-rr63.3%
if -2.0000000000000001e238 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) (sin.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) Initial program 53.9%
associate-*l*53.9%
*-commutative53.9%
associate-*l*53.9%
Simplified53.9%
Taylor expanded in angle around inf 54.8%
*-commutative54.8%
Simplified54.8%
unpow254.8%
unpow254.8%
difference-of-squares58.2%
Applied egg-rr58.2%
add-cbrt-cube56.9%
pow356.9%
Applied egg-rr56.9%
add-cbrt-cube56.9%
pow356.9%
Applied egg-rr59.8%
Final simplification60.4%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(let* ((t_0 (* angle_m (* PI 0.005555555555555556)))
(t_1 (sin t_0))
(t_2 (cos t_0))
(t_3 (* t_2 t_1))
(t_4 (* PI (/ angle_m 180.0)))
(t_5 (cbrt (pow PI 3.0))))
(*
angle_s
(if (<=
(* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) (sin t_4)) (cos t_4))
-2e-217)
(fma
a
(fma (* 2.0 t_2) (* t_1 0.0) (* (* a -2.0) t_3))
(* 2.0 (* (pow b 2.0) t_3)))
(*
(* (- b a) (+ b a))
(*
2.0
(*
(sin (* 0.005555555555555556 (* angle_m t_5)))
(cos (* (/ angle_m 180.0) t_5)))))))))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 = angle_m * (((double) M_PI) * 0.005555555555555556);
double t_1 = sin(t_0);
double t_2 = cos(t_0);
double t_3 = t_2 * t_1;
double t_4 = ((double) M_PI) * (angle_m / 180.0);
double t_5 = cbrt(pow(((double) M_PI), 3.0));
double tmp;
if ((((2.0 * (pow(b, 2.0) - pow(a, 2.0))) * sin(t_4)) * cos(t_4)) <= -2e-217) {
tmp = fma(a, fma((2.0 * t_2), (t_1 * 0.0), ((a * -2.0) * t_3)), (2.0 * (pow(b, 2.0) * t_3)));
} else {
tmp = ((b - a) * (b + a)) * (2.0 * (sin((0.005555555555555556 * (angle_m * t_5))) * cos(((angle_m / 180.0) * t_5))));
}
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(angle_m * Float64(pi * 0.005555555555555556)) t_1 = sin(t_0) t_2 = cos(t_0) t_3 = Float64(t_2 * t_1) t_4 = Float64(pi * Float64(angle_m / 180.0)) t_5 = cbrt((pi ^ 3.0)) tmp = 0.0 if (Float64(Float64(Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))) * sin(t_4)) * cos(t_4)) <= -2e-217) tmp = fma(a, fma(Float64(2.0 * t_2), Float64(t_1 * 0.0), Float64(Float64(a * -2.0) * t_3)), Float64(2.0 * Float64((b ^ 2.0) * t_3))); else tmp = Float64(Float64(Float64(b - a) * Float64(b + a)) * Float64(2.0 * Float64(sin(Float64(0.005555555555555556 * Float64(angle_m * t_5))) * cos(Float64(Float64(angle_m / 180.0) * t_5))))); 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[(angle$95$m * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sin[t$95$0], $MachinePrecision]}, Block[{t$95$2 = N[Cos[t$95$0], $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 * t$95$1), $MachinePrecision]}, Block[{t$95$4 = N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[Power[N[Power[Pi, 3.0], $MachinePrecision], 1/3], $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$4], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$4], $MachinePrecision]), $MachinePrecision], -2e-217], N[(a * N[(N[(2.0 * t$95$2), $MachinePrecision] * N[(t$95$1 * 0.0), $MachinePrecision] + N[(N[(a * -2.0), $MachinePrecision] * t$95$3), $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] * t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b - a), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[(N[Sin[N[(0.005555555555555556 * N[(angle$95$m * t$95$5), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(N[(angle$95$m / 180.0), $MachinePrecision] * t$95$5), $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 := angle\_m \cdot \left(\pi \cdot 0.005555555555555556\right)\\
t_1 := \sin t\_0\\
t_2 := \cos t\_0\\
t_3 := t\_2 \cdot t\_1\\
t_4 := \pi \cdot \frac{angle\_m}{180}\\
t_5 := \sqrt[3]{{\pi}^{3}}\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin t\_4\right) \cdot \cos t\_4 \leq -2 \cdot 10^{-217}:\\
\;\;\;\;\mathsf{fma}\left(a, \mathsf{fma}\left(2 \cdot t\_2, t\_1 \cdot 0, \left(a \cdot -2\right) \cdot t\_3\right), 2 \cdot \left({b}^{2} \cdot t\_3\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(b - a\right) \cdot \left(b + a\right)\right) \cdot \left(2 \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle\_m \cdot t\_5\right)\right) \cdot \cos \left(\frac{angle\_m}{180} \cdot t\_5\right)\right)\right)\\
\end{array}
\end{array}
\end{array}
if (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) (sin.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) < -2.00000000000000016e-217Initial program 52.3%
associate-*l*52.3%
*-commutative52.3%
associate-*l*52.3%
Simplified52.3%
Taylor expanded in angle around inf 58.5%
*-commutative58.5%
Simplified58.5%
unpow258.5%
unpow258.5%
difference-of-squares58.5%
Applied egg-rr58.5%
Taylor expanded in a around 0 57.8%
+-commutative57.8%
fma-define57.8%
Simplified55.4%
if -2.00000000000000016e-217 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) (sin.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) Initial program 54.1%
associate-*l*54.1%
*-commutative54.1%
associate-*l*54.1%
Simplified54.1%
Taylor expanded in angle around inf 55.2%
*-commutative55.2%
Simplified55.2%
unpow255.2%
unpow255.2%
difference-of-squares59.5%
Applied egg-rr59.5%
add-cbrt-cube58.3%
pow358.3%
Applied egg-rr58.3%
add-cbrt-cube58.3%
pow358.3%
Applied egg-rr61.4%
Final simplification59.3%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(let* ((t_0 (* (- b a) (+ b a))) (t_1 (cbrt (pow PI 3.0))))
(*
angle_s
(if (<= (/ angle_m 180.0) 5e-86)
(*
0.011111111111111112
(- (* angle_m (* (pow b 2.0) PI)) (* a (* PI (* a angle_m)))))
(if (<= (/ angle_m 180.0) 1e+259)
(*
t_0
(*
2.0
(*
(cos (* PI (/ angle_m 180.0)))
(sin (* 0.005555555555555556 (* PI angle_m))))))
(*
t_0
(*
2.0
(*
(sin (* 0.005555555555555556 (* angle_m t_1)))
(cos (* (/ angle_m 180.0) t_1))))))))))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 t_1 = cbrt(pow(((double) M_PI), 3.0));
double tmp;
if ((angle_m / 180.0) <= 5e-86) {
tmp = 0.011111111111111112 * ((angle_m * (pow(b, 2.0) * ((double) M_PI))) - (a * (((double) M_PI) * (a * angle_m))));
} else if ((angle_m / 180.0) <= 1e+259) {
tmp = t_0 * (2.0 * (cos((((double) M_PI) * (angle_m / 180.0))) * sin((0.005555555555555556 * (((double) M_PI) * angle_m)))));
} else {
tmp = t_0 * (2.0 * (sin((0.005555555555555556 * (angle_m * t_1))) * cos(((angle_m / 180.0) * t_1))));
}
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 t_1 = Math.cbrt(Math.pow(Math.PI, 3.0));
double tmp;
if ((angle_m / 180.0) <= 5e-86) {
tmp = 0.011111111111111112 * ((angle_m * (Math.pow(b, 2.0) * Math.PI)) - (a * (Math.PI * (a * angle_m))));
} else if ((angle_m / 180.0) <= 1e+259) {
tmp = t_0 * (2.0 * (Math.cos((Math.PI * (angle_m / 180.0))) * Math.sin((0.005555555555555556 * (Math.PI * angle_m)))));
} else {
tmp = t_0 * (2.0 * (Math.sin((0.005555555555555556 * (angle_m * t_1))) * Math.cos(((angle_m / 180.0) * t_1))));
}
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)) t_1 = cbrt((pi ^ 3.0)) tmp = 0.0 if (Float64(angle_m / 180.0) <= 5e-86) tmp = Float64(0.011111111111111112 * Float64(Float64(angle_m * Float64((b ^ 2.0) * pi)) - Float64(a * Float64(pi * Float64(a * angle_m))))); elseif (Float64(angle_m / 180.0) <= 1e+259) tmp = Float64(t_0 * Float64(2.0 * Float64(cos(Float64(pi * Float64(angle_m / 180.0))) * sin(Float64(0.005555555555555556 * Float64(pi * angle_m)))))); else tmp = Float64(t_0 * Float64(2.0 * Float64(sin(Float64(0.005555555555555556 * Float64(angle_m * t_1))) * cos(Float64(Float64(angle_m / 180.0) * t_1))))); 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[(N[(b - a), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Power[N[Power[Pi, 3.0], $MachinePrecision], 1/3], $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e-86], N[(0.011111111111111112 * N[(N[(angle$95$m * N[(N[Power[b, 2.0], $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision] - N[(a * N[(Pi * N[(a * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e+259], N[(t$95$0 * N[(2.0 * N[(N[Cos[N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(0.005555555555555556 * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(2.0 * N[(N[Sin[N[(0.005555555555555556 * N[(angle$95$m * t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(N[(angle$95$m / 180.0), $MachinePrecision] * t$95$1), $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)\\
t_1 := \sqrt[3]{{\pi}^{3}}\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{-86}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left({b}^{2} \cdot \pi\right) - a \cdot \left(\pi \cdot \left(a \cdot angle\_m\right)\right)\right)\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 10^{+259}:\\
\;\;\;\;t\_0 \cdot \left(2 \cdot \left(\cos \left(\pi \cdot \frac{angle\_m}{180}\right) \cdot \sin \left(0.005555555555555556 \cdot \left(\pi \cdot angle\_m\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \left(2 \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle\_m \cdot t\_1\right)\right) \cdot \cos \left(\frac{angle\_m}{180} \cdot t\_1\right)\right)\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 4.9999999999999999e-86Initial program 56.6%
associate-*l*56.6%
*-commutative56.6%
associate-*l*56.6%
Simplified56.6%
Taylor expanded in angle around 0 51.2%
unpow258.2%
unpow258.2%
difference-of-squares61.6%
Applied egg-rr54.6%
associate-*r*54.6%
sub-neg54.6%
distribute-lft-in51.1%
Applied egg-rr51.1%
Taylor expanded in a around 0 56.0%
+-commutative56.0%
+-commutative56.0%
distribute-rgt-in56.0%
*-commutative56.0%
mul-1-neg56.0%
distribute-lft-neg-out56.0%
unsub-neg56.0%
Simplified56.0%
if 4.9999999999999999e-86 < (/.f64 angle #s(literal 180 binary64)) < 9.999999999999999e258Initial program 47.0%
associate-*l*47.0%
*-commutative47.0%
associate-*l*47.0%
Simplified47.0%
Taylor expanded in angle around inf 54.7%
*-commutative54.7%
Simplified54.7%
unpow254.7%
unpow254.7%
difference-of-squares56.2%
Applied egg-rr56.2%
if 9.999999999999999e258 < (/.f64 angle #s(literal 180 binary64)) Initial program 38.4%
associate-*l*38.4%
*-commutative38.4%
associate-*l*38.4%
Simplified38.4%
Taylor expanded in angle around inf 28.3%
*-commutative28.3%
Simplified28.3%
unpow228.3%
unpow228.3%
difference-of-squares28.3%
Applied egg-rr28.3%
add-cbrt-cube42.3%
pow342.3%
Applied egg-rr42.3%
add-cbrt-cube42.3%
pow342.3%
Applied egg-rr53.5%
Final simplification56.0%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(*
angle_s
(if (<= (/ angle_m 180.0) 5e-86)
(*
0.011111111111111112
(- (* angle_m (* (pow b 2.0) PI)) (* a (* PI (* a angle_m)))))
(if (<= (/ angle_m 180.0) 1e+264)
(*
(* (- b a) (+ b a))
(*
2.0
(*
(cos (* PI (/ angle_m 180.0)))
(sin (* 0.005555555555555556 (* PI angle_m))))))
(*
2.0
(*
(sin (* angle_m (/ (* (cbrt PI) (pow (cbrt PI) 2.0)) -180.0)))
(* (+ b a) (- a b))))))))angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double tmp;
if ((angle_m / 180.0) <= 5e-86) {
tmp = 0.011111111111111112 * ((angle_m * (pow(b, 2.0) * ((double) M_PI))) - (a * (((double) M_PI) * (a * angle_m))));
} else if ((angle_m / 180.0) <= 1e+264) {
tmp = ((b - a) * (b + a)) * (2.0 * (cos((((double) M_PI) * (angle_m / 180.0))) * sin((0.005555555555555556 * (((double) M_PI) * angle_m)))));
} else {
tmp = 2.0 * (sin((angle_m * ((cbrt(((double) M_PI)) * pow(cbrt(((double) M_PI)), 2.0)) / -180.0))) * ((b + a) * (a - b)));
}
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 tmp;
if ((angle_m / 180.0) <= 5e-86) {
tmp = 0.011111111111111112 * ((angle_m * (Math.pow(b, 2.0) * Math.PI)) - (a * (Math.PI * (a * angle_m))));
} else if ((angle_m / 180.0) <= 1e+264) {
tmp = ((b - a) * (b + a)) * (2.0 * (Math.cos((Math.PI * (angle_m / 180.0))) * Math.sin((0.005555555555555556 * (Math.PI * angle_m)))));
} else {
tmp = 2.0 * (Math.sin((angle_m * ((Math.cbrt(Math.PI) * Math.pow(Math.cbrt(Math.PI), 2.0)) / -180.0))) * ((b + a) * (a - b)));
}
return angle_s * tmp;
}
angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) tmp = 0.0 if (Float64(angle_m / 180.0) <= 5e-86) tmp = Float64(0.011111111111111112 * Float64(Float64(angle_m * Float64((b ^ 2.0) * pi)) - Float64(a * Float64(pi * Float64(a * angle_m))))); elseif (Float64(angle_m / 180.0) <= 1e+264) tmp = Float64(Float64(Float64(b - a) * Float64(b + a)) * Float64(2.0 * Float64(cos(Float64(pi * Float64(angle_m / 180.0))) * sin(Float64(0.005555555555555556 * Float64(pi * angle_m)))))); else tmp = Float64(2.0 * Float64(sin(Float64(angle_m * Float64(Float64(cbrt(pi) * (cbrt(pi) ^ 2.0)) / -180.0))) * Float64(Float64(b + a) * Float64(a - b)))); 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_] := N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e-86], N[(0.011111111111111112 * N[(N[(angle$95$m * N[(N[Power[b, 2.0], $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision] - N[(a * N[(Pi * N[(a * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e+264], N[(N[(N[(b - a), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[(N[Cos[N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(0.005555555555555556 * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[Sin[N[(angle$95$m * N[(N[(N[Power[Pi, 1/3], $MachinePrecision] * N[Power[N[Power[Pi, 1/3], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / -180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(b + a), $MachinePrecision] * N[(a - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{-86}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left({b}^{2} \cdot \pi\right) - a \cdot \left(\pi \cdot \left(a \cdot angle\_m\right)\right)\right)\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 10^{+264}:\\
\;\;\;\;\left(\left(b - a\right) \cdot \left(b + a\right)\right) \cdot \left(2 \cdot \left(\cos \left(\pi \cdot \frac{angle\_m}{180}\right) \cdot \sin \left(0.005555555555555556 \cdot \left(\pi \cdot angle\_m\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\sin \left(angle\_m \cdot \frac{\sqrt[3]{\pi} \cdot {\left(\sqrt[3]{\pi}\right)}^{2}}{-180}\right) \cdot \left(\left(b + a\right) \cdot \left(a - b\right)\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 4.9999999999999999e-86Initial program 56.6%
associate-*l*56.6%
*-commutative56.6%
associate-*l*56.6%
Simplified56.6%
Taylor expanded in angle around 0 51.2%
unpow258.2%
unpow258.2%
difference-of-squares61.6%
Applied egg-rr54.6%
associate-*r*54.6%
sub-neg54.6%
distribute-lft-in51.1%
Applied egg-rr51.1%
Taylor expanded in a around 0 56.0%
+-commutative56.0%
+-commutative56.0%
distribute-rgt-in56.0%
*-commutative56.0%
mul-1-neg56.0%
distribute-lft-neg-out56.0%
unsub-neg56.0%
Simplified56.0%
if 4.9999999999999999e-86 < (/.f64 angle #s(literal 180 binary64)) < 1.00000000000000004e264Initial program 48.5%
associate-*l*48.5%
*-commutative48.5%
associate-*l*48.5%
Simplified48.5%
Taylor expanded in angle around inf 56.0%
*-commutative56.0%
Simplified56.0%
unpow256.0%
unpow256.0%
difference-of-squares57.4%
Applied egg-rr57.4%
if 1.00000000000000004e264 < (/.f64 angle #s(literal 180 binary64)) Initial program 17.8%
Simplified17.8%
Taylor expanded in angle around 0 34.5%
add-cube-cbrt34.5%
pow234.5%
Applied egg-rr34.5%
unpow234.5%
unpow234.5%
difference-of-squares51.2%
Applied egg-rr51.2%
Final simplification56.3%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(let* ((t_0 (* 0.005555555555555556 (* PI angle_m))))
(*
angle_s
(if (<= (/ angle_m 180.0) 5e-86)
(*
0.011111111111111112
(- (* angle_m (* (pow b 2.0) PI)) (* a (* PI (* a angle_m)))))
(* 2.0 (* (cos t_0) (* (* (- b a) (+ b a)) (sin 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 * (((double) M_PI) * angle_m);
double tmp;
if ((angle_m / 180.0) <= 5e-86) {
tmp = 0.011111111111111112 * ((angle_m * (pow(b, 2.0) * ((double) M_PI))) - (a * (((double) M_PI) * (a * angle_m))));
} else {
tmp = 2.0 * (cos(t_0) * (((b - a) * (b + a)) * sin(t_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 = 0.005555555555555556 * (Math.PI * angle_m);
double tmp;
if ((angle_m / 180.0) <= 5e-86) {
tmp = 0.011111111111111112 * ((angle_m * (Math.pow(b, 2.0) * Math.PI)) - (a * (Math.PI * (a * angle_m))));
} else {
tmp = 2.0 * (Math.cos(t_0) * (((b - a) * (b + a)) * Math.sin(t_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 = 0.005555555555555556 * (math.pi * angle_m) tmp = 0 if (angle_m / 180.0) <= 5e-86: tmp = 0.011111111111111112 * ((angle_m * (math.pow(b, 2.0) * math.pi)) - (a * (math.pi * (a * angle_m)))) else: tmp = 2.0 * (math.cos(t_0) * (((b - a) * (b + a)) * math.sin(t_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(0.005555555555555556 * Float64(pi * angle_m)) tmp = 0.0 if (Float64(angle_m / 180.0) <= 5e-86) tmp = Float64(0.011111111111111112 * Float64(Float64(angle_m * Float64((b ^ 2.0) * pi)) - Float64(a * Float64(pi * Float64(a * angle_m))))); else tmp = Float64(2.0 * Float64(cos(t_0) * Float64(Float64(Float64(b - a) * Float64(b + a)) * sin(t_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 = 0.005555555555555556 * (pi * angle_m); tmp = 0.0; if ((angle_m / 180.0) <= 5e-86) tmp = 0.011111111111111112 * ((angle_m * ((b ^ 2.0) * pi)) - (a * (pi * (a * angle_m)))); else tmp = 2.0 * (cos(t_0) * (((b - a) * (b + a)) * sin(t_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[(0.005555555555555556 * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e-86], N[(0.011111111111111112 * N[(N[(angle$95$m * N[(N[Power[b, 2.0], $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision] - N[(a * N[(Pi * N[(a * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[Cos[t$95$0], $MachinePrecision] * N[(N[(N[(b - a), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$0], $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 := 0.005555555555555556 \cdot \left(\pi \cdot angle\_m\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{-86}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left({b}^{2} \cdot \pi\right) - a \cdot \left(\pi \cdot \left(a \cdot angle\_m\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\cos t\_0 \cdot \left(\left(\left(b - a\right) \cdot \left(b + a\right)\right) \cdot \sin t\_0\right)\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 4.9999999999999999e-86Initial program 56.6%
associate-*l*56.6%
*-commutative56.6%
associate-*l*56.6%
Simplified56.6%
Taylor expanded in angle around 0 51.2%
unpow258.2%
unpow258.2%
difference-of-squares61.6%
Applied egg-rr54.6%
associate-*r*54.6%
sub-neg54.6%
distribute-lft-in51.1%
Applied egg-rr51.1%
Taylor expanded in a around 0 56.0%
+-commutative56.0%
+-commutative56.0%
distribute-rgt-in56.0%
*-commutative56.0%
mul-1-neg56.0%
distribute-lft-neg-out56.0%
unsub-neg56.0%
Simplified56.0%
if 4.9999999999999999e-86 < (/.f64 angle #s(literal 180 binary64)) Initial program 46.1%
associate-*l*46.1%
*-commutative46.1%
associate-*l*46.1%
Simplified46.1%
Taylor expanded in angle around inf 52.0%
*-commutative52.0%
Simplified52.0%
unpow252.0%
unpow252.0%
difference-of-squares53.3%
Applied egg-rr53.3%
Taylor expanded in angle around inf 52.7%
+-commutative52.7%
*-commutative52.7%
+-commutative52.7%
Simplified52.7%
Final simplification55.1%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(*
angle_s
(if (<= (/ angle_m 180.0) 5e-86)
(*
0.011111111111111112
(- (* angle_m (* (pow b 2.0) PI)) (* a (* PI (* a angle_m)))))
(*
(* (- b a) (+ b a))
(*
2.0
(*
(cos (* PI (/ angle_m 180.0)))
(sin (* 0.005555555555555556 (* PI angle_m)))))))))angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double tmp;
if ((angle_m / 180.0) <= 5e-86) {
tmp = 0.011111111111111112 * ((angle_m * (pow(b, 2.0) * ((double) M_PI))) - (a * (((double) M_PI) * (a * angle_m))));
} else {
tmp = ((b - a) * (b + a)) * (2.0 * (cos((((double) M_PI) * (angle_m / 180.0))) * sin((0.005555555555555556 * (((double) M_PI) * angle_m)))));
}
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 tmp;
if ((angle_m / 180.0) <= 5e-86) {
tmp = 0.011111111111111112 * ((angle_m * (Math.pow(b, 2.0) * Math.PI)) - (a * (Math.PI * (a * angle_m))));
} else {
tmp = ((b - a) * (b + a)) * (2.0 * (Math.cos((Math.PI * (angle_m / 180.0))) * Math.sin((0.005555555555555556 * (Math.PI * angle_m)))));
}
return angle_s * tmp;
}
angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): tmp = 0 if (angle_m / 180.0) <= 5e-86: tmp = 0.011111111111111112 * ((angle_m * (math.pow(b, 2.0) * math.pi)) - (a * (math.pi * (a * angle_m)))) else: tmp = ((b - a) * (b + a)) * (2.0 * (math.cos((math.pi * (angle_m / 180.0))) * math.sin((0.005555555555555556 * (math.pi * angle_m))))) return angle_s * tmp
angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) tmp = 0.0 if (Float64(angle_m / 180.0) <= 5e-86) tmp = Float64(0.011111111111111112 * Float64(Float64(angle_m * Float64((b ^ 2.0) * pi)) - Float64(a * Float64(pi * Float64(a * angle_m))))); else tmp = Float64(Float64(Float64(b - a) * Float64(b + a)) * Float64(2.0 * Float64(cos(Float64(pi * Float64(angle_m / 180.0))) * sin(Float64(0.005555555555555556 * Float64(pi * angle_m)))))); 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) tmp = 0.0; if ((angle_m / 180.0) <= 5e-86) tmp = 0.011111111111111112 * ((angle_m * ((b ^ 2.0) * pi)) - (a * (pi * (a * angle_m)))); else tmp = ((b - a) * (b + a)) * (2.0 * (cos((pi * (angle_m / 180.0))) * sin((0.005555555555555556 * (pi * angle_m))))); 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_] := N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e-86], N[(0.011111111111111112 * N[(N[(angle$95$m * N[(N[Power[b, 2.0], $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision] - N[(a * N[(Pi * N[(a * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b - a), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[(N[Cos[N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(0.005555555555555556 * N[(Pi * angle$95$m), $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 \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{-86}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left({b}^{2} \cdot \pi\right) - a \cdot \left(\pi \cdot \left(a \cdot angle\_m\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(b - a\right) \cdot \left(b + a\right)\right) \cdot \left(2 \cdot \left(\cos \left(\pi \cdot \frac{angle\_m}{180}\right) \cdot \sin \left(0.005555555555555556 \cdot \left(\pi \cdot angle\_m\right)\right)\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 4.9999999999999999e-86Initial program 56.6%
associate-*l*56.6%
*-commutative56.6%
associate-*l*56.6%
Simplified56.6%
Taylor expanded in angle around 0 51.2%
unpow258.2%
unpow258.2%
difference-of-squares61.6%
Applied egg-rr54.6%
associate-*r*54.6%
sub-neg54.6%
distribute-lft-in51.1%
Applied egg-rr51.1%
Taylor expanded in a around 0 56.0%
+-commutative56.0%
+-commutative56.0%
distribute-rgt-in56.0%
*-commutative56.0%
mul-1-neg56.0%
distribute-lft-neg-out56.0%
unsub-neg56.0%
Simplified56.0%
if 4.9999999999999999e-86 < (/.f64 angle #s(literal 180 binary64)) Initial program 46.1%
associate-*l*46.1%
*-commutative46.1%
associate-*l*46.1%
Simplified46.1%
Taylor expanded in angle around inf 52.0%
*-commutative52.0%
Simplified52.0%
unpow252.0%
unpow252.0%
difference-of-squares53.3%
Applied egg-rr53.3%
Final simplification55.2%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(*
angle_s
(if (<= angle_m 7.8e-83)
(*
0.011111111111111112
(- (* angle_m (* (pow b 2.0) PI)) (* a (* PI (* a angle_m)))))
(*
(* (- b a) (+ b a))
(sin (* 2.0 (* 0.005555555555555556 (* PI angle_m))))))))angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double tmp;
if (angle_m <= 7.8e-83) {
tmp = 0.011111111111111112 * ((angle_m * (pow(b, 2.0) * ((double) M_PI))) - (a * (((double) M_PI) * (a * angle_m))));
} else {
tmp = ((b - a) * (b + a)) * sin((2.0 * (0.005555555555555556 * (((double) M_PI) * angle_m))));
}
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 tmp;
if (angle_m <= 7.8e-83) {
tmp = 0.011111111111111112 * ((angle_m * (Math.pow(b, 2.0) * Math.PI)) - (a * (Math.PI * (a * angle_m))));
} else {
tmp = ((b - a) * (b + a)) * Math.sin((2.0 * (0.005555555555555556 * (Math.PI * angle_m))));
}
return angle_s * tmp;
}
angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): tmp = 0 if angle_m <= 7.8e-83: tmp = 0.011111111111111112 * ((angle_m * (math.pow(b, 2.0) * math.pi)) - (a * (math.pi * (a * angle_m)))) else: tmp = ((b - a) * (b + a)) * math.sin((2.0 * (0.005555555555555556 * (math.pi * angle_m)))) return angle_s * tmp
angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) tmp = 0.0 if (angle_m <= 7.8e-83) tmp = Float64(0.011111111111111112 * Float64(Float64(angle_m * Float64((b ^ 2.0) * pi)) - Float64(a * Float64(pi * Float64(a * angle_m))))); else tmp = Float64(Float64(Float64(b - a) * Float64(b + a)) * sin(Float64(2.0 * Float64(0.005555555555555556 * Float64(pi * angle_m))))); 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) tmp = 0.0; if (angle_m <= 7.8e-83) tmp = 0.011111111111111112 * ((angle_m * ((b ^ 2.0) * pi)) - (a * (pi * (a * angle_m)))); else tmp = ((b - a) * (b + a)) * sin((2.0 * (0.005555555555555556 * (pi * angle_m)))); 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_] := N[(angle$95$s * If[LessEqual[angle$95$m, 7.8e-83], N[(0.011111111111111112 * N[(N[(angle$95$m * N[(N[Power[b, 2.0], $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision] - N[(a * N[(Pi * N[(a * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b - a), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(2.0 * N[(0.005555555555555556 * N[(Pi * 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 \begin{array}{l}
\mathbf{if}\;angle\_m \leq 7.8 \cdot 10^{-83}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left({b}^{2} \cdot \pi\right) - a \cdot \left(\pi \cdot \left(a \cdot angle\_m\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(b - a\right) \cdot \left(b + a\right)\right) \cdot \sin \left(2 \cdot \left(0.005555555555555556 \cdot \left(\pi \cdot angle\_m\right)\right)\right)\\
\end{array}
\end{array}
if angle < 7.800000000000001e-83Initial program 56.6%
associate-*l*56.6%
*-commutative56.6%
associate-*l*56.6%
Simplified56.6%
Taylor expanded in angle around 0 51.2%
unpow258.2%
unpow258.2%
difference-of-squares61.6%
Applied egg-rr54.6%
associate-*r*54.6%
sub-neg54.6%
distribute-lft-in51.1%
Applied egg-rr51.1%
Taylor expanded in a around 0 56.0%
+-commutative56.0%
+-commutative56.0%
distribute-rgt-in56.0%
*-commutative56.0%
mul-1-neg56.0%
distribute-lft-neg-out56.0%
unsub-neg56.0%
Simplified56.0%
if 7.800000000000001e-83 < angle Initial program 46.1%
associate-*l*46.1%
*-commutative46.1%
associate-*l*46.1%
Simplified46.1%
Taylor expanded in angle around inf 52.0%
*-commutative52.0%
Simplified52.0%
unpow252.0%
unpow252.0%
difference-of-squares53.3%
Applied egg-rr53.3%
add-cbrt-cube52.6%
pow352.6%
Applied egg-rr52.6%
pow152.6%
Applied egg-rr49.9%
unpow149.9%
*-commutative49.9%
associate-*r*52.7%
*-commutative52.7%
*-commutative52.7%
Simplified52.7%
Final simplification55.1%
angle\_m = (fabs.f64 angle) angle\_s = (copysign.f64 #s(literal 1 binary64) angle) (FPCore (angle_s a b angle_m) :precision binary64 (* angle_s (* (* (- b a) (+ b a)) (sin (* 2.0 (* 0.005555555555555556 (* PI 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 * (((b - a) * (b + a)) * sin((2.0 * (0.005555555555555556 * (((double) M_PI) * 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 * (((b - a) * (b + a)) * Math.sin((2.0 * (0.005555555555555556 * (Math.PI * 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 * (((b - a) * (b + a)) * math.sin((2.0 * (0.005555555555555556 * (math.pi * 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(Float64(Float64(b - a) * Float64(b + a)) * sin(Float64(2.0 * Float64(0.005555555555555556 * Float64(pi * 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 * (((b - a) * (b + a)) * sin((2.0 * (0.005555555555555556 * (pi * 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[(N[(N[(b - a), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(2.0 * N[(0.005555555555555556 * N[(Pi * 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(\left(\left(b - a\right) \cdot \left(b + a\right)\right) \cdot \sin \left(2 \cdot \left(0.005555555555555556 \cdot \left(\pi \cdot angle\_m\right)\right)\right)\right)
\end{array}
Initial program 53.5%
associate-*l*53.5%
*-commutative53.5%
associate-*l*53.5%
Simplified53.5%
Taylor expanded in angle around inf 56.3%
*-commutative56.3%
Simplified56.3%
unpow256.3%
unpow256.3%
difference-of-squares59.1%
Applied egg-rr59.1%
add-cbrt-cube56.6%
pow356.6%
Applied egg-rr56.6%
pow156.6%
Applied egg-rr56.2%
unpow156.2%
*-commutative56.2%
associate-*r*58.8%
*-commutative58.8%
*-commutative58.8%
Simplified58.8%
Final simplification58.8%
angle\_m = (fabs.f64 angle) angle\_s = (copysign.f64 #s(literal 1 binary64) angle) (FPCore (angle_s a b angle_m) :precision binary64 (* angle_s (* 0.011111111111111112 (* angle_m (* PI (* (- b a) (+ b a)))))))
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 * (((double) M_PI) * ((b - a) * (b + a)))));
}
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 * (Math.PI * ((b - a) * (b + a)))));
}
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 * (math.pi * ((b - a) * (b + a)))))
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(pi * Float64(Float64(b - a) * Float64(b + a)))))) 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 * (pi * ((b - a) * (b + a))))); 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[(Pi * N[(N[(b - a), $MachinePrecision] * N[(b + a), $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(0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot \left(\left(b - a\right) \cdot \left(b + a\right)\right)\right)\right)\right)
\end{array}
Initial program 53.5%
associate-*l*53.5%
*-commutative53.5%
associate-*l*53.5%
Simplified53.5%
Taylor expanded in angle around 0 47.4%
unpow256.3%
unpow256.3%
difference-of-squares59.1%
Applied egg-rr50.6%
Final simplification50.6%
herbie shell --seed 2024095
(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)))))