
(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 12 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}
b_m = (fabs.f64 b)
(FPCore (a b_m angle)
:precision binary64
(let* ((t_0 (* 0.005555555555555556 (* angle PI))))
(if (<= b_m 5.6e+250)
(*
2.0
(* (* (+ b_m a) (* (- b_m a) (sin t_0))) (cos (* PI (/ angle 180.0)))))
(*
2.0
(*
(* (+ b_m a) (- b_m a))
(+ t_0 (* -2.8577960676726107e-8 (* (pow angle 3.0) (pow PI 3.0)))))))))b_m = fabs(b);
double code(double a, double b_m, double angle) {
double t_0 = 0.005555555555555556 * (angle * ((double) M_PI));
double tmp;
if (b_m <= 5.6e+250) {
tmp = 2.0 * (((b_m + a) * ((b_m - a) * sin(t_0))) * cos((((double) M_PI) * (angle / 180.0))));
} else {
tmp = 2.0 * (((b_m + a) * (b_m - a)) * (t_0 + (-2.8577960676726107e-8 * (pow(angle, 3.0) * pow(((double) M_PI), 3.0)))));
}
return tmp;
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle) {
double t_0 = 0.005555555555555556 * (angle * Math.PI);
double tmp;
if (b_m <= 5.6e+250) {
tmp = 2.0 * (((b_m + a) * ((b_m - a) * Math.sin(t_0))) * Math.cos((Math.PI * (angle / 180.0))));
} else {
tmp = 2.0 * (((b_m + a) * (b_m - a)) * (t_0 + (-2.8577960676726107e-8 * (Math.pow(angle, 3.0) * Math.pow(Math.PI, 3.0)))));
}
return tmp;
}
b_m = math.fabs(b) def code(a, b_m, angle): t_0 = 0.005555555555555556 * (angle * math.pi) tmp = 0 if b_m <= 5.6e+250: tmp = 2.0 * (((b_m + a) * ((b_m - a) * math.sin(t_0))) * math.cos((math.pi * (angle / 180.0)))) else: tmp = 2.0 * (((b_m + a) * (b_m - a)) * (t_0 + (-2.8577960676726107e-8 * (math.pow(angle, 3.0) * math.pow(math.pi, 3.0))))) return tmp
b_m = abs(b) function code(a, b_m, angle) t_0 = Float64(0.005555555555555556 * Float64(angle * pi)) tmp = 0.0 if (b_m <= 5.6e+250) tmp = Float64(2.0 * Float64(Float64(Float64(b_m + a) * Float64(Float64(b_m - a) * sin(t_0))) * cos(Float64(pi * Float64(angle / 180.0))))); else tmp = Float64(2.0 * Float64(Float64(Float64(b_m + a) * Float64(b_m - a)) * Float64(t_0 + Float64(-2.8577960676726107e-8 * Float64((angle ^ 3.0) * (pi ^ 3.0)))))); end return tmp end
b_m = abs(b); function tmp_2 = code(a, b_m, angle) t_0 = 0.005555555555555556 * (angle * pi); tmp = 0.0; if (b_m <= 5.6e+250) tmp = 2.0 * (((b_m + a) * ((b_m - a) * sin(t_0))) * cos((pi * (angle / 180.0)))); else tmp = 2.0 * (((b_m + a) * (b_m - a)) * (t_0 + (-2.8577960676726107e-8 * ((angle ^ 3.0) * (pi ^ 3.0))))); end tmp_2 = tmp; end
b_m = N[Abs[b], $MachinePrecision]
code[a_, b$95$m_, angle_] := Block[{t$95$0 = N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b$95$m, 5.6e+250], N[(2.0 * N[(N[(N[(b$95$m + a), $MachinePrecision] * N[(N[(b$95$m - a), $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[(b$95$m + a), $MachinePrecision] * N[(b$95$m - a), $MachinePrecision]), $MachinePrecision] * N[(t$95$0 + N[(-2.8577960676726107e-8 * N[(N[Power[angle, 3.0], $MachinePrecision] * N[Power[Pi, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
t_0 := 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\\
\mathbf{if}\;b\_m \leq 5.6 \cdot 10^{+250}:\\
\;\;\;\;2 \cdot \left(\left(\left(b\_m + a\right) \cdot \left(\left(b\_m - a\right) \cdot \sin t\_0\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(\left(b\_m + a\right) \cdot \left(b\_m - a\right)\right) \cdot \left(t\_0 + -2.8577960676726107 \cdot 10^{-8} \cdot \left({angle}^{3} \cdot {\pi}^{3}\right)\right)\right)\\
\end{array}
\end{array}
if b < 5.60000000000000019e250Initial program 56.4%
associate-*l*56.4%
associate-*l*56.4%
Simplified56.4%
unpow256.4%
unpow256.4%
difference-of-squares59.2%
Applied egg-rr59.2%
add-cube-cbrt58.3%
pow358.7%
div-inv59.6%
metadata-eval59.6%
Applied egg-rr59.6%
rem-cube-cbrt61.0%
metadata-eval61.0%
div-inv59.2%
clear-num60.1%
div-inv60.6%
add-sqr-sqrt61.0%
associate-/l*60.8%
Applied egg-rr60.8%
Taylor expanded in angle around inf 61.9%
*-commutative61.9%
associate-*r*61.0%
*-commutative61.0%
*-commutative61.0%
rem-square-sqrt60.7%
associate-*r*59.9%
associate-*l*68.9%
associate-*r*69.7%
rem-square-sqrt70.1%
*-commutative70.1%
*-commutative70.1%
associate-*r*71.0%
Simplified71.0%
if 5.60000000000000019e250 < b Initial program 18.2%
associate-*l*18.2%
associate-*l*18.2%
Simplified18.2%
unpow218.2%
unpow218.2%
difference-of-squares45.5%
Applied egg-rr45.5%
Taylor expanded in angle around 0 72.7%
Taylor expanded in angle around 0 100.0%
Final simplification72.2%
b_m = (fabs.f64 b)
(FPCore (a b_m angle)
:precision binary64
(let* ((t_0 (* 0.005555555555555556 (* angle PI)))
(t_1 (* (+ b_m a) (- b_m a))))
(if (<= (/ angle 180.0) 2e-38)
(*
2.0
(* (+ b_m a) (* (- b_m a) (sin (* PI (* 0.005555555555555556 angle))))))
(if (<= (/ angle 180.0) 4e+226)
(* 2.0 (* (* t_1 (sin (* PI (/ angle 180.0)))) (cos t_0)))
(* 2.0 (* (sin t_0) t_1))))))b_m = fabs(b);
double code(double a, double b_m, double angle) {
double t_0 = 0.005555555555555556 * (angle * ((double) M_PI));
double t_1 = (b_m + a) * (b_m - a);
double tmp;
if ((angle / 180.0) <= 2e-38) {
tmp = 2.0 * ((b_m + a) * ((b_m - a) * sin((((double) M_PI) * (0.005555555555555556 * angle)))));
} else if ((angle / 180.0) <= 4e+226) {
tmp = 2.0 * ((t_1 * sin((((double) M_PI) * (angle / 180.0)))) * cos(t_0));
} else {
tmp = 2.0 * (sin(t_0) * t_1);
}
return tmp;
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle) {
double t_0 = 0.005555555555555556 * (angle * Math.PI);
double t_1 = (b_m + a) * (b_m - a);
double tmp;
if ((angle / 180.0) <= 2e-38) {
tmp = 2.0 * ((b_m + a) * ((b_m - a) * Math.sin((Math.PI * (0.005555555555555556 * angle)))));
} else if ((angle / 180.0) <= 4e+226) {
tmp = 2.0 * ((t_1 * Math.sin((Math.PI * (angle / 180.0)))) * Math.cos(t_0));
} else {
tmp = 2.0 * (Math.sin(t_0) * t_1);
}
return tmp;
}
b_m = math.fabs(b) def code(a, b_m, angle): t_0 = 0.005555555555555556 * (angle * math.pi) t_1 = (b_m + a) * (b_m - a) tmp = 0 if (angle / 180.0) <= 2e-38: tmp = 2.0 * ((b_m + a) * ((b_m - a) * math.sin((math.pi * (0.005555555555555556 * angle))))) elif (angle / 180.0) <= 4e+226: tmp = 2.0 * ((t_1 * math.sin((math.pi * (angle / 180.0)))) * math.cos(t_0)) else: tmp = 2.0 * (math.sin(t_0) * t_1) return tmp
b_m = abs(b) function code(a, b_m, angle) t_0 = Float64(0.005555555555555556 * Float64(angle * pi)) t_1 = Float64(Float64(b_m + a) * Float64(b_m - a)) tmp = 0.0 if (Float64(angle / 180.0) <= 2e-38) tmp = Float64(2.0 * Float64(Float64(b_m + a) * Float64(Float64(b_m - a) * sin(Float64(pi * Float64(0.005555555555555556 * angle)))))); elseif (Float64(angle / 180.0) <= 4e+226) tmp = Float64(2.0 * Float64(Float64(t_1 * sin(Float64(pi * Float64(angle / 180.0)))) * cos(t_0))); else tmp = Float64(2.0 * Float64(sin(t_0) * t_1)); end return tmp end
b_m = abs(b); function tmp_2 = code(a, b_m, angle) t_0 = 0.005555555555555556 * (angle * pi); t_1 = (b_m + a) * (b_m - a); tmp = 0.0; if ((angle / 180.0) <= 2e-38) tmp = 2.0 * ((b_m + a) * ((b_m - a) * sin((pi * (0.005555555555555556 * angle))))); elseif ((angle / 180.0) <= 4e+226) tmp = 2.0 * ((t_1 * sin((pi * (angle / 180.0)))) * cos(t_0)); else tmp = 2.0 * (sin(t_0) * t_1); end tmp_2 = tmp; end
b_m = N[Abs[b], $MachinePrecision]
code[a_, b$95$m_, angle_] := Block[{t$95$0 = N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(b$95$m + a), $MachinePrecision] * N[(b$95$m - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(angle / 180.0), $MachinePrecision], 2e-38], N[(2.0 * N[(N[(b$95$m + a), $MachinePrecision] * N[(N[(b$95$m - a), $MachinePrecision] * N[Sin[N[(Pi * N[(0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle / 180.0), $MachinePrecision], 4e+226], N[(2.0 * N[(N[(t$95$1 * N[Sin[N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[Sin[t$95$0], $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
t_0 := 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\\
t_1 := \left(b\_m + a\right) \cdot \left(b\_m - a\right)\\
\mathbf{if}\;\frac{angle}{180} \leq 2 \cdot 10^{-38}:\\
\;\;\;\;2 \cdot \left(\left(b\_m + a\right) \cdot \left(\left(b\_m - a\right) \cdot \sin \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right)\right)\right)\\
\mathbf{elif}\;\frac{angle}{180} \leq 4 \cdot 10^{+226}:\\
\;\;\;\;2 \cdot \left(\left(t\_1 \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos t\_0\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\sin t\_0 \cdot t\_1\right)\\
\end{array}
\end{array}
if (/.f64 angle 180) < 1.9999999999999999e-38Initial program 59.6%
associate-*l*59.6%
associate-*l*59.6%
Simplified59.6%
unpow259.6%
unpow259.6%
difference-of-squares63.4%
Applied egg-rr63.4%
Taylor expanded in angle around 0 62.8%
div-inv63.5%
metadata-eval63.5%
add-exp-log21.5%
Applied egg-rr21.5%
pow121.5%
associate-*l*28.2%
rem-exp-log75.5%
Applied egg-rr75.5%
if 1.9999999999999999e-38 < (/.f64 angle 180) < 3.99999999999999985e226Initial program 51.7%
associate-*l*51.7%
associate-*l*51.7%
Simplified51.7%
unpow251.7%
unpow251.7%
difference-of-squares55.9%
Applied egg-rr55.9%
Taylor expanded in angle around 0 59.1%
if 3.99999999999999985e226 < (/.f64 angle 180) Initial program 22.1%
associate-*l*22.1%
associate-*l*22.1%
Simplified22.1%
unpow222.1%
unpow222.1%
difference-of-squares26.4%
Applied egg-rr26.4%
Taylor expanded in angle around 0 25.6%
Taylor expanded in angle around inf 41.4%
Final simplification69.4%
b_m = (fabs.f64 b)
(FPCore (a b_m angle)
:precision binary64
(let* ((t_0 (* 0.005555555555555556 (* angle PI)))
(t_1 (* (+ b_m a) (- b_m a))))
(if (<= (/ angle 180.0) 5e+68)
(*
2.0
(* (+ b_m a) (* (- b_m a) (sin (* PI (* 0.005555555555555556 angle))))))
(if (<= (/ angle 180.0) 4e+226)
(* 2.0 (* (cos t_0) (* t_1 (sin (/ PI (/ 180.0 angle))))))
(* 2.0 (* (sin t_0) t_1))))))b_m = fabs(b);
double code(double a, double b_m, double angle) {
double t_0 = 0.005555555555555556 * (angle * ((double) M_PI));
double t_1 = (b_m + a) * (b_m - a);
double tmp;
if ((angle / 180.0) <= 5e+68) {
tmp = 2.0 * ((b_m + a) * ((b_m - a) * sin((((double) M_PI) * (0.005555555555555556 * angle)))));
} else if ((angle / 180.0) <= 4e+226) {
tmp = 2.0 * (cos(t_0) * (t_1 * sin((((double) M_PI) / (180.0 / angle)))));
} else {
tmp = 2.0 * (sin(t_0) * t_1);
}
return tmp;
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle) {
double t_0 = 0.005555555555555556 * (angle * Math.PI);
double t_1 = (b_m + a) * (b_m - a);
double tmp;
if ((angle / 180.0) <= 5e+68) {
tmp = 2.0 * ((b_m + a) * ((b_m - a) * Math.sin((Math.PI * (0.005555555555555556 * angle)))));
} else if ((angle / 180.0) <= 4e+226) {
tmp = 2.0 * (Math.cos(t_0) * (t_1 * Math.sin((Math.PI / (180.0 / angle)))));
} else {
tmp = 2.0 * (Math.sin(t_0) * t_1);
}
return tmp;
}
b_m = math.fabs(b) def code(a, b_m, angle): t_0 = 0.005555555555555556 * (angle * math.pi) t_1 = (b_m + a) * (b_m - a) tmp = 0 if (angle / 180.0) <= 5e+68: tmp = 2.0 * ((b_m + a) * ((b_m - a) * math.sin((math.pi * (0.005555555555555556 * angle))))) elif (angle / 180.0) <= 4e+226: tmp = 2.0 * (math.cos(t_0) * (t_1 * math.sin((math.pi / (180.0 / angle))))) else: tmp = 2.0 * (math.sin(t_0) * t_1) return tmp
b_m = abs(b) function code(a, b_m, angle) t_0 = Float64(0.005555555555555556 * Float64(angle * pi)) t_1 = Float64(Float64(b_m + a) * Float64(b_m - a)) tmp = 0.0 if (Float64(angle / 180.0) <= 5e+68) tmp = Float64(2.0 * Float64(Float64(b_m + a) * Float64(Float64(b_m - a) * sin(Float64(pi * Float64(0.005555555555555556 * angle)))))); elseif (Float64(angle / 180.0) <= 4e+226) tmp = Float64(2.0 * Float64(cos(t_0) * Float64(t_1 * sin(Float64(pi / Float64(180.0 / angle)))))); else tmp = Float64(2.0 * Float64(sin(t_0) * t_1)); end return tmp end
b_m = abs(b); function tmp_2 = code(a, b_m, angle) t_0 = 0.005555555555555556 * (angle * pi); t_1 = (b_m + a) * (b_m - a); tmp = 0.0; if ((angle / 180.0) <= 5e+68) tmp = 2.0 * ((b_m + a) * ((b_m - a) * sin((pi * (0.005555555555555556 * angle))))); elseif ((angle / 180.0) <= 4e+226) tmp = 2.0 * (cos(t_0) * (t_1 * sin((pi / (180.0 / angle))))); else tmp = 2.0 * (sin(t_0) * t_1); end tmp_2 = tmp; end
b_m = N[Abs[b], $MachinePrecision]
code[a_, b$95$m_, angle_] := Block[{t$95$0 = N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(b$95$m + a), $MachinePrecision] * N[(b$95$m - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(angle / 180.0), $MachinePrecision], 5e+68], N[(2.0 * N[(N[(b$95$m + a), $MachinePrecision] * N[(N[(b$95$m - a), $MachinePrecision] * N[Sin[N[(Pi * N[(0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle / 180.0), $MachinePrecision], 4e+226], N[(2.0 * N[(N[Cos[t$95$0], $MachinePrecision] * N[(t$95$1 * N[Sin[N[(Pi / N[(180.0 / angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[Sin[t$95$0], $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
t_0 := 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\\
t_1 := \left(b\_m + a\right) \cdot \left(b\_m - a\right)\\
\mathbf{if}\;\frac{angle}{180} \leq 5 \cdot 10^{+68}:\\
\;\;\;\;2 \cdot \left(\left(b\_m + a\right) \cdot \left(\left(b\_m - a\right) \cdot \sin \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right)\right)\right)\\
\mathbf{elif}\;\frac{angle}{180} \leq 4 \cdot 10^{+226}:\\
\;\;\;\;2 \cdot \left(\cos t\_0 \cdot \left(t\_1 \cdot \sin \left(\frac{\pi}{\frac{180}{angle}}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\sin t\_0 \cdot t\_1\right)\\
\end{array}
\end{array}
if (/.f64 angle 180) < 5.0000000000000004e68Initial program 60.1%
associate-*l*60.1%
associate-*l*60.1%
Simplified60.1%
unpow260.1%
unpow260.1%
difference-of-squares64.6%
Applied egg-rr64.6%
Taylor expanded in angle around 0 62.8%
div-inv63.4%
metadata-eval63.4%
add-exp-log25.4%
Applied egg-rr25.4%
pow125.4%
associate-*l*31.5%
rem-exp-log74.3%
Applied egg-rr74.3%
if 5.0000000000000004e68 < (/.f64 angle 180) < 3.99999999999999985e226Initial program 41.9%
associate-*l*41.9%
associate-*l*41.9%
Simplified41.9%
unpow241.9%
unpow241.9%
difference-of-squares41.9%
Applied egg-rr41.9%
associate-*r/45.7%
associate-/l*39.5%
Applied egg-rr39.5%
Taylor expanded in angle around inf 45.1%
if 3.99999999999999985e226 < (/.f64 angle 180) Initial program 22.1%
associate-*l*22.1%
associate-*l*22.1%
Simplified22.1%
unpow222.1%
unpow222.1%
difference-of-squares26.4%
Applied egg-rr26.4%
Taylor expanded in angle around 0 25.6%
Taylor expanded in angle around inf 41.4%
Final simplification68.1%
b_m = (fabs.f64 b)
(FPCore (a b_m angle)
:precision binary64
(let* ((t_0 (* (+ b_m a) (- b_m a))) (t_1 (* PI (/ angle 180.0))))
(if (<= (/ angle 180.0) 2e-38)
(*
2.0
(* (+ b_m a) (* (- b_m a) (sin (* PI (* 0.005555555555555556 angle))))))
(if (<= (/ angle 180.0) 2e+166)
(*
2.0
(* (* t_0 (sin t_1)) (cos (* 0.005555555555555556 (* angle PI)))))
(* 2.0 (* (cos t_1) (* t_0 (sin (/ PI (/ 180.0 angle))))))))))b_m = fabs(b);
double code(double a, double b_m, double angle) {
double t_0 = (b_m + a) * (b_m - a);
double t_1 = ((double) M_PI) * (angle / 180.0);
double tmp;
if ((angle / 180.0) <= 2e-38) {
tmp = 2.0 * ((b_m + a) * ((b_m - a) * sin((((double) M_PI) * (0.005555555555555556 * angle)))));
} else if ((angle / 180.0) <= 2e+166) {
tmp = 2.0 * ((t_0 * sin(t_1)) * cos((0.005555555555555556 * (angle * ((double) M_PI)))));
} else {
tmp = 2.0 * (cos(t_1) * (t_0 * sin((((double) M_PI) / (180.0 / angle)))));
}
return tmp;
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle) {
double t_0 = (b_m + a) * (b_m - a);
double t_1 = Math.PI * (angle / 180.0);
double tmp;
if ((angle / 180.0) <= 2e-38) {
tmp = 2.0 * ((b_m + a) * ((b_m - a) * Math.sin((Math.PI * (0.005555555555555556 * angle)))));
} else if ((angle / 180.0) <= 2e+166) {
tmp = 2.0 * ((t_0 * Math.sin(t_1)) * Math.cos((0.005555555555555556 * (angle * Math.PI))));
} else {
tmp = 2.0 * (Math.cos(t_1) * (t_0 * Math.sin((Math.PI / (180.0 / angle)))));
}
return tmp;
}
b_m = math.fabs(b) def code(a, b_m, angle): t_0 = (b_m + a) * (b_m - a) t_1 = math.pi * (angle / 180.0) tmp = 0 if (angle / 180.0) <= 2e-38: tmp = 2.0 * ((b_m + a) * ((b_m - a) * math.sin((math.pi * (0.005555555555555556 * angle))))) elif (angle / 180.0) <= 2e+166: tmp = 2.0 * ((t_0 * math.sin(t_1)) * math.cos((0.005555555555555556 * (angle * math.pi)))) else: tmp = 2.0 * (math.cos(t_1) * (t_0 * math.sin((math.pi / (180.0 / angle))))) return tmp
b_m = abs(b) function code(a, b_m, angle) t_0 = Float64(Float64(b_m + a) * Float64(b_m - a)) t_1 = Float64(pi * Float64(angle / 180.0)) tmp = 0.0 if (Float64(angle / 180.0) <= 2e-38) tmp = Float64(2.0 * Float64(Float64(b_m + a) * Float64(Float64(b_m - a) * sin(Float64(pi * Float64(0.005555555555555556 * angle)))))); elseif (Float64(angle / 180.0) <= 2e+166) tmp = Float64(2.0 * Float64(Float64(t_0 * sin(t_1)) * cos(Float64(0.005555555555555556 * Float64(angle * pi))))); else tmp = Float64(2.0 * Float64(cos(t_1) * Float64(t_0 * sin(Float64(pi / Float64(180.0 / angle)))))); end return tmp end
b_m = abs(b); function tmp_2 = code(a, b_m, angle) t_0 = (b_m + a) * (b_m - a); t_1 = pi * (angle / 180.0); tmp = 0.0; if ((angle / 180.0) <= 2e-38) tmp = 2.0 * ((b_m + a) * ((b_m - a) * sin((pi * (0.005555555555555556 * angle))))); elseif ((angle / 180.0) <= 2e+166) tmp = 2.0 * ((t_0 * sin(t_1)) * cos((0.005555555555555556 * (angle * pi)))); else tmp = 2.0 * (cos(t_1) * (t_0 * sin((pi / (180.0 / angle))))); end tmp_2 = tmp; end
b_m = N[Abs[b], $MachinePrecision]
code[a_, b$95$m_, angle_] := Block[{t$95$0 = N[(N[(b$95$m + a), $MachinePrecision] * N[(b$95$m - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(angle / 180.0), $MachinePrecision], 2e-38], N[(2.0 * N[(N[(b$95$m + a), $MachinePrecision] * N[(N[(b$95$m - a), $MachinePrecision] * N[Sin[N[(Pi * N[(0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle / 180.0), $MachinePrecision], 2e+166], N[(2.0 * N[(N[(t$95$0 * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision] * N[Cos[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[Cos[t$95$1], $MachinePrecision] * N[(t$95$0 * N[Sin[N[(Pi / N[(180.0 / angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
t_0 := \left(b\_m + a\right) \cdot \left(b\_m - a\right)\\
t_1 := \pi \cdot \frac{angle}{180}\\
\mathbf{if}\;\frac{angle}{180} \leq 2 \cdot 10^{-38}:\\
\;\;\;\;2 \cdot \left(\left(b\_m + a\right) \cdot \left(\left(b\_m - a\right) \cdot \sin \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right)\right)\right)\\
\mathbf{elif}\;\frac{angle}{180} \leq 2 \cdot 10^{+166}:\\
\;\;\;\;2 \cdot \left(\left(t\_0 \cdot \sin t\_1\right) \cdot \cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\cos t\_1 \cdot \left(t\_0 \cdot \sin \left(\frac{\pi}{\frac{180}{angle}}\right)\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle 180) < 1.9999999999999999e-38Initial program 59.6%
associate-*l*59.6%
associate-*l*59.6%
Simplified59.6%
unpow259.6%
unpow259.6%
difference-of-squares63.4%
Applied egg-rr63.4%
Taylor expanded in angle around 0 62.8%
div-inv63.5%
metadata-eval63.5%
add-exp-log21.5%
Applied egg-rr21.5%
pow121.5%
associate-*l*28.2%
rem-exp-log75.5%
Applied egg-rr75.5%
if 1.9999999999999999e-38 < (/.f64 angle 180) < 1.99999999999999988e166Initial program 51.9%
associate-*l*51.9%
associate-*l*51.9%
Simplified51.9%
unpow251.9%
unpow251.9%
difference-of-squares57.3%
Applied egg-rr57.3%
Taylor expanded in angle around 0 62.0%
if 1.99999999999999988e166 < (/.f64 angle 180) Initial program 31.5%
associate-*l*31.5%
associate-*l*31.5%
Simplified31.5%
unpow231.5%
unpow231.5%
difference-of-squares34.4%
Applied egg-rr34.4%
associate-*r/35.9%
associate-/l*36.2%
Applied egg-rr36.2%
Final simplification68.3%
b_m = (fabs.f64 b) (FPCore (a b_m angle) :precision binary64 (* 2.0 (* (* (+ b_m a) (* (- b_m a) (sin (* 0.005555555555555556 (* angle PI))))) (cos (* PI (/ angle 180.0))))))
b_m = fabs(b);
double code(double a, double b_m, double angle) {
return 2.0 * (((b_m + a) * ((b_m - a) * sin((0.005555555555555556 * (angle * ((double) M_PI)))))) * cos((((double) M_PI) * (angle / 180.0))));
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle) {
return 2.0 * (((b_m + a) * ((b_m - a) * Math.sin((0.005555555555555556 * (angle * Math.PI))))) * Math.cos((Math.PI * (angle / 180.0))));
}
b_m = math.fabs(b) def code(a, b_m, angle): return 2.0 * (((b_m + a) * ((b_m - a) * math.sin((0.005555555555555556 * (angle * math.pi))))) * math.cos((math.pi * (angle / 180.0))))
b_m = abs(b) function code(a, b_m, angle) return Float64(2.0 * Float64(Float64(Float64(b_m + a) * Float64(Float64(b_m - a) * sin(Float64(0.005555555555555556 * Float64(angle * pi))))) * cos(Float64(pi * Float64(angle / 180.0))))) end
b_m = abs(b); function tmp = code(a, b_m, angle) tmp = 2.0 * (((b_m + a) * ((b_m - a) * sin((0.005555555555555556 * (angle * pi))))) * cos((pi * (angle / 180.0)))); end
b_m = N[Abs[b], $MachinePrecision] code[a_, b$95$m_, angle_] := N[(2.0 * N[(N[(N[(b$95$m + a), $MachinePrecision] * N[(N[(b$95$m - a), $MachinePrecision] * N[Sin[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
b_m = \left|b\right|
\\
2 \cdot \left(\left(\left(b\_m + a\right) \cdot \left(\left(b\_m - a\right) \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)
\end{array}
Initial program 54.7%
associate-*l*54.7%
associate-*l*54.7%
Simplified54.7%
unpow254.7%
unpow254.7%
difference-of-squares58.7%
Applied egg-rr58.7%
add-cube-cbrt58.5%
pow359.0%
div-inv59.8%
metadata-eval59.8%
Applied egg-rr59.8%
rem-cube-cbrt60.4%
metadata-eval60.4%
div-inv58.7%
clear-num59.9%
div-inv60.7%
add-sqr-sqrt61.5%
associate-/l*61.3%
Applied egg-rr61.3%
Taylor expanded in angle around inf 61.6%
*-commutative61.6%
associate-*r*60.4%
*-commutative60.4%
*-commutative60.4%
rem-square-sqrt61.2%
associate-*r*60.4%
associate-*l*69.0%
associate-*r*69.8%
rem-square-sqrt69.1%
*-commutative69.1%
*-commutative69.1%
associate-*r*70.3%
Simplified70.3%
Final simplification70.3%
b_m = (fabs.f64 b)
(FPCore (a b_m angle)
:precision binary64
(let* ((t_0 (* (+ b_m a) (- b_m a))))
(if (<= a 1.75e+189)
(* 2.0 (* t_0 (* PI (* 0.005555555555555556 angle))))
(if (<= a 4.4e+232)
(*
2.0
(*
0.005555555555555556
(* angle (fabs (* (+ b_m a) (* (- b_m a) PI))))))
(* 2.0 (* 0.005555555555555556 (* angle (* PI t_0))))))))b_m = fabs(b);
double code(double a, double b_m, double angle) {
double t_0 = (b_m + a) * (b_m - a);
double tmp;
if (a <= 1.75e+189) {
tmp = 2.0 * (t_0 * (((double) M_PI) * (0.005555555555555556 * angle)));
} else if (a <= 4.4e+232) {
tmp = 2.0 * (0.005555555555555556 * (angle * fabs(((b_m + a) * ((b_m - a) * ((double) M_PI))))));
} else {
tmp = 2.0 * (0.005555555555555556 * (angle * (((double) M_PI) * t_0)));
}
return tmp;
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle) {
double t_0 = (b_m + a) * (b_m - a);
double tmp;
if (a <= 1.75e+189) {
tmp = 2.0 * (t_0 * (Math.PI * (0.005555555555555556 * angle)));
} else if (a <= 4.4e+232) {
tmp = 2.0 * (0.005555555555555556 * (angle * Math.abs(((b_m + a) * ((b_m - a) * Math.PI)))));
} else {
tmp = 2.0 * (0.005555555555555556 * (angle * (Math.PI * t_0)));
}
return tmp;
}
b_m = math.fabs(b) def code(a, b_m, angle): t_0 = (b_m + a) * (b_m - a) tmp = 0 if a <= 1.75e+189: tmp = 2.0 * (t_0 * (math.pi * (0.005555555555555556 * angle))) elif a <= 4.4e+232: tmp = 2.0 * (0.005555555555555556 * (angle * math.fabs(((b_m + a) * ((b_m - a) * math.pi))))) else: tmp = 2.0 * (0.005555555555555556 * (angle * (math.pi * t_0))) return tmp
b_m = abs(b) function code(a, b_m, angle) t_0 = Float64(Float64(b_m + a) * Float64(b_m - a)) tmp = 0.0 if (a <= 1.75e+189) tmp = Float64(2.0 * Float64(t_0 * Float64(pi * Float64(0.005555555555555556 * angle)))); elseif (a <= 4.4e+232) tmp = Float64(2.0 * Float64(0.005555555555555556 * Float64(angle * abs(Float64(Float64(b_m + a) * Float64(Float64(b_m - a) * pi)))))); else tmp = Float64(2.0 * Float64(0.005555555555555556 * Float64(angle * Float64(pi * t_0)))); end return tmp end
b_m = abs(b); function tmp_2 = code(a, b_m, angle) t_0 = (b_m + a) * (b_m - a); tmp = 0.0; if (a <= 1.75e+189) tmp = 2.0 * (t_0 * (pi * (0.005555555555555556 * angle))); elseif (a <= 4.4e+232) tmp = 2.0 * (0.005555555555555556 * (angle * abs(((b_m + a) * ((b_m - a) * pi))))); else tmp = 2.0 * (0.005555555555555556 * (angle * (pi * t_0))); end tmp_2 = tmp; end
b_m = N[Abs[b], $MachinePrecision]
code[a_, b$95$m_, angle_] := Block[{t$95$0 = N[(N[(b$95$m + a), $MachinePrecision] * N[(b$95$m - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, 1.75e+189], N[(2.0 * N[(t$95$0 * N[(Pi * N[(0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 4.4e+232], N[(2.0 * N[(0.005555555555555556 * N[(angle * N[Abs[N[(N[(b$95$m + a), $MachinePrecision] * N[(N[(b$95$m - a), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(0.005555555555555556 * N[(angle * N[(Pi * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
t_0 := \left(b\_m + a\right) \cdot \left(b\_m - a\right)\\
\mathbf{if}\;a \leq 1.75 \cdot 10^{+189}:\\
\;\;\;\;2 \cdot \left(t\_0 \cdot \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right)\right)\\
\mathbf{elif}\;a \leq 4.4 \cdot 10^{+232}:\\
\;\;\;\;2 \cdot \left(0.005555555555555556 \cdot \left(angle \cdot \left|\left(b\_m + a\right) \cdot \left(\left(b\_m - a\right) \cdot \pi\right)\right|\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(0.005555555555555556 \cdot \left(angle \cdot \left(\pi \cdot t\_0\right)\right)\right)\\
\end{array}
\end{array}
if a < 1.74999999999999998e189Initial program 56.4%
associate-*l*56.4%
associate-*l*56.4%
Simplified56.4%
unpow256.4%
unpow256.4%
difference-of-squares60.0%
Applied egg-rr60.0%
Taylor expanded in angle around 0 57.5%
Taylor expanded in angle around 0 56.6%
associate-*r*56.7%
*-commutative56.7%
Simplified56.7%
if 1.74999999999999998e189 < a < 4.4e232Initial program 48.0%
associate-*l*48.0%
associate-*l*48.0%
Simplified48.0%
unpow248.0%
unpow248.0%
difference-of-squares48.3%
Applied egg-rr48.3%
Taylor expanded in angle around 0 53.5%
Taylor expanded in angle around 0 16.7%
add-sqr-sqrt0.0%
sqrt-unprod63.2%
pow263.2%
+-commutative63.2%
Applied egg-rr63.2%
unpow263.2%
rem-sqrt-square63.2%
+-commutative63.2%
*-commutative63.2%
associate-*r*63.2%
Simplified63.2%
if 4.4e232 < a Initial program 37.2%
associate-*l*37.2%
associate-*l*37.2%
Simplified37.2%
unpow237.2%
unpow237.2%
difference-of-squares51.5%
Applied egg-rr51.5%
Taylor expanded in angle around 0 58.6%
Taylor expanded in angle around 0 72.9%
Final simplification58.0%
b_m = (fabs.f64 b)
(FPCore (a b_m angle)
:precision binary64
(if (<= (/ angle 180.0) 2e-38)
(*
2.0
(* (+ b_m a) (* (- b_m a) (sin (* PI (* 0.005555555555555556 angle))))))
(* 2.0 (* (* (+ b_m a) (- b_m a)) (sin (/ (* angle PI) 180.0))))))b_m = fabs(b);
double code(double a, double b_m, double angle) {
double tmp;
if ((angle / 180.0) <= 2e-38) {
tmp = 2.0 * ((b_m + a) * ((b_m - a) * sin((((double) M_PI) * (0.005555555555555556 * angle)))));
} else {
tmp = 2.0 * (((b_m + a) * (b_m - a)) * sin(((angle * ((double) M_PI)) / 180.0)));
}
return tmp;
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle) {
double tmp;
if ((angle / 180.0) <= 2e-38) {
tmp = 2.0 * ((b_m + a) * ((b_m - a) * Math.sin((Math.PI * (0.005555555555555556 * angle)))));
} else {
tmp = 2.0 * (((b_m + a) * (b_m - a)) * Math.sin(((angle * Math.PI) / 180.0)));
}
return tmp;
}
b_m = math.fabs(b) def code(a, b_m, angle): tmp = 0 if (angle / 180.0) <= 2e-38: tmp = 2.0 * ((b_m + a) * ((b_m - a) * math.sin((math.pi * (0.005555555555555556 * angle))))) else: tmp = 2.0 * (((b_m + a) * (b_m - a)) * math.sin(((angle * math.pi) / 180.0))) return tmp
b_m = abs(b) function code(a, b_m, angle) tmp = 0.0 if (Float64(angle / 180.0) <= 2e-38) tmp = Float64(2.0 * Float64(Float64(b_m + a) * Float64(Float64(b_m - a) * sin(Float64(pi * Float64(0.005555555555555556 * angle)))))); else tmp = Float64(2.0 * Float64(Float64(Float64(b_m + a) * Float64(b_m - a)) * sin(Float64(Float64(angle * pi) / 180.0)))); end return tmp end
b_m = abs(b); function tmp_2 = code(a, b_m, angle) tmp = 0.0; if ((angle / 180.0) <= 2e-38) tmp = 2.0 * ((b_m + a) * ((b_m - a) * sin((pi * (0.005555555555555556 * angle))))); else tmp = 2.0 * (((b_m + a) * (b_m - a)) * sin(((angle * pi) / 180.0))); end tmp_2 = tmp; end
b_m = N[Abs[b], $MachinePrecision] code[a_, b$95$m_, angle_] := If[LessEqual[N[(angle / 180.0), $MachinePrecision], 2e-38], N[(2.0 * N[(N[(b$95$m + a), $MachinePrecision] * N[(N[(b$95$m - a), $MachinePrecision] * N[Sin[N[(Pi * N[(0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[(b$95$m + a), $MachinePrecision] * N[(b$95$m - a), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(N[(angle * Pi), $MachinePrecision] / 180.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
\mathbf{if}\;\frac{angle}{180} \leq 2 \cdot 10^{-38}:\\
\;\;\;\;2 \cdot \left(\left(b\_m + a\right) \cdot \left(\left(b\_m - a\right) \cdot \sin \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(\left(b\_m + a\right) \cdot \left(b\_m - a\right)\right) \cdot \sin \left(\frac{angle \cdot \pi}{180}\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle 180) < 1.9999999999999999e-38Initial program 59.6%
associate-*l*59.6%
associate-*l*59.6%
Simplified59.6%
unpow259.6%
unpow259.6%
difference-of-squares63.4%
Applied egg-rr63.4%
Taylor expanded in angle around 0 62.8%
div-inv63.5%
metadata-eval63.5%
add-exp-log21.5%
Applied egg-rr21.5%
pow121.5%
associate-*l*28.2%
rem-exp-log75.5%
Applied egg-rr75.5%
if 1.9999999999999999e-38 < (/.f64 angle 180) Initial program 42.1%
associate-*l*42.1%
associate-*l*42.1%
Simplified42.1%
unpow242.1%
unpow242.1%
difference-of-squares46.3%
Applied egg-rr46.3%
Taylor expanded in angle around 0 42.8%
associate-*r/48.9%
Applied egg-rr48.9%
Final simplification68.1%
b_m = (fabs.f64 b) (FPCore (a b_m angle) :precision binary64 (* 2.0 (* (sin (* 0.005555555555555556 (* angle PI))) (* (+ b_m a) (- b_m a)))))
b_m = fabs(b);
double code(double a, double b_m, double angle) {
return 2.0 * (sin((0.005555555555555556 * (angle * ((double) M_PI)))) * ((b_m + a) * (b_m - a)));
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle) {
return 2.0 * (Math.sin((0.005555555555555556 * (angle * Math.PI))) * ((b_m + a) * (b_m - a)));
}
b_m = math.fabs(b) def code(a, b_m, angle): return 2.0 * (math.sin((0.005555555555555556 * (angle * math.pi))) * ((b_m + a) * (b_m - a)))
b_m = abs(b) function code(a, b_m, angle) return Float64(2.0 * Float64(sin(Float64(0.005555555555555556 * Float64(angle * pi))) * Float64(Float64(b_m + a) * Float64(b_m - a)))) end
b_m = abs(b); function tmp = code(a, b_m, angle) tmp = 2.0 * (sin((0.005555555555555556 * (angle * pi))) * ((b_m + a) * (b_m - a))); end
b_m = N[Abs[b], $MachinePrecision] code[a_, b$95$m_, angle_] := N[(2.0 * N[(N[Sin[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(b$95$m + a), $MachinePrecision] * N[(b$95$m - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
b_m = \left|b\right|
\\
2 \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(\left(b\_m + a\right) \cdot \left(b\_m - a\right)\right)\right)
\end{array}
Initial program 54.7%
associate-*l*54.7%
associate-*l*54.7%
Simplified54.7%
unpow254.7%
unpow254.7%
difference-of-squares58.7%
Applied egg-rr58.7%
Taylor expanded in angle around 0 57.2%
Taylor expanded in angle around inf 59.7%
Final simplification59.7%
b_m = (fabs.f64 b) (FPCore (a b_m angle) :precision binary64 (* 2.0 (* (* (+ b_m a) (- b_m a)) (sin (/ (* angle PI) 180.0)))))
b_m = fabs(b);
double code(double a, double b_m, double angle) {
return 2.0 * (((b_m + a) * (b_m - a)) * sin(((angle * ((double) M_PI)) / 180.0)));
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle) {
return 2.0 * (((b_m + a) * (b_m - a)) * Math.sin(((angle * Math.PI) / 180.0)));
}
b_m = math.fabs(b) def code(a, b_m, angle): return 2.0 * (((b_m + a) * (b_m - a)) * math.sin(((angle * math.pi) / 180.0)))
b_m = abs(b) function code(a, b_m, angle) return Float64(2.0 * Float64(Float64(Float64(b_m + a) * Float64(b_m - a)) * sin(Float64(Float64(angle * pi) / 180.0)))) end
b_m = abs(b); function tmp = code(a, b_m, angle) tmp = 2.0 * (((b_m + a) * (b_m - a)) * sin(((angle * pi) / 180.0))); end
b_m = N[Abs[b], $MachinePrecision] code[a_, b$95$m_, angle_] := N[(2.0 * N[(N[(N[(b$95$m + a), $MachinePrecision] * N[(b$95$m - a), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(N[(angle * Pi), $MachinePrecision] / 180.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
b_m = \left|b\right|
\\
2 \cdot \left(\left(\left(b\_m + a\right) \cdot \left(b\_m - a\right)\right) \cdot \sin \left(\frac{angle \cdot \pi}{180}\right)\right)
\end{array}
Initial program 54.7%
associate-*l*54.7%
associate-*l*54.7%
Simplified54.7%
unpow254.7%
unpow254.7%
difference-of-squares58.7%
Applied egg-rr58.7%
Taylor expanded in angle around 0 57.2%
associate-*r/60.3%
Applied egg-rr60.3%
Final simplification60.3%
b_m = (fabs.f64 b) (FPCore (a b_m angle) :precision binary64 (* 2.0 (* 0.005555555555555556 (* angle (* PI (* (+ b_m a) (- b_m a)))))))
b_m = fabs(b);
double code(double a, double b_m, double angle) {
return 2.0 * (0.005555555555555556 * (angle * (((double) M_PI) * ((b_m + a) * (b_m - a)))));
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle) {
return 2.0 * (0.005555555555555556 * (angle * (Math.PI * ((b_m + a) * (b_m - a)))));
}
b_m = math.fabs(b) def code(a, b_m, angle): return 2.0 * (0.005555555555555556 * (angle * (math.pi * ((b_m + a) * (b_m - a)))))
b_m = abs(b) function code(a, b_m, angle) return Float64(2.0 * Float64(0.005555555555555556 * Float64(angle * Float64(pi * Float64(Float64(b_m + a) * Float64(b_m - a)))))) end
b_m = abs(b); function tmp = code(a, b_m, angle) tmp = 2.0 * (0.005555555555555556 * (angle * (pi * ((b_m + a) * (b_m - a))))); end
b_m = N[Abs[b], $MachinePrecision] code[a_, b$95$m_, angle_] := N[(2.0 * N[(0.005555555555555556 * N[(angle * N[(Pi * N[(N[(b$95$m + a), $MachinePrecision] * N[(b$95$m - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
b_m = \left|b\right|
\\
2 \cdot \left(0.005555555555555556 \cdot \left(angle \cdot \left(\pi \cdot \left(\left(b\_m + a\right) \cdot \left(b\_m - a\right)\right)\right)\right)\right)
\end{array}
Initial program 54.7%
associate-*l*54.7%
associate-*l*54.7%
Simplified54.7%
unpow254.7%
unpow254.7%
difference-of-squares58.7%
Applied egg-rr58.7%
Taylor expanded in angle around 0 57.2%
Taylor expanded in angle around 0 54.5%
Final simplification54.5%
b_m = (fabs.f64 b) (FPCore (a b_m angle) :precision binary64 (* 2.0 (* 0.005555555555555556 (* angle (* (+ b_m a) (* (- b_m a) PI))))))
b_m = fabs(b);
double code(double a, double b_m, double angle) {
return 2.0 * (0.005555555555555556 * (angle * ((b_m + a) * ((b_m - a) * ((double) M_PI)))));
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle) {
return 2.0 * (0.005555555555555556 * (angle * ((b_m + a) * ((b_m - a) * Math.PI))));
}
b_m = math.fabs(b) def code(a, b_m, angle): return 2.0 * (0.005555555555555556 * (angle * ((b_m + a) * ((b_m - a) * math.pi))))
b_m = abs(b) function code(a, b_m, angle) return Float64(2.0 * Float64(0.005555555555555556 * Float64(angle * Float64(Float64(b_m + a) * Float64(Float64(b_m - a) * pi))))) end
b_m = abs(b); function tmp = code(a, b_m, angle) tmp = 2.0 * (0.005555555555555556 * (angle * ((b_m + a) * ((b_m - a) * pi)))); end
b_m = N[Abs[b], $MachinePrecision] code[a_, b$95$m_, angle_] := N[(2.0 * N[(0.005555555555555556 * N[(angle * N[(N[(b$95$m + a), $MachinePrecision] * N[(N[(b$95$m - a), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
b_m = \left|b\right|
\\
2 \cdot \left(0.005555555555555556 \cdot \left(angle \cdot \left(\left(b\_m + a\right) \cdot \left(\left(b\_m - a\right) \cdot \pi\right)\right)\right)\right)
\end{array}
Initial program 54.7%
associate-*l*54.7%
associate-*l*54.7%
Simplified54.7%
unpow254.7%
unpow254.7%
difference-of-squares58.7%
Applied egg-rr58.7%
Taylor expanded in angle around 0 57.2%
Taylor expanded in angle around 0 54.5%
expm1-log1p-u40.4%
expm1-udef28.3%
associate-*r*28.3%
+-commutative28.3%
Applied egg-rr28.3%
expm1-def40.3%
expm1-log1p54.5%
associate-*l*54.5%
+-commutative54.5%
*-commutative54.5%
associate-*r*54.6%
Simplified54.6%
Final simplification54.6%
b_m = (fabs.f64 b) (FPCore (a b_m angle) :precision binary64 (* 2.0 (* (* (+ b_m a) (- b_m a)) (* PI (* 0.005555555555555556 angle)))))
b_m = fabs(b);
double code(double a, double b_m, double angle) {
return 2.0 * (((b_m + a) * (b_m - a)) * (((double) M_PI) * (0.005555555555555556 * angle)));
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle) {
return 2.0 * (((b_m + a) * (b_m - a)) * (Math.PI * (0.005555555555555556 * angle)));
}
b_m = math.fabs(b) def code(a, b_m, angle): return 2.0 * (((b_m + a) * (b_m - a)) * (math.pi * (0.005555555555555556 * angle)))
b_m = abs(b) function code(a, b_m, angle) return Float64(2.0 * Float64(Float64(Float64(b_m + a) * Float64(b_m - a)) * Float64(pi * Float64(0.005555555555555556 * angle)))) end
b_m = abs(b); function tmp = code(a, b_m, angle) tmp = 2.0 * (((b_m + a) * (b_m - a)) * (pi * (0.005555555555555556 * angle))); end
b_m = N[Abs[b], $MachinePrecision] code[a_, b$95$m_, angle_] := N[(2.0 * N[(N[(N[(b$95$m + a), $MachinePrecision] * N[(b$95$m - a), $MachinePrecision]), $MachinePrecision] * N[(Pi * N[(0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
b_m = \left|b\right|
\\
2 \cdot \left(\left(\left(b\_m + a\right) \cdot \left(b\_m - a\right)\right) \cdot \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right)\right)
\end{array}
Initial program 54.7%
associate-*l*54.7%
associate-*l*54.7%
Simplified54.7%
unpow254.7%
unpow254.7%
difference-of-squares58.7%
Applied egg-rr58.7%
Taylor expanded in angle around 0 57.2%
Taylor expanded in angle around 0 54.6%
associate-*r*54.6%
*-commutative54.6%
Simplified54.6%
Final simplification54.6%
herbie shell --seed 2024027
(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)))))