| Alternative 1 | |
|---|---|
| Accuracy | 67.9% |
| Cost | 71940 |

(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 (cbrt (* angle PI)))
(t_1 (* (sin (* 0.005555555555555556 (* angle PI))) (+ a b))))
(if (<= b -5e+191)
(*
2.0
(*
(- b a)
(* t_1 (cos (* 0.005555555555555556 (pow (pow (cbrt t_0) 3.0) 3.0))))))
(if (<= b -2.8e-149)
(*
2.0
(*
(- b a)
(*
t_1
(cos
(*
(cbrt PI)
(* (* 0.005555555555555556 angle) (pow (cbrt PI) 2.0)))))))
(if (<= b 4.3e+219)
(*
2.0
(* (- b a) (* (cos (* 0.005555555555555556 (pow t_0 3.0))) t_1)))
(*
2.0
(* (* (- b a) (+ a b)) (sin (/ 1.0 (/ 180.0 (* angle PI)))))))))))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 = cbrt((angle * ((double) M_PI)));
double t_1 = sin((0.005555555555555556 * (angle * ((double) M_PI)))) * (a + b);
double tmp;
if (b <= -5e+191) {
tmp = 2.0 * ((b - a) * (t_1 * cos((0.005555555555555556 * pow(pow(cbrt(t_0), 3.0), 3.0)))));
} else if (b <= -2.8e-149) {
tmp = 2.0 * ((b - a) * (t_1 * cos((cbrt(((double) M_PI)) * ((0.005555555555555556 * angle) * pow(cbrt(((double) M_PI)), 2.0))))));
} else if (b <= 4.3e+219) {
tmp = 2.0 * ((b - a) * (cos((0.005555555555555556 * pow(t_0, 3.0))) * t_1));
} else {
tmp = 2.0 * (((b - a) * (a + b)) * sin((1.0 / (180.0 / (angle * ((double) M_PI))))));
}
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 = Math.cbrt((angle * Math.PI));
double t_1 = Math.sin((0.005555555555555556 * (angle * Math.PI))) * (a + b);
double tmp;
if (b <= -5e+191) {
tmp = 2.0 * ((b - a) * (t_1 * Math.cos((0.005555555555555556 * Math.pow(Math.pow(Math.cbrt(t_0), 3.0), 3.0)))));
} else if (b <= -2.8e-149) {
tmp = 2.0 * ((b - a) * (t_1 * Math.cos((Math.cbrt(Math.PI) * ((0.005555555555555556 * angle) * Math.pow(Math.cbrt(Math.PI), 2.0))))));
} else if (b <= 4.3e+219) {
tmp = 2.0 * ((b - a) * (Math.cos((0.005555555555555556 * Math.pow(t_0, 3.0))) * t_1));
} else {
tmp = 2.0 * (((b - a) * (a + b)) * Math.sin((1.0 / (180.0 / (angle * Math.PI)))));
}
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 = cbrt(Float64(angle * pi)) t_1 = Float64(sin(Float64(0.005555555555555556 * Float64(angle * pi))) * Float64(a + b)) tmp = 0.0 if (b <= -5e+191) tmp = Float64(2.0 * Float64(Float64(b - a) * Float64(t_1 * cos(Float64(0.005555555555555556 * ((cbrt(t_0) ^ 3.0) ^ 3.0)))))); elseif (b <= -2.8e-149) tmp = Float64(2.0 * Float64(Float64(b - a) * Float64(t_1 * cos(Float64(cbrt(pi) * Float64(Float64(0.005555555555555556 * angle) * (cbrt(pi) ^ 2.0))))))); elseif (b <= 4.3e+219) tmp = Float64(2.0 * Float64(Float64(b - a) * Float64(cos(Float64(0.005555555555555556 * (t_0 ^ 3.0))) * t_1))); else tmp = Float64(2.0 * Float64(Float64(Float64(b - a) * Float64(a + b)) * sin(Float64(1.0 / Float64(180.0 / Float64(angle * pi)))))); end return 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[Power[N[(angle * Pi), $MachinePrecision], 1/3], $MachinePrecision]}, Block[{t$95$1 = N[(N[Sin[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(a + b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -5e+191], N[(2.0 * N[(N[(b - a), $MachinePrecision] * N[(t$95$1 * N[Cos[N[(0.005555555555555556 * N[Power[N[Power[N[Power[t$95$0, 1/3], $MachinePrecision], 3.0], $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -2.8e-149], N[(2.0 * N[(N[(b - a), $MachinePrecision] * N[(t$95$1 * N[Cos[N[(N[Power[Pi, 1/3], $MachinePrecision] * N[(N[(0.005555555555555556 * angle), $MachinePrecision] * N[Power[N[Power[Pi, 1/3], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 4.3e+219], N[(2.0 * N[(N[(b - a), $MachinePrecision] * N[(N[Cos[N[(0.005555555555555556 * N[Power[t$95$0, 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[(b - a), $MachinePrecision] * N[(a + b), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(1.0 / N[(180.0 / N[(angle * Pi), $MachinePrecision]), $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 := \sqrt[3]{angle \cdot \pi}\\
t_1 := \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(a + b\right)\\
\mathbf{if}\;b \leq -5 \cdot 10^{+191}:\\
\;\;\;\;2 \cdot \left(\left(b - a\right) \cdot \left(t_1 \cdot \cos \left(0.005555555555555556 \cdot {\left({\left(\sqrt[3]{t_0}\right)}^{3}\right)}^{3}\right)\right)\right)\\
\mathbf{elif}\;b \leq -2.8 \cdot 10^{-149}:\\
\;\;\;\;2 \cdot \left(\left(b - a\right) \cdot \left(t_1 \cdot \cos \left(\sqrt[3]{\pi} \cdot \left(\left(0.005555555555555556 \cdot angle\right) \cdot {\left(\sqrt[3]{\pi}\right)}^{2}\right)\right)\right)\right)\\
\mathbf{elif}\;b \leq 4.3 \cdot 10^{+219}:\\
\;\;\;\;2 \cdot \left(\left(b - a\right) \cdot \left(\cos \left(0.005555555555555556 \cdot {t_0}^{3}\right) \cdot t_1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(\left(b - a\right) \cdot \left(a + b\right)\right) \cdot \sin \left(\frac{1}{\frac{180}{angle \cdot \pi}}\right)\right)\\
\end{array}
Herbie found 19 alternatives:
| Alternative | Accuracy | Speedup |
|---|
Results
if b < -5.0000000000000002e191Initial program 46.7%
Simplified54.4%
[Start]46.7 | \[ \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* [=>]46.7 | \[ \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)}
\] |
associate-*l* [=>]46.7 | \[ \color{blue}{2 \cdot \left(\left({b}^{2} - {a}^{2}\right) \cdot \left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)\right)}
\] |
unpow2 [=>]46.7 | \[ 2 \cdot \left(\left(\color{blue}{b \cdot b} - {a}^{2}\right) \cdot \left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)\right)
\] |
unpow2 [=>]46.7 | \[ 2 \cdot \left(\left(b \cdot b - \color{blue}{a \cdot a}\right) \cdot \left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)\right)
\] |
difference-of-squares [=>]54.4 | \[ 2 \cdot \left(\color{blue}{\left(\left(b + a\right) \cdot \left(b - a\right)\right)} \cdot \left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)\right)
\] |
Taylor expanded in angle around inf 65.2%
Applied egg-rr72.9%
[Start]65.2 | \[ 2 \cdot \left(\left(b - a\right) \cdot \left(\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(a + b\right)\right)\right)\right)
\] |
|---|---|
add-cube-cbrt [=>]72.9 | \[ 2 \cdot \left(\left(b - a\right) \cdot \left(\cos \left(0.005555555555555556 \cdot \color{blue}{\left(\left(\sqrt[3]{angle \cdot \pi} \cdot \sqrt[3]{angle \cdot \pi}\right) \cdot \sqrt[3]{angle \cdot \pi}\right)}\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(a + b\right)\right)\right)\right)
\] |
pow3 [=>]72.9 | \[ 2 \cdot \left(\left(b - a\right) \cdot \left(\cos \left(0.005555555555555556 \cdot \color{blue}{{\left(\sqrt[3]{angle \cdot \pi}\right)}^{3}}\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(a + b\right)\right)\right)\right)
\] |
Applied egg-rr80.6%
[Start]72.9 | \[ 2 \cdot \left(\left(b - a\right) \cdot \left(\cos \left(0.005555555555555556 \cdot {\left(\sqrt[3]{angle \cdot \pi}\right)}^{3}\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(a + b\right)\right)\right)\right)
\] |
|---|---|
add-cube-cbrt [=>]76.7 | \[ 2 \cdot \left(\left(b - a\right) \cdot \left(\cos \left(0.005555555555555556 \cdot {\color{blue}{\left(\left(\sqrt[3]{\sqrt[3]{angle \cdot \pi}} \cdot \sqrt[3]{\sqrt[3]{angle \cdot \pi}}\right) \cdot \sqrt[3]{\sqrt[3]{angle \cdot \pi}}\right)}}^{3}\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(a + b\right)\right)\right)\right)
\] |
pow3 [=>]80.6 | \[ 2 \cdot \left(\left(b - a\right) \cdot \left(\cos \left(0.005555555555555556 \cdot {\color{blue}{\left({\left(\sqrt[3]{\sqrt[3]{angle \cdot \pi}}\right)}^{3}\right)}}^{3}\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(a + b\right)\right)\right)\right)
\] |
if -5.0000000000000002e191 < b < -2.7999999999999999e-149Initial program 49.3%
Simplified49.3%
[Start]49.3 | \[ \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* [=>]49.3 | \[ \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)}
\] |
associate-*l* [=>]49.3 | \[ \color{blue}{2 \cdot \left(\left({b}^{2} - {a}^{2}\right) \cdot \left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)\right)}
\] |
unpow2 [=>]49.3 | \[ 2 \cdot \left(\left(\color{blue}{b \cdot b} - {a}^{2}\right) \cdot \left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)\right)
\] |
unpow2 [=>]49.3 | \[ 2 \cdot \left(\left(b \cdot b - \color{blue}{a \cdot a}\right) \cdot \left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)\right)
\] |
difference-of-squares [=>]49.3 | \[ 2 \cdot \left(\color{blue}{\left(\left(b + a\right) \cdot \left(b - a\right)\right)} \cdot \left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)\right)
\] |
Taylor expanded in angle around inf 61.5%
Applied egg-rr38.7%
[Start]61.5 | \[ 2 \cdot \left(\left(b - a\right) \cdot \left(\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(a + b\right)\right)\right)\right)
\] |
|---|---|
add-sqr-sqrt [=>]38.9 | \[ 2 \cdot \left(\left(b - a\right) \cdot \left(\cos \color{blue}{\left(\sqrt{0.005555555555555556 \cdot \left(angle \cdot \pi\right)} \cdot \sqrt{0.005555555555555556 \cdot \left(angle \cdot \pi\right)}\right)} \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(a + b\right)\right)\right)\right)
\] |
pow2 [=>]38.7 | \[ 2 \cdot \left(\left(b - a\right) \cdot \left(\cos \color{blue}{\left({\left(\sqrt{0.005555555555555556 \cdot \left(angle \cdot \pi\right)}\right)}^{2}\right)} \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(a + b\right)\right)\right)\right)
\] |
Applied egg-rr71.0%
[Start]38.7 | \[ 2 \cdot \left(\left(b - a\right) \cdot \left(\cos \left({\left(\sqrt{0.005555555555555556 \cdot \left(angle \cdot \pi\right)}\right)}^{2}\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(a + b\right)\right)\right)\right)
\] |
|---|---|
unpow2 [=>]38.9 | \[ 2 \cdot \left(\left(b - a\right) \cdot \left(\cos \color{blue}{\left(\sqrt{0.005555555555555556 \cdot \left(angle \cdot \pi\right)} \cdot \sqrt{0.005555555555555556 \cdot \left(angle \cdot \pi\right)}\right)} \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(a + b\right)\right)\right)\right)
\] |
add-sqr-sqrt [<=]61.5 | \[ 2 \cdot \left(\left(b - a\right) \cdot \left(\cos \color{blue}{\left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)} \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(a + b\right)\right)\right)\right)
\] |
associate-*r* [=>]62.1 | \[ 2 \cdot \left(\left(b - a\right) \cdot \left(\cos \color{blue}{\left(\left(0.005555555555555556 \cdot angle\right) \cdot \pi\right)} \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(a + b\right)\right)\right)\right)
\] |
add-cube-cbrt [=>]70.1 | \[ 2 \cdot \left(\left(b - a\right) \cdot \left(\cos \left(\left(0.005555555555555556 \cdot angle\right) \cdot \color{blue}{\left(\left(\sqrt[3]{\pi} \cdot \sqrt[3]{\pi}\right) \cdot \sqrt[3]{\pi}\right)}\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(a + b\right)\right)\right)\right)
\] |
associate-*r* [=>]71.0 | \[ 2 \cdot \left(\left(b - a\right) \cdot \left(\cos \color{blue}{\left(\left(\left(0.005555555555555556 \cdot angle\right) \cdot \left(\sqrt[3]{\pi} \cdot \sqrt[3]{\pi}\right)\right) \cdot \sqrt[3]{\pi}\right)} \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(a + b\right)\right)\right)\right)
\] |
pow2 [=>]71.0 | \[ 2 \cdot \left(\left(b - a\right) \cdot \left(\cos \left(\left(\left(0.005555555555555556 \cdot angle\right) \cdot \color{blue}{{\left(\sqrt[3]{\pi}\right)}^{2}}\right) \cdot \sqrt[3]{\pi}\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(a + b\right)\right)\right)\right)
\] |
if -2.7999999999999999e-149 < b < 4.2999999999999997e219Initial program 62.6%
Simplified62.6%
[Start]62.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)
\] |
|---|---|
associate-*l* [=>]62.6 | \[ \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)}
\] |
associate-*l* [=>]62.6 | \[ \color{blue}{2 \cdot \left(\left({b}^{2} - {a}^{2}\right) \cdot \left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)\right)}
\] |
unpow2 [=>]62.6 | \[ 2 \cdot \left(\left(\color{blue}{b \cdot b} - {a}^{2}\right) \cdot \left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)\right)
\] |
unpow2 [=>]62.6 | \[ 2 \cdot \left(\left(b \cdot b - \color{blue}{a \cdot a}\right) \cdot \left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)\right)
\] |
difference-of-squares [=>]62.6 | \[ 2 \cdot \left(\color{blue}{\left(\left(b + a\right) \cdot \left(b - a\right)\right)} \cdot \left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)\right)
\] |
Taylor expanded in angle around inf 70.2%
Applied egg-rr73.5%
[Start]70.2 | \[ 2 \cdot \left(\left(b - a\right) \cdot \left(\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(a + b\right)\right)\right)\right)
\] |
|---|---|
add-cube-cbrt [=>]73.2 | \[ 2 \cdot \left(\left(b - a\right) \cdot \left(\cos \left(0.005555555555555556 \cdot \color{blue}{\left(\left(\sqrt[3]{angle \cdot \pi} \cdot \sqrt[3]{angle \cdot \pi}\right) \cdot \sqrt[3]{angle \cdot \pi}\right)}\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(a + b\right)\right)\right)\right)
\] |
pow3 [=>]73.5 | \[ 2 \cdot \left(\left(b - a\right) \cdot \left(\cos \left(0.005555555555555556 \cdot \color{blue}{{\left(\sqrt[3]{angle \cdot \pi}\right)}^{3}}\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(a + b\right)\right)\right)\right)
\] |
if 4.2999999999999997e219 < b Initial program 53.4%
Simplified73.4%
[Start]53.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* [=>]53.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)}
\] |
associate-*l* [=>]53.4 | \[ \color{blue}{2 \cdot \left(\left({b}^{2} - {a}^{2}\right) \cdot \left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)\right)}
\] |
unpow2 [=>]53.4 | \[ 2 \cdot \left(\left(\color{blue}{b \cdot b} - {a}^{2}\right) \cdot \left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)\right)
\] |
unpow2 [=>]53.4 | \[ 2 \cdot \left(\left(b \cdot b - \color{blue}{a \cdot a}\right) \cdot \left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)\right)
\] |
difference-of-squares [=>]73.4 | \[ 2 \cdot \left(\color{blue}{\left(\left(b + a\right) \cdot \left(b - a\right)\right)} \cdot \left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)\right)
\] |
Applied egg-rr53.4%
[Start]73.4 | \[ 2 \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)\right)
\] |
|---|---|
associate-*r/ [=>]66.8 | \[ 2 \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \left(\sin \color{blue}{\left(\frac{\pi \cdot angle}{180}\right)} \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)\right)
\] |
clear-num [=>]53.4 | \[ 2 \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \left(\sin \color{blue}{\left(\frac{1}{\frac{180}{\pi \cdot angle}}\right)} \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)\right)
\] |
Taylor expanded in angle around 0 86.8%
Final simplification74.2%
| Alternative 1 | |
|---|---|
| Accuracy | 67.9% |
| Cost | 71940 |
| Alternative 2 | |
|---|---|
| Accuracy | 67.9% |
| Cost | 59140 |
| Alternative 3 | |
|---|---|
| Accuracy | 67.6% |
| Cost | 33476 |
| Alternative 4 | |
|---|---|
| Accuracy | 67.6% |
| Cost | 27336 |
| Alternative 5 | |
|---|---|
| Accuracy | 67.9% |
| Cost | 14345 |
| Alternative 6 | |
|---|---|
| Accuracy | 68.0% |
| Cost | 14345 |
| Alternative 7 | |
|---|---|
| Accuracy | 67.9% |
| Cost | 14344 |
| Alternative 8 | |
|---|---|
| Accuracy | 60.3% |
| Cost | 14221 |
| Alternative 9 | |
|---|---|
| Accuracy | 58.3% |
| Cost | 13964 |
| Alternative 10 | |
|---|---|
| Accuracy | 57.6% |
| Cost | 7696 |
| Alternative 11 | |
|---|---|
| Accuracy | 57.7% |
| Cost | 7696 |
| Alternative 12 | |
|---|---|
| Accuracy | 57.0% |
| Cost | 7565 |
| Alternative 13 | |
|---|---|
| Accuracy | 56.9% |
| Cost | 7564 |
| Alternative 14 | |
|---|---|
| Accuracy | 38.3% |
| Cost | 7177 |
| Alternative 15 | |
|---|---|
| Accuracy | 39.1% |
| Cost | 7177 |
| Alternative 16 | |
|---|---|
| Accuracy | 51.5% |
| Cost | 7177 |
| Alternative 17 | |
|---|---|
| Accuracy | 53.5% |
| Cost | 7177 |
| Alternative 18 | |
|---|---|
| Accuracy | 34.3% |
| Cost | 6912 |
herbie shell --seed 2023160
(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)))))