
(FPCore (a b angle) :precision binary64 (let* ((t_0 (* PI (/ angle 180.0)))) (* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) (sin t_0)) (cos t_0))))
double code(double a, double b, double angle) {
double t_0 = ((double) M_PI) * (angle / 180.0);
return ((2.0 * (pow(b, 2.0) - pow(a, 2.0))) * sin(t_0)) * cos(t_0);
}
public static double code(double a, double b, double angle) {
double t_0 = Math.PI * (angle / 180.0);
return ((2.0 * (Math.pow(b, 2.0) - Math.pow(a, 2.0))) * Math.sin(t_0)) * Math.cos(t_0);
}
def code(a, b, angle): t_0 = math.pi * (angle / 180.0) return ((2.0 * (math.pow(b, 2.0) - math.pow(a, 2.0))) * math.sin(t_0)) * math.cos(t_0)
function code(a, b, angle) t_0 = Float64(pi * Float64(angle / 180.0)) return Float64(Float64(Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))) * sin(t_0)) * cos(t_0)) end
function tmp = code(a, b, angle) t_0 = pi * (angle / 180.0); tmp = ((2.0 * ((b ^ 2.0) - (a ^ 2.0))) * sin(t_0)) * cos(t_0); end
code[a_, b_, angle_] := Block[{t$95$0 = N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \pi \cdot \frac{angle}{180}\\
\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin t\_0\right) \cdot \cos t\_0
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (a b angle) :precision binary64 (let* ((t_0 (* PI (/ angle 180.0)))) (* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) (sin t_0)) (cos t_0))))
double code(double a, double b, double angle) {
double t_0 = ((double) M_PI) * (angle / 180.0);
return ((2.0 * (pow(b, 2.0) - pow(a, 2.0))) * sin(t_0)) * cos(t_0);
}
public static double code(double a, double b, double angle) {
double t_0 = Math.PI * (angle / 180.0);
return ((2.0 * (Math.pow(b, 2.0) - Math.pow(a, 2.0))) * Math.sin(t_0)) * Math.cos(t_0);
}
def code(a, b, angle): t_0 = math.pi * (angle / 180.0) return ((2.0 * (math.pow(b, 2.0) - math.pow(a, 2.0))) * math.sin(t_0)) * math.cos(t_0)
function code(a, b, angle) t_0 = Float64(pi * Float64(angle / 180.0)) return Float64(Float64(Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))) * sin(t_0)) * cos(t_0)) end
function tmp = code(a, b, angle) t_0 = pi * (angle / 180.0); tmp = ((2.0 * ((b ^ 2.0) - (a ^ 2.0))) * sin(t_0)) * cos(t_0); end
code[a_, b_, angle_] := Block[{t$95$0 = N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \pi \cdot \frac{angle}{180}\\
\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin t\_0\right) \cdot \cos t\_0
\end{array}
\end{array}
b_m = (fabs.f64 b)
(FPCore (a b_m angle)
:precision binary64
(if (<= b_m 1.3e+208)
(*
(+ b_m a)
(*
(- b_m a)
(sin
(*
2.0
(* 0.005555555555555556 (* angle (* (cbrt PI) (pow (cbrt PI) 2.0))))))))
(*
(+ b_m a)
(*
(- b_m a)
(sin (* 2.0 (pow (cbrt (* 0.005555555555555556 (* angle PI))) 3.0)))))))b_m = fabs(b);
double code(double a, double b_m, double angle) {
double tmp;
if (b_m <= 1.3e+208) {
tmp = (b_m + a) * ((b_m - a) * sin((2.0 * (0.005555555555555556 * (angle * (cbrt(((double) M_PI)) * pow(cbrt(((double) M_PI)), 2.0)))))));
} else {
tmp = (b_m + a) * ((b_m - a) * sin((2.0 * pow(cbrt((0.005555555555555556 * (angle * ((double) M_PI)))), 3.0))));
}
return tmp;
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle) {
double tmp;
if (b_m <= 1.3e+208) {
tmp = (b_m + a) * ((b_m - a) * Math.sin((2.0 * (0.005555555555555556 * (angle * (Math.cbrt(Math.PI) * Math.pow(Math.cbrt(Math.PI), 2.0)))))));
} else {
tmp = (b_m + a) * ((b_m - a) * Math.sin((2.0 * Math.pow(Math.cbrt((0.005555555555555556 * (angle * Math.PI))), 3.0))));
}
return tmp;
}
b_m = abs(b) function code(a, b_m, angle) tmp = 0.0 if (b_m <= 1.3e+208) tmp = Float64(Float64(b_m + a) * Float64(Float64(b_m - a) * sin(Float64(2.0 * Float64(0.005555555555555556 * Float64(angle * Float64(cbrt(pi) * (cbrt(pi) ^ 2.0)))))))); else tmp = Float64(Float64(b_m + a) * Float64(Float64(b_m - a) * sin(Float64(2.0 * (cbrt(Float64(0.005555555555555556 * Float64(angle * pi))) ^ 3.0))))); end return tmp end
b_m = N[Abs[b], $MachinePrecision] code[a_, b$95$m_, angle_] := If[LessEqual[b$95$m, 1.3e+208], N[(N[(b$95$m + a), $MachinePrecision] * N[(N[(b$95$m - a), $MachinePrecision] * N[Sin[N[(2.0 * 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]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b$95$m + a), $MachinePrecision] * N[(N[(b$95$m - a), $MachinePrecision] * N[Sin[N[(2.0 * N[Power[N[Power[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
\mathbf{if}\;b\_m \leq 1.3 \cdot 10^{+208}:\\
\;\;\;\;\left(b\_m + a\right) \cdot \left(\left(b\_m - a\right) \cdot \sin \left(2 \cdot \left(0.005555555555555556 \cdot \left(angle \cdot \left(\sqrt[3]{\pi} \cdot {\left(\sqrt[3]{\pi}\right)}^{2}\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(b\_m + a\right) \cdot \left(\left(b\_m - a\right) \cdot \sin \left(2 \cdot {\left(\sqrt[3]{0.005555555555555556 \cdot \left(angle \cdot \pi\right)}\right)}^{3}\right)\right)\\
\end{array}
\end{array}
if b < 1.3e208Initial program 54.4%
associate-*l*54.4%
*-commutative54.4%
associate-*l*54.4%
Simplified54.4%
unpow254.4%
unpow254.4%
difference-of-squares55.8%
Applied egg-rr55.8%
pow155.8%
associate-*l*63.6%
2-sin63.6%
div-inv63.4%
metadata-eval63.4%
Applied egg-rr63.4%
unpow163.4%
+-commutative63.4%
associate-*r*64.0%
*-commutative64.0%
*-commutative64.0%
Simplified64.0%
add-cube-cbrt69.7%
pow269.7%
Applied egg-rr69.7%
if 1.3e208 < b Initial program 39.4%
associate-*l*39.4%
*-commutative39.4%
associate-*l*39.4%
Simplified39.4%
unpow239.4%
unpow239.4%
difference-of-squares54.1%
Applied egg-rr54.1%
pow154.1%
associate-*l*76.1%
2-sin76.1%
div-inv80.9%
metadata-eval80.9%
Applied egg-rr80.9%
unpow180.9%
+-commutative80.9%
associate-*r*81.0%
*-commutative81.0%
*-commutative81.0%
Simplified81.0%
add-cube-cbrt80.6%
pow380.7%
Applied egg-rr80.7%
Final simplification70.6%
b_m = (fabs.f64 b)
(FPCore (a b_m angle)
:precision binary64
(if (<= b_m 9000.0)
(*
(+ b_m a)
(*
(- b_m a)
(sin (* 2.0 (* 0.005555555555555556 (* angle (pow (sqrt PI) 2.0)))))))
(*
(+ b_m a)
(* (- b_m a) (fabs (sin (* PI (* angle 0.011111111111111112))))))))b_m = fabs(b);
double code(double a, double b_m, double angle) {
double tmp;
if (b_m <= 9000.0) {
tmp = (b_m + a) * ((b_m - a) * sin((2.0 * (0.005555555555555556 * (angle * pow(sqrt(((double) M_PI)), 2.0))))));
} else {
tmp = (b_m + a) * ((b_m - a) * fabs(sin((((double) M_PI) * (angle * 0.011111111111111112)))));
}
return tmp;
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle) {
double tmp;
if (b_m <= 9000.0) {
tmp = (b_m + a) * ((b_m - a) * Math.sin((2.0 * (0.005555555555555556 * (angle * Math.pow(Math.sqrt(Math.PI), 2.0))))));
} else {
tmp = (b_m + a) * ((b_m - a) * Math.abs(Math.sin((Math.PI * (angle * 0.011111111111111112)))));
}
return tmp;
}
b_m = math.fabs(b) def code(a, b_m, angle): tmp = 0 if b_m <= 9000.0: tmp = (b_m + a) * ((b_m - a) * math.sin((2.0 * (0.005555555555555556 * (angle * math.pow(math.sqrt(math.pi), 2.0)))))) else: tmp = (b_m + a) * ((b_m - a) * math.fabs(math.sin((math.pi * (angle * 0.011111111111111112))))) return tmp
b_m = abs(b) function code(a, b_m, angle) tmp = 0.0 if (b_m <= 9000.0) tmp = Float64(Float64(b_m + a) * Float64(Float64(b_m - a) * sin(Float64(2.0 * Float64(0.005555555555555556 * Float64(angle * (sqrt(pi) ^ 2.0))))))); else tmp = Float64(Float64(b_m + a) * Float64(Float64(b_m - a) * abs(sin(Float64(pi * Float64(angle * 0.011111111111111112)))))); end return tmp end
b_m = abs(b); function tmp_2 = code(a, b_m, angle) tmp = 0.0; if (b_m <= 9000.0) tmp = (b_m + a) * ((b_m - a) * sin((2.0 * (0.005555555555555556 * (angle * (sqrt(pi) ^ 2.0)))))); else tmp = (b_m + a) * ((b_m - a) * abs(sin((pi * (angle * 0.011111111111111112))))); end tmp_2 = tmp; end
b_m = N[Abs[b], $MachinePrecision] code[a_, b$95$m_, angle_] := If[LessEqual[b$95$m, 9000.0], N[(N[(b$95$m + a), $MachinePrecision] * N[(N[(b$95$m - a), $MachinePrecision] * N[Sin[N[(2.0 * N[(0.005555555555555556 * N[(angle * N[Power[N[Sqrt[Pi], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b$95$m + a), $MachinePrecision] * N[(N[(b$95$m - a), $MachinePrecision] * N[Abs[N[Sin[N[(Pi * N[(angle * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
\mathbf{if}\;b\_m \leq 9000:\\
\;\;\;\;\left(b\_m + a\right) \cdot \left(\left(b\_m - a\right) \cdot \sin \left(2 \cdot \left(0.005555555555555556 \cdot \left(angle \cdot {\left(\sqrt{\pi}\right)}^{2}\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(b\_m + a\right) \cdot \left(\left(b\_m - a\right) \cdot \left|\sin \left(\pi \cdot \left(angle \cdot 0.011111111111111112\right)\right)\right|\right)\\
\end{array}
\end{array}
if b < 9e3Initial program 55.9%
associate-*l*55.9%
*-commutative55.9%
associate-*l*55.9%
Simplified55.9%
unpow255.9%
unpow255.9%
difference-of-squares57.5%
Applied egg-rr57.5%
pow157.5%
associate-*l*63.6%
2-sin63.6%
div-inv62.9%
metadata-eval62.9%
Applied egg-rr62.9%
unpow162.9%
+-commutative62.9%
associate-*r*63.2%
*-commutative63.2%
*-commutative63.2%
Simplified63.2%
add-sqr-sqrt68.2%
pow268.2%
Applied egg-rr68.2%
if 9e3 < b Initial program 44.0%
associate-*l*44.0%
*-commutative44.0%
associate-*l*44.0%
Simplified44.0%
unpow244.0%
unpow244.0%
difference-of-squares49.5%
Applied egg-rr49.5%
pow149.5%
associate-*l*68.0%
2-sin68.0%
div-inv71.1%
metadata-eval71.1%
Applied egg-rr71.1%
unpow171.1%
+-commutative71.1%
associate-*r*72.8%
*-commutative72.8%
*-commutative72.8%
Simplified72.8%
*-commutative72.8%
*-commutative72.8%
associate-*r*71.1%
add-sqr-sqrt31.4%
sqrt-unprod28.1%
pow228.1%
Applied egg-rr28.1%
unpow228.1%
rem-sqrt-square36.0%
*-commutative36.0%
associate-*r*36.0%
Simplified36.0%
Final simplification60.8%
b_m = (fabs.f64 b) (FPCore (a b_m angle) :precision binary64 (* (+ b_m a) (* (- b_m a) (sin (* 2.0 (expm1 (log1p (* 0.005555555555555556 (* angle PI)))))))))
b_m = fabs(b);
double code(double a, double b_m, double angle) {
return (b_m + a) * ((b_m - a) * sin((2.0 * expm1(log1p((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) * ((b_m - a) * Math.sin((2.0 * Math.expm1(Math.log1p((0.005555555555555556 * (angle * Math.PI)))))));
}
b_m = math.fabs(b) def code(a, b_m, angle): return (b_m + a) * ((b_m - a) * math.sin((2.0 * math.expm1(math.log1p((0.005555555555555556 * (angle * math.pi)))))))
b_m = abs(b) function code(a, b_m, angle) return Float64(Float64(b_m + a) * Float64(Float64(b_m - a) * sin(Float64(2.0 * expm1(log1p(Float64(0.005555555555555556 * Float64(angle * pi)))))))) end
b_m = N[Abs[b], $MachinePrecision] code[a_, b$95$m_, angle_] := N[(N[(b$95$m + a), $MachinePrecision] * N[(N[(b$95$m - a), $MachinePrecision] * N[Sin[N[(2.0 * N[(Exp[N[Log[1 + N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]] - 1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
b_m = \left|b\right|
\\
\left(b\_m + a\right) \cdot \left(\left(b\_m - a\right) \cdot \sin \left(2 \cdot \mathsf{expm1}\left(\mathsf{log1p}\left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right)\right)
\end{array}
Initial program 53.1%
associate-*l*53.1%
*-commutative53.1%
associate-*l*53.1%
Simplified53.1%
unpow253.1%
unpow253.1%
difference-of-squares55.6%
Applied egg-rr55.6%
pow155.6%
associate-*l*64.6%
2-sin64.6%
div-inv64.8%
metadata-eval64.8%
Applied egg-rr64.8%
unpow164.8%
+-commutative64.8%
associate-*r*65.4%
*-commutative65.4%
*-commutative65.4%
Simplified65.4%
expm1-log1p-u58.3%
expm1-undefine19.9%
Applied egg-rr19.9%
expm1-define58.3%
*-commutative58.3%
Simplified58.3%
Final simplification58.3%
b_m = (fabs.f64 b) (FPCore (a b_m angle) :precision binary64 (if (<= (pow b_m 2.0) 2e-157) (* (+ b_m a) (* (- b_m a) (sin (* 2.0 (/ PI (/ 180.0 angle)))))) (* (+ b_m a) (* 0.011111111111111112 (* angle (* (- b_m a) PI))))))
b_m = fabs(b);
double code(double a, double b_m, double angle) {
double tmp;
if (pow(b_m, 2.0) <= 2e-157) {
tmp = (b_m + a) * ((b_m - a) * sin((2.0 * (((double) M_PI) / (180.0 / angle)))));
} else {
tmp = (b_m + a) * (0.011111111111111112 * (angle * ((b_m - a) * ((double) M_PI))));
}
return tmp;
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle) {
double tmp;
if (Math.pow(b_m, 2.0) <= 2e-157) {
tmp = (b_m + a) * ((b_m - a) * Math.sin((2.0 * (Math.PI / (180.0 / angle)))));
} else {
tmp = (b_m + a) * (0.011111111111111112 * (angle * ((b_m - a) * Math.PI)));
}
return tmp;
}
b_m = math.fabs(b) def code(a, b_m, angle): tmp = 0 if math.pow(b_m, 2.0) <= 2e-157: tmp = (b_m + a) * ((b_m - a) * math.sin((2.0 * (math.pi / (180.0 / angle))))) else: tmp = (b_m + a) * (0.011111111111111112 * (angle * ((b_m - a) * math.pi))) return tmp
b_m = abs(b) function code(a, b_m, angle) tmp = 0.0 if ((b_m ^ 2.0) <= 2e-157) tmp = Float64(Float64(b_m + a) * Float64(Float64(b_m - a) * sin(Float64(2.0 * Float64(pi / Float64(180.0 / angle)))))); else tmp = Float64(Float64(b_m + a) * Float64(0.011111111111111112 * Float64(angle * Float64(Float64(b_m - a) * pi)))); end return tmp end
b_m = abs(b); function tmp_2 = code(a, b_m, angle) tmp = 0.0; if ((b_m ^ 2.0) <= 2e-157) tmp = (b_m + a) * ((b_m - a) * sin((2.0 * (pi / (180.0 / angle))))); else tmp = (b_m + a) * (0.011111111111111112 * (angle * ((b_m - a) * pi))); end tmp_2 = tmp; end
b_m = N[Abs[b], $MachinePrecision] code[a_, b$95$m_, angle_] := If[LessEqual[N[Power[b$95$m, 2.0], $MachinePrecision], 2e-157], N[(N[(b$95$m + a), $MachinePrecision] * N[(N[(b$95$m - a), $MachinePrecision] * N[Sin[N[(2.0 * N[(Pi / N[(180.0 / angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b$95$m + a), $MachinePrecision] * N[(0.011111111111111112 * N[(angle * N[(N[(b$95$m - a), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
\mathbf{if}\;{b\_m}^{2} \leq 2 \cdot 10^{-157}:\\
\;\;\;\;\left(b\_m + a\right) \cdot \left(\left(b\_m - a\right) \cdot \sin \left(2 \cdot \frac{\pi}{\frac{180}{angle}}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(b\_m + a\right) \cdot \left(0.011111111111111112 \cdot \left(angle \cdot \left(\left(b\_m - a\right) \cdot \pi\right)\right)\right)\\
\end{array}
\end{array}
if (pow.f64 b #s(literal 2 binary64)) < 1.99999999999999989e-157Initial program 62.2%
associate-*l*62.2%
*-commutative62.2%
associate-*l*62.2%
Simplified62.2%
unpow262.2%
unpow262.2%
difference-of-squares62.2%
Applied egg-rr62.2%
pow162.2%
associate-*l*65.1%
2-sin65.1%
div-inv64.5%
metadata-eval64.5%
Applied egg-rr64.5%
unpow164.5%
+-commutative64.5%
associate-*r*64.9%
*-commutative64.9%
*-commutative64.9%
Simplified64.9%
*-commutative64.9%
*-commutative64.9%
associate-*r*64.5%
metadata-eval64.5%
div-inv65.1%
clear-num64.7%
un-div-inv65.9%
Applied egg-rr65.9%
if 1.99999999999999989e-157 < (pow.f64 b #s(literal 2 binary64)) Initial program 47.7%
associate-*l*47.7%
*-commutative47.7%
associate-*l*47.7%
Simplified47.7%
unpow247.7%
unpow247.7%
difference-of-squares51.7%
Applied egg-rr51.7%
pow151.7%
associate-*l*64.3%
2-sin64.3%
div-inv65.0%
metadata-eval65.0%
Applied egg-rr65.0%
unpow165.0%
+-commutative65.0%
associate-*r*65.8%
*-commutative65.8%
*-commutative65.8%
Simplified65.8%
Taylor expanded in angle around 0 69.6%
Final simplification68.2%
b_m = (fabs.f64 b) (FPCore (a b_m angle) :precision binary64 (if (<= (pow a 2.0) 5e+131) (* (- b_m a) (* (+ b_m a) (sin (* (* angle PI) 0.011111111111111112)))) (* (+ b_m a) (* 0.011111111111111112 (* angle (* (- b_m a) PI))))))
b_m = fabs(b);
double code(double a, double b_m, double angle) {
double tmp;
if (pow(a, 2.0) <= 5e+131) {
tmp = (b_m - a) * ((b_m + a) * sin(((angle * ((double) M_PI)) * 0.011111111111111112)));
} else {
tmp = (b_m + a) * (0.011111111111111112 * (angle * ((b_m - a) * ((double) M_PI))));
}
return tmp;
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle) {
double tmp;
if (Math.pow(a, 2.0) <= 5e+131) {
tmp = (b_m - a) * ((b_m + a) * Math.sin(((angle * Math.PI) * 0.011111111111111112)));
} else {
tmp = (b_m + a) * (0.011111111111111112 * (angle * ((b_m - a) * Math.PI)));
}
return tmp;
}
b_m = math.fabs(b) def code(a, b_m, angle): tmp = 0 if math.pow(a, 2.0) <= 5e+131: tmp = (b_m - a) * ((b_m + a) * math.sin(((angle * math.pi) * 0.011111111111111112))) else: tmp = (b_m + a) * (0.011111111111111112 * (angle * ((b_m - a) * math.pi))) return tmp
b_m = abs(b) function code(a, b_m, angle) tmp = 0.0 if ((a ^ 2.0) <= 5e+131) tmp = Float64(Float64(b_m - a) * Float64(Float64(b_m + a) * sin(Float64(Float64(angle * pi) * 0.011111111111111112)))); else tmp = Float64(Float64(b_m + a) * Float64(0.011111111111111112 * Float64(angle * Float64(Float64(b_m - a) * pi)))); end return tmp end
b_m = abs(b); function tmp_2 = code(a, b_m, angle) tmp = 0.0; if ((a ^ 2.0) <= 5e+131) tmp = (b_m - a) * ((b_m + a) * sin(((angle * pi) * 0.011111111111111112))); else tmp = (b_m + a) * (0.011111111111111112 * (angle * ((b_m - a) * pi))); end tmp_2 = tmp; end
b_m = N[Abs[b], $MachinePrecision] code[a_, b$95$m_, angle_] := If[LessEqual[N[Power[a, 2.0], $MachinePrecision], 5e+131], N[(N[(b$95$m - a), $MachinePrecision] * N[(N[(b$95$m + a), $MachinePrecision] * N[Sin[N[(N[(angle * Pi), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b$95$m + a), $MachinePrecision] * N[(0.011111111111111112 * N[(angle * N[(N[(b$95$m - a), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
\mathbf{if}\;{a}^{2} \leq 5 \cdot 10^{+131}:\\
\;\;\;\;\left(b\_m - a\right) \cdot \left(\left(b\_m + a\right) \cdot \sin \left(\left(angle \cdot \pi\right) \cdot 0.011111111111111112\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(b\_m + a\right) \cdot \left(0.011111111111111112 \cdot \left(angle \cdot \left(\left(b\_m - a\right) \cdot \pi\right)\right)\right)\\
\end{array}
\end{array}
if (pow.f64 a #s(literal 2 binary64)) < 4.99999999999999995e131Initial program 59.4%
associate-*l*59.4%
*-commutative59.4%
associate-*l*59.4%
Simplified59.4%
unpow259.4%
unpow259.4%
difference-of-squares59.4%
Applied egg-rr59.4%
add-exp-log34.6%
associate-*l*38.2%
2-sin38.2%
div-inv39.0%
metadata-eval39.0%
Applied egg-rr39.0%
rem-exp-log64.6%
associate-*r*59.8%
*-commutative59.8%
associate-*l*64.6%
associate-*r*65.9%
*-commutative65.9%
*-commutative65.9%
count-265.9%
associate-*r*65.1%
*-commutative65.1%
metadata-eval65.1%
div-inv64.6%
*-commutative64.6%
*-commutative64.6%
*-commutative64.6%
associate-*r*63.4%
rem-cbrt-cube64.7%
metadata-eval64.7%
div-inv63.8%
Applied egg-rr65.9%
if 4.99999999999999995e131 < (pow.f64 a #s(literal 2 binary64)) Initial program 43.0%
associate-*l*43.0%
*-commutative43.0%
associate-*l*43.0%
Simplified43.0%
unpow243.0%
unpow243.0%
difference-of-squares49.5%
Applied egg-rr49.5%
pow149.5%
associate-*l*65.3%
2-sin65.3%
div-inv65.3%
metadata-eval65.3%
Applied egg-rr65.3%
unpow165.3%
+-commutative65.3%
associate-*r*64.7%
*-commutative64.7%
*-commutative64.7%
Simplified64.7%
Taylor expanded in angle around 0 68.9%
Final simplification67.0%
b_m = (fabs.f64 b) (FPCore (a b_m angle) :precision binary64 (* (+ b_m a) (* (- b_m a) (fabs (sin (* PI (* angle 0.011111111111111112)))))))
b_m = fabs(b);
double code(double a, double b_m, double angle) {
return (b_m + a) * ((b_m - a) * fabs(sin((((double) M_PI) * (angle * 0.011111111111111112)))));
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle) {
return (b_m + a) * ((b_m - a) * Math.abs(Math.sin((Math.PI * (angle * 0.011111111111111112)))));
}
b_m = math.fabs(b) def code(a, b_m, angle): return (b_m + a) * ((b_m - a) * math.fabs(math.sin((math.pi * (angle * 0.011111111111111112)))))
b_m = abs(b) function code(a, b_m, angle) return Float64(Float64(b_m + a) * Float64(Float64(b_m - a) * abs(sin(Float64(pi * Float64(angle * 0.011111111111111112)))))) end
b_m = abs(b); function tmp = code(a, b_m, angle) tmp = (b_m + a) * ((b_m - a) * abs(sin((pi * (angle * 0.011111111111111112))))); end
b_m = N[Abs[b], $MachinePrecision] code[a_, b$95$m_, angle_] := N[(N[(b$95$m + a), $MachinePrecision] * N[(N[(b$95$m - a), $MachinePrecision] * N[Abs[N[Sin[N[(Pi * N[(angle * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
b_m = \left|b\right|
\\
\left(b\_m + a\right) \cdot \left(\left(b\_m - a\right) \cdot \left|\sin \left(\pi \cdot \left(angle \cdot 0.011111111111111112\right)\right)\right|\right)
\end{array}
Initial program 53.1%
associate-*l*53.1%
*-commutative53.1%
associate-*l*53.1%
Simplified53.1%
unpow253.1%
unpow253.1%
difference-of-squares55.6%
Applied egg-rr55.6%
pow155.6%
associate-*l*64.6%
2-sin64.6%
div-inv64.8%
metadata-eval64.8%
Applied egg-rr64.8%
unpow164.8%
+-commutative64.8%
associate-*r*65.4%
*-commutative65.4%
*-commutative65.4%
Simplified65.4%
*-commutative65.4%
*-commutative65.4%
associate-*r*64.8%
add-sqr-sqrt30.2%
sqrt-unprod34.7%
pow234.7%
Applied egg-rr34.6%
unpow234.6%
rem-sqrt-square42.0%
*-commutative42.0%
associate-*r*42.0%
Simplified42.0%
Final simplification42.0%
b_m = (fabs.f64 b)
(FPCore (a b_m angle)
:precision binary64
(if (<= angle 3.3e+14)
(* (+ b_m a) (* 0.011111111111111112 (* angle (* (- b_m a) PI))))
(if (<= angle 1.35e+45)
(* (+ b_m a) (* b_m (sin (* (* angle PI) 0.011111111111111112))))
(* 0.011111111111111112 (* angle (* PI (* (+ b_m a) (- b_m a))))))))b_m = fabs(b);
double code(double a, double b_m, double angle) {
double tmp;
if (angle <= 3.3e+14) {
tmp = (b_m + a) * (0.011111111111111112 * (angle * ((b_m - a) * ((double) M_PI))));
} else if (angle <= 1.35e+45) {
tmp = (b_m + a) * (b_m * sin(((angle * ((double) M_PI)) * 0.011111111111111112)));
} else {
tmp = 0.011111111111111112 * (angle * (((double) M_PI) * ((b_m + a) * (b_m - a))));
}
return tmp;
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle) {
double tmp;
if (angle <= 3.3e+14) {
tmp = (b_m + a) * (0.011111111111111112 * (angle * ((b_m - a) * Math.PI)));
} else if (angle <= 1.35e+45) {
tmp = (b_m + a) * (b_m * Math.sin(((angle * Math.PI) * 0.011111111111111112)));
} else {
tmp = 0.011111111111111112 * (angle * (Math.PI * ((b_m + a) * (b_m - a))));
}
return tmp;
}
b_m = math.fabs(b) def code(a, b_m, angle): tmp = 0 if angle <= 3.3e+14: tmp = (b_m + a) * (0.011111111111111112 * (angle * ((b_m - a) * math.pi))) elif angle <= 1.35e+45: tmp = (b_m + a) * (b_m * math.sin(((angle * math.pi) * 0.011111111111111112))) else: tmp = 0.011111111111111112 * (angle * (math.pi * ((b_m + a) * (b_m - a)))) return tmp
b_m = abs(b) function code(a, b_m, angle) tmp = 0.0 if (angle <= 3.3e+14) tmp = Float64(Float64(b_m + a) * Float64(0.011111111111111112 * Float64(angle * Float64(Float64(b_m - a) * pi)))); elseif (angle <= 1.35e+45) tmp = Float64(Float64(b_m + a) * Float64(b_m * sin(Float64(Float64(angle * pi) * 0.011111111111111112)))); else tmp = Float64(0.011111111111111112 * Float64(angle * Float64(pi * Float64(Float64(b_m + a) * Float64(b_m - a))))); end return tmp end
b_m = abs(b); function tmp_2 = code(a, b_m, angle) tmp = 0.0; if (angle <= 3.3e+14) tmp = (b_m + a) * (0.011111111111111112 * (angle * ((b_m - a) * pi))); elseif (angle <= 1.35e+45) tmp = (b_m + a) * (b_m * sin(((angle * pi) * 0.011111111111111112))); else tmp = 0.011111111111111112 * (angle * (pi * ((b_m + a) * (b_m - a)))); end tmp_2 = tmp; end
b_m = N[Abs[b], $MachinePrecision] code[a_, b$95$m_, angle_] := If[LessEqual[angle, 3.3e+14], N[(N[(b$95$m + a), $MachinePrecision] * N[(0.011111111111111112 * N[(angle * N[(N[(b$95$m - a), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[angle, 1.35e+45], N[(N[(b$95$m + a), $MachinePrecision] * N[(b$95$m * N[Sin[N[(N[(angle * Pi), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(angle * N[(Pi * N[(N[(b$95$m + a), $MachinePrecision] * N[(b$95$m - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
\mathbf{if}\;angle \leq 3.3 \cdot 10^{+14}:\\
\;\;\;\;\left(b\_m + a\right) \cdot \left(0.011111111111111112 \cdot \left(angle \cdot \left(\left(b\_m - a\right) \cdot \pi\right)\right)\right)\\
\mathbf{elif}\;angle \leq 1.35 \cdot 10^{+45}:\\
\;\;\;\;\left(b\_m + a\right) \cdot \left(b\_m \cdot \sin \left(\left(angle \cdot \pi\right) \cdot 0.011111111111111112\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(\left(b\_m + a\right) \cdot \left(b\_m - a\right)\right)\right)\right)\\
\end{array}
\end{array}
if angle < 3.3e14Initial program 60.3%
associate-*l*60.3%
*-commutative60.3%
associate-*l*60.3%
Simplified60.3%
unpow260.3%
unpow260.3%
difference-of-squares62.9%
Applied egg-rr62.9%
pow162.9%
associate-*l*74.2%
2-sin74.2%
div-inv74.8%
metadata-eval74.8%
Applied egg-rr74.8%
unpow174.8%
+-commutative74.8%
associate-*r*74.9%
*-commutative74.9%
*-commutative74.9%
Simplified74.9%
Taylor expanded in angle around 0 75.0%
if 3.3e14 < angle < 1.34999999999999992e45Initial program 35.9%
associate-*l*35.9%
*-commutative35.9%
associate-*l*35.9%
Simplified35.9%
unpow235.9%
unpow235.9%
difference-of-squares35.9%
Applied egg-rr35.9%
pow135.9%
associate-*l*35.9%
2-sin35.9%
div-inv33.3%
metadata-eval33.3%
Applied egg-rr33.3%
unpow133.3%
+-commutative33.3%
associate-*r*44.4%
*-commutative44.4%
*-commutative44.4%
Simplified44.4%
Taylor expanded in b around inf 37.6%
if 1.34999999999999992e45 < angle Initial program 23.7%
associate-*l*23.7%
*-commutative23.7%
associate-*l*23.7%
Simplified23.7%
Taylor expanded in angle around 0 24.9%
unpow223.7%
unpow223.7%
difference-of-squares25.9%
Applied egg-rr27.2%
Final simplification65.4%
b_m = (fabs.f64 b)
(FPCore (a b_m angle)
:precision binary64
(let* ((t_0 (* PI (* angle 0.011111111111111112))))
(if (<= b_m 5.5e+52)
(* (- b_m a) (* (+ b_m a) (sin t_0)))
(* (+ b_m a) (* (- b_m a) t_0)))))b_m = fabs(b);
double code(double a, double b_m, double angle) {
double t_0 = ((double) M_PI) * (angle * 0.011111111111111112);
double tmp;
if (b_m <= 5.5e+52) {
tmp = (b_m - a) * ((b_m + a) * sin(t_0));
} else {
tmp = (b_m + a) * ((b_m - a) * t_0);
}
return tmp;
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle) {
double t_0 = Math.PI * (angle * 0.011111111111111112);
double tmp;
if (b_m <= 5.5e+52) {
tmp = (b_m - a) * ((b_m + a) * Math.sin(t_0));
} else {
tmp = (b_m + a) * ((b_m - a) * t_0);
}
return tmp;
}
b_m = math.fabs(b) def code(a, b_m, angle): t_0 = math.pi * (angle * 0.011111111111111112) tmp = 0 if b_m <= 5.5e+52: tmp = (b_m - a) * ((b_m + a) * math.sin(t_0)) else: tmp = (b_m + a) * ((b_m - a) * t_0) return tmp
b_m = abs(b) function code(a, b_m, angle) t_0 = Float64(pi * Float64(angle * 0.011111111111111112)) tmp = 0.0 if (b_m <= 5.5e+52) tmp = Float64(Float64(b_m - a) * Float64(Float64(b_m + a) * sin(t_0))); else tmp = Float64(Float64(b_m + a) * Float64(Float64(b_m - a) * t_0)); end return tmp end
b_m = abs(b); function tmp_2 = code(a, b_m, angle) t_0 = pi * (angle * 0.011111111111111112); tmp = 0.0; if (b_m <= 5.5e+52) tmp = (b_m - a) * ((b_m + a) * sin(t_0)); else tmp = (b_m + a) * ((b_m - a) * t_0); end tmp_2 = tmp; end
b_m = N[Abs[b], $MachinePrecision]
code[a_, b$95$m_, angle_] := Block[{t$95$0 = N[(Pi * N[(angle * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b$95$m, 5.5e+52], N[(N[(b$95$m - a), $MachinePrecision] * N[(N[(b$95$m + a), $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b$95$m + a), $MachinePrecision] * N[(N[(b$95$m - a), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
t_0 := \pi \cdot \left(angle \cdot 0.011111111111111112\right)\\
\mathbf{if}\;b\_m \leq 5.5 \cdot 10^{+52}:\\
\;\;\;\;\left(b\_m - a\right) \cdot \left(\left(b\_m + a\right) \cdot \sin t\_0\right)\\
\mathbf{else}:\\
\;\;\;\;\left(b\_m + a\right) \cdot \left(\left(b\_m - a\right) \cdot t\_0\right)\\
\end{array}
\end{array}
if b < 5.49999999999999996e52Initial program 55.6%
associate-*l*55.6%
*-commutative55.6%
associate-*l*55.6%
Simplified55.6%
unpow255.6%
unpow255.6%
difference-of-squares57.1%
Applied egg-rr57.1%
add-exp-log34.4%
associate-*l*37.2%
2-sin37.2%
div-inv36.8%
metadata-eval36.8%
Applied egg-rr36.8%
Taylor expanded in angle around inf 56.8%
*-commutative56.8%
+-commutative56.8%
*-commutative56.8%
associate-*r*63.0%
*-commutative63.0%
associate-*r*63.0%
+-commutative63.0%
*-commutative63.0%
associate-*r*62.8%
Simplified62.8%
if 5.49999999999999996e52 < b Initial program 42.3%
associate-*l*42.3%
*-commutative42.3%
associate-*l*42.3%
Simplified42.3%
unpow242.3%
unpow242.3%
difference-of-squares49.1%
Applied egg-rr49.1%
pow149.1%
associate-*l*69.9%
2-sin69.9%
div-inv73.7%
metadata-eval73.7%
Applied egg-rr73.7%
unpow173.7%
+-commutative73.7%
associate-*r*75.8%
*-commutative75.8%
*-commutative75.8%
Simplified75.8%
Taylor expanded in angle around 0 75.5%
associate-*r*75.5%
Simplified75.5%
Final simplification65.2%
b_m = (fabs.f64 b) (FPCore (a b_m angle) :precision binary64 (if (<= b_m 3.9e-137) (* (+ b_m a) (* a (- (sin (* PI (* angle 0.011111111111111112)))))) (* (+ b_m a) (* 0.011111111111111112 (* angle (* (- b_m a) PI))))))
b_m = fabs(b);
double code(double a, double b_m, double angle) {
double tmp;
if (b_m <= 3.9e-137) {
tmp = (b_m + a) * (a * -sin((((double) M_PI) * (angle * 0.011111111111111112))));
} else {
tmp = (b_m + a) * (0.011111111111111112 * (angle * ((b_m - a) * ((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 <= 3.9e-137) {
tmp = (b_m + a) * (a * -Math.sin((Math.PI * (angle * 0.011111111111111112))));
} else {
tmp = (b_m + a) * (0.011111111111111112 * (angle * ((b_m - a) * Math.PI)));
}
return tmp;
}
b_m = math.fabs(b) def code(a, b_m, angle): tmp = 0 if b_m <= 3.9e-137: tmp = (b_m + a) * (a * -math.sin((math.pi * (angle * 0.011111111111111112)))) else: tmp = (b_m + a) * (0.011111111111111112 * (angle * ((b_m - a) * math.pi))) return tmp
b_m = abs(b) function code(a, b_m, angle) tmp = 0.0 if (b_m <= 3.9e-137) tmp = Float64(Float64(b_m + a) * Float64(a * Float64(-sin(Float64(pi * Float64(angle * 0.011111111111111112)))))); else tmp = Float64(Float64(b_m + a) * Float64(0.011111111111111112 * Float64(angle * Float64(Float64(b_m - a) * pi)))); end return tmp end
b_m = abs(b); function tmp_2 = code(a, b_m, angle) tmp = 0.0; if (b_m <= 3.9e-137) tmp = (b_m + a) * (a * -sin((pi * (angle * 0.011111111111111112)))); else tmp = (b_m + a) * (0.011111111111111112 * (angle * ((b_m - a) * pi))); end tmp_2 = tmp; end
b_m = N[Abs[b], $MachinePrecision] code[a_, b$95$m_, angle_] := If[LessEqual[b$95$m, 3.9e-137], N[(N[(b$95$m + a), $MachinePrecision] * N[(a * (-N[Sin[N[(Pi * N[(angle * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]), $MachinePrecision], N[(N[(b$95$m + a), $MachinePrecision] * N[(0.011111111111111112 * N[(angle * N[(N[(b$95$m - a), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
\mathbf{if}\;b\_m \leq 3.9 \cdot 10^{-137}:\\
\;\;\;\;\left(b\_m + a\right) \cdot \left(a \cdot \left(-\sin \left(\pi \cdot \left(angle \cdot 0.011111111111111112\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(b\_m + a\right) \cdot \left(0.011111111111111112 \cdot \left(angle \cdot \left(\left(b\_m - a\right) \cdot \pi\right)\right)\right)\\
\end{array}
\end{array}
if b < 3.8999999999999999e-137Initial program 55.9%
associate-*l*55.9%
*-commutative55.9%
associate-*l*55.9%
Simplified55.9%
unpow255.9%
unpow255.9%
difference-of-squares57.8%
Applied egg-rr57.8%
pow157.8%
associate-*l*63.8%
2-sin63.8%
div-inv63.8%
metadata-eval63.8%
Applied egg-rr63.8%
unpow163.8%
+-commutative63.8%
associate-*r*64.7%
*-commutative64.7%
*-commutative64.7%
Simplified64.7%
Taylor expanded in b around 0 47.3%
associate-*r*47.3%
neg-mul-147.3%
*-commutative47.3%
*-commutative47.3%
*-commutative47.3%
associate-*r*47.2%
Simplified47.2%
if 3.8999999999999999e-137 < b Initial program 47.8%
associate-*l*47.8%
*-commutative47.8%
associate-*l*47.8%
Simplified47.8%
unpow247.8%
unpow247.8%
difference-of-squares51.5%
Applied egg-rr51.5%
pow151.5%
associate-*l*66.0%
2-sin66.1%
div-inv66.9%
metadata-eval66.9%
Applied egg-rr66.9%
unpow166.9%
+-commutative66.9%
associate-*r*66.9%
*-commutative66.9%
*-commutative66.9%
Simplified66.9%
Taylor expanded in angle around 0 66.1%
Final simplification53.7%
b_m = (fabs.f64 b) (FPCore (a b_m angle) :precision binary64 (if (<= angle 1e-59) (* (+ b_m a) (* 0.011111111111111112 (* (- b_m a) (* angle PI)))) (* 0.011111111111111112 (* angle (* PI (* (+ b_m a) (- b_m a)))))))
b_m = fabs(b);
double code(double a, double b_m, double angle) {
double tmp;
if (angle <= 1e-59) {
tmp = (b_m + a) * (0.011111111111111112 * ((b_m - a) * (angle * ((double) M_PI))));
} else {
tmp = 0.011111111111111112 * (angle * (((double) M_PI) * ((b_m + a) * (b_m - a))));
}
return tmp;
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle) {
double tmp;
if (angle <= 1e-59) {
tmp = (b_m + a) * (0.011111111111111112 * ((b_m - a) * (angle * Math.PI)));
} else {
tmp = 0.011111111111111112 * (angle * (Math.PI * ((b_m + a) * (b_m - a))));
}
return tmp;
}
b_m = math.fabs(b) def code(a, b_m, angle): tmp = 0 if angle <= 1e-59: tmp = (b_m + a) * (0.011111111111111112 * ((b_m - a) * (angle * math.pi))) else: tmp = 0.011111111111111112 * (angle * (math.pi * ((b_m + a) * (b_m - a)))) return tmp
b_m = abs(b) function code(a, b_m, angle) tmp = 0.0 if (angle <= 1e-59) tmp = Float64(Float64(b_m + a) * Float64(0.011111111111111112 * Float64(Float64(b_m - a) * Float64(angle * pi)))); else tmp = Float64(0.011111111111111112 * Float64(angle * Float64(pi * Float64(Float64(b_m + a) * Float64(b_m - a))))); end return tmp end
b_m = abs(b); function tmp_2 = code(a, b_m, angle) tmp = 0.0; if (angle <= 1e-59) tmp = (b_m + a) * (0.011111111111111112 * ((b_m - a) * (angle * pi))); else tmp = 0.011111111111111112 * (angle * (pi * ((b_m + a) * (b_m - a)))); end tmp_2 = tmp; end
b_m = N[Abs[b], $MachinePrecision] code[a_, b$95$m_, angle_] := If[LessEqual[angle, 1e-59], N[(N[(b$95$m + a), $MachinePrecision] * N[(0.011111111111111112 * N[(N[(b$95$m - a), $MachinePrecision] * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(angle * N[(Pi * N[(N[(b$95$m + a), $MachinePrecision] * N[(b$95$m - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
\mathbf{if}\;angle \leq 10^{-59}:\\
\;\;\;\;\left(b\_m + a\right) \cdot \left(0.011111111111111112 \cdot \left(\left(b\_m - a\right) \cdot \left(angle \cdot \pi\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(\left(b\_m + a\right) \cdot \left(b\_m - a\right)\right)\right)\right)\\
\end{array}
\end{array}
if angle < 1e-59Initial program 58.0%
associate-*l*58.0%
*-commutative58.0%
associate-*l*58.0%
Simplified58.0%
unpow258.0%
unpow258.0%
difference-of-squares59.3%
Applied egg-rr59.3%
pow159.3%
associate-*l*71.8%
2-sin71.8%
div-inv72.3%
metadata-eval72.3%
Applied egg-rr72.3%
unpow172.3%
+-commutative72.3%
associate-*r*72.4%
*-commutative72.4%
*-commutative72.4%
Simplified72.4%
Taylor expanded in angle around 0 73.2%
associate-*r*73.2%
Simplified73.2%
if 1e-59 < angle Initial program 40.7%
associate-*l*40.7%
*-commutative40.7%
associate-*l*40.7%
Simplified40.7%
Taylor expanded in angle around 0 35.6%
unpow240.7%
unpow240.7%
difference-of-squares46.2%
Applied egg-rr41.1%
Final simplification64.2%
b_m = (fabs.f64 b) (FPCore (a b_m angle) :precision binary64 (if (<= angle 7e-58) (* (+ b_m a) (* 0.011111111111111112 (* angle (* (- b_m a) PI)))) (* 0.011111111111111112 (* angle (* PI (* (+ b_m a) (- b_m a)))))))
b_m = fabs(b);
double code(double a, double b_m, double angle) {
double tmp;
if (angle <= 7e-58) {
tmp = (b_m + a) * (0.011111111111111112 * (angle * ((b_m - a) * ((double) M_PI))));
} else {
tmp = 0.011111111111111112 * (angle * (((double) M_PI) * ((b_m + a) * (b_m - a))));
}
return tmp;
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle) {
double tmp;
if (angle <= 7e-58) {
tmp = (b_m + a) * (0.011111111111111112 * (angle * ((b_m - a) * Math.PI)));
} else {
tmp = 0.011111111111111112 * (angle * (Math.PI * ((b_m + a) * (b_m - a))));
}
return tmp;
}
b_m = math.fabs(b) def code(a, b_m, angle): tmp = 0 if angle <= 7e-58: tmp = (b_m + a) * (0.011111111111111112 * (angle * ((b_m - a) * math.pi))) else: tmp = 0.011111111111111112 * (angle * (math.pi * ((b_m + a) * (b_m - a)))) return tmp
b_m = abs(b) function code(a, b_m, angle) tmp = 0.0 if (angle <= 7e-58) tmp = Float64(Float64(b_m + a) * Float64(0.011111111111111112 * Float64(angle * Float64(Float64(b_m - a) * pi)))); else tmp = Float64(0.011111111111111112 * Float64(angle * Float64(pi * Float64(Float64(b_m + a) * Float64(b_m - a))))); end return tmp end
b_m = abs(b); function tmp_2 = code(a, b_m, angle) tmp = 0.0; if (angle <= 7e-58) tmp = (b_m + a) * (0.011111111111111112 * (angle * ((b_m - a) * pi))); else tmp = 0.011111111111111112 * (angle * (pi * ((b_m + a) * (b_m - a)))); end tmp_2 = tmp; end
b_m = N[Abs[b], $MachinePrecision] code[a_, b$95$m_, angle_] := If[LessEqual[angle, 7e-58], N[(N[(b$95$m + a), $MachinePrecision] * N[(0.011111111111111112 * N[(angle * N[(N[(b$95$m - a), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(angle * N[(Pi * N[(N[(b$95$m + a), $MachinePrecision] * N[(b$95$m - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
\mathbf{if}\;angle \leq 7 \cdot 10^{-58}:\\
\;\;\;\;\left(b\_m + a\right) \cdot \left(0.011111111111111112 \cdot \left(angle \cdot \left(\left(b\_m - a\right) \cdot \pi\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(\left(b\_m + a\right) \cdot \left(b\_m - a\right)\right)\right)\right)\\
\end{array}
\end{array}
if angle < 6.9999999999999998e-58Initial program 58.0%
associate-*l*58.0%
*-commutative58.0%
associate-*l*58.0%
Simplified58.0%
unpow258.0%
unpow258.0%
difference-of-squares59.3%
Applied egg-rr59.3%
pow159.3%
associate-*l*71.8%
2-sin71.8%
div-inv72.3%
metadata-eval72.3%
Applied egg-rr72.3%
unpow172.3%
+-commutative72.3%
associate-*r*72.4%
*-commutative72.4%
*-commutative72.4%
Simplified72.4%
Taylor expanded in angle around 0 73.2%
if 6.9999999999999998e-58 < angle Initial program 40.7%
associate-*l*40.7%
*-commutative40.7%
associate-*l*40.7%
Simplified40.7%
Taylor expanded in angle around 0 35.6%
unpow240.7%
unpow240.7%
difference-of-squares46.2%
Applied egg-rr41.1%
Final simplification64.2%
b_m = (fabs.f64 b) (FPCore (a b_m angle) :precision binary64 (if (<= angle 2.8e-58) (* 0.011111111111111112 (* (+ b_m a) (* PI (* (- b_m a) angle)))) (* 0.011111111111111112 (* angle (* PI (* (+ b_m a) (- b_m a)))))))
b_m = fabs(b);
double code(double a, double b_m, double angle) {
double tmp;
if (angle <= 2.8e-58) {
tmp = 0.011111111111111112 * ((b_m + a) * (((double) M_PI) * ((b_m - a) * angle)));
} else {
tmp = 0.011111111111111112 * (angle * (((double) M_PI) * ((b_m + a) * (b_m - a))));
}
return tmp;
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle) {
double tmp;
if (angle <= 2.8e-58) {
tmp = 0.011111111111111112 * ((b_m + a) * (Math.PI * ((b_m - a) * angle)));
} else {
tmp = 0.011111111111111112 * (angle * (Math.PI * ((b_m + a) * (b_m - a))));
}
return tmp;
}
b_m = math.fabs(b) def code(a, b_m, angle): tmp = 0 if angle <= 2.8e-58: tmp = 0.011111111111111112 * ((b_m + a) * (math.pi * ((b_m - a) * angle))) else: tmp = 0.011111111111111112 * (angle * (math.pi * ((b_m + a) * (b_m - a)))) return tmp
b_m = abs(b) function code(a, b_m, angle) tmp = 0.0 if (angle <= 2.8e-58) tmp = Float64(0.011111111111111112 * Float64(Float64(b_m + a) * Float64(pi * Float64(Float64(b_m - a) * angle)))); else tmp = Float64(0.011111111111111112 * Float64(angle * Float64(pi * Float64(Float64(b_m + a) * Float64(b_m - a))))); end return tmp end
b_m = abs(b); function tmp_2 = code(a, b_m, angle) tmp = 0.0; if (angle <= 2.8e-58) tmp = 0.011111111111111112 * ((b_m + a) * (pi * ((b_m - a) * angle))); else tmp = 0.011111111111111112 * (angle * (pi * ((b_m + a) * (b_m - a)))); end tmp_2 = tmp; end
b_m = N[Abs[b], $MachinePrecision] code[a_, b$95$m_, angle_] := If[LessEqual[angle, 2.8e-58], N[(0.011111111111111112 * N[(N[(b$95$m + a), $MachinePrecision] * N[(Pi * N[(N[(b$95$m - a), $MachinePrecision] * angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(angle * N[(Pi * N[(N[(b$95$m + a), $MachinePrecision] * N[(b$95$m - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
\mathbf{if}\;angle \leq 2.8 \cdot 10^{-58}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(b\_m + a\right) \cdot \left(\pi \cdot \left(\left(b\_m - a\right) \cdot angle\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(\left(b\_m + a\right) \cdot \left(b\_m - a\right)\right)\right)\right)\\
\end{array}
\end{array}
if angle < 2.8000000000000001e-58Initial program 58.0%
associate-*l*58.0%
*-commutative58.0%
associate-*l*58.0%
Simplified58.0%
Taylor expanded in angle around 0 59.9%
unpow258.0%
unpow258.0%
difference-of-squares59.3%
Applied egg-rr62.2%
Taylor expanded in angle around 0 62.2%
associate-*r*62.2%
+-commutative62.2%
*-commutative62.2%
+-commutative62.2%
Simplified62.2%
associate-*r*72.7%
+-commutative72.7%
distribute-lft-in68.3%
*-commutative68.3%
associate-*l*68.3%
*-commutative68.3%
associate-*l*68.3%
Applied egg-rr68.3%
+-commutative68.3%
distribute-lft-out72.8%
Simplified72.8%
if 2.8000000000000001e-58 < angle Initial program 40.7%
associate-*l*40.7%
*-commutative40.7%
associate-*l*40.7%
Simplified40.7%
Taylor expanded in angle around 0 35.6%
unpow240.7%
unpow240.7%
difference-of-squares46.2%
Applied egg-rr41.1%
Final simplification63.9%
b_m = (fabs.f64 b) (FPCore (a b_m angle) :precision binary64 (if (<= angle 7.2e-60) (* 0.011111111111111112 (* (* (- b_m a) angle) (* (+ b_m a) PI))) (* 0.011111111111111112 (* angle (* PI (* (+ b_m a) (- b_m a)))))))
b_m = fabs(b);
double code(double a, double b_m, double angle) {
double tmp;
if (angle <= 7.2e-60) {
tmp = 0.011111111111111112 * (((b_m - a) * angle) * ((b_m + a) * ((double) M_PI)));
} else {
tmp = 0.011111111111111112 * (angle * (((double) M_PI) * ((b_m + a) * (b_m - a))));
}
return tmp;
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle) {
double tmp;
if (angle <= 7.2e-60) {
tmp = 0.011111111111111112 * (((b_m - a) * angle) * ((b_m + a) * Math.PI));
} else {
tmp = 0.011111111111111112 * (angle * (Math.PI * ((b_m + a) * (b_m - a))));
}
return tmp;
}
b_m = math.fabs(b) def code(a, b_m, angle): tmp = 0 if angle <= 7.2e-60: tmp = 0.011111111111111112 * (((b_m - a) * angle) * ((b_m + a) * math.pi)) else: tmp = 0.011111111111111112 * (angle * (math.pi * ((b_m + a) * (b_m - a)))) return tmp
b_m = abs(b) function code(a, b_m, angle) tmp = 0.0 if (angle <= 7.2e-60) tmp = Float64(0.011111111111111112 * Float64(Float64(Float64(b_m - a) * angle) * Float64(Float64(b_m + a) * pi))); else tmp = Float64(0.011111111111111112 * Float64(angle * Float64(pi * Float64(Float64(b_m + a) * Float64(b_m - a))))); end return tmp end
b_m = abs(b); function tmp_2 = code(a, b_m, angle) tmp = 0.0; if (angle <= 7.2e-60) tmp = 0.011111111111111112 * (((b_m - a) * angle) * ((b_m + a) * pi)); else tmp = 0.011111111111111112 * (angle * (pi * ((b_m + a) * (b_m - a)))); end tmp_2 = tmp; end
b_m = N[Abs[b], $MachinePrecision] code[a_, b$95$m_, angle_] := If[LessEqual[angle, 7.2e-60], N[(0.011111111111111112 * N[(N[(N[(b$95$m - a), $MachinePrecision] * angle), $MachinePrecision] * N[(N[(b$95$m + a), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(angle * N[(Pi * N[(N[(b$95$m + a), $MachinePrecision] * N[(b$95$m - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
\mathbf{if}\;angle \leq 7.2 \cdot 10^{-60}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(\left(b\_m - a\right) \cdot angle\right) \cdot \left(\left(b\_m + a\right) \cdot \pi\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(\left(b\_m + a\right) \cdot \left(b\_m - a\right)\right)\right)\right)\\
\end{array}
\end{array}
if angle < 7.2e-60Initial program 58.0%
associate-*l*58.0%
*-commutative58.0%
associate-*l*58.0%
Simplified58.0%
Taylor expanded in angle around 0 59.9%
unpow258.0%
unpow258.0%
difference-of-squares59.3%
Applied egg-rr62.2%
Taylor expanded in angle around 0 62.2%
associate-*r*62.2%
+-commutative62.2%
*-commutative62.2%
+-commutative62.2%
Simplified62.2%
associate-*r*72.7%
+-commutative72.7%
distribute-lft-in68.3%
*-commutative68.3%
associate-*l*68.3%
*-commutative68.3%
associate-*l*68.3%
Applied egg-rr68.3%
distribute-lft-out72.8%
distribute-rgt-out68.3%
associate-*r*68.2%
associate-*r*68.3%
distribute-rgt-out72.8%
distribute-rgt-in72.8%
+-commutative72.8%
Simplified72.8%
if 7.2e-60 < angle Initial program 40.7%
associate-*l*40.7%
*-commutative40.7%
associate-*l*40.7%
Simplified40.7%
Taylor expanded in angle around 0 35.6%
unpow240.7%
unpow240.7%
difference-of-squares46.2%
Applied egg-rr41.1%
Final simplification63.9%
b_m = (fabs.f64 b) (FPCore (a b_m angle) :precision binary64 (* 0.011111111111111112 (* angle (* PI (* (+ b_m a) (- b_m a))))))
b_m = fabs(b);
double code(double a, double b_m, double angle) {
return 0.011111111111111112 * (angle * (((double) M_PI) * ((b_m + a) * (b_m - a))));
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle) {
return 0.011111111111111112 * (angle * (Math.PI * ((b_m + a) * (b_m - a))));
}
b_m = math.fabs(b) def code(a, b_m, angle): return 0.011111111111111112 * (angle * (math.pi * ((b_m + a) * (b_m - a))))
b_m = abs(b) function code(a, b_m, angle) return Float64(0.011111111111111112 * Float64(angle * Float64(pi * Float64(Float64(b_m + a) * Float64(b_m - a))))) end
b_m = abs(b); function tmp = code(a, b_m, angle) tmp = 0.011111111111111112 * (angle * (pi * ((b_m + a) * (b_m - a)))); end
b_m = N[Abs[b], $MachinePrecision] code[a_, b$95$m_, angle_] := N[(0.011111111111111112 * N[(angle * N[(Pi * N[(N[(b$95$m + a), $MachinePrecision] * N[(b$95$m - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
b_m = \left|b\right|
\\
0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(\left(b\_m + a\right) \cdot \left(b\_m - a\right)\right)\right)\right)
\end{array}
Initial program 53.1%
associate-*l*53.1%
*-commutative53.1%
associate-*l*53.1%
Simplified53.1%
Taylor expanded in angle around 0 53.0%
unpow253.1%
unpow253.1%
difference-of-squares55.6%
Applied egg-rr56.3%
herbie shell --seed 2024103
(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)))))