| Alternative 1 | |
|---|---|
| Accuracy | 68.0% |
| Cost | 40136 |

(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 (* 0.005555555555555556 (* angle PI)))
(t_1 (* PI (* angle 0.005555555555555556)))
(t_2 (exp (log1p t_1))))
(if (<= (/ angle 180.0) -10000000000.0)
(*
(+ a b)
(* (- b a) (sqrt (pow (sin (* angle (* PI 0.011111111111111112))) 2.0))))
(if (<= (/ angle 180.0) 2e+85)
(* 2.0 (* (- b a) (* (cos t_0) (* (+ a b) (sin (expm1 (log1p t_0)))))))
(*
(* 2.0 (* (+ a b) (- b a)))
(*
(- (* (sin t_2) (cos 1.0)) (* (cos t_2) (sin 1.0)))
(cos (pow (cbrt t_1) 3.0))))))))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 = 0.005555555555555556 * (angle * ((double) M_PI));
double t_1 = ((double) M_PI) * (angle * 0.005555555555555556);
double t_2 = exp(log1p(t_1));
double tmp;
if ((angle / 180.0) <= -10000000000.0) {
tmp = (a + b) * ((b - a) * sqrt(pow(sin((angle * (((double) M_PI) * 0.011111111111111112))), 2.0)));
} else if ((angle / 180.0) <= 2e+85) {
tmp = 2.0 * ((b - a) * (cos(t_0) * ((a + b) * sin(expm1(log1p(t_0))))));
} else {
tmp = (2.0 * ((a + b) * (b - a))) * (((sin(t_2) * cos(1.0)) - (cos(t_2) * sin(1.0))) * cos(pow(cbrt(t_1), 3.0)));
}
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 = 0.005555555555555556 * (angle * Math.PI);
double t_1 = Math.PI * (angle * 0.005555555555555556);
double t_2 = Math.exp(Math.log1p(t_1));
double tmp;
if ((angle / 180.0) <= -10000000000.0) {
tmp = (a + b) * ((b - a) * Math.sqrt(Math.pow(Math.sin((angle * (Math.PI * 0.011111111111111112))), 2.0)));
} else if ((angle / 180.0) <= 2e+85) {
tmp = 2.0 * ((b - a) * (Math.cos(t_0) * ((a + b) * Math.sin(Math.expm1(Math.log1p(t_0))))));
} else {
tmp = (2.0 * ((a + b) * (b - a))) * (((Math.sin(t_2) * Math.cos(1.0)) - (Math.cos(t_2) * Math.sin(1.0))) * Math.cos(Math.pow(Math.cbrt(t_1), 3.0)));
}
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(0.005555555555555556 * Float64(angle * pi)) t_1 = Float64(pi * Float64(angle * 0.005555555555555556)) t_2 = exp(log1p(t_1)) tmp = 0.0 if (Float64(angle / 180.0) <= -10000000000.0) tmp = Float64(Float64(a + b) * Float64(Float64(b - a) * sqrt((sin(Float64(angle * Float64(pi * 0.011111111111111112))) ^ 2.0)))); elseif (Float64(angle / 180.0) <= 2e+85) tmp = Float64(2.0 * Float64(Float64(b - a) * Float64(cos(t_0) * Float64(Float64(a + b) * sin(expm1(log1p(t_0))))))); else tmp = Float64(Float64(2.0 * Float64(Float64(a + b) * Float64(b - a))) * Float64(Float64(Float64(sin(t_2) * cos(1.0)) - Float64(cos(t_2) * sin(1.0))) * cos((cbrt(t_1) ^ 3.0)))); 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[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Exp[N[Log[1 + t$95$1], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(angle / 180.0), $MachinePrecision], -10000000000.0], N[(N[(a + b), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[Sqrt[N[Power[N[Sin[N[(angle * N[(Pi * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle / 180.0), $MachinePrecision], 2e+85], N[(2.0 * N[(N[(b - a), $MachinePrecision] * N[(N[Cos[t$95$0], $MachinePrecision] * N[(N[(a + b), $MachinePrecision] * N[Sin[N[(Exp[N[Log[1 + t$95$0], $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 * N[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(N[Sin[t$95$2], $MachinePrecision] * N[Cos[1.0], $MachinePrecision]), $MachinePrecision] - N[(N[Cos[t$95$2], $MachinePrecision] * N[Sin[1.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Cos[N[Power[N[Power[t$95$1, 1/3], $MachinePrecision], 3.0], $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 := 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\\
t_1 := \pi \cdot \left(angle \cdot 0.005555555555555556\right)\\
t_2 := e^{\mathsf{log1p}\left(t_1\right)}\\
\mathbf{if}\;\frac{angle}{180} \leq -10000000000:\\
\;\;\;\;\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sqrt{{\sin \left(angle \cdot \left(\pi \cdot 0.011111111111111112\right)\right)}^{2}}\right)\\
\mathbf{elif}\;\frac{angle}{180} \leq 2 \cdot 10^{+85}:\\
\;\;\;\;2 \cdot \left(\left(b - a\right) \cdot \left(\cos t_0 \cdot \left(\left(a + b\right) \cdot \sin \left(\mathsf{expm1}\left(\mathsf{log1p}\left(t_0\right)\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(2 \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right) \cdot \left(\left(\sin t_2 \cdot \cos 1 - \cos t_2 \cdot \sin 1\right) \cdot \cos \left({\left(\sqrt[3]{t_1}\right)}^{3}\right)\right)\\
\end{array}
Herbie found 27 alternatives:
| Alternative | Accuracy | Speedup |
|---|
Results
if (/.f64 angle 180) < -1e10Initial program 30.3%
Simplified31.9%
[Start]30.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* [=>]30.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)}
\] |
unpow2 [=>]30.3 | \[ \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 [=>]30.3 | \[ \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)
\] |
difference-of-squares [=>]31.9 | \[ \left(2 \cdot \color{blue}{\left(\left(b + a\right) \cdot \left(b - a\right)\right)}\right) \cdot \left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)
\] |
Applied egg-rr27.4%
[Start]31.9 | \[ \left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)
\] |
|---|---|
add-cube-cbrt [=>]25.9 | \[ \left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \cos \color{blue}{\left(\left(\sqrt[3]{\pi \cdot \frac{angle}{180}} \cdot \sqrt[3]{\pi \cdot \frac{angle}{180}}\right) \cdot \sqrt[3]{\pi \cdot \frac{angle}{180}}\right)}\right)
\] |
pow3 [=>]28.1 | \[ \left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \cos \color{blue}{\left({\left(\sqrt[3]{\pi \cdot \frac{angle}{180}}\right)}^{3}\right)}\right)
\] |
div-inv [=>]27.4 | \[ \left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \cos \left({\left(\sqrt[3]{\pi \cdot \color{blue}{\left(angle \cdot \frac{1}{180}\right)}}\right)}^{3}\right)\right)
\] |
metadata-eval [=>]27.4 | \[ \left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \cos \left({\left(\sqrt[3]{\pi \cdot \left(angle \cdot \color{blue}{0.005555555555555556}\right)}\right)}^{3}\right)\right)
\] |
Applied egg-rr18.9%
[Start]27.4 | \[ \left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \cos \left({\left(\sqrt[3]{\pi \cdot \left(angle \cdot 0.005555555555555556\right)}\right)}^{3}\right)\right)
\] |
|---|---|
expm1-log1p-u [=>]15.7 | \[ \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \cos \left({\left(\sqrt[3]{\pi \cdot \left(angle \cdot 0.005555555555555556\right)}\right)}^{3}\right)\right)\right)\right)}
\] |
expm1-udef [=>]14.8 | \[ \color{blue}{e^{\mathsf{log1p}\left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \cos \left({\left(\sqrt[3]{\pi \cdot \left(angle \cdot 0.005555555555555556\right)}\right)}^{3}\right)\right)\right)} - 1}
\] |
Simplified32.1%
[Start]18.9 | \[ e^{\mathsf{log1p}\left(2 \cdot \frac{\left(b \cdot b - a \cdot a\right) \cdot \left(\sin 0 + \sin \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right)\right)}{2}\right)} - 1
\] |
|---|---|
expm1-def [=>]19.8 | \[ \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(2 \cdot \frac{\left(b \cdot b - a \cdot a\right) \cdot \left(\sin 0 + \sin \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right)\right)}{2}\right)\right)}
\] |
expm1-log1p [=>]28.5 | \[ \color{blue}{2 \cdot \frac{\left(b \cdot b - a \cdot a\right) \cdot \left(\sin 0 + \sin \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right)\right)}{2}}
\] |
associate-/l* [=>]28.5 | \[ 2 \cdot \color{blue}{\frac{b \cdot b - a \cdot a}{\frac{2}{\sin 0 + \sin \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right)}}}
\] |
associate-*r/ [=>]28.5 | \[ \color{blue}{\frac{2 \cdot \left(b \cdot b - a \cdot a\right)}{\frac{2}{\sin 0 + \sin \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right)}}}
\] |
associate-/r/ [=>]28.5 | \[ \color{blue}{\frac{2 \cdot \left(b \cdot b - a \cdot a\right)}{2} \cdot \left(\sin 0 + \sin \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right)\right)}
\] |
*-commutative [=>]28.5 | \[ \frac{\color{blue}{\left(b \cdot b - a \cdot a\right) \cdot 2}}{2} \cdot \left(\sin 0 + \sin \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right)\right)
\] |
associate-/l* [=>]28.5 | \[ \color{blue}{\frac{b \cdot b - a \cdot a}{\frac{2}{2}}} \cdot \left(\sin 0 + \sin \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right)\right)
\] |
metadata-eval [=>]28.5 | \[ \frac{b \cdot b - a \cdot a}{\color{blue}{1}} \cdot \left(\sin 0 + \sin \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right)\right)
\] |
/-rgt-identity [=>]28.5 | \[ \color{blue}{\left(b \cdot b - a \cdot a\right)} \cdot \left(\sin 0 + \sin \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right)\right)
\] |
difference-of-squares [=>]30.2 | \[ \color{blue}{\left(\left(b + a\right) \cdot \left(b - a\right)\right)} \cdot \left(\sin 0 + \sin \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right)\right)
\] |
+-commutative [<=]30.2 | \[ \left(\color{blue}{\left(a + b\right)} \cdot \left(b - a\right)\right) \cdot \left(\sin 0 + \sin \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right)\right)
\] |
associate-*l* [=>]30.2 | \[ \color{blue}{\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \left(\sin 0 + \sin \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right)\right)\right)}
\] |
sin-0 [=>]30.2 | \[ \left(a + b\right) \cdot \left(\left(b - a\right) \cdot \left(\color{blue}{0} + \sin \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right)\right)\right)
\] |
Applied egg-rr42.5%
[Start]32.1 | \[ \left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \left(angle \cdot \left(\pi \cdot 0.011111111111111112\right)\right)\right)
\] |
|---|---|
add-sqr-sqrt [=>]24.8 | \[ \left(a + b\right) \cdot \left(\left(b - a\right) \cdot \color{blue}{\left(\sqrt{\sin \left(angle \cdot \left(\pi \cdot 0.011111111111111112\right)\right)} \cdot \sqrt{\sin \left(angle \cdot \left(\pi \cdot 0.011111111111111112\right)\right)}\right)}\right)
\] |
sqrt-unprod [=>]42.5 | \[ \left(a + b\right) \cdot \left(\left(b - a\right) \cdot \color{blue}{\sqrt{\sin \left(angle \cdot \left(\pi \cdot 0.011111111111111112\right)\right) \cdot \sin \left(angle \cdot \left(\pi \cdot 0.011111111111111112\right)\right)}}\right)
\] |
pow2 [=>]42.5 | \[ \left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sqrt{\color{blue}{{\sin \left(angle \cdot \left(\pi \cdot 0.011111111111111112\right)\right)}^{2}}}\right)
\] |
if -1e10 < (/.f64 angle 180) < 2e85Initial program 75.0%
Simplified79.7%
[Start]75.0 | \[ \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* [=>]75.0 | \[ \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 [=>]75.0 | \[ \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 [=>]75.0 | \[ \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)
\] |
difference-of-squares [=>]79.7 | \[ \left(2 \cdot \color{blue}{\left(\left(b + a\right) \cdot \left(b - a\right)\right)}\right) \cdot \left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)
\] |
Taylor expanded in angle around inf 93.5%
Applied egg-rr94.5%
[Start]93.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)
\] |
|---|---|
expm1-log1p-u [=>]94.5 | \[ 2 \cdot \left(\left(b - a\right) \cdot \left(\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(\sin \color{blue}{\left(\mathsf{expm1}\left(\mathsf{log1p}\left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right)} \cdot \left(a + b\right)\right)\right)\right)
\] |
if 2e85 < (/.f64 angle 180) Initial program 30.5%
Simplified30.5%
[Start]30.5 | \[ \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* [=>]30.5 | \[ \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 [=>]30.5 | \[ \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 [=>]30.5 | \[ \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)
\] |
difference-of-squares [=>]30.5 | \[ \left(2 \cdot \color{blue}{\left(\left(b + a\right) \cdot \left(b - a\right)\right)}\right) \cdot \left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)
\] |
Applied egg-rr26.2%
[Start]30.5 | \[ \left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)
\] |
|---|---|
add-cube-cbrt [=>]29.1 | \[ \left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \cos \color{blue}{\left(\left(\sqrt[3]{\pi \cdot \frac{angle}{180}} \cdot \sqrt[3]{\pi \cdot \frac{angle}{180}}\right) \cdot \sqrt[3]{\pi \cdot \frac{angle}{180}}\right)}\right)
\] |
pow3 [=>]27.1 | \[ \left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \cos \color{blue}{\left({\left(\sqrt[3]{\pi \cdot \frac{angle}{180}}\right)}^{3}\right)}\right)
\] |
div-inv [=>]26.2 | \[ \left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \cos \left({\left(\sqrt[3]{\pi \cdot \color{blue}{\left(angle \cdot \frac{1}{180}\right)}}\right)}^{3}\right)\right)
\] |
metadata-eval [=>]26.2 | \[ \left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \cos \left({\left(\sqrt[3]{\pi \cdot \left(angle \cdot \color{blue}{0.005555555555555556}\right)}\right)}^{3}\right)\right)
\] |
Applied egg-rr41.9%
[Start]26.2 | \[ \left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \cos \left({\left(\sqrt[3]{\pi \cdot \left(angle \cdot 0.005555555555555556\right)}\right)}^{3}\right)\right)
\] |
|---|---|
expm1-log1p-u [=>]43.6 | \[ \left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \left(\sin \color{blue}{\left(\mathsf{expm1}\left(\mathsf{log1p}\left(\pi \cdot \frac{angle}{180}\right)\right)\right)} \cdot \cos \left({\left(\sqrt[3]{\pi \cdot \left(angle \cdot 0.005555555555555556\right)}\right)}^{3}\right)\right)
\] |
expm1-udef [=>]40.1 | \[ \left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \left(\sin \color{blue}{\left(e^{\mathsf{log1p}\left(\pi \cdot \frac{angle}{180}\right)} - 1\right)} \cdot \cos \left({\left(\sqrt[3]{\pi \cdot \left(angle \cdot 0.005555555555555556\right)}\right)}^{3}\right)\right)
\] |
sin-diff [=>]41.9 | \[ \left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \left(\color{blue}{\left(\sin \left(e^{\mathsf{log1p}\left(\pi \cdot \frac{angle}{180}\right)}\right) \cdot \cos 1 - \cos \left(e^{\mathsf{log1p}\left(\pi \cdot \frac{angle}{180}\right)}\right) \cdot \sin 1\right)} \cdot \cos \left({\left(\sqrt[3]{\pi \cdot \left(angle \cdot 0.005555555555555556\right)}\right)}^{3}\right)\right)
\] |
div-inv [=>]41.9 | \[ \left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \left(\left(\sin \left(e^{\mathsf{log1p}\left(\pi \cdot \color{blue}{\left(angle \cdot \frac{1}{180}\right)}\right)}\right) \cdot \cos 1 - \cos \left(e^{\mathsf{log1p}\left(\pi \cdot \frac{angle}{180}\right)}\right) \cdot \sin 1\right) \cdot \cos \left({\left(\sqrt[3]{\pi \cdot \left(angle \cdot 0.005555555555555556\right)}\right)}^{3}\right)\right)
\] |
metadata-eval [=>]41.9 | \[ \left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \left(\left(\sin \left(e^{\mathsf{log1p}\left(\pi \cdot \left(angle \cdot \color{blue}{0.005555555555555556}\right)\right)}\right) \cdot \cos 1 - \cos \left(e^{\mathsf{log1p}\left(\pi \cdot \frac{angle}{180}\right)}\right) \cdot \sin 1\right) \cdot \cos \left({\left(\sqrt[3]{\pi \cdot \left(angle \cdot 0.005555555555555556\right)}\right)}^{3}\right)\right)
\] |
div-inv [=>]41.9 | \[ \left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \left(\left(\sin \left(e^{\mathsf{log1p}\left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}\right) \cdot \cos 1 - \cos \left(e^{\mathsf{log1p}\left(\pi \cdot \color{blue}{\left(angle \cdot \frac{1}{180}\right)}\right)}\right) \cdot \sin 1\right) \cdot \cos \left({\left(\sqrt[3]{\pi \cdot \left(angle \cdot 0.005555555555555556\right)}\right)}^{3}\right)\right)
\] |
metadata-eval [=>]41.9 | \[ \left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \left(\left(\sin \left(e^{\mathsf{log1p}\left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}\right) \cdot \cos 1 - \cos \left(e^{\mathsf{log1p}\left(\pi \cdot \left(angle \cdot \color{blue}{0.005555555555555556}\right)\right)}\right) \cdot \sin 1\right) \cdot \cos \left({\left(\sqrt[3]{\pi \cdot \left(angle \cdot 0.005555555555555556\right)}\right)}^{3}\right)\right)
\] |
Final simplification72.2%
| Alternative 1 | |
|---|---|
| Accuracy | 68.0% |
| Cost | 40136 |
| Alternative 2 | |
|---|---|
| Accuracy | 68.0% |
| Cost | 27076 |
| Alternative 3 | |
|---|---|
| Accuracy | 67.8% |
| Cost | 26692 |
| Alternative 4 | |
|---|---|
| Accuracy | 62.0% |
| Cost | 13972 |
| Alternative 5 | |
|---|---|
| Accuracy | 62.4% |
| Cost | 13968 |
| Alternative 6 | |
|---|---|
| Accuracy | 62.4% |
| Cost | 13900 |
| Alternative 7 | |
|---|---|
| Accuracy | 62.4% |
| Cost | 13900 |
| Alternative 8 | |
|---|---|
| Accuracy | 64.1% |
| Cost | 13840 |
| Alternative 9 | |
|---|---|
| Accuracy | 66.9% |
| Cost | 13833 |
| Alternative 10 | |
|---|---|
| Accuracy | 64.8% |
| Cost | 13708 |
| Alternative 11 | |
|---|---|
| Accuracy | 67.8% |
| Cost | 13568 |
| Alternative 12 | |
|---|---|
| Accuracy | 60.9% |
| Cost | 13444 |
| Alternative 13 | |
|---|---|
| Accuracy | 61.6% |
| Cost | 13444 |
| Alternative 14 | |
|---|---|
| Accuracy | 61.6% |
| Cost | 13444 |
| Alternative 15 | |
|---|---|
| Accuracy | 57.1% |
| Cost | 7433 |
| Alternative 16 | |
|---|---|
| Accuracy | 57.1% |
| Cost | 7433 |
| Alternative 17 | |
|---|---|
| Accuracy | 61.1% |
| Cost | 7432 |
| Alternative 18 | |
|---|---|
| Accuracy | 52.1% |
| Cost | 7305 |
| Alternative 19 | |
|---|---|
| Accuracy | 52.1% |
| Cost | 7304 |
| Alternative 20 | |
|---|---|
| Accuracy | 52.1% |
| Cost | 7177 |
| Alternative 21 | |
|---|---|
| Accuracy | 52.1% |
| Cost | 7177 |
| Alternative 22 | |
|---|---|
| Accuracy | 52.1% |
| Cost | 7177 |
| Alternative 23 | |
|---|---|
| Accuracy | 52.1% |
| Cost | 7177 |
| Alternative 24 | |
|---|---|
| Accuracy | 34.8% |
| Cost | 6912 |
| Alternative 25 | |
|---|---|
| Accuracy | 34.8% |
| Cost | 6912 |
| Alternative 26 | |
|---|---|
| Accuracy | 38.4% |
| Cost | 6912 |
herbie shell --seed 2023161
(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)))))