
(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: a should be positive before calling this function
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (* (+ a b) (- a b)))
(t_1 (cbrt (pow PI 3.0)))
(t_2 (* angle (/ t_1 -180.0))))
(if (<= a 3.8e+148)
(*
(* 2.0 (sin (* (* angle t_1) -0.005555555555555556)))
(* (cos (* PI (* angle -0.005555555555555556))) t_0))
(* (* 2.0 (sin t_2)) (* t_0 (cos t_2))))))a = abs(a);
double code(double a, double b, double angle) {
double t_0 = (a + b) * (a - b);
double t_1 = cbrt(pow(((double) M_PI), 3.0));
double t_2 = angle * (t_1 / -180.0);
double tmp;
if (a <= 3.8e+148) {
tmp = (2.0 * sin(((angle * t_1) * -0.005555555555555556))) * (cos((((double) M_PI) * (angle * -0.005555555555555556))) * t_0);
} else {
tmp = (2.0 * sin(t_2)) * (t_0 * cos(t_2));
}
return tmp;
}
a = Math.abs(a);
public static double code(double a, double b, double angle) {
double t_0 = (a + b) * (a - b);
double t_1 = Math.cbrt(Math.pow(Math.PI, 3.0));
double t_2 = angle * (t_1 / -180.0);
double tmp;
if (a <= 3.8e+148) {
tmp = (2.0 * Math.sin(((angle * t_1) * -0.005555555555555556))) * (Math.cos((Math.PI * (angle * -0.005555555555555556))) * t_0);
} else {
tmp = (2.0 * Math.sin(t_2)) * (t_0 * Math.cos(t_2));
}
return tmp;
}
a = abs(a) function code(a, b, angle) t_0 = Float64(Float64(a + b) * Float64(a - b)) t_1 = cbrt((pi ^ 3.0)) t_2 = Float64(angle * Float64(t_1 / -180.0)) tmp = 0.0 if (a <= 3.8e+148) tmp = Float64(Float64(2.0 * sin(Float64(Float64(angle * t_1) * -0.005555555555555556))) * Float64(cos(Float64(pi * Float64(angle * -0.005555555555555556))) * t_0)); else tmp = Float64(Float64(2.0 * sin(t_2)) * Float64(t_0 * cos(t_2))); end return tmp end
NOTE: a should be positive before calling this function
code[a_, b_, angle_] := Block[{t$95$0 = N[(N[(a + b), $MachinePrecision] * N[(a - b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Power[N[Power[Pi, 3.0], $MachinePrecision], 1/3], $MachinePrecision]}, Block[{t$95$2 = N[(angle * N[(t$95$1 / -180.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, 3.8e+148], N[(N[(2.0 * N[Sin[N[(N[(angle * t$95$1), $MachinePrecision] * -0.005555555555555556), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[Cos[N[(Pi * N[(angle * -0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 * N[Sin[t$95$2], $MachinePrecision]), $MachinePrecision] * N[(t$95$0 * N[Cos[t$95$2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
a = |a|\\
\\
\begin{array}{l}
t_0 := \left(a + b\right) \cdot \left(a - b\right)\\
t_1 := \sqrt[3]{{\pi}^{3}}\\
t_2 := angle \cdot \frac{t_1}{-180}\\
\mathbf{if}\;a \leq 3.8 \cdot 10^{+148}:\\
\;\;\;\;\left(2 \cdot \sin \left(\left(angle \cdot t_1\right) \cdot -0.005555555555555556\right)\right) \cdot \left(\cos \left(\pi \cdot \left(angle \cdot -0.005555555555555556\right)\right) \cdot t_0\right)\\
\mathbf{else}:\\
\;\;\;\;\left(2 \cdot \sin t_2\right) \cdot \left(t_0 \cdot \cos t_2\right)\\
\end{array}
\end{array}
if a < 3.7999999999999998e148Initial program 54.4%
Simplified53.5%
unpow253.5%
unpow253.5%
difference-of-squares55.8%
Applied egg-rr55.8%
Taylor expanded in angle around inf 55.2%
*-commutative55.2%
Simplified55.2%
Taylor expanded in angle around inf 55.6%
associate-*r*56.6%
*-commutative56.6%
*-commutative56.6%
Simplified56.6%
add-cbrt-cube57.4%
pow357.4%
Applied egg-rr57.4%
if 3.7999999999999998e148 < a Initial program 30.3%
Simplified35.5%
unpow235.5%
unpow235.5%
difference-of-squares46.3%
Applied egg-rr46.3%
add-cbrt-cube49.0%
pow349.0%
Applied egg-rr51.6%
add-cbrt-cube49.0%
pow349.0%
Applied egg-rr56.9%
Final simplification57.3%
NOTE: a should be positive before calling this function
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (* PI (* angle -0.005555555555555556))) (t_1 (* (+ a b) (- a b))))
(if (<= (- (pow b 2.0) (pow a 2.0)) -5e+303)
(*
(* 2.0 (sin (* angle (/ PI -180.0))))
(* t_1 (cos (* angle (/ (pow (sqrt PI) 2.0) -180.0)))))
(* (* (cos t_0) t_1) (* 2.0 (sin t_0))))))a = abs(a);
double code(double a, double b, double angle) {
double t_0 = ((double) M_PI) * (angle * -0.005555555555555556);
double t_1 = (a + b) * (a - b);
double tmp;
if ((pow(b, 2.0) - pow(a, 2.0)) <= -5e+303) {
tmp = (2.0 * sin((angle * (((double) M_PI) / -180.0)))) * (t_1 * cos((angle * (pow(sqrt(((double) M_PI)), 2.0) / -180.0))));
} else {
tmp = (cos(t_0) * t_1) * (2.0 * sin(t_0));
}
return tmp;
}
a = Math.abs(a);
public static double code(double a, double b, double angle) {
double t_0 = Math.PI * (angle * -0.005555555555555556);
double t_1 = (a + b) * (a - b);
double tmp;
if ((Math.pow(b, 2.0) - Math.pow(a, 2.0)) <= -5e+303) {
tmp = (2.0 * Math.sin((angle * (Math.PI / -180.0)))) * (t_1 * Math.cos((angle * (Math.pow(Math.sqrt(Math.PI), 2.0) / -180.0))));
} else {
tmp = (Math.cos(t_0) * t_1) * (2.0 * Math.sin(t_0));
}
return tmp;
}
a = abs(a) def code(a, b, angle): t_0 = math.pi * (angle * -0.005555555555555556) t_1 = (a + b) * (a - b) tmp = 0 if (math.pow(b, 2.0) - math.pow(a, 2.0)) <= -5e+303: tmp = (2.0 * math.sin((angle * (math.pi / -180.0)))) * (t_1 * math.cos((angle * (math.pow(math.sqrt(math.pi), 2.0) / -180.0)))) else: tmp = (math.cos(t_0) * t_1) * (2.0 * math.sin(t_0)) return tmp
a = abs(a) function code(a, b, angle) t_0 = Float64(pi * Float64(angle * -0.005555555555555556)) t_1 = Float64(Float64(a + b) * Float64(a - b)) tmp = 0.0 if (Float64((b ^ 2.0) - (a ^ 2.0)) <= -5e+303) tmp = Float64(Float64(2.0 * sin(Float64(angle * Float64(pi / -180.0)))) * Float64(t_1 * cos(Float64(angle * Float64((sqrt(pi) ^ 2.0) / -180.0))))); else tmp = Float64(Float64(cos(t_0) * t_1) * Float64(2.0 * sin(t_0))); end return tmp end
a = abs(a) function tmp_2 = code(a, b, angle) t_0 = pi * (angle * -0.005555555555555556); t_1 = (a + b) * (a - b); tmp = 0.0; if (((b ^ 2.0) - (a ^ 2.0)) <= -5e+303) tmp = (2.0 * sin((angle * (pi / -180.0)))) * (t_1 * cos((angle * ((sqrt(pi) ^ 2.0) / -180.0)))); else tmp = (cos(t_0) * t_1) * (2.0 * sin(t_0)); end tmp_2 = tmp; end
NOTE: a 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[(N[(a + b), $MachinePrecision] * N[(a - b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision], -5e+303], N[(N[(2.0 * N[Sin[N[(angle * N[(Pi / -180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(t$95$1 * N[Cos[N[(angle * N[(N[Power[N[Sqrt[Pi], $MachinePrecision], 2.0], $MachinePrecision] / -180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Cos[t$95$0], $MachinePrecision] * t$95$1), $MachinePrecision] * N[(2.0 * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
a = |a|\\
\\
\begin{array}{l}
t_0 := \pi \cdot \left(angle \cdot -0.005555555555555556\right)\\
t_1 := \left(a + b\right) \cdot \left(a - b\right)\\
\mathbf{if}\;{b}^{2} - {a}^{2} \leq -5 \cdot 10^{+303}:\\
\;\;\;\;\left(2 \cdot \sin \left(angle \cdot \frac{\pi}{-180}\right)\right) \cdot \left(t_1 \cdot \cos \left(angle \cdot \frac{{\left(\sqrt{\pi}\right)}^{2}}{-180}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\cos t_0 \cdot t_1\right) \cdot \left(2 \cdot \sin t_0\right)\\
\end{array}
\end{array}
if (-.f64 (pow.f64 b 2) (pow.f64 a 2)) < -4.9999999999999997e303Initial program 47.3%
Simplified49.5%
unpow249.5%
unpow249.5%
difference-of-squares49.5%
Applied egg-rr49.5%
add-sqr-sqrt57.1%
pow257.1%
Applied egg-rr57.1%
if -4.9999999999999997e303 < (-.f64 (pow.f64 b 2) (pow.f64 a 2)) Initial program 51.7%
Simplified51.2%
unpow251.2%
unpow251.2%
difference-of-squares55.6%
Applied egg-rr55.6%
Taylor expanded in angle around inf 55.5%
*-commutative55.5%
Simplified55.5%
Taylor expanded in angle around inf 55.9%
associate-*r*56.5%
*-commutative56.5%
*-commutative56.5%
Simplified56.5%
Taylor expanded in angle around inf 56.5%
associate-*r*57.1%
*-commutative57.1%
*-commutative57.1%
Simplified57.1%
Final simplification57.1%
NOTE: a should be positive before calling this function
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (* (+ a b) (- a b))) (t_1 (* angle (/ PI -180.0))))
(if (<= (- (pow b 2.0) (pow a 2.0)) 5e+281)
(*
(* 2.0 (sin t_1))
(* t_0 (cos (* angle (/ (pow (sqrt PI) 2.0) -180.0)))))
(*
(* 2.0 (sin (* angle (/ (cbrt (pow PI 3.0)) -180.0))))
(* t_0 (cos t_1))))))a = abs(a);
double code(double a, double b, double angle) {
double t_0 = (a + b) * (a - b);
double t_1 = angle * (((double) M_PI) / -180.0);
double tmp;
if ((pow(b, 2.0) - pow(a, 2.0)) <= 5e+281) {
tmp = (2.0 * sin(t_1)) * (t_0 * cos((angle * (pow(sqrt(((double) M_PI)), 2.0) / -180.0))));
} else {
tmp = (2.0 * sin((angle * (cbrt(pow(((double) M_PI), 3.0)) / -180.0)))) * (t_0 * cos(t_1));
}
return tmp;
}
a = Math.abs(a);
public static double code(double a, double b, double angle) {
double t_0 = (a + b) * (a - b);
double t_1 = angle * (Math.PI / -180.0);
double tmp;
if ((Math.pow(b, 2.0) - Math.pow(a, 2.0)) <= 5e+281) {
tmp = (2.0 * Math.sin(t_1)) * (t_0 * Math.cos((angle * (Math.pow(Math.sqrt(Math.PI), 2.0) / -180.0))));
} else {
tmp = (2.0 * Math.sin((angle * (Math.cbrt(Math.pow(Math.PI, 3.0)) / -180.0)))) * (t_0 * Math.cos(t_1));
}
return tmp;
}
a = abs(a) function code(a, b, angle) t_0 = Float64(Float64(a + b) * Float64(a - b)) t_1 = Float64(angle * Float64(pi / -180.0)) tmp = 0.0 if (Float64((b ^ 2.0) - (a ^ 2.0)) <= 5e+281) tmp = Float64(Float64(2.0 * sin(t_1)) * Float64(t_0 * cos(Float64(angle * Float64((sqrt(pi) ^ 2.0) / -180.0))))); else tmp = Float64(Float64(2.0 * sin(Float64(angle * Float64(cbrt((pi ^ 3.0)) / -180.0)))) * Float64(t_0 * cos(t_1))); end return tmp end
NOTE: a should be positive before calling this function
code[a_, b_, angle_] := Block[{t$95$0 = N[(N[(a + b), $MachinePrecision] * N[(a - b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(angle * N[(Pi / -180.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision], 5e+281], N[(N[(2.0 * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision] * N[(t$95$0 * N[Cos[N[(angle * N[(N[Power[N[Sqrt[Pi], $MachinePrecision], 2.0], $MachinePrecision] / -180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 * N[Sin[N[(angle * N[(N[Power[N[Power[Pi, 3.0], $MachinePrecision], 1/3], $MachinePrecision] / -180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(t$95$0 * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
a = |a|\\
\\
\begin{array}{l}
t_0 := \left(a + b\right) \cdot \left(a - b\right)\\
t_1 := angle \cdot \frac{\pi}{-180}\\
\mathbf{if}\;{b}^{2} - {a}^{2} \leq 5 \cdot 10^{+281}:\\
\;\;\;\;\left(2 \cdot \sin t_1\right) \cdot \left(t_0 \cdot \cos \left(angle \cdot \frac{{\left(\sqrt{\pi}\right)}^{2}}{-180}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(2 \cdot \sin \left(angle \cdot \frac{\sqrt[3]{{\pi}^{3}}}{-180}\right)\right) \cdot \left(t_0 \cdot \cos t_1\right)\\
\end{array}
\end{array}
if (-.f64 (pow.f64 b 2) (pow.f64 a 2)) < 5.00000000000000016e281Initial program 56.4%
Simplified56.9%
unpow256.9%
unpow256.9%
difference-of-squares56.9%
Applied egg-rr56.9%
add-sqr-sqrt58.3%
pow258.3%
Applied egg-rr58.3%
if 5.00000000000000016e281 < (-.f64 (pow.f64 b 2) (pow.f64 a 2)) Initial program 35.8%
Simplified34.6%
unpow234.6%
unpow234.6%
difference-of-squares47.6%
Applied egg-rr47.6%
add-cbrt-cube58.0%
pow358.0%
Applied egg-rr55.3%
Final simplification57.5%
NOTE: a should be positive before calling this function
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (* (+ a b) (- a b))))
(if (<= (- (pow b 2.0) (pow a 2.0)) 5e+281)
(*
(* 2.0 (sin (* angle (/ PI -180.0))))
(* t_0 (cos (* angle (/ (pow (sqrt PI) 2.0) -180.0)))))
(*
(* (cos (* PI (* angle -0.005555555555555556))) t_0)
(* 2.0 (sin (* angle (/ (cbrt (pow PI 3.0)) -180.0))))))))a = abs(a);
double code(double a, double b, double angle) {
double t_0 = (a + b) * (a - b);
double tmp;
if ((pow(b, 2.0) - pow(a, 2.0)) <= 5e+281) {
tmp = (2.0 * sin((angle * (((double) M_PI) / -180.0)))) * (t_0 * cos((angle * (pow(sqrt(((double) M_PI)), 2.0) / -180.0))));
} else {
tmp = (cos((((double) M_PI) * (angle * -0.005555555555555556))) * t_0) * (2.0 * sin((angle * (cbrt(pow(((double) M_PI), 3.0)) / -180.0))));
}
return tmp;
}
a = Math.abs(a);
public static double code(double a, double b, double angle) {
double t_0 = (a + b) * (a - b);
double tmp;
if ((Math.pow(b, 2.0) - Math.pow(a, 2.0)) <= 5e+281) {
tmp = (2.0 * Math.sin((angle * (Math.PI / -180.0)))) * (t_0 * Math.cos((angle * (Math.pow(Math.sqrt(Math.PI), 2.0) / -180.0))));
} else {
tmp = (Math.cos((Math.PI * (angle * -0.005555555555555556))) * t_0) * (2.0 * Math.sin((angle * (Math.cbrt(Math.pow(Math.PI, 3.0)) / -180.0))));
}
return tmp;
}
a = abs(a) function code(a, b, angle) t_0 = Float64(Float64(a + b) * Float64(a - b)) tmp = 0.0 if (Float64((b ^ 2.0) - (a ^ 2.0)) <= 5e+281) tmp = Float64(Float64(2.0 * sin(Float64(angle * Float64(pi / -180.0)))) * Float64(t_0 * cos(Float64(angle * Float64((sqrt(pi) ^ 2.0) / -180.0))))); else tmp = Float64(Float64(cos(Float64(pi * Float64(angle * -0.005555555555555556))) * t_0) * Float64(2.0 * sin(Float64(angle * Float64(cbrt((pi ^ 3.0)) / -180.0))))); end return tmp end
NOTE: a should be positive before calling this function
code[a_, b_, angle_] := Block[{t$95$0 = N[(N[(a + b), $MachinePrecision] * N[(a - b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision], 5e+281], N[(N[(2.0 * N[Sin[N[(angle * N[(Pi / -180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(t$95$0 * N[Cos[N[(angle * N[(N[Power[N[Sqrt[Pi], $MachinePrecision], 2.0], $MachinePrecision] / -180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Cos[N[(Pi * N[(angle * -0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision] * N[(2.0 * N[Sin[N[(angle * N[(N[Power[N[Power[Pi, 3.0], $MachinePrecision], 1/3], $MachinePrecision] / -180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
a = |a|\\
\\
\begin{array}{l}
t_0 := \left(a + b\right) \cdot \left(a - b\right)\\
\mathbf{if}\;{b}^{2} - {a}^{2} \leq 5 \cdot 10^{+281}:\\
\;\;\;\;\left(2 \cdot \sin \left(angle \cdot \frac{\pi}{-180}\right)\right) \cdot \left(t_0 \cdot \cos \left(angle \cdot \frac{{\left(\sqrt{\pi}\right)}^{2}}{-180}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\cos \left(\pi \cdot \left(angle \cdot -0.005555555555555556\right)\right) \cdot t_0\right) \cdot \left(2 \cdot \sin \left(angle \cdot \frac{\sqrt[3]{{\pi}^{3}}}{-180}\right)\right)\\
\end{array}
\end{array}
if (-.f64 (pow.f64 b 2) (pow.f64 a 2)) < 5.00000000000000016e281Initial program 56.4%
Simplified56.9%
unpow256.9%
unpow256.9%
difference-of-squares56.9%
Applied egg-rr56.9%
add-sqr-sqrt58.3%
pow258.3%
Applied egg-rr58.3%
if 5.00000000000000016e281 < (-.f64 (pow.f64 b 2) (pow.f64 a 2)) Initial program 35.8%
Simplified34.6%
unpow234.6%
unpow234.6%
difference-of-squares47.6%
Applied egg-rr47.6%
add-cbrt-cube58.0%
pow358.0%
Applied egg-rr55.3%
Taylor expanded in angle around inf 56.8%
associate-*r*50.4%
*-commutative50.4%
*-commutative50.4%
Simplified58.2%
Final simplification58.3%
NOTE: a should be positive before calling this function
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (* (+ a b) (- a b))))
(if (<= (- (pow b 2.0) (pow a 2.0)) -5e+303)
(*
(* 2.0 (sin (* angle (/ PI -180.0))))
(* t_0 (cos (* angle (/ (pow (sqrt PI) 2.0) -180.0)))))
(*
(* 2.0 (sin (* (* angle (cbrt (pow PI 3.0))) -0.005555555555555556)))
(* (cos (* PI (* angle -0.005555555555555556))) t_0)))))a = abs(a);
double code(double a, double b, double angle) {
double t_0 = (a + b) * (a - b);
double tmp;
if ((pow(b, 2.0) - pow(a, 2.0)) <= -5e+303) {
tmp = (2.0 * sin((angle * (((double) M_PI) / -180.0)))) * (t_0 * cos((angle * (pow(sqrt(((double) M_PI)), 2.0) / -180.0))));
} else {
tmp = (2.0 * sin(((angle * cbrt(pow(((double) M_PI), 3.0))) * -0.005555555555555556))) * (cos((((double) M_PI) * (angle * -0.005555555555555556))) * t_0);
}
return tmp;
}
a = Math.abs(a);
public static double code(double a, double b, double angle) {
double t_0 = (a + b) * (a - b);
double tmp;
if ((Math.pow(b, 2.0) - Math.pow(a, 2.0)) <= -5e+303) {
tmp = (2.0 * Math.sin((angle * (Math.PI / -180.0)))) * (t_0 * Math.cos((angle * (Math.pow(Math.sqrt(Math.PI), 2.0) / -180.0))));
} else {
tmp = (2.0 * Math.sin(((angle * Math.cbrt(Math.pow(Math.PI, 3.0))) * -0.005555555555555556))) * (Math.cos((Math.PI * (angle * -0.005555555555555556))) * t_0);
}
return tmp;
}
a = abs(a) function code(a, b, angle) t_0 = Float64(Float64(a + b) * Float64(a - b)) tmp = 0.0 if (Float64((b ^ 2.0) - (a ^ 2.0)) <= -5e+303) tmp = Float64(Float64(2.0 * sin(Float64(angle * Float64(pi / -180.0)))) * Float64(t_0 * cos(Float64(angle * Float64((sqrt(pi) ^ 2.0) / -180.0))))); else tmp = Float64(Float64(2.0 * sin(Float64(Float64(angle * cbrt((pi ^ 3.0))) * -0.005555555555555556))) * Float64(cos(Float64(pi * Float64(angle * -0.005555555555555556))) * t_0)); end return tmp end
NOTE: a should be positive before calling this function
code[a_, b_, angle_] := Block[{t$95$0 = N[(N[(a + b), $MachinePrecision] * N[(a - b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision], -5e+303], N[(N[(2.0 * N[Sin[N[(angle * N[(Pi / -180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(t$95$0 * N[Cos[N[(angle * N[(N[Power[N[Sqrt[Pi], $MachinePrecision], 2.0], $MachinePrecision] / -180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 * N[Sin[N[(N[(angle * N[Power[N[Power[Pi, 3.0], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision] * -0.005555555555555556), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[Cos[N[(Pi * N[(angle * -0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
a = |a|\\
\\
\begin{array}{l}
t_0 := \left(a + b\right) \cdot \left(a - b\right)\\
\mathbf{if}\;{b}^{2} - {a}^{2} \leq -5 \cdot 10^{+303}:\\
\;\;\;\;\left(2 \cdot \sin \left(angle \cdot \frac{\pi}{-180}\right)\right) \cdot \left(t_0 \cdot \cos \left(angle \cdot \frac{{\left(\sqrt{\pi}\right)}^{2}}{-180}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(2 \cdot \sin \left(\left(angle \cdot \sqrt[3]{{\pi}^{3}}\right) \cdot -0.005555555555555556\right)\right) \cdot \left(\cos \left(\pi \cdot \left(angle \cdot -0.005555555555555556\right)\right) \cdot t_0\right)\\
\end{array}
\end{array}
if (-.f64 (pow.f64 b 2) (pow.f64 a 2)) < -4.9999999999999997e303Initial program 47.3%
Simplified49.5%
unpow249.5%
unpow249.5%
difference-of-squares49.5%
Applied egg-rr49.5%
add-sqr-sqrt57.1%
pow257.1%
Applied egg-rr57.1%
if -4.9999999999999997e303 < (-.f64 (pow.f64 b 2) (pow.f64 a 2)) Initial program 51.7%
Simplified51.2%
unpow251.2%
unpow251.2%
difference-of-squares55.6%
Applied egg-rr55.6%
Taylor expanded in angle around inf 55.5%
*-commutative55.5%
Simplified55.5%
Taylor expanded in angle around inf 55.9%
associate-*r*56.5%
*-commutative56.5%
*-commutative56.5%
Simplified56.5%
add-cbrt-cube58.9%
pow358.9%
Applied egg-rr58.9%
Final simplification58.5%
NOTE: a should be positive before calling this function
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (* PI (* angle -0.005555555555555556))))
(if (<= (pow a 2.0) 4e+240)
(*
2.0
(*
(- (pow b 2.0) (pow a 2.0))
(/ (sin (* (* angle PI) 0.011111111111111112)) 2.0)))
(* (* (cos t_0) (* (+ a b) (- a b))) (* 2.0 t_0)))))a = abs(a);
double code(double a, double b, double angle) {
double t_0 = ((double) M_PI) * (angle * -0.005555555555555556);
double tmp;
if (pow(a, 2.0) <= 4e+240) {
tmp = 2.0 * ((pow(b, 2.0) - pow(a, 2.0)) * (sin(((angle * ((double) M_PI)) * 0.011111111111111112)) / 2.0));
} else {
tmp = (cos(t_0) * ((a + b) * (a - b))) * (2.0 * t_0);
}
return tmp;
}
a = Math.abs(a);
public static double code(double a, double b, double angle) {
double t_0 = Math.PI * (angle * -0.005555555555555556);
double tmp;
if (Math.pow(a, 2.0) <= 4e+240) {
tmp = 2.0 * ((Math.pow(b, 2.0) - Math.pow(a, 2.0)) * (Math.sin(((angle * Math.PI) * 0.011111111111111112)) / 2.0));
} else {
tmp = (Math.cos(t_0) * ((a + b) * (a - b))) * (2.0 * t_0);
}
return tmp;
}
a = abs(a) def code(a, b, angle): t_0 = math.pi * (angle * -0.005555555555555556) tmp = 0 if math.pow(a, 2.0) <= 4e+240: tmp = 2.0 * ((math.pow(b, 2.0) - math.pow(a, 2.0)) * (math.sin(((angle * math.pi) * 0.011111111111111112)) / 2.0)) else: tmp = (math.cos(t_0) * ((a + b) * (a - b))) * (2.0 * t_0) return tmp
a = abs(a) function code(a, b, angle) t_0 = Float64(pi * Float64(angle * -0.005555555555555556)) tmp = 0.0 if ((a ^ 2.0) <= 4e+240) tmp = Float64(2.0 * Float64(Float64((b ^ 2.0) - (a ^ 2.0)) * Float64(sin(Float64(Float64(angle * pi) * 0.011111111111111112)) / 2.0))); else tmp = Float64(Float64(cos(t_0) * Float64(Float64(a + b) * Float64(a - b))) * Float64(2.0 * t_0)); end return tmp end
a = abs(a) function tmp_2 = code(a, b, angle) t_0 = pi * (angle * -0.005555555555555556); tmp = 0.0; if ((a ^ 2.0) <= 4e+240) tmp = 2.0 * (((b ^ 2.0) - (a ^ 2.0)) * (sin(((angle * pi) * 0.011111111111111112)) / 2.0)); else tmp = (cos(t_0) * ((a + b) * (a - b))) * (2.0 * t_0); end tmp_2 = tmp; end
NOTE: a 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[Power[a, 2.0], $MachinePrecision], 4e+240], N[(2.0 * N[(N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision] * N[(N[Sin[N[(N[(angle * Pi), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]], $MachinePrecision] / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Cos[t$95$0], $MachinePrecision] * N[(N[(a + b), $MachinePrecision] * N[(a - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(2.0 * t$95$0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
a = |a|\\
\\
\begin{array}{l}
t_0 := \pi \cdot \left(angle \cdot -0.005555555555555556\right)\\
\mathbf{if}\;{a}^{2} \leq 4 \cdot 10^{+240}:\\
\;\;\;\;2 \cdot \left(\left({b}^{2} - {a}^{2}\right) \cdot \frac{\sin \left(\left(angle \cdot \pi\right) \cdot 0.011111111111111112\right)}{2}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\cos t_0 \cdot \left(\left(a + b\right) \cdot \left(a - b\right)\right)\right) \cdot \left(2 \cdot t_0\right)\\
\end{array}
\end{array}
if (pow.f64 a 2) < 4.00000000000000006e240Initial program 57.1%
associate-*l*57.1%
associate-*l*57.1%
cos-neg57.1%
distribute-rgt-neg-out57.1%
distribute-frac-neg57.1%
neg-mul-157.1%
associate-/l*56.7%
associate-*r/56.9%
associate-/r/57.1%
associate-/l*57.1%
metadata-eval57.1%
Simplified57.1%
sin-cos-mult57.0%
associate-*r/57.0%
Applied egg-rr58.8%
*-commutative58.8%
associate-/l*58.8%
associate-/r/58.8%
Simplified57.5%
if 4.00000000000000006e240 < (pow.f64 a 2) Initial program 38.8%
Simplified39.0%
unpow239.0%
unpow239.0%
difference-of-squares49.4%
Applied egg-rr49.4%
Taylor expanded in angle around inf 51.4%
*-commutative51.4%
Simplified51.4%
Taylor expanded in angle around inf 49.1%
associate-*r*51.6%
*-commutative51.6%
*-commutative51.6%
Simplified51.6%
Taylor expanded in angle around 0 52.8%
associate-*r*52.8%
*-commutative52.8%
*-commutative52.8%
Simplified52.8%
Final simplification55.9%
NOTE: a should be positive before calling this function
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (* angle (* PI -0.005555555555555556))) (t_1 (* (+ a b) (- a b))))
(if (<= b 9e+184)
(* 2.0 (* t_1 (* (cos t_0) (sin t_0))))
(*
(* (cos (* PI (* angle -0.005555555555555556))) t_1)
(* 2.0 (* -0.005555555555555556 (* angle PI)))))))a = abs(a);
double code(double a, double b, double angle) {
double t_0 = angle * (((double) M_PI) * -0.005555555555555556);
double t_1 = (a + b) * (a - b);
double tmp;
if (b <= 9e+184) {
tmp = 2.0 * (t_1 * (cos(t_0) * sin(t_0)));
} else {
tmp = (cos((((double) M_PI) * (angle * -0.005555555555555556))) * t_1) * (2.0 * (-0.005555555555555556 * (angle * ((double) M_PI))));
}
return tmp;
}
a = Math.abs(a);
public static double code(double a, double b, double angle) {
double t_0 = angle * (Math.PI * -0.005555555555555556);
double t_1 = (a + b) * (a - b);
double tmp;
if (b <= 9e+184) {
tmp = 2.0 * (t_1 * (Math.cos(t_0) * Math.sin(t_0)));
} else {
tmp = (Math.cos((Math.PI * (angle * -0.005555555555555556))) * t_1) * (2.0 * (-0.005555555555555556 * (angle * Math.PI)));
}
return tmp;
}
a = abs(a) def code(a, b, angle): t_0 = angle * (math.pi * -0.005555555555555556) t_1 = (a + b) * (a - b) tmp = 0 if b <= 9e+184: tmp = 2.0 * (t_1 * (math.cos(t_0) * math.sin(t_0))) else: tmp = (math.cos((math.pi * (angle * -0.005555555555555556))) * t_1) * (2.0 * (-0.005555555555555556 * (angle * math.pi))) return tmp
a = abs(a) function code(a, b, angle) t_0 = Float64(angle * Float64(pi * -0.005555555555555556)) t_1 = Float64(Float64(a + b) * Float64(a - b)) tmp = 0.0 if (b <= 9e+184) tmp = Float64(2.0 * Float64(t_1 * Float64(cos(t_0) * sin(t_0)))); else tmp = Float64(Float64(cos(Float64(pi * Float64(angle * -0.005555555555555556))) * t_1) * Float64(2.0 * Float64(-0.005555555555555556 * Float64(angle * pi)))); end return tmp end
a = abs(a) function tmp_2 = code(a, b, angle) t_0 = angle * (pi * -0.005555555555555556); t_1 = (a + b) * (a - b); tmp = 0.0; if (b <= 9e+184) tmp = 2.0 * (t_1 * (cos(t_0) * sin(t_0))); else tmp = (cos((pi * (angle * -0.005555555555555556))) * t_1) * (2.0 * (-0.005555555555555556 * (angle * pi))); end tmp_2 = tmp; end
NOTE: a should be positive before calling this function
code[a_, b_, angle_] := Block[{t$95$0 = N[(angle * N[(Pi * -0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(a + b), $MachinePrecision] * N[(a - b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, 9e+184], N[(2.0 * N[(t$95$1 * N[(N[Cos[t$95$0], $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Cos[N[(Pi * N[(angle * -0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision] * N[(2.0 * N[(-0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
a = |a|\\
\\
\begin{array}{l}
t_0 := angle \cdot \left(\pi \cdot -0.005555555555555556\right)\\
t_1 := \left(a + b\right) \cdot \left(a - b\right)\\
\mathbf{if}\;b \leq 9 \cdot 10^{+184}:\\
\;\;\;\;2 \cdot \left(t_1 \cdot \left(\cos t_0 \cdot \sin t_0\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\cos \left(\pi \cdot \left(angle \cdot -0.005555555555555556\right)\right) \cdot t_1\right) \cdot \left(2 \cdot \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\\
\end{array}
\end{array}
if b < 9.00000000000000072e184Initial program 53.9%
Simplified53.9%
unpow253.9%
unpow253.9%
difference-of-squares55.7%
Applied egg-rr55.7%
add-cbrt-cube55.9%
pow355.9%
Applied egg-rr56.0%
Taylor expanded in angle around inf 55.5%
associate-*r*55.5%
*-commutative55.5%
associate-*l*56.4%
*-commutative56.4%
associate-*l*55.7%
Simplified55.7%
if 9.00000000000000072e184 < b Initial program 19.2%
Simplified19.2%
unpow219.2%
unpow219.2%
difference-of-squares40.9%
Applied egg-rr40.9%
Taylor expanded in angle around inf 40.9%
*-commutative40.9%
Simplified40.9%
Taylor expanded in angle around inf 45.3%
associate-*r*45.3%
*-commutative45.3%
*-commutative45.3%
Simplified45.3%
Taylor expanded in angle around 0 54.0%
Final simplification55.5%
NOTE: a should be positive before calling this function
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (* (+ a b) (- a b))) (t_1 (* angle (/ PI -180.0))))
(if (<= b 1e+186)
(* (* 2.0 (sin t_1)) (* t_0 (cos t_1)))
(*
(* (cos (* PI (* angle -0.005555555555555556))) t_0)
(* 2.0 (* -0.005555555555555556 (* angle PI)))))))a = abs(a);
double code(double a, double b, double angle) {
double t_0 = (a + b) * (a - b);
double t_1 = angle * (((double) M_PI) / -180.0);
double tmp;
if (b <= 1e+186) {
tmp = (2.0 * sin(t_1)) * (t_0 * cos(t_1));
} else {
tmp = (cos((((double) M_PI) * (angle * -0.005555555555555556))) * t_0) * (2.0 * (-0.005555555555555556 * (angle * ((double) M_PI))));
}
return tmp;
}
a = Math.abs(a);
public static double code(double a, double b, double angle) {
double t_0 = (a + b) * (a - b);
double t_1 = angle * (Math.PI / -180.0);
double tmp;
if (b <= 1e+186) {
tmp = (2.0 * Math.sin(t_1)) * (t_0 * Math.cos(t_1));
} else {
tmp = (Math.cos((Math.PI * (angle * -0.005555555555555556))) * t_0) * (2.0 * (-0.005555555555555556 * (angle * Math.PI)));
}
return tmp;
}
a = abs(a) def code(a, b, angle): t_0 = (a + b) * (a - b) t_1 = angle * (math.pi / -180.0) tmp = 0 if b <= 1e+186: tmp = (2.0 * math.sin(t_1)) * (t_0 * math.cos(t_1)) else: tmp = (math.cos((math.pi * (angle * -0.005555555555555556))) * t_0) * (2.0 * (-0.005555555555555556 * (angle * math.pi))) return tmp
a = abs(a) function code(a, b, angle) t_0 = Float64(Float64(a + b) * Float64(a - b)) t_1 = Float64(angle * Float64(pi / -180.0)) tmp = 0.0 if (b <= 1e+186) tmp = Float64(Float64(2.0 * sin(t_1)) * Float64(t_0 * cos(t_1))); else tmp = Float64(Float64(cos(Float64(pi * Float64(angle * -0.005555555555555556))) * t_0) * Float64(2.0 * Float64(-0.005555555555555556 * Float64(angle * pi)))); end return tmp end
a = abs(a) function tmp_2 = code(a, b, angle) t_0 = (a + b) * (a - b); t_1 = angle * (pi / -180.0); tmp = 0.0; if (b <= 1e+186) tmp = (2.0 * sin(t_1)) * (t_0 * cos(t_1)); else tmp = (cos((pi * (angle * -0.005555555555555556))) * t_0) * (2.0 * (-0.005555555555555556 * (angle * pi))); end tmp_2 = tmp; end
NOTE: a should be positive before calling this function
code[a_, b_, angle_] := Block[{t$95$0 = N[(N[(a + b), $MachinePrecision] * N[(a - b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(angle * N[(Pi / -180.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, 1e+186], N[(N[(2.0 * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision] * N[(t$95$0 * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Cos[N[(Pi * N[(angle * -0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision] * N[(2.0 * N[(-0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
a = |a|\\
\\
\begin{array}{l}
t_0 := \left(a + b\right) \cdot \left(a - b\right)\\
t_1 := angle \cdot \frac{\pi}{-180}\\
\mathbf{if}\;b \leq 10^{+186}:\\
\;\;\;\;\left(2 \cdot \sin t_1\right) \cdot \left(t_0 \cdot \cos t_1\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\cos \left(\pi \cdot \left(angle \cdot -0.005555555555555556\right)\right) \cdot t_0\right) \cdot \left(2 \cdot \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\\
\end{array}
\end{array}
if b < 9.9999999999999998e185Initial program 53.9%
Simplified53.9%
unpow253.9%
unpow253.9%
difference-of-squares55.7%
Applied egg-rr55.7%
if 9.9999999999999998e185 < b Initial program 19.2%
Simplified19.2%
unpow219.2%
unpow219.2%
difference-of-squares40.9%
Applied egg-rr40.9%
Taylor expanded in angle around inf 40.9%
*-commutative40.9%
Simplified40.9%
Taylor expanded in angle around inf 45.3%
associate-*r*45.3%
*-commutative45.3%
*-commutative45.3%
Simplified45.3%
Taylor expanded in angle around 0 54.0%
Final simplification55.5%
NOTE: a should be positive before calling this function
(FPCore (a b angle)
:precision binary64
(let* ((t_0
(* (cos (* PI (* angle -0.005555555555555556))) (* (+ a b) (- a b)))))
(if (<= b 4e+184)
(* t_0 (* 2.0 (sin (* angle (/ PI -180.0)))))
(* t_0 (* 2.0 (* -0.005555555555555556 (* angle PI)))))))a = abs(a);
double code(double a, double b, double angle) {
double t_0 = cos((((double) M_PI) * (angle * -0.005555555555555556))) * ((a + b) * (a - b));
double tmp;
if (b <= 4e+184) {
tmp = t_0 * (2.0 * sin((angle * (((double) M_PI) / -180.0))));
} else {
tmp = t_0 * (2.0 * (-0.005555555555555556 * (angle * ((double) M_PI))));
}
return tmp;
}
a = Math.abs(a);
public static double code(double a, double b, double angle) {
double t_0 = Math.cos((Math.PI * (angle * -0.005555555555555556))) * ((a + b) * (a - b));
double tmp;
if (b <= 4e+184) {
tmp = t_0 * (2.0 * Math.sin((angle * (Math.PI / -180.0))));
} else {
tmp = t_0 * (2.0 * (-0.005555555555555556 * (angle * Math.PI)));
}
return tmp;
}
a = abs(a) def code(a, b, angle): t_0 = math.cos((math.pi * (angle * -0.005555555555555556))) * ((a + b) * (a - b)) tmp = 0 if b <= 4e+184: tmp = t_0 * (2.0 * math.sin((angle * (math.pi / -180.0)))) else: tmp = t_0 * (2.0 * (-0.005555555555555556 * (angle * math.pi))) return tmp
a = abs(a) function code(a, b, angle) t_0 = Float64(cos(Float64(pi * Float64(angle * -0.005555555555555556))) * Float64(Float64(a + b) * Float64(a - b))) tmp = 0.0 if (b <= 4e+184) tmp = Float64(t_0 * Float64(2.0 * sin(Float64(angle * Float64(pi / -180.0))))); else tmp = Float64(t_0 * Float64(2.0 * Float64(-0.005555555555555556 * Float64(angle * pi)))); end return tmp end
a = abs(a) function tmp_2 = code(a, b, angle) t_0 = cos((pi * (angle * -0.005555555555555556))) * ((a + b) * (a - b)); tmp = 0.0; if (b <= 4e+184) tmp = t_0 * (2.0 * sin((angle * (pi / -180.0)))); else tmp = t_0 * (2.0 * (-0.005555555555555556 * (angle * pi))); end tmp_2 = tmp; end
NOTE: a should be positive before calling this function
code[a_, b_, angle_] := Block[{t$95$0 = N[(N[Cos[N[(Pi * N[(angle * -0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(a + b), $MachinePrecision] * N[(a - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, 4e+184], N[(t$95$0 * N[(2.0 * N[Sin[N[(angle * N[(Pi / -180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(2.0 * N[(-0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
a = |a|\\
\\
\begin{array}{l}
t_0 := \cos \left(\pi \cdot \left(angle \cdot -0.005555555555555556\right)\right) \cdot \left(\left(a + b\right) \cdot \left(a - b\right)\right)\\
\mathbf{if}\;b \leq 4 \cdot 10^{+184}:\\
\;\;\;\;t_0 \cdot \left(2 \cdot \sin \left(angle \cdot \frac{\pi}{-180}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_0 \cdot \left(2 \cdot \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\\
\end{array}
\end{array}
if b < 4.00000000000000007e184Initial program 53.9%
Simplified53.9%
unpow253.9%
unpow253.9%
difference-of-squares55.7%
Applied egg-rr55.7%
Taylor expanded in angle around inf 55.4%
associate-*r*56.4%
*-commutative56.4%
*-commutative56.4%
Simplified56.4%
if 4.00000000000000007e184 < b Initial program 19.2%
Simplified19.2%
unpow219.2%
unpow219.2%
difference-of-squares40.9%
Applied egg-rr40.9%
Taylor expanded in angle around inf 40.9%
*-commutative40.9%
Simplified40.9%
Taylor expanded in angle around inf 45.3%
associate-*r*45.3%
*-commutative45.3%
*-commutative45.3%
Simplified45.3%
Taylor expanded in angle around 0 54.0%
Final simplification56.2%
NOTE: a should be positive before calling this function (FPCore (a b angle) :precision binary64 (let* ((t_0 (* PI (* angle -0.005555555555555556)))) (* (* (cos t_0) (* (+ a b) (- a b))) (* 2.0 (sin t_0)))))
a = abs(a);
double code(double a, double b, double angle) {
double t_0 = ((double) M_PI) * (angle * -0.005555555555555556);
return (cos(t_0) * ((a + b) * (a - b))) * (2.0 * sin(t_0));
}
a = Math.abs(a);
public static double code(double a, double b, double angle) {
double t_0 = Math.PI * (angle * -0.005555555555555556);
return (Math.cos(t_0) * ((a + b) * (a - b))) * (2.0 * Math.sin(t_0));
}
a = abs(a) def code(a, b, angle): t_0 = math.pi * (angle * -0.005555555555555556) return (math.cos(t_0) * ((a + b) * (a - b))) * (2.0 * math.sin(t_0))
a = abs(a) function code(a, b, angle) t_0 = Float64(pi * Float64(angle * -0.005555555555555556)) return Float64(Float64(cos(t_0) * Float64(Float64(a + b) * Float64(a - b))) * Float64(2.0 * sin(t_0))) end
a = abs(a) function tmp = code(a, b, angle) t_0 = pi * (angle * -0.005555555555555556); tmp = (cos(t_0) * ((a + b) * (a - b))) * (2.0 * sin(t_0)); end
NOTE: a should be positive before calling this function
code[a_, b_, angle_] := Block[{t$95$0 = N[(Pi * N[(angle * -0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[Cos[t$95$0], $MachinePrecision] * N[(N[(a + b), $MachinePrecision] * N[(a - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
a = |a|\\
\\
\begin{array}{l}
t_0 := \pi \cdot \left(angle \cdot -0.005555555555555556\right)\\
\left(\cos t_0 \cdot \left(\left(a + b\right) \cdot \left(a - b\right)\right)\right) \cdot \left(2 \cdot \sin t_0\right)
\end{array}
\end{array}
Initial program 50.8%
Simplified50.8%
unpow250.8%
unpow250.8%
difference-of-squares54.4%
Applied egg-rr54.4%
Taylor expanded in angle around inf 55.0%
*-commutative55.0%
Simplified55.0%
Taylor expanded in angle around inf 54.6%
associate-*r*55.4%
*-commutative55.4%
*-commutative55.4%
Simplified55.4%
Taylor expanded in angle around inf 55.4%
associate-*r*55.5%
*-commutative55.5%
*-commutative55.5%
Simplified55.5%
Final simplification55.5%
NOTE: a should be positive before calling this function
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (* (+ a b) (- a b))) (t_1 (* -0.005555555555555556 (* angle PI))))
(if (<= b 5e+162)
(* t_0 (* 2.0 (sin t_1)))
(* (* (cos (* PI (* angle -0.005555555555555556))) t_0) (* 2.0 t_1)))))a = abs(a);
double code(double a, double b, double angle) {
double t_0 = (a + b) * (a - b);
double t_1 = -0.005555555555555556 * (angle * ((double) M_PI));
double tmp;
if (b <= 5e+162) {
tmp = t_0 * (2.0 * sin(t_1));
} else {
tmp = (cos((((double) M_PI) * (angle * -0.005555555555555556))) * t_0) * (2.0 * t_1);
}
return tmp;
}
a = Math.abs(a);
public static double code(double a, double b, double angle) {
double t_0 = (a + b) * (a - b);
double t_1 = -0.005555555555555556 * (angle * Math.PI);
double tmp;
if (b <= 5e+162) {
tmp = t_0 * (2.0 * Math.sin(t_1));
} else {
tmp = (Math.cos((Math.PI * (angle * -0.005555555555555556))) * t_0) * (2.0 * t_1);
}
return tmp;
}
a = abs(a) def code(a, b, angle): t_0 = (a + b) * (a - b) t_1 = -0.005555555555555556 * (angle * math.pi) tmp = 0 if b <= 5e+162: tmp = t_0 * (2.0 * math.sin(t_1)) else: tmp = (math.cos((math.pi * (angle * -0.005555555555555556))) * t_0) * (2.0 * t_1) return tmp
a = abs(a) function code(a, b, angle) t_0 = Float64(Float64(a + b) * Float64(a - b)) t_1 = Float64(-0.005555555555555556 * Float64(angle * pi)) tmp = 0.0 if (b <= 5e+162) tmp = Float64(t_0 * Float64(2.0 * sin(t_1))); else tmp = Float64(Float64(cos(Float64(pi * Float64(angle * -0.005555555555555556))) * t_0) * Float64(2.0 * t_1)); end return tmp end
a = abs(a) function tmp_2 = code(a, b, angle) t_0 = (a + b) * (a - b); t_1 = -0.005555555555555556 * (angle * pi); tmp = 0.0; if (b <= 5e+162) tmp = t_0 * (2.0 * sin(t_1)); else tmp = (cos((pi * (angle * -0.005555555555555556))) * t_0) * (2.0 * t_1); end tmp_2 = tmp; end
NOTE: a should be positive before calling this function
code[a_, b_, angle_] := Block[{t$95$0 = N[(N[(a + b), $MachinePrecision] * N[(a - b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(-0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, 5e+162], N[(t$95$0 * N[(2.0 * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Cos[N[(Pi * N[(angle * -0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision] * N[(2.0 * t$95$1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
a = |a|\\
\\
\begin{array}{l}
t_0 := \left(a + b\right) \cdot \left(a - b\right)\\
t_1 := -0.005555555555555556 \cdot \left(angle \cdot \pi\right)\\
\mathbf{if}\;b \leq 5 \cdot 10^{+162}:\\
\;\;\;\;t_0 \cdot \left(2 \cdot \sin t_1\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\cos \left(\pi \cdot \left(angle \cdot -0.005555555555555556\right)\right) \cdot t_0\right) \cdot \left(2 \cdot t_1\right)\\
\end{array}
\end{array}
if b < 4.9999999999999997e162Initial program 54.6%
Simplified54.6%
unpow254.6%
unpow254.6%
difference-of-squares56.0%
Applied egg-rr56.0%
Taylor expanded in angle around inf 56.7%
*-commutative56.7%
Simplified56.7%
Taylor expanded in angle around 0 55.6%
if 4.9999999999999997e162 < b Initial program 19.7%
Simplified19.7%
unpow219.7%
unpow219.7%
difference-of-squares41.1%
Applied egg-rr41.1%
Taylor expanded in angle around inf 41.1%
*-commutative41.1%
Simplified41.1%
Taylor expanded in angle around inf 44.7%
associate-*r*44.7%
*-commutative44.7%
*-commutative44.7%
Simplified44.7%
Taylor expanded in angle around 0 44.7%
Final simplification54.4%
NOTE: a should be positive before calling this function
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (* (+ a b) (- a b))))
(if (<= (pow b 2.0) 1e+290)
(* t_0 (* 2.0 (sin (* -0.005555555555555556 (* angle PI)))))
(* -0.011111111111111112 (* angle (* PI t_0))))))a = abs(a);
double code(double a, double b, double angle) {
double t_0 = (a + b) * (a - b);
double tmp;
if (pow(b, 2.0) <= 1e+290) {
tmp = t_0 * (2.0 * sin((-0.005555555555555556 * (angle * ((double) M_PI)))));
} else {
tmp = -0.011111111111111112 * (angle * (((double) M_PI) * t_0));
}
return tmp;
}
a = Math.abs(a);
public static double code(double a, double b, double angle) {
double t_0 = (a + b) * (a - b);
double tmp;
if (Math.pow(b, 2.0) <= 1e+290) {
tmp = t_0 * (2.0 * Math.sin((-0.005555555555555556 * (angle * Math.PI))));
} else {
tmp = -0.011111111111111112 * (angle * (Math.PI * t_0));
}
return tmp;
}
a = abs(a) def code(a, b, angle): t_0 = (a + b) * (a - b) tmp = 0 if math.pow(b, 2.0) <= 1e+290: tmp = t_0 * (2.0 * math.sin((-0.005555555555555556 * (angle * math.pi)))) else: tmp = -0.011111111111111112 * (angle * (math.pi * t_0)) return tmp
a = abs(a) function code(a, b, angle) t_0 = Float64(Float64(a + b) * Float64(a - b)) tmp = 0.0 if ((b ^ 2.0) <= 1e+290) tmp = Float64(t_0 * Float64(2.0 * sin(Float64(-0.005555555555555556 * Float64(angle * pi))))); else tmp = Float64(-0.011111111111111112 * Float64(angle * Float64(pi * t_0))); end return tmp end
a = abs(a) function tmp_2 = code(a, b, angle) t_0 = (a + b) * (a - b); tmp = 0.0; if ((b ^ 2.0) <= 1e+290) tmp = t_0 * (2.0 * sin((-0.005555555555555556 * (angle * pi)))); else tmp = -0.011111111111111112 * (angle * (pi * t_0)); end tmp_2 = tmp; end
NOTE: a should be positive before calling this function
code[a_, b_, angle_] := Block[{t$95$0 = N[(N[(a + b), $MachinePrecision] * N[(a - b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Power[b, 2.0], $MachinePrecision], 1e+290], N[(t$95$0 * N[(2.0 * N[Sin[N[(-0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-0.011111111111111112 * N[(angle * N[(Pi * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
a = |a|\\
\\
\begin{array}{l}
t_0 := \left(a + b\right) \cdot \left(a - b\right)\\
\mathbf{if}\;{b}^{2} \leq 10^{+290}:\\
\;\;\;\;t_0 \cdot \left(2 \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;-0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot t_0\right)\right)\\
\end{array}
\end{array}
if (pow.f64 b 2) < 1.00000000000000006e290Initial program 56.4%
Simplified57.0%
unpow257.0%
unpow257.0%
difference-of-squares57.0%
Applied egg-rr57.0%
Taylor expanded in angle around inf 57.4%
*-commutative57.4%
Simplified57.4%
Taylor expanded in angle around 0 56.6%
if 1.00000000000000006e290 < (pow.f64 b 2) Initial program 36.4%
Simplified35.0%
unpow235.0%
unpow235.0%
difference-of-squares47.6%
Applied egg-rr47.6%
Taylor expanded in angle around 0 51.9%
Final simplification55.3%
NOTE: a should be positive before calling this function
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (* (+ a b) (- a b))))
(if (<= b 9.5e+144)
(* t_0 (* 2.0 (sin (* -0.005555555555555556 (* angle PI)))))
(* -0.011111111111111112 (* angle (* (cbrt (pow PI 3.0)) t_0))))))a = abs(a);
double code(double a, double b, double angle) {
double t_0 = (a + b) * (a - b);
double tmp;
if (b <= 9.5e+144) {
tmp = t_0 * (2.0 * sin((-0.005555555555555556 * (angle * ((double) M_PI)))));
} else {
tmp = -0.011111111111111112 * (angle * (cbrt(pow(((double) M_PI), 3.0)) * t_0));
}
return tmp;
}
a = Math.abs(a);
public static double code(double a, double b, double angle) {
double t_0 = (a + b) * (a - b);
double tmp;
if (b <= 9.5e+144) {
tmp = t_0 * (2.0 * Math.sin((-0.005555555555555556 * (angle * Math.PI))));
} else {
tmp = -0.011111111111111112 * (angle * (Math.cbrt(Math.pow(Math.PI, 3.0)) * t_0));
}
return tmp;
}
a = abs(a) function code(a, b, angle) t_0 = Float64(Float64(a + b) * Float64(a - b)) tmp = 0.0 if (b <= 9.5e+144) tmp = Float64(t_0 * Float64(2.0 * sin(Float64(-0.005555555555555556 * Float64(angle * pi))))); else tmp = Float64(-0.011111111111111112 * Float64(angle * Float64(cbrt((pi ^ 3.0)) * t_0))); end return tmp end
NOTE: a should be positive before calling this function
code[a_, b_, angle_] := Block[{t$95$0 = N[(N[(a + b), $MachinePrecision] * N[(a - b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, 9.5e+144], N[(t$95$0 * N[(2.0 * N[Sin[N[(-0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-0.011111111111111112 * N[(angle * N[(N[Power[N[Power[Pi, 3.0], $MachinePrecision], 1/3], $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
a = |a|\\
\\
\begin{array}{l}
t_0 := \left(a + b\right) \cdot \left(a - b\right)\\
\mathbf{if}\;b \leq 9.5 \cdot 10^{+144}:\\
\;\;\;\;t_0 \cdot \left(2 \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;-0.011111111111111112 \cdot \left(angle \cdot \left(\sqrt[3]{{\pi}^{3}} \cdot t_0\right)\right)\\
\end{array}
\end{array}
if b < 9.50000000000000031e144Initial program 55.1%
Simplified55.1%
unpow255.1%
unpow255.1%
difference-of-squares56.5%
Applied egg-rr56.5%
Taylor expanded in angle around inf 57.2%
*-commutative57.2%
Simplified57.2%
Taylor expanded in angle around 0 56.1%
if 9.50000000000000031e144 < b Initial program 20.8%
Simplified20.8%
unpow220.8%
unpow220.8%
difference-of-squares39.5%
Applied egg-rr39.5%
Taylor expanded in angle around 0 39.8%
add-cbrt-cube52.6%
pow352.6%
Applied egg-rr39.8%
Final simplification54.1%
NOTE: a should be positive before calling this function (FPCore (a b angle) :precision binary64 (* -0.011111111111111112 (* angle (* PI (* (+ a b) (- a b))))))
a = abs(a);
double code(double a, double b, double angle) {
return -0.011111111111111112 * (angle * (((double) M_PI) * ((a + b) * (a - b))));
}
a = Math.abs(a);
public static double code(double a, double b, double angle) {
return -0.011111111111111112 * (angle * (Math.PI * ((a + b) * (a - b))));
}
a = abs(a) def code(a, b, angle): return -0.011111111111111112 * (angle * (math.pi * ((a + b) * (a - b))))
a = abs(a) function code(a, b, angle) return Float64(-0.011111111111111112 * Float64(angle * Float64(pi * Float64(Float64(a + b) * Float64(a - b))))) end
a = abs(a) function tmp = code(a, b, angle) tmp = -0.011111111111111112 * (angle * (pi * ((a + b) * (a - b)))); end
NOTE: a should be positive before calling this function code[a_, b_, angle_] := N[(-0.011111111111111112 * N[(angle * N[(Pi * N[(N[(a + b), $MachinePrecision] * N[(a - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
a = |a|\\
\\
-0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(\left(a + b\right) \cdot \left(a - b\right)\right)\right)\right)
\end{array}
Initial program 50.8%
Simplified50.8%
unpow250.8%
unpow250.8%
difference-of-squares54.4%
Applied egg-rr54.4%
Taylor expanded in angle around 0 53.3%
Final simplification53.3%
NOTE: a should be positive before calling this function (FPCore (a b angle) :precision binary64 (* -0.011111111111111112 (* (* (+ a b) (- a b)) (* angle PI))))
a = abs(a);
double code(double a, double b, double angle) {
return -0.011111111111111112 * (((a + b) * (a - b)) * (angle * ((double) M_PI)));
}
a = Math.abs(a);
public static double code(double a, double b, double angle) {
return -0.011111111111111112 * (((a + b) * (a - b)) * (angle * Math.PI));
}
a = abs(a) def code(a, b, angle): return -0.011111111111111112 * (((a + b) * (a - b)) * (angle * math.pi))
a = abs(a) function code(a, b, angle) return Float64(-0.011111111111111112 * Float64(Float64(Float64(a + b) * Float64(a - b)) * Float64(angle * pi))) end
a = abs(a) function tmp = code(a, b, angle) tmp = -0.011111111111111112 * (((a + b) * (a - b)) * (angle * pi)); end
NOTE: a should be positive before calling this function code[a_, b_, angle_] := N[(-0.011111111111111112 * N[(N[(N[(a + b), $MachinePrecision] * N[(a - b), $MachinePrecision]), $MachinePrecision] * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
a = |a|\\
\\
-0.011111111111111112 \cdot \left(\left(\left(a + b\right) \cdot \left(a - b\right)\right) \cdot \left(angle \cdot \pi\right)\right)
\end{array}
Initial program 50.8%
Simplified50.8%
unpow250.8%
unpow250.8%
difference-of-squares54.4%
Applied egg-rr54.4%
add-cbrt-cube56.1%
pow356.1%
Applied egg-rr55.8%
Taylor expanded in angle around 0 53.3%
associate-*r*53.3%
*-commutative53.3%
Simplified53.3%
Final simplification53.3%
herbie shell --seed 2023318
(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)))))