
(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 16 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}
b_m = (fabs.f64 b)
(FPCore (a b_m angle)
:precision binary64
(let* ((t_0 (* 2.0 (+ b_m a))))
(if (<= b_m 4.6e+218)
(*
(*
(- b_m a)
(*
(sin
(* 0.005555555555555556 (* angle (* (cbrt PI) (pow (cbrt PI) 2.0)))))
t_0))
(cos (* (pow (sqrt PI) 2.0) (/ angle 180.0))))
(*
(* (- b_m a) (* t_0 (sin (* 0.005555555555555556 (* angle PI)))))
(cos (* (/ angle 180.0) (pow (cbrt (pow PI 1.5)) 2.0)))))))b_m = fabs(b);
double code(double a, double b_m, double angle) {
double t_0 = 2.0 * (b_m + a);
double tmp;
if (b_m <= 4.6e+218) {
tmp = ((b_m - a) * (sin((0.005555555555555556 * (angle * (cbrt(((double) M_PI)) * pow(cbrt(((double) M_PI)), 2.0))))) * t_0)) * cos((pow(sqrt(((double) M_PI)), 2.0) * (angle / 180.0)));
} else {
tmp = ((b_m - a) * (t_0 * sin((0.005555555555555556 * (angle * ((double) M_PI)))))) * cos(((angle / 180.0) * pow(cbrt(pow(((double) M_PI), 1.5)), 2.0)));
}
return tmp;
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle) {
double t_0 = 2.0 * (b_m + a);
double tmp;
if (b_m <= 4.6e+218) {
tmp = ((b_m - a) * (Math.sin((0.005555555555555556 * (angle * (Math.cbrt(Math.PI) * Math.pow(Math.cbrt(Math.PI), 2.0))))) * t_0)) * Math.cos((Math.pow(Math.sqrt(Math.PI), 2.0) * (angle / 180.0)));
} else {
tmp = ((b_m - a) * (t_0 * Math.sin((0.005555555555555556 * (angle * Math.PI))))) * Math.cos(((angle / 180.0) * Math.pow(Math.cbrt(Math.pow(Math.PI, 1.5)), 2.0)));
}
return tmp;
}
b_m = abs(b) function code(a, b_m, angle) t_0 = Float64(2.0 * Float64(b_m + a)) tmp = 0.0 if (b_m <= 4.6e+218) tmp = Float64(Float64(Float64(b_m - a) * Float64(sin(Float64(0.005555555555555556 * Float64(angle * Float64(cbrt(pi) * (cbrt(pi) ^ 2.0))))) * t_0)) * cos(Float64((sqrt(pi) ^ 2.0) * Float64(angle / 180.0)))); else tmp = Float64(Float64(Float64(b_m - a) * Float64(t_0 * sin(Float64(0.005555555555555556 * Float64(angle * pi))))) * cos(Float64(Float64(angle / 180.0) * (cbrt((pi ^ 1.5)) ^ 2.0)))); end return tmp end
b_m = N[Abs[b], $MachinePrecision]
code[a_, b$95$m_, angle_] := Block[{t$95$0 = N[(2.0 * N[(b$95$m + a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b$95$m, 4.6e+218], N[(N[(N[(b$95$m - a), $MachinePrecision] * N[(N[Sin[N[(0.005555555555555556 * N[(angle * N[(N[Power[Pi, 1/3], $MachinePrecision] * N[Power[N[Power[Pi, 1/3], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(N[Power[N[Sqrt[Pi], $MachinePrecision], 2.0], $MachinePrecision] * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[(b$95$m - a), $MachinePrecision] * N[(t$95$0 * N[Sin[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(N[(angle / 180.0), $MachinePrecision] * N[Power[N[Power[N[Power[Pi, 1.5], $MachinePrecision], 1/3], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
t_0 := 2 \cdot \left(b\_m + a\right)\\
\mathbf{if}\;b\_m \leq 4.6 \cdot 10^{+218}:\\
\;\;\;\;\left(\left(b\_m - a\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \left(\sqrt[3]{\pi} \cdot {\left(\sqrt[3]{\pi}\right)}^{2}\right)\right)\right) \cdot t\_0\right)\right) \cdot \cos \left({\left(\sqrt{\pi}\right)}^{2} \cdot \frac{angle}{180}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(b\_m - a\right) \cdot \left(t\_0 \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot {\left(\sqrt[3]{{\pi}^{1.5}}\right)}^{2}\right)\\
\end{array}
\end{array}
if b < 4.6000000000000002e218Initial program 57.2%
add-exp-log30.5%
*-commutative30.5%
div-inv30.1%
metadata-eval30.1%
Applied egg-rr30.1%
rem-exp-log55.9%
add-sqr-sqrt34.2%
add-sqr-sqrt55.9%
unpow255.9%
unpow255.9%
difference-of-squares58.0%
associate-*r*58.0%
associate-*r*68.0%
Applied egg-rr68.0%
*-commutative68.0%
associate-*r*68.5%
*-commutative68.5%
*-commutative68.5%
+-commutative68.5%
Simplified68.5%
add-sqr-sqrt68.3%
pow268.3%
Applied egg-rr68.3%
add-cube-cbrt73.0%
pow273.0%
Applied egg-rr73.0%
if 4.6000000000000002e218 < b Initial program 36.6%
add-exp-log14.6%
*-commutative14.6%
div-inv21.8%
metadata-eval21.8%
Applied egg-rr21.8%
rem-exp-log43.7%
add-sqr-sqrt43.7%
add-sqr-sqrt43.7%
unpow243.7%
unpow243.7%
difference-of-squares58.0%
associate-*r*58.0%
associate-*r*70.7%
Applied egg-rr70.7%
*-commutative70.7%
associate-*r*70.9%
*-commutative70.9%
*-commutative70.9%
+-commutative70.9%
Simplified70.9%
add-sqr-sqrt63.8%
pow263.8%
Applied egg-rr63.8%
add-cbrt-cube63.8%
pow1/363.8%
add-sqr-sqrt63.8%
pow163.8%
pow1/263.8%
pow-prod-up63.8%
metadata-eval63.8%
Applied egg-rr63.8%
unpow1/385.2%
Simplified85.2%
Final simplification73.7%
b_m = (fabs.f64 b)
(FPCore (a b_m angle)
:precision binary64
(let* ((t_0 (* 0.005555555555555556 (* angle PI)))
(t_1 (* (- b_m a) (* (* 2.0 (+ b_m a)) (sin t_0)))))
(if (<= (- (pow b_m 2.0) (pow a 2.0)) -500000.0)
(* t_1 (cos (expm1 (log1p (* PI (* 0.005555555555555556 angle))))))
(* t_1 (pow (cbrt (cos t_0)) 3.0)))))b_m = fabs(b);
double code(double a, double b_m, double angle) {
double t_0 = 0.005555555555555556 * (angle * ((double) M_PI));
double t_1 = (b_m - a) * ((2.0 * (b_m + a)) * sin(t_0));
double tmp;
if ((pow(b_m, 2.0) - pow(a, 2.0)) <= -500000.0) {
tmp = t_1 * cos(expm1(log1p((((double) M_PI) * (0.005555555555555556 * angle)))));
} else {
tmp = t_1 * pow(cbrt(cos(t_0)), 3.0);
}
return tmp;
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle) {
double t_0 = 0.005555555555555556 * (angle * Math.PI);
double t_1 = (b_m - a) * ((2.0 * (b_m + a)) * Math.sin(t_0));
double tmp;
if ((Math.pow(b_m, 2.0) - Math.pow(a, 2.0)) <= -500000.0) {
tmp = t_1 * Math.cos(Math.expm1(Math.log1p((Math.PI * (0.005555555555555556 * angle)))));
} else {
tmp = t_1 * Math.pow(Math.cbrt(Math.cos(t_0)), 3.0);
}
return tmp;
}
b_m = abs(b) function code(a, b_m, angle) t_0 = Float64(0.005555555555555556 * Float64(angle * pi)) t_1 = Float64(Float64(b_m - a) * Float64(Float64(2.0 * Float64(b_m + a)) * sin(t_0))) tmp = 0.0 if (Float64((b_m ^ 2.0) - (a ^ 2.0)) <= -500000.0) tmp = Float64(t_1 * cos(expm1(log1p(Float64(pi * Float64(0.005555555555555556 * angle)))))); else tmp = Float64(t_1 * (cbrt(cos(t_0)) ^ 3.0)); end return tmp end
b_m = N[Abs[b], $MachinePrecision]
code[a_, b$95$m_, angle_] := Block[{t$95$0 = N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(b$95$m - a), $MachinePrecision] * N[(N[(2.0 * N[(b$95$m + a), $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[Power[b$95$m, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision], -500000.0], N[(t$95$1 * N[Cos[N[(Exp[N[Log[1 + N[(Pi * N[(0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[Power[N[Power[N[Cos[t$95$0], $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
t_0 := 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\\
t_1 := \left(b\_m - a\right) \cdot \left(\left(2 \cdot \left(b\_m + a\right)\right) \cdot \sin t\_0\right)\\
\mathbf{if}\;{b\_m}^{2} - {a}^{2} \leq -500000:\\
\;\;\;\;t\_1 \cdot \cos \left(\mathsf{expm1}\left(\mathsf{log1p}\left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot {\left(\sqrt[3]{\cos t\_0}\right)}^{3}\\
\end{array}
\end{array}
if (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < -5e5Initial program 48.0%
add-exp-log19.5%
*-commutative19.5%
div-inv17.0%
metadata-eval17.0%
Applied egg-rr17.0%
rem-exp-log46.7%
add-sqr-sqrt0.0%
add-sqr-sqrt46.7%
unpow246.7%
unpow246.7%
difference-of-squares46.7%
associate-*r*46.7%
associate-*r*61.6%
Applied egg-rr61.6%
*-commutative61.6%
associate-*r*64.0%
*-commutative64.0%
*-commutative64.0%
+-commutative64.0%
Simplified64.0%
div-inv66.5%
metadata-eval66.5%
expm1-log1p-u64.4%
expm1-undefine63.2%
*-commutative63.2%
associate-*l*61.9%
Applied egg-rr61.9%
expm1-define63.2%
associate-*r*64.4%
*-commutative64.4%
*-commutative64.4%
Simplified64.4%
if -5e5 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) Initial program 59.7%
add-exp-log34.3%
*-commutative34.3%
div-inv35.4%
metadata-eval35.4%
Applied egg-rr35.4%
rem-exp-log59.2%
add-sqr-sqrt50.5%
add-sqr-sqrt59.2%
unpow259.2%
unpow259.2%
difference-of-squares63.2%
associate-*r*63.2%
associate-*r*71.1%
Applied egg-rr71.1%
*-commutative71.1%
associate-*r*70.7%
*-commutative70.7%
*-commutative70.7%
+-commutative70.7%
Simplified70.7%
div-inv70.0%
metadata-eval70.0%
add-cube-cbrt70.0%
pow371.2%
*-commutative71.2%
associate-*l*71.4%
Applied egg-rr71.4%
rem-cube-cbrt71.5%
associate-*r*70.0%
metadata-eval70.0%
div-inv70.7%
*-commutative70.7%
add-sqr-sqrt70.3%
unpow270.3%
add-cube-cbrt70.3%
pow370.3%
Applied egg-rr73.0%
Final simplification70.3%
b_m = (fabs.f64 b)
(FPCore (a b_m angle)
:precision binary64
(let* ((t_0 (* 0.005555555555555556 (* angle PI)))
(t_1 (* (- b_m a) (* (* 2.0 (+ b_m a)) (sin t_0)))))
(if (<= (- (pow b_m 2.0) (pow a 2.0)) -500000.0)
(* t_1 (cos (expm1 (log1p (* PI (* 0.005555555555555556 angle))))))
(* t_1 (log (exp (cos t_0)))))))b_m = fabs(b);
double code(double a, double b_m, double angle) {
double t_0 = 0.005555555555555556 * (angle * ((double) M_PI));
double t_1 = (b_m - a) * ((2.0 * (b_m + a)) * sin(t_0));
double tmp;
if ((pow(b_m, 2.0) - pow(a, 2.0)) <= -500000.0) {
tmp = t_1 * cos(expm1(log1p((((double) M_PI) * (0.005555555555555556 * angle)))));
} else {
tmp = t_1 * log(exp(cos(t_0)));
}
return tmp;
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle) {
double t_0 = 0.005555555555555556 * (angle * Math.PI);
double t_1 = (b_m - a) * ((2.0 * (b_m + a)) * Math.sin(t_0));
double tmp;
if ((Math.pow(b_m, 2.0) - Math.pow(a, 2.0)) <= -500000.0) {
tmp = t_1 * Math.cos(Math.expm1(Math.log1p((Math.PI * (0.005555555555555556 * angle)))));
} else {
tmp = t_1 * Math.log(Math.exp(Math.cos(t_0)));
}
return tmp;
}
b_m = math.fabs(b) def code(a, b_m, angle): t_0 = 0.005555555555555556 * (angle * math.pi) t_1 = (b_m - a) * ((2.0 * (b_m + a)) * math.sin(t_0)) tmp = 0 if (math.pow(b_m, 2.0) - math.pow(a, 2.0)) <= -500000.0: tmp = t_1 * math.cos(math.expm1(math.log1p((math.pi * (0.005555555555555556 * angle))))) else: tmp = t_1 * math.log(math.exp(math.cos(t_0))) return tmp
b_m = abs(b) function code(a, b_m, angle) t_0 = Float64(0.005555555555555556 * Float64(angle * pi)) t_1 = Float64(Float64(b_m - a) * Float64(Float64(2.0 * Float64(b_m + a)) * sin(t_0))) tmp = 0.0 if (Float64((b_m ^ 2.0) - (a ^ 2.0)) <= -500000.0) tmp = Float64(t_1 * cos(expm1(log1p(Float64(pi * Float64(0.005555555555555556 * angle)))))); else tmp = Float64(t_1 * log(exp(cos(t_0)))); end return tmp end
b_m = N[Abs[b], $MachinePrecision]
code[a_, b$95$m_, angle_] := Block[{t$95$0 = N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(b$95$m - a), $MachinePrecision] * N[(N[(2.0 * N[(b$95$m + a), $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[Power[b$95$m, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision], -500000.0], N[(t$95$1 * N[Cos[N[(Exp[N[Log[1 + N[(Pi * N[(0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[Log[N[Exp[N[Cos[t$95$0], $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
t_0 := 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\\
t_1 := \left(b\_m - a\right) \cdot \left(\left(2 \cdot \left(b\_m + a\right)\right) \cdot \sin t\_0\right)\\
\mathbf{if}\;{b\_m}^{2} - {a}^{2} \leq -500000:\\
\;\;\;\;t\_1 \cdot \cos \left(\mathsf{expm1}\left(\mathsf{log1p}\left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \log \left(e^{\cos t\_0}\right)\\
\end{array}
\end{array}
if (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < -5e5Initial program 48.0%
add-exp-log19.5%
*-commutative19.5%
div-inv17.0%
metadata-eval17.0%
Applied egg-rr17.0%
rem-exp-log46.7%
add-sqr-sqrt0.0%
add-sqr-sqrt46.7%
unpow246.7%
unpow246.7%
difference-of-squares46.7%
associate-*r*46.7%
associate-*r*61.6%
Applied egg-rr61.6%
*-commutative61.6%
associate-*r*64.0%
*-commutative64.0%
*-commutative64.0%
+-commutative64.0%
Simplified64.0%
div-inv66.5%
metadata-eval66.5%
expm1-log1p-u64.4%
expm1-undefine63.2%
*-commutative63.2%
associate-*l*61.9%
Applied egg-rr61.9%
expm1-define63.2%
associate-*r*64.4%
*-commutative64.4%
*-commutative64.4%
Simplified64.4%
if -5e5 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) Initial program 59.7%
add-exp-log34.3%
*-commutative34.3%
div-inv35.4%
metadata-eval35.4%
Applied egg-rr35.4%
rem-exp-log59.2%
add-sqr-sqrt50.5%
add-sqr-sqrt59.2%
unpow259.2%
unpow259.2%
difference-of-squares63.2%
associate-*r*63.2%
associate-*r*71.1%
Applied egg-rr71.1%
*-commutative71.1%
associate-*r*70.7%
*-commutative70.7%
*-commutative70.7%
+-commutative70.7%
Simplified70.7%
div-inv70.0%
metadata-eval70.0%
add-cube-cbrt70.0%
pow371.2%
*-commutative71.2%
associate-*l*71.4%
Applied egg-rr71.4%
add-log-exp71.4%
rem-cube-cbrt71.5%
*-commutative71.5%
associate-*l*73.0%
*-commutative73.0%
Applied egg-rr73.0%
Final simplification70.3%
b_m = (fabs.f64 b)
(FPCore (a b_m angle)
:precision binary64
(let* ((t_0
(*
(- b_m a)
(* (* 2.0 (+ b_m a)) (sin (* 0.005555555555555556 (* angle PI)))))))
(if (<= (- (pow b_m 2.0) (pow a 2.0)) -5e+114)
(* t_0 (cos (expm1 (log1p (* PI (* 0.005555555555555556 angle))))))
(* t_0 (cos (/ 1.0 (/ 180.0 (* angle PI))))))))b_m = fabs(b);
double code(double a, double b_m, double angle) {
double t_0 = (b_m - a) * ((2.0 * (b_m + a)) * sin((0.005555555555555556 * (angle * ((double) M_PI)))));
double tmp;
if ((pow(b_m, 2.0) - pow(a, 2.0)) <= -5e+114) {
tmp = t_0 * cos(expm1(log1p((((double) M_PI) * (0.005555555555555556 * angle)))));
} else {
tmp = t_0 * cos((1.0 / (180.0 / (angle * ((double) M_PI)))));
}
return tmp;
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle) {
double t_0 = (b_m - a) * ((2.0 * (b_m + a)) * Math.sin((0.005555555555555556 * (angle * Math.PI))));
double tmp;
if ((Math.pow(b_m, 2.0) - Math.pow(a, 2.0)) <= -5e+114) {
tmp = t_0 * Math.cos(Math.expm1(Math.log1p((Math.PI * (0.005555555555555556 * angle)))));
} else {
tmp = t_0 * Math.cos((1.0 / (180.0 / (angle * Math.PI))));
}
return tmp;
}
b_m = math.fabs(b) def code(a, b_m, angle): t_0 = (b_m - a) * ((2.0 * (b_m + a)) * math.sin((0.005555555555555556 * (angle * math.pi)))) tmp = 0 if (math.pow(b_m, 2.0) - math.pow(a, 2.0)) <= -5e+114: tmp = t_0 * math.cos(math.expm1(math.log1p((math.pi * (0.005555555555555556 * angle))))) else: tmp = t_0 * math.cos((1.0 / (180.0 / (angle * math.pi)))) return tmp
b_m = abs(b) function code(a, b_m, angle) t_0 = Float64(Float64(b_m - a) * Float64(Float64(2.0 * Float64(b_m + a)) * sin(Float64(0.005555555555555556 * Float64(angle * pi))))) tmp = 0.0 if (Float64((b_m ^ 2.0) - (a ^ 2.0)) <= -5e+114) tmp = Float64(t_0 * cos(expm1(log1p(Float64(pi * Float64(0.005555555555555556 * angle)))))); else tmp = Float64(t_0 * cos(Float64(1.0 / Float64(180.0 / Float64(angle * pi))))); end return tmp end
b_m = N[Abs[b], $MachinePrecision]
code[a_, b$95$m_, angle_] := Block[{t$95$0 = N[(N[(b$95$m - a), $MachinePrecision] * N[(N[(2.0 * N[(b$95$m + a), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[Power[b$95$m, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision], -5e+114], N[(t$95$0 * N[Cos[N[(Exp[N[Log[1 + N[(Pi * N[(0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[Cos[N[(1.0 / N[(180.0 / N[(angle * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
t_0 := \left(b\_m - a\right) \cdot \left(\left(2 \cdot \left(b\_m + a\right)\right) \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\\
\mathbf{if}\;{b\_m}^{2} - {a}^{2} \leq -5 \cdot 10^{+114}:\\
\;\;\;\;t\_0 \cdot \cos \left(\mathsf{expm1}\left(\mathsf{log1p}\left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \cos \left(\frac{1}{\frac{180}{angle \cdot \pi}}\right)\\
\end{array}
\end{array}
if (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < -5.0000000000000001e114Initial program 47.5%
add-exp-log20.2%
*-commutative20.2%
div-inv17.4%
metadata-eval17.4%
Applied egg-rr17.4%
rem-exp-log46.1%
add-sqr-sqrt0.0%
add-sqr-sqrt46.1%
unpow246.1%
unpow246.1%
difference-of-squares46.1%
associate-*r*46.1%
associate-*r*62.7%
Applied egg-rr62.7%
*-commutative62.7%
associate-*r*64.9%
*-commutative64.9%
*-commutative64.9%
+-commutative64.9%
Simplified64.9%
div-inv67.7%
metadata-eval67.7%
expm1-log1p-u65.6%
expm1-undefine64.2%
*-commutative64.2%
associate-*l*62.8%
Applied egg-rr62.8%
expm1-define64.2%
associate-*r*65.6%
*-commutative65.6%
*-commutative65.6%
Simplified65.6%
if -5.0000000000000001e114 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) Initial program 59.4%
add-exp-log33.3%
*-commutative33.3%
div-inv34.5%
metadata-eval34.5%
Applied egg-rr34.5%
rem-exp-log58.9%
add-sqr-sqrt48.3%
add-sqr-sqrt58.9%
unpow258.9%
unpow258.9%
difference-of-squares62.7%
associate-*r*62.7%
associate-*r*70.3%
Applied egg-rr70.3%
*-commutative70.3%
associate-*r*70.0%
*-commutative70.0%
*-commutative70.0%
+-commutative70.0%
Simplified70.0%
associate-*r/71.1%
*-commutative71.1%
clear-num71.7%
Applied egg-rr71.7%
Final simplification69.9%
b_m = (fabs.f64 b)
(FPCore (a b_m angle)
:precision binary64
(let* ((t_0
(*
(- b_m a)
(* (* 2.0 (+ b_m a)) (sin (* 0.005555555555555556 (* angle PI)))))))
(if (<= b_m 1.55e+148)
(* t_0 (cos (expm1 (log1p (* PI (* 0.005555555555555556 angle))))))
(* t_0 (cos (* (/ angle 180.0) (pow (cbrt (pow PI 1.5)) 2.0)))))))b_m = fabs(b);
double code(double a, double b_m, double angle) {
double t_0 = (b_m - a) * ((2.0 * (b_m + a)) * sin((0.005555555555555556 * (angle * ((double) M_PI)))));
double tmp;
if (b_m <= 1.55e+148) {
tmp = t_0 * cos(expm1(log1p((((double) M_PI) * (0.005555555555555556 * angle)))));
} else {
tmp = t_0 * cos(((angle / 180.0) * pow(cbrt(pow(((double) M_PI), 1.5)), 2.0)));
}
return tmp;
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle) {
double t_0 = (b_m - a) * ((2.0 * (b_m + a)) * Math.sin((0.005555555555555556 * (angle * Math.PI))));
double tmp;
if (b_m <= 1.55e+148) {
tmp = t_0 * Math.cos(Math.expm1(Math.log1p((Math.PI * (0.005555555555555556 * angle)))));
} else {
tmp = t_0 * Math.cos(((angle / 180.0) * Math.pow(Math.cbrt(Math.pow(Math.PI, 1.5)), 2.0)));
}
return tmp;
}
b_m = abs(b) function code(a, b_m, angle) t_0 = Float64(Float64(b_m - a) * Float64(Float64(2.0 * Float64(b_m + a)) * sin(Float64(0.005555555555555556 * Float64(angle * pi))))) tmp = 0.0 if (b_m <= 1.55e+148) tmp = Float64(t_0 * cos(expm1(log1p(Float64(pi * Float64(0.005555555555555556 * angle)))))); else tmp = Float64(t_0 * cos(Float64(Float64(angle / 180.0) * (cbrt((pi ^ 1.5)) ^ 2.0)))); end return tmp end
b_m = N[Abs[b], $MachinePrecision]
code[a_, b$95$m_, angle_] := Block[{t$95$0 = N[(N[(b$95$m - a), $MachinePrecision] * N[(N[(2.0 * N[(b$95$m + a), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b$95$m, 1.55e+148], N[(t$95$0 * N[Cos[N[(Exp[N[Log[1 + N[(Pi * N[(0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[Cos[N[(N[(angle / 180.0), $MachinePrecision] * N[Power[N[Power[N[Power[Pi, 1.5], $MachinePrecision], 1/3], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
t_0 := \left(b\_m - a\right) \cdot \left(\left(2 \cdot \left(b\_m + a\right)\right) \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\\
\mathbf{if}\;b\_m \leq 1.55 \cdot 10^{+148}:\\
\;\;\;\;t\_0 \cdot \cos \left(\mathsf{expm1}\left(\mathsf{log1p}\left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \cos \left(\frac{angle}{180} \cdot {\left(\sqrt[3]{{\pi}^{1.5}}\right)}^{2}\right)\\
\end{array}
\end{array}
if b < 1.54999999999999988e148Initial program 58.0%
add-exp-log31.8%
*-commutative31.8%
div-inv30.9%
metadata-eval30.9%
Applied egg-rr30.9%
rem-exp-log56.2%
add-sqr-sqrt33.0%
add-sqr-sqrt56.2%
unpow256.2%
unpow256.2%
difference-of-squares58.0%
associate-*r*58.0%
associate-*r*66.2%
Applied egg-rr66.2%
*-commutative66.2%
associate-*r*66.7%
*-commutative66.7%
*-commutative66.7%
+-commutative66.7%
Simplified66.7%
div-inv67.1%
metadata-eval67.1%
expm1-log1p-u61.2%
expm1-undefine60.7%
*-commutative60.7%
associate-*l*60.3%
Applied egg-rr60.3%
expm1-define60.7%
associate-*r*61.2%
*-commutative61.2%
*-commutative61.2%
Simplified61.2%
if 1.54999999999999988e148 < b Initial program 41.4%
add-exp-log13.6%
*-commutative13.6%
div-inv20.3%
metadata-eval20.3%
Applied egg-rr20.3%
rem-exp-log48.0%
add-sqr-sqrt48.0%
add-sqr-sqrt48.0%
unpow248.0%
unpow248.0%
difference-of-squares58.2%
associate-*r*58.2%
associate-*r*82.8%
Applied egg-rr82.8%
*-commutative82.8%
associate-*r*82.9%
*-commutative82.9%
*-commutative82.9%
+-commutative82.9%
Simplified82.9%
add-sqr-sqrt79.6%
pow279.6%
Applied egg-rr79.6%
add-cbrt-cube79.6%
pow1/379.6%
add-sqr-sqrt79.6%
pow179.6%
pow1/279.6%
pow-prod-up79.6%
metadata-eval79.6%
Applied egg-rr79.6%
unpow1/389.6%
Simplified89.6%
Final simplification64.5%
b_m = (fabs.f64 b)
(FPCore (a b_m angle)
:precision binary64
(let* ((t_0
(*
(- b_m a)
(* (* 2.0 (+ b_m a)) (sin (* 0.005555555555555556 (* angle PI)))))))
(if (<= (- (pow b_m 2.0) (pow a 2.0)) -2e+134)
t_0
(* t_0 (cos (/ 1.0 (/ 180.0 (* angle PI))))))))b_m = fabs(b);
double code(double a, double b_m, double angle) {
double t_0 = (b_m - a) * ((2.0 * (b_m + a)) * sin((0.005555555555555556 * (angle * ((double) M_PI)))));
double tmp;
if ((pow(b_m, 2.0) - pow(a, 2.0)) <= -2e+134) {
tmp = t_0;
} else {
tmp = t_0 * cos((1.0 / (180.0 / (angle * ((double) M_PI)))));
}
return tmp;
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle) {
double t_0 = (b_m - a) * ((2.0 * (b_m + a)) * Math.sin((0.005555555555555556 * (angle * Math.PI))));
double tmp;
if ((Math.pow(b_m, 2.0) - Math.pow(a, 2.0)) <= -2e+134) {
tmp = t_0;
} else {
tmp = t_0 * Math.cos((1.0 / (180.0 / (angle * Math.PI))));
}
return tmp;
}
b_m = math.fabs(b) def code(a, b_m, angle): t_0 = (b_m - a) * ((2.0 * (b_m + a)) * math.sin((0.005555555555555556 * (angle * math.pi)))) tmp = 0 if (math.pow(b_m, 2.0) - math.pow(a, 2.0)) <= -2e+134: tmp = t_0 else: tmp = t_0 * math.cos((1.0 / (180.0 / (angle * math.pi)))) return tmp
b_m = abs(b) function code(a, b_m, angle) t_0 = Float64(Float64(b_m - a) * Float64(Float64(2.0 * Float64(b_m + a)) * sin(Float64(0.005555555555555556 * Float64(angle * pi))))) tmp = 0.0 if (Float64((b_m ^ 2.0) - (a ^ 2.0)) <= -2e+134) tmp = t_0; else tmp = Float64(t_0 * cos(Float64(1.0 / Float64(180.0 / Float64(angle * pi))))); end return tmp end
b_m = abs(b); function tmp_2 = code(a, b_m, angle) t_0 = (b_m - a) * ((2.0 * (b_m + a)) * sin((0.005555555555555556 * (angle * pi)))); tmp = 0.0; if (((b_m ^ 2.0) - (a ^ 2.0)) <= -2e+134) tmp = t_0; else tmp = t_0 * cos((1.0 / (180.0 / (angle * pi)))); end tmp_2 = tmp; end
b_m = N[Abs[b], $MachinePrecision]
code[a_, b$95$m_, angle_] := Block[{t$95$0 = N[(N[(b$95$m - a), $MachinePrecision] * N[(N[(2.0 * N[(b$95$m + a), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[Power[b$95$m, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision], -2e+134], t$95$0, N[(t$95$0 * N[Cos[N[(1.0 / N[(180.0 / N[(angle * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
t_0 := \left(b\_m - a\right) \cdot \left(\left(2 \cdot \left(b\_m + a\right)\right) \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\\
\mathbf{if}\;{b\_m}^{2} - {a}^{2} \leq -2 \cdot 10^{+134}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \cos \left(\frac{1}{\frac{180}{angle \cdot \pi}}\right)\\
\end{array}
\end{array}
if (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < -1.99999999999999984e134Initial program 47.5%
add-exp-log19.7%
*-commutative19.7%
div-inv16.8%
metadata-eval16.8%
Applied egg-rr16.8%
rem-exp-log46.1%
add-sqr-sqrt0.0%
add-sqr-sqrt46.1%
unpow246.1%
unpow246.1%
difference-of-squares46.1%
associate-*r*46.1%
associate-*r*63.3%
Applied egg-rr63.3%
*-commutative63.3%
associate-*r*65.6%
*-commutative65.6%
*-commutative65.6%
+-commutative65.6%
Simplified65.6%
Taylor expanded in angle around 0 76.0%
if -1.99999999999999984e134 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) Initial program 59.2%
add-exp-log33.3%
*-commutative33.3%
div-inv34.4%
metadata-eval34.4%
Applied egg-rr34.4%
rem-exp-log58.7%
add-sqr-sqrt47.5%
add-sqr-sqrt58.7%
unpow258.7%
unpow258.7%
difference-of-squares62.4%
associate-*r*62.4%
associate-*r*69.9%
Applied egg-rr69.9%
*-commutative69.9%
associate-*r*69.7%
*-commutative69.7%
*-commutative69.7%
+-commutative69.7%
Simplified69.7%
associate-*r/70.6%
*-commutative70.6%
clear-num71.2%
Applied egg-rr71.2%
Final simplification72.5%
b_m = (fabs.f64 b)
(FPCore (a b_m angle)
:precision binary64
(let* ((t_0
(*
(- b_m a)
(* (* 2.0 (+ b_m a)) (sin (* 0.005555555555555556 (* angle PI)))))))
(if (<= (- (pow b_m 2.0) (pow a 2.0)) (- INFINITY))
t_0
(* t_0 (cos (* angle (/ PI 180.0)))))))b_m = fabs(b);
double code(double a, double b_m, double angle) {
double t_0 = (b_m - a) * ((2.0 * (b_m + a)) * sin((0.005555555555555556 * (angle * ((double) M_PI)))));
double tmp;
if ((pow(b_m, 2.0) - pow(a, 2.0)) <= -((double) INFINITY)) {
tmp = t_0;
} else {
tmp = t_0 * cos((angle * (((double) M_PI) / 180.0)));
}
return tmp;
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle) {
double t_0 = (b_m - a) * ((2.0 * (b_m + a)) * Math.sin((0.005555555555555556 * (angle * Math.PI))));
double tmp;
if ((Math.pow(b_m, 2.0) - Math.pow(a, 2.0)) <= -Double.POSITIVE_INFINITY) {
tmp = t_0;
} else {
tmp = t_0 * Math.cos((angle * (Math.PI / 180.0)));
}
return tmp;
}
b_m = math.fabs(b) def code(a, b_m, angle): t_0 = (b_m - a) * ((2.0 * (b_m + a)) * math.sin((0.005555555555555556 * (angle * math.pi)))) tmp = 0 if (math.pow(b_m, 2.0) - math.pow(a, 2.0)) <= -math.inf: tmp = t_0 else: tmp = t_0 * math.cos((angle * (math.pi / 180.0))) return tmp
b_m = abs(b) function code(a, b_m, angle) t_0 = Float64(Float64(b_m - a) * Float64(Float64(2.0 * Float64(b_m + a)) * sin(Float64(0.005555555555555556 * Float64(angle * pi))))) tmp = 0.0 if (Float64((b_m ^ 2.0) - (a ^ 2.0)) <= Float64(-Inf)) tmp = t_0; else tmp = Float64(t_0 * cos(Float64(angle * Float64(pi / 180.0)))); end return tmp end
b_m = abs(b); function tmp_2 = code(a, b_m, angle) t_0 = (b_m - a) * ((2.0 * (b_m + a)) * sin((0.005555555555555556 * (angle * pi)))); tmp = 0.0; if (((b_m ^ 2.0) - (a ^ 2.0)) <= -Inf) tmp = t_0; else tmp = t_0 * cos((angle * (pi / 180.0))); end tmp_2 = tmp; end
b_m = N[Abs[b], $MachinePrecision]
code[a_, b$95$m_, angle_] := Block[{t$95$0 = N[(N[(b$95$m - a), $MachinePrecision] * N[(N[(2.0 * N[(b$95$m + a), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[Power[b$95$m, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision], (-Infinity)], t$95$0, N[(t$95$0 * N[Cos[N[(angle * N[(Pi / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
t_0 := \left(b\_m - a\right) \cdot \left(\left(2 \cdot \left(b\_m + a\right)\right) \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\\
\mathbf{if}\;{b\_m}^{2} - {a}^{2} \leq -\infty:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \cos \left(angle \cdot \frac{\pi}{180}\right)\\
\end{array}
\end{array}
if (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < -inf.0Initial program 43.3%
add-exp-log22.1%
*-commutative22.1%
div-inv18.4%
metadata-eval18.4%
Applied egg-rr18.4%
rem-exp-log41.4%
add-sqr-sqrt0.0%
add-sqr-sqrt41.4%
unpow241.4%
unpow241.4%
difference-of-squares41.4%
associate-*r*41.4%
associate-*r*64.0%
Applied egg-rr64.0%
*-commutative64.0%
associate-*r*67.8%
*-commutative67.8%
*-commutative67.8%
+-commutative67.8%
Simplified67.8%
Taylor expanded in angle around 0 81.0%
if -inf.0 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) Initial program 59.4%
add-exp-log31.6%
*-commutative31.6%
div-inv32.6%
metadata-eval32.6%
Applied egg-rr32.6%
rem-exp-log58.9%
add-sqr-sqrt43.8%
add-sqr-sqrt58.9%
unpow258.9%
unpow258.9%
difference-of-squares62.4%
associate-*r*62.4%
associate-*r*69.2%
Applied egg-rr69.2%
*-commutative69.2%
associate-*r*68.8%
*-commutative68.8%
*-commutative68.8%
+-commutative68.8%
Simplified68.8%
div-inv68.2%
metadata-eval68.2%
add-cube-cbrt68.3%
pow369.3%
*-commutative69.3%
associate-*l*69.6%
Applied egg-rr69.6%
rem-cube-cbrt69.7%
associate-*r*68.2%
metadata-eval68.2%
div-inv68.8%
*-commutative68.8%
clear-num68.9%
un-div-inv69.9%
Applied egg-rr69.9%
associate-/r/69.7%
Simplified69.7%
Final simplification72.0%
b_m = (fabs.f64 b)
(FPCore (a b_m angle)
:precision binary64
(let* ((t_0 (* 2.0 (+ b_m a))))
(if (<= (- (pow b_m 2.0) (pow a 2.0)) -5e+299)
(* (- b_m a) (* t_0 (sin (* 0.005555555555555556 (* angle PI)))))
(*
(* t_0 (* (- b_m a) (sin (* PI (* 0.005555555555555556 angle)))))
(cos (* PI (/ angle 180.0)))))))b_m = fabs(b);
double code(double a, double b_m, double angle) {
double t_0 = 2.0 * (b_m + a);
double tmp;
if ((pow(b_m, 2.0) - pow(a, 2.0)) <= -5e+299) {
tmp = (b_m - a) * (t_0 * sin((0.005555555555555556 * (angle * ((double) M_PI)))));
} else {
tmp = (t_0 * ((b_m - a) * sin((((double) M_PI) * (0.005555555555555556 * angle))))) * cos((((double) M_PI) * (angle / 180.0)));
}
return tmp;
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle) {
double t_0 = 2.0 * (b_m + a);
double tmp;
if ((Math.pow(b_m, 2.0) - Math.pow(a, 2.0)) <= -5e+299) {
tmp = (b_m - a) * (t_0 * Math.sin((0.005555555555555556 * (angle * Math.PI))));
} else {
tmp = (t_0 * ((b_m - a) * Math.sin((Math.PI * (0.005555555555555556 * angle))))) * Math.cos((Math.PI * (angle / 180.0)));
}
return tmp;
}
b_m = math.fabs(b) def code(a, b_m, angle): t_0 = 2.0 * (b_m + a) tmp = 0 if (math.pow(b_m, 2.0) - math.pow(a, 2.0)) <= -5e+299: tmp = (b_m - a) * (t_0 * math.sin((0.005555555555555556 * (angle * math.pi)))) else: tmp = (t_0 * ((b_m - a) * math.sin((math.pi * (0.005555555555555556 * angle))))) * math.cos((math.pi * (angle / 180.0))) return tmp
b_m = abs(b) function code(a, b_m, angle) t_0 = Float64(2.0 * Float64(b_m + a)) tmp = 0.0 if (Float64((b_m ^ 2.0) - (a ^ 2.0)) <= -5e+299) tmp = Float64(Float64(b_m - a) * Float64(t_0 * sin(Float64(0.005555555555555556 * Float64(angle * pi))))); else tmp = Float64(Float64(t_0 * Float64(Float64(b_m - a) * sin(Float64(pi * Float64(0.005555555555555556 * angle))))) * cos(Float64(pi * Float64(angle / 180.0)))); end return tmp end
b_m = abs(b); function tmp_2 = code(a, b_m, angle) t_0 = 2.0 * (b_m + a); tmp = 0.0; if (((b_m ^ 2.0) - (a ^ 2.0)) <= -5e+299) tmp = (b_m - a) * (t_0 * sin((0.005555555555555556 * (angle * pi)))); else tmp = (t_0 * ((b_m - a) * sin((pi * (0.005555555555555556 * angle))))) * cos((pi * (angle / 180.0))); end tmp_2 = tmp; end
b_m = N[Abs[b], $MachinePrecision]
code[a_, b$95$m_, angle_] := Block[{t$95$0 = N[(2.0 * N[(b$95$m + a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[Power[b$95$m, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision], -5e+299], N[(N[(b$95$m - a), $MachinePrecision] * N[(t$95$0 * N[Sin[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$0 * N[(N[(b$95$m - a), $MachinePrecision] * N[Sin[N[(Pi * N[(0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
t_0 := 2 \cdot \left(b\_m + a\right)\\
\mathbf{if}\;{b\_m}^{2} - {a}^{2} \leq -5 \cdot 10^{+299}:\\
\;\;\;\;\left(b\_m - a\right) \cdot \left(t\_0 \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(t\_0 \cdot \left(\left(b\_m - a\right) \cdot \sin \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right)\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\\
\end{array}
\end{array}
if (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < -5.0000000000000003e299Initial program 42.5%
add-exp-log21.7%
*-commutative21.7%
div-inv18.0%
metadata-eval18.0%
Applied egg-rr18.0%
rem-exp-log40.7%
add-sqr-sqrt0.0%
add-sqr-sqrt40.7%
unpow240.7%
unpow240.7%
difference-of-squares40.7%
associate-*r*40.7%
associate-*r*62.8%
Applied egg-rr62.8%
*-commutative62.8%
associate-*r*66.6%
*-commutative66.6%
*-commutative66.6%
+-commutative66.6%
Simplified66.6%
Taylor expanded in angle around 0 79.5%
if -5.0000000000000003e299 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) Initial program 59.7%
add-exp-log31.8%
*-commutative31.8%
div-inv32.8%
metadata-eval32.8%
Applied egg-rr32.8%
rem-exp-log55.5%
*-commutative55.5%
add-sqr-sqrt40.9%
add-sqr-sqrt55.5%
unpow255.5%
unpow255.5%
difference-of-squares58.0%
associate-*r*58.0%
associate-*l*64.9%
Applied egg-rr69.6%
Final simplification71.7%
b_m = (fabs.f64 b)
(FPCore (a b_m angle)
:precision binary64
(let* ((t_0 (sin (* PI (* 0.005555555555555556 angle)))))
(if (<= (- (pow b_m 2.0) (pow a 2.0)) 5e-97)
(* (* 2.0 (+ b_m a)) (* (- b_m a) t_0))
(* (cos (* PI (/ angle 180.0))) (* 2.0 (* b_m (* b_m t_0)))))))b_m = fabs(b);
double code(double a, double b_m, double angle) {
double t_0 = sin((((double) M_PI) * (0.005555555555555556 * angle)));
double tmp;
if ((pow(b_m, 2.0) - pow(a, 2.0)) <= 5e-97) {
tmp = (2.0 * (b_m + a)) * ((b_m - a) * t_0);
} else {
tmp = cos((((double) M_PI) * (angle / 180.0))) * (2.0 * (b_m * (b_m * t_0)));
}
return tmp;
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle) {
double t_0 = Math.sin((Math.PI * (0.005555555555555556 * angle)));
double tmp;
if ((Math.pow(b_m, 2.0) - Math.pow(a, 2.0)) <= 5e-97) {
tmp = (2.0 * (b_m + a)) * ((b_m - a) * t_0);
} else {
tmp = Math.cos((Math.PI * (angle / 180.0))) * (2.0 * (b_m * (b_m * t_0)));
}
return tmp;
}
b_m = math.fabs(b) def code(a, b_m, angle): t_0 = math.sin((math.pi * (0.005555555555555556 * angle))) tmp = 0 if (math.pow(b_m, 2.0) - math.pow(a, 2.0)) <= 5e-97: tmp = (2.0 * (b_m + a)) * ((b_m - a) * t_0) else: tmp = math.cos((math.pi * (angle / 180.0))) * (2.0 * (b_m * (b_m * t_0))) return tmp
b_m = abs(b) function code(a, b_m, angle) t_0 = sin(Float64(pi * Float64(0.005555555555555556 * angle))) tmp = 0.0 if (Float64((b_m ^ 2.0) - (a ^ 2.0)) <= 5e-97) tmp = Float64(Float64(2.0 * Float64(b_m + a)) * Float64(Float64(b_m - a) * t_0)); else tmp = Float64(cos(Float64(pi * Float64(angle / 180.0))) * Float64(2.0 * Float64(b_m * Float64(b_m * t_0)))); end return tmp end
b_m = abs(b); function tmp_2 = code(a, b_m, angle) t_0 = sin((pi * (0.005555555555555556 * angle))); tmp = 0.0; if (((b_m ^ 2.0) - (a ^ 2.0)) <= 5e-97) tmp = (2.0 * (b_m + a)) * ((b_m - a) * t_0); else tmp = cos((pi * (angle / 180.0))) * (2.0 * (b_m * (b_m * t_0))); end tmp_2 = tmp; end
b_m = N[Abs[b], $MachinePrecision]
code[a_, b$95$m_, angle_] := Block[{t$95$0 = N[Sin[N[(Pi * N[(0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(N[Power[b$95$m, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision], 5e-97], N[(N[(2.0 * N[(b$95$m + a), $MachinePrecision]), $MachinePrecision] * N[(N[(b$95$m - a), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[Cos[N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(2.0 * N[(b$95$m * N[(b$95$m * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
t_0 := \sin \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right)\\
\mathbf{if}\;{b\_m}^{2} - {a}^{2} \leq 5 \cdot 10^{-97}:\\
\;\;\;\;\left(2 \cdot \left(b\_m + a\right)\right) \cdot \left(\left(b\_m - a\right) \cdot t\_0\right)\\
\mathbf{else}:\\
\;\;\;\;\cos \left(\pi \cdot \frac{angle}{180}\right) \cdot \left(2 \cdot \left(b\_m \cdot \left(b\_m \cdot t\_0\right)\right)\right)\\
\end{array}
\end{array}
if (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < 4.9999999999999995e-97Initial program 56.6%
add-exp-log36.3%
*-commutative36.3%
div-inv34.9%
metadata-eval34.9%
Applied egg-rr34.9%
Taylor expanded in angle around 0 37.9%
rem-exp-log61.8%
*-commutative61.8%
add-sqr-sqrt18.8%
add-sqr-sqrt61.8%
unpow261.8%
unpow261.8%
difference-of-squares61.8%
associate-*r*61.8%
associate-*l*70.2%
Applied egg-rr70.2%
if 4.9999999999999995e-97 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) Initial program 55.3%
unpow255.3%
unpow255.3%
difference-of-squares61.4%
Applied egg-rr61.4%
add-log-exp23.8%
div-inv22.9%
metadata-eval22.9%
Applied egg-rr22.9%
Taylor expanded in a around 0 57.9%
Simplified70.9%
Final simplification70.5%
b_m = (fabs.f64 b)
(FPCore (a b_m angle)
:precision binary64
(let* ((t_0 (* 2.0 (+ b_m a))))
(if (<= (pow b_m 2.0) 5e-97)
(* t_0 (* (- b_m a) (sin (* PI (* 0.005555555555555556 angle)))))
(*
(* (- b_m a) (* t_0 (sin (* 0.005555555555555556 (* angle PI)))))
(cos (/ PI (/ 180.0 angle)))))))b_m = fabs(b);
double code(double a, double b_m, double angle) {
double t_0 = 2.0 * (b_m + a);
double tmp;
if (pow(b_m, 2.0) <= 5e-97) {
tmp = t_0 * ((b_m - a) * sin((((double) M_PI) * (0.005555555555555556 * angle))));
} else {
tmp = ((b_m - a) * (t_0 * sin((0.005555555555555556 * (angle * ((double) M_PI)))))) * cos((((double) M_PI) / (180.0 / angle)));
}
return tmp;
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle) {
double t_0 = 2.0 * (b_m + a);
double tmp;
if (Math.pow(b_m, 2.0) <= 5e-97) {
tmp = t_0 * ((b_m - a) * Math.sin((Math.PI * (0.005555555555555556 * angle))));
} else {
tmp = ((b_m - a) * (t_0 * Math.sin((0.005555555555555556 * (angle * Math.PI))))) * Math.cos((Math.PI / (180.0 / angle)));
}
return tmp;
}
b_m = math.fabs(b) def code(a, b_m, angle): t_0 = 2.0 * (b_m + a) tmp = 0 if math.pow(b_m, 2.0) <= 5e-97: tmp = t_0 * ((b_m - a) * math.sin((math.pi * (0.005555555555555556 * angle)))) else: tmp = ((b_m - a) * (t_0 * math.sin((0.005555555555555556 * (angle * math.pi))))) * math.cos((math.pi / (180.0 / angle))) return tmp
b_m = abs(b) function code(a, b_m, angle) t_0 = Float64(2.0 * Float64(b_m + a)) tmp = 0.0 if ((b_m ^ 2.0) <= 5e-97) tmp = Float64(t_0 * Float64(Float64(b_m - a) * sin(Float64(pi * Float64(0.005555555555555556 * angle))))); else tmp = Float64(Float64(Float64(b_m - a) * Float64(t_0 * sin(Float64(0.005555555555555556 * Float64(angle * pi))))) * cos(Float64(pi / Float64(180.0 / angle)))); end return tmp end
b_m = abs(b); function tmp_2 = code(a, b_m, angle) t_0 = 2.0 * (b_m + a); tmp = 0.0; if ((b_m ^ 2.0) <= 5e-97) tmp = t_0 * ((b_m - a) * sin((pi * (0.005555555555555556 * angle)))); else tmp = ((b_m - a) * (t_0 * sin((0.005555555555555556 * (angle * pi))))) * cos((pi / (180.0 / angle))); end tmp_2 = tmp; end
b_m = N[Abs[b], $MachinePrecision]
code[a_, b$95$m_, angle_] := Block[{t$95$0 = N[(2.0 * N[(b$95$m + a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Power[b$95$m, 2.0], $MachinePrecision], 5e-97], N[(t$95$0 * N[(N[(b$95$m - a), $MachinePrecision] * N[Sin[N[(Pi * N[(0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b$95$m - a), $MachinePrecision] * N[(t$95$0 * N[Sin[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(Pi / N[(180.0 / angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
t_0 := 2 \cdot \left(b\_m + a\right)\\
\mathbf{if}\;{b\_m}^{2} \leq 5 \cdot 10^{-97}:\\
\;\;\;\;t\_0 \cdot \left(\left(b\_m - a\right) \cdot \sin \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(b\_m - a\right) \cdot \left(t\_0 \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right) \cdot \cos \left(\frac{\pi}{\frac{180}{angle}}\right)\\
\end{array}
\end{array}
if (pow.f64 b #s(literal 2 binary64)) < 4.9999999999999995e-97Initial program 57.1%
add-exp-log40.0%
*-commutative40.0%
div-inv39.2%
metadata-eval39.2%
Applied egg-rr39.2%
Taylor expanded in angle around 0 41.9%
rem-exp-log62.9%
*-commutative62.9%
add-sqr-sqrt24.2%
add-sqr-sqrt62.9%
unpow262.9%
unpow262.9%
difference-of-squares62.9%
associate-*r*62.9%
associate-*l*71.3%
Applied egg-rr71.3%
if 4.9999999999999995e-97 < (pow.f64 b #s(literal 2 binary64)) Initial program 55.3%
add-exp-log21.8%
*-commutative21.8%
div-inv22.5%
metadata-eval22.5%
Applied egg-rr22.5%
rem-exp-log54.5%
add-sqr-sqrt42.8%
add-sqr-sqrt54.5%
unpow254.5%
unpow254.5%
difference-of-squares59.3%
associate-*r*59.3%
associate-*r*70.7%
Applied egg-rr70.7%
*-commutative70.7%
associate-*r*70.5%
*-commutative70.5%
*-commutative70.5%
+-commutative70.5%
Simplified70.5%
clear-num71.8%
un-div-inv72.9%
Applied egg-rr72.9%
Final simplification72.2%
b_m = (fabs.f64 b)
(FPCore (a b_m angle)
:precision binary64
(if (<= (/ angle 180.0) 2e+58)
(*
(* 2.0 (+ b_m a))
(* (- b_m a) (sin (* PI (* 0.005555555555555556 angle)))))
(* (* (- b_m a) (+ b_m a)) (* 2.0 (sin (* PI (/ angle 180.0)))))))b_m = fabs(b);
double code(double a, double b_m, double angle) {
double tmp;
if ((angle / 180.0) <= 2e+58) {
tmp = (2.0 * (b_m + a)) * ((b_m - a) * sin((((double) M_PI) * (0.005555555555555556 * angle))));
} else {
tmp = ((b_m - a) * (b_m + a)) * (2.0 * sin((((double) M_PI) * (angle / 180.0))));
}
return tmp;
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle) {
double tmp;
if ((angle / 180.0) <= 2e+58) {
tmp = (2.0 * (b_m + a)) * ((b_m - a) * Math.sin((Math.PI * (0.005555555555555556 * angle))));
} else {
tmp = ((b_m - a) * (b_m + a)) * (2.0 * Math.sin((Math.PI * (angle / 180.0))));
}
return tmp;
}
b_m = math.fabs(b) def code(a, b_m, angle): tmp = 0 if (angle / 180.0) <= 2e+58: tmp = (2.0 * (b_m + a)) * ((b_m - a) * math.sin((math.pi * (0.005555555555555556 * angle)))) else: tmp = ((b_m - a) * (b_m + a)) * (2.0 * math.sin((math.pi * (angle / 180.0)))) return tmp
b_m = abs(b) function code(a, b_m, angle) tmp = 0.0 if (Float64(angle / 180.0) <= 2e+58) tmp = Float64(Float64(2.0 * Float64(b_m + a)) * Float64(Float64(b_m - a) * sin(Float64(pi * Float64(0.005555555555555556 * angle))))); else tmp = Float64(Float64(Float64(b_m - a) * Float64(b_m + a)) * Float64(2.0 * sin(Float64(pi * Float64(angle / 180.0))))); end return tmp end
b_m = abs(b); function tmp_2 = code(a, b_m, angle) tmp = 0.0; if ((angle / 180.0) <= 2e+58) tmp = (2.0 * (b_m + a)) * ((b_m - a) * sin((pi * (0.005555555555555556 * angle)))); else tmp = ((b_m - a) * (b_m + a)) * (2.0 * sin((pi * (angle / 180.0)))); end tmp_2 = tmp; end
b_m = N[Abs[b], $MachinePrecision] code[a_, b$95$m_, angle_] := If[LessEqual[N[(angle / 180.0), $MachinePrecision], 2e+58], N[(N[(2.0 * N[(b$95$m + a), $MachinePrecision]), $MachinePrecision] * N[(N[(b$95$m - a), $MachinePrecision] * N[Sin[N[(Pi * N[(0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b$95$m - a), $MachinePrecision] * N[(b$95$m + a), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[Sin[N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
\mathbf{if}\;\frac{angle}{180} \leq 2 \cdot 10^{+58}:\\
\;\;\;\;\left(2 \cdot \left(b\_m + a\right)\right) \cdot \left(\left(b\_m - a\right) \cdot \sin \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(b\_m - a\right) \cdot \left(b\_m + a\right)\right) \cdot \left(2 \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 1.99999999999999989e58Initial program 63.5%
add-exp-log33.4%
*-commutative33.4%
div-inv32.8%
metadata-eval32.8%
Applied egg-rr32.8%
Taylor expanded in angle around 0 32.9%
rem-exp-log62.7%
*-commutative62.7%
add-sqr-sqrt36.0%
add-sqr-sqrt62.7%
unpow262.7%
unpow262.7%
difference-of-squares64.2%
associate-*r*64.2%
associate-*l*76.8%
Applied egg-rr76.8%
if 1.99999999999999989e58 < (/.f64 angle #s(literal 180 binary64)) Initial program 26.1%
associate-*l*26.1%
*-commutative26.1%
associate-*l*26.1%
Simplified26.1%
unpow226.1%
unpow226.1%
difference-of-squares30.0%
Applied egg-rr30.0%
Taylor expanded in angle around 0 42.1%
Final simplification69.9%
b_m = (fabs.f64 b) (FPCore (a b_m angle) :precision binary64 (* (- b_m a) (* (* 2.0 (+ b_m a)) (sin (* 0.005555555555555556 (* angle PI))))))
b_m = fabs(b);
double code(double a, double b_m, double angle) {
return (b_m - a) * ((2.0 * (b_m + a)) * sin((0.005555555555555556 * (angle * ((double) M_PI)))));
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle) {
return (b_m - a) * ((2.0 * (b_m + a)) * Math.sin((0.005555555555555556 * (angle * Math.PI))));
}
b_m = math.fabs(b) def code(a, b_m, angle): return (b_m - a) * ((2.0 * (b_m + a)) * math.sin((0.005555555555555556 * (angle * math.pi))))
b_m = abs(b) function code(a, b_m, angle) return Float64(Float64(b_m - a) * Float64(Float64(2.0 * Float64(b_m + a)) * sin(Float64(0.005555555555555556 * Float64(angle * pi))))) end
b_m = abs(b); function tmp = code(a, b_m, angle) tmp = (b_m - a) * ((2.0 * (b_m + a)) * sin((0.005555555555555556 * (angle * pi)))); end
b_m = N[Abs[b], $MachinePrecision] code[a_, b$95$m_, angle_] := N[(N[(b$95$m - a), $MachinePrecision] * N[(N[(2.0 * N[(b$95$m + a), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
b_m = \left|b\right|
\\
\left(b\_m - a\right) \cdot \left(\left(2 \cdot \left(b\_m + a\right)\right) \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)
\end{array}
Initial program 56.0%
add-exp-log29.6%
*-commutative29.6%
div-inv29.7%
metadata-eval29.7%
Applied egg-rr29.7%
rem-exp-log55.3%
add-sqr-sqrt34.7%
add-sqr-sqrt55.3%
unpow255.3%
unpow255.3%
difference-of-squares58.0%
associate-*r*58.0%
associate-*r*68.1%
Applied egg-rr68.1%
*-commutative68.1%
associate-*r*68.6%
*-commutative68.6%
*-commutative68.6%
+-commutative68.6%
Simplified68.6%
Taylor expanded in angle around 0 68.8%
Final simplification68.8%
b_m = (fabs.f64 b) (FPCore (a b_m angle) :precision binary64 (* (* 2.0 (+ b_m a)) (* (- b_m a) (sin (* PI (* 0.005555555555555556 angle))))))
b_m = fabs(b);
double code(double a, double b_m, double angle) {
return (2.0 * (b_m + a)) * ((b_m - a) * sin((((double) M_PI) * (0.005555555555555556 * angle))));
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle) {
return (2.0 * (b_m + a)) * ((b_m - a) * Math.sin((Math.PI * (0.005555555555555556 * angle))));
}
b_m = math.fabs(b) def code(a, b_m, angle): return (2.0 * (b_m + a)) * ((b_m - a) * math.sin((math.pi * (0.005555555555555556 * angle))))
b_m = abs(b) function code(a, b_m, angle) return Float64(Float64(2.0 * Float64(b_m + a)) * Float64(Float64(b_m - a) * sin(Float64(pi * Float64(0.005555555555555556 * angle))))) end
b_m = abs(b); function tmp = code(a, b_m, angle) tmp = (2.0 * (b_m + a)) * ((b_m - a) * sin((pi * (0.005555555555555556 * angle)))); end
b_m = N[Abs[b], $MachinePrecision] code[a_, b$95$m_, angle_] := N[(N[(2.0 * N[(b$95$m + a), $MachinePrecision]), $MachinePrecision] * N[(N[(b$95$m - a), $MachinePrecision] * N[Sin[N[(Pi * N[(0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
b_m = \left|b\right|
\\
\left(2 \cdot \left(b\_m + a\right)\right) \cdot \left(\left(b\_m - a\right) \cdot \sin \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right)\right)
\end{array}
Initial program 56.0%
add-exp-log29.6%
*-commutative29.6%
div-inv29.7%
metadata-eval29.7%
Applied egg-rr29.7%
Taylor expanded in angle around 0 29.9%
rem-exp-log55.9%
*-commutative55.9%
add-sqr-sqrt32.2%
add-sqr-sqrt55.9%
unpow255.9%
unpow255.9%
difference-of-squares57.9%
associate-*r*57.9%
associate-*l*68.0%
Applied egg-rr68.0%
Final simplification68.0%
b_m = (fabs.f64 b) (FPCore (a b_m angle) :precision binary64 (if (<= b_m 1.4e+148) (* 0.011111111111111112 (* angle (* PI (* (- b_m a) (+ b_m a))))) (* b_m (* (* angle 0.011111111111111112) (* b_m PI)))))
b_m = fabs(b);
double code(double a, double b_m, double angle) {
double tmp;
if (b_m <= 1.4e+148) {
tmp = 0.011111111111111112 * (angle * (((double) M_PI) * ((b_m - a) * (b_m + a))));
} else {
tmp = b_m * ((angle * 0.011111111111111112) * (b_m * ((double) M_PI)));
}
return tmp;
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle) {
double tmp;
if (b_m <= 1.4e+148) {
tmp = 0.011111111111111112 * (angle * (Math.PI * ((b_m - a) * (b_m + a))));
} else {
tmp = b_m * ((angle * 0.011111111111111112) * (b_m * Math.PI));
}
return tmp;
}
b_m = math.fabs(b) def code(a, b_m, angle): tmp = 0 if b_m <= 1.4e+148: tmp = 0.011111111111111112 * (angle * (math.pi * ((b_m - a) * (b_m + a)))) else: tmp = b_m * ((angle * 0.011111111111111112) * (b_m * math.pi)) return tmp
b_m = abs(b) function code(a, b_m, angle) tmp = 0.0 if (b_m <= 1.4e+148) tmp = Float64(0.011111111111111112 * Float64(angle * Float64(pi * Float64(Float64(b_m - a) * Float64(b_m + a))))); else tmp = Float64(b_m * Float64(Float64(angle * 0.011111111111111112) * Float64(b_m * pi))); end return tmp end
b_m = abs(b); function tmp_2 = code(a, b_m, angle) tmp = 0.0; if (b_m <= 1.4e+148) tmp = 0.011111111111111112 * (angle * (pi * ((b_m - a) * (b_m + a)))); else tmp = b_m * ((angle * 0.011111111111111112) * (b_m * pi)); end tmp_2 = tmp; end
b_m = N[Abs[b], $MachinePrecision] code[a_, b$95$m_, angle_] := If[LessEqual[b$95$m, 1.4e+148], N[(0.011111111111111112 * N[(angle * N[(Pi * N[(N[(b$95$m - a), $MachinePrecision] * N[(b$95$m + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(b$95$m * N[(N[(angle * 0.011111111111111112), $MachinePrecision] * N[(b$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
\mathbf{if}\;b\_m \leq 1.4 \cdot 10^{+148}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(\left(b\_m - a\right) \cdot \left(b\_m + a\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;b\_m \cdot \left(\left(angle \cdot 0.011111111111111112\right) \cdot \left(b\_m \cdot \pi\right)\right)\\
\end{array}
\end{array}
if b < 1.3999999999999999e148Initial program 58.0%
associate-*l*58.0%
*-commutative58.0%
associate-*l*58.0%
Simplified58.0%
unpow258.0%
unpow258.0%
difference-of-squares59.8%
Applied egg-rr59.8%
Taylor expanded in angle around 0 56.9%
if 1.3999999999999999e148 < b Initial program 41.4%
associate-*l*41.4%
*-commutative41.4%
associate-*l*41.4%
Simplified41.4%
unpow241.4%
unpow241.4%
difference-of-squares51.5%
Applied egg-rr51.5%
Taylor expanded in angle around 0 38.2%
Taylor expanded in a around 0 34.9%
Simplified59.5%
Final simplification57.2%
b_m = (fabs.f64 b) (FPCore (a b_m angle) :precision binary64 (if (<= b_m 1e+61) (* 0.011111111111111112 (* angle (* b_m (* b_m PI)))) (* b_m (* (* angle 0.011111111111111112) (* b_m PI)))))
b_m = fabs(b);
double code(double a, double b_m, double angle) {
double tmp;
if (b_m <= 1e+61) {
tmp = 0.011111111111111112 * (angle * (b_m * (b_m * ((double) M_PI))));
} else {
tmp = b_m * ((angle * 0.011111111111111112) * (b_m * ((double) M_PI)));
}
return tmp;
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle) {
double tmp;
if (b_m <= 1e+61) {
tmp = 0.011111111111111112 * (angle * (b_m * (b_m * Math.PI)));
} else {
tmp = b_m * ((angle * 0.011111111111111112) * (b_m * Math.PI));
}
return tmp;
}
b_m = math.fabs(b) def code(a, b_m, angle): tmp = 0 if b_m <= 1e+61: tmp = 0.011111111111111112 * (angle * (b_m * (b_m * math.pi))) else: tmp = b_m * ((angle * 0.011111111111111112) * (b_m * math.pi)) return tmp
b_m = abs(b) function code(a, b_m, angle) tmp = 0.0 if (b_m <= 1e+61) tmp = Float64(0.011111111111111112 * Float64(angle * Float64(b_m * Float64(b_m * pi)))); else tmp = Float64(b_m * Float64(Float64(angle * 0.011111111111111112) * Float64(b_m * pi))); end return tmp end
b_m = abs(b); function tmp_2 = code(a, b_m, angle) tmp = 0.0; if (b_m <= 1e+61) tmp = 0.011111111111111112 * (angle * (b_m * (b_m * pi))); else tmp = b_m * ((angle * 0.011111111111111112) * (b_m * pi)); end tmp_2 = tmp; end
b_m = N[Abs[b], $MachinePrecision] code[a_, b$95$m_, angle_] := If[LessEqual[b$95$m, 1e+61], N[(0.011111111111111112 * N[(angle * N[(b$95$m * N[(b$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(b$95$m * N[(N[(angle * 0.011111111111111112), $MachinePrecision] * N[(b$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
\mathbf{if}\;b\_m \leq 10^{+61}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle \cdot \left(b\_m \cdot \left(b\_m \cdot \pi\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;b\_m \cdot \left(\left(angle \cdot 0.011111111111111112\right) \cdot \left(b\_m \cdot \pi\right)\right)\\
\end{array}
\end{array}
if b < 9.99999999999999949e60Initial program 57.5%
associate-*l*57.5%
*-commutative57.5%
associate-*l*57.5%
Simplified57.5%
unpow257.5%
unpow257.5%
difference-of-squares59.4%
Applied egg-rr59.4%
Taylor expanded in angle around 0 57.7%
Taylor expanded in a around 0 38.4%
Simplified38.3%
Taylor expanded in b around 0 38.3%
*-commutative38.3%
Simplified38.3%
if 9.99999999999999949e60 < b Initial program 50.6%
associate-*l*50.6%
*-commutative50.6%
associate-*l*50.6%
Simplified50.6%
unpow250.6%
unpow250.6%
difference-of-squares56.3%
Applied egg-rr56.3%
Taylor expanded in angle around 0 43.1%
Taylor expanded in a around 0 39.2%
Simplified53.3%
Final simplification41.4%
b_m = (fabs.f64 b) (FPCore (a b_m angle) :precision binary64 (* 0.011111111111111112 (* angle (* b_m (* b_m PI)))))
b_m = fabs(b);
double code(double a, double b_m, double angle) {
return 0.011111111111111112 * (angle * (b_m * (b_m * ((double) M_PI))));
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle) {
return 0.011111111111111112 * (angle * (b_m * (b_m * Math.PI)));
}
b_m = math.fabs(b) def code(a, b_m, angle): return 0.011111111111111112 * (angle * (b_m * (b_m * math.pi)))
b_m = abs(b) function code(a, b_m, angle) return Float64(0.011111111111111112 * Float64(angle * Float64(b_m * Float64(b_m * pi)))) end
b_m = abs(b); function tmp = code(a, b_m, angle) tmp = 0.011111111111111112 * (angle * (b_m * (b_m * pi))); end
b_m = N[Abs[b], $MachinePrecision] code[a_, b$95$m_, angle_] := N[(0.011111111111111112 * N[(angle * N[(b$95$m * N[(b$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
b_m = \left|b\right|
\\
0.011111111111111112 \cdot \left(angle \cdot \left(b\_m \cdot \left(b\_m \cdot \pi\right)\right)\right)
\end{array}
Initial program 56.0%
associate-*l*56.0%
*-commutative56.0%
associate-*l*56.0%
Simplified56.0%
unpow256.0%
unpow256.0%
difference-of-squares58.8%
Applied egg-rr58.8%
Taylor expanded in angle around 0 54.7%
Taylor expanded in a around 0 38.5%
Simplified38.5%
Taylor expanded in b around 0 38.5%
*-commutative38.5%
Simplified38.5%
Final simplification38.5%
herbie shell --seed 2024108
(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)))))