
(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 18 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 (* 2.0 (- b a)))
(t_1 (sin (* PI (* 0.005555555555555556 angle)))))
(if (<= a 2e+176)
(* t_0 (* (* t_1 (cos (* 0.005555555555555556 (* PI angle)))) (+ a b)))
(*
t_0
(*
(+ a b)
(*
t_1
(cos (* (* 0.005555555555555556 angle) (cbrt (* PI (* PI PI)))))))))))a = abs(a);
b = abs(b);
double code(double a, double b, double angle) {
double t_0 = 2.0 * (b - a);
double t_1 = sin((((double) M_PI) * (0.005555555555555556 * angle)));
double tmp;
if (a <= 2e+176) {
tmp = t_0 * ((t_1 * cos((0.005555555555555556 * (((double) M_PI) * angle)))) * (a + b));
} else {
tmp = t_0 * ((a + b) * (t_1 * cos(((0.005555555555555556 * angle) * cbrt((((double) M_PI) * (((double) M_PI) * ((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 = 2.0 * (b - a);
double t_1 = Math.sin((Math.PI * (0.005555555555555556 * angle)));
double tmp;
if (a <= 2e+176) {
tmp = t_0 * ((t_1 * Math.cos((0.005555555555555556 * (Math.PI * angle)))) * (a + b));
} else {
tmp = t_0 * ((a + b) * (t_1 * Math.cos(((0.005555555555555556 * angle) * Math.cbrt((Math.PI * (Math.PI * Math.PI)))))));
}
return tmp;
}
a = abs(a) b = abs(b) function code(a, b, angle) t_0 = Float64(2.0 * Float64(b - a)) t_1 = sin(Float64(pi * Float64(0.005555555555555556 * angle))) tmp = 0.0 if (a <= 2e+176) tmp = Float64(t_0 * Float64(Float64(t_1 * cos(Float64(0.005555555555555556 * Float64(pi * angle)))) * Float64(a + b))); else tmp = Float64(t_0 * Float64(Float64(a + b) * Float64(t_1 * cos(Float64(Float64(0.005555555555555556 * angle) * cbrt(Float64(pi * Float64(pi * 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[(2.0 * N[(b - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sin[N[(Pi * N[(0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[a, 2e+176], N[(t$95$0 * N[(N[(t$95$1 * N[Cos[N[(0.005555555555555556 * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(a + b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(N[(a + b), $MachinePrecision] * N[(t$95$1 * N[Cos[N[(N[(0.005555555555555556 * angle), $MachinePrecision] * N[Power[N[(Pi * N[(Pi * Pi), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
a = |a|\\
b = |b|\\
\\
\begin{array}{l}
t_0 := 2 \cdot \left(b - a\right)\\
t_1 := \sin \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right)\\
\mathbf{if}\;a \leq 2 \cdot 10^{+176}:\\
\;\;\;\;t_0 \cdot \left(\left(t_1 \cdot \cos \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)\right) \cdot \left(a + b\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_0 \cdot \left(\left(a + b\right) \cdot \left(t_1 \cdot \cos \left(\left(0.005555555555555556 \cdot angle\right) \cdot \sqrt[3]{\pi \cdot \left(\pi \cdot \pi\right)}\right)\right)\right)\\
\end{array}
\end{array}
if a < 2e176Initial program 57.6%
associate-*l*57.6%
unpow257.6%
unpow257.6%
difference-of-squares59.5%
Simplified59.5%
Taylor expanded in angle around inf 66.0%
associate-*r*66.0%
associate-*r*66.0%
*-commutative66.0%
associate-*r*67.1%
*-commutative67.1%
*-commutative67.1%
*-commutative67.1%
associate-*r*67.2%
*-commutative67.2%
*-commutative67.2%
*-commutative67.2%
Simplified67.2%
Taylor expanded in angle around inf 67.1%
if 2e176 < a Initial program 50.2%
associate-*l*50.2%
unpow250.2%
unpow250.2%
difference-of-squares53.8%
Simplified53.8%
Taylor expanded in angle around inf 90.0%
associate-*r*90.0%
associate-*r*90.0%
*-commutative90.0%
associate-*r*89.9%
*-commutative89.9%
*-commutative89.9%
*-commutative89.9%
associate-*r*86.7%
*-commutative86.7%
*-commutative86.7%
*-commutative86.7%
Simplified86.7%
add-cbrt-cube93.1%
Applied egg-rr93.1%
Final simplification70.3%
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 180.0))))
(if (<= (/ angle 180.0) -1.45e+218)
(* 0.011111111111111112 (* angle (* PI (pow (+ a b) 2.0))))
(if (<= (/ angle 180.0) 2e-9)
(*
(* 2.0 (- b a))
(*
(+ a b)
(*
(* angle (* PI 0.005555555555555556))
(cos (* PI (* 0.005555555555555556 angle))))))
(if (<= (/ angle 180.0) 4e+112)
(*
(* (sin (* 0.005555555555555556 (* PI angle))) (* 2.0 (* b b)))
(cos t_0))
(* 2.0 (* (* (- b a) (+ a b)) (sin t_0))))))))a = abs(a);
b = abs(b);
double code(double a, double b, double angle) {
double t_0 = ((double) M_PI) * (angle / 180.0);
double tmp;
if ((angle / 180.0) <= -1.45e+218) {
tmp = 0.011111111111111112 * (angle * (((double) M_PI) * pow((a + b), 2.0)));
} else if ((angle / 180.0) <= 2e-9) {
tmp = (2.0 * (b - a)) * ((a + b) * ((angle * (((double) M_PI) * 0.005555555555555556)) * cos((((double) M_PI) * (0.005555555555555556 * angle)))));
} else if ((angle / 180.0) <= 4e+112) {
tmp = (sin((0.005555555555555556 * (((double) M_PI) * angle))) * (2.0 * (b * b))) * cos(t_0);
} else {
tmp = 2.0 * (((b - a) * (a + b)) * sin(t_0));
}
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 / 180.0);
double tmp;
if ((angle / 180.0) <= -1.45e+218) {
tmp = 0.011111111111111112 * (angle * (Math.PI * Math.pow((a + b), 2.0)));
} else if ((angle / 180.0) <= 2e-9) {
tmp = (2.0 * (b - a)) * ((a + b) * ((angle * (Math.PI * 0.005555555555555556)) * Math.cos((Math.PI * (0.005555555555555556 * angle)))));
} else if ((angle / 180.0) <= 4e+112) {
tmp = (Math.sin((0.005555555555555556 * (Math.PI * angle))) * (2.0 * (b * b))) * Math.cos(t_0);
} else {
tmp = 2.0 * (((b - a) * (a + b)) * Math.sin(t_0));
}
return tmp;
}
a = abs(a) b = abs(b) def code(a, b, angle): t_0 = math.pi * (angle / 180.0) tmp = 0 if (angle / 180.0) <= -1.45e+218: tmp = 0.011111111111111112 * (angle * (math.pi * math.pow((a + b), 2.0))) elif (angle / 180.0) <= 2e-9: tmp = (2.0 * (b - a)) * ((a + b) * ((angle * (math.pi * 0.005555555555555556)) * math.cos((math.pi * (0.005555555555555556 * angle))))) elif (angle / 180.0) <= 4e+112: tmp = (math.sin((0.005555555555555556 * (math.pi * angle))) * (2.0 * (b * b))) * math.cos(t_0) else: tmp = 2.0 * (((b - a) * (a + b)) * math.sin(t_0)) return tmp
a = abs(a) b = abs(b) function code(a, b, angle) t_0 = Float64(pi * Float64(angle / 180.0)) tmp = 0.0 if (Float64(angle / 180.0) <= -1.45e+218) tmp = Float64(0.011111111111111112 * Float64(angle * Float64(pi * (Float64(a + b) ^ 2.0)))); elseif (Float64(angle / 180.0) <= 2e-9) tmp = Float64(Float64(2.0 * Float64(b - a)) * Float64(Float64(a + b) * Float64(Float64(angle * Float64(pi * 0.005555555555555556)) * cos(Float64(pi * Float64(0.005555555555555556 * angle)))))); elseif (Float64(angle / 180.0) <= 4e+112) tmp = Float64(Float64(sin(Float64(0.005555555555555556 * Float64(pi * angle))) * Float64(2.0 * Float64(b * b))) * cos(t_0)); else tmp = Float64(2.0 * Float64(Float64(Float64(b - a) * Float64(a + b)) * sin(t_0))); end return tmp end
a = abs(a) b = abs(b) function tmp_2 = code(a, b, angle) t_0 = pi * (angle / 180.0); tmp = 0.0; if ((angle / 180.0) <= -1.45e+218) tmp = 0.011111111111111112 * (angle * (pi * ((a + b) ^ 2.0))); elseif ((angle / 180.0) <= 2e-9) tmp = (2.0 * (b - a)) * ((a + b) * ((angle * (pi * 0.005555555555555556)) * cos((pi * (0.005555555555555556 * angle))))); elseif ((angle / 180.0) <= 4e+112) tmp = (sin((0.005555555555555556 * (pi * angle))) * (2.0 * (b * b))) * cos(t_0); else tmp = 2.0 * (((b - a) * (a + b)) * sin(t_0)); 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_] := Block[{t$95$0 = N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(angle / 180.0), $MachinePrecision], -1.45e+218], N[(0.011111111111111112 * N[(angle * N[(Pi * N[Power[N[(a + b), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle / 180.0), $MachinePrecision], 2e-9], N[(N[(2.0 * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[(N[(a + b), $MachinePrecision] * N[(N[(angle * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(Pi * N[(0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle / 180.0), $MachinePrecision], 4e+112], N[(N[(N[Sin[N[(0.005555555555555556 * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(2.0 * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[(b - a), $MachinePrecision] * N[(a + b), $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
a = |a|\\
b = |b|\\
\\
\begin{array}{l}
t_0 := \pi \cdot \frac{angle}{180}\\
\mathbf{if}\;\frac{angle}{180} \leq -1.45 \cdot 10^{+218}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot {\left(a + b\right)}^{2}\right)\right)\\
\mathbf{elif}\;\frac{angle}{180} \leq 2 \cdot 10^{-9}:\\
\;\;\;\;\left(2 \cdot \left(b - a\right)\right) \cdot \left(\left(a + b\right) \cdot \left(\left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right) \cdot \cos \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right)\right)\right)\\
\mathbf{elif}\;\frac{angle}{180} \leq 4 \cdot 10^{+112}:\\
\;\;\;\;\left(\sin \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right) \cdot \left(2 \cdot \left(b \cdot b\right)\right)\right) \cdot \cos t_0\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(\left(b - a\right) \cdot \left(a + b\right)\right) \cdot \sin t_0\right)\\
\end{array}
\end{array}
if (/.f64 angle 180) < -1.45e218Initial program 20.9%
*-commutative20.9%
associate-*l*20.9%
unpow220.9%
fma-neg25.1%
unpow225.1%
Simplified25.1%
Applied egg-rr34.5%
log-pow36.3%
+-commutative36.3%
sin-036.3%
+-lft-identity36.3%
associate-*l*36.3%
*-commutative36.3%
*-commutative36.3%
Simplified36.3%
Taylor expanded in angle around 0 43.9%
+-commutative43.9%
Simplified43.9%
if -1.45e218 < (/.f64 angle 180) < 2.00000000000000012e-9Initial program 70.6%
associate-*l*70.6%
unpow270.6%
unpow270.6%
difference-of-squares71.9%
Simplified71.9%
Taylor expanded in angle around inf 87.2%
associate-*r*87.2%
associate-*r*87.2%
*-commutative87.2%
associate-*r*86.2%
*-commutative86.2%
*-commutative86.2%
*-commutative86.2%
associate-*r*88.0%
*-commutative88.0%
*-commutative88.0%
*-commutative88.0%
Simplified88.0%
Taylor expanded in angle around 0 88.0%
associate-*r*88.0%
*-commutative88.0%
associate-*r*88.0%
*-commutative88.0%
*-commutative88.0%
Simplified88.0%
if 2.00000000000000012e-9 < (/.f64 angle 180) < 3.9999999999999997e112Initial program 45.6%
*-commutative45.6%
associate-*l*45.6%
unpow245.6%
fma-neg45.6%
unpow245.6%
distribute-rgt-neg-in45.6%
Simplified45.6%
Taylor expanded in b around inf 47.8%
unpow247.8%
associate-*r*47.8%
*-commutative47.8%
Simplified47.8%
if 3.9999999999999997e112 < (/.f64 angle 180) Initial program 26.5%
associate-*l*26.5%
associate-*l*26.5%
unpow226.5%
unpow226.5%
difference-of-squares29.1%
Simplified29.1%
Taylor expanded in angle around 0 34.3%
Final simplification71.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 (* PI angle)))) (* 2.0 (* (* (+ a b) (sin t_0)) (* (- b a) (cos t_0))))))
a = abs(a);
b = abs(b);
double code(double a, double b, double angle) {
double t_0 = 0.005555555555555556 * (((double) M_PI) * angle);
return 2.0 * (((a + b) * sin(t_0)) * ((b - a) * cos(t_0)));
}
a = Math.abs(a);
b = Math.abs(b);
public static double code(double a, double b, double angle) {
double t_0 = 0.005555555555555556 * (Math.PI * angle);
return 2.0 * (((a + b) * Math.sin(t_0)) * ((b - a) * Math.cos(t_0)));
}
a = abs(a) b = abs(b) def code(a, b, angle): t_0 = 0.005555555555555556 * (math.pi * angle) return 2.0 * (((a + b) * math.sin(t_0)) * ((b - a) * math.cos(t_0)))
a = abs(a) b = abs(b) function code(a, b, angle) t_0 = Float64(0.005555555555555556 * Float64(pi * angle)) return Float64(2.0 * Float64(Float64(Float64(a + b) * sin(t_0)) * Float64(Float64(b - a) * cos(t_0)))) end
a = abs(a) b = abs(b) function tmp = code(a, b, angle) t_0 = 0.005555555555555556 * (pi * angle); tmp = 2.0 * (((a + b) * sin(t_0)) * ((b - a) * cos(t_0))); 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[(Pi * angle), $MachinePrecision]), $MachinePrecision]}, N[(2.0 * N[(N[(N[(a + b), $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
a = |a|\\
b = |b|\\
\\
\begin{array}{l}
t_0 := 0.005555555555555556 \cdot \left(\pi \cdot angle\right)\\
2 \cdot \left(\left(\left(a + b\right) \cdot \sin t_0\right) \cdot \left(\left(b - a\right) \cdot \cos t_0\right)\right)
\end{array}
\end{array}
Initial program 56.8%
associate-*l*56.8%
associate-*l*56.7%
unpow256.7%
unpow256.7%
difference-of-squares58.8%
Simplified58.8%
Taylor expanded in angle around inf 68.9%
associate-*r*68.9%
*-commutative68.9%
*-commutative68.9%
Simplified68.9%
Final simplification68.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 (* angle (* PI 0.005555555555555556)))) (* 2.0 (* (- b a) (* (+ a b) (* (sin t_0) (cos t_0)))))))
a = abs(a);
b = abs(b);
double code(double a, double b, double angle) {
double t_0 = angle * (((double) M_PI) * 0.005555555555555556);
return 2.0 * ((b - a) * ((a + b) * (sin(t_0) * cos(t_0))));
}
a = Math.abs(a);
b = Math.abs(b);
public static double code(double a, double b, double angle) {
double t_0 = angle * (Math.PI * 0.005555555555555556);
return 2.0 * ((b - a) * ((a + b) * (Math.sin(t_0) * Math.cos(t_0))));
}
a = abs(a) b = abs(b) def code(a, b, angle): t_0 = angle * (math.pi * 0.005555555555555556) return 2.0 * ((b - a) * ((a + b) * (math.sin(t_0) * math.cos(t_0))))
a = abs(a) b = abs(b) function code(a, b, angle) t_0 = Float64(angle * Float64(pi * 0.005555555555555556)) return Float64(2.0 * Float64(Float64(b - a) * Float64(Float64(a + b) * Float64(sin(t_0) * cos(t_0))))) end
a = abs(a) b = abs(b) function tmp = code(a, b, angle) t_0 = angle * (pi * 0.005555555555555556); tmp = 2.0 * ((b - a) * ((a + b) * (sin(t_0) * cos(t_0)))); 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[(angle * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, N[(2.0 * N[(N[(b - a), $MachinePrecision] * N[(N[(a + b), $MachinePrecision] * N[(N[Sin[t$95$0], $MachinePrecision] * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
a = |a|\\
b = |b|\\
\\
\begin{array}{l}
t_0 := angle \cdot \left(\pi \cdot 0.005555555555555556\right)\\
2 \cdot \left(\left(b - a\right) \cdot \left(\left(a + b\right) \cdot \left(\sin t_0 \cdot \cos t_0\right)\right)\right)
\end{array}
\end{array}
Initial program 56.8%
associate-*l*56.8%
unpow256.8%
unpow256.8%
difference-of-squares58.8%
Simplified58.8%
add-sqr-sqrt48.1%
pow248.1%
div-inv47.7%
metadata-eval47.7%
Applied egg-rr47.7%
Taylor expanded in angle around inf 68.9%
associate-*r*68.9%
*-commutative68.9%
+-commutative68.9%
*-commutative68.9%
associate-*r*69.9%
*-commutative69.9%
associate-*r*68.4%
*-commutative68.4%
*-commutative68.4%
associate-*r*69.9%
*-commutative69.9%
associate-*r*69.4%
*-commutative69.4%
*-commutative69.4%
Simplified69.4%
Final simplification69.4%
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))
(*
(*
(sin (* PI (* 0.005555555555555556 angle)))
(cos (* 0.005555555555555556 (* PI angle))))
(+ a b))))a = abs(a);
b = abs(b);
double code(double a, double b, double angle) {
return (2.0 * (b - a)) * ((sin((((double) M_PI) * (0.005555555555555556 * angle))) * cos((0.005555555555555556 * (((double) M_PI) * angle)))) * (a + b));
}
a = Math.abs(a);
b = Math.abs(b);
public static double code(double a, double b, double angle) {
return (2.0 * (b - a)) * ((Math.sin((Math.PI * (0.005555555555555556 * angle))) * Math.cos((0.005555555555555556 * (Math.PI * angle)))) * (a + b));
}
a = abs(a) b = abs(b) def code(a, b, angle): return (2.0 * (b - a)) * ((math.sin((math.pi * (0.005555555555555556 * angle))) * math.cos((0.005555555555555556 * (math.pi * angle)))) * (a + b))
a = abs(a) b = abs(b) function code(a, b, angle) return Float64(Float64(2.0 * Float64(b - a)) * Float64(Float64(sin(Float64(pi * Float64(0.005555555555555556 * angle))) * cos(Float64(0.005555555555555556 * Float64(pi * angle)))) * Float64(a + b))) end
a = abs(a) b = abs(b) function tmp = code(a, b, angle) tmp = (2.0 * (b - a)) * ((sin((pi * (0.005555555555555556 * angle))) * cos((0.005555555555555556 * (pi * angle)))) * (a + 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[(N[(2.0 * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[(N[(N[Sin[N[(Pi * N[(0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(0.005555555555555556 * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(a + b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
a = |a|\\
b = |b|\\
\\
\left(2 \cdot \left(b - a\right)\right) \cdot \left(\left(\sin \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right) \cdot \cos \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)\right) \cdot \left(a + b\right)\right)
\end{array}
Initial program 56.8%
associate-*l*56.8%
unpow256.8%
unpow256.8%
difference-of-squares58.8%
Simplified58.8%
Taylor expanded in angle around inf 68.9%
associate-*r*68.9%
associate-*r*68.9%
*-commutative68.9%
associate-*r*69.9%
*-commutative69.9%
*-commutative69.9%
*-commutative69.9%
associate-*r*69.6%
*-commutative69.6%
*-commutative69.6%
*-commutative69.6%
Simplified69.6%
Taylor expanded in angle around inf 69.9%
Final simplification69.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 (pow (+ a b) 2.0)))
(if (<= (/ angle 180.0) -1.45e+218)
(* 0.011111111111111112 (* angle (* PI t_0)))
(if (<= (/ angle 180.0) 2e-9)
(*
(* 2.0 (- b a))
(*
(+ a b)
(*
(* angle (* PI 0.005555555555555556))
(cos (* PI (* 0.005555555555555556 angle))))))
(if (<= (/ angle 180.0) 2e+70)
(*
(sin (* PI (* 2.0 (* 0.005555555555555556 angle))))
(* 0.5 (* 2.0 t_0)))
(* 2.0 (* (* (- b a) (+ a b)) (sin (* PI (/ angle 180.0))))))))))a = abs(a);
b = abs(b);
double code(double a, double b, double angle) {
double t_0 = pow((a + b), 2.0);
double tmp;
if ((angle / 180.0) <= -1.45e+218) {
tmp = 0.011111111111111112 * (angle * (((double) M_PI) * t_0));
} else if ((angle / 180.0) <= 2e-9) {
tmp = (2.0 * (b - a)) * ((a + b) * ((angle * (((double) M_PI) * 0.005555555555555556)) * cos((((double) M_PI) * (0.005555555555555556 * angle)))));
} else if ((angle / 180.0) <= 2e+70) {
tmp = sin((((double) M_PI) * (2.0 * (0.005555555555555556 * angle)))) * (0.5 * (2.0 * t_0));
} else {
tmp = 2.0 * (((b - a) * (a + b)) * sin((((double) M_PI) * (angle / 180.0))));
}
return tmp;
}
a = Math.abs(a);
b = Math.abs(b);
public static double code(double a, double b, double angle) {
double t_0 = Math.pow((a + b), 2.0);
double tmp;
if ((angle / 180.0) <= -1.45e+218) {
tmp = 0.011111111111111112 * (angle * (Math.PI * t_0));
} else if ((angle / 180.0) <= 2e-9) {
tmp = (2.0 * (b - a)) * ((a + b) * ((angle * (Math.PI * 0.005555555555555556)) * Math.cos((Math.PI * (0.005555555555555556 * angle)))));
} else if ((angle / 180.0) <= 2e+70) {
tmp = Math.sin((Math.PI * (2.0 * (0.005555555555555556 * angle)))) * (0.5 * (2.0 * t_0));
} else {
tmp = 2.0 * (((b - a) * (a + b)) * Math.sin((Math.PI * (angle / 180.0))));
}
return tmp;
}
a = abs(a) b = abs(b) def code(a, b, angle): t_0 = math.pow((a + b), 2.0) tmp = 0 if (angle / 180.0) <= -1.45e+218: tmp = 0.011111111111111112 * (angle * (math.pi * t_0)) elif (angle / 180.0) <= 2e-9: tmp = (2.0 * (b - a)) * ((a + b) * ((angle * (math.pi * 0.005555555555555556)) * math.cos((math.pi * (0.005555555555555556 * angle))))) elif (angle / 180.0) <= 2e+70: tmp = math.sin((math.pi * (2.0 * (0.005555555555555556 * angle)))) * (0.5 * (2.0 * t_0)) else: tmp = 2.0 * (((b - a) * (a + b)) * math.sin((math.pi * (angle / 180.0)))) return tmp
a = abs(a) b = abs(b) function code(a, b, angle) t_0 = Float64(a + b) ^ 2.0 tmp = 0.0 if (Float64(angle / 180.0) <= -1.45e+218) tmp = Float64(0.011111111111111112 * Float64(angle * Float64(pi * t_0))); elseif (Float64(angle / 180.0) <= 2e-9) tmp = Float64(Float64(2.0 * Float64(b - a)) * Float64(Float64(a + b) * Float64(Float64(angle * Float64(pi * 0.005555555555555556)) * cos(Float64(pi * Float64(0.005555555555555556 * angle)))))); elseif (Float64(angle / 180.0) <= 2e+70) tmp = Float64(sin(Float64(pi * Float64(2.0 * Float64(0.005555555555555556 * angle)))) * Float64(0.5 * Float64(2.0 * t_0))); else tmp = Float64(2.0 * Float64(Float64(Float64(b - a) * Float64(a + b)) * sin(Float64(pi * Float64(angle / 180.0))))); end return tmp end
a = abs(a) b = abs(b) function tmp_2 = code(a, b, angle) t_0 = (a + b) ^ 2.0; tmp = 0.0; if ((angle / 180.0) <= -1.45e+218) tmp = 0.011111111111111112 * (angle * (pi * t_0)); elseif ((angle / 180.0) <= 2e-9) tmp = (2.0 * (b - a)) * ((a + b) * ((angle * (pi * 0.005555555555555556)) * cos((pi * (0.005555555555555556 * angle))))); elseif ((angle / 180.0) <= 2e+70) tmp = sin((pi * (2.0 * (0.005555555555555556 * angle)))) * (0.5 * (2.0 * t_0)); else tmp = 2.0 * (((b - a) * (a + b)) * sin((pi * (angle / 180.0)))); 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_] := Block[{t$95$0 = N[Power[N[(a + b), $MachinePrecision], 2.0], $MachinePrecision]}, If[LessEqual[N[(angle / 180.0), $MachinePrecision], -1.45e+218], N[(0.011111111111111112 * N[(angle * N[(Pi * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle / 180.0), $MachinePrecision], 2e-9], N[(N[(2.0 * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[(N[(a + b), $MachinePrecision] * N[(N[(angle * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(Pi * N[(0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle / 180.0), $MachinePrecision], 2e+70], N[(N[Sin[N[(Pi * N[(2.0 * N[(0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(0.5 * N[(2.0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[(b - a), $MachinePrecision] * N[(a + b), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
a = |a|\\
b = |b|\\
\\
\begin{array}{l}
t_0 := {\left(a + b\right)}^{2}\\
\mathbf{if}\;\frac{angle}{180} \leq -1.45 \cdot 10^{+218}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot t_0\right)\right)\\
\mathbf{elif}\;\frac{angle}{180} \leq 2 \cdot 10^{-9}:\\
\;\;\;\;\left(2 \cdot \left(b - a\right)\right) \cdot \left(\left(a + b\right) \cdot \left(\left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right) \cdot \cos \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right)\right)\right)\\
\mathbf{elif}\;\frac{angle}{180} \leq 2 \cdot 10^{+70}:\\
\;\;\;\;\sin \left(\pi \cdot \left(2 \cdot \left(0.005555555555555556 \cdot angle\right)\right)\right) \cdot \left(0.5 \cdot \left(2 \cdot t_0\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(\left(b - a\right) \cdot \left(a + b\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle 180) < -1.45e218Initial program 20.9%
*-commutative20.9%
associate-*l*20.9%
unpow220.9%
fma-neg25.1%
unpow225.1%
Simplified25.1%
Applied egg-rr34.5%
log-pow36.3%
+-commutative36.3%
sin-036.3%
+-lft-identity36.3%
associate-*l*36.3%
*-commutative36.3%
*-commutative36.3%
Simplified36.3%
Taylor expanded in angle around 0 43.9%
+-commutative43.9%
Simplified43.9%
if -1.45e218 < (/.f64 angle 180) < 2.00000000000000012e-9Initial program 70.6%
associate-*l*70.6%
unpow270.6%
unpow270.6%
difference-of-squares71.9%
Simplified71.9%
Taylor expanded in angle around inf 87.2%
associate-*r*87.2%
associate-*r*87.2%
*-commutative87.2%
associate-*r*86.2%
*-commutative86.2%
*-commutative86.2%
*-commutative86.2%
associate-*r*88.0%
*-commutative88.0%
*-commutative88.0%
*-commutative88.0%
Simplified88.0%
Taylor expanded in angle around 0 88.0%
associate-*r*88.0%
*-commutative88.0%
associate-*r*88.0%
*-commutative88.0%
*-commutative88.0%
Simplified88.0%
if 2.00000000000000012e-9 < (/.f64 angle 180) < 2.00000000000000015e70Initial program 46.2%
*-commutative46.2%
associate-*l*46.2%
unpow246.2%
fma-neg46.2%
unpow246.2%
Simplified46.2%
Applied egg-rr35.2%
expm1-def36.8%
expm1-log1p47.1%
associate-*l*47.1%
sin-047.1%
+-lft-identity47.1%
associate-*l*47.1%
*-commutative47.1%
*-commutative47.1%
+-commutative47.1%
Simplified47.1%
if 2.00000000000000015e70 < (/.f64 angle 180) Initial program 27.6%
associate-*l*27.6%
associate-*l*27.6%
unpow227.6%
unpow227.6%
difference-of-squares30.0%
Simplified30.0%
Taylor expanded in angle around 0 34.7%
Final simplification71.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 (<= (/ angle 180.0) -4e+209)
(* 0.011111111111111112 (* angle (* PI (pow (+ a b) 2.0))))
(if (or (<= (/ angle 180.0) -5e+109) (not (<= (/ angle 180.0) 1e+67)))
(* 2.0 (* (* (- b a) (+ a b)) (sin (* PI (/ angle 180.0)))))
(* 0.011111111111111112 (* (* (- b a) angle) (* PI (+ a b)))))))a = abs(a);
b = abs(b);
double code(double a, double b, double angle) {
double tmp;
if ((angle / 180.0) <= -4e+209) {
tmp = 0.011111111111111112 * (angle * (((double) M_PI) * pow((a + b), 2.0)));
} else if (((angle / 180.0) <= -5e+109) || !((angle / 180.0) <= 1e+67)) {
tmp = 2.0 * (((b - a) * (a + b)) * sin((((double) M_PI) * (angle / 180.0))));
} else {
tmp = 0.011111111111111112 * (((b - a) * angle) * (((double) M_PI) * (a + b)));
}
return tmp;
}
a = Math.abs(a);
b = Math.abs(b);
public static double code(double a, double b, double angle) {
double tmp;
if ((angle / 180.0) <= -4e+209) {
tmp = 0.011111111111111112 * (angle * (Math.PI * Math.pow((a + b), 2.0)));
} else if (((angle / 180.0) <= -5e+109) || !((angle / 180.0) <= 1e+67)) {
tmp = 2.0 * (((b - a) * (a + b)) * Math.sin((Math.PI * (angle / 180.0))));
} else {
tmp = 0.011111111111111112 * (((b - a) * angle) * (Math.PI * (a + b)));
}
return tmp;
}
a = abs(a) b = abs(b) def code(a, b, angle): tmp = 0 if (angle / 180.0) <= -4e+209: tmp = 0.011111111111111112 * (angle * (math.pi * math.pow((a + b), 2.0))) elif ((angle / 180.0) <= -5e+109) or not ((angle / 180.0) <= 1e+67): tmp = 2.0 * (((b - a) * (a + b)) * math.sin((math.pi * (angle / 180.0)))) else: tmp = 0.011111111111111112 * (((b - a) * angle) * (math.pi * (a + b))) return tmp
a = abs(a) b = abs(b) function code(a, b, angle) tmp = 0.0 if (Float64(angle / 180.0) <= -4e+209) tmp = Float64(0.011111111111111112 * Float64(angle * Float64(pi * (Float64(a + b) ^ 2.0)))); elseif ((Float64(angle / 180.0) <= -5e+109) || !(Float64(angle / 180.0) <= 1e+67)) tmp = Float64(2.0 * Float64(Float64(Float64(b - a) * Float64(a + b)) * sin(Float64(pi * Float64(angle / 180.0))))); else tmp = Float64(0.011111111111111112 * Float64(Float64(Float64(b - a) * angle) * Float64(pi * Float64(a + b)))); end return tmp end
a = abs(a) b = abs(b) function tmp_2 = code(a, b, angle) tmp = 0.0; if ((angle / 180.0) <= -4e+209) tmp = 0.011111111111111112 * (angle * (pi * ((a + b) ^ 2.0))); elseif (((angle / 180.0) <= -5e+109) || ~(((angle / 180.0) <= 1e+67))) tmp = 2.0 * (((b - a) * (a + b)) * sin((pi * (angle / 180.0)))); else tmp = 0.011111111111111112 * (((b - a) * angle) * (pi * (a + 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[N[(angle / 180.0), $MachinePrecision], -4e+209], N[(0.011111111111111112 * N[(angle * N[(Pi * N[Power[N[(a + b), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[N[(angle / 180.0), $MachinePrecision], -5e+109], N[Not[LessEqual[N[(angle / 180.0), $MachinePrecision], 1e+67]], $MachinePrecision]], N[(2.0 * N[(N[(N[(b - a), $MachinePrecision] * N[(a + b), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(N[(N[(b - a), $MachinePrecision] * angle), $MachinePrecision] * N[(Pi * N[(a + b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
a = |a|\\
b = |b|\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{angle}{180} \leq -4 \cdot 10^{+209}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot {\left(a + b\right)}^{2}\right)\right)\\
\mathbf{elif}\;\frac{angle}{180} \leq -5 \cdot 10^{+109} \lor \neg \left(\frac{angle}{180} \leq 10^{+67}\right):\\
\;\;\;\;2 \cdot \left(\left(\left(b - a\right) \cdot \left(a + b\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(\left(b - a\right) \cdot angle\right) \cdot \left(\pi \cdot \left(a + b\right)\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle 180) < -4.0000000000000003e209Initial program 21.5%
*-commutative21.5%
associate-*l*21.5%
unpow221.5%
fma-neg24.9%
unpow224.9%
Simplified24.9%
Applied egg-rr32.7%
log-pow35.2%
+-commutative35.2%
sin-035.2%
+-lft-identity35.2%
associate-*l*35.2%
*-commutative35.2%
*-commutative35.2%
Simplified35.2%
Taylor expanded in angle around 0 40.2%
+-commutative40.2%
Simplified40.2%
if -4.0000000000000003e209 < (/.f64 angle 180) < -5.0000000000000001e109 or 9.99999999999999983e66 < (/.f64 angle 180) Initial program 34.0%
associate-*l*34.0%
associate-*l*34.0%
unpow234.0%
unpow234.0%
difference-of-squares35.4%
Simplified35.4%
Taylor expanded in angle around 0 40.3%
if -5.0000000000000001e109 < (/.f64 angle 180) < 9.99999999999999983e66Initial program 73.4%
associate-*l*73.4%
unpow273.4%
unpow273.4%
difference-of-squares74.8%
Simplified74.8%
Taylor expanded in angle around 0 72.9%
*-commutative72.9%
associate-*r*88.8%
Simplified88.8%
Final simplification70.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) (* (+ a b) (sin (* angle (* PI 0.005555555555555556)))))))
a = abs(a);
b = abs(b);
double code(double a, double b, double angle) {
return 2.0 * ((b - a) * ((a + b) * sin((angle * (((double) M_PI) * 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) * ((a + b) * Math.sin((angle * (Math.PI * 0.005555555555555556)))));
}
a = abs(a) b = abs(b) def code(a, b, angle): return 2.0 * ((b - a) * ((a + b) * math.sin((angle * (math.pi * 0.005555555555555556)))))
a = abs(a) b = abs(b) function code(a, b, angle) return Float64(2.0 * Float64(Float64(b - a) * Float64(Float64(a + b) * sin(Float64(angle * Float64(pi * 0.005555555555555556)))))) end
a = abs(a) b = abs(b) function tmp = code(a, b, angle) tmp = 2.0 * ((b - a) * ((a + b) * sin((angle * (pi * 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[(a + b), $MachinePrecision] * N[Sin[N[(angle * N[(Pi * 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(a + b\right) \cdot \sin \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)\right)
\end{array}
Initial program 56.8%
associate-*l*56.8%
unpow256.8%
unpow256.8%
difference-of-squares58.8%
Simplified58.8%
add-sqr-sqrt48.1%
pow248.1%
div-inv47.7%
metadata-eval47.7%
Applied egg-rr47.7%
Taylor expanded in angle around inf 68.9%
associate-*r*68.9%
*-commutative68.9%
+-commutative68.9%
*-commutative68.9%
associate-*r*69.9%
*-commutative69.9%
associate-*r*68.4%
*-commutative68.4%
*-commutative68.4%
associate-*r*69.9%
*-commutative69.9%
associate-*r*69.4%
*-commutative69.4%
*-commutative69.4%
Simplified69.4%
Taylor expanded in angle around 0 65.2%
Final simplification65.2%
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 -3.8e+109) (not (<= angle 8.8e+58))) (* 0.011111111111111112 (* angle (* PI (pow (+ a b) 2.0)))) (* 0.011111111111111112 (* (* (- b a) angle) (* PI (+ a b))))))
a = abs(a);
b = abs(b);
double code(double a, double b, double angle) {
double tmp;
if ((angle <= -3.8e+109) || !(angle <= 8.8e+58)) {
tmp = 0.011111111111111112 * (angle * (((double) M_PI) * pow((a + b), 2.0)));
} else {
tmp = 0.011111111111111112 * (((b - a) * angle) * (((double) M_PI) * (a + b)));
}
return tmp;
}
a = Math.abs(a);
b = Math.abs(b);
public static double code(double a, double b, double angle) {
double tmp;
if ((angle <= -3.8e+109) || !(angle <= 8.8e+58)) {
tmp = 0.011111111111111112 * (angle * (Math.PI * Math.pow((a + b), 2.0)));
} else {
tmp = 0.011111111111111112 * (((b - a) * angle) * (Math.PI * (a + b)));
}
return tmp;
}
a = abs(a) b = abs(b) def code(a, b, angle): tmp = 0 if (angle <= -3.8e+109) or not (angle <= 8.8e+58): tmp = 0.011111111111111112 * (angle * (math.pi * math.pow((a + b), 2.0))) else: tmp = 0.011111111111111112 * (((b - a) * angle) * (math.pi * (a + b))) return tmp
a = abs(a) b = abs(b) function code(a, b, angle) tmp = 0.0 if ((angle <= -3.8e+109) || !(angle <= 8.8e+58)) tmp = Float64(0.011111111111111112 * Float64(angle * Float64(pi * (Float64(a + b) ^ 2.0)))); else tmp = Float64(0.011111111111111112 * Float64(Float64(Float64(b - a) * angle) * Float64(pi * Float64(a + b)))); end return tmp end
a = abs(a) b = abs(b) function tmp_2 = code(a, b, angle) tmp = 0.0; if ((angle <= -3.8e+109) || ~((angle <= 8.8e+58))) tmp = 0.011111111111111112 * (angle * (pi * ((a + b) ^ 2.0))); else tmp = 0.011111111111111112 * (((b - a) * angle) * (pi * (a + 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[Or[LessEqual[angle, -3.8e+109], N[Not[LessEqual[angle, 8.8e+58]], $MachinePrecision]], N[(0.011111111111111112 * N[(angle * N[(Pi * N[Power[N[(a + b), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(N[(N[(b - a), $MachinePrecision] * angle), $MachinePrecision] * N[(Pi * N[(a + b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
a = |a|\\
b = |b|\\
\\
\begin{array}{l}
\mathbf{if}\;angle \leq -3.8 \cdot 10^{+109} \lor \neg \left(angle \leq 8.8 \cdot 10^{+58}\right):\\
\;\;\;\;0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot {\left(a + b\right)}^{2}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(\left(b - a\right) \cdot angle\right) \cdot \left(\pi \cdot \left(a + b\right)\right)\right)\\
\end{array}
\end{array}
if angle < -3.80000000000000039e109 or 8.8000000000000003e58 < angle Initial program 31.6%
*-commutative31.6%
associate-*l*31.6%
unpow231.6%
fma-neg34.5%
unpow234.5%
Simplified34.5%
Applied egg-rr33.9%
log-pow36.8%
+-commutative36.8%
sin-036.8%
+-lft-identity36.8%
associate-*l*36.8%
*-commutative36.8%
*-commutative36.8%
Simplified36.8%
Taylor expanded in angle around 0 33.1%
+-commutative33.1%
Simplified33.1%
if -3.80000000000000039e109 < angle < 8.8000000000000003e58Initial program 74.2%
associate-*l*74.2%
unpow274.2%
unpow274.2%
difference-of-squares75.7%
Simplified75.7%
Taylor expanded in angle around 0 73.8%
*-commutative73.8%
associate-*r*90.4%
Simplified90.4%
Final simplification66.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 (if (<= angle -1.02e+139) (* 0.011111111111111112 (* PI (* angle (* a a)))) (* 0.011111111111111112 (* (* (- b a) angle) (* PI (+ a b))))))
a = abs(a);
b = abs(b);
double code(double a, double b, double angle) {
double tmp;
if (angle <= -1.02e+139) {
tmp = 0.011111111111111112 * (((double) M_PI) * (angle * (a * a)));
} else {
tmp = 0.011111111111111112 * (((b - a) * angle) * (((double) M_PI) * (a + b)));
}
return tmp;
}
a = Math.abs(a);
b = Math.abs(b);
public static double code(double a, double b, double angle) {
double tmp;
if (angle <= -1.02e+139) {
tmp = 0.011111111111111112 * (Math.PI * (angle * (a * a)));
} else {
tmp = 0.011111111111111112 * (((b - a) * angle) * (Math.PI * (a + b)));
}
return tmp;
}
a = abs(a) b = abs(b) def code(a, b, angle): tmp = 0 if angle <= -1.02e+139: tmp = 0.011111111111111112 * (math.pi * (angle * (a * a))) else: tmp = 0.011111111111111112 * (((b - a) * angle) * (math.pi * (a + b))) return tmp
a = abs(a) b = abs(b) function code(a, b, angle) tmp = 0.0 if (angle <= -1.02e+139) tmp = Float64(0.011111111111111112 * Float64(pi * Float64(angle * Float64(a * a)))); else tmp = Float64(0.011111111111111112 * Float64(Float64(Float64(b - a) * angle) * Float64(pi * Float64(a + b)))); end return tmp end
a = abs(a) b = abs(b) function tmp_2 = code(a, b, angle) tmp = 0.0; if (angle <= -1.02e+139) tmp = 0.011111111111111112 * (pi * (angle * (a * a))); else tmp = 0.011111111111111112 * (((b - a) * angle) * (pi * (a + 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[angle, -1.02e+139], N[(0.011111111111111112 * N[(Pi * N[(angle * N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(N[(N[(b - a), $MachinePrecision] * angle), $MachinePrecision] * N[(Pi * N[(a + b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
a = |a|\\
b = |b|\\
\\
\begin{array}{l}
\mathbf{if}\;angle \leq -1.02 \cdot 10^{+139}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\pi \cdot \left(angle \cdot \left(a \cdot a\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(\left(b - a\right) \cdot angle\right) \cdot \left(\pi \cdot \left(a + b\right)\right)\right)\\
\end{array}
\end{array}
if angle < -1.02e139Initial program 28.4%
*-commutative28.4%
associate-*l*28.4%
unpow228.4%
fma-neg32.3%
unpow232.3%
Simplified32.3%
Applied egg-rr36.7%
log-pow39.0%
+-commutative39.0%
sin-039.0%
+-lft-identity39.0%
associate-*l*39.0%
*-commutative39.0%
*-commutative39.0%
Simplified39.0%
Taylor expanded in a around inf 24.3%
associate-*r*24.3%
*-commutative24.3%
unpow224.3%
associate-*r*21.5%
*-commutative21.5%
associate-*r*23.2%
*-commutative23.2%
Simplified23.2%
Taylor expanded in angle around 0 31.2%
associate-*r*31.2%
unpow231.2%
Simplified31.2%
if -1.02e139 < angle Initial program 63.8%
associate-*l*63.8%
unpow263.8%
unpow263.8%
difference-of-squares65.4%
Simplified65.4%
Taylor expanded in angle around 0 59.5%
*-commutative59.5%
associate-*r*71.3%
Simplified71.3%
Final simplification63.3%
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 (* a a)))))
(if (or (<= angle -2e+194) (not (<= angle 8.8e+58)))
(* 0.011111111111111112 t_0)
(* t_0 -0.011111111111111112))))a = abs(a);
b = abs(b);
double code(double a, double b, double angle) {
double t_0 = ((double) M_PI) * (angle * (a * a));
double tmp;
if ((angle <= -2e+194) || !(angle <= 8.8e+58)) {
tmp = 0.011111111111111112 * t_0;
} else {
tmp = t_0 * -0.011111111111111112;
}
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 * (a * a));
double tmp;
if ((angle <= -2e+194) || !(angle <= 8.8e+58)) {
tmp = 0.011111111111111112 * t_0;
} else {
tmp = t_0 * -0.011111111111111112;
}
return tmp;
}
a = abs(a) b = abs(b) def code(a, b, angle): t_0 = math.pi * (angle * (a * a)) tmp = 0 if (angle <= -2e+194) or not (angle <= 8.8e+58): tmp = 0.011111111111111112 * t_0 else: tmp = t_0 * -0.011111111111111112 return tmp
a = abs(a) b = abs(b) function code(a, b, angle) t_0 = Float64(pi * Float64(angle * Float64(a * a))) tmp = 0.0 if ((angle <= -2e+194) || !(angle <= 8.8e+58)) tmp = Float64(0.011111111111111112 * t_0); else tmp = Float64(t_0 * -0.011111111111111112); end return tmp end
a = abs(a) b = abs(b) function tmp_2 = code(a, b, angle) t_0 = pi * (angle * (a * a)); tmp = 0.0; if ((angle <= -2e+194) || ~((angle <= 8.8e+58))) tmp = 0.011111111111111112 * t_0; else tmp = t_0 * -0.011111111111111112; 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_] := Block[{t$95$0 = N[(Pi * N[(angle * N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[angle, -2e+194], N[Not[LessEqual[angle, 8.8e+58]], $MachinePrecision]], N[(0.011111111111111112 * t$95$0), $MachinePrecision], N[(t$95$0 * -0.011111111111111112), $MachinePrecision]]]
\begin{array}{l}
a = |a|\\
b = |b|\\
\\
\begin{array}{l}
t_0 := \pi \cdot \left(angle \cdot \left(a \cdot a\right)\right)\\
\mathbf{if}\;angle \leq -2 \cdot 10^{+194} \lor \neg \left(angle \leq 8.8 \cdot 10^{+58}\right):\\
\;\;\;\;0.011111111111111112 \cdot t_0\\
\mathbf{else}:\\
\;\;\;\;t_0 \cdot -0.011111111111111112\\
\end{array}
\end{array}
if angle < -1.99999999999999989e194 or 8.8000000000000003e58 < angle Initial program 26.1%
*-commutative26.1%
associate-*l*26.1%
unpow226.1%
fma-neg29.7%
unpow229.7%
Simplified29.7%
Applied egg-rr29.1%
log-pow31.8%
+-commutative31.8%
sin-031.8%
+-lft-identity31.8%
associate-*l*31.8%
*-commutative31.8%
*-commutative31.8%
Simplified31.8%
Taylor expanded in a around inf 22.2%
associate-*r*22.2%
*-commutative22.2%
unpow222.2%
associate-*r*19.5%
*-commutative19.5%
associate-*r*21.8%
*-commutative21.8%
Simplified21.8%
Taylor expanded in angle around 0 27.3%
associate-*r*27.3%
unpow227.3%
Simplified27.3%
if -1.99999999999999989e194 < angle < 8.8000000000000003e58Initial program 71.7%
associate-*l*71.7%
unpow271.7%
unpow271.7%
difference-of-squares73.0%
Simplified73.0%
Taylor expanded in angle around 0 67.1%
Taylor expanded in b around 0 47.7%
associate-*r*47.7%
*-commutative47.7%
*-commutative47.7%
unpow247.7%
*-commutative47.7%
Simplified47.7%
Taylor expanded in a around 0 47.7%
associate-*r*47.7%
unpow247.7%
Simplified47.7%
Final simplification41.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 (<= a 1.8e-23) (* 0.011111111111111112 (* PI (* angle (* b b)))) (* 0.011111111111111112 (* angle (* (- b a) (* a PI))))))
a = abs(a);
b = abs(b);
double code(double a, double b, double angle) {
double tmp;
if (a <= 1.8e-23) {
tmp = 0.011111111111111112 * (((double) M_PI) * (angle * (b * b)));
} else {
tmp = 0.011111111111111112 * (angle * ((b - a) * (a * ((double) M_PI))));
}
return tmp;
}
a = Math.abs(a);
b = Math.abs(b);
public static double code(double a, double b, double angle) {
double tmp;
if (a <= 1.8e-23) {
tmp = 0.011111111111111112 * (Math.PI * (angle * (b * b)));
} else {
tmp = 0.011111111111111112 * (angle * ((b - a) * (a * Math.PI)));
}
return tmp;
}
a = abs(a) b = abs(b) def code(a, b, angle): tmp = 0 if a <= 1.8e-23: tmp = 0.011111111111111112 * (math.pi * (angle * (b * b))) else: tmp = 0.011111111111111112 * (angle * ((b - a) * (a * math.pi))) return tmp
a = abs(a) b = abs(b) function code(a, b, angle) tmp = 0.0 if (a <= 1.8e-23) tmp = Float64(0.011111111111111112 * Float64(pi * Float64(angle * Float64(b * b)))); else tmp = Float64(0.011111111111111112 * Float64(angle * Float64(Float64(b - a) * Float64(a * pi)))); end return tmp end
a = abs(a) b = abs(b) function tmp_2 = code(a, b, angle) tmp = 0.0; if (a <= 1.8e-23) tmp = 0.011111111111111112 * (pi * (angle * (b * b))); else tmp = 0.011111111111111112 * (angle * ((b - a) * (a * pi))); 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[a, 1.8e-23], N[(0.011111111111111112 * N[(Pi * N[(angle * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(angle * N[(N[(b - a), $MachinePrecision] * N[(a * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
a = |a|\\
b = |b|\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq 1.8 \cdot 10^{-23}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\pi \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle \cdot \left(\left(b - a\right) \cdot \left(a \cdot \pi\right)\right)\right)\\
\end{array}
\end{array}
if a < 1.7999999999999999e-23Initial program 59.4%
associate-*l*59.4%
unpow259.4%
unpow259.4%
difference-of-squares61.1%
Simplified61.1%
Taylor expanded in angle around 0 54.4%
Taylor expanded in b around inf 40.1%
*-commutative40.1%
associate-*r*40.1%
unpow240.1%
Simplified40.1%
if 1.7999999999999999e-23 < a Initial program 50.2%
associate-*l*50.2%
unpow250.2%
unpow250.2%
difference-of-squares53.1%
Simplified53.1%
Taylor expanded in angle around 0 48.3%
Taylor expanded in a around inf 44.2%
*-commutative44.2%
Simplified44.2%
Final simplification41.3%
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 680000000.0) (* 0.011111111111111112 (* angle (* (- b a) (* a PI)))) (* 0.011111111111111112 (* angle (* (- b a) (* b PI))))))
a = abs(a);
b = abs(b);
double code(double a, double b, double angle) {
double tmp;
if (b <= 680000000.0) {
tmp = 0.011111111111111112 * (angle * ((b - a) * (a * ((double) M_PI))));
} else {
tmp = 0.011111111111111112 * (angle * ((b - a) * (b * ((double) M_PI))));
}
return tmp;
}
a = Math.abs(a);
b = Math.abs(b);
public static double code(double a, double b, double angle) {
double tmp;
if (b <= 680000000.0) {
tmp = 0.011111111111111112 * (angle * ((b - a) * (a * Math.PI)));
} else {
tmp = 0.011111111111111112 * (angle * ((b - a) * (b * Math.PI)));
}
return tmp;
}
a = abs(a) b = abs(b) def code(a, b, angle): tmp = 0 if b <= 680000000.0: tmp = 0.011111111111111112 * (angle * ((b - a) * (a * math.pi))) else: tmp = 0.011111111111111112 * (angle * ((b - a) * (b * math.pi))) return tmp
a = abs(a) b = abs(b) function code(a, b, angle) tmp = 0.0 if (b <= 680000000.0) tmp = Float64(0.011111111111111112 * Float64(angle * Float64(Float64(b - a) * Float64(a * pi)))); else tmp = Float64(0.011111111111111112 * Float64(angle * Float64(Float64(b - a) * Float64(b * pi)))); end return tmp end
a = abs(a) b = abs(b) function tmp_2 = code(a, b, angle) tmp = 0.0; if (b <= 680000000.0) tmp = 0.011111111111111112 * (angle * ((b - a) * (a * pi))); else tmp = 0.011111111111111112 * (angle * ((b - a) * (b * pi))); 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, 680000000.0], N[(0.011111111111111112 * N[(angle * N[(N[(b - a), $MachinePrecision] * N[(a * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(angle * N[(N[(b - a), $MachinePrecision] * N[(b * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
a = |a|\\
b = |b|\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq 680000000:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle \cdot \left(\left(b - a\right) \cdot \left(a \cdot \pi\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle \cdot \left(\left(b - a\right) \cdot \left(b \cdot \pi\right)\right)\right)\\
\end{array}
\end{array}
if b < 6.8e8Initial program 59.7%
associate-*l*59.7%
unpow259.7%
unpow259.7%
difference-of-squares61.2%
Simplified61.2%
Taylor expanded in angle around 0 55.4%
Taylor expanded in a around inf 45.1%
*-commutative45.1%
Simplified45.1%
if 6.8e8 < b Initial program 47.2%
associate-*l*47.2%
unpow247.2%
unpow247.2%
difference-of-squares50.8%
Simplified50.8%
Taylor expanded in angle around 0 43.6%
Taylor expanded in a around 0 43.5%
*-commutative43.5%
Simplified43.5%
Final simplification44.7%
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 (* (- b a) (* PI (+ a b))))))
a = abs(a);
b = abs(b);
double code(double a, double b, double angle) {
return 0.011111111111111112 * (angle * ((b - a) * (((double) M_PI) * (a + b))));
}
a = Math.abs(a);
b = Math.abs(b);
public static double code(double a, double b, double angle) {
return 0.011111111111111112 * (angle * ((b - a) * (Math.PI * (a + b))));
}
a = abs(a) b = abs(b) def code(a, b, angle): return 0.011111111111111112 * (angle * ((b - a) * (math.pi * (a + b))))
a = abs(a) b = abs(b) function code(a, b, angle) return Float64(0.011111111111111112 * Float64(angle * Float64(Float64(b - a) * Float64(pi * Float64(a + b))))) end
a = abs(a) b = abs(b) function tmp = code(a, b, angle) tmp = 0.011111111111111112 * (angle * ((b - a) * (pi * (a + 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[(N[(b - a), $MachinePrecision] * N[(Pi * N[(a + b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
a = |a|\\
b = |b|\\
\\
0.011111111111111112 \cdot \left(angle \cdot \left(\left(b - a\right) \cdot \left(\pi \cdot \left(a + b\right)\right)\right)\right)
\end{array}
Initial program 56.8%
associate-*l*56.8%
unpow256.8%
unpow256.8%
difference-of-squares58.8%
Simplified58.8%
Taylor expanded in angle around 0 52.6%
Final simplification52.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 3700000000.0) (* (* PI (* angle (* a a))) -0.011111111111111112) (* (* PI (* b b)) (* angle 0.011111111111111112))))
a = abs(a);
b = abs(b);
double code(double a, double b, double angle) {
double tmp;
if (b <= 3700000000.0) {
tmp = (((double) M_PI) * (angle * (a * a))) * -0.011111111111111112;
} else {
tmp = (((double) M_PI) * (b * b)) * (angle * 0.011111111111111112);
}
return tmp;
}
a = Math.abs(a);
b = Math.abs(b);
public static double code(double a, double b, double angle) {
double tmp;
if (b <= 3700000000.0) {
tmp = (Math.PI * (angle * (a * a))) * -0.011111111111111112;
} else {
tmp = (Math.PI * (b * b)) * (angle * 0.011111111111111112);
}
return tmp;
}
a = abs(a) b = abs(b) def code(a, b, angle): tmp = 0 if b <= 3700000000.0: tmp = (math.pi * (angle * (a * a))) * -0.011111111111111112 else: tmp = (math.pi * (b * b)) * (angle * 0.011111111111111112) return tmp
a = abs(a) b = abs(b) function code(a, b, angle) tmp = 0.0 if (b <= 3700000000.0) tmp = Float64(Float64(pi * Float64(angle * Float64(a * a))) * -0.011111111111111112); else tmp = Float64(Float64(pi * Float64(b * b)) * Float64(angle * 0.011111111111111112)); end return tmp end
a = abs(a) b = abs(b) function tmp_2 = code(a, b, angle) tmp = 0.0; if (b <= 3700000000.0) tmp = (pi * (angle * (a * a))) * -0.011111111111111112; else tmp = (pi * (b * b)) * (angle * 0.011111111111111112); 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, 3700000000.0], N[(N[(Pi * N[(angle * N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -0.011111111111111112), $MachinePrecision], N[(N[(Pi * N[(b * b), $MachinePrecision]), $MachinePrecision] * N[(angle * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
a = |a|\\
b = |b|\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq 3700000000:\\
\;\;\;\;\left(\pi \cdot \left(angle \cdot \left(a \cdot a\right)\right)\right) \cdot -0.011111111111111112\\
\mathbf{else}:\\
\;\;\;\;\left(\pi \cdot \left(b \cdot b\right)\right) \cdot \left(angle \cdot 0.011111111111111112\right)\\
\end{array}
\end{array}
if b < 3.7e9Initial program 59.7%
associate-*l*59.7%
unpow259.7%
unpow259.7%
difference-of-squares61.2%
Simplified61.2%
Taylor expanded in angle around 0 55.4%
Taylor expanded in b around 0 43.7%
associate-*r*43.7%
*-commutative43.7%
*-commutative43.7%
unpow243.7%
*-commutative43.7%
Simplified43.7%
Taylor expanded in a around 0 43.7%
associate-*r*43.7%
unpow243.7%
Simplified43.7%
if 3.7e9 < b Initial program 47.2%
associate-*l*47.2%
unpow247.2%
unpow247.2%
difference-of-squares50.8%
Simplified50.8%
Taylor expanded in angle around 0 43.6%
Taylor expanded in b around inf 38.6%
associate-*r*38.5%
*-commutative38.5%
*-commutative38.5%
unpow238.5%
*-commutative38.5%
Simplified38.5%
Final simplification42.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 4200000000.0) (* (* PI (* angle (* a a))) -0.011111111111111112) (* 0.011111111111111112 (* PI (* angle (* b b))))))
a = abs(a);
b = abs(b);
double code(double a, double b, double angle) {
double tmp;
if (b <= 4200000000.0) {
tmp = (((double) M_PI) * (angle * (a * a))) * -0.011111111111111112;
} else {
tmp = 0.011111111111111112 * (((double) M_PI) * (angle * (b * 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 <= 4200000000.0) {
tmp = (Math.PI * (angle * (a * a))) * -0.011111111111111112;
} else {
tmp = 0.011111111111111112 * (Math.PI * (angle * (b * b)));
}
return tmp;
}
a = abs(a) b = abs(b) def code(a, b, angle): tmp = 0 if b <= 4200000000.0: tmp = (math.pi * (angle * (a * a))) * -0.011111111111111112 else: tmp = 0.011111111111111112 * (math.pi * (angle * (b * b))) return tmp
a = abs(a) b = abs(b) function code(a, b, angle) tmp = 0.0 if (b <= 4200000000.0) tmp = Float64(Float64(pi * Float64(angle * Float64(a * a))) * -0.011111111111111112); else tmp = Float64(0.011111111111111112 * Float64(pi * Float64(angle * Float64(b * b)))); end return tmp end
a = abs(a) b = abs(b) function tmp_2 = code(a, b, angle) tmp = 0.0; if (b <= 4200000000.0) tmp = (pi * (angle * (a * a))) * -0.011111111111111112; else tmp = 0.011111111111111112 * (pi * (angle * (b * 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, 4200000000.0], N[(N[(Pi * N[(angle * N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -0.011111111111111112), $MachinePrecision], N[(0.011111111111111112 * N[(Pi * N[(angle * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
a = |a|\\
b = |b|\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq 4200000000:\\
\;\;\;\;\left(\pi \cdot \left(angle \cdot \left(a \cdot a\right)\right)\right) \cdot -0.011111111111111112\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\pi \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right)\\
\end{array}
\end{array}
if b < 4.2e9Initial program 59.7%
associate-*l*59.7%
unpow259.7%
unpow259.7%
difference-of-squares61.2%
Simplified61.2%
Taylor expanded in angle around 0 55.4%
Taylor expanded in b around 0 43.7%
associate-*r*43.7%
*-commutative43.7%
*-commutative43.7%
unpow243.7%
*-commutative43.7%
Simplified43.7%
Taylor expanded in a around 0 43.7%
associate-*r*43.7%
unpow243.7%
Simplified43.7%
if 4.2e9 < b Initial program 47.2%
associate-*l*47.2%
unpow247.2%
unpow247.2%
difference-of-squares50.8%
Simplified50.8%
Taylor expanded in angle around 0 43.6%
Taylor expanded in b around inf 38.6%
*-commutative38.6%
associate-*r*38.6%
unpow238.6%
Simplified38.6%
Final simplification42.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 (* -0.011111111111111112 (* angle (* PI (* a a)))))
a = abs(a);
b = abs(b);
double code(double a, double b, double angle) {
return -0.011111111111111112 * (angle * (((double) M_PI) * (a * a)));
}
a = Math.abs(a);
b = Math.abs(b);
public static double code(double a, double b, double angle) {
return -0.011111111111111112 * (angle * (Math.PI * (a * a)));
}
a = abs(a) b = abs(b) def code(a, b, angle): return -0.011111111111111112 * (angle * (math.pi * (a * a)))
a = abs(a) b = abs(b) function code(a, b, angle) return Float64(-0.011111111111111112 * Float64(angle * Float64(pi * Float64(a * a)))) end
a = abs(a) b = abs(b) function tmp = code(a, b, angle) tmp = -0.011111111111111112 * (angle * (pi * (a * 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[(angle * N[(Pi * N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
a = |a|\\
b = |b|\\
\\
-0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(a \cdot a\right)\right)\right)
\end{array}
Initial program 56.8%
associate-*l*56.8%
unpow256.8%
unpow256.8%
difference-of-squares58.8%
Simplified58.8%
Taylor expanded in angle around 0 52.6%
Taylor expanded in b around 0 37.1%
associate-*r*37.0%
*-commutative37.0%
*-commutative37.0%
unpow237.0%
*-commutative37.0%
Simplified37.0%
Taylor expanded in a around 0 37.1%
associate-*r*37.1%
unpow237.1%
Simplified37.1%
Taylor expanded in angle around 0 37.1%
*-commutative37.1%
unpow237.1%
Simplified37.1%
Final simplification37.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 (* (* PI (* angle (* a a))) -0.011111111111111112))
a = abs(a);
b = abs(b);
double code(double a, double b, double angle) {
return (((double) M_PI) * (angle * (a * a))) * -0.011111111111111112;
}
a = Math.abs(a);
b = Math.abs(b);
public static double code(double a, double b, double angle) {
return (Math.PI * (angle * (a * a))) * -0.011111111111111112;
}
a = abs(a) b = abs(b) def code(a, b, angle): return (math.pi * (angle * (a * a))) * -0.011111111111111112
a = abs(a) b = abs(b) function code(a, b, angle) return Float64(Float64(pi * Float64(angle * Float64(a * a))) * -0.011111111111111112) end
a = abs(a) b = abs(b) function tmp = code(a, b, angle) tmp = (pi * (angle * (a * a))) * -0.011111111111111112; end
NOTE: a should be positive before calling this function NOTE: b should be positive before calling this function code[a_, b_, angle_] := N[(N[(Pi * N[(angle * N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -0.011111111111111112), $MachinePrecision]
\begin{array}{l}
a = |a|\\
b = |b|\\
\\
\left(\pi \cdot \left(angle \cdot \left(a \cdot a\right)\right)\right) \cdot -0.011111111111111112
\end{array}
Initial program 56.8%
associate-*l*56.8%
unpow256.8%
unpow256.8%
difference-of-squares58.8%
Simplified58.8%
Taylor expanded in angle around 0 52.6%
Taylor expanded in b around 0 37.1%
associate-*r*37.0%
*-commutative37.0%
*-commutative37.0%
unpow237.0%
*-commutative37.0%
Simplified37.0%
Taylor expanded in a around 0 37.1%
associate-*r*37.1%
unpow237.1%
Simplified37.1%
Final simplification37.1%
herbie shell --seed 2023224
(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)))))