
(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 11 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}
a_m = (fabs.f64 a)
(FPCore (a_m b angle)
:precision binary64
(let* ((t_0 (* (+ b a_m) (- b a_m)))
(t_1 (* 2.0 t_0))
(t_2 (* angle (* PI 0.005555555555555556))))
(if (<= a_m 1.05e-136)
(* (cos (pow (cbrt t_2) 3.0)) (* t_1 (sin t_2)))
(if (<= a_m 2.25e+216)
(*
(* t_1 (sin (* (/ angle 180.0) (pow (sqrt PI) 2.0))))
(cbrt (pow (cos (/ PI (/ 180.0 angle))) 3.0)))
(* 0.011111111111111112 (* angle (* PI t_0)))))))a_m = fabs(a);
double code(double a_m, double b, double angle) {
double t_0 = (b + a_m) * (b - a_m);
double t_1 = 2.0 * t_0;
double t_2 = angle * (((double) M_PI) * 0.005555555555555556);
double tmp;
if (a_m <= 1.05e-136) {
tmp = cos(pow(cbrt(t_2), 3.0)) * (t_1 * sin(t_2));
} else if (a_m <= 2.25e+216) {
tmp = (t_1 * sin(((angle / 180.0) * pow(sqrt(((double) M_PI)), 2.0)))) * cbrt(pow(cos((((double) M_PI) / (180.0 / angle))), 3.0));
} else {
tmp = 0.011111111111111112 * (angle * (((double) M_PI) * t_0));
}
return tmp;
}
a_m = Math.abs(a);
public static double code(double a_m, double b, double angle) {
double t_0 = (b + a_m) * (b - a_m);
double t_1 = 2.0 * t_0;
double t_2 = angle * (Math.PI * 0.005555555555555556);
double tmp;
if (a_m <= 1.05e-136) {
tmp = Math.cos(Math.pow(Math.cbrt(t_2), 3.0)) * (t_1 * Math.sin(t_2));
} else if (a_m <= 2.25e+216) {
tmp = (t_1 * Math.sin(((angle / 180.0) * Math.pow(Math.sqrt(Math.PI), 2.0)))) * Math.cbrt(Math.pow(Math.cos((Math.PI / (180.0 / angle))), 3.0));
} else {
tmp = 0.011111111111111112 * (angle * (Math.PI * t_0));
}
return tmp;
}
a_m = abs(a) function code(a_m, b, angle) t_0 = Float64(Float64(b + a_m) * Float64(b - a_m)) t_1 = Float64(2.0 * t_0) t_2 = Float64(angle * Float64(pi * 0.005555555555555556)) tmp = 0.0 if (a_m <= 1.05e-136) tmp = Float64(cos((cbrt(t_2) ^ 3.0)) * Float64(t_1 * sin(t_2))); elseif (a_m <= 2.25e+216) tmp = Float64(Float64(t_1 * sin(Float64(Float64(angle / 180.0) * (sqrt(pi) ^ 2.0)))) * cbrt((cos(Float64(pi / Float64(180.0 / angle))) ^ 3.0))); else tmp = Float64(0.011111111111111112 * Float64(angle * Float64(pi * t_0))); end return tmp end
a_m = N[Abs[a], $MachinePrecision]
code[a$95$m_, b_, angle_] := Block[{t$95$0 = N[(N[(b + a$95$m), $MachinePrecision] * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(2.0 * t$95$0), $MachinePrecision]}, Block[{t$95$2 = N[(angle * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a$95$m, 1.05e-136], N[(N[Cos[N[Power[N[Power[t$95$2, 1/3], $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision] * N[(t$95$1 * N[Sin[t$95$2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a$95$m, 2.25e+216], N[(N[(t$95$1 * N[Sin[N[(N[(angle / 180.0), $MachinePrecision] * N[Power[N[Sqrt[Pi], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Power[N[Power[N[Cos[N[(Pi / N[(180.0 / angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], 3.0], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(angle * N[(Pi * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
a_m = \left|a\right|
\\
\begin{array}{l}
t_0 := \left(b + a_m\right) \cdot \left(b - a_m\right)\\
t_1 := 2 \cdot t_0\\
t_2 := angle \cdot \left(\pi \cdot 0.005555555555555556\right)\\
\mathbf{if}\;a_m \leq 1.05 \cdot 10^{-136}:\\
\;\;\;\;\cos \left({\left(\sqrt[3]{t_2}\right)}^{3}\right) \cdot \left(t_1 \cdot \sin t_2\right)\\
\mathbf{elif}\;a_m \leq 2.25 \cdot 10^{+216}:\\
\;\;\;\;\left(t_1 \cdot \sin \left(\frac{angle}{180} \cdot {\left(\sqrt{\pi}\right)}^{2}\right)\right) \cdot \sqrt[3]{{\cos \left(\frac{\pi}{\frac{180}{angle}}\right)}^{3}}\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot t_0\right)\right)\\
\end{array}
\end{array}
if a < 1.0499999999999999e-136Initial program 56.9%
unpow256.9%
unpow256.9%
difference-of-squares59.8%
Applied egg-rr59.8%
add-sqr-sqrt61.7%
pow261.7%
Applied egg-rr61.7%
add-cube-cbrt60.1%
pow359.0%
*-commutative59.0%
div-inv59.3%
metadata-eval59.3%
associate-*l*60.1%
Applied egg-rr60.1%
*-un-lft-identity60.1%
unpow260.1%
add-sqr-sqrt58.1%
div-inv58.5%
metadata-eval58.5%
*-commutative58.5%
metadata-eval58.5%
div-inv58.1%
*-commutative58.1%
div-inv58.5%
metadata-eval58.5%
associate-*l*59.4%
Applied egg-rr59.4%
if 1.0499999999999999e-136 < a < 2.25000000000000012e216Initial program 51.8%
unpow251.8%
unpow251.8%
difference-of-squares55.1%
Applied egg-rr55.1%
add-sqr-sqrt56.9%
pow256.9%
Applied egg-rr56.9%
add-cube-cbrt53.1%
pow354.8%
*-commutative54.8%
div-inv53.1%
metadata-eval53.1%
associate-*l*54.7%
Applied egg-rr54.7%
rem-cube-cbrt58.3%
add-cbrt-cube58.3%
pow358.3%
associate-*r*55.0%
metadata-eval55.0%
div-inv56.9%
*-commutative56.9%
clear-num53.8%
un-div-inv60.2%
Applied egg-rr60.2%
if 2.25000000000000012e216 < a Initial program 55.6%
unpow255.6%
unpow255.6%
difference-of-squares72.2%
Applied egg-rr72.2%
Taylor expanded in angle around 0 61.1%
Taylor expanded in angle around 0 83.3%
Final simplification61.3%
a_m = (fabs.f64 a)
(FPCore (a_m b angle)
:precision binary64
(let* ((t_0
(*
(* 2.0 (* (+ b a_m) (- b a_m)))
(sin (* (/ angle 180.0) (pow (sqrt PI) 2.0)))))
(t_1 (* PI (/ angle 180.0))))
(if (<=
(* (* (* 2.0 (- (pow b 2.0) (pow a_m 2.0))) (sin t_1)) (cos t_1))
5e+189)
(* t_0 (cos (/ 1.0 (/ 180.0 (* PI angle)))))
(* t_0 (cos (pow (cbrt (* angle (* PI 0.005555555555555556))) 3.0))))))a_m = fabs(a);
double code(double a_m, double b, double angle) {
double t_0 = (2.0 * ((b + a_m) * (b - a_m))) * sin(((angle / 180.0) * pow(sqrt(((double) M_PI)), 2.0)));
double t_1 = ((double) M_PI) * (angle / 180.0);
double tmp;
if ((((2.0 * (pow(b, 2.0) - pow(a_m, 2.0))) * sin(t_1)) * cos(t_1)) <= 5e+189) {
tmp = t_0 * cos((1.0 / (180.0 / (((double) M_PI) * angle))));
} else {
tmp = t_0 * cos(pow(cbrt((angle * (((double) M_PI) * 0.005555555555555556))), 3.0));
}
return tmp;
}
a_m = Math.abs(a);
public static double code(double a_m, double b, double angle) {
double t_0 = (2.0 * ((b + a_m) * (b - a_m))) * Math.sin(((angle / 180.0) * Math.pow(Math.sqrt(Math.PI), 2.0)));
double t_1 = Math.PI * (angle / 180.0);
double tmp;
if ((((2.0 * (Math.pow(b, 2.0) - Math.pow(a_m, 2.0))) * Math.sin(t_1)) * Math.cos(t_1)) <= 5e+189) {
tmp = t_0 * Math.cos((1.0 / (180.0 / (Math.PI * angle))));
} else {
tmp = t_0 * Math.cos(Math.pow(Math.cbrt((angle * (Math.PI * 0.005555555555555556))), 3.0));
}
return tmp;
}
a_m = abs(a) function code(a_m, b, angle) t_0 = Float64(Float64(2.0 * Float64(Float64(b + a_m) * Float64(b - a_m))) * sin(Float64(Float64(angle / 180.0) * (sqrt(pi) ^ 2.0)))) t_1 = Float64(pi * Float64(angle / 180.0)) tmp = 0.0 if (Float64(Float64(Float64(2.0 * Float64((b ^ 2.0) - (a_m ^ 2.0))) * sin(t_1)) * cos(t_1)) <= 5e+189) tmp = Float64(t_0 * cos(Float64(1.0 / Float64(180.0 / Float64(pi * angle))))); else tmp = Float64(t_0 * cos((cbrt(Float64(angle * Float64(pi * 0.005555555555555556))) ^ 3.0))); end return tmp end
a_m = N[Abs[a], $MachinePrecision]
code[a$95$m_, b_, angle_] := Block[{t$95$0 = N[(N[(2.0 * N[(N[(b + a$95$m), $MachinePrecision] * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(N[(angle / 180.0), $MachinePrecision] * N[Power[N[Sqrt[Pi], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision], 5e+189], N[(t$95$0 * N[Cos[N[(1.0 / N[(180.0 / N[(Pi * angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[Cos[N[Power[N[Power[N[(angle * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
a_m = \left|a\right|
\\
\begin{array}{l}
t_0 := \left(2 \cdot \left(\left(b + a_m\right) \cdot \left(b - a_m\right)\right)\right) \cdot \sin \left(\frac{angle}{180} \cdot {\left(\sqrt{\pi}\right)}^{2}\right)\\
t_1 := \pi \cdot \frac{angle}{180}\\
\mathbf{if}\;\left(\left(2 \cdot \left({b}^{2} - {a_m}^{2}\right)\right) \cdot \sin t_1\right) \cdot \cos t_1 \leq 5 \cdot 10^{+189}:\\
\;\;\;\;t_0 \cdot \cos \left(\frac{1}{\frac{180}{\pi \cdot angle}}\right)\\
\mathbf{else}:\\
\;\;\;\;t_0 \cdot \cos \left({\left(\sqrt[3]{angle \cdot \left(\pi \cdot 0.005555555555555556\right)}\right)}^{3}\right)\\
\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)))) < 5.0000000000000004e189Initial program 62.7%
unpow262.7%
unpow262.7%
difference-of-squares62.7%
Applied egg-rr62.7%
add-sqr-sqrt63.8%
pow263.8%
Applied egg-rr63.8%
associate-*r/61.8%
clear-num63.5%
Applied egg-rr63.5%
if 5.0000000000000004e189 < (*.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 38.2%
unpow238.2%
unpow238.2%
difference-of-squares51.8%
Applied egg-rr51.8%
add-sqr-sqrt53.6%
pow253.6%
Applied egg-rr53.6%
add-cube-cbrt58.5%
pow360.1%
*-commutative60.1%
div-inv59.8%
metadata-eval59.8%
associate-*l*62.8%
Applied egg-rr62.8%
Final simplification63.3%
a_m = (fabs.f64 a)
(FPCore (a_m b angle)
:precision binary64
(let* ((t_0 (* (+ b a_m) (- b a_m)))
(t_1 (* 2.0 t_0))
(t_2 (* angle (* PI 0.005555555555555556))))
(if (<= a_m 1.12e-138)
(* (cos (pow (cbrt t_2) 3.0)) (* t_1 (sin t_2)))
(if (<= a_m 2.05e+216)
(*
(* t_1 (sin (* (/ angle 180.0) (pow (sqrt PI) 2.0))))
(log1p (expm1 (cos (/ PI (/ 180.0 angle))))))
(* 0.011111111111111112 (* angle (* PI t_0)))))))a_m = fabs(a);
double code(double a_m, double b, double angle) {
double t_0 = (b + a_m) * (b - a_m);
double t_1 = 2.0 * t_0;
double t_2 = angle * (((double) M_PI) * 0.005555555555555556);
double tmp;
if (a_m <= 1.12e-138) {
tmp = cos(pow(cbrt(t_2), 3.0)) * (t_1 * sin(t_2));
} else if (a_m <= 2.05e+216) {
tmp = (t_1 * sin(((angle / 180.0) * pow(sqrt(((double) M_PI)), 2.0)))) * log1p(expm1(cos((((double) M_PI) / (180.0 / angle)))));
} else {
tmp = 0.011111111111111112 * (angle * (((double) M_PI) * t_0));
}
return tmp;
}
a_m = Math.abs(a);
public static double code(double a_m, double b, double angle) {
double t_0 = (b + a_m) * (b - a_m);
double t_1 = 2.0 * t_0;
double t_2 = angle * (Math.PI * 0.005555555555555556);
double tmp;
if (a_m <= 1.12e-138) {
tmp = Math.cos(Math.pow(Math.cbrt(t_2), 3.0)) * (t_1 * Math.sin(t_2));
} else if (a_m <= 2.05e+216) {
tmp = (t_1 * Math.sin(((angle / 180.0) * Math.pow(Math.sqrt(Math.PI), 2.0)))) * Math.log1p(Math.expm1(Math.cos((Math.PI / (180.0 / angle)))));
} else {
tmp = 0.011111111111111112 * (angle * (Math.PI * t_0));
}
return tmp;
}
a_m = abs(a) function code(a_m, b, angle) t_0 = Float64(Float64(b + a_m) * Float64(b - a_m)) t_1 = Float64(2.0 * t_0) t_2 = Float64(angle * Float64(pi * 0.005555555555555556)) tmp = 0.0 if (a_m <= 1.12e-138) tmp = Float64(cos((cbrt(t_2) ^ 3.0)) * Float64(t_1 * sin(t_2))); elseif (a_m <= 2.05e+216) tmp = Float64(Float64(t_1 * sin(Float64(Float64(angle / 180.0) * (sqrt(pi) ^ 2.0)))) * log1p(expm1(cos(Float64(pi / Float64(180.0 / angle)))))); else tmp = Float64(0.011111111111111112 * Float64(angle * Float64(pi * t_0))); end return tmp end
a_m = N[Abs[a], $MachinePrecision]
code[a$95$m_, b_, angle_] := Block[{t$95$0 = N[(N[(b + a$95$m), $MachinePrecision] * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(2.0 * t$95$0), $MachinePrecision]}, Block[{t$95$2 = N[(angle * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a$95$m, 1.12e-138], N[(N[Cos[N[Power[N[Power[t$95$2, 1/3], $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision] * N[(t$95$1 * N[Sin[t$95$2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a$95$m, 2.05e+216], N[(N[(t$95$1 * N[Sin[N[(N[(angle / 180.0), $MachinePrecision] * N[Power[N[Sqrt[Pi], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Log[1 + N[(Exp[N[Cos[N[(Pi / N[(180.0 / angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(angle * N[(Pi * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
a_m = \left|a\right|
\\
\begin{array}{l}
t_0 := \left(b + a_m\right) \cdot \left(b - a_m\right)\\
t_1 := 2 \cdot t_0\\
t_2 := angle \cdot \left(\pi \cdot 0.005555555555555556\right)\\
\mathbf{if}\;a_m \leq 1.12 \cdot 10^{-138}:\\
\;\;\;\;\cos \left({\left(\sqrt[3]{t_2}\right)}^{3}\right) \cdot \left(t_1 \cdot \sin t_2\right)\\
\mathbf{elif}\;a_m \leq 2.05 \cdot 10^{+216}:\\
\;\;\;\;\left(t_1 \cdot \sin \left(\frac{angle}{180} \cdot {\left(\sqrt{\pi}\right)}^{2}\right)\right) \cdot \mathsf{log1p}\left(\mathsf{expm1}\left(\cos \left(\frac{\pi}{\frac{180}{angle}}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot t_0\right)\right)\\
\end{array}
\end{array}
if a < 1.1199999999999999e-138Initial program 56.9%
unpow256.9%
unpow256.9%
difference-of-squares59.8%
Applied egg-rr59.8%
add-sqr-sqrt61.7%
pow261.7%
Applied egg-rr61.7%
add-cube-cbrt60.1%
pow359.0%
*-commutative59.0%
div-inv59.3%
metadata-eval59.3%
associate-*l*60.1%
Applied egg-rr60.1%
*-un-lft-identity60.1%
unpow260.1%
add-sqr-sqrt58.1%
div-inv58.5%
metadata-eval58.5%
*-commutative58.5%
metadata-eval58.5%
div-inv58.1%
*-commutative58.1%
div-inv58.5%
metadata-eval58.5%
associate-*l*59.4%
Applied egg-rr59.4%
if 1.1199999999999999e-138 < a < 2.0499999999999999e216Initial program 51.8%
unpow251.8%
unpow251.8%
difference-of-squares55.1%
Applied egg-rr55.1%
add-sqr-sqrt56.9%
pow256.9%
Applied egg-rr56.9%
add-cube-cbrt53.1%
pow354.8%
*-commutative54.8%
div-inv53.1%
metadata-eval53.1%
associate-*l*54.7%
Applied egg-rr54.7%
log1p-expm1-u54.7%
rem-cube-cbrt58.3%
associate-*r*55.0%
metadata-eval55.0%
div-inv56.9%
*-commutative56.9%
clear-num53.8%
un-div-inv60.2%
Applied egg-rr60.2%
if 2.0499999999999999e216 < a Initial program 55.6%
unpow255.6%
unpow255.6%
difference-of-squares72.2%
Applied egg-rr72.2%
Taylor expanded in angle around 0 61.1%
Taylor expanded in angle around 0 83.3%
Final simplification61.3%
a_m = (fabs.f64 a)
(FPCore (a_m b angle)
:precision binary64
(let* ((t_0 (* 2.0 (* (+ b a_m) (- b a_m)))) (t_1 (* PI (/ angle 180.0))))
(if (<= (pow b 2.0) 5e+241)
(* (cos t_1) (* t_0 (sin (* (/ angle 180.0) (pow (sqrt PI) 2.0)))))
(*
(* (sin t_1) t_0)
(+ 1.0 (* (* -1.54320987654321e-5 (pow angle 2.0)) (pow PI 2.0)))))))a_m = fabs(a);
double code(double a_m, double b, double angle) {
double t_0 = 2.0 * ((b + a_m) * (b - a_m));
double t_1 = ((double) M_PI) * (angle / 180.0);
double tmp;
if (pow(b, 2.0) <= 5e+241) {
tmp = cos(t_1) * (t_0 * sin(((angle / 180.0) * pow(sqrt(((double) M_PI)), 2.0))));
} else {
tmp = (sin(t_1) * t_0) * (1.0 + ((-1.54320987654321e-5 * pow(angle, 2.0)) * pow(((double) M_PI), 2.0)));
}
return tmp;
}
a_m = Math.abs(a);
public static double code(double a_m, double b, double angle) {
double t_0 = 2.0 * ((b + a_m) * (b - a_m));
double t_1 = Math.PI * (angle / 180.0);
double tmp;
if (Math.pow(b, 2.0) <= 5e+241) {
tmp = Math.cos(t_1) * (t_0 * Math.sin(((angle / 180.0) * Math.pow(Math.sqrt(Math.PI), 2.0))));
} else {
tmp = (Math.sin(t_1) * t_0) * (1.0 + ((-1.54320987654321e-5 * Math.pow(angle, 2.0)) * Math.pow(Math.PI, 2.0)));
}
return tmp;
}
a_m = math.fabs(a) def code(a_m, b, angle): t_0 = 2.0 * ((b + a_m) * (b - a_m)) t_1 = math.pi * (angle / 180.0) tmp = 0 if math.pow(b, 2.0) <= 5e+241: tmp = math.cos(t_1) * (t_0 * math.sin(((angle / 180.0) * math.pow(math.sqrt(math.pi), 2.0)))) else: tmp = (math.sin(t_1) * t_0) * (1.0 + ((-1.54320987654321e-5 * math.pow(angle, 2.0)) * math.pow(math.pi, 2.0))) return tmp
a_m = abs(a) function code(a_m, b, angle) t_0 = Float64(2.0 * Float64(Float64(b + a_m) * Float64(b - a_m))) t_1 = Float64(pi * Float64(angle / 180.0)) tmp = 0.0 if ((b ^ 2.0) <= 5e+241) tmp = Float64(cos(t_1) * Float64(t_0 * sin(Float64(Float64(angle / 180.0) * (sqrt(pi) ^ 2.0))))); else tmp = Float64(Float64(sin(t_1) * t_0) * Float64(1.0 + Float64(Float64(-1.54320987654321e-5 * (angle ^ 2.0)) * (pi ^ 2.0)))); end return tmp end
a_m = abs(a); function tmp_2 = code(a_m, b, angle) t_0 = 2.0 * ((b + a_m) * (b - a_m)); t_1 = pi * (angle / 180.0); tmp = 0.0; if ((b ^ 2.0) <= 5e+241) tmp = cos(t_1) * (t_0 * sin(((angle / 180.0) * (sqrt(pi) ^ 2.0)))); else tmp = (sin(t_1) * t_0) * (1.0 + ((-1.54320987654321e-5 * (angle ^ 2.0)) * (pi ^ 2.0))); end tmp_2 = tmp; end
a_m = N[Abs[a], $MachinePrecision]
code[a$95$m_, b_, angle_] := Block[{t$95$0 = N[(2.0 * N[(N[(b + a$95$m), $MachinePrecision] * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Power[b, 2.0], $MachinePrecision], 5e+241], N[(N[Cos[t$95$1], $MachinePrecision] * N[(t$95$0 * N[Sin[N[(N[(angle / 180.0), $MachinePrecision] * N[Power[N[Sqrt[Pi], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sin[t$95$1], $MachinePrecision] * t$95$0), $MachinePrecision] * N[(1.0 + N[(N[(-1.54320987654321e-5 * N[Power[angle, 2.0], $MachinePrecision]), $MachinePrecision] * N[Power[Pi, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
a_m = \left|a\right|
\\
\begin{array}{l}
t_0 := 2 \cdot \left(\left(b + a_m\right) \cdot \left(b - a_m\right)\right)\\
t_1 := \pi \cdot \frac{angle}{180}\\
\mathbf{if}\;{b}^{2} \leq 5 \cdot 10^{+241}:\\
\;\;\;\;\cos t_1 \cdot \left(t_0 \cdot \sin \left(\frac{angle}{180} \cdot {\left(\sqrt{\pi}\right)}^{2}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\sin t_1 \cdot t_0\right) \cdot \left(1 + \left(-1.54320987654321 \cdot 10^{-5} \cdot {angle}^{2}\right) \cdot {\pi}^{2}\right)\\
\end{array}
\end{array}
if (pow.f64 b 2) < 5.00000000000000025e241Initial program 61.9%
unpow261.9%
unpow261.9%
difference-of-squares61.9%
Applied egg-rr61.9%
add-sqr-sqrt64.2%
pow264.2%
Applied egg-rr64.2%
if 5.00000000000000025e241 < (pow.f64 b 2) Initial program 42.2%
unpow242.2%
unpow242.2%
difference-of-squares54.5%
Applied egg-rr54.5%
Taylor expanded in angle around 0 58.9%
associate-*r*58.9%
Simplified58.9%
Final simplification62.5%
a_m = (fabs.f64 a)
(FPCore (a_m b angle)
:precision binary64
(let* ((t_0 (* (+ b a_m) (- b a_m))) (t_1 (* PI (/ angle 180.0))))
(if (<= (pow a_m 2.0) 4e-242)
(*
(* 2.0 t_0)
(sin (pow (cbrt (* angle (* PI 0.005555555555555556))) 3.0)))
(* 2.0 (* (cos t_1) (* (sin t_1) t_0))))))a_m = fabs(a);
double code(double a_m, double b, double angle) {
double t_0 = (b + a_m) * (b - a_m);
double t_1 = ((double) M_PI) * (angle / 180.0);
double tmp;
if (pow(a_m, 2.0) <= 4e-242) {
tmp = (2.0 * t_0) * sin(pow(cbrt((angle * (((double) M_PI) * 0.005555555555555556))), 3.0));
} else {
tmp = 2.0 * (cos(t_1) * (sin(t_1) * t_0));
}
return tmp;
}
a_m = Math.abs(a);
public static double code(double a_m, double b, double angle) {
double t_0 = (b + a_m) * (b - a_m);
double t_1 = Math.PI * (angle / 180.0);
double tmp;
if (Math.pow(a_m, 2.0) <= 4e-242) {
tmp = (2.0 * t_0) * Math.sin(Math.pow(Math.cbrt((angle * (Math.PI * 0.005555555555555556))), 3.0));
} else {
tmp = 2.0 * (Math.cos(t_1) * (Math.sin(t_1) * t_0));
}
return tmp;
}
a_m = abs(a) function code(a_m, b, angle) t_0 = Float64(Float64(b + a_m) * Float64(b - a_m)) t_1 = Float64(pi * Float64(angle / 180.0)) tmp = 0.0 if ((a_m ^ 2.0) <= 4e-242) tmp = Float64(Float64(2.0 * t_0) * sin((cbrt(Float64(angle * Float64(pi * 0.005555555555555556))) ^ 3.0))); else tmp = Float64(2.0 * Float64(cos(t_1) * Float64(sin(t_1) * t_0))); end return tmp end
a_m = N[Abs[a], $MachinePrecision]
code[a$95$m_, b_, angle_] := Block[{t$95$0 = N[(N[(b + a$95$m), $MachinePrecision] * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Power[a$95$m, 2.0], $MachinePrecision], 4e-242], N[(N[(2.0 * t$95$0), $MachinePrecision] * N[Sin[N[Power[N[Power[N[(angle * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[Cos[t$95$1], $MachinePrecision] * N[(N[Sin[t$95$1], $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
a_m = \left|a\right|
\\
\begin{array}{l}
t_0 := \left(b + a_m\right) \cdot \left(b - a_m\right)\\
t_1 := \pi \cdot \frac{angle}{180}\\
\mathbf{if}\;{a_m}^{2} \leq 4 \cdot 10^{-242}:\\
\;\;\;\;\left(2 \cdot t_0\right) \cdot \sin \left({\left(\sqrt[3]{angle \cdot \left(\pi \cdot 0.005555555555555556\right)}\right)}^{3}\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\cos t_1 \cdot \left(\sin t_1 \cdot t_0\right)\right)\\
\end{array}
\end{array}
if (pow.f64 a 2) < 4e-242Initial program 58.5%
unpow258.5%
unpow258.5%
difference-of-squares58.5%
Applied egg-rr58.5%
Taylor expanded in angle around 0 60.7%
add-cube-cbrt60.7%
pow360.9%
*-commutative60.9%
div-inv62.1%
metadata-eval62.1%
associate-*l*61.3%
Applied egg-rr63.4%
if 4e-242 < (pow.f64 a 2) Initial program 54.2%
associate-*l*54.2%
associate-*l*54.2%
Simplified54.2%
unpow254.2%
unpow254.2%
difference-of-squares60.0%
Applied egg-rr60.0%
Final simplification61.1%
a_m = (fabs.f64 a)
(FPCore (a_m b angle)
:precision binary64
(if (<= (pow a_m 2.0) 1e+279)
(*
(* (sin (* PI (/ angle 180.0))) (* 2.0 (* (+ b a_m) (- b a_m))))
(cos (* angle (* PI 0.005555555555555556))))
(* (* angle 0.011111111111111112) (* (- b a_m) (* PI (+ b a_m))))))a_m = fabs(a);
double code(double a_m, double b, double angle) {
double tmp;
if (pow(a_m, 2.0) <= 1e+279) {
tmp = (sin((((double) M_PI) * (angle / 180.0))) * (2.0 * ((b + a_m) * (b - a_m)))) * cos((angle * (((double) M_PI) * 0.005555555555555556)));
} else {
tmp = (angle * 0.011111111111111112) * ((b - a_m) * (((double) M_PI) * (b + a_m)));
}
return tmp;
}
a_m = Math.abs(a);
public static double code(double a_m, double b, double angle) {
double tmp;
if (Math.pow(a_m, 2.0) <= 1e+279) {
tmp = (Math.sin((Math.PI * (angle / 180.0))) * (2.0 * ((b + a_m) * (b - a_m)))) * Math.cos((angle * (Math.PI * 0.005555555555555556)));
} else {
tmp = (angle * 0.011111111111111112) * ((b - a_m) * (Math.PI * (b + a_m)));
}
return tmp;
}
a_m = math.fabs(a) def code(a_m, b, angle): tmp = 0 if math.pow(a_m, 2.0) <= 1e+279: tmp = (math.sin((math.pi * (angle / 180.0))) * (2.0 * ((b + a_m) * (b - a_m)))) * math.cos((angle * (math.pi * 0.005555555555555556))) else: tmp = (angle * 0.011111111111111112) * ((b - a_m) * (math.pi * (b + a_m))) return tmp
a_m = abs(a) function code(a_m, b, angle) tmp = 0.0 if ((a_m ^ 2.0) <= 1e+279) tmp = Float64(Float64(sin(Float64(pi * Float64(angle / 180.0))) * Float64(2.0 * Float64(Float64(b + a_m) * Float64(b - a_m)))) * cos(Float64(angle * Float64(pi * 0.005555555555555556)))); else tmp = Float64(Float64(angle * 0.011111111111111112) * Float64(Float64(b - a_m) * Float64(pi * Float64(b + a_m)))); end return tmp end
a_m = abs(a); function tmp_2 = code(a_m, b, angle) tmp = 0.0; if ((a_m ^ 2.0) <= 1e+279) tmp = (sin((pi * (angle / 180.0))) * (2.0 * ((b + a_m) * (b - a_m)))) * cos((angle * (pi * 0.005555555555555556))); else tmp = (angle * 0.011111111111111112) * ((b - a_m) * (pi * (b + a_m))); end tmp_2 = tmp; end
a_m = N[Abs[a], $MachinePrecision] code[a$95$m_, b_, angle_] := If[LessEqual[N[Power[a$95$m, 2.0], $MachinePrecision], 1e+279], N[(N[(N[Sin[N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(2.0 * N[(N[(b + a$95$m), $MachinePrecision] * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(angle * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(angle * 0.011111111111111112), $MachinePrecision] * N[(N[(b - a$95$m), $MachinePrecision] * N[(Pi * N[(b + a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
a_m = \left|a\right|
\\
\begin{array}{l}
\mathbf{if}\;{a_m}^{2} \leq 10^{+279}:\\
\;\;\;\;\left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \left(2 \cdot \left(\left(b + a_m\right) \cdot \left(b - a_m\right)\right)\right)\right) \cdot \cos \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(angle \cdot 0.011111111111111112\right) \cdot \left(\left(b - a_m\right) \cdot \left(\pi \cdot \left(b + a_m\right)\right)\right)\\
\end{array}
\end{array}
if (pow.f64 a 2) < 1.00000000000000006e279Initial program 57.4%
unpow257.4%
unpow257.4%
difference-of-squares57.4%
Applied egg-rr57.4%
Taylor expanded in angle around inf 57.8%
*-commutative57.8%
associate-*l*59.3%
Simplified59.3%
if 1.00000000000000006e279 < (pow.f64 a 2) Initial program 50.1%
unpow250.1%
unpow250.1%
difference-of-squares66.0%
Applied egg-rr66.0%
Taylor expanded in angle around 0 58.1%
add-log-exp27.4%
div-inv24.5%
metadata-eval24.5%
Applied egg-rr24.5%
Taylor expanded in angle around 0 70.8%
associate-*r*70.8%
associate-*r*70.8%
+-commutative70.8%
Simplified70.8%
Final simplification62.2%
a_m = (fabs.f64 a)
(FPCore (a_m b angle)
:precision binary64
(let* ((t_0 (* 2.0 (* (+ b a_m) (- b a_m)))))
(if (<= (pow a_m 2.0) 1e+27)
(* t_0 (sin (* 0.005555555555555556 (* PI angle))))
(* t_0 (* angle (* PI 0.005555555555555556))))))a_m = fabs(a);
double code(double a_m, double b, double angle) {
double t_0 = 2.0 * ((b + a_m) * (b - a_m));
double tmp;
if (pow(a_m, 2.0) <= 1e+27) {
tmp = t_0 * sin((0.005555555555555556 * (((double) M_PI) * angle)));
} else {
tmp = t_0 * (angle * (((double) M_PI) * 0.005555555555555556));
}
return tmp;
}
a_m = Math.abs(a);
public static double code(double a_m, double b, double angle) {
double t_0 = 2.0 * ((b + a_m) * (b - a_m));
double tmp;
if (Math.pow(a_m, 2.0) <= 1e+27) {
tmp = t_0 * Math.sin((0.005555555555555556 * (Math.PI * angle)));
} else {
tmp = t_0 * (angle * (Math.PI * 0.005555555555555556));
}
return tmp;
}
a_m = math.fabs(a) def code(a_m, b, angle): t_0 = 2.0 * ((b + a_m) * (b - a_m)) tmp = 0 if math.pow(a_m, 2.0) <= 1e+27: tmp = t_0 * math.sin((0.005555555555555556 * (math.pi * angle))) else: tmp = t_0 * (angle * (math.pi * 0.005555555555555556)) return tmp
a_m = abs(a) function code(a_m, b, angle) t_0 = Float64(2.0 * Float64(Float64(b + a_m) * Float64(b - a_m))) tmp = 0.0 if ((a_m ^ 2.0) <= 1e+27) tmp = Float64(t_0 * sin(Float64(0.005555555555555556 * Float64(pi * angle)))); else tmp = Float64(t_0 * Float64(angle * Float64(pi * 0.005555555555555556))); end return tmp end
a_m = abs(a); function tmp_2 = code(a_m, b, angle) t_0 = 2.0 * ((b + a_m) * (b - a_m)); tmp = 0.0; if ((a_m ^ 2.0) <= 1e+27) tmp = t_0 * sin((0.005555555555555556 * (pi * angle))); else tmp = t_0 * (angle * (pi * 0.005555555555555556)); end tmp_2 = tmp; end
a_m = N[Abs[a], $MachinePrecision]
code[a$95$m_, b_, angle_] := Block[{t$95$0 = N[(2.0 * N[(N[(b + a$95$m), $MachinePrecision] * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Power[a$95$m, 2.0], $MachinePrecision], 1e+27], N[(t$95$0 * N[Sin[N[(0.005555555555555556 * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(angle * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
a_m = \left|a\right|
\\
\begin{array}{l}
t_0 := 2 \cdot \left(\left(b + a_m\right) \cdot \left(b - a_m\right)\right)\\
\mathbf{if}\;{a_m}^{2} \leq 10^{+27}:\\
\;\;\;\;t_0 \cdot \sin \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_0 \cdot \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\\
\end{array}
\end{array}
if (pow.f64 a 2) < 1e27Initial program 61.1%
unpow261.1%
unpow261.1%
difference-of-squares61.2%
Applied egg-rr61.2%
Taylor expanded in angle around 0 59.8%
Taylor expanded in angle around inf 60.1%
if 1e27 < (pow.f64 a 2) Initial program 48.8%
unpow248.8%
unpow248.8%
difference-of-squares57.6%
Applied egg-rr57.6%
Taylor expanded in angle around 0 50.8%
Taylor expanded in angle around 0 58.7%
*-commutative58.7%
associate-*l*58.7%
Simplified58.7%
Final simplification59.5%
a_m = (fabs.f64 a)
(FPCore (a_m b angle)
:precision binary64
(let* ((t_0 (* 2.0 (* (+ b a_m) (- b a_m)))))
(if (<= (pow a_m 2.0) 1e+27)
(* t_0 (sin (* PI (* angle 0.005555555555555556))))
(* t_0 (* angle (* PI 0.005555555555555556))))))a_m = fabs(a);
double code(double a_m, double b, double angle) {
double t_0 = 2.0 * ((b + a_m) * (b - a_m));
double tmp;
if (pow(a_m, 2.0) <= 1e+27) {
tmp = t_0 * sin((((double) M_PI) * (angle * 0.005555555555555556)));
} else {
tmp = t_0 * (angle * (((double) M_PI) * 0.005555555555555556));
}
return tmp;
}
a_m = Math.abs(a);
public static double code(double a_m, double b, double angle) {
double t_0 = 2.0 * ((b + a_m) * (b - a_m));
double tmp;
if (Math.pow(a_m, 2.0) <= 1e+27) {
tmp = t_0 * Math.sin((Math.PI * (angle * 0.005555555555555556)));
} else {
tmp = t_0 * (angle * (Math.PI * 0.005555555555555556));
}
return tmp;
}
a_m = math.fabs(a) def code(a_m, b, angle): t_0 = 2.0 * ((b + a_m) * (b - a_m)) tmp = 0 if math.pow(a_m, 2.0) <= 1e+27: tmp = t_0 * math.sin((math.pi * (angle * 0.005555555555555556))) else: tmp = t_0 * (angle * (math.pi * 0.005555555555555556)) return tmp
a_m = abs(a) function code(a_m, b, angle) t_0 = Float64(2.0 * Float64(Float64(b + a_m) * Float64(b - a_m))) tmp = 0.0 if ((a_m ^ 2.0) <= 1e+27) tmp = Float64(t_0 * sin(Float64(pi * Float64(angle * 0.005555555555555556)))); else tmp = Float64(t_0 * Float64(angle * Float64(pi * 0.005555555555555556))); end return tmp end
a_m = abs(a); function tmp_2 = code(a_m, b, angle) t_0 = 2.0 * ((b + a_m) * (b - a_m)); tmp = 0.0; if ((a_m ^ 2.0) <= 1e+27) tmp = t_0 * sin((pi * (angle * 0.005555555555555556))); else tmp = t_0 * (angle * (pi * 0.005555555555555556)); end tmp_2 = tmp; end
a_m = N[Abs[a], $MachinePrecision]
code[a$95$m_, b_, angle_] := Block[{t$95$0 = N[(2.0 * N[(N[(b + a$95$m), $MachinePrecision] * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Power[a$95$m, 2.0], $MachinePrecision], 1e+27], N[(t$95$0 * N[Sin[N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(angle * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
a_m = \left|a\right|
\\
\begin{array}{l}
t_0 := 2 \cdot \left(\left(b + a_m\right) \cdot \left(b - a_m\right)\right)\\
\mathbf{if}\;{a_m}^{2} \leq 10^{+27}:\\
\;\;\;\;t_0 \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_0 \cdot \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\\
\end{array}
\end{array}
if (pow.f64 a 2) < 1e27Initial program 61.1%
unpow261.1%
unpow261.1%
difference-of-squares61.2%
Applied egg-rr61.2%
Taylor expanded in angle around 0 59.8%
Taylor expanded in angle around inf 60.1%
*-commutative60.1%
*-commutative60.1%
associate-*r*61.4%
Simplified61.4%
if 1e27 < (pow.f64 a 2) Initial program 48.8%
unpow248.8%
unpow248.8%
difference-of-squares57.6%
Applied egg-rr57.6%
Taylor expanded in angle around 0 50.8%
Taylor expanded in angle around 0 58.7%
*-commutative58.7%
associate-*l*58.7%
Simplified58.7%
Final simplification60.2%
a_m = (fabs.f64 a) (FPCore (a_m b angle) :precision binary64 (* (* 2.0 (* (+ b a_m) (- b a_m))) (* 0.005555555555555556 (* PI angle))))
a_m = fabs(a);
double code(double a_m, double b, double angle) {
return (2.0 * ((b + a_m) * (b - a_m))) * (0.005555555555555556 * (((double) M_PI) * angle));
}
a_m = Math.abs(a);
public static double code(double a_m, double b, double angle) {
return (2.0 * ((b + a_m) * (b - a_m))) * (0.005555555555555556 * (Math.PI * angle));
}
a_m = math.fabs(a) def code(a_m, b, angle): return (2.0 * ((b + a_m) * (b - a_m))) * (0.005555555555555556 * (math.pi * angle))
a_m = abs(a) function code(a_m, b, angle) return Float64(Float64(2.0 * Float64(Float64(b + a_m) * Float64(b - a_m))) * Float64(0.005555555555555556 * Float64(pi * angle))) end
a_m = abs(a); function tmp = code(a_m, b, angle) tmp = (2.0 * ((b + a_m) * (b - a_m))) * (0.005555555555555556 * (pi * angle)); end
a_m = N[Abs[a], $MachinePrecision] code[a$95$m_, b_, angle_] := N[(N[(2.0 * N[(N[(b + a$95$m), $MachinePrecision] * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(0.005555555555555556 * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
\left(2 \cdot \left(\left(b + a_m\right) \cdot \left(b - a_m\right)\right)\right) \cdot \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)
\end{array}
Initial program 55.6%
unpow255.6%
unpow255.6%
difference-of-squares59.5%
Applied egg-rr59.5%
Taylor expanded in angle around 0 55.7%
Taylor expanded in angle around 0 56.6%
Final simplification56.6%
a_m = (fabs.f64 a) (FPCore (a_m b angle) :precision binary64 (* 0.011111111111111112 (* angle (* PI (* (+ b a_m) (- b a_m))))))
a_m = fabs(a);
double code(double a_m, double b, double angle) {
return 0.011111111111111112 * (angle * (((double) M_PI) * ((b + a_m) * (b - a_m))));
}
a_m = Math.abs(a);
public static double code(double a_m, double b, double angle) {
return 0.011111111111111112 * (angle * (Math.PI * ((b + a_m) * (b - a_m))));
}
a_m = math.fabs(a) def code(a_m, b, angle): return 0.011111111111111112 * (angle * (math.pi * ((b + a_m) * (b - a_m))))
a_m = abs(a) function code(a_m, b, angle) return Float64(0.011111111111111112 * Float64(angle * Float64(pi * Float64(Float64(b + a_m) * Float64(b - a_m))))) end
a_m = abs(a); function tmp = code(a_m, b, angle) tmp = 0.011111111111111112 * (angle * (pi * ((b + a_m) * (b - a_m)))); end
a_m = N[Abs[a], $MachinePrecision] code[a$95$m_, b_, angle_] := N[(0.011111111111111112 * N[(angle * N[(Pi * N[(N[(b + a$95$m), $MachinePrecision] * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(\left(b + a_m\right) \cdot \left(b - a_m\right)\right)\right)\right)
\end{array}
Initial program 55.6%
unpow255.6%
unpow255.6%
difference-of-squares59.5%
Applied egg-rr59.5%
Taylor expanded in angle around 0 55.7%
Taylor expanded in angle around 0 56.6%
Final simplification56.6%
a_m = (fabs.f64 a) (FPCore (a_m b angle) :precision binary64 (* 0.011111111111111112 (* (* (+ b a_m) (- b a_m)) (* PI angle))))
a_m = fabs(a);
double code(double a_m, double b, double angle) {
return 0.011111111111111112 * (((b + a_m) * (b - a_m)) * (((double) M_PI) * angle));
}
a_m = Math.abs(a);
public static double code(double a_m, double b, double angle) {
return 0.011111111111111112 * (((b + a_m) * (b - a_m)) * (Math.PI * angle));
}
a_m = math.fabs(a) def code(a_m, b, angle): return 0.011111111111111112 * (((b + a_m) * (b - a_m)) * (math.pi * angle))
a_m = abs(a) function code(a_m, b, angle) return Float64(0.011111111111111112 * Float64(Float64(Float64(b + a_m) * Float64(b - a_m)) * Float64(pi * angle))) end
a_m = abs(a); function tmp = code(a_m, b, angle) tmp = 0.011111111111111112 * (((b + a_m) * (b - a_m)) * (pi * angle)); end
a_m = N[Abs[a], $MachinePrecision] code[a$95$m_, b_, angle_] := N[(0.011111111111111112 * N[(N[(N[(b + a$95$m), $MachinePrecision] * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision] * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
0.011111111111111112 \cdot \left(\left(\left(b + a_m\right) \cdot \left(b - a_m\right)\right) \cdot \left(\pi \cdot angle\right)\right)
\end{array}
Initial program 55.6%
unpow255.6%
unpow255.6%
difference-of-squares59.5%
Applied egg-rr59.5%
Taylor expanded in angle around 0 55.7%
Taylor expanded in angle around 0 56.6%
associate-*r*56.6%
+-commutative56.6%
*-commutative56.6%
+-commutative56.6%
Simplified56.6%
Final simplification56.6%
herbie shell --seed 2023319
(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)))))