| Alternative 1 | |
|---|---|
| Error | 21.1 |
| Cost | 26944 |
(FPCore (a b angle) :precision binary64 (* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) (sin (* PI (/ angle 180.0)))) (cos (* PI (/ angle 180.0)))))
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (- (* b b) (* a a))))
(if (<= (/ angle 180.0) -2e-13)
(* t_0 (sin (* (* angle PI) 0.011111111111111112)))
(if (<= (/ angle 180.0) 2e-5)
(*
(* (* -2.0 (+ b a)) (* (- a b) (* angle (* 0.005555555555555556 PI))))
(cos (* PI (/ angle 180.0))))
(fabs (* t_0 (sin (* angle (* PI 0.011111111111111112)))))))))double code(double a, double b, double angle) {
return ((2.0 * (pow(b, 2.0) - pow(a, 2.0))) * sin((((double) M_PI) * (angle / 180.0)))) * cos((((double) M_PI) * (angle / 180.0)));
}
double code(double a, double b, double angle) {
double t_0 = (b * b) - (a * a);
double tmp;
if ((angle / 180.0) <= -2e-13) {
tmp = t_0 * sin(((angle * ((double) M_PI)) * 0.011111111111111112));
} else if ((angle / 180.0) <= 2e-5) {
tmp = ((-2.0 * (b + a)) * ((a - b) * (angle * (0.005555555555555556 * ((double) M_PI))))) * cos((((double) M_PI) * (angle / 180.0)));
} else {
tmp = fabs((t_0 * sin((angle * (((double) M_PI) * 0.011111111111111112)))));
}
return tmp;
}
public static double code(double a, double b, double angle) {
return ((2.0 * (Math.pow(b, 2.0) - Math.pow(a, 2.0))) * Math.sin((Math.PI * (angle / 180.0)))) * Math.cos((Math.PI * (angle / 180.0)));
}
public static double code(double a, double b, double angle) {
double t_0 = (b * b) - (a * a);
double tmp;
if ((angle / 180.0) <= -2e-13) {
tmp = t_0 * Math.sin(((angle * Math.PI) * 0.011111111111111112));
} else if ((angle / 180.0) <= 2e-5) {
tmp = ((-2.0 * (b + a)) * ((a - b) * (angle * (0.005555555555555556 * Math.PI)))) * Math.cos((Math.PI * (angle / 180.0)));
} else {
tmp = Math.abs((t_0 * Math.sin((angle * (Math.PI * 0.011111111111111112)))));
}
return tmp;
}
def code(a, b, angle): return ((2.0 * (math.pow(b, 2.0) - math.pow(a, 2.0))) * math.sin((math.pi * (angle / 180.0)))) * math.cos((math.pi * (angle / 180.0)))
def code(a, b, angle): t_0 = (b * b) - (a * a) tmp = 0 if (angle / 180.0) <= -2e-13: tmp = t_0 * math.sin(((angle * math.pi) * 0.011111111111111112)) elif (angle / 180.0) <= 2e-5: tmp = ((-2.0 * (b + a)) * ((a - b) * (angle * (0.005555555555555556 * math.pi)))) * math.cos((math.pi * (angle / 180.0))) else: tmp = math.fabs((t_0 * math.sin((angle * (math.pi * 0.011111111111111112))))) return tmp
function code(a, b, angle) return Float64(Float64(Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))) * sin(Float64(pi * Float64(angle / 180.0)))) * cos(Float64(pi * Float64(angle / 180.0)))) end
function code(a, b, angle) t_0 = Float64(Float64(b * b) - Float64(a * a)) tmp = 0.0 if (Float64(angle / 180.0) <= -2e-13) tmp = Float64(t_0 * sin(Float64(Float64(angle * pi) * 0.011111111111111112))); elseif (Float64(angle / 180.0) <= 2e-5) tmp = Float64(Float64(Float64(-2.0 * Float64(b + a)) * Float64(Float64(a - b) * Float64(angle * Float64(0.005555555555555556 * pi)))) * cos(Float64(pi * Float64(angle / 180.0)))); else tmp = abs(Float64(t_0 * sin(Float64(angle * Float64(pi * 0.011111111111111112))))); end return tmp end
function tmp = code(a, b, angle) tmp = ((2.0 * ((b ^ 2.0) - (a ^ 2.0))) * sin((pi * (angle / 180.0)))) * cos((pi * (angle / 180.0))); end
function tmp_2 = code(a, b, angle) t_0 = (b * b) - (a * a); tmp = 0.0; if ((angle / 180.0) <= -2e-13) tmp = t_0 * sin(((angle * pi) * 0.011111111111111112)); elseif ((angle / 180.0) <= 2e-5) tmp = ((-2.0 * (b + a)) * ((a - b) * (angle * (0.005555555555555556 * pi)))) * cos((pi * (angle / 180.0))); else tmp = abs((t_0 * sin((angle * (pi * 0.011111111111111112))))); end tmp_2 = tmp; end
code[a_, b_, angle_] := N[(N[(N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Cos[N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
code[a_, b_, angle_] := Block[{t$95$0 = N[(N[(b * b), $MachinePrecision] - N[(a * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(angle / 180.0), $MachinePrecision], -2e-13], N[(t$95$0 * N[Sin[N[(N[(angle * Pi), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle / 180.0), $MachinePrecision], 2e-5], N[(N[(N[(-2.0 * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[(N[(a - b), $MachinePrecision] * N[(angle * N[(0.005555555555555556 * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Abs[N[(t$95$0 * N[Sin[N[(angle * N[(Pi * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]
\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)
\begin{array}{l}
t_0 := b \cdot b - a \cdot a\\
\mathbf{if}\;\frac{angle}{180} \leq -2 \cdot 10^{-13}:\\
\;\;\;\;t_0 \cdot \sin \left(\left(angle \cdot \pi\right) \cdot 0.011111111111111112\right)\\
\mathbf{elif}\;\frac{angle}{180} \leq 2 \cdot 10^{-5}:\\
\;\;\;\;\left(\left(-2 \cdot \left(b + a\right)\right) \cdot \left(\left(a - b\right) \cdot \left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right)\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\\
\mathbf{else}:\\
\;\;\;\;\left|t_0 \cdot \sin \left(angle \cdot \left(\pi \cdot 0.011111111111111112\right)\right)\right|\\
\end{array}
Results
if (/.f64 angle 180) < -2.0000000000000001e-13Initial program 48.4
Simplified48.4
[Start]48.4 | \[ \left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)
\] |
|---|---|
associate-*l* [=>]48.4 | \[ \color{blue}{\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)}
\] |
unpow2 [=>]48.4 | \[ \left(2 \cdot \left(\color{blue}{b \cdot b} - {a}^{2}\right)\right) \cdot \left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)
\] |
unpow2 [=>]48.4 | \[ \left(2 \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right) \cdot \left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)
\] |
Applied egg-rr53.6
Simplified48.2
[Start]53.6 | \[ e^{\mathsf{log1p}\left(\left(2 \cdot \left(b \cdot b - a \cdot a\right)\right) \cdot \left(\left(\sin 0 + \sin \left(2 \cdot \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right) \cdot 0.5\right)\right)} - 1
\] |
|---|---|
expm1-def [=>]51.6 | \[ \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\left(2 \cdot \left(b \cdot b - a \cdot a\right)\right) \cdot \left(\left(\sin 0 + \sin \left(2 \cdot \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right) \cdot 0.5\right)\right)\right)}
\] |
expm1-log1p [=>]48.5 | \[ \color{blue}{\left(2 \cdot \left(b \cdot b - a \cdot a\right)\right) \cdot \left(\left(\sin 0 + \sin \left(2 \cdot \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right) \cdot 0.5\right)}
\] |
*-commutative [=>]48.5 | \[ \color{blue}{\left(\left(b \cdot b - a \cdot a\right) \cdot 2\right)} \cdot \left(\left(\sin 0 + \sin \left(2 \cdot \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right) \cdot 0.5\right)
\] |
associate-*l* [=>]48.4 | \[ \color{blue}{\left(b \cdot b - a \cdot a\right) \cdot \left(2 \cdot \left(\left(\sin 0 + \sin \left(2 \cdot \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right) \cdot 0.5\right)\right)}
\] |
*-commutative [=>]48.4 | \[ \left(b \cdot b - a \cdot a\right) \cdot \color{blue}{\left(\left(\left(\sin 0 + \sin \left(2 \cdot \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right) \cdot 0.5\right) \cdot 2\right)}
\] |
associate-*l* [=>]48.4 | \[ \left(b \cdot b - a \cdot a\right) \cdot \color{blue}{\left(\left(\sin 0 + \sin \left(2 \cdot \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right) \cdot \left(0.5 \cdot 2\right)\right)}
\] |
metadata-eval [=>]48.4 | \[ \left(b \cdot b - a \cdot a\right) \cdot \left(\left(\sin 0 + \sin \left(2 \cdot \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right) \cdot \color{blue}{1}\right)
\] |
if -2.0000000000000001e-13 < (/.f64 angle 180) < 2.00000000000000016e-5Initial program 17.6
Simplified17.6
[Start]17.6 | \[ \left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)
\] |
|---|---|
*-commutative [=>]17.6 | \[ \left(\color{blue}{\left(\left({b}^{2} - {a}^{2}\right) \cdot 2\right)} \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)
\] |
sub-neg [=>]17.6 | \[ \left(\left(\color{blue}{\left({b}^{2} + \left(-{a}^{2}\right)\right)} \cdot 2\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)
\] |
+-commutative [=>]17.6 | \[ \left(\left(\color{blue}{\left(\left(-{a}^{2}\right) + {b}^{2}\right)} \cdot 2\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)
\] |
neg-sub0 [=>]17.6 | \[ \left(\left(\left(\color{blue}{\left(0 - {a}^{2}\right)} + {b}^{2}\right) \cdot 2\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)
\] |
associate-+l- [=>]17.6 | \[ \left(\left(\color{blue}{\left(0 - \left({a}^{2} - {b}^{2}\right)\right)} \cdot 2\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)
\] |
sub0-neg [=>]17.6 | \[ \left(\left(\color{blue}{\left(-\left({a}^{2} - {b}^{2}\right)\right)} \cdot 2\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)
\] |
distribute-lft-neg-out [=>]17.6 | \[ \left(\color{blue}{\left(-\left({a}^{2} - {b}^{2}\right) \cdot 2\right)} \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)
\] |
distribute-rgt-neg-in [=>]17.6 | \[ \left(\color{blue}{\left(\left({a}^{2} - {b}^{2}\right) \cdot \left(-2\right)\right)} \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)
\] |
unpow2 [=>]17.6 | \[ \left(\left(\left(\color{blue}{a \cdot a} - {b}^{2}\right) \cdot \left(-2\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)
\] |
unpow2 [=>]17.6 | \[ \left(\left(\left(a \cdot a - \color{blue}{b \cdot b}\right) \cdot \left(-2\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)
\] |
metadata-eval [=>]17.6 | \[ \left(\left(\left(a \cdot a - b \cdot b\right) \cdot \color{blue}{-2}\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)
\] |
Taylor expanded in angle around inf 17.5
Simplified0.4
[Start]17.5 | \[ \left(-2 \cdot \left(\left({a}^{2} - {b}^{2}\right) \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)
\] |
|---|---|
unpow2 [=>]17.5 | \[ \left(-2 \cdot \left(\left(\color{blue}{a \cdot a} - {b}^{2}\right) \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)
\] |
unpow2 [=>]17.5 | \[ \left(-2 \cdot \left(\left(a \cdot a - \color{blue}{b \cdot b}\right) \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)
\] |
difference-of-squares [=>]17.5 | \[ \left(-2 \cdot \left(\color{blue}{\left(\left(a + b\right) \cdot \left(a - b\right)\right)} \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)
\] |
associate-*r* [=>]17.5 | \[ \left(-2 \cdot \left(\left(\left(a + b\right) \cdot \left(a - b\right)\right) \cdot \sin \color{blue}{\left(\left(0.005555555555555556 \cdot angle\right) \cdot \pi\right)}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)
\] |
*-commutative [<=]17.5 | \[ \left(-2 \cdot \left(\left(\left(a + b\right) \cdot \left(a - b\right)\right) \cdot \sin \left(\color{blue}{\left(angle \cdot 0.005555555555555556\right)} \cdot \pi\right)\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)
\] |
*-commutative [<=]17.5 | \[ \left(-2 \cdot \left(\left(\left(a + b\right) \cdot \left(a - b\right)\right) \cdot \sin \color{blue}{\left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)
\] |
associate-*l* [=>]0.4 | \[ \left(-2 \cdot \color{blue}{\left(\left(a + b\right) \cdot \left(\left(a - b\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)
\] |
associate-*l* [<=]0.4 | \[ \color{blue}{\left(\left(-2 \cdot \left(a + b\right)\right) \cdot \left(\left(a - b\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)} \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)
\] |
+-commutative [=>]0.4 | \[ \left(\left(-2 \cdot \color{blue}{\left(b + a\right)}\right) \cdot \left(\left(a - b\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)
\] |
*-commutative [=>]0.4 | \[ \left(\left(-2 \cdot \left(b + a\right)\right) \cdot \left(\left(a - b\right) \cdot \sin \color{blue}{\left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\right)}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)
\] |
*-commutative [=>]0.4 | \[ \left(\left(-2 \cdot \left(b + a\right)\right) \cdot \left(\left(a - b\right) \cdot \sin \left(\color{blue}{\left(0.005555555555555556 \cdot angle\right)} \cdot \pi\right)\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)
\] |
associate-*r* [<=]0.4 | \[ \left(\left(-2 \cdot \left(b + a\right)\right) \cdot \left(\left(a - b\right) \cdot \sin \color{blue}{\left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)
\] |
Taylor expanded in angle around 0 0.4
Simplified0.3
[Start]0.4 | \[ \left(\left(-2 \cdot \left(b + a\right)\right) \cdot \left(\left(a - b\right) \cdot \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)
\] |
|---|---|
associate-*r* [=>]0.4 | \[ \left(\left(-2 \cdot \left(b + a\right)\right) \cdot \left(\left(a - b\right) \cdot \color{blue}{\left(\left(0.005555555555555556 \cdot angle\right) \cdot \pi\right)}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)
\] |
*-commutative [=>]0.4 | \[ \left(\left(-2 \cdot \left(b + a\right)\right) \cdot \left(\left(a - b\right) \cdot \left(\color{blue}{\left(angle \cdot 0.005555555555555556\right)} \cdot \pi\right)\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)
\] |
associate-*r* [<=]0.3 | \[ \left(\left(-2 \cdot \left(b + a\right)\right) \cdot \left(\left(a - b\right) \cdot \color{blue}{\left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right)}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)
\] |
if 2.00000000000000016e-5 < (/.f64 angle 180) Initial program 48.9
Simplified48.9
[Start]48.9 | \[ \left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)
\] |
|---|---|
associate-*l* [=>]48.9 | \[ \color{blue}{\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)}
\] |
unpow2 [=>]48.9 | \[ \left(2 \cdot \left(\color{blue}{b \cdot b} - {a}^{2}\right)\right) \cdot \left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)
\] |
unpow2 [=>]48.9 | \[ \left(2 \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right) \cdot \left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)
\] |
Applied egg-rr55.7
Simplified49.0
[Start]55.7 | \[ \log \left({\left(\sqrt{e^{\sin 0 + \sin \left(2 \cdot \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}}\right)}^{\left(2 \cdot \left(b \cdot b - a \cdot a\right)\right)}\right)
\] |
|---|---|
log-pow [=>]48.9 | \[ \color{blue}{\left(2 \cdot \left(b \cdot b - a \cdot a\right)\right) \cdot \log \left(\sqrt{e^{\sin 0 + \sin \left(2 \cdot \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}}\right)}
\] |
sin-0 [=>]48.9 | \[ \left(2 \cdot \left(b \cdot b - a \cdot a\right)\right) \cdot \log \left(\sqrt{e^{\color{blue}{0} + \sin \left(2 \cdot \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}}\right)
\] |
+-lft-identity [=>]48.9 | \[ \left(2 \cdot \left(b \cdot b - a \cdot a\right)\right) \cdot \log \left(\sqrt{e^{\color{blue}{\sin \left(2 \cdot \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}}}\right)
\] |
*-commutative [=>]48.9 | \[ \left(2 \cdot \left(b \cdot b - a \cdot a\right)\right) \cdot \log \left(\sqrt{e^{\sin \color{blue}{\left(\left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot 2\right)}}}\right)
\] |
associate-*r* [=>]49.0 | \[ \left(2 \cdot \left(b \cdot b - a \cdot a\right)\right) \cdot \log \left(\sqrt{e^{\sin \left(\color{blue}{\left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556\right)} \cdot 2\right)}}\right)
\] |
*-commutative [<=]49.0 | \[ \left(2 \cdot \left(b \cdot b - a \cdot a\right)\right) \cdot \log \left(\sqrt{e^{\sin \left(\left(\color{blue}{\left(angle \cdot \pi\right)} \cdot 0.005555555555555556\right) \cdot 2\right)}}\right)
\] |
associate-*l* [=>]49.0 | \[ \left(2 \cdot \left(b \cdot b - a \cdot a\right)\right) \cdot \log \left(\sqrt{e^{\sin \color{blue}{\left(\left(angle \cdot \pi\right) \cdot \left(0.005555555555555556 \cdot 2\right)\right)}}}\right)
\] |
metadata-eval [=>]49.0 | \[ \left(2 \cdot \left(b \cdot b - a \cdot a\right)\right) \cdot \log \left(\sqrt{e^{\sin \left(\left(angle \cdot \pi\right) \cdot \color{blue}{0.011111111111111112}\right)}}\right)
\] |
Applied egg-rr53.1
Simplified50.4
[Start]53.1 | \[ \sqrt{{\left(2 \cdot \left(\left(b \cdot b - a \cdot a\right) \cdot \left(0.5 \cdot \sin \left(angle \cdot \left(\pi \cdot 0.011111111111111112\right)\right)\right)\right)\right)}^{2}}
\] |
|---|---|
unpow2 [=>]53.1 | \[ \sqrt{\color{blue}{\left(2 \cdot \left(\left(b \cdot b - a \cdot a\right) \cdot \left(0.5 \cdot \sin \left(angle \cdot \left(\pi \cdot 0.011111111111111112\right)\right)\right)\right)\right) \cdot \left(2 \cdot \left(\left(b \cdot b - a \cdot a\right) \cdot \left(0.5 \cdot \sin \left(angle \cdot \left(\pi \cdot 0.011111111111111112\right)\right)\right)\right)\right)}}
\] |
rem-sqrt-square [=>]50.4 | \[ \color{blue}{\left|2 \cdot \left(\left(b \cdot b - a \cdot a\right) \cdot \left(0.5 \cdot \sin \left(angle \cdot \left(\pi \cdot 0.011111111111111112\right)\right)\right)\right)\right|}
\] |
*-commutative [=>]50.4 | \[ \left|\color{blue}{\left(\left(b \cdot b - a \cdot a\right) \cdot \left(0.5 \cdot \sin \left(angle \cdot \left(\pi \cdot 0.011111111111111112\right)\right)\right)\right) \cdot 2}\right|
\] |
associate-*l* [=>]50.4 | \[ \left|\color{blue}{\left(b \cdot b - a \cdot a\right) \cdot \left(\left(0.5 \cdot \sin \left(angle \cdot \left(\pi \cdot 0.011111111111111112\right)\right)\right) \cdot 2\right)}\right|
\] |
*-commutative [=>]50.4 | \[ \left|\left(b \cdot b - a \cdot a\right) \cdot \color{blue}{\left(2 \cdot \left(0.5 \cdot \sin \left(angle \cdot \left(\pi \cdot 0.011111111111111112\right)\right)\right)\right)}\right|
\] |
associate-*r* [=>]50.4 | \[ \left|\left(b \cdot b - a \cdot a\right) \cdot \color{blue}{\left(\left(2 \cdot 0.5\right) \cdot \sin \left(angle \cdot \left(\pi \cdot 0.011111111111111112\right)\right)\right)}\right|
\] |
metadata-eval [=>]50.4 | \[ \left|\left(b \cdot b - a \cdot a\right) \cdot \left(\color{blue}{1} \cdot \sin \left(angle \cdot \left(\pi \cdot 0.011111111111111112\right)\right)\right)\right|
\] |
*-lft-identity [=>]50.4 | \[ \left|\left(b \cdot b - a \cdot a\right) \cdot \color{blue}{\sin \left(angle \cdot \left(\pi \cdot 0.011111111111111112\right)\right)}\right|
\] |
*-commutative [=>]50.4 | \[ \left|\left(b \cdot b - a \cdot a\right) \cdot \sin \left(angle \cdot \color{blue}{\left(0.011111111111111112 \cdot \pi\right)}\right)\right|
\] |
Final simplification21.3
| Alternative 1 | |
|---|---|
| Error | 21.1 |
| Cost | 26944 |
| Alternative 2 | |
|---|---|
| Error | 21.0 |
| Cost | 26816 |
| Alternative 3 | |
|---|---|
| Error | 21.3 |
| Cost | 20488 |
| Alternative 4 | |
|---|---|
| Error | 21.5 |
| Cost | 14089 |
| Alternative 5 | |
|---|---|
| Error | 22.0 |
| Cost | 13700 |
| Alternative 6 | |
|---|---|
| Error | 22.6 |
| Cost | 13508 |
| Alternative 7 | |
|---|---|
| Error | 22.9 |
| Cost | 7561 |
| Alternative 8 | |
|---|---|
| Error | 29.0 |
| Cost | 7433 |
| Alternative 9 | |
|---|---|
| Error | 29.0 |
| Cost | 7433 |
| Alternative 10 | |
|---|---|
| Error | 22.9 |
| Cost | 7433 |
| Alternative 11 | |
|---|---|
| Error | 37.1 |
| Cost | 7177 |
| Alternative 12 | |
|---|---|
| Error | 37.1 |
| Cost | 7177 |
| Alternative 13 | |
|---|---|
| Error | 32.2 |
| Cost | 7176 |
| Alternative 14 | |
|---|---|
| Error | 32.2 |
| Cost | 7176 |
| Alternative 15 | |
|---|---|
| Error | 32.2 |
| Cost | 7176 |
| Alternative 16 | |
|---|---|
| Error | 32.2 |
| Cost | 7176 |
| Alternative 17 | |
|---|---|
| Error | 51.7 |
| Cost | 320 |
herbie shell --seed 2023059
(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)))))