
(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}
NOTE: a should be positive before calling this function
NOTE: b should be positive before calling this function
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (* PI (* angle 0.005555555555555556)))
(t_1 (* 0.005555555555555556 (* angle PI)))
(t_2 (* (- b a) (cos t_0))))
(if (<= (/ angle 180.0) -2e+22)
(* 2.0 (* t_2 (* (sin (pow (pow (cbrt t_0) 2.0) 1.5)) (+ b a))))
(if (<= (/ angle 180.0) 1e+175)
(* 2.0 (* t_2 (* (+ b a) (sin t_1))))
(*
2.0
(*
(- b a)
(*
(cos t_1)
(*
(+ b a)
(sin (* 0.005555555555555556 (expm1 (log1p (* angle PI)))))))))))))a = abs(a);
b = abs(b);
double code(double a, double b, double angle) {
double t_0 = ((double) M_PI) * (angle * 0.005555555555555556);
double t_1 = 0.005555555555555556 * (angle * ((double) M_PI));
double t_2 = (b - a) * cos(t_0);
double tmp;
if ((angle / 180.0) <= -2e+22) {
tmp = 2.0 * (t_2 * (sin(pow(pow(cbrt(t_0), 2.0), 1.5)) * (b + a)));
} else if ((angle / 180.0) <= 1e+175) {
tmp = 2.0 * (t_2 * ((b + a) * sin(t_1)));
} else {
tmp = 2.0 * ((b - a) * (cos(t_1) * ((b + a) * sin((0.005555555555555556 * expm1(log1p((angle * ((double) M_PI)))))))));
}
return tmp;
}
a = Math.abs(a);
b = Math.abs(b);
public static double code(double a, double b, double angle) {
double t_0 = Math.PI * (angle * 0.005555555555555556);
double t_1 = 0.005555555555555556 * (angle * Math.PI);
double t_2 = (b - a) * Math.cos(t_0);
double tmp;
if ((angle / 180.0) <= -2e+22) {
tmp = 2.0 * (t_2 * (Math.sin(Math.pow(Math.pow(Math.cbrt(t_0), 2.0), 1.5)) * (b + a)));
} else if ((angle / 180.0) <= 1e+175) {
tmp = 2.0 * (t_2 * ((b + a) * Math.sin(t_1)));
} else {
tmp = 2.0 * ((b - a) * (Math.cos(t_1) * ((b + a) * Math.sin((0.005555555555555556 * Math.expm1(Math.log1p((angle * Math.PI))))))));
}
return tmp;
}
a = abs(a) b = abs(b) function code(a, b, angle) t_0 = Float64(pi * Float64(angle * 0.005555555555555556)) t_1 = Float64(0.005555555555555556 * Float64(angle * pi)) t_2 = Float64(Float64(b - a) * cos(t_0)) tmp = 0.0 if (Float64(angle / 180.0) <= -2e+22) tmp = Float64(2.0 * Float64(t_2 * Float64(sin(((cbrt(t_0) ^ 2.0) ^ 1.5)) * Float64(b + a)))); elseif (Float64(angle / 180.0) <= 1e+175) tmp = Float64(2.0 * Float64(t_2 * Float64(Float64(b + a) * sin(t_1)))); else tmp = Float64(2.0 * Float64(Float64(b - a) * Float64(cos(t_1) * Float64(Float64(b + a) * sin(Float64(0.005555555555555556 * expm1(log1p(Float64(angle * pi))))))))); end return tmp end
NOTE: a should be positive before calling this function
NOTE: b should be positive before calling this function
code[a_, b_, angle_] := Block[{t$95$0 = N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(b - a), $MachinePrecision] * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(angle / 180.0), $MachinePrecision], -2e+22], N[(2.0 * N[(t$95$2 * N[(N[Sin[N[Power[N[Power[N[Power[t$95$0, 1/3], $MachinePrecision], 2.0], $MachinePrecision], 1.5], $MachinePrecision]], $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle / 180.0), $MachinePrecision], 1e+175], N[(2.0 * N[(t$95$2 * N[(N[(b + a), $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(b - a), $MachinePrecision] * N[(N[Cos[t$95$1], $MachinePrecision] * N[(N[(b + a), $MachinePrecision] * N[Sin[N[(0.005555555555555556 * N[(Exp[N[Log[1 + N[(angle * Pi), $MachinePrecision]], $MachinePrecision]] - 1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
a = |a|\\
b = |b|\\
\\
\begin{array}{l}
t_0 := \pi \cdot \left(angle \cdot 0.005555555555555556\right)\\
t_1 := 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\\
t_2 := \left(b - a\right) \cdot \cos t_0\\
\mathbf{if}\;\frac{angle}{180} \leq -2 \cdot 10^{+22}:\\
\;\;\;\;2 \cdot \left(t_2 \cdot \left(\sin \left({\left({\left(\sqrt[3]{t_0}\right)}^{2}\right)}^{1.5}\right) \cdot \left(b + a\right)\right)\right)\\
\mathbf{elif}\;\frac{angle}{180} \leq 10^{+175}:\\
\;\;\;\;2 \cdot \left(t_2 \cdot \left(\left(b + a\right) \cdot \sin t_1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(b - a\right) \cdot \left(\cos t_1 \cdot \left(\left(b + a\right) \cdot \sin \left(0.005555555555555556 \cdot \mathsf{expm1}\left(\mathsf{log1p}\left(angle \cdot \pi\right)\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle 180) < -2e22Initial program 25.3%
associate-*l*25.3%
unpow225.3%
unpow225.3%
difference-of-squares25.3%
Simplified25.3%
Taylor expanded in angle around inf 26.5%
associate-*r*26.5%
*-commutative26.5%
*-commutative26.5%
associate-*r*23.2%
*-commutative23.2%
*-commutative23.2%
*-commutative23.2%
associate-*r*26.0%
*-commutative26.0%
+-commutative26.0%
Simplified26.0%
Taylor expanded in angle around inf 23.2%
associate-*r*26.0%
*-commutative26.0%
rem-cube-cbrt21.6%
sqr-pow0.0%
pow-prod-down36.6%
pow236.6%
*-commutative36.6%
associate-*r*33.9%
metadata-eval33.9%
Applied egg-rr33.9%
associate-*r*36.6%
*-commutative36.6%
Simplified36.6%
if -2e22 < (/.f64 angle 180) < 9.9999999999999994e174Initial program 65.1%
associate-*l*65.1%
unpow265.1%
unpow265.1%
difference-of-squares68.1%
Simplified68.1%
Taylor expanded in angle around inf 89.1%
associate-*r*89.1%
*-commutative89.1%
*-commutative89.1%
associate-*r*91.2%
*-commutative91.2%
*-commutative91.2%
*-commutative91.2%
associate-*r*89.5%
*-commutative89.5%
+-commutative89.5%
Simplified89.5%
Taylor expanded in angle around inf 91.2%
if 9.9999999999999994e174 < (/.f64 angle 180) Initial program 27.8%
associate-*l*27.8%
unpow227.8%
unpow227.8%
difference-of-squares31.7%
Simplified31.7%
Taylor expanded in angle around inf 25.7%
expm1-log1p-u52.1%
*-commutative52.1%
Applied egg-rr52.1%
Final simplification73.6%
NOTE: a should be positive before calling this function
NOTE: b should be positive before calling this function
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (* 0.005555555555555556 (* angle PI)))
(t_1 (* PI (* angle 0.005555555555555556))))
(if (<= (/ angle 180.0) -2e+22)
(* 2.0 (* (- b a) (* (+ b a) (sin (pow (cbrt t_1) 3.0)))))
(if (<= (/ angle 180.0) 1e+175)
(* 2.0 (* (* (- b a) (cos t_1)) (* (+ b a) (sin t_0))))
(*
2.0
(*
(- b a)
(*
(cos t_0)
(*
(+ b a)
(sin (* 0.005555555555555556 (expm1 (log1p (* angle PI)))))))))))))a = abs(a);
b = abs(b);
double code(double a, double b, double angle) {
double t_0 = 0.005555555555555556 * (angle * ((double) M_PI));
double t_1 = ((double) M_PI) * (angle * 0.005555555555555556);
double tmp;
if ((angle / 180.0) <= -2e+22) {
tmp = 2.0 * ((b - a) * ((b + a) * sin(pow(cbrt(t_1), 3.0))));
} else if ((angle / 180.0) <= 1e+175) {
tmp = 2.0 * (((b - a) * cos(t_1)) * ((b + a) * sin(t_0)));
} else {
tmp = 2.0 * ((b - a) * (cos(t_0) * ((b + a) * sin((0.005555555555555556 * expm1(log1p((angle * ((double) M_PI)))))))));
}
return tmp;
}
a = Math.abs(a);
b = Math.abs(b);
public static double code(double a, double b, double angle) {
double t_0 = 0.005555555555555556 * (angle * Math.PI);
double t_1 = Math.PI * (angle * 0.005555555555555556);
double tmp;
if ((angle / 180.0) <= -2e+22) {
tmp = 2.0 * ((b - a) * ((b + a) * Math.sin(Math.pow(Math.cbrt(t_1), 3.0))));
} else if ((angle / 180.0) <= 1e+175) {
tmp = 2.0 * (((b - a) * Math.cos(t_1)) * ((b + a) * Math.sin(t_0)));
} else {
tmp = 2.0 * ((b - a) * (Math.cos(t_0) * ((b + a) * Math.sin((0.005555555555555556 * Math.expm1(Math.log1p((angle * Math.PI))))))));
}
return tmp;
}
a = abs(a) b = abs(b) function code(a, b, angle) t_0 = Float64(0.005555555555555556 * Float64(angle * pi)) t_1 = Float64(pi * Float64(angle * 0.005555555555555556)) tmp = 0.0 if (Float64(angle / 180.0) <= -2e+22) tmp = Float64(2.0 * Float64(Float64(b - a) * Float64(Float64(b + a) * sin((cbrt(t_1) ^ 3.0))))); elseif (Float64(angle / 180.0) <= 1e+175) tmp = Float64(2.0 * Float64(Float64(Float64(b - a) * cos(t_1)) * Float64(Float64(b + a) * sin(t_0)))); else tmp = Float64(2.0 * Float64(Float64(b - a) * Float64(cos(t_0) * Float64(Float64(b + a) * sin(Float64(0.005555555555555556 * expm1(log1p(Float64(angle * pi))))))))); end return tmp end
NOTE: a should be positive before calling this function
NOTE: b should be positive before calling this function
code[a_, b_, angle_] := Block[{t$95$0 = N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(angle / 180.0), $MachinePrecision], -2e+22], N[(2.0 * N[(N[(b - a), $MachinePrecision] * N[(N[(b + a), $MachinePrecision] * N[Sin[N[Power[N[Power[t$95$1, 1/3], $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle / 180.0), $MachinePrecision], 1e+175], N[(2.0 * N[(N[(N[(b - a), $MachinePrecision] * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision] * N[(N[(b + a), $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(b - a), $MachinePrecision] * N[(N[Cos[t$95$0], $MachinePrecision] * N[(N[(b + a), $MachinePrecision] * N[Sin[N[(0.005555555555555556 * N[(Exp[N[Log[1 + N[(angle * Pi), $MachinePrecision]], $MachinePrecision]] - 1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
a = |a|\\
b = |b|\\
\\
\begin{array}{l}
t_0 := 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\\
t_1 := \pi \cdot \left(angle \cdot 0.005555555555555556\right)\\
\mathbf{if}\;\frac{angle}{180} \leq -2 \cdot 10^{+22}:\\
\;\;\;\;2 \cdot \left(\left(b - a\right) \cdot \left(\left(b + a\right) \cdot \sin \left({\left(\sqrt[3]{t_1}\right)}^{3}\right)\right)\right)\\
\mathbf{elif}\;\frac{angle}{180} \leq 10^{+175}:\\
\;\;\;\;2 \cdot \left(\left(\left(b - a\right) \cdot \cos t_1\right) \cdot \left(\left(b + a\right) \cdot \sin t_0\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(b - a\right) \cdot \left(\cos t_0 \cdot \left(\left(b + a\right) \cdot \sin \left(0.005555555555555556 \cdot \mathsf{expm1}\left(\mathsf{log1p}\left(angle \cdot \pi\right)\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle 180) < -2e22Initial program 25.3%
associate-*l*25.3%
unpow225.3%
unpow225.3%
difference-of-squares25.3%
Simplified25.3%
Taylor expanded in angle around inf 26.5%
associate-*r*26.5%
*-commutative26.5%
*-commutative26.5%
associate-*r*23.2%
*-commutative23.2%
*-commutative23.2%
*-commutative23.2%
associate-*r*26.0%
*-commutative26.0%
+-commutative26.0%
Simplified26.0%
*-commutative26.0%
add-cube-cbrt20.1%
unpow321.6%
associate-*r*24.5%
*-commutative24.5%
*-commutative24.5%
associate-*r*21.6%
*-commutative21.6%
Applied egg-rr21.6%
Taylor expanded in angle around 0 36.2%
if -2e22 < (/.f64 angle 180) < 9.9999999999999994e174Initial program 65.1%
associate-*l*65.1%
unpow265.1%
unpow265.1%
difference-of-squares68.1%
Simplified68.1%
Taylor expanded in angle around inf 89.1%
associate-*r*89.1%
*-commutative89.1%
*-commutative89.1%
associate-*r*91.2%
*-commutative91.2%
*-commutative91.2%
*-commutative91.2%
associate-*r*89.5%
*-commutative89.5%
+-commutative89.5%
Simplified89.5%
Taylor expanded in angle around inf 91.2%
if 9.9999999999999994e174 < (/.f64 angle 180) Initial program 27.8%
associate-*l*27.8%
unpow227.8%
unpow227.8%
difference-of-squares31.7%
Simplified31.7%
Taylor expanded in angle around inf 25.7%
expm1-log1p-u52.1%
*-commutative52.1%
Applied egg-rr52.1%
Final simplification73.5%
NOTE: a should be positive before calling this function
NOTE: b should be positive before calling this function
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (* PI (* angle 0.005555555555555556))))
(if (<= (/ angle 180.0) -2e+22)
(* 2.0 (* (- b a) (* (+ b a) (sin (pow (cbrt t_0) 3.0)))))
(*
2.0
(*
(* (- b a) (cos t_0))
(* (+ b a) (sin (* 0.005555555555555556 (* angle PI)))))))))a = abs(a);
b = abs(b);
double code(double a, double b, double angle) {
double t_0 = ((double) M_PI) * (angle * 0.005555555555555556);
double tmp;
if ((angle / 180.0) <= -2e+22) {
tmp = 2.0 * ((b - a) * ((b + a) * sin(pow(cbrt(t_0), 3.0))));
} else {
tmp = 2.0 * (((b - a) * cos(t_0)) * ((b + a) * sin((0.005555555555555556 * (angle * ((double) M_PI))))));
}
return tmp;
}
a = Math.abs(a);
b = Math.abs(b);
public static double code(double a, double b, double angle) {
double t_0 = Math.PI * (angle * 0.005555555555555556);
double tmp;
if ((angle / 180.0) <= -2e+22) {
tmp = 2.0 * ((b - a) * ((b + a) * Math.sin(Math.pow(Math.cbrt(t_0), 3.0))));
} else {
tmp = 2.0 * (((b - a) * Math.cos(t_0)) * ((b + a) * Math.sin((0.005555555555555556 * (angle * Math.PI)))));
}
return tmp;
}
a = abs(a) b = abs(b) function code(a, b, angle) t_0 = Float64(pi * Float64(angle * 0.005555555555555556)) tmp = 0.0 if (Float64(angle / 180.0) <= -2e+22) tmp = Float64(2.0 * Float64(Float64(b - a) * Float64(Float64(b + a) * sin((cbrt(t_0) ^ 3.0))))); else tmp = Float64(2.0 * Float64(Float64(Float64(b - a) * cos(t_0)) * Float64(Float64(b + a) * sin(Float64(0.005555555555555556 * Float64(angle * pi)))))); end return tmp end
NOTE: a should be positive before calling this function
NOTE: b should be positive before calling this function
code[a_, b_, angle_] := Block[{t$95$0 = N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(angle / 180.0), $MachinePrecision], -2e+22], N[(2.0 * N[(N[(b - a), $MachinePrecision] * N[(N[(b + a), $MachinePrecision] * N[Sin[N[Power[N[Power[t$95$0, 1/3], $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[(b - a), $MachinePrecision] * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision] * N[(N[(b + a), $MachinePrecision] * N[Sin[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
a = |a|\\
b = |b|\\
\\
\begin{array}{l}
t_0 := \pi \cdot \left(angle \cdot 0.005555555555555556\right)\\
\mathbf{if}\;\frac{angle}{180} \leq -2 \cdot 10^{+22}:\\
\;\;\;\;2 \cdot \left(\left(b - a\right) \cdot \left(\left(b + a\right) \cdot \sin \left({\left(\sqrt[3]{t_0}\right)}^{3}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(\left(b - a\right) \cdot \cos t_0\right) \cdot \left(\left(b + a\right) \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle 180) < -2e22Initial program 25.3%
associate-*l*25.3%
unpow225.3%
unpow225.3%
difference-of-squares25.3%
Simplified25.3%
Taylor expanded in angle around inf 26.5%
associate-*r*26.5%
*-commutative26.5%
*-commutative26.5%
associate-*r*23.2%
*-commutative23.2%
*-commutative23.2%
*-commutative23.2%
associate-*r*26.0%
*-commutative26.0%
+-commutative26.0%
Simplified26.0%
*-commutative26.0%
add-cube-cbrt20.1%
unpow321.6%
associate-*r*24.5%
*-commutative24.5%
*-commutative24.5%
associate-*r*21.6%
*-commutative21.6%
Applied egg-rr21.6%
Taylor expanded in angle around 0 36.2%
if -2e22 < (/.f64 angle 180) Initial program 60.0%
associate-*l*60.0%
unpow260.0%
unpow260.0%
difference-of-squares63.2%
Simplified63.2%
Taylor expanded in angle around inf 80.5%
associate-*r*80.5%
*-commutative80.5%
*-commutative80.5%
associate-*r*83.8%
*-commutative83.8%
*-commutative83.8%
*-commutative83.8%
associate-*r*82.3%
*-commutative82.3%
+-commutative82.3%
Simplified82.3%
Taylor expanded in angle around inf 83.8%
Final simplification71.9%
NOTE: a should be positive before calling this function
NOTE: b should be positive before calling this function
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (* 0.005555555555555556 (* angle PI))))
(if (<= b 6.2e+173)
(* 2.0 (* (* (+ b a) (sin t_0)) (* (- b a) (cos t_0))))
(*
2.0
(*
(- b a)
(*
(+ b a)
(sin (pow (cbrt (* PI (* angle 0.005555555555555556))) 3.0))))))))a = abs(a);
b = abs(b);
double code(double a, double b, double angle) {
double t_0 = 0.005555555555555556 * (angle * ((double) M_PI));
double tmp;
if (b <= 6.2e+173) {
tmp = 2.0 * (((b + a) * sin(t_0)) * ((b - a) * cos(t_0)));
} else {
tmp = 2.0 * ((b - a) * ((b + a) * sin(pow(cbrt((((double) M_PI) * (angle * 0.005555555555555556))), 3.0))));
}
return tmp;
}
a = Math.abs(a);
b = Math.abs(b);
public static double code(double a, double b, double angle) {
double t_0 = 0.005555555555555556 * (angle * Math.PI);
double tmp;
if (b <= 6.2e+173) {
tmp = 2.0 * (((b + a) * Math.sin(t_0)) * ((b - a) * Math.cos(t_0)));
} else {
tmp = 2.0 * ((b - a) * ((b + a) * Math.sin(Math.pow(Math.cbrt((Math.PI * (angle * 0.005555555555555556))), 3.0))));
}
return tmp;
}
a = abs(a) b = abs(b) function code(a, b, angle) t_0 = Float64(0.005555555555555556 * Float64(angle * pi)) tmp = 0.0 if (b <= 6.2e+173) tmp = Float64(2.0 * Float64(Float64(Float64(b + a) * sin(t_0)) * Float64(Float64(b - a) * cos(t_0)))); else tmp = Float64(2.0 * Float64(Float64(b - a) * Float64(Float64(b + a) * sin((cbrt(Float64(pi * Float64(angle * 0.005555555555555556))) ^ 3.0))))); end return tmp end
NOTE: a should be positive before calling this function
NOTE: b should be positive before calling this function
code[a_, b_, angle_] := Block[{t$95$0 = N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, 6.2e+173], N[(2.0 * N[(N[(N[(b + a), $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(b - a), $MachinePrecision] * N[(N[(b + a), $MachinePrecision] * N[Sin[N[Power[N[Power[N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
a = |a|\\
b = |b|\\
\\
\begin{array}{l}
t_0 := 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\\
\mathbf{if}\;b \leq 6.2 \cdot 10^{+173}:\\
\;\;\;\;2 \cdot \left(\left(\left(b + a\right) \cdot \sin t_0\right) \cdot \left(\left(b - a\right) \cdot \cos t_0\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(b - a\right) \cdot \left(\left(b + a\right) \cdot \sin \left({\left(\sqrt[3]{\pi \cdot \left(angle \cdot 0.005555555555555556\right)}\right)}^{3}\right)\right)\right)\\
\end{array}
\end{array}
if b < 6.2e173Initial program 50.9%
associate-*l*50.9%
unpow250.9%
unpow250.9%
difference-of-squares52.7%
Simplified52.7%
Taylor expanded in angle around inf 66.1%
associate-*r*66.1%
*-commutative66.1%
+-commutative66.1%
Simplified66.1%
if 6.2e173 < b Initial program 56.1%
associate-*l*56.1%
unpow256.1%
unpow256.1%
difference-of-squares65.2%
Simplified65.2%
Taylor expanded in angle around inf 77.1%
associate-*r*77.1%
*-commutative77.1%
*-commutative77.1%
associate-*r*77.1%
*-commutative77.1%
*-commutative77.1%
*-commutative77.1%
associate-*r*77.2%
*-commutative77.2%
+-commutative77.2%
Simplified77.2%
*-commutative77.2%
add-cube-cbrt67.6%
unpow372.1%
associate-*r*76.6%
*-commutative76.6%
*-commutative76.6%
associate-*r*72.1%
*-commutative72.1%
Applied egg-rr72.1%
Taylor expanded in angle around 0 90.3%
Final simplification68.1%
NOTE: a should be positive before calling this function NOTE: b should be positive before calling this function (FPCore (a b angle) :precision binary64 (* 2.0 (* (- b a) (* (+ b a) (sin (pow (cbrt (* PI (* angle 0.005555555555555556))) 3.0))))))
a = abs(a);
b = abs(b);
double code(double a, double b, double angle) {
return 2.0 * ((b - a) * ((b + a) * sin(pow(cbrt((((double) M_PI) * (angle * 0.005555555555555556))), 3.0))));
}
a = Math.abs(a);
b = Math.abs(b);
public static double code(double a, double b, double angle) {
return 2.0 * ((b - a) * ((b + a) * Math.sin(Math.pow(Math.cbrt((Math.PI * (angle * 0.005555555555555556))), 3.0))));
}
a = abs(a) b = abs(b) function code(a, b, angle) return Float64(2.0 * Float64(Float64(b - a) * Float64(Float64(b + a) * sin((cbrt(Float64(pi * Float64(angle * 0.005555555555555556))) ^ 3.0))))) end
NOTE: a should be positive before calling this function NOTE: b should be positive before calling this function code[a_, b_, angle_] := N[(2.0 * N[(N[(b - a), $MachinePrecision] * N[(N[(b + a), $MachinePrecision] * N[Sin[N[Power[N[Power[N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
a = |a|\\
b = |b|\\
\\
2 \cdot \left(\left(b - a\right) \cdot \left(\left(b + a\right) \cdot \sin \left({\left(\sqrt[3]{\pi \cdot \left(angle \cdot 0.005555555555555556\right)}\right)}^{3}\right)\right)\right)
\end{array}
Initial program 51.4%
associate-*l*51.4%
unpow251.4%
unpow251.4%
difference-of-squares53.7%
Simplified53.7%
Taylor expanded in angle around inf 67.0%
associate-*r*67.0%
*-commutative67.0%
*-commutative67.0%
associate-*r*68.6%
*-commutative68.6%
*-commutative68.6%
*-commutative68.6%
associate-*r*68.2%
*-commutative68.2%
+-commutative68.2%
Simplified68.2%
*-commutative68.2%
add-cube-cbrt65.0%
unpow365.9%
associate-*r*66.3%
*-commutative66.3%
*-commutative66.3%
associate-*r*65.9%
*-commutative65.9%
Applied egg-rr65.9%
Taylor expanded in angle around 0 68.0%
Final simplification68.0%
NOTE: a should be positive before calling this function NOTE: b should be positive before calling this function (FPCore (a b angle) :precision binary64 (if (or (<= angle -2.95e+144) (not (<= angle 4e+197))) (* (sin (* 0.005555555555555556 (* angle PI))) (* 2.0 (* (- b a) (+ b a)))) (* 0.011111111111111112 (* (* PI (+ b a)) (* angle (- b a))))))
a = abs(a);
b = abs(b);
double code(double a, double b, double angle) {
double tmp;
if ((angle <= -2.95e+144) || !(angle <= 4e+197)) {
tmp = sin((0.005555555555555556 * (angle * ((double) M_PI)))) * (2.0 * ((b - a) * (b + a)));
} else {
tmp = 0.011111111111111112 * ((((double) M_PI) * (b + a)) * (angle * (b - a)));
}
return tmp;
}
a = Math.abs(a);
b = Math.abs(b);
public static double code(double a, double b, double angle) {
double tmp;
if ((angle <= -2.95e+144) || !(angle <= 4e+197)) {
tmp = Math.sin((0.005555555555555556 * (angle * Math.PI))) * (2.0 * ((b - a) * (b + a)));
} else {
tmp = 0.011111111111111112 * ((Math.PI * (b + a)) * (angle * (b - a)));
}
return tmp;
}
a = abs(a) b = abs(b) def code(a, b, angle): tmp = 0 if (angle <= -2.95e+144) or not (angle <= 4e+197): tmp = math.sin((0.005555555555555556 * (angle * math.pi))) * (2.0 * ((b - a) * (b + a))) else: tmp = 0.011111111111111112 * ((math.pi * (b + a)) * (angle * (b - a))) return tmp
a = abs(a) b = abs(b) function code(a, b, angle) tmp = 0.0 if ((angle <= -2.95e+144) || !(angle <= 4e+197)) tmp = Float64(sin(Float64(0.005555555555555556 * Float64(angle * pi))) * Float64(2.0 * Float64(Float64(b - a) * Float64(b + a)))); else tmp = Float64(0.011111111111111112 * Float64(Float64(pi * Float64(b + a)) * Float64(angle * Float64(b - a)))); end return tmp end
a = abs(a) b = abs(b) function tmp_2 = code(a, b, angle) tmp = 0.0; if ((angle <= -2.95e+144) || ~((angle <= 4e+197))) tmp = sin((0.005555555555555556 * (angle * pi))) * (2.0 * ((b - a) * (b + a))); else tmp = 0.011111111111111112 * ((pi * (b + a)) * (angle * (b - a))); end tmp_2 = tmp; end
NOTE: a should be positive before calling this function NOTE: b should be positive before calling this function code[a_, b_, angle_] := If[Or[LessEqual[angle, -2.95e+144], N[Not[LessEqual[angle, 4e+197]], $MachinePrecision]], N[(N[Sin[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(2.0 * N[(N[(b - a), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(N[(Pi * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[(angle * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
a = |a|\\
b = |b|\\
\\
\begin{array}{l}
\mathbf{if}\;angle \leq -2.95 \cdot 10^{+144} \lor \neg \left(angle \leq 4 \cdot 10^{+197}\right):\\
\;\;\;\;\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(2 \cdot \left(\left(b - a\right) \cdot \left(b + a\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(\pi \cdot \left(b + a\right)\right) \cdot \left(angle \cdot \left(b - a\right)\right)\right)\\
\end{array}
\end{array}
if angle < -2.94999999999999994e144 or 3.9999999999999998e197 < angle Initial program 29.1%
associate-*l*29.1%
unpow229.1%
unpow229.1%
difference-of-squares30.9%
Simplified30.9%
add-cube-cbrt33.3%
pow331.7%
div-inv32.0%
metadata-eval32.0%
Applied egg-rr32.0%
Taylor expanded in angle around inf 37.6%
associate-*r*37.6%
+-commutative37.6%
*-commutative37.6%
associate-*l*37.6%
associate-*r*37.6%
*-commutative37.6%
Simplified37.6%
if -2.94999999999999994e144 < angle < 3.9999999999999998e197Initial program 57.5%
associate-*l*57.5%
unpow257.5%
unpow257.5%
difference-of-squares60.0%
Simplified60.0%
Taylor expanded in angle around 0 57.8%
associate-*r*74.4%
*-commutative74.4%
+-commutative74.4%
Simplified74.4%
Final simplification66.5%
NOTE: a should be positive before calling this function NOTE: b should be positive before calling this function (FPCore (a b angle) :precision binary64 (if (<= b 3.5e+140) (* (* (+ b a) (sin (* 0.005555555555555556 (* angle PI)))) (* 2.0 (- b a))) (* 0.011111111111111112 (* (* PI (+ b a)) (* angle (- b a))))))
a = abs(a);
b = abs(b);
double code(double a, double b, double angle) {
double tmp;
if (b <= 3.5e+140) {
tmp = ((b + a) * sin((0.005555555555555556 * (angle * ((double) M_PI))))) * (2.0 * (b - a));
} else {
tmp = 0.011111111111111112 * ((((double) M_PI) * (b + a)) * (angle * (b - a)));
}
return tmp;
}
a = Math.abs(a);
b = Math.abs(b);
public static double code(double a, double b, double angle) {
double tmp;
if (b <= 3.5e+140) {
tmp = ((b + a) * Math.sin((0.005555555555555556 * (angle * Math.PI)))) * (2.0 * (b - a));
} else {
tmp = 0.011111111111111112 * ((Math.PI * (b + a)) * (angle * (b - a)));
}
return tmp;
}
a = abs(a) b = abs(b) def code(a, b, angle): tmp = 0 if b <= 3.5e+140: tmp = ((b + a) * math.sin((0.005555555555555556 * (angle * math.pi)))) * (2.0 * (b - a)) else: tmp = 0.011111111111111112 * ((math.pi * (b + a)) * (angle * (b - a))) return tmp
a = abs(a) b = abs(b) function code(a, b, angle) tmp = 0.0 if (b <= 3.5e+140) tmp = Float64(Float64(Float64(b + a) * sin(Float64(0.005555555555555556 * Float64(angle * pi)))) * Float64(2.0 * Float64(b - a))); else tmp = Float64(0.011111111111111112 * Float64(Float64(pi * Float64(b + a)) * Float64(angle * Float64(b - a)))); end return tmp end
a = abs(a) b = abs(b) function tmp_2 = code(a, b, angle) tmp = 0.0; if (b <= 3.5e+140) tmp = ((b + a) * sin((0.005555555555555556 * (angle * pi)))) * (2.0 * (b - a)); else tmp = 0.011111111111111112 * ((pi * (b + a)) * (angle * (b - a))); end tmp_2 = tmp; end
NOTE: a should be positive before calling this function NOTE: b should be positive before calling this function code[a_, b_, angle_] := If[LessEqual[b, 3.5e+140], N[(N[(N[(b + a), $MachinePrecision] * N[Sin[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(N[(Pi * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[(angle * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
a = |a|\\
b = |b|\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq 3.5 \cdot 10^{+140}:\\
\;\;\;\;\left(\left(b + a\right) \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right) \cdot \left(2 \cdot \left(b - a\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(\pi \cdot \left(b + a\right)\right) \cdot \left(angle \cdot \left(b - a\right)\right)\right)\\
\end{array}
\end{array}
if b < 3.49999999999999989e140Initial program 51.2%
associate-*l*51.2%
unpow251.2%
unpow251.2%
difference-of-squares53.0%
Simplified53.0%
add-cube-cbrt57.0%
pow355.1%
div-inv56.0%
metadata-eval56.0%
Applied egg-rr56.0%
Taylor expanded in angle around inf 64.3%
associate-*r*64.3%
+-commutative64.3%
Simplified64.3%
if 3.49999999999999989e140 < b Initial program 52.7%
associate-*l*52.7%
unpow252.7%
unpow252.7%
difference-of-squares59.1%
Simplified59.1%
Taylor expanded in angle around 0 50.8%
associate-*r*78.1%
*-commutative78.1%
+-commutative78.1%
Simplified78.1%
Final simplification66.0%
NOTE: a should be positive before calling this function NOTE: b should be positive before calling this function (FPCore (a b angle) :precision binary64 (* 2.0 (* (- b a) (* (+ b a) (sin (* PI (* angle 0.005555555555555556)))))))
a = abs(a);
b = abs(b);
double code(double a, double b, double angle) {
return 2.0 * ((b - a) * ((b + a) * sin((((double) M_PI) * (angle * 0.005555555555555556)))));
}
a = Math.abs(a);
b = Math.abs(b);
public static double code(double a, double b, double angle) {
return 2.0 * ((b - a) * ((b + a) * Math.sin((Math.PI * (angle * 0.005555555555555556)))));
}
a = abs(a) b = abs(b) def code(a, b, angle): return 2.0 * ((b - a) * ((b + a) * math.sin((math.pi * (angle * 0.005555555555555556)))))
a = abs(a) b = abs(b) function code(a, b, angle) return Float64(2.0 * Float64(Float64(b - a) * Float64(Float64(b + a) * sin(Float64(pi * Float64(angle * 0.005555555555555556)))))) end
a = abs(a) b = abs(b) function tmp = code(a, b, angle) tmp = 2.0 * ((b - a) * ((b + a) * sin((pi * (angle * 0.005555555555555556))))); end
NOTE: a should be positive before calling this function NOTE: b should be positive before calling this function code[a_, b_, angle_] := N[(2.0 * N[(N[(b - a), $MachinePrecision] * N[(N[(b + a), $MachinePrecision] * N[Sin[N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
a = |a|\\
b = |b|\\
\\
2 \cdot \left(\left(b - a\right) \cdot \left(\left(b + a\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)
\end{array}
Initial program 51.4%
associate-*l*51.4%
unpow251.4%
unpow251.4%
difference-of-squares53.7%
Simplified53.7%
Taylor expanded in angle around inf 67.0%
associate-*r*67.0%
*-commutative67.0%
*-commutative67.0%
associate-*r*68.6%
*-commutative68.6%
*-commutative68.6%
*-commutative68.6%
associate-*r*68.2%
*-commutative68.2%
+-commutative68.2%
Simplified68.2%
Taylor expanded in angle around 0 66.6%
Final simplification66.6%
NOTE: a should be positive before calling this function NOTE: b should be positive before calling this function (FPCore (a b angle) :precision binary64 (if (<= b 5.2e+153) (* 0.011111111111111112 (* angle (* PI (* (- b a) (+ b a))))) (* 0.011111111111111112 (* (* b PI) (* angle b)))))
a = abs(a);
b = abs(b);
double code(double a, double b, double angle) {
double tmp;
if (b <= 5.2e+153) {
tmp = 0.011111111111111112 * (angle * (((double) M_PI) * ((b - a) * (b + a))));
} else {
tmp = 0.011111111111111112 * ((b * ((double) M_PI)) * (angle * b));
}
return tmp;
}
a = Math.abs(a);
b = Math.abs(b);
public static double code(double a, double b, double angle) {
double tmp;
if (b <= 5.2e+153) {
tmp = 0.011111111111111112 * (angle * (Math.PI * ((b - a) * (b + a))));
} else {
tmp = 0.011111111111111112 * ((b * Math.PI) * (angle * b));
}
return tmp;
}
a = abs(a) b = abs(b) def code(a, b, angle): tmp = 0 if b <= 5.2e+153: tmp = 0.011111111111111112 * (angle * (math.pi * ((b - a) * (b + a)))) else: tmp = 0.011111111111111112 * ((b * math.pi) * (angle * b)) return tmp
a = abs(a) b = abs(b) function code(a, b, angle) tmp = 0.0 if (b <= 5.2e+153) tmp = Float64(0.011111111111111112 * Float64(angle * Float64(pi * Float64(Float64(b - a) * Float64(b + a))))); else tmp = Float64(0.011111111111111112 * Float64(Float64(b * pi) * Float64(angle * b))); end return tmp end
a = abs(a) b = abs(b) function tmp_2 = code(a, b, angle) tmp = 0.0; if (b <= 5.2e+153) tmp = 0.011111111111111112 * (angle * (pi * ((b - a) * (b + a)))); else tmp = 0.011111111111111112 * ((b * pi) * (angle * b)); end tmp_2 = tmp; end
NOTE: a should be positive before calling this function NOTE: b should be positive before calling this function code[a_, b_, angle_] := If[LessEqual[b, 5.2e+153], N[(0.011111111111111112 * N[(angle * N[(Pi * N[(N[(b - a), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(N[(b * Pi), $MachinePrecision] * N[(angle * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
a = |a|\\
b = |b|\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq 5.2 \cdot 10^{+153}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(\left(b - a\right) \cdot \left(b + a\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(b \cdot \pi\right) \cdot \left(angle \cdot b\right)\right)\\
\end{array}
\end{array}
if b < 5.1999999999999998e153Initial program 51.1%
associate-*l*51.1%
unpow251.1%
unpow251.1%
difference-of-squares52.9%
Simplified52.9%
Taylor expanded in angle around 0 50.0%
Taylor expanded in angle around 0 50.0%
associate-*r*50.1%
*-commutative50.1%
+-commutative50.1%
Simplified50.1%
if 5.1999999999999998e153 < b Initial program 53.6%
associate-*l*53.6%
unpow253.6%
unpow253.6%
difference-of-squares61.0%
Simplified61.0%
Taylor expanded in angle around 0 53.6%
Taylor expanded in b around inf 57.3%
*-commutative57.3%
unpow257.3%
Simplified57.3%
Taylor expanded in angle around 0 57.3%
*-commutative57.3%
unpow257.3%
*-commutative57.3%
associate-*l*57.3%
Simplified57.3%
Taylor expanded in angle around 0 57.3%
*-commutative57.3%
*-commutative57.3%
unpow257.3%
associate-*r*57.3%
associate-*l*85.2%
*-commutative85.2%
Simplified85.2%
Final simplification53.8%
NOTE: a should be positive before calling this function NOTE: b should be positive before calling this function (FPCore (a b angle) :precision binary64 (* 0.011111111111111112 (* (* PI (+ b a)) (* angle (- b a)))))
a = abs(a);
b = abs(b);
double code(double a, double b, double angle) {
return 0.011111111111111112 * ((((double) M_PI) * (b + a)) * (angle * (b - a)));
}
a = Math.abs(a);
b = Math.abs(b);
public static double code(double a, double b, double angle) {
return 0.011111111111111112 * ((Math.PI * (b + a)) * (angle * (b - a)));
}
a = abs(a) b = abs(b) def code(a, b, angle): return 0.011111111111111112 * ((math.pi * (b + a)) * (angle * (b - a)))
a = abs(a) b = abs(b) function code(a, b, angle) return Float64(0.011111111111111112 * Float64(Float64(pi * Float64(b + a)) * Float64(angle * Float64(b - a)))) end
a = abs(a) b = abs(b) function tmp = code(a, b, angle) tmp = 0.011111111111111112 * ((pi * (b + a)) * (angle * (b - a))); end
NOTE: a should be positive before calling this function NOTE: b should be positive before calling this function code[a_, b_, angle_] := N[(0.011111111111111112 * N[(N[(Pi * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[(angle * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
a = |a|\\
b = |b|\\
\\
0.011111111111111112 \cdot \left(\left(\pi \cdot \left(b + a\right)\right) \cdot \left(angle \cdot \left(b - a\right)\right)\right)
\end{array}
Initial program 51.4%
associate-*l*51.4%
unpow251.4%
unpow251.4%
difference-of-squares53.7%
Simplified53.7%
Taylor expanded in angle around 0 50.4%
associate-*r*61.6%
*-commutative61.6%
+-commutative61.6%
Simplified61.6%
Final simplification61.6%
NOTE: a should be positive before calling this function NOTE: b should be positive before calling this function (FPCore (a b angle) :precision binary64 (if (<= b 1.2e+55) (* 0.011111111111111112 (* angle (* PI (* b b)))) (* 0.011111111111111112 (* (* b PI) (* angle b)))))
a = abs(a);
b = abs(b);
double code(double a, double b, double angle) {
double tmp;
if (b <= 1.2e+55) {
tmp = 0.011111111111111112 * (angle * (((double) M_PI) * (b * b)));
} else {
tmp = 0.011111111111111112 * ((b * ((double) M_PI)) * (angle * b));
}
return tmp;
}
a = Math.abs(a);
b = Math.abs(b);
public static double code(double a, double b, double angle) {
double tmp;
if (b <= 1.2e+55) {
tmp = 0.011111111111111112 * (angle * (Math.PI * (b * b)));
} else {
tmp = 0.011111111111111112 * ((b * Math.PI) * (angle * b));
}
return tmp;
}
a = abs(a) b = abs(b) def code(a, b, angle): tmp = 0 if b <= 1.2e+55: tmp = 0.011111111111111112 * (angle * (math.pi * (b * b))) else: tmp = 0.011111111111111112 * ((b * math.pi) * (angle * b)) return tmp
a = abs(a) b = abs(b) function code(a, b, angle) tmp = 0.0 if (b <= 1.2e+55) tmp = Float64(0.011111111111111112 * Float64(angle * Float64(pi * Float64(b * b)))); else tmp = Float64(0.011111111111111112 * Float64(Float64(b * pi) * Float64(angle * b))); end return tmp end
a = abs(a) b = abs(b) function tmp_2 = code(a, b, angle) tmp = 0.0; if (b <= 1.2e+55) tmp = 0.011111111111111112 * (angle * (pi * (b * b))); else tmp = 0.011111111111111112 * ((b * pi) * (angle * b)); end tmp_2 = tmp; end
NOTE: a should be positive before calling this function NOTE: b should be positive before calling this function code[a_, b_, angle_] := If[LessEqual[b, 1.2e+55], N[(0.011111111111111112 * N[(angle * N[(Pi * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(N[(b * Pi), $MachinePrecision] * N[(angle * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
a = |a|\\
b = |b|\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq 1.2 \cdot 10^{+55}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(b \cdot b\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(b \cdot \pi\right) \cdot \left(angle \cdot b\right)\right)\\
\end{array}
\end{array}
if b < 1.2e55Initial program 51.7%
associate-*l*51.7%
unpow251.7%
unpow251.7%
difference-of-squares53.7%
Simplified53.7%
Taylor expanded in angle around 0 51.4%
Taylor expanded in b around inf 29.6%
*-commutative29.6%
unpow229.6%
Simplified29.6%
if 1.2e55 < b Initial program 49.9%
associate-*l*49.9%
unpow249.9%
unpow249.9%
difference-of-squares53.9%
Simplified53.9%
Taylor expanded in angle around 0 46.5%
Taylor expanded in b around inf 46.2%
*-commutative46.2%
unpow246.2%
Simplified46.2%
Taylor expanded in angle around 0 46.2%
*-commutative46.2%
unpow246.2%
*-commutative46.2%
associate-*l*46.2%
Simplified46.2%
Taylor expanded in angle around 0 46.2%
*-commutative46.2%
*-commutative46.2%
unpow246.2%
associate-*r*46.2%
associate-*l*61.3%
*-commutative61.3%
Simplified61.3%
Final simplification35.8%
NOTE: a should be positive before calling this function NOTE: b should be positive before calling this function (FPCore (a b angle) :precision binary64 (if (<= b 3.8e+42) (* angle (* 0.011111111111111112 (* PI (* b b)))) (* 0.011111111111111112 (* (* b PI) (* angle b)))))
a = abs(a);
b = abs(b);
double code(double a, double b, double angle) {
double tmp;
if (b <= 3.8e+42) {
tmp = angle * (0.011111111111111112 * (((double) M_PI) * (b * b)));
} else {
tmp = 0.011111111111111112 * ((b * ((double) M_PI)) * (angle * b));
}
return tmp;
}
a = Math.abs(a);
b = Math.abs(b);
public static double code(double a, double b, double angle) {
double tmp;
if (b <= 3.8e+42) {
tmp = angle * (0.011111111111111112 * (Math.PI * (b * b)));
} else {
tmp = 0.011111111111111112 * ((b * Math.PI) * (angle * b));
}
return tmp;
}
a = abs(a) b = abs(b) def code(a, b, angle): tmp = 0 if b <= 3.8e+42: tmp = angle * (0.011111111111111112 * (math.pi * (b * b))) else: tmp = 0.011111111111111112 * ((b * math.pi) * (angle * b)) return tmp
a = abs(a) b = abs(b) function code(a, b, angle) tmp = 0.0 if (b <= 3.8e+42) tmp = Float64(angle * Float64(0.011111111111111112 * Float64(pi * Float64(b * b)))); else tmp = Float64(0.011111111111111112 * Float64(Float64(b * pi) * Float64(angle * b))); end return tmp end
a = abs(a) b = abs(b) function tmp_2 = code(a, b, angle) tmp = 0.0; if (b <= 3.8e+42) tmp = angle * (0.011111111111111112 * (pi * (b * b))); else tmp = 0.011111111111111112 * ((b * pi) * (angle * b)); end tmp_2 = tmp; end
NOTE: a should be positive before calling this function NOTE: b should be positive before calling this function code[a_, b_, angle_] := If[LessEqual[b, 3.8e+42], N[(angle * N[(0.011111111111111112 * N[(Pi * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(N[(b * Pi), $MachinePrecision] * N[(angle * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
a = |a|\\
b = |b|\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq 3.8 \cdot 10^{+42}:\\
\;\;\;\;angle \cdot \left(0.011111111111111112 \cdot \left(\pi \cdot \left(b \cdot b\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(b \cdot \pi\right) \cdot \left(angle \cdot b\right)\right)\\
\end{array}
\end{array}
if b < 3.7999999999999998e42Initial program 51.2%
associate-*l*51.3%
unpow251.3%
unpow251.3%
difference-of-squares53.2%
Simplified53.2%
Taylor expanded in angle around 0 50.9%
Taylor expanded in b around inf 29.4%
*-commutative29.4%
unpow229.4%
Simplified29.4%
Taylor expanded in angle around 0 29.4%
*-commutative29.4%
unpow229.4%
*-commutative29.4%
associate-*l*29.4%
Simplified29.4%
if 3.7999999999999998e42 < b Initial program 51.8%
associate-*l*51.8%
unpow251.8%
unpow251.8%
difference-of-squares55.6%
Simplified55.6%
Taylor expanded in angle around 0 48.6%
Taylor expanded in b around inf 46.4%
*-commutative46.4%
unpow246.4%
Simplified46.4%
Taylor expanded in angle around 0 46.4%
*-commutative46.4%
unpow246.4%
*-commutative46.4%
associate-*l*46.4%
Simplified46.4%
Taylor expanded in angle around 0 46.4%
*-commutative46.4%
*-commutative46.4%
unpow246.4%
associate-*r*46.4%
associate-*l*60.9%
*-commutative60.9%
Simplified60.9%
Final simplification35.8%
NOTE: a should be positive before calling this function NOTE: b should be positive before calling this function (FPCore (a b angle) :precision binary64 (if (<= b 5e+60) (* (* angle -0.011111111111111112) (* PI (* a a))) (* 0.011111111111111112 (* (* b PI) (* angle b)))))
a = abs(a);
b = abs(b);
double code(double a, double b, double angle) {
double tmp;
if (b <= 5e+60) {
tmp = (angle * -0.011111111111111112) * (((double) M_PI) * (a * a));
} else {
tmp = 0.011111111111111112 * ((b * ((double) M_PI)) * (angle * b));
}
return tmp;
}
a = Math.abs(a);
b = Math.abs(b);
public static double code(double a, double b, double angle) {
double tmp;
if (b <= 5e+60) {
tmp = (angle * -0.011111111111111112) * (Math.PI * (a * a));
} else {
tmp = 0.011111111111111112 * ((b * Math.PI) * (angle * b));
}
return tmp;
}
a = abs(a) b = abs(b) def code(a, b, angle): tmp = 0 if b <= 5e+60: tmp = (angle * -0.011111111111111112) * (math.pi * (a * a)) else: tmp = 0.011111111111111112 * ((b * math.pi) * (angle * b)) return tmp
a = abs(a) b = abs(b) function code(a, b, angle) tmp = 0.0 if (b <= 5e+60) tmp = Float64(Float64(angle * -0.011111111111111112) * Float64(pi * Float64(a * a))); else tmp = Float64(0.011111111111111112 * Float64(Float64(b * pi) * Float64(angle * b))); end return tmp end
a = abs(a) b = abs(b) function tmp_2 = code(a, b, angle) tmp = 0.0; if (b <= 5e+60) tmp = (angle * -0.011111111111111112) * (pi * (a * a)); else tmp = 0.011111111111111112 * ((b * pi) * (angle * b)); end tmp_2 = tmp; end
NOTE: a should be positive before calling this function NOTE: b should be positive before calling this function code[a_, b_, angle_] := If[LessEqual[b, 5e+60], N[(N[(angle * -0.011111111111111112), $MachinePrecision] * N[(Pi * N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(N[(b * Pi), $MachinePrecision] * N[(angle * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
a = |a|\\
b = |b|\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq 5 \cdot 10^{+60}:\\
\;\;\;\;\left(angle \cdot -0.011111111111111112\right) \cdot \left(\pi \cdot \left(a \cdot a\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(b \cdot \pi\right) \cdot \left(angle \cdot b\right)\right)\\
\end{array}
\end{array}
if b < 4.99999999999999975e60Initial program 51.0%
associate-*l*51.0%
unpow251.0%
unpow251.0%
difference-of-squares53.0%
Simplified53.0%
Taylor expanded in angle around 0 50.7%
Taylor expanded in b around 0 39.6%
associate-*r*39.2%
*-commutative39.2%
unpow239.2%
Simplified39.2%
if 4.99999999999999975e60 < b Initial program 52.8%
associate-*l*52.8%
unpow252.8%
unpow252.8%
difference-of-squares57.1%
Simplified57.1%
Taylor expanded in angle around 0 49.1%
Taylor expanded in b around inf 48.9%
*-commutative48.9%
unpow248.9%
Simplified48.9%
Taylor expanded in angle around 0 48.9%
*-commutative48.9%
unpow248.9%
*-commutative48.9%
associate-*l*49.0%
Simplified49.0%
Taylor expanded in angle around 0 48.9%
*-commutative48.9%
*-commutative48.9%
unpow248.9%
associate-*r*48.9%
associate-*l*65.0%
*-commutative65.0%
Simplified65.0%
Final simplification43.9%
NOTE: a should be positive before calling this function NOTE: b should be positive before calling this function (FPCore (a b angle) :precision binary64 (* 0.011111111111111112 (* angle (* PI (* b b)))))
a = abs(a);
b = abs(b);
double code(double a, double b, double angle) {
return 0.011111111111111112 * (angle * (((double) M_PI) * (b * b)));
}
a = Math.abs(a);
b = Math.abs(b);
public static double code(double a, double b, double angle) {
return 0.011111111111111112 * (angle * (Math.PI * (b * b)));
}
a = abs(a) b = abs(b) def code(a, b, angle): return 0.011111111111111112 * (angle * (math.pi * (b * b)))
a = abs(a) b = abs(b) function code(a, b, angle) return Float64(0.011111111111111112 * Float64(angle * Float64(pi * Float64(b * b)))) end
a = abs(a) b = abs(b) function tmp = code(a, b, angle) tmp = 0.011111111111111112 * (angle * (pi * (b * b))); end
NOTE: a should be positive before calling this function 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}
a = |a|\\
b = |b|\\
\\
0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(b \cdot b\right)\right)\right)
\end{array}
Initial program 51.4%
associate-*l*51.4%
unpow251.4%
unpow251.4%
difference-of-squares53.7%
Simplified53.7%
Taylor expanded in angle around 0 50.4%
Taylor expanded in b around inf 32.8%
*-commutative32.8%
unpow232.8%
Simplified32.8%
Final simplification32.8%
herbie shell --seed 2023257
(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)))))