
(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 15 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}
NOTE: b should be positive before calling this function
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (cbrt (sqrt PI))) (t_1 (* t_0 t_0)))
(if (<= b 4e+248)
(*
(+ b a)
(*
(- b a)
(sin (* 2.0 (* (* t_1 (pow t_1 2.0)) (* 0.005555555555555556 angle))))))
(*
(* (* 2.0 (* b b)) (sin (* 0.005555555555555556 (* PI angle))))
(cos (* PI (/ angle 180.0)))))))b = abs(b);
double code(double a, double b, double angle) {
double t_0 = cbrt(sqrt(((double) M_PI)));
double t_1 = t_0 * t_0;
double tmp;
if (b <= 4e+248) {
tmp = (b + a) * ((b - a) * sin((2.0 * ((t_1 * pow(t_1, 2.0)) * (0.005555555555555556 * angle)))));
} else {
tmp = ((2.0 * (b * b)) * sin((0.005555555555555556 * (((double) M_PI) * angle)))) * cos((((double) M_PI) * (angle / 180.0)));
}
return tmp;
}
b = Math.abs(b);
public static double code(double a, double b, double angle) {
double t_0 = Math.cbrt(Math.sqrt(Math.PI));
double t_1 = t_0 * t_0;
double tmp;
if (b <= 4e+248) {
tmp = (b + a) * ((b - a) * Math.sin((2.0 * ((t_1 * Math.pow(t_1, 2.0)) * (0.005555555555555556 * angle)))));
} else {
tmp = ((2.0 * (b * b)) * Math.sin((0.005555555555555556 * (Math.PI * angle)))) * Math.cos((Math.PI * (angle / 180.0)));
}
return tmp;
}
b = abs(b) function code(a, b, angle) t_0 = cbrt(sqrt(pi)) t_1 = Float64(t_0 * t_0) tmp = 0.0 if (b <= 4e+248) tmp = Float64(Float64(b + a) * Float64(Float64(b - a) * sin(Float64(2.0 * Float64(Float64(t_1 * (t_1 ^ 2.0)) * Float64(0.005555555555555556 * angle)))))); else tmp = Float64(Float64(Float64(2.0 * Float64(b * b)) * sin(Float64(0.005555555555555556 * Float64(pi * angle)))) * cos(Float64(pi * Float64(angle / 180.0)))); end return tmp end
NOTE: b should be positive before calling this function
code[a_, b_, angle_] := Block[{t$95$0 = N[Power[N[Sqrt[Pi], $MachinePrecision], 1/3], $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 * t$95$0), $MachinePrecision]}, If[LessEqual[b, 4e+248], N[(N[(b + a), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[Sin[N[(2.0 * N[(N[(t$95$1 * N[Power[t$95$1, 2.0], $MachinePrecision]), $MachinePrecision] * N[(0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(2.0 * N[(b * b), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(0.005555555555555556 * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Cos[N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
b = |b|\\
\\
\begin{array}{l}
t_0 := \sqrt[3]{\sqrt{\pi}}\\
t_1 := t_0 \cdot t_0\\
\mathbf{if}\;b \leq 4 \cdot 10^{+248}:\\
\;\;\;\;\left(b + a\right) \cdot \left(\left(b - a\right) \cdot \sin \left(2 \cdot \left(\left(t_1 \cdot {t_1}^{2}\right) \cdot \left(0.005555555555555556 \cdot angle\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(2 \cdot \left(b \cdot b\right)\right) \cdot \sin \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\\
\end{array}
\end{array}
if b < 4.00000000000000018e248Initial program 57.9%
*-commutative57.9%
associate-*l*57.9%
associate-*l*57.9%
unpow257.9%
unpow257.9%
difference-of-squares62.2%
Simplified62.2%
associate-*l*69.1%
flip-+58.0%
associate-*l/55.9%
associate-*l*55.9%
2-sin55.9%
div-inv55.2%
metadata-eval55.2%
Applied egg-rr55.2%
associate-/l*57.1%
associate-/r/57.2%
difference-of-squares61.0%
associate-/l*67.9%
*-inverses67.9%
+-commutative67.9%
*-commutative67.9%
Simplified67.9%
add-cube-cbrt65.9%
pow265.9%
Applied egg-rr65.9%
pow1/365.9%
add-sqr-sqrt65.9%
unpow265.9%
pow-pow65.9%
metadata-eval65.9%
Applied egg-rr65.9%
metadata-eval65.9%
pow-sqr68.0%
unpow1/365.9%
unpow1/370.3%
Simplified70.3%
pow1/365.9%
add-sqr-sqrt65.9%
unpow265.9%
pow-pow65.9%
metadata-eval65.9%
Applied egg-rr70.3%
metadata-eval65.9%
pow-sqr68.0%
unpow1/365.9%
unpow1/370.3%
Simplified69.7%
if 4.00000000000000018e248 < b Initial program 57.1%
sub-neg57.1%
unpow257.1%
sqr-neg57.1%
unpow257.1%
unpow257.1%
sqr-neg57.1%
unpow257.1%
unpow257.1%
sqr-neg57.1%
unpow257.1%
sub-neg57.1%
Simplified57.1%
Taylor expanded in b around inf 92.9%
unpow292.9%
associate-*r*92.9%
*-commutative92.9%
*-commutative92.9%
associate-*r*85.7%
*-commutative85.7%
Simplified85.7%
Taylor expanded in angle around 0 92.9%
Final simplification71.0%
NOTE: b should be positive before calling this function
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (cbrt (sqrt PI))))
(if (<= (pow a 2.0) 5e+94)
(*
(+ b a)
(* (- b a) (sin (* 2.0 (* angle (* PI 0.005555555555555556))))))
(*
(+ b a)
(*
(- b a)
(sin
(*
2.0
(*
(* 0.005555555555555556 angle)
(* (* t_0 t_0) (pow (cbrt PI) 2.0))))))))))b = abs(b);
double code(double a, double b, double angle) {
double t_0 = cbrt(sqrt(((double) M_PI)));
double tmp;
if (pow(a, 2.0) <= 5e+94) {
tmp = (b + a) * ((b - a) * sin((2.0 * (angle * (((double) M_PI) * 0.005555555555555556)))));
} else {
tmp = (b + a) * ((b - a) * sin((2.0 * ((0.005555555555555556 * angle) * ((t_0 * t_0) * pow(cbrt(((double) M_PI)), 2.0))))));
}
return tmp;
}
b = Math.abs(b);
public static double code(double a, double b, double angle) {
double t_0 = Math.cbrt(Math.sqrt(Math.PI));
double tmp;
if (Math.pow(a, 2.0) <= 5e+94) {
tmp = (b + a) * ((b - a) * Math.sin((2.0 * (angle * (Math.PI * 0.005555555555555556)))));
} else {
tmp = (b + a) * ((b - a) * Math.sin((2.0 * ((0.005555555555555556 * angle) * ((t_0 * t_0) * Math.pow(Math.cbrt(Math.PI), 2.0))))));
}
return tmp;
}
b = abs(b) function code(a, b, angle) t_0 = cbrt(sqrt(pi)) tmp = 0.0 if ((a ^ 2.0) <= 5e+94) tmp = Float64(Float64(b + a) * Float64(Float64(b - a) * sin(Float64(2.0 * Float64(angle * Float64(pi * 0.005555555555555556)))))); else tmp = Float64(Float64(b + a) * Float64(Float64(b - a) * sin(Float64(2.0 * Float64(Float64(0.005555555555555556 * angle) * Float64(Float64(t_0 * t_0) * (cbrt(pi) ^ 2.0))))))); end return tmp end
NOTE: b should be positive before calling this function
code[a_, b_, angle_] := Block[{t$95$0 = N[Power[N[Sqrt[Pi], $MachinePrecision], 1/3], $MachinePrecision]}, If[LessEqual[N[Power[a, 2.0], $MachinePrecision], 5e+94], N[(N[(b + a), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[Sin[N[(2.0 * N[(angle * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b + a), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[Sin[N[(2.0 * N[(N[(0.005555555555555556 * angle), $MachinePrecision] * N[(N[(t$95$0 * t$95$0), $MachinePrecision] * N[Power[N[Power[Pi, 1/3], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
b = |b|\\
\\
\begin{array}{l}
t_0 := \sqrt[3]{\sqrt{\pi}}\\
\mathbf{if}\;{a}^{2} \leq 5 \cdot 10^{+94}:\\
\;\;\;\;\left(b + a\right) \cdot \left(\left(b - a\right) \cdot \sin \left(2 \cdot \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(b + a\right) \cdot \left(\left(b - a\right) \cdot \sin \left(2 \cdot \left(\left(0.005555555555555556 \cdot angle\right) \cdot \left(\left(t_0 \cdot t_0\right) \cdot {\left(\sqrt[3]{\pi}\right)}^{2}\right)\right)\right)\right)\\
\end{array}
\end{array}
if (pow.f64 a 2) < 5.0000000000000001e94Initial program 65.5%
*-commutative65.5%
associate-*l*65.5%
associate-*l*65.5%
unpow265.5%
unpow265.5%
difference-of-squares65.5%
Simplified65.5%
associate-*l*69.3%
flip-+65.6%
associate-*l/63.1%
associate-*l*63.1%
2-sin63.1%
div-inv62.7%
metadata-eval62.7%
Applied egg-rr62.7%
associate-/l*64.8%
associate-/r/64.9%
difference-of-squares64.9%
associate-/l*68.6%
*-inverses68.6%
+-commutative68.6%
*-commutative68.6%
Simplified68.6%
Taylor expanded in angle around 0 68.5%
*-commutative68.5%
associate-*r*69.7%
Simplified69.7%
if 5.0000000000000001e94 < (pow.f64 a 2) Initial program 46.7%
*-commutative46.7%
associate-*l*46.7%
associate-*l*46.7%
unpow246.7%
unpow246.7%
difference-of-squares59.6%
Simplified59.6%
associate-*l*70.2%
flip-+46.7%
associate-*l/45.6%
associate-*l*45.6%
2-sin45.6%
div-inv44.6%
metadata-eval44.6%
Applied egg-rr44.6%
associate-/l*45.8%
associate-/r/45.8%
difference-of-squares57.7%
associate-/l*68.3%
*-inverses68.3%
+-commutative68.3%
*-commutative68.3%
Simplified68.3%
add-cube-cbrt66.6%
pow266.6%
Applied egg-rr66.6%
pow1/366.6%
add-sqr-sqrt66.6%
unpow266.6%
pow-pow66.6%
metadata-eval66.6%
Applied egg-rr66.6%
metadata-eval66.6%
pow-sqr70.1%
unpow1/366.6%
unpow1/375.9%
Simplified75.9%
Final simplification72.2%
NOTE: b should be positive before calling this function
(FPCore (a b angle)
:precision binary64
(if (<= (pow a 2.0) 2e+120)
(* (+ b a) (* (- b a) (sin (* 2.0 (* angle (* PI 0.005555555555555556))))))
(*
(+ b a)
(*
(- b a)
(sin
(*
2.0
(* (* 0.005555555555555556 angle) (cbrt (exp (* 3.0 (log PI)))))))))))b = abs(b);
double code(double a, double b, double angle) {
double tmp;
if (pow(a, 2.0) <= 2e+120) {
tmp = (b + a) * ((b - a) * sin((2.0 * (angle * (((double) M_PI) * 0.005555555555555556)))));
} else {
tmp = (b + a) * ((b - a) * sin((2.0 * ((0.005555555555555556 * angle) * cbrt(exp((3.0 * log(((double) M_PI)))))))));
}
return tmp;
}
b = Math.abs(b);
public static double code(double a, double b, double angle) {
double tmp;
if (Math.pow(a, 2.0) <= 2e+120) {
tmp = (b + a) * ((b - a) * Math.sin((2.0 * (angle * (Math.PI * 0.005555555555555556)))));
} else {
tmp = (b + a) * ((b - a) * Math.sin((2.0 * ((0.005555555555555556 * angle) * Math.cbrt(Math.exp((3.0 * Math.log(Math.PI))))))));
}
return tmp;
}
b = abs(b) function code(a, b, angle) tmp = 0.0 if ((a ^ 2.0) <= 2e+120) tmp = Float64(Float64(b + a) * Float64(Float64(b - a) * sin(Float64(2.0 * Float64(angle * Float64(pi * 0.005555555555555556)))))); else tmp = Float64(Float64(b + a) * Float64(Float64(b - a) * sin(Float64(2.0 * Float64(Float64(0.005555555555555556 * angle) * cbrt(exp(Float64(3.0 * log(pi))))))))); end return tmp end
NOTE: b should be positive before calling this function code[a_, b_, angle_] := If[LessEqual[N[Power[a, 2.0], $MachinePrecision], 2e+120], N[(N[(b + a), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[Sin[N[(2.0 * N[(angle * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b + a), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[Sin[N[(2.0 * N[(N[(0.005555555555555556 * angle), $MachinePrecision] * N[Power[N[Exp[N[(3.0 * N[Log[Pi], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
b = |b|\\
\\
\begin{array}{l}
\mathbf{if}\;{a}^{2} \leq 2 \cdot 10^{+120}:\\
\;\;\;\;\left(b + a\right) \cdot \left(\left(b - a\right) \cdot \sin \left(2 \cdot \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(b + a\right) \cdot \left(\left(b - a\right) \cdot \sin \left(2 \cdot \left(\left(0.005555555555555556 \cdot angle\right) \cdot \sqrt[3]{e^{3 \cdot \log \pi}}\right)\right)\right)\\
\end{array}
\end{array}
if (pow.f64 a 2) < 2e120Initial program 65.4%
*-commutative65.4%
associate-*l*65.4%
associate-*l*65.4%
unpow265.4%
unpow265.4%
difference-of-squares65.4%
Simplified65.4%
associate-*l*69.0%
flip-+65.4%
associate-*l/63.0%
associate-*l*63.0%
2-sin63.0%
div-inv62.6%
metadata-eval62.6%
Applied egg-rr62.6%
associate-/l*64.7%
associate-/r/64.8%
difference-of-squares64.8%
associate-/l*68.3%
*-inverses68.3%
+-commutative68.3%
*-commutative68.3%
Simplified68.3%
Taylor expanded in angle around 0 68.3%
*-commutative68.3%
associate-*r*69.4%
Simplified69.4%
if 2e120 < (pow.f64 a 2) Initial program 46.0%
*-commutative46.0%
associate-*l*46.0%
associate-*l*46.0%
unpow246.0%
unpow246.0%
difference-of-squares59.6%
Simplified59.6%
associate-*l*70.7%
flip-+46.0%
associate-*l/44.8%
associate-*l*44.8%
2-sin44.8%
div-inv43.8%
metadata-eval43.8%
Applied egg-rr43.8%
associate-/l*45.0%
associate-/r/45.1%
difference-of-squares57.5%
associate-/l*68.7%
*-inverses68.7%
+-commutative68.7%
*-commutative68.7%
Simplified68.7%
add-cbrt-cube73.5%
pow373.5%
Applied egg-rr73.5%
add-exp-log73.5%
log-pow76.4%
Applied egg-rr76.4%
Final simplification72.1%
NOTE: b should be positive before calling this function
(FPCore (a b angle)
:precision binary64
(if (<= a 4.3e+217)
(* (+ b a) (* (- b a) (sin (* 2.0 (* angle (* PI 0.005555555555555556))))))
(*
(+ b a)
(*
(- b a)
(sin (* 2.0 (* PI (pow (cbrt (* 0.005555555555555556 angle)) 3.0))))))))b = abs(b);
double code(double a, double b, double angle) {
double tmp;
if (a <= 4.3e+217) {
tmp = (b + a) * ((b - a) * sin((2.0 * (angle * (((double) M_PI) * 0.005555555555555556)))));
} else {
tmp = (b + a) * ((b - a) * sin((2.0 * (((double) M_PI) * pow(cbrt((0.005555555555555556 * angle)), 3.0)))));
}
return tmp;
}
b = Math.abs(b);
public static double code(double a, double b, double angle) {
double tmp;
if (a <= 4.3e+217) {
tmp = (b + a) * ((b - a) * Math.sin((2.0 * (angle * (Math.PI * 0.005555555555555556)))));
} else {
tmp = (b + a) * ((b - a) * Math.sin((2.0 * (Math.PI * Math.pow(Math.cbrt((0.005555555555555556 * angle)), 3.0)))));
}
return tmp;
}
b = abs(b) function code(a, b, angle) tmp = 0.0 if (a <= 4.3e+217) tmp = Float64(Float64(b + a) * Float64(Float64(b - a) * sin(Float64(2.0 * Float64(angle * Float64(pi * 0.005555555555555556)))))); else tmp = Float64(Float64(b + a) * Float64(Float64(b - a) * sin(Float64(2.0 * Float64(pi * (cbrt(Float64(0.005555555555555556 * angle)) ^ 3.0)))))); end return tmp end
NOTE: b should be positive before calling this function code[a_, b_, angle_] := If[LessEqual[a, 4.3e+217], N[(N[(b + a), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[Sin[N[(2.0 * N[(angle * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b + a), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[Sin[N[(2.0 * N[(Pi * N[Power[N[Power[N[(0.005555555555555556 * angle), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
b = |b|\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq 4.3 \cdot 10^{+217}:\\
\;\;\;\;\left(b + a\right) \cdot \left(\left(b - a\right) \cdot \sin \left(2 \cdot \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(b + a\right) \cdot \left(\left(b - a\right) \cdot \sin \left(2 \cdot \left(\pi \cdot {\left(\sqrt[3]{0.005555555555555556 \cdot angle}\right)}^{3}\right)\right)\right)\\
\end{array}
\end{array}
if a < 4.3000000000000001e217Initial program 59.9%
*-commutative59.9%
associate-*l*59.9%
associate-*l*59.9%
unpow259.9%
unpow259.9%
difference-of-squares64.2%
Simplified64.2%
associate-*l*70.4%
flip-+59.9%
associate-*l/57.9%
associate-*l*57.9%
2-sin57.9%
div-inv57.6%
metadata-eval57.6%
Applied egg-rr57.6%
associate-/l*59.5%
associate-/r/59.5%
difference-of-squares63.4%
associate-/l*69.6%
*-inverses69.6%
+-commutative69.6%
*-commutative69.6%
Simplified69.6%
Taylor expanded in angle around 0 69.7%
*-commutative69.7%
associate-*r*69.9%
Simplified69.9%
if 4.3000000000000001e217 < a Initial program 29.8%
*-commutative29.8%
associate-*l*29.8%
associate-*l*29.8%
unpow229.8%
unpow229.8%
difference-of-squares47.9%
Simplified47.9%
associate-*l*58.7%
flip-+29.8%
associate-*l/29.8%
associate-*l*29.8%
2-sin29.8%
div-inv23.9%
metadata-eval23.9%
Applied egg-rr23.9%
associate-/l*23.9%
associate-/r/23.9%
difference-of-squares42.0%
associate-/l*52.8%
*-inverses52.8%
+-commutative52.8%
*-commutative52.8%
Simplified52.8%
add-cube-cbrt70.4%
pow370.4%
Applied egg-rr70.4%
Final simplification69.9%
NOTE: b should be positive before calling this function
(FPCore (a b angle)
:precision binary64
(if (<= b 5.6e+252)
(*
(+ b a)
(*
(- b a)
(sin (* 2.0 (* (* 0.005555555555555556 angle) (cbrt (pow PI 3.0)))))))
(*
(* (* 2.0 (* b b)) (sin (* 0.005555555555555556 (* PI angle))))
(cos (* PI (/ angle 180.0))))))b = abs(b);
double code(double a, double b, double angle) {
double tmp;
if (b <= 5.6e+252) {
tmp = (b + a) * ((b - a) * sin((2.0 * ((0.005555555555555556 * angle) * cbrt(pow(((double) M_PI), 3.0))))));
} else {
tmp = ((2.0 * (b * b)) * sin((0.005555555555555556 * (((double) M_PI) * angle)))) * cos((((double) M_PI) * (angle / 180.0)));
}
return tmp;
}
b = Math.abs(b);
public static double code(double a, double b, double angle) {
double tmp;
if (b <= 5.6e+252) {
tmp = (b + a) * ((b - a) * Math.sin((2.0 * ((0.005555555555555556 * angle) * Math.cbrt(Math.pow(Math.PI, 3.0))))));
} else {
tmp = ((2.0 * (b * b)) * Math.sin((0.005555555555555556 * (Math.PI * angle)))) * Math.cos((Math.PI * (angle / 180.0)));
}
return tmp;
}
b = abs(b) function code(a, b, angle) tmp = 0.0 if (b <= 5.6e+252) tmp = Float64(Float64(b + a) * Float64(Float64(b - a) * sin(Float64(2.0 * Float64(Float64(0.005555555555555556 * angle) * cbrt((pi ^ 3.0))))))); else tmp = Float64(Float64(Float64(2.0 * Float64(b * b)) * sin(Float64(0.005555555555555556 * Float64(pi * angle)))) * cos(Float64(pi * Float64(angle / 180.0)))); end return tmp end
NOTE: b should be positive before calling this function code[a_, b_, angle_] := If[LessEqual[b, 5.6e+252], N[(N[(b + a), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[Sin[N[(2.0 * N[(N[(0.005555555555555556 * angle), $MachinePrecision] * N[Power[N[Power[Pi, 3.0], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(2.0 * N[(b * b), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(0.005555555555555556 * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Cos[N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
b = |b|\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq 5.6 \cdot 10^{+252}:\\
\;\;\;\;\left(b + a\right) \cdot \left(\left(b - a\right) \cdot \sin \left(2 \cdot \left(\left(0.005555555555555556 \cdot angle\right) \cdot \sqrt[3]{{\pi}^{3}}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(2 \cdot \left(b \cdot b\right)\right) \cdot \sin \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\\
\end{array}
\end{array}
if b < 5.60000000000000007e252Initial program 57.9%
*-commutative57.9%
associate-*l*57.9%
associate-*l*57.9%
unpow257.9%
unpow257.9%
difference-of-squares62.2%
Simplified62.2%
associate-*l*69.1%
flip-+58.0%
associate-*l/55.9%
associate-*l*55.9%
2-sin55.9%
div-inv55.2%
metadata-eval55.2%
Applied egg-rr55.2%
associate-/l*57.1%
associate-/r/57.2%
difference-of-squares61.0%
associate-/l*67.9%
*-inverses67.9%
+-commutative67.9%
*-commutative67.9%
Simplified67.9%
add-cbrt-cube70.0%
pow370.0%
Applied egg-rr70.0%
if 5.60000000000000007e252 < b Initial program 57.1%
sub-neg57.1%
unpow257.1%
sqr-neg57.1%
unpow257.1%
unpow257.1%
sqr-neg57.1%
unpow257.1%
unpow257.1%
sqr-neg57.1%
unpow257.1%
sub-neg57.1%
Simplified57.1%
Taylor expanded in b around inf 92.9%
unpow292.9%
associate-*r*92.9%
*-commutative92.9%
*-commutative92.9%
associate-*r*85.7%
*-commutative85.7%
Simplified85.7%
Taylor expanded in angle around 0 92.9%
Final simplification71.3%
NOTE: b should be positive before calling this function (FPCore (a b angle) :precision binary64 (if (<= (/ angle 180.0) -2e+159) (* 0.011111111111111112 (* angle (* PI (* (+ b a) (- b a))))) (* (+ b a) (* (- b a) (sin (* (* PI angle) 0.011111111111111112))))))
b = abs(b);
double code(double a, double b, double angle) {
double tmp;
if ((angle / 180.0) <= -2e+159) {
tmp = 0.011111111111111112 * (angle * (((double) M_PI) * ((b + a) * (b - a))));
} else {
tmp = (b + a) * ((b - a) * sin(((((double) M_PI) * angle) * 0.011111111111111112)));
}
return tmp;
}
b = Math.abs(b);
public static double code(double a, double b, double angle) {
double tmp;
if ((angle / 180.0) <= -2e+159) {
tmp = 0.011111111111111112 * (angle * (Math.PI * ((b + a) * (b - a))));
} else {
tmp = (b + a) * ((b - a) * Math.sin(((Math.PI * angle) * 0.011111111111111112)));
}
return tmp;
}
b = abs(b) def code(a, b, angle): tmp = 0 if (angle / 180.0) <= -2e+159: tmp = 0.011111111111111112 * (angle * (math.pi * ((b + a) * (b - a)))) else: tmp = (b + a) * ((b - a) * math.sin(((math.pi * angle) * 0.011111111111111112))) return tmp
b = abs(b) function code(a, b, angle) tmp = 0.0 if (Float64(angle / 180.0) <= -2e+159) tmp = Float64(0.011111111111111112 * Float64(angle * Float64(pi * Float64(Float64(b + a) * Float64(b - a))))); else tmp = Float64(Float64(b + a) * Float64(Float64(b - a) * sin(Float64(Float64(pi * angle) * 0.011111111111111112)))); end return tmp end
b = abs(b) function tmp_2 = code(a, b, angle) tmp = 0.0; if ((angle / 180.0) <= -2e+159) tmp = 0.011111111111111112 * (angle * (pi * ((b + a) * (b - a)))); else tmp = (b + a) * ((b - a) * sin(((pi * angle) * 0.011111111111111112))); end tmp_2 = tmp; end
NOTE: b should be positive before calling this function code[a_, b_, angle_] := If[LessEqual[N[(angle / 180.0), $MachinePrecision], -2e+159], N[(0.011111111111111112 * N[(angle * N[(Pi * N[(N[(b + a), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b + a), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[Sin[N[(N[(Pi * angle), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
b = |b|\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{angle}{180} \leq -2 \cdot 10^{+159}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(b + a\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle 180) < -1.9999999999999999e159Initial program 21.9%
*-commutative21.9%
associate-*l*21.9%
associate-*l*21.9%
unpow221.9%
unpow221.9%
difference-of-squares25.5%
Simplified25.5%
Taylor expanded in angle around 0 40.7%
if -1.9999999999999999e159 < (/.f64 angle 180) Initial program 62.3%
*-commutative62.3%
associate-*l*62.3%
associate-*l*62.3%
unpow262.3%
unpow262.3%
difference-of-squares67.7%
Simplified67.7%
associate-*l*75.1%
flip-+62.4%
associate-*l/60.4%
associate-*l*60.4%
2-sin60.4%
div-inv60.0%
metadata-eval60.0%
Applied egg-rr60.0%
associate-/l*61.9%
associate-/r/62.0%
difference-of-squares67.4%
associate-/l*74.7%
*-inverses74.7%
+-commutative74.7%
*-commutative74.7%
Simplified74.7%
Taylor expanded in angle around inf 75.3%
Final simplification71.6%
NOTE: b should be positive before calling this function (FPCore (a b angle) :precision binary64 (if (<= angle 2.2e+129) (* (+ b a) (* (* angle 0.011111111111111112) (* (- b a) PI))) (* 0.011111111111111112 (fabs (* angle (* (- b a) (* (+ b a) PI)))))))
b = abs(b);
double code(double a, double b, double angle) {
double tmp;
if (angle <= 2.2e+129) {
tmp = (b + a) * ((angle * 0.011111111111111112) * ((b - a) * ((double) M_PI)));
} else {
tmp = 0.011111111111111112 * fabs((angle * ((b - a) * ((b + a) * ((double) M_PI)))));
}
return tmp;
}
b = Math.abs(b);
public static double code(double a, double b, double angle) {
double tmp;
if (angle <= 2.2e+129) {
tmp = (b + a) * ((angle * 0.011111111111111112) * ((b - a) * Math.PI));
} else {
tmp = 0.011111111111111112 * Math.abs((angle * ((b - a) * ((b + a) * Math.PI))));
}
return tmp;
}
b = abs(b) def code(a, b, angle): tmp = 0 if angle <= 2.2e+129: tmp = (b + a) * ((angle * 0.011111111111111112) * ((b - a) * math.pi)) else: tmp = 0.011111111111111112 * math.fabs((angle * ((b - a) * ((b + a) * math.pi)))) return tmp
b = abs(b) function code(a, b, angle) tmp = 0.0 if (angle <= 2.2e+129) tmp = Float64(Float64(b + a) * Float64(Float64(angle * 0.011111111111111112) * Float64(Float64(b - a) * pi))); else tmp = Float64(0.011111111111111112 * abs(Float64(angle * Float64(Float64(b - a) * Float64(Float64(b + a) * pi))))); end return tmp end
b = abs(b) function tmp_2 = code(a, b, angle) tmp = 0.0; if (angle <= 2.2e+129) tmp = (b + a) * ((angle * 0.011111111111111112) * ((b - a) * pi)); else tmp = 0.011111111111111112 * abs((angle * ((b - a) * ((b + a) * pi)))); end tmp_2 = tmp; end
NOTE: b should be positive before calling this function code[a_, b_, angle_] := If[LessEqual[angle, 2.2e+129], N[(N[(b + a), $MachinePrecision] * N[(N[(angle * 0.011111111111111112), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[Abs[N[(angle * N[(N[(b - a), $MachinePrecision] * N[(N[(b + a), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
b = |b|\\
\\
\begin{array}{l}
\mathbf{if}\;angle \leq 2.2 \cdot 10^{+129}:\\
\;\;\;\;\left(b + a\right) \cdot \left(\left(angle \cdot 0.011111111111111112\right) \cdot \left(\left(b - a\right) \cdot \pi\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left|angle \cdot \left(\left(b - a\right) \cdot \left(\left(b + a\right) \cdot \pi\right)\right)\right|\\
\end{array}
\end{array}
if angle < 2.1999999999999999e129Initial program 62.5%
*-commutative62.5%
associate-*l*62.5%
associate-*l*62.5%
unpow262.5%
unpow262.5%
difference-of-squares68.2%
Simplified68.2%
associate-*l*75.9%
flip-+62.5%
associate-*l/60.3%
associate-*l*60.3%
2-sin60.3%
div-inv59.9%
metadata-eval59.9%
Applied egg-rr59.9%
associate-/l*61.9%
associate-/r/62.0%
difference-of-squares67.3%
associate-/l*74.9%
*-inverses74.9%
+-commutative74.9%
*-commutative74.9%
Simplified74.9%
Taylor expanded in angle around 0 75.2%
*-commutative75.2%
associate-*r*75.2%
Simplified75.2%
Taylor expanded in angle around 0 75.7%
associate-*r*75.7%
Simplified75.7%
if 2.1999999999999999e129 < angle Initial program 33.3%
*-commutative33.3%
associate-*l*33.3%
associate-*l*33.3%
unpow233.3%
unpow233.3%
difference-of-squares35.8%
Simplified35.8%
Taylor expanded in angle around 0 16.6%
add-sqr-sqrt13.0%
sqrt-unprod29.5%
pow229.5%
+-commutative29.5%
difference-of-squares24.5%
Applied egg-rr24.5%
unpow224.5%
rem-sqrt-square24.6%
difference-of-squares29.6%
+-commutative29.6%
associate-*r*29.6%
+-commutative29.6%
Simplified29.6%
Final simplification68.5%
NOTE: b should be positive before calling this function (FPCore (a b angle) :precision binary64 (if (<= angle 2.2e+129) (* (+ b a) (* (* angle 0.011111111111111112) (* (- b a) PI))) (* 0.011111111111111112 (* angle (fabs (* (- b a) (* (+ b a) PI)))))))
b = abs(b);
double code(double a, double b, double angle) {
double tmp;
if (angle <= 2.2e+129) {
tmp = (b + a) * ((angle * 0.011111111111111112) * ((b - a) * ((double) M_PI)));
} else {
tmp = 0.011111111111111112 * (angle * fabs(((b - a) * ((b + a) * ((double) M_PI)))));
}
return tmp;
}
b = Math.abs(b);
public static double code(double a, double b, double angle) {
double tmp;
if (angle <= 2.2e+129) {
tmp = (b + a) * ((angle * 0.011111111111111112) * ((b - a) * Math.PI));
} else {
tmp = 0.011111111111111112 * (angle * Math.abs(((b - a) * ((b + a) * Math.PI))));
}
return tmp;
}
b = abs(b) def code(a, b, angle): tmp = 0 if angle <= 2.2e+129: tmp = (b + a) * ((angle * 0.011111111111111112) * ((b - a) * math.pi)) else: tmp = 0.011111111111111112 * (angle * math.fabs(((b - a) * ((b + a) * math.pi)))) return tmp
b = abs(b) function code(a, b, angle) tmp = 0.0 if (angle <= 2.2e+129) tmp = Float64(Float64(b + a) * Float64(Float64(angle * 0.011111111111111112) * Float64(Float64(b - a) * pi))); else tmp = Float64(0.011111111111111112 * Float64(angle * abs(Float64(Float64(b - a) * Float64(Float64(b + a) * pi))))); end return tmp end
b = abs(b) function tmp_2 = code(a, b, angle) tmp = 0.0; if (angle <= 2.2e+129) tmp = (b + a) * ((angle * 0.011111111111111112) * ((b - a) * pi)); else tmp = 0.011111111111111112 * (angle * abs(((b - a) * ((b + a) * pi)))); end tmp_2 = tmp; end
NOTE: b should be positive before calling this function code[a_, b_, angle_] := If[LessEqual[angle, 2.2e+129], N[(N[(b + a), $MachinePrecision] * N[(N[(angle * 0.011111111111111112), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(angle * N[Abs[N[(N[(b - a), $MachinePrecision] * N[(N[(b + a), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
b = |b|\\
\\
\begin{array}{l}
\mathbf{if}\;angle \leq 2.2 \cdot 10^{+129}:\\
\;\;\;\;\left(b + a\right) \cdot \left(\left(angle \cdot 0.011111111111111112\right) \cdot \left(\left(b - a\right) \cdot \pi\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle \cdot \left|\left(b - a\right) \cdot \left(\left(b + a\right) \cdot \pi\right)\right|\right)\\
\end{array}
\end{array}
if angle < 2.1999999999999999e129Initial program 62.5%
*-commutative62.5%
associate-*l*62.5%
associate-*l*62.5%
unpow262.5%
unpow262.5%
difference-of-squares68.2%
Simplified68.2%
associate-*l*75.9%
flip-+62.5%
associate-*l/60.3%
associate-*l*60.3%
2-sin60.3%
div-inv59.9%
metadata-eval59.9%
Applied egg-rr59.9%
associate-/l*61.9%
associate-/r/62.0%
difference-of-squares67.3%
associate-/l*74.9%
*-inverses74.9%
+-commutative74.9%
*-commutative74.9%
Simplified74.9%
Taylor expanded in angle around 0 75.2%
*-commutative75.2%
associate-*r*75.2%
Simplified75.2%
Taylor expanded in angle around 0 75.7%
associate-*r*75.7%
Simplified75.7%
if 2.1999999999999999e129 < angle Initial program 33.3%
*-commutative33.3%
associate-*l*33.3%
associate-*l*33.3%
unpow233.3%
unpow233.3%
difference-of-squares35.8%
Simplified35.8%
Taylor expanded in angle around 0 16.6%
add-sqr-sqrt13.0%
sqrt-unprod31.9%
pow231.9%
+-commutative31.9%
difference-of-squares26.9%
Applied egg-rr26.9%
unpow226.9%
rem-sqrt-square24.6%
difference-of-squares29.6%
+-commutative29.6%
associate-*r*29.6%
+-commutative29.6%
Simplified29.6%
Final simplification68.5%
NOTE: b should be positive before calling this function (FPCore (a b angle) :precision binary64 (if (<= angle 3e+113) (* (+ b a) (* (* angle 0.011111111111111112) (* (- b a) PI))) (* (+ b a) (* b (sin (* (* PI angle) 0.011111111111111112))))))
b = abs(b);
double code(double a, double b, double angle) {
double tmp;
if (angle <= 3e+113) {
tmp = (b + a) * ((angle * 0.011111111111111112) * ((b - a) * ((double) M_PI)));
} else {
tmp = (b + a) * (b * sin(((((double) M_PI) * angle) * 0.011111111111111112)));
}
return tmp;
}
b = Math.abs(b);
public static double code(double a, double b, double angle) {
double tmp;
if (angle <= 3e+113) {
tmp = (b + a) * ((angle * 0.011111111111111112) * ((b - a) * Math.PI));
} else {
tmp = (b + a) * (b * Math.sin(((Math.PI * angle) * 0.011111111111111112)));
}
return tmp;
}
b = abs(b) def code(a, b, angle): tmp = 0 if angle <= 3e+113: tmp = (b + a) * ((angle * 0.011111111111111112) * ((b - a) * math.pi)) else: tmp = (b + a) * (b * math.sin(((math.pi * angle) * 0.011111111111111112))) return tmp
b = abs(b) function code(a, b, angle) tmp = 0.0 if (angle <= 3e+113) tmp = Float64(Float64(b + a) * Float64(Float64(angle * 0.011111111111111112) * Float64(Float64(b - a) * pi))); else tmp = Float64(Float64(b + a) * Float64(b * sin(Float64(Float64(pi * angle) * 0.011111111111111112)))); end return tmp end
b = abs(b) function tmp_2 = code(a, b, angle) tmp = 0.0; if (angle <= 3e+113) tmp = (b + a) * ((angle * 0.011111111111111112) * ((b - a) * pi)); else tmp = (b + a) * (b * sin(((pi * angle) * 0.011111111111111112))); end tmp_2 = tmp; end
NOTE: b should be positive before calling this function code[a_, b_, angle_] := If[LessEqual[angle, 3e+113], N[(N[(b + a), $MachinePrecision] * N[(N[(angle * 0.011111111111111112), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b + a), $MachinePrecision] * N[(b * N[Sin[N[(N[(Pi * angle), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
b = |b|\\
\\
\begin{array}{l}
\mathbf{if}\;angle \leq 3 \cdot 10^{+113}:\\
\;\;\;\;\left(b + a\right) \cdot \left(\left(angle \cdot 0.011111111111111112\right) \cdot \left(\left(b - a\right) \cdot \pi\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(b + a\right) \cdot \left(b \cdot \sin \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right)\right)\\
\end{array}
\end{array}
if angle < 3e113Initial program 62.9%
*-commutative62.9%
associate-*l*62.9%
associate-*l*62.9%
unpow262.9%
unpow262.9%
difference-of-squares68.7%
Simplified68.7%
associate-*l*76.5%
flip-+63.0%
associate-*l/60.8%
associate-*l*60.8%
2-sin60.8%
div-inv60.4%
metadata-eval60.4%
Applied egg-rr60.4%
associate-/l*62.4%
associate-/r/62.5%
difference-of-squares67.8%
associate-/l*75.5%
*-inverses75.5%
+-commutative75.5%
*-commutative75.5%
Simplified75.5%
Taylor expanded in angle around 0 75.8%
*-commutative75.8%
associate-*r*75.8%
Simplified75.8%
Taylor expanded in angle around 0 76.3%
associate-*r*76.3%
Simplified76.3%
if 3e113 < angle Initial program 32.2%
*-commutative32.2%
associate-*l*32.2%
associate-*l*32.2%
unpow232.2%
unpow232.2%
difference-of-squares34.6%
Simplified34.6%
associate-*l*34.6%
flip-+32.2%
associate-*l/31.5%
associate-*l*31.5%
2-sin31.5%
div-inv29.5%
metadata-eval29.5%
Applied egg-rr29.5%
associate-/l*30.0%
associate-/r/30.0%
difference-of-squares32.4%
associate-/l*32.4%
*-inverses32.4%
+-commutative32.4%
*-commutative32.4%
Simplified32.4%
Taylor expanded in angle around 0 33.9%
*-commutative33.9%
associate-*r*33.0%
Simplified33.0%
Taylor expanded in b around inf 31.5%
Final simplification69.0%
NOTE: b should be positive before calling this function (FPCore (a b angle) :precision binary64 (if (<= angle 3e+113) (* (+ b a) (* (* angle 0.011111111111111112) (* (- b a) PI))) (* (+ b a) (* b (sin (* PI (* angle 0.011111111111111112)))))))
b = abs(b);
double code(double a, double b, double angle) {
double tmp;
if (angle <= 3e+113) {
tmp = (b + a) * ((angle * 0.011111111111111112) * ((b - a) * ((double) M_PI)));
} else {
tmp = (b + a) * (b * sin((((double) M_PI) * (angle * 0.011111111111111112))));
}
return tmp;
}
b = Math.abs(b);
public static double code(double a, double b, double angle) {
double tmp;
if (angle <= 3e+113) {
tmp = (b + a) * ((angle * 0.011111111111111112) * ((b - a) * Math.PI));
} else {
tmp = (b + a) * (b * Math.sin((Math.PI * (angle * 0.011111111111111112))));
}
return tmp;
}
b = abs(b) def code(a, b, angle): tmp = 0 if angle <= 3e+113: tmp = (b + a) * ((angle * 0.011111111111111112) * ((b - a) * math.pi)) else: tmp = (b + a) * (b * math.sin((math.pi * (angle * 0.011111111111111112)))) return tmp
b = abs(b) function code(a, b, angle) tmp = 0.0 if (angle <= 3e+113) tmp = Float64(Float64(b + a) * Float64(Float64(angle * 0.011111111111111112) * Float64(Float64(b - a) * pi))); else tmp = Float64(Float64(b + a) * Float64(b * sin(Float64(pi * Float64(angle * 0.011111111111111112))))); end return tmp end
b = abs(b) function tmp_2 = code(a, b, angle) tmp = 0.0; if (angle <= 3e+113) tmp = (b + a) * ((angle * 0.011111111111111112) * ((b - a) * pi)); else tmp = (b + a) * (b * sin((pi * (angle * 0.011111111111111112)))); end tmp_2 = tmp; end
NOTE: b should be positive before calling this function code[a_, b_, angle_] := If[LessEqual[angle, 3e+113], N[(N[(b + a), $MachinePrecision] * N[(N[(angle * 0.011111111111111112), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b + a), $MachinePrecision] * N[(b * N[Sin[N[(Pi * N[(angle * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
b = |b|\\
\\
\begin{array}{l}
\mathbf{if}\;angle \leq 3 \cdot 10^{+113}:\\
\;\;\;\;\left(b + a\right) \cdot \left(\left(angle \cdot 0.011111111111111112\right) \cdot \left(\left(b - a\right) \cdot \pi\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(b + a\right) \cdot \left(b \cdot \sin \left(\pi \cdot \left(angle \cdot 0.011111111111111112\right)\right)\right)\\
\end{array}
\end{array}
if angle < 3e113Initial program 62.9%
*-commutative62.9%
associate-*l*62.9%
associate-*l*62.9%
unpow262.9%
unpow262.9%
difference-of-squares68.7%
Simplified68.7%
associate-*l*76.5%
flip-+63.0%
associate-*l/60.8%
associate-*l*60.8%
2-sin60.8%
div-inv60.4%
metadata-eval60.4%
Applied egg-rr60.4%
associate-/l*62.4%
associate-/r/62.5%
difference-of-squares67.8%
associate-/l*75.5%
*-inverses75.5%
+-commutative75.5%
*-commutative75.5%
Simplified75.5%
Taylor expanded in angle around 0 75.8%
*-commutative75.8%
associate-*r*75.8%
Simplified75.8%
Taylor expanded in angle around 0 76.3%
associate-*r*76.3%
Simplified76.3%
if 3e113 < angle Initial program 32.2%
*-commutative32.2%
associate-*l*32.2%
associate-*l*32.2%
unpow232.2%
unpow232.2%
difference-of-squares34.6%
Simplified34.6%
associate-*l*34.6%
flip-+32.2%
associate-*l/31.5%
associate-*l*31.5%
2-sin31.5%
div-inv29.5%
metadata-eval29.5%
Applied egg-rr29.5%
associate-/l*30.0%
associate-/r/30.0%
difference-of-squares32.4%
associate-/l*32.4%
*-inverses32.4%
+-commutative32.4%
*-commutative32.4%
Simplified32.4%
Taylor expanded in angle around 0 33.9%
*-commutative33.9%
associate-*r*33.0%
Simplified33.0%
Taylor expanded in b around inf 31.5%
*-commutative31.5%
metadata-eval31.5%
associate-*r*31.5%
associate-*r*31.3%
*-commutative31.3%
*-commutative31.3%
associate-*r*31.5%
associate-*r*31.5%
metadata-eval31.5%
associate-*r*31.3%
Simplified31.3%
Final simplification68.9%
NOTE: b should be positive before calling this function (FPCore (a b angle) :precision binary64 (if (<= angle 3e+113) (* (+ b a) (* 0.011111111111111112 (* PI (* (- b a) angle)))) (* 0.011111111111111112 (* angle (* PI (* b b))))))
b = abs(b);
double code(double a, double b, double angle) {
double tmp;
if (angle <= 3e+113) {
tmp = (b + a) * (0.011111111111111112 * (((double) M_PI) * ((b - a) * angle)));
} else {
tmp = 0.011111111111111112 * (angle * (((double) M_PI) * (b * b)));
}
return tmp;
}
b = Math.abs(b);
public static double code(double a, double b, double angle) {
double tmp;
if (angle <= 3e+113) {
tmp = (b + a) * (0.011111111111111112 * (Math.PI * ((b - a) * angle)));
} else {
tmp = 0.011111111111111112 * (angle * (Math.PI * (b * b)));
}
return tmp;
}
b = abs(b) def code(a, b, angle): tmp = 0 if angle <= 3e+113: tmp = (b + a) * (0.011111111111111112 * (math.pi * ((b - a) * angle))) else: tmp = 0.011111111111111112 * (angle * (math.pi * (b * b))) return tmp
b = abs(b) function code(a, b, angle) tmp = 0.0 if (angle <= 3e+113) tmp = Float64(Float64(b + a) * Float64(0.011111111111111112 * Float64(pi * Float64(Float64(b - a) * angle)))); else tmp = Float64(0.011111111111111112 * Float64(angle * Float64(pi * Float64(b * b)))); end return tmp end
b = abs(b) function tmp_2 = code(a, b, angle) tmp = 0.0; if (angle <= 3e+113) tmp = (b + a) * (0.011111111111111112 * (pi * ((b - a) * angle))); else tmp = 0.011111111111111112 * (angle * (pi * (b * b))); end tmp_2 = tmp; end
NOTE: b should be positive before calling this function code[a_, b_, angle_] := If[LessEqual[angle, 3e+113], N[(N[(b + a), $MachinePrecision] * N[(0.011111111111111112 * N[(Pi * N[(N[(b - a), $MachinePrecision] * angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(angle * N[(Pi * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
b = |b|\\
\\
\begin{array}{l}
\mathbf{if}\;angle \leq 3 \cdot 10^{+113}:\\
\;\;\;\;\left(b + a\right) \cdot \left(0.011111111111111112 \cdot \left(\pi \cdot \left(\left(b - a\right) \cdot angle\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(b \cdot b\right)\right)\right)\\
\end{array}
\end{array}
if angle < 3e113Initial program 62.9%
*-commutative62.9%
associate-*l*62.9%
associate-*l*62.9%
unpow262.9%
unpow262.9%
difference-of-squares68.7%
Simplified68.7%
associate-*l*76.5%
flip-+63.0%
associate-*l/60.8%
associate-*l*60.8%
2-sin60.8%
div-inv60.4%
metadata-eval60.4%
Applied egg-rr60.4%
associate-/l*62.4%
associate-/r/62.5%
difference-of-squares67.8%
associate-/l*75.5%
*-inverses75.5%
+-commutative75.5%
*-commutative75.5%
Simplified75.5%
Taylor expanded in angle around 0 75.8%
*-commutative75.8%
associate-*r*75.8%
Simplified75.8%
Taylor expanded in angle around 0 76.3%
*-commutative76.3%
associate-*l*76.3%
Simplified76.3%
if 3e113 < angle Initial program 32.2%
*-commutative32.2%
associate-*l*32.2%
associate-*l*32.2%
unpow232.2%
unpow232.2%
difference-of-squares34.6%
Simplified34.6%
Taylor expanded in angle around 0 16.1%
Taylor expanded in a around 0 23.8%
*-commutative23.8%
unpow223.8%
Simplified23.8%
Final simplification67.7%
NOTE: b should be positive before calling this function (FPCore (a b angle) :precision binary64 (if (<= angle 3e+113) (* (+ b a) (* (* angle 0.011111111111111112) (* (- b a) PI))) (* 0.011111111111111112 (* angle (* PI (* b b))))))
b = abs(b);
double code(double a, double b, double angle) {
double tmp;
if (angle <= 3e+113) {
tmp = (b + a) * ((angle * 0.011111111111111112) * ((b - a) * ((double) M_PI)));
} else {
tmp = 0.011111111111111112 * (angle * (((double) M_PI) * (b * b)));
}
return tmp;
}
b = Math.abs(b);
public static double code(double a, double b, double angle) {
double tmp;
if (angle <= 3e+113) {
tmp = (b + a) * ((angle * 0.011111111111111112) * ((b - a) * Math.PI));
} else {
tmp = 0.011111111111111112 * (angle * (Math.PI * (b * b)));
}
return tmp;
}
b = abs(b) def code(a, b, angle): tmp = 0 if angle <= 3e+113: tmp = (b + a) * ((angle * 0.011111111111111112) * ((b - a) * math.pi)) else: tmp = 0.011111111111111112 * (angle * (math.pi * (b * b))) return tmp
b = abs(b) function code(a, b, angle) tmp = 0.0 if (angle <= 3e+113) tmp = Float64(Float64(b + a) * Float64(Float64(angle * 0.011111111111111112) * Float64(Float64(b - a) * pi))); else tmp = Float64(0.011111111111111112 * Float64(angle * Float64(pi * Float64(b * b)))); end return tmp end
b = abs(b) function tmp_2 = code(a, b, angle) tmp = 0.0; if (angle <= 3e+113) tmp = (b + a) * ((angle * 0.011111111111111112) * ((b - a) * pi)); else tmp = 0.011111111111111112 * (angle * (pi * (b * b))); end tmp_2 = tmp; end
NOTE: b should be positive before calling this function code[a_, b_, angle_] := If[LessEqual[angle, 3e+113], N[(N[(b + a), $MachinePrecision] * N[(N[(angle * 0.011111111111111112), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(angle * N[(Pi * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
b = |b|\\
\\
\begin{array}{l}
\mathbf{if}\;angle \leq 3 \cdot 10^{+113}:\\
\;\;\;\;\left(b + a\right) \cdot \left(\left(angle \cdot 0.011111111111111112\right) \cdot \left(\left(b - a\right) \cdot \pi\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(b \cdot b\right)\right)\right)\\
\end{array}
\end{array}
if angle < 3e113Initial program 62.9%
*-commutative62.9%
associate-*l*62.9%
associate-*l*62.9%
unpow262.9%
unpow262.9%
difference-of-squares68.7%
Simplified68.7%
associate-*l*76.5%
flip-+63.0%
associate-*l/60.8%
associate-*l*60.8%
2-sin60.8%
div-inv60.4%
metadata-eval60.4%
Applied egg-rr60.4%
associate-/l*62.4%
associate-/r/62.5%
difference-of-squares67.8%
associate-/l*75.5%
*-inverses75.5%
+-commutative75.5%
*-commutative75.5%
Simplified75.5%
Taylor expanded in angle around 0 75.8%
*-commutative75.8%
associate-*r*75.8%
Simplified75.8%
Taylor expanded in angle around 0 76.3%
associate-*r*76.3%
Simplified76.3%
if 3e113 < angle Initial program 32.2%
*-commutative32.2%
associate-*l*32.2%
associate-*l*32.2%
unpow232.2%
unpow232.2%
difference-of-squares34.6%
Simplified34.6%
Taylor expanded in angle around 0 16.1%
Taylor expanded in a around 0 23.8%
*-commutative23.8%
unpow223.8%
Simplified23.8%
Final simplification67.7%
NOTE: b should be positive before calling this function (FPCore (a b angle) :precision binary64 (* 0.011111111111111112 (* angle (* PI (* (+ b a) (- b a))))))
b = abs(b);
double code(double a, double b, double angle) {
return 0.011111111111111112 * (angle * (((double) M_PI) * ((b + a) * (b - a))));
}
b = Math.abs(b);
public static double code(double a, double b, double angle) {
return 0.011111111111111112 * (angle * (Math.PI * ((b + a) * (b - a))));
}
b = abs(b) def code(a, b, angle): return 0.011111111111111112 * (angle * (math.pi * ((b + a) * (b - a))))
b = abs(b) function code(a, b, angle) return Float64(0.011111111111111112 * Float64(angle * Float64(pi * Float64(Float64(b + a) * Float64(b - a))))) end
b = abs(b) function tmp = code(a, b, angle) tmp = 0.011111111111111112 * (angle * (pi * ((b + a) * (b - a)))); end
NOTE: b should be positive before calling this function code[a_, b_, angle_] := N[(0.011111111111111112 * N[(angle * N[(Pi * N[(N[(b + a), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
b = |b|\\
\\
0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)\right)
\end{array}
Initial program 57.9%
*-commutative57.9%
associate-*l*57.9%
associate-*l*57.9%
unpow257.9%
unpow257.9%
difference-of-squares63.1%
Simplified63.1%
Taylor expanded in angle around 0 60.3%
Final simplification60.3%
NOTE: b should be positive before calling this function (FPCore (a b angle) :precision binary64 (if (<= b 5.2e+61) (* (* PI angle) (* (* a a) -0.011111111111111112)) (* 0.011111111111111112 (* angle (* PI (* b b))))))
b = abs(b);
double code(double a, double b, double angle) {
double tmp;
if (b <= 5.2e+61) {
tmp = (((double) M_PI) * angle) * ((a * a) * -0.011111111111111112);
} else {
tmp = 0.011111111111111112 * (angle * (((double) M_PI) * (b * b)));
}
return tmp;
}
b = Math.abs(b);
public static double code(double a, double b, double angle) {
double tmp;
if (b <= 5.2e+61) {
tmp = (Math.PI * angle) * ((a * a) * -0.011111111111111112);
} else {
tmp = 0.011111111111111112 * (angle * (Math.PI * (b * b)));
}
return tmp;
}
b = abs(b) def code(a, b, angle): tmp = 0 if b <= 5.2e+61: tmp = (math.pi * angle) * ((a * a) * -0.011111111111111112) else: tmp = 0.011111111111111112 * (angle * (math.pi * (b * b))) return tmp
b = abs(b) function code(a, b, angle) tmp = 0.0 if (b <= 5.2e+61) tmp = Float64(Float64(pi * angle) * Float64(Float64(a * a) * -0.011111111111111112)); else tmp = Float64(0.011111111111111112 * Float64(angle * Float64(pi * Float64(b * b)))); end return tmp end
b = abs(b) function tmp_2 = code(a, b, angle) tmp = 0.0; if (b <= 5.2e+61) tmp = (pi * angle) * ((a * a) * -0.011111111111111112); else tmp = 0.011111111111111112 * (angle * (pi * (b * b))); end tmp_2 = tmp; end
NOTE: b should be positive before calling this function code[a_, b_, angle_] := If[LessEqual[b, 5.2e+61], N[(N[(Pi * angle), $MachinePrecision] * N[(N[(a * a), $MachinePrecision] * -0.011111111111111112), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(angle * N[(Pi * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
b = |b|\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq 5.2 \cdot 10^{+61}:\\
\;\;\;\;\left(\pi \cdot angle\right) \cdot \left(\left(a \cdot a\right) \cdot -0.011111111111111112\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(b \cdot b\right)\right)\right)\\
\end{array}
\end{array}
if b < 5.19999999999999945e61Initial program 59.3%
*-commutative59.3%
associate-*l*59.3%
associate-*l*59.3%
unpow259.3%
unpow259.3%
difference-of-squares62.2%
Simplified62.2%
Taylor expanded in angle around 0 59.3%
Taylor expanded in a around inf 43.7%
*-commutative43.7%
*-commutative43.7%
associate-*l*43.7%
unpow243.7%
Simplified43.7%
if 5.19999999999999945e61 < b Initial program 51.3%
*-commutative51.3%
associate-*l*51.3%
associate-*l*51.3%
unpow251.3%
unpow251.3%
difference-of-squares67.8%
Simplified67.8%
Taylor expanded in angle around 0 65.1%
Taylor expanded in a around 0 55.3%
*-commutative55.3%
unpow255.3%
Simplified55.3%
Final simplification45.7%
NOTE: b should be positive before calling this function (FPCore (a b angle) :precision binary64 (* 0.011111111111111112 (* angle (* PI (* b b)))))
b = abs(b);
double code(double a, double b, double angle) {
return 0.011111111111111112 * (angle * (((double) M_PI) * (b * b)));
}
b = Math.abs(b);
public static double code(double a, double b, double angle) {
return 0.011111111111111112 * (angle * (Math.PI * (b * b)));
}
b = abs(b) def code(a, b, angle): return 0.011111111111111112 * (angle * (math.pi * (b * b)))
b = abs(b) function code(a, b, angle) return Float64(0.011111111111111112 * Float64(angle * Float64(pi * Float64(b * b)))) end
b = abs(b) function tmp = code(a, b, angle) tmp = 0.011111111111111112 * (angle * (pi * (b * b))); end
NOTE: b should be positive before calling this function code[a_, b_, angle_] := N[(0.011111111111111112 * N[(angle * N[(Pi * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
b = |b|\\
\\
0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(b \cdot b\right)\right)\right)
\end{array}
Initial program 57.9%
*-commutative57.9%
associate-*l*57.9%
associate-*l*57.9%
unpow257.9%
unpow257.9%
difference-of-squares63.1%
Simplified63.1%
Taylor expanded in angle around 0 60.3%
Taylor expanded in a around 0 40.5%
*-commutative40.5%
unpow240.5%
Simplified40.5%
Final simplification40.5%
herbie shell --seed 2023279
(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)))))