
(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 20 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 (* (* (* (sin (* (* (sqrt PI) (sqrt PI)) (* angle 0.005555555555555556))) (+ b a)) (cos (* (* angle 0.005555555555555556) (cbrt (* PI (* PI PI)))))) (* 2.0 (- b a))))
a = abs(a);
double code(double a, double b, double angle) {
return ((sin(((sqrt(((double) M_PI)) * sqrt(((double) M_PI))) * (angle * 0.005555555555555556))) * (b + a)) * cos(((angle * 0.005555555555555556) * cbrt((((double) M_PI) * (((double) M_PI) * ((double) M_PI))))))) * (2.0 * (b - a));
}
a = Math.abs(a);
public static double code(double a, double b, double angle) {
return ((Math.sin(((Math.sqrt(Math.PI) * Math.sqrt(Math.PI)) * (angle * 0.005555555555555556))) * (b + a)) * Math.cos(((angle * 0.005555555555555556) * Math.cbrt((Math.PI * (Math.PI * Math.PI)))))) * (2.0 * (b - a));
}
a = abs(a) function code(a, b, angle) return Float64(Float64(Float64(sin(Float64(Float64(sqrt(pi) * sqrt(pi)) * Float64(angle * 0.005555555555555556))) * Float64(b + a)) * cos(Float64(Float64(angle * 0.005555555555555556) * cbrt(Float64(pi * Float64(pi * pi)))))) * Float64(2.0 * Float64(b - a))) end
NOTE: a should be positive before calling this function code[a_, b_, angle_] := N[(N[(N[(N[Sin[N[(N[(N[Sqrt[Pi], $MachinePrecision] * N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision] * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(N[(angle * 0.005555555555555556), $MachinePrecision] * N[Power[N[(Pi * N[(Pi * Pi), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
a = |a|\\
\\
\left(\left(\sin \left(\left(\sqrt{\pi} \cdot \sqrt{\pi}\right) \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot \left(b + a\right)\right) \cdot \cos \left(\left(angle \cdot 0.005555555555555556\right) \cdot \sqrt[3]{\pi \cdot \left(\pi \cdot \pi\right)}\right)\right) \cdot \left(2 \cdot \left(b - a\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 69.4%
associate-*r*69.4%
*-commutative69.4%
*-commutative69.4%
*-commutative69.4%
*-commutative69.4%
associate-*r*70.2%
+-commutative70.2%
*-commutative70.2%
*-commutative70.2%
associate-*r*70.3%
Simplified70.3%
add-cbrt-cube71.0%
Applied egg-rr71.0%
add-sqr-sqrt72.5%
Applied egg-rr72.5%
Final simplification72.5%
NOTE: a should be positive before calling this function
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (* 2.0 (- b a)))
(t_1 (* (+ b a) (sin (* PI (* angle 0.005555555555555556)))))
(t_2 (* PI (/ angle 180.0))))
(if (<=
(* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) (sin t_2)) (cos t_2))
(- INFINITY))
(*
t_0
(*
t_1
(+ 1.0 (* -1.54320987654321e-5 (* (* angle angle) (pow PI 2.0))))))
(* t_0 (* t_1 (cos (* 0.005555555555555556 (* PI angle))))))))a = abs(a);
double code(double a, double b, double angle) {
double t_0 = 2.0 * (b - a);
double t_1 = (b + a) * sin((((double) M_PI) * (angle * 0.005555555555555556)));
double t_2 = ((double) M_PI) * (angle / 180.0);
double tmp;
if ((((2.0 * (pow(b, 2.0) - pow(a, 2.0))) * sin(t_2)) * cos(t_2)) <= -((double) INFINITY)) {
tmp = t_0 * (t_1 * (1.0 + (-1.54320987654321e-5 * ((angle * angle) * pow(((double) M_PI), 2.0)))));
} else {
tmp = t_0 * (t_1 * cos((0.005555555555555556 * (((double) M_PI) * angle))));
}
return tmp;
}
a = Math.abs(a);
public static double code(double a, double b, double angle) {
double t_0 = 2.0 * (b - a);
double t_1 = (b + a) * Math.sin((Math.PI * (angle * 0.005555555555555556)));
double t_2 = Math.PI * (angle / 180.0);
double tmp;
if ((((2.0 * (Math.pow(b, 2.0) - Math.pow(a, 2.0))) * Math.sin(t_2)) * Math.cos(t_2)) <= -Double.POSITIVE_INFINITY) {
tmp = t_0 * (t_1 * (1.0 + (-1.54320987654321e-5 * ((angle * angle) * Math.pow(Math.PI, 2.0)))));
} else {
tmp = t_0 * (t_1 * Math.cos((0.005555555555555556 * (Math.PI * angle))));
}
return tmp;
}
a = abs(a) def code(a, b, angle): t_0 = 2.0 * (b - a) t_1 = (b + a) * math.sin((math.pi * (angle * 0.005555555555555556))) t_2 = math.pi * (angle / 180.0) tmp = 0 if (((2.0 * (math.pow(b, 2.0) - math.pow(a, 2.0))) * math.sin(t_2)) * math.cos(t_2)) <= -math.inf: tmp = t_0 * (t_1 * (1.0 + (-1.54320987654321e-5 * ((angle * angle) * math.pow(math.pi, 2.0))))) else: tmp = t_0 * (t_1 * math.cos((0.005555555555555556 * (math.pi * angle)))) return tmp
a = abs(a) function code(a, b, angle) t_0 = Float64(2.0 * Float64(b - a)) t_1 = Float64(Float64(b + a) * sin(Float64(pi * Float64(angle * 0.005555555555555556)))) t_2 = Float64(pi * Float64(angle / 180.0)) tmp = 0.0 if (Float64(Float64(Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))) * sin(t_2)) * cos(t_2)) <= Float64(-Inf)) tmp = Float64(t_0 * Float64(t_1 * Float64(1.0 + Float64(-1.54320987654321e-5 * Float64(Float64(angle * angle) * (pi ^ 2.0)))))); else tmp = Float64(t_0 * Float64(t_1 * cos(Float64(0.005555555555555556 * Float64(pi * angle))))); end return tmp end
a = abs(a) function tmp_2 = code(a, b, angle) t_0 = 2.0 * (b - a); t_1 = (b + a) * sin((pi * (angle * 0.005555555555555556))); t_2 = pi * (angle / 180.0); tmp = 0.0; if ((((2.0 * ((b ^ 2.0) - (a ^ 2.0))) * sin(t_2)) * cos(t_2)) <= -Inf) tmp = t_0 * (t_1 * (1.0 + (-1.54320987654321e-5 * ((angle * angle) * (pi ^ 2.0))))); else tmp = t_0 * (t_1 * cos((0.005555555555555556 * (pi * angle)))); end tmp_2 = tmp; end
NOTE: a 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[(N[(b + a), $MachinePrecision] * N[Sin[N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$2], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$2], $MachinePrecision]), $MachinePrecision], (-Infinity)], N[(t$95$0 * N[(t$95$1 * N[(1.0 + N[(-1.54320987654321e-5 * N[(N[(angle * angle), $MachinePrecision] * N[Power[Pi, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(t$95$1 * N[Cos[N[(0.005555555555555556 * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
a = |a|\\
\\
\begin{array}{l}
t_0 := 2 \cdot \left(b - a\right)\\
t_1 := \left(b + a\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\\
t_2 := \pi \cdot \frac{angle}{180}\\
\mathbf{if}\;\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin t_2\right) \cdot \cos t_2 \leq -\infty:\\
\;\;\;\;t_0 \cdot \left(t_1 \cdot \left(1 + -1.54320987654321 \cdot 10^{-5} \cdot \left(\left(angle \cdot angle\right) \cdot {\pi}^{2}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_0 \cdot \left(t_1 \cdot \cos \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 (*.f64 2 (-.f64 (pow.f64 b 2) (pow.f64 a 2))) (sin.f64 (*.f64 (PI.f64) (/.f64 angle 180)))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle 180)))) < -inf.0Initial program 48.2%
associate-*l*48.2%
unpow248.2%
unpow248.2%
difference-of-squares48.2%
Simplified48.2%
Taylor expanded in angle around inf 73.9%
associate-*r*73.9%
*-commutative73.9%
*-commutative73.9%
*-commutative73.9%
*-commutative73.9%
associate-*r*73.7%
+-commutative73.7%
*-commutative73.7%
*-commutative73.7%
associate-*r*75.6%
Simplified75.6%
Taylor expanded in angle around 0 83.0%
unpow283.0%
Simplified83.0%
if -inf.0 < (*.f64 (*.f64 (*.f64 2 (-.f64 (pow.f64 b 2) (pow.f64 a 2))) (sin.f64 (*.f64 (PI.f64) (/.f64 angle 180)))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle 180)))) Initial program 59.2%
associate-*l*59.2%
unpow259.2%
unpow259.2%
difference-of-squares61.7%
Simplified61.7%
Taylor expanded in angle around inf 68.2%
associate-*r*68.2%
*-commutative68.2%
*-commutative68.2%
*-commutative68.2%
*-commutative68.2%
associate-*r*69.2%
+-commutative69.2%
*-commutative69.2%
*-commutative69.2%
associate-*r*68.9%
Simplified68.9%
Taylor expanded in angle around inf 69.2%
Final simplification72.1%
NOTE: a should be positive before calling this function (FPCore (a b angle) :precision binary64 (let* ((t_0 (* PI (* angle 0.005555555555555556)))) (* (* 2.0 (- b a)) (* (* (+ b a) (sin (pow (cbrt t_0) 3.0))) (cos t_0)))))
a = abs(a);
double code(double a, double b, double angle) {
double t_0 = ((double) M_PI) * (angle * 0.005555555555555556);
return (2.0 * (b - a)) * (((b + a) * sin(pow(cbrt(t_0), 3.0))) * cos(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 (2.0 * (b - a)) * (((b + a) * Math.sin(Math.pow(Math.cbrt(t_0), 3.0))) * Math.cos(t_0));
}
a = abs(a) function code(a, b, angle) t_0 = Float64(pi * Float64(angle * 0.005555555555555556)) return Float64(Float64(2.0 * Float64(b - a)) * Float64(Float64(Float64(b + a) * sin((cbrt(t_0) ^ 3.0))) * cos(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[(2.0 * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(b + a), $MachinePrecision] * N[Sin[N[Power[N[Power[t$95$0, 1/3], $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Cos[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(2 \cdot \left(b - a\right)\right) \cdot \left(\left(\left(b + a\right) \cdot \sin \left({\left(\sqrt[3]{t_0}\right)}^{3}\right)\right) \cdot \cos t_0\right)
\end{array}
\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 69.4%
associate-*r*69.4%
*-commutative69.4%
*-commutative69.4%
*-commutative69.4%
*-commutative69.4%
associate-*r*70.2%
+-commutative70.2%
*-commutative70.2%
*-commutative70.2%
associate-*r*70.3%
Simplified70.3%
expm1-log1p-u62.4%
Applied egg-rr62.4%
expm1-log1p-u70.3%
*-commutative70.3%
*-commutative70.3%
associate-*r*69.7%
add-cube-cbrt71.0%
pow371.6%
associate-*r*71.6%
*-commutative71.6%
*-commutative71.6%
Applied egg-rr71.6%
Final simplification71.6%
NOTE: a should be positive before calling this function
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (* PI (/ angle 180.0)))
(t_1 (sin t_0))
(t_2 (* 2.0 (* (+ b a) (- b a)))))
(if (<= (/ angle 180.0) -5e+225)
(* t_2 (* t_1 (cos t_0)))
(if (<= (/ angle 180.0) 2e-35)
(*
(* 2.0 (- b a))
(* (+ b a) (sin (* PI (* angle 0.005555555555555556)))))
(* t_2 (* t_1 (cos (* 0.005555555555555556 (* PI angle)))))))))a = abs(a);
double code(double a, double b, double angle) {
double t_0 = ((double) M_PI) * (angle / 180.0);
double t_1 = sin(t_0);
double t_2 = 2.0 * ((b + a) * (b - a));
double tmp;
if ((angle / 180.0) <= -5e+225) {
tmp = t_2 * (t_1 * cos(t_0));
} else if ((angle / 180.0) <= 2e-35) {
tmp = (2.0 * (b - a)) * ((b + a) * sin((((double) M_PI) * (angle * 0.005555555555555556))));
} else {
tmp = t_2 * (t_1 * cos((0.005555555555555556 * (((double) M_PI) * angle))));
}
return tmp;
}
a = Math.abs(a);
public static double code(double a, double b, double angle) {
double t_0 = Math.PI * (angle / 180.0);
double t_1 = Math.sin(t_0);
double t_2 = 2.0 * ((b + a) * (b - a));
double tmp;
if ((angle / 180.0) <= -5e+225) {
tmp = t_2 * (t_1 * Math.cos(t_0));
} else if ((angle / 180.0) <= 2e-35) {
tmp = (2.0 * (b - a)) * ((b + a) * Math.sin((Math.PI * (angle * 0.005555555555555556))));
} else {
tmp = t_2 * (t_1 * Math.cos((0.005555555555555556 * (Math.PI * angle))));
}
return tmp;
}
a = abs(a) def code(a, b, angle): t_0 = math.pi * (angle / 180.0) t_1 = math.sin(t_0) t_2 = 2.0 * ((b + a) * (b - a)) tmp = 0 if (angle / 180.0) <= -5e+225: tmp = t_2 * (t_1 * math.cos(t_0)) elif (angle / 180.0) <= 2e-35: tmp = (2.0 * (b - a)) * ((b + a) * math.sin((math.pi * (angle * 0.005555555555555556)))) else: tmp = t_2 * (t_1 * math.cos((0.005555555555555556 * (math.pi * angle)))) return tmp
a = abs(a) function code(a, b, angle) t_0 = Float64(pi * Float64(angle / 180.0)) t_1 = sin(t_0) t_2 = Float64(2.0 * Float64(Float64(b + a) * Float64(b - a))) tmp = 0.0 if (Float64(angle / 180.0) <= -5e+225) tmp = Float64(t_2 * Float64(t_1 * cos(t_0))); elseif (Float64(angle / 180.0) <= 2e-35) tmp = Float64(Float64(2.0 * Float64(b - a)) * Float64(Float64(b + a) * sin(Float64(pi * Float64(angle * 0.005555555555555556))))); else tmp = Float64(t_2 * Float64(t_1 * cos(Float64(0.005555555555555556 * Float64(pi * angle))))); end return tmp end
a = abs(a) function tmp_2 = code(a, b, angle) t_0 = pi * (angle / 180.0); t_1 = sin(t_0); t_2 = 2.0 * ((b + a) * (b - a)); tmp = 0.0; if ((angle / 180.0) <= -5e+225) tmp = t_2 * (t_1 * cos(t_0)); elseif ((angle / 180.0) <= 2e-35) tmp = (2.0 * (b - a)) * ((b + a) * sin((pi * (angle * 0.005555555555555556)))); else tmp = t_2 * (t_1 * cos((0.005555555555555556 * (pi * angle)))); 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 / 180.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sin[t$95$0], $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[(N[(b + a), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(angle / 180.0), $MachinePrecision], -5e+225], N[(t$95$2 * N[(t$95$1 * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle / 180.0), $MachinePrecision], 2e-35], N[(N[(2.0 * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[(N[(b + a), $MachinePrecision] * N[Sin[N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$2 * N[(t$95$1 * N[Cos[N[(0.005555555555555556 * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
a = |a|\\
\\
\begin{array}{l}
t_0 := \pi \cdot \frac{angle}{180}\\
t_1 := \sin t_0\\
t_2 := 2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\\
\mathbf{if}\;\frac{angle}{180} \leq -5 \cdot 10^{+225}:\\
\;\;\;\;t_2 \cdot \left(t_1 \cdot \cos t_0\right)\\
\mathbf{elif}\;\frac{angle}{180} \leq 2 \cdot 10^{-35}:\\
\;\;\;\;\left(2 \cdot \left(b - a\right)\right) \cdot \left(\left(b + a\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_2 \cdot \left(t_1 \cdot \cos \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle 180) < -4.99999999999999981e225Initial program 52.1%
associate-*l*52.1%
unpow252.1%
unpow252.1%
difference-of-squares66.4%
Simplified66.4%
if -4.99999999999999981e225 < (/.f64 angle 180) < 2.00000000000000002e-35Initial program 63.2%
associate-*l*63.2%
unpow263.2%
unpow263.2%
difference-of-squares64.5%
Simplified64.5%
Taylor expanded in angle around inf 81.1%
associate-*r*81.1%
*-commutative81.1%
*-commutative81.1%
*-commutative81.1%
*-commutative81.1%
associate-*r*81.9%
+-commutative81.9%
*-commutative81.9%
*-commutative81.9%
associate-*r*81.4%
Simplified81.4%
Taylor expanded in angle around 0 83.7%
if 2.00000000000000002e-35 < (/.f64 angle 180) Initial program 42.4%
associate-*l*42.4%
unpow242.4%
unpow242.4%
difference-of-squares43.8%
Simplified43.8%
Taylor expanded in angle around inf 44.8%
Final simplification71.9%
NOTE: a should be positive before calling this function
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (* 0.005555555555555556 (* PI angle)))
(t_1 (cos t_0))
(t_2 (* 2.0 (- b a)))
(t_3 (* (+ b a) (sin t_0))))
(if (<= a 1.6e-51)
(* t_2 (* (* (+ b a) (sin (* PI (* angle 0.005555555555555556)))) t_1))
(if (<= a 2e+185) (* t_2 t_3) (* 2.0 (* (- b a) (* t_1 t_3)))))))a = abs(a);
double code(double a, double b, double angle) {
double t_0 = 0.005555555555555556 * (((double) M_PI) * angle);
double t_1 = cos(t_0);
double t_2 = 2.0 * (b - a);
double t_3 = (b + a) * sin(t_0);
double tmp;
if (a <= 1.6e-51) {
tmp = t_2 * (((b + a) * sin((((double) M_PI) * (angle * 0.005555555555555556)))) * t_1);
} else if (a <= 2e+185) {
tmp = t_2 * t_3;
} else {
tmp = 2.0 * ((b - a) * (t_1 * t_3));
}
return tmp;
}
a = Math.abs(a);
public static double code(double a, double b, double angle) {
double t_0 = 0.005555555555555556 * (Math.PI * angle);
double t_1 = Math.cos(t_0);
double t_2 = 2.0 * (b - a);
double t_3 = (b + a) * Math.sin(t_0);
double tmp;
if (a <= 1.6e-51) {
tmp = t_2 * (((b + a) * Math.sin((Math.PI * (angle * 0.005555555555555556)))) * t_1);
} else if (a <= 2e+185) {
tmp = t_2 * t_3;
} else {
tmp = 2.0 * ((b - a) * (t_1 * t_3));
}
return tmp;
}
a = abs(a) def code(a, b, angle): t_0 = 0.005555555555555556 * (math.pi * angle) t_1 = math.cos(t_0) t_2 = 2.0 * (b - a) t_3 = (b + a) * math.sin(t_0) tmp = 0 if a <= 1.6e-51: tmp = t_2 * (((b + a) * math.sin((math.pi * (angle * 0.005555555555555556)))) * t_1) elif a <= 2e+185: tmp = t_2 * t_3 else: tmp = 2.0 * ((b - a) * (t_1 * t_3)) return tmp
a = abs(a) function code(a, b, angle) t_0 = Float64(0.005555555555555556 * Float64(pi * angle)) t_1 = cos(t_0) t_2 = Float64(2.0 * Float64(b - a)) t_3 = Float64(Float64(b + a) * sin(t_0)) tmp = 0.0 if (a <= 1.6e-51) tmp = Float64(t_2 * Float64(Float64(Float64(b + a) * sin(Float64(pi * Float64(angle * 0.005555555555555556)))) * t_1)); elseif (a <= 2e+185) tmp = Float64(t_2 * t_3); else tmp = Float64(2.0 * Float64(Float64(b - a) * Float64(t_1 * t_3))); end return tmp end
a = abs(a) function tmp_2 = code(a, b, angle) t_0 = 0.005555555555555556 * (pi * angle); t_1 = cos(t_0); t_2 = 2.0 * (b - a); t_3 = (b + a) * sin(t_0); tmp = 0.0; if (a <= 1.6e-51) tmp = t_2 * (((b + a) * sin((pi * (angle * 0.005555555555555556)))) * t_1); elseif (a <= 2e+185) tmp = t_2 * t_3; else tmp = 2.0 * ((b - a) * (t_1 * t_3)); end tmp_2 = tmp; end
NOTE: a should be positive before calling this function
code[a_, b_, angle_] := Block[{t$95$0 = N[(0.005555555555555556 * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Cos[t$95$0], $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[(b - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(b + a), $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, 1.6e-51], N[(t$95$2 * N[(N[(N[(b + a), $MachinePrecision] * N[Sin[N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 2e+185], N[(t$95$2 * t$95$3), $MachinePrecision], N[(2.0 * N[(N[(b - a), $MachinePrecision] * N[(t$95$1 * t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
a = |a|\\
\\
\begin{array}{l}
t_0 := 0.005555555555555556 \cdot \left(\pi \cdot angle\right)\\
t_1 := \cos t_0\\
t_2 := 2 \cdot \left(b - a\right)\\
t_3 := \left(b + a\right) \cdot \sin t_0\\
\mathbf{if}\;a \leq 1.6 \cdot 10^{-51}:\\
\;\;\;\;t_2 \cdot \left(\left(\left(b + a\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right) \cdot t_1\right)\\
\mathbf{elif}\;a \leq 2 \cdot 10^{+185}:\\
\;\;\;\;t_2 \cdot t_3\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(b - a\right) \cdot \left(t_1 \cdot t_3\right)\right)\\
\end{array}
\end{array}
if a < 1.6e-51Initial program 57.6%
associate-*l*57.6%
unpow257.6%
unpow257.6%
difference-of-squares58.8%
Simplified58.8%
Taylor expanded in angle around inf 68.1%
associate-*r*68.1%
*-commutative68.1%
*-commutative68.1%
*-commutative68.1%
*-commutative68.1%
associate-*r*68.9%
+-commutative68.9%
*-commutative68.9%
*-commutative68.9%
associate-*r*69.2%
Simplified69.2%
Taylor expanded in angle around inf 68.9%
if 1.6e-51 < a < 2e185Initial program 55.1%
associate-*l*55.1%
unpow255.1%
unpow255.1%
difference-of-squares55.1%
Simplified55.1%
Taylor expanded in angle around inf 64.3%
associate-*r*64.3%
*-commutative64.3%
*-commutative64.3%
*-commutative64.3%
*-commutative64.3%
associate-*r*65.3%
+-commutative65.3%
*-commutative65.3%
*-commutative65.3%
associate-*r*65.0%
Simplified65.0%
add-cbrt-cube69.6%
Applied egg-rr69.6%
Taylor expanded in angle around inf 69.2%
Taylor expanded in angle around 0 72.8%
if 2e185 < a Initial program 55.7%
associate-*l*55.7%
unpow255.7%
unpow255.7%
difference-of-squares68.2%
Simplified68.2%
Taylor expanded in angle around inf 91.3%
Final simplification71.9%
NOTE: a should be positive before calling this function
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (* 2.0 (- b a)))
(t_1 (* 0.005555555555555556 (* PI angle)))
(t_2 (* (+ b a) (sin t_1)))
(t_3 (* PI (* angle 0.005555555555555556))))
(if (<= a 4e-49)
(* t_0 (* (cos t_3) (* (+ b a) (sin t_3))))
(if (<= a 2e+185) (* t_0 t_2) (* 2.0 (* (- b a) (* (cos t_1) t_2)))))))a = abs(a);
double code(double a, double b, double angle) {
double t_0 = 2.0 * (b - a);
double t_1 = 0.005555555555555556 * (((double) M_PI) * angle);
double t_2 = (b + a) * sin(t_1);
double t_3 = ((double) M_PI) * (angle * 0.005555555555555556);
double tmp;
if (a <= 4e-49) {
tmp = t_0 * (cos(t_3) * ((b + a) * sin(t_3)));
} else if (a <= 2e+185) {
tmp = t_0 * t_2;
} else {
tmp = 2.0 * ((b - a) * (cos(t_1) * t_2));
}
return tmp;
}
a = Math.abs(a);
public static double code(double a, double b, double angle) {
double t_0 = 2.0 * (b - a);
double t_1 = 0.005555555555555556 * (Math.PI * angle);
double t_2 = (b + a) * Math.sin(t_1);
double t_3 = Math.PI * (angle * 0.005555555555555556);
double tmp;
if (a <= 4e-49) {
tmp = t_0 * (Math.cos(t_3) * ((b + a) * Math.sin(t_3)));
} else if (a <= 2e+185) {
tmp = t_0 * t_2;
} else {
tmp = 2.0 * ((b - a) * (Math.cos(t_1) * t_2));
}
return tmp;
}
a = abs(a) def code(a, b, angle): t_0 = 2.0 * (b - a) t_1 = 0.005555555555555556 * (math.pi * angle) t_2 = (b + a) * math.sin(t_1) t_3 = math.pi * (angle * 0.005555555555555556) tmp = 0 if a <= 4e-49: tmp = t_0 * (math.cos(t_3) * ((b + a) * math.sin(t_3))) elif a <= 2e+185: tmp = t_0 * t_2 else: tmp = 2.0 * ((b - a) * (math.cos(t_1) * t_2)) return tmp
a = abs(a) function code(a, b, angle) t_0 = Float64(2.0 * Float64(b - a)) t_1 = Float64(0.005555555555555556 * Float64(pi * angle)) t_2 = Float64(Float64(b + a) * sin(t_1)) t_3 = Float64(pi * Float64(angle * 0.005555555555555556)) tmp = 0.0 if (a <= 4e-49) tmp = Float64(t_0 * Float64(cos(t_3) * Float64(Float64(b + a) * sin(t_3)))); elseif (a <= 2e+185) tmp = Float64(t_0 * t_2); else tmp = Float64(2.0 * Float64(Float64(b - a) * Float64(cos(t_1) * t_2))); end return tmp end
a = abs(a) function tmp_2 = code(a, b, angle) t_0 = 2.0 * (b - a); t_1 = 0.005555555555555556 * (pi * angle); t_2 = (b + a) * sin(t_1); t_3 = pi * (angle * 0.005555555555555556); tmp = 0.0; if (a <= 4e-49) tmp = t_0 * (cos(t_3) * ((b + a) * sin(t_3))); elseif (a <= 2e+185) tmp = t_0 * t_2; else tmp = 2.0 * ((b - a) * (cos(t_1) * t_2)); end tmp_2 = tmp; end
NOTE: a 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[(0.005555555555555556 * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(b + a), $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, 4e-49], N[(t$95$0 * N[(N[Cos[t$95$3], $MachinePrecision] * N[(N[(b + a), $MachinePrecision] * N[Sin[t$95$3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 2e+185], N[(t$95$0 * t$95$2), $MachinePrecision], N[(2.0 * N[(N[(b - a), $MachinePrecision] * N[(N[Cos[t$95$1], $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
a = |a|\\
\\
\begin{array}{l}
t_0 := 2 \cdot \left(b - a\right)\\
t_1 := 0.005555555555555556 \cdot \left(\pi \cdot angle\right)\\
t_2 := \left(b + a\right) \cdot \sin t_1\\
t_3 := \pi \cdot \left(angle \cdot 0.005555555555555556\right)\\
\mathbf{if}\;a \leq 4 \cdot 10^{-49}:\\
\;\;\;\;t_0 \cdot \left(\cos t_3 \cdot \left(\left(b + a\right) \cdot \sin t_3\right)\right)\\
\mathbf{elif}\;a \leq 2 \cdot 10^{+185}:\\
\;\;\;\;t_0 \cdot t_2\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(b - a\right) \cdot \left(\cos t_1 \cdot t_2\right)\right)\\
\end{array}
\end{array}
if a < 3.99999999999999975e-49Initial program 57.6%
associate-*l*57.6%
unpow257.6%
unpow257.6%
difference-of-squares58.8%
Simplified58.8%
Taylor expanded in angle around inf 68.1%
associate-*r*68.1%
*-commutative68.1%
*-commutative68.1%
*-commutative68.1%
*-commutative68.1%
associate-*r*68.9%
+-commutative68.9%
*-commutative68.9%
*-commutative68.9%
associate-*r*69.2%
Simplified69.2%
if 3.99999999999999975e-49 < a < 2e185Initial program 55.1%
associate-*l*55.1%
unpow255.1%
unpow255.1%
difference-of-squares55.1%
Simplified55.1%
Taylor expanded in angle around inf 64.3%
associate-*r*64.3%
*-commutative64.3%
*-commutative64.3%
*-commutative64.3%
*-commutative64.3%
associate-*r*65.3%
+-commutative65.3%
*-commutative65.3%
*-commutative65.3%
associate-*r*65.0%
Simplified65.0%
add-cbrt-cube69.6%
Applied egg-rr69.6%
Taylor expanded in angle around inf 69.2%
Taylor expanded in angle around 0 72.8%
if 2e185 < a Initial program 55.7%
associate-*l*55.7%
unpow255.7%
unpow255.7%
difference-of-squares68.2%
Simplified68.2%
Taylor expanded in angle around inf 91.3%
Final simplification72.1%
NOTE: a should be positive before calling this function (FPCore (a b angle) :precision binary64 (let* ((t_0 (* 0.005555555555555556 (* PI angle)))) (* 2.0 (* (- b a) (* (cos t_0) (* (+ b a) (sin t_0)))))))
a = abs(a);
double code(double a, double b, double angle) {
double t_0 = 0.005555555555555556 * (((double) M_PI) * angle);
return 2.0 * ((b - a) * (cos(t_0) * ((b + a) * sin(t_0))));
}
a = Math.abs(a);
public static double code(double a, double b, double angle) {
double t_0 = 0.005555555555555556 * (Math.PI * angle);
return 2.0 * ((b - a) * (Math.cos(t_0) * ((b + a) * Math.sin(t_0))));
}
a = abs(a) def code(a, b, angle): t_0 = 0.005555555555555556 * (math.pi * angle) return 2.0 * ((b - a) * (math.cos(t_0) * ((b + a) * math.sin(t_0))))
a = abs(a) function code(a, b, angle) t_0 = Float64(0.005555555555555556 * Float64(pi * angle)) return Float64(2.0 * Float64(Float64(b - a) * Float64(cos(t_0) * Float64(Float64(b + a) * sin(t_0))))) end
a = abs(a) function tmp = code(a, b, angle) t_0 = 0.005555555555555556 * (pi * angle); tmp = 2.0 * ((b - a) * (cos(t_0) * ((b + a) * sin(t_0)))); end
NOTE: a 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[(b - a), $MachinePrecision] * N[(N[Cos[t$95$0], $MachinePrecision] * N[(N[(b + a), $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
a = |a|\\
\\
\begin{array}{l}
t_0 := 0.005555555555555556 \cdot \left(\pi \cdot angle\right)\\
2 \cdot \left(\left(b - a\right) \cdot \left(\cos t_0 \cdot \left(\left(b + a\right) \cdot \sin 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%
Taylor expanded in angle around inf 69.4%
Final simplification69.4%
NOTE: a should be positive before calling this function
(FPCore (a b angle)
:precision binary64
(if (<= (/ angle 180.0) -2e-79)
(* (sin (* PI (/ angle 180.0))) (* 2.0 (* (+ b a) (- b a))))
(*
(* 2.0 (- b a))
(* (+ b a) (sin (expm1 (log1p (* PI (* angle 0.005555555555555556)))))))))a = abs(a);
double code(double a, double b, double angle) {
double tmp;
if ((angle / 180.0) <= -2e-79) {
tmp = sin((((double) M_PI) * (angle / 180.0))) * (2.0 * ((b + a) * (b - a)));
} else {
tmp = (2.0 * (b - a)) * ((b + a) * sin(expm1(log1p((((double) M_PI) * (angle * 0.005555555555555556))))));
}
return tmp;
}
a = Math.abs(a);
public static double code(double a, double b, double angle) {
double tmp;
if ((angle / 180.0) <= -2e-79) {
tmp = Math.sin((Math.PI * (angle / 180.0))) * (2.0 * ((b + a) * (b - a)));
} else {
tmp = (2.0 * (b - a)) * ((b + a) * Math.sin(Math.expm1(Math.log1p((Math.PI * (angle * 0.005555555555555556))))));
}
return tmp;
}
a = abs(a) def code(a, b, angle): tmp = 0 if (angle / 180.0) <= -2e-79: tmp = math.sin((math.pi * (angle / 180.0))) * (2.0 * ((b + a) * (b - a))) else: tmp = (2.0 * (b - a)) * ((b + a) * math.sin(math.expm1(math.log1p((math.pi * (angle * 0.005555555555555556)))))) return tmp
a = abs(a) function code(a, b, angle) tmp = 0.0 if (Float64(angle / 180.0) <= -2e-79) tmp = Float64(sin(Float64(pi * Float64(angle / 180.0))) * Float64(2.0 * Float64(Float64(b + a) * Float64(b - a)))); else tmp = Float64(Float64(2.0 * Float64(b - a)) * Float64(Float64(b + a) * sin(expm1(log1p(Float64(pi * Float64(angle * 0.005555555555555556))))))); end return tmp end
NOTE: a should be positive before calling this function code[a_, b_, angle_] := If[LessEqual[N[(angle / 180.0), $MachinePrecision], -2e-79], N[(N[Sin[N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(2.0 * N[(N[(b + a), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[(N[(b + a), $MachinePrecision] * N[Sin[N[(Exp[N[Log[1 + N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
a = |a|\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{angle}{180} \leq -2 \cdot 10^{-79}:\\
\;\;\;\;\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(2 \cdot \left(b - a\right)\right) \cdot \left(\left(b + a\right) \cdot \sin \left(\mathsf{expm1}\left(\mathsf{log1p}\left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle 180) < -2e-79Initial program 48.7%
associate-*l*48.7%
unpow248.7%
unpow248.7%
difference-of-squares51.4%
Simplified51.4%
Taylor expanded in angle around 0 52.7%
if -2e-79 < (/.f64 angle 180) Initial program 60.1%
associate-*l*60.1%
unpow260.1%
unpow260.1%
difference-of-squares61.8%
Simplified61.8%
Taylor expanded in angle around inf 78.0%
associate-*r*78.0%
*-commutative78.0%
*-commutative78.0%
*-commutative78.0%
*-commutative78.0%
associate-*r*78.2%
+-commutative78.2%
*-commutative78.2%
*-commutative78.2%
associate-*r*78.4%
Simplified78.4%
expm1-log1p-u77.9%
Applied egg-rr77.9%
Taylor expanded in angle around 0 74.8%
Final simplification68.4%
NOTE: a should be positive before calling this function
(FPCore (a b angle)
:precision binary64
(if (<= a 4e-124)
(pow (cbrt (* b (* b (sin (* angle (* PI 0.011111111111111112)))))) 3.0)
(*
(* 2.0 (- b a))
(* (+ b a) (sin (* PI (* angle 0.005555555555555556)))))))a = abs(a);
double code(double a, double b, double angle) {
double tmp;
if (a <= 4e-124) {
tmp = pow(cbrt((b * (b * sin((angle * (((double) M_PI) * 0.011111111111111112)))))), 3.0);
} else {
tmp = (2.0 * (b - a)) * ((b + a) * sin((((double) M_PI) * (angle * 0.005555555555555556))));
}
return tmp;
}
a = Math.abs(a);
public static double code(double a, double b, double angle) {
double tmp;
if (a <= 4e-124) {
tmp = Math.pow(Math.cbrt((b * (b * Math.sin((angle * (Math.PI * 0.011111111111111112)))))), 3.0);
} else {
tmp = (2.0 * (b - a)) * ((b + a) * Math.sin((Math.PI * (angle * 0.005555555555555556))));
}
return tmp;
}
a = abs(a) function code(a, b, angle) tmp = 0.0 if (a <= 4e-124) tmp = cbrt(Float64(b * Float64(b * sin(Float64(angle * Float64(pi * 0.011111111111111112)))))) ^ 3.0; else tmp = Float64(Float64(2.0 * Float64(b - a)) * Float64(Float64(b + a) * sin(Float64(pi * Float64(angle * 0.005555555555555556))))); end return tmp end
NOTE: a should be positive before calling this function code[a_, b_, angle_] := If[LessEqual[a, 4e-124], N[Power[N[Power[N[(b * N[(b * N[Sin[N[(angle * N[(Pi * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision], N[(N[(2.0 * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[(N[(b + a), $MachinePrecision] * N[Sin[N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
a = |a|\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq 4 \cdot 10^{-124}:\\
\;\;\;\;{\left(\sqrt[3]{b \cdot \left(b \cdot \sin \left(angle \cdot \left(\pi \cdot 0.011111111111111112\right)\right)\right)}\right)}^{3}\\
\mathbf{else}:\\
\;\;\;\;\left(2 \cdot \left(b - a\right)\right) \cdot \left(\left(b + a\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\\
\end{array}
\end{array}
if a < 3.99999999999999973e-124Initial program 59.4%
*-commutative59.4%
associate-*l*59.4%
unpow259.4%
fma-neg60.0%
unpow260.0%
Simplified60.0%
Applied egg-rr46.4%
Taylor expanded in b around inf 43.5%
*-commutative43.5%
unpow243.5%
associate-*l*47.5%
*-commutative47.5%
associate-*l*47.8%
Simplified47.8%
if 3.99999999999999973e-124 < a Initial program 52.6%
associate-*l*52.6%
unpow252.6%
unpow252.6%
difference-of-squares55.7%
Simplified55.7%
Taylor expanded in angle around inf 70.1%
associate-*r*70.1%
*-commutative70.1%
*-commutative70.1%
*-commutative70.1%
*-commutative70.1%
associate-*r*70.7%
+-commutative70.7%
*-commutative70.7%
*-commutative70.7%
associate-*r*70.5%
Simplified70.5%
Taylor expanded in angle around 0 70.9%
Final simplification56.5%
NOTE: a should be positive before calling this function
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (* 0.005555555555555556 (* PI angle))))
(if (<= a 7.2e-208)
(* 2.0 (* t_0 (* (cos t_0) (* b b))))
(* (* 2.0 (- b a)) (* (+ b a) (sin t_0))))))a = abs(a);
double code(double a, double b, double angle) {
double t_0 = 0.005555555555555556 * (((double) M_PI) * angle);
double tmp;
if (a <= 7.2e-208) {
tmp = 2.0 * (t_0 * (cos(t_0) * (b * b)));
} else {
tmp = (2.0 * (b - a)) * ((b + a) * sin(t_0));
}
return tmp;
}
a = Math.abs(a);
public static double code(double a, double b, double angle) {
double t_0 = 0.005555555555555556 * (Math.PI * angle);
double tmp;
if (a <= 7.2e-208) {
tmp = 2.0 * (t_0 * (Math.cos(t_0) * (b * b)));
} else {
tmp = (2.0 * (b - a)) * ((b + a) * Math.sin(t_0));
}
return tmp;
}
a = abs(a) def code(a, b, angle): t_0 = 0.005555555555555556 * (math.pi * angle) tmp = 0 if a <= 7.2e-208: tmp = 2.0 * (t_0 * (math.cos(t_0) * (b * b))) else: tmp = (2.0 * (b - a)) * ((b + a) * math.sin(t_0)) return tmp
a = abs(a) function code(a, b, angle) t_0 = Float64(0.005555555555555556 * Float64(pi * angle)) tmp = 0.0 if (a <= 7.2e-208) tmp = Float64(2.0 * Float64(t_0 * Float64(cos(t_0) * Float64(b * b)))); else tmp = Float64(Float64(2.0 * Float64(b - a)) * Float64(Float64(b + a) * sin(t_0))); end return tmp end
a = abs(a) function tmp_2 = code(a, b, angle) t_0 = 0.005555555555555556 * (pi * angle); tmp = 0.0; if (a <= 7.2e-208) tmp = 2.0 * (t_0 * (cos(t_0) * (b * b))); else tmp = (2.0 * (b - a)) * ((b + a) * 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[(0.005555555555555556 * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, 7.2e-208], N[(2.0 * N[(t$95$0 * N[(N[Cos[t$95$0], $MachinePrecision] * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[(N[(b + a), $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
a = |a|\\
\\
\begin{array}{l}
t_0 := 0.005555555555555556 \cdot \left(\pi \cdot angle\right)\\
\mathbf{if}\;a \leq 7.2 \cdot 10^{-208}:\\
\;\;\;\;2 \cdot \left(t_0 \cdot \left(\cos t_0 \cdot \left(b \cdot b\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(2 \cdot \left(b - a\right)\right) \cdot \left(\left(b + a\right) \cdot \sin t_0\right)\\
\end{array}
\end{array}
if a < 7.1999999999999997e-208Initial program 59.2%
associate-*l*59.2%
unpow259.2%
unpow259.2%
difference-of-squares60.7%
Simplified60.7%
Taylor expanded in angle around inf 58.6%
Taylor expanded in b around inf 40.6%
associate-*r*40.6%
unpow240.6%
Simplified40.6%
Taylor expanded in angle around 0 40.8%
if 7.1999999999999997e-208 < a Initial program 53.9%
associate-*l*53.9%
unpow253.9%
unpow253.9%
difference-of-squares56.5%
Simplified56.5%
Taylor expanded in angle around inf 70.4%
associate-*r*70.4%
*-commutative70.4%
*-commutative70.4%
*-commutative70.4%
*-commutative70.4%
associate-*r*70.9%
+-commutative70.9%
*-commutative70.9%
*-commutative70.9%
associate-*r*69.7%
Simplified69.7%
add-cbrt-cube71.9%
Applied egg-rr71.9%
Taylor expanded in angle around inf 71.7%
Taylor expanded in angle around 0 69.5%
Final simplification53.7%
NOTE: a should be positive before calling this function
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (* 2.0 (* (+ b a) (- b a)))))
(if (<= (/ angle 180.0) -2e-15)
(* (sin (* PI (/ angle 180.0))) t_0)
(if (<= (/ angle 180.0) 5e-9)
(* 0.011111111111111112 (* (* PI (+ b a)) (* angle (- b a))))
(* (sin (* 0.005555555555555556 (* PI angle))) t_0)))))a = abs(a);
double code(double a, double b, double angle) {
double t_0 = 2.0 * ((b + a) * (b - a));
double tmp;
if ((angle / 180.0) <= -2e-15) {
tmp = sin((((double) M_PI) * (angle / 180.0))) * t_0;
} else if ((angle / 180.0) <= 5e-9) {
tmp = 0.011111111111111112 * ((((double) M_PI) * (b + a)) * (angle * (b - a)));
} else {
tmp = sin((0.005555555555555556 * (((double) M_PI) * angle))) * t_0;
}
return tmp;
}
a = Math.abs(a);
public static double code(double a, double b, double angle) {
double t_0 = 2.0 * ((b + a) * (b - a));
double tmp;
if ((angle / 180.0) <= -2e-15) {
tmp = Math.sin((Math.PI * (angle / 180.0))) * t_0;
} else if ((angle / 180.0) <= 5e-9) {
tmp = 0.011111111111111112 * ((Math.PI * (b + a)) * (angle * (b - a)));
} else {
tmp = Math.sin((0.005555555555555556 * (Math.PI * angle))) * t_0;
}
return tmp;
}
a = abs(a) def code(a, b, angle): t_0 = 2.0 * ((b + a) * (b - a)) tmp = 0 if (angle / 180.0) <= -2e-15: tmp = math.sin((math.pi * (angle / 180.0))) * t_0 elif (angle / 180.0) <= 5e-9: tmp = 0.011111111111111112 * ((math.pi * (b + a)) * (angle * (b - a))) else: tmp = math.sin((0.005555555555555556 * (math.pi * angle))) * t_0 return tmp
a = abs(a) function code(a, b, angle) t_0 = Float64(2.0 * Float64(Float64(b + a) * Float64(b - a))) tmp = 0.0 if (Float64(angle / 180.0) <= -2e-15) tmp = Float64(sin(Float64(pi * Float64(angle / 180.0))) * t_0); elseif (Float64(angle / 180.0) <= 5e-9) tmp = Float64(0.011111111111111112 * Float64(Float64(pi * Float64(b + a)) * Float64(angle * Float64(b - a)))); else tmp = Float64(sin(Float64(0.005555555555555556 * Float64(pi * angle))) * t_0); end return tmp end
a = abs(a) function tmp_2 = code(a, b, angle) t_0 = 2.0 * ((b + a) * (b - a)); tmp = 0.0; if ((angle / 180.0) <= -2e-15) tmp = sin((pi * (angle / 180.0))) * t_0; elseif ((angle / 180.0) <= 5e-9) tmp = 0.011111111111111112 * ((pi * (b + a)) * (angle * (b - a))); else tmp = sin((0.005555555555555556 * (pi * angle))) * 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[(2.0 * N[(N[(b + a), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(angle / 180.0), $MachinePrecision], -2e-15], N[(N[Sin[N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[N[(angle / 180.0), $MachinePrecision], 5e-9], N[(0.011111111111111112 * N[(N[(Pi * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[(angle * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sin[N[(0.005555555555555556 * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision]]]]
\begin{array}{l}
a = |a|\\
\\
\begin{array}{l}
t_0 := 2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\\
\mathbf{if}\;\frac{angle}{180} \leq -2 \cdot 10^{-15}:\\
\;\;\;\;\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot t_0\\
\mathbf{elif}\;\frac{angle}{180} \leq 5 \cdot 10^{-9}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(\pi \cdot \left(b + a\right)\right) \cdot \left(angle \cdot \left(b - a\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\sin \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right) \cdot t_0\\
\end{array}
\end{array}
if (/.f64 angle 180) < -2.0000000000000002e-15Initial program 37.8%
associate-*l*37.8%
unpow237.8%
unpow237.8%
difference-of-squares41.1%
Simplified41.1%
Taylor expanded in angle around 0 42.6%
if -2.0000000000000002e-15 < (/.f64 angle 180) < 5.0000000000000001e-9Initial program 76.2%
associate-*l*76.2%
unpow276.2%
unpow276.2%
difference-of-squares77.7%
Simplified77.7%
Taylor expanded in angle around 0 77.9%
associate-*r*99.7%
*-commutative99.7%
+-commutative99.7%
Simplified99.7%
if 5.0000000000000001e-9 < (/.f64 angle 180) Initial program 34.1%
associate-*l*34.1%
unpow234.1%
unpow234.1%
difference-of-squares35.7%
Simplified35.7%
Taylor expanded in angle around inf 35.5%
Taylor expanded in angle around 0 22.1%
Final simplification67.3%
NOTE: a should be positive before calling this function (FPCore (a b angle) :precision binary64 (if (or (<= angle -1e-13) (not (<= angle 0.000116))) (* (sin (* 0.005555555555555556 (* PI angle))) (* 2.0 (* (+ b a) (- b a)))) (* 0.011111111111111112 (* (* PI (+ b a)) (* angle (- b a))))))
a = abs(a);
double code(double a, double b, double angle) {
double tmp;
if ((angle <= -1e-13) || !(angle <= 0.000116)) {
tmp = sin((0.005555555555555556 * (((double) M_PI) * angle))) * (2.0 * ((b + a) * (b - a)));
} else {
tmp = 0.011111111111111112 * ((((double) M_PI) * (b + a)) * (angle * (b - a)));
}
return tmp;
}
a = Math.abs(a);
public static double code(double a, double b, double angle) {
double tmp;
if ((angle <= -1e-13) || !(angle <= 0.000116)) {
tmp = Math.sin((0.005555555555555556 * (Math.PI * angle))) * (2.0 * ((b + a) * (b - a)));
} else {
tmp = 0.011111111111111112 * ((Math.PI * (b + a)) * (angle * (b - a)));
}
return tmp;
}
a = abs(a) def code(a, b, angle): tmp = 0 if (angle <= -1e-13) or not (angle <= 0.000116): tmp = math.sin((0.005555555555555556 * (math.pi * angle))) * (2.0 * ((b + a) * (b - a))) else: tmp = 0.011111111111111112 * ((math.pi * (b + a)) * (angle * (b - a))) return tmp
a = abs(a) function code(a, b, angle) tmp = 0.0 if ((angle <= -1e-13) || !(angle <= 0.000116)) tmp = Float64(sin(Float64(0.005555555555555556 * Float64(pi * angle))) * Float64(2.0 * Float64(Float64(b + a) * Float64(b - a)))); else tmp = Float64(0.011111111111111112 * Float64(Float64(pi * Float64(b + a)) * Float64(angle * Float64(b - a)))); end return tmp end
a = abs(a) function tmp_2 = code(a, b, angle) tmp = 0.0; if ((angle <= -1e-13) || ~((angle <= 0.000116))) tmp = sin((0.005555555555555556 * (pi * angle))) * (2.0 * ((b + a) * (b - a))); else tmp = 0.011111111111111112 * ((pi * (b + a)) * (angle * (b - a))); end tmp_2 = tmp; end
NOTE: a should be positive before calling this function code[a_, b_, angle_] := If[Or[LessEqual[angle, -1e-13], N[Not[LessEqual[angle, 0.000116]], $MachinePrecision]], N[(N[Sin[N[(0.005555555555555556 * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(2.0 * N[(N[(b + a), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(N[(Pi * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[(angle * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
a = |a|\\
\\
\begin{array}{l}
\mathbf{if}\;angle \leq -1 \cdot 10^{-13} \lor \neg \left(angle \leq 0.000116\right):\\
\;\;\;\;\sin \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right) \cdot \left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(\pi \cdot \left(b + a\right)\right) \cdot \left(angle \cdot \left(b - a\right)\right)\right)\\
\end{array}
\end{array}
if angle < -1e-13 or 1.16e-4 < angle Initial program 35.9%
associate-*l*35.9%
unpow235.9%
unpow235.9%
difference-of-squares38.4%
Simplified38.4%
Taylor expanded in angle around inf 35.3%
Taylor expanded in angle around 0 30.7%
if -1e-13 < angle < 1.16e-4Initial program 76.2%
associate-*l*76.2%
unpow276.2%
unpow276.2%
difference-of-squares77.7%
Simplified77.7%
Taylor expanded in angle around 0 77.9%
associate-*r*99.7%
*-commutative99.7%
+-commutative99.7%
Simplified99.7%
Final simplification66.5%
NOTE: a should be positive before calling this function (FPCore (a b angle) :precision binary64 (* (* 2.0 (- b a)) (* (+ b a) (sin (* 0.005555555555555556 (* PI angle))))))
a = abs(a);
double code(double a, double b, double angle) {
return (2.0 * (b - a)) * ((b + a) * sin((0.005555555555555556 * (((double) M_PI) * angle))));
}
a = Math.abs(a);
public static double code(double a, double b, double angle) {
return (2.0 * (b - a)) * ((b + a) * Math.sin((0.005555555555555556 * (Math.PI * angle))));
}
a = abs(a) def code(a, b, angle): return (2.0 * (b - a)) * ((b + a) * math.sin((0.005555555555555556 * (math.pi * angle))))
a = abs(a) function code(a, b, angle) return Float64(Float64(2.0 * Float64(b - a)) * Float64(Float64(b + a) * sin(Float64(0.005555555555555556 * Float64(pi * angle))))) end
a = abs(a) function tmp = code(a, b, angle) tmp = (2.0 * (b - a)) * ((b + a) * sin((0.005555555555555556 * (pi * angle)))); end
NOTE: a should be positive before calling this function code[a_, b_, angle_] := N[(N[(2.0 * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[(N[(b + a), $MachinePrecision] * N[Sin[N[(0.005555555555555556 * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
a = |a|\\
\\
\left(2 \cdot \left(b - a\right)\right) \cdot \left(\left(b + a\right) \cdot \sin \left(0.005555555555555556 \cdot \left(\pi \cdot angle\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 inf 69.4%
associate-*r*69.4%
*-commutative69.4%
*-commutative69.4%
*-commutative69.4%
*-commutative69.4%
associate-*r*70.2%
+-commutative70.2%
*-commutative70.2%
*-commutative70.2%
associate-*r*70.3%
Simplified70.3%
add-cbrt-cube71.0%
Applied egg-rr71.0%
Taylor expanded in angle around inf 71.2%
Taylor expanded in angle around 0 66.4%
Final simplification66.4%
NOTE: a should be positive before calling this function (FPCore (a b angle) :precision binary64 (if (<= a 2.15e+141) (* 0.011111111111111112 (* angle (* (- b a) (* PI (+ b a))))) (* PI (* a (* angle (* a -0.011111111111111112))))))
a = abs(a);
double code(double a, double b, double angle) {
double tmp;
if (a <= 2.15e+141) {
tmp = 0.011111111111111112 * (angle * ((b - a) * (((double) M_PI) * (b + a))));
} else {
tmp = ((double) M_PI) * (a * (angle * (a * -0.011111111111111112)));
}
return tmp;
}
a = Math.abs(a);
public static double code(double a, double b, double angle) {
double tmp;
if (a <= 2.15e+141) {
tmp = 0.011111111111111112 * (angle * ((b - a) * (Math.PI * (b + a))));
} else {
tmp = Math.PI * (a * (angle * (a * -0.011111111111111112)));
}
return tmp;
}
a = abs(a) def code(a, b, angle): tmp = 0 if a <= 2.15e+141: tmp = 0.011111111111111112 * (angle * ((b - a) * (math.pi * (b + a)))) else: tmp = math.pi * (a * (angle * (a * -0.011111111111111112))) return tmp
a = abs(a) function code(a, b, angle) tmp = 0.0 if (a <= 2.15e+141) tmp = Float64(0.011111111111111112 * Float64(angle * Float64(Float64(b - a) * Float64(pi * Float64(b + a))))); else tmp = Float64(pi * Float64(a * Float64(angle * Float64(a * -0.011111111111111112)))); end return tmp end
a = abs(a) function tmp_2 = code(a, b, angle) tmp = 0.0; if (a <= 2.15e+141) tmp = 0.011111111111111112 * (angle * ((b - a) * (pi * (b + a)))); else tmp = pi * (a * (angle * (a * -0.011111111111111112))); end tmp_2 = tmp; end
NOTE: a should be positive before calling this function code[a_, b_, angle_] := If[LessEqual[a, 2.15e+141], N[(0.011111111111111112 * N[(angle * N[(N[(b - a), $MachinePrecision] * N[(Pi * N[(b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(Pi * N[(a * N[(angle * N[(a * -0.011111111111111112), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
a = |a|\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq 2.15 \cdot 10^{+141}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle \cdot \left(\left(b - a\right) \cdot \left(\pi \cdot \left(b + a\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\pi \cdot \left(a \cdot \left(angle \cdot \left(a \cdot -0.011111111111111112\right)\right)\right)\\
\end{array}
\end{array}
if a < 2.1499999999999999e141Initial program 58.0%
associate-*l*58.0%
unpow258.0%
unpow258.0%
difference-of-squares59.0%
Simplified59.0%
Taylor expanded in angle around 0 54.5%
if 2.1499999999999999e141 < a Initial program 49.0%
associate-*l*49.0%
unpow249.0%
unpow249.0%
difference-of-squares57.8%
Simplified57.8%
Taylor expanded in angle around 0 39.6%
Taylor expanded in b around 0 39.6%
*-commutative39.6%
associate-*l*39.6%
*-commutative39.6%
unpow239.6%
Simplified39.6%
Taylor expanded in angle around 0 39.6%
associate-*r*39.6%
unpow239.6%
Simplified39.6%
Taylor expanded in angle around 0 39.6%
associate-*r*39.6%
unpow239.6%
associate-*r*39.6%
*-commutative39.6%
associate-*r*61.8%
*-commutative61.8%
*-commutative61.8%
associate-*l*61.8%
Simplified61.8%
Final simplification55.4%
NOTE: a should be positive before calling this function (FPCore (a b angle) :precision binary64 (if (<= a 2.05e+63) (* 0.011111111111111112 (* angle (* (- b a) (* PI b)))) (* PI (* a (* angle (* a -0.011111111111111112))))))
a = abs(a);
double code(double a, double b, double angle) {
double tmp;
if (a <= 2.05e+63) {
tmp = 0.011111111111111112 * (angle * ((b - a) * (((double) M_PI) * b)));
} else {
tmp = ((double) M_PI) * (a * (angle * (a * -0.011111111111111112)));
}
return tmp;
}
a = Math.abs(a);
public static double code(double a, double b, double angle) {
double tmp;
if (a <= 2.05e+63) {
tmp = 0.011111111111111112 * (angle * ((b - a) * (Math.PI * b)));
} else {
tmp = Math.PI * (a * (angle * (a * -0.011111111111111112)));
}
return tmp;
}
a = abs(a) def code(a, b, angle): tmp = 0 if a <= 2.05e+63: tmp = 0.011111111111111112 * (angle * ((b - a) * (math.pi * b))) else: tmp = math.pi * (a * (angle * (a * -0.011111111111111112))) return tmp
a = abs(a) function code(a, b, angle) tmp = 0.0 if (a <= 2.05e+63) tmp = Float64(0.011111111111111112 * Float64(angle * Float64(Float64(b - a) * Float64(pi * b)))); else tmp = Float64(pi * Float64(a * Float64(angle * Float64(a * -0.011111111111111112)))); end return tmp end
a = abs(a) function tmp_2 = code(a, b, angle) tmp = 0.0; if (a <= 2.05e+63) tmp = 0.011111111111111112 * (angle * ((b - a) * (pi * b))); else tmp = pi * (a * (angle * (a * -0.011111111111111112))); end tmp_2 = tmp; end
NOTE: a should be positive before calling this function code[a_, b_, angle_] := If[LessEqual[a, 2.05e+63], N[(0.011111111111111112 * N[(angle * N[(N[(b - a), $MachinePrecision] * N[(Pi * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(Pi * N[(a * N[(angle * N[(a * -0.011111111111111112), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
a = |a|\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq 2.05 \cdot 10^{+63}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle \cdot \left(\left(b - a\right) \cdot \left(\pi \cdot b\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\pi \cdot \left(a \cdot \left(angle \cdot \left(a \cdot -0.011111111111111112\right)\right)\right)\\
\end{array}
\end{array}
if a < 2.04999999999999996e63Initial program 57.9%
associate-*l*57.9%
unpow257.9%
unpow257.9%
difference-of-squares58.9%
Simplified58.9%
Taylor expanded in angle around 0 53.6%
Taylor expanded in a around 0 43.3%
*-commutative43.3%
Simplified43.3%
if 2.04999999999999996e63 < a Initial program 53.3%
associate-*l*53.3%
unpow253.3%
unpow253.3%
difference-of-squares58.5%
Simplified58.5%
Taylor expanded in angle around 0 48.7%
Taylor expanded in b around 0 41.5%
*-commutative41.5%
associate-*l*41.4%
*-commutative41.4%
unpow241.4%
Simplified41.4%
Taylor expanded in angle around 0 41.5%
associate-*r*41.4%
unpow241.4%
Simplified41.4%
Taylor expanded in angle around 0 41.5%
associate-*r*41.4%
unpow241.4%
associate-*r*41.4%
*-commutative41.4%
associate-*r*54.6%
*-commutative54.6%
*-commutative54.6%
associate-*l*54.6%
Simplified54.6%
Final simplification45.8%
NOTE: a should be positive before calling this function (FPCore (a b angle) :precision binary64 (* 0.011111111111111112 (* (* PI (+ b a)) (* angle (- b a)))))
a = abs(a);
double code(double a, double b, double angle) {
return 0.011111111111111112 * ((((double) M_PI) * (b + a)) * (angle * (b - a)));
}
a = Math.abs(a);
public static double code(double a, double b, double angle) {
return 0.011111111111111112 * ((Math.PI * (b + a)) * (angle * (b - a)));
}
a = abs(a) def code(a, b, angle): return 0.011111111111111112 * ((math.pi * (b + a)) * (angle * (b - a)))
a = abs(a) function code(a, b, angle) return Float64(0.011111111111111112 * Float64(Float64(pi * Float64(b + a)) * Float64(angle * Float64(b - a)))) end
a = abs(a) function tmp = code(a, b, angle) tmp = 0.011111111111111112 * ((pi * (b + a)) * (angle * (b - a))); end
NOTE: a should be positive before calling this function code[a_, b_, angle_] := N[(0.011111111111111112 * N[(N[(Pi * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[(angle * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
a = |a|\\
\\
0.011111111111111112 \cdot \left(\left(\pi \cdot \left(b + a\right)\right) \cdot \left(angle \cdot \left(b - a\right)\right)\right)
\end{array}
Initial program 56.8%
associate-*l*56.8%
unpow256.8%
unpow256.8%
difference-of-squares58.8%
Simplified58.8%
Taylor expanded in angle around 0 52.5%
associate-*r*61.6%
*-commutative61.6%
+-commutative61.6%
Simplified61.6%
Final simplification61.6%
NOTE: a should be positive before calling this function (FPCore (a b angle) :precision binary64 (if (<= a 3.5e+58) (* angle (* 0.011111111111111112 (* PI (* b b)))) (* angle (* a (* PI (* a -0.011111111111111112))))))
a = abs(a);
double code(double a, double b, double angle) {
double tmp;
if (a <= 3.5e+58) {
tmp = angle * (0.011111111111111112 * (((double) M_PI) * (b * b)));
} else {
tmp = angle * (a * (((double) M_PI) * (a * -0.011111111111111112)));
}
return tmp;
}
a = Math.abs(a);
public static double code(double a, double b, double angle) {
double tmp;
if (a <= 3.5e+58) {
tmp = angle * (0.011111111111111112 * (Math.PI * (b * b)));
} else {
tmp = angle * (a * (Math.PI * (a * -0.011111111111111112)));
}
return tmp;
}
a = abs(a) def code(a, b, angle): tmp = 0 if a <= 3.5e+58: tmp = angle * (0.011111111111111112 * (math.pi * (b * b))) else: tmp = angle * (a * (math.pi * (a * -0.011111111111111112))) return tmp
a = abs(a) function code(a, b, angle) tmp = 0.0 if (a <= 3.5e+58) tmp = Float64(angle * Float64(0.011111111111111112 * Float64(pi * Float64(b * b)))); else tmp = Float64(angle * Float64(a * Float64(pi * Float64(a * -0.011111111111111112)))); end return tmp end
a = abs(a) function tmp_2 = code(a, b, angle) tmp = 0.0; if (a <= 3.5e+58) tmp = angle * (0.011111111111111112 * (pi * (b * b))); else tmp = angle * (a * (pi * (a * -0.011111111111111112))); end tmp_2 = tmp; end
NOTE: a should be positive before calling this function code[a_, b_, angle_] := If[LessEqual[a, 3.5e+58], N[(angle * N[(0.011111111111111112 * N[(Pi * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(angle * N[(a * N[(Pi * N[(a * -0.011111111111111112), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
a = |a|\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq 3.5 \cdot 10^{+58}:\\
\;\;\;\;angle \cdot \left(0.011111111111111112 \cdot \left(\pi \cdot \left(b \cdot b\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;angle \cdot \left(a \cdot \left(\pi \cdot \left(a \cdot -0.011111111111111112\right)\right)\right)\\
\end{array}
\end{array}
if a < 3.4999999999999997e58Initial program 58.1%
associate-*l*58.1%
unpow258.1%
unpow258.1%
difference-of-squares59.1%
Simplified59.1%
Taylor expanded in angle around 0 53.8%
Taylor expanded in b around inf 39.7%
*-commutative39.7%
associate-*l*39.7%
*-commutative39.7%
unpow239.7%
Simplified39.7%
if 3.4999999999999997e58 < a Initial program 52.7%
associate-*l*52.7%
unpow252.7%
unpow252.7%
difference-of-squares57.8%
Simplified57.8%
Taylor expanded in angle around 0 47.9%
Taylor expanded in b around 0 40.8%
*-commutative40.8%
associate-*l*40.8%
*-commutative40.8%
unpow240.8%
Simplified40.8%
Taylor expanded in angle around 0 40.8%
associate-*r*40.7%
*-commutative40.7%
*-commutative40.7%
unpow240.7%
associate-*r*40.8%
unpow240.8%
*-commutative40.8%
associate-*r*40.7%
*-commutative40.7%
unpow240.7%
associate-*l*42.4%
associate-*l*42.4%
*-commutative42.4%
Simplified42.4%
Final simplification40.3%
NOTE: a should be positive before calling this function (FPCore (a b angle) :precision binary64 (if (<= a 6.2e+53) (* angle (* 0.011111111111111112 (* PI (* b b)))) (* PI (* a (* angle (* a -0.011111111111111112))))))
a = abs(a);
double code(double a, double b, double angle) {
double tmp;
if (a <= 6.2e+53) {
tmp = angle * (0.011111111111111112 * (((double) M_PI) * (b * b)));
} else {
tmp = ((double) M_PI) * (a * (angle * (a * -0.011111111111111112)));
}
return tmp;
}
a = Math.abs(a);
public static double code(double a, double b, double angle) {
double tmp;
if (a <= 6.2e+53) {
tmp = angle * (0.011111111111111112 * (Math.PI * (b * b)));
} else {
tmp = Math.PI * (a * (angle * (a * -0.011111111111111112)));
}
return tmp;
}
a = abs(a) def code(a, b, angle): tmp = 0 if a <= 6.2e+53: tmp = angle * (0.011111111111111112 * (math.pi * (b * b))) else: tmp = math.pi * (a * (angle * (a * -0.011111111111111112))) return tmp
a = abs(a) function code(a, b, angle) tmp = 0.0 if (a <= 6.2e+53) tmp = Float64(angle * Float64(0.011111111111111112 * Float64(pi * Float64(b * b)))); else tmp = Float64(pi * Float64(a * Float64(angle * Float64(a * -0.011111111111111112)))); end return tmp end
a = abs(a) function tmp_2 = code(a, b, angle) tmp = 0.0; if (a <= 6.2e+53) tmp = angle * (0.011111111111111112 * (pi * (b * b))); else tmp = pi * (a * (angle * (a * -0.011111111111111112))); end tmp_2 = tmp; end
NOTE: a should be positive before calling this function code[a_, b_, angle_] := If[LessEqual[a, 6.2e+53], N[(angle * N[(0.011111111111111112 * N[(Pi * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(Pi * N[(a * N[(angle * N[(a * -0.011111111111111112), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
a = |a|\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq 6.2 \cdot 10^{+53}:\\
\;\;\;\;angle \cdot \left(0.011111111111111112 \cdot \left(\pi \cdot \left(b \cdot b\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\pi \cdot \left(a \cdot \left(angle \cdot \left(a \cdot -0.011111111111111112\right)\right)\right)\\
\end{array}
\end{array}
if a < 6.20000000000000038e53Initial program 58.1%
associate-*l*58.1%
unpow258.1%
unpow258.1%
difference-of-squares59.1%
Simplified59.1%
Taylor expanded in angle around 0 53.8%
Taylor expanded in b around inf 39.7%
*-commutative39.7%
associate-*l*39.7%
*-commutative39.7%
unpow239.7%
Simplified39.7%
if 6.20000000000000038e53 < a Initial program 52.7%
associate-*l*52.7%
unpow252.7%
unpow252.7%
difference-of-squares57.8%
Simplified57.8%
Taylor expanded in angle around 0 47.9%
Taylor expanded in b around 0 40.8%
*-commutative40.8%
associate-*l*40.8%
*-commutative40.8%
unpow240.8%
Simplified40.8%
Taylor expanded in angle around 0 40.8%
associate-*r*40.8%
unpow240.8%
Simplified40.8%
Taylor expanded in angle around 0 40.8%
associate-*r*40.7%
unpow240.7%
associate-*r*40.7%
*-commutative40.7%
associate-*r*53.7%
*-commutative53.7%
*-commutative53.7%
associate-*l*53.8%
Simplified53.8%
Final simplification42.9%
NOTE: a should be positive before calling this function (FPCore (a b angle) :precision binary64 (* -0.011111111111111112 (* angle (* a (* PI a)))))
a = abs(a);
double code(double a, double b, double angle) {
return -0.011111111111111112 * (angle * (a * (((double) M_PI) * a)));
}
a = Math.abs(a);
public static double code(double a, double b, double angle) {
return -0.011111111111111112 * (angle * (a * (Math.PI * a)));
}
a = abs(a) def code(a, b, angle): return -0.011111111111111112 * (angle * (a * (math.pi * a)))
a = abs(a) function code(a, b, angle) return Float64(-0.011111111111111112 * Float64(angle * Float64(a * Float64(pi * a)))) end
a = abs(a) function tmp = code(a, b, angle) tmp = -0.011111111111111112 * (angle * (a * (pi * a))); end
NOTE: a should be positive before calling this function code[a_, b_, angle_] := N[(-0.011111111111111112 * N[(angle * N[(a * N[(Pi * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
a = |a|\\
\\
-0.011111111111111112 \cdot \left(angle \cdot \left(a \cdot \left(\pi \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.5%
Taylor expanded in b around 0 32.9%
*-commutative32.9%
associate-*l*32.8%
*-commutative32.8%
unpow232.8%
Simplified32.8%
Taylor expanded in angle around 0 32.9%
associate-*r*32.8%
unpow232.8%
Simplified32.8%
Taylor expanded in angle around 0 32.9%
unpow232.9%
*-commutative32.9%
associate-*r*32.9%
Simplified32.9%
Final simplification32.9%
NOTE: a should be positive before calling this function (FPCore (a b angle) :precision binary64 (* angle (* a (* PI (* a -0.011111111111111112)))))
a = abs(a);
double code(double a, double b, double angle) {
return angle * (a * (((double) M_PI) * (a * -0.011111111111111112)));
}
a = Math.abs(a);
public static double code(double a, double b, double angle) {
return angle * (a * (Math.PI * (a * -0.011111111111111112)));
}
a = abs(a) def code(a, b, angle): return angle * (a * (math.pi * (a * -0.011111111111111112)))
a = abs(a) function code(a, b, angle) return Float64(angle * Float64(a * Float64(pi * Float64(a * -0.011111111111111112)))) end
a = abs(a) function tmp = code(a, b, angle) tmp = angle * (a * (pi * (a * -0.011111111111111112))); end
NOTE: a should be positive before calling this function code[a_, b_, angle_] := N[(angle * N[(a * N[(Pi * N[(a * -0.011111111111111112), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
a = |a|\\
\\
angle \cdot \left(a \cdot \left(\pi \cdot \left(a \cdot -0.011111111111111112\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.5%
Taylor expanded in b around 0 32.9%
*-commutative32.9%
associate-*l*32.8%
*-commutative32.8%
unpow232.8%
Simplified32.8%
Taylor expanded in angle around 0 32.9%
associate-*r*32.8%
*-commutative32.8%
*-commutative32.8%
unpow232.8%
associate-*r*32.8%
unpow232.8%
*-commutative32.8%
associate-*r*32.8%
*-commutative32.8%
unpow232.8%
associate-*l*33.2%
associate-*l*33.2%
*-commutative33.2%
Simplified33.2%
Final simplification33.2%
herbie shell --seed 2023258
(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)))))