
(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 10 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 (* (+ b_m a) (- b_m a)))
(t_1 (cos (* PI (/ angle 180.0))))
(t_2 (cbrt (* angle 0.005555555555555556))))
(if (<= b_m 3.7e+152)
(* 2.0 (* t_1 (* t_0 (sin (* 0.005555555555555556 (* PI angle))))))
(if (<= b_m 5e+245)
(*
2.0
(*
t_1
(*
t_0
(sin
(*
(pow (cbrt angle) 2.0)
(* (cbrt angle) (* PI 0.005555555555555556)))))))
(* 2.0 (* t_1 (* t_0 (sin (* (pow t_2 2.0) (* PI t_2))))))))))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 = cos((((double) M_PI) * (angle / 180.0)));
double t_2 = cbrt((angle * 0.005555555555555556));
double tmp;
if (b_m <= 3.7e+152) {
tmp = 2.0 * (t_1 * (t_0 * sin((0.005555555555555556 * (((double) M_PI) * angle)))));
} else if (b_m <= 5e+245) {
tmp = 2.0 * (t_1 * (t_0 * sin((pow(cbrt(angle), 2.0) * (cbrt(angle) * (((double) M_PI) * 0.005555555555555556))))));
} else {
tmp = 2.0 * (t_1 * (t_0 * sin((pow(t_2, 2.0) * (((double) M_PI) * t_2)))));
}
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.cos((Math.PI * (angle / 180.0)));
double t_2 = Math.cbrt((angle * 0.005555555555555556));
double tmp;
if (b_m <= 3.7e+152) {
tmp = 2.0 * (t_1 * (t_0 * Math.sin((0.005555555555555556 * (Math.PI * angle)))));
} else if (b_m <= 5e+245) {
tmp = 2.0 * (t_1 * (t_0 * Math.sin((Math.pow(Math.cbrt(angle), 2.0) * (Math.cbrt(angle) * (Math.PI * 0.005555555555555556))))));
} else {
tmp = 2.0 * (t_1 * (t_0 * Math.sin((Math.pow(t_2, 2.0) * (Math.PI * t_2)))));
}
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 = cos(Float64(pi * Float64(angle / 180.0))) t_2 = cbrt(Float64(angle * 0.005555555555555556)) tmp = 0.0 if (b_m <= 3.7e+152) tmp = Float64(2.0 * Float64(t_1 * Float64(t_0 * sin(Float64(0.005555555555555556 * Float64(pi * angle)))))); elseif (b_m <= 5e+245) tmp = Float64(2.0 * Float64(t_1 * Float64(t_0 * sin(Float64((cbrt(angle) ^ 2.0) * Float64(cbrt(angle) * Float64(pi * 0.005555555555555556))))))); else tmp = Float64(2.0 * Float64(t_1 * Float64(t_0 * sin(Float64((t_2 ^ 2.0) * Float64(pi * t_2)))))); end return 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[Cos[N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Power[N[(angle * 0.005555555555555556), $MachinePrecision], 1/3], $MachinePrecision]}, If[LessEqual[b$95$m, 3.7e+152], N[(2.0 * N[(t$95$1 * N[(t$95$0 * N[Sin[N[(0.005555555555555556 * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b$95$m, 5e+245], N[(2.0 * N[(t$95$1 * N[(t$95$0 * N[Sin[N[(N[Power[N[Power[angle, 1/3], $MachinePrecision], 2.0], $MachinePrecision] * N[(N[Power[angle, 1/3], $MachinePrecision] * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(t$95$1 * N[(t$95$0 * N[Sin[N[(N[Power[t$95$2, 2.0], $MachinePrecision] * N[(Pi * t$95$2), $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 := \cos \left(\pi \cdot \frac{angle}{180}\right)\\
t_2 := \sqrt[3]{angle \cdot 0.005555555555555556}\\
\mathbf{if}\;b_m \leq 3.7 \cdot 10^{+152}:\\
\;\;\;\;2 \cdot \left(t_1 \cdot \left(t_0 \cdot \sin \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)\right)\right)\\
\mathbf{elif}\;b_m \leq 5 \cdot 10^{+245}:\\
\;\;\;\;2 \cdot \left(t_1 \cdot \left(t_0 \cdot \sin \left({\left(\sqrt[3]{angle}\right)}^{2} \cdot \left(\sqrt[3]{angle} \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(t_1 \cdot \left(t_0 \cdot \sin \left({t_2}^{2} \cdot \left(\pi \cdot t_2\right)\right)\right)\right)\\
\end{array}
\end{array}
if b < 3.69999999999999996e152Initial program 60.1%
associate-*l*60.1%
associate-*l*60.1%
Simplified60.1%
unpow260.1%
unpow260.1%
difference-of-squares61.1%
Applied egg-rr61.1%
Taylor expanded in angle around 0 61.7%
if 3.69999999999999996e152 < b < 5.00000000000000034e245Initial program 44.7%
associate-*l*44.7%
associate-*l*44.7%
Simplified44.7%
unpow244.7%
unpow244.7%
difference-of-squares56.8%
Applied egg-rr56.8%
add-sqr-sqrt36.3%
pow236.3%
div-inv36.3%
metadata-eval36.3%
Applied egg-rr36.3%
unpow236.3%
add-sqr-sqrt56.8%
*-commutative56.8%
associate-*l*56.8%
metadata-eval56.8%
associate-/r/56.8%
clear-num56.8%
add-cube-cbrt80.8%
associate-*l*68.8%
pow268.8%
clear-num68.8%
associate-/r/68.8%
metadata-eval68.8%
Applied egg-rr68.8%
if 5.00000000000000034e245 < b Initial program 18.7%
associate-*l*18.7%
associate-*l*18.7%
Simplified18.7%
unpow218.7%
unpow218.7%
difference-of-squares52.8%
Applied egg-rr52.8%
add-sqr-sqrt34.5%
pow234.5%
div-inv34.5%
metadata-eval34.5%
Applied egg-rr34.5%
unpow234.5%
add-sqr-sqrt52.8%
*-commutative52.8%
add-cube-cbrt61.1%
associate-*l*61.1%
pow261.1%
*-commutative61.1%
*-commutative61.1%
Applied egg-rr61.1%
Final simplification62.4%
b_m = (fabs.f64 b)
(FPCore (a b_m angle)
:precision binary64
(let* ((t_0 (* PI (* angle 0.005555555555555556)))
(t_1 (* (+ b_m a) (- b_m a)))
(t_2 (* PI (/ angle 180.0))))
(if (<=
(* (* (* 2.0 (- (pow b_m 2.0) (pow a 2.0))) (sin t_2)) (cos t_2))
2e+140)
(* 2.0 (* (* t_1 (sin (/ PI (/ 180.0 angle)))) (log (exp (cos t_0)))))
(*
2.0
(*
(*
t_1
(sin
(*
(pow (cbrt angle) 2.0)
(* (cbrt angle) (* PI 0.005555555555555556)))))
(cos (expm1 (log1p t_0))))))))b_m = fabs(b);
double code(double a, double b_m, double angle) {
double t_0 = ((double) M_PI) * (angle * 0.005555555555555556);
double t_1 = (b_m + a) * (b_m - a);
double t_2 = ((double) M_PI) * (angle / 180.0);
double tmp;
if ((((2.0 * (pow(b_m, 2.0) - pow(a, 2.0))) * sin(t_2)) * cos(t_2)) <= 2e+140) {
tmp = 2.0 * ((t_1 * sin((((double) M_PI) / (180.0 / angle)))) * log(exp(cos(t_0))));
} else {
tmp = 2.0 * ((t_1 * sin((pow(cbrt(angle), 2.0) * (cbrt(angle) * (((double) M_PI) * 0.005555555555555556))))) * cos(expm1(log1p(t_0))));
}
return tmp;
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle) {
double t_0 = Math.PI * (angle * 0.005555555555555556);
double t_1 = (b_m + a) * (b_m - a);
double t_2 = Math.PI * (angle / 180.0);
double tmp;
if ((((2.0 * (Math.pow(b_m, 2.0) - Math.pow(a, 2.0))) * Math.sin(t_2)) * Math.cos(t_2)) <= 2e+140) {
tmp = 2.0 * ((t_1 * Math.sin((Math.PI / (180.0 / angle)))) * Math.log(Math.exp(Math.cos(t_0))));
} else {
tmp = 2.0 * ((t_1 * Math.sin((Math.pow(Math.cbrt(angle), 2.0) * (Math.cbrt(angle) * (Math.PI * 0.005555555555555556))))) * Math.cos(Math.expm1(Math.log1p(t_0))));
}
return tmp;
}
b_m = abs(b) function code(a, b_m, angle) t_0 = Float64(pi * Float64(angle * 0.005555555555555556)) t_1 = Float64(Float64(b_m + a) * Float64(b_m - a)) t_2 = Float64(pi * Float64(angle / 180.0)) tmp = 0.0 if (Float64(Float64(Float64(2.0 * Float64((b_m ^ 2.0) - (a ^ 2.0))) * sin(t_2)) * cos(t_2)) <= 2e+140) tmp = Float64(2.0 * Float64(Float64(t_1 * sin(Float64(pi / Float64(180.0 / angle)))) * log(exp(cos(t_0))))); else tmp = Float64(2.0 * Float64(Float64(t_1 * sin(Float64((cbrt(angle) ^ 2.0) * Float64(cbrt(angle) * Float64(pi * 0.005555555555555556))))) * cos(expm1(log1p(t_0))))); end return tmp end
b_m = N[Abs[b], $MachinePrecision]
code[a_, b$95$m_, angle_] := Block[{t$95$0 = N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(b$95$m + a), $MachinePrecision] * N[(b$95$m - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(N[(2.0 * N[(N[Power[b$95$m, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$2], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$2], $MachinePrecision]), $MachinePrecision], 2e+140], N[(2.0 * N[(N[(t$95$1 * N[Sin[N[(Pi / N[(180.0 / angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Log[N[Exp[N[Cos[t$95$0], $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(t$95$1 * N[Sin[N[(N[Power[N[Power[angle, 1/3], $MachinePrecision], 2.0], $MachinePrecision] * N[(N[Power[angle, 1/3], $MachinePrecision] * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Cos[N[(Exp[N[Log[1 + t$95$0], $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
t_0 := \pi \cdot \left(angle \cdot 0.005555555555555556\right)\\
t_1 := \left(b_m + a\right) \cdot \left(b_m - a\right)\\
t_2 := \pi \cdot \frac{angle}{180}\\
\mathbf{if}\;\left(\left(2 \cdot \left({b_m}^{2} - {a}^{2}\right)\right) \cdot \sin t_2\right) \cdot \cos t_2 \leq 2 \cdot 10^{+140}:\\
\;\;\;\;2 \cdot \left(\left(t_1 \cdot \sin \left(\frac{\pi}{\frac{180}{angle}}\right)\right) \cdot \log \left(e^{\cos t_0}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(t_1 \cdot \sin \left({\left(\sqrt[3]{angle}\right)}^{2} \cdot \left(\sqrt[3]{angle} \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)\right) \cdot \cos \left(\mathsf{expm1}\left(\mathsf{log1p}\left(t_0\right)\right)\right)\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 (*.f64 2 (-.f64 (pow.f64 b 2) (pow.f64 a 2))) (sin.f64 (*.f64 (PI.f64) (/.f64 angle 180)))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle 180)))) < 2.00000000000000012e140Initial program 64.3%
associate-*l*64.3%
associate-*l*64.3%
Simplified64.3%
unpow264.3%
unpow264.3%
difference-of-squares64.3%
Applied egg-rr64.3%
Taylor expanded in angle around 0 64.9%
add-log-exp64.9%
div-inv65.2%
metadata-eval65.2%
Applied egg-rr65.2%
*-commutative65.2%
metadata-eval65.2%
div-inv64.6%
*-commutative64.6%
associate-/l*65.1%
Applied egg-rr65.1%
if 2.00000000000000012e140 < (*.f64 (*.f64 (*.f64 2 (-.f64 (pow.f64 b 2) (pow.f64 a 2))) (sin.f64 (*.f64 (PI.f64) (/.f64 angle 180)))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle 180)))) Initial program 38.1%
associate-*l*38.1%
associate-*l*38.1%
Simplified38.1%
unpow238.1%
unpow238.1%
difference-of-squares50.6%
Applied egg-rr50.6%
add-sqr-sqrt29.7%
pow229.7%
div-inv25.8%
metadata-eval25.8%
Applied egg-rr25.8%
unpow225.8%
add-sqr-sqrt47.5%
*-commutative47.5%
associate-*l*48.8%
metadata-eval48.8%
associate-/r/48.8%
clear-num48.8%
add-cube-cbrt55.1%
associate-*l*54.6%
pow254.6%
clear-num54.6%
associate-/r/54.6%
metadata-eval54.6%
Applied egg-rr54.6%
div-inv53.0%
metadata-eval53.0%
expm1-log1p-u46.6%
Applied egg-rr46.6%
Final simplification59.6%
b_m = (fabs.f64 b)
(FPCore (a b_m angle)
:precision binary64
(let* ((t_0 (* (+ b_m a) (- b_m a))) (t_1 (cos (* PI (/ angle 180.0)))))
(if (<= a 5.1e+166)
(* 2.0 (* t_1 (* t_0 (fabs (sin (* PI (* angle 0.005555555555555556)))))))
(if (<= a 1.05e+233)
(*
2.0
(*
t_1
(*
t_0
(sin
(*
(pow (cbrt angle) 2.0)
(* (cbrt angle) (* PI 0.005555555555555556)))))))
(* 2.0 (* t_1 (* t_0 (sin (* 0.005555555555555556 (* PI 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 = cos((((double) M_PI) * (angle / 180.0)));
double tmp;
if (a <= 5.1e+166) {
tmp = 2.0 * (t_1 * (t_0 * fabs(sin((((double) M_PI) * (angle * 0.005555555555555556))))));
} else if (a <= 1.05e+233) {
tmp = 2.0 * (t_1 * (t_0 * sin((pow(cbrt(angle), 2.0) * (cbrt(angle) * (((double) M_PI) * 0.005555555555555556))))));
} else {
tmp = 2.0 * (t_1 * (t_0 * sin((0.005555555555555556 * (((double) M_PI) * 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.cos((Math.PI * (angle / 180.0)));
double tmp;
if (a <= 5.1e+166) {
tmp = 2.0 * (t_1 * (t_0 * Math.abs(Math.sin((Math.PI * (angle * 0.005555555555555556))))));
} else if (a <= 1.05e+233) {
tmp = 2.0 * (t_1 * (t_0 * Math.sin((Math.pow(Math.cbrt(angle), 2.0) * (Math.cbrt(angle) * (Math.PI * 0.005555555555555556))))));
} else {
tmp = 2.0 * (t_1 * (t_0 * Math.sin((0.005555555555555556 * (Math.PI * 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 = cos(Float64(pi * Float64(angle / 180.0))) tmp = 0.0 if (a <= 5.1e+166) tmp = Float64(2.0 * Float64(t_1 * Float64(t_0 * abs(sin(Float64(pi * Float64(angle * 0.005555555555555556))))))); elseif (a <= 1.05e+233) tmp = Float64(2.0 * Float64(t_1 * Float64(t_0 * sin(Float64((cbrt(angle) ^ 2.0) * Float64(cbrt(angle) * Float64(pi * 0.005555555555555556))))))); else tmp = Float64(2.0 * Float64(t_1 * Float64(t_0 * sin(Float64(0.005555555555555556 * Float64(pi * angle)))))); end return 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[Cos[N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[a, 5.1e+166], N[(2.0 * N[(t$95$1 * N[(t$95$0 * N[Abs[N[Sin[N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.05e+233], N[(2.0 * N[(t$95$1 * N[(t$95$0 * N[Sin[N[(N[Power[N[Power[angle, 1/3], $MachinePrecision], 2.0], $MachinePrecision] * N[(N[Power[angle, 1/3], $MachinePrecision] * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(t$95$1 * N[(t$95$0 * N[Sin[N[(0.005555555555555556 * N[(Pi * 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 := \cos \left(\pi \cdot \frac{angle}{180}\right)\\
\mathbf{if}\;a \leq 5.1 \cdot 10^{+166}:\\
\;\;\;\;2 \cdot \left(t_1 \cdot \left(t_0 \cdot \left|\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right|\right)\right)\\
\mathbf{elif}\;a \leq 1.05 \cdot 10^{+233}:\\
\;\;\;\;2 \cdot \left(t_1 \cdot \left(t_0 \cdot \sin \left({\left(\sqrt[3]{angle}\right)}^{2} \cdot \left(\sqrt[3]{angle} \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(t_1 \cdot \left(t_0 \cdot \sin \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)\right)\right)\\
\end{array}
\end{array}
if a < 5.1e166Initial program 58.3%
associate-*l*58.3%
associate-*l*58.3%
Simplified58.3%
unpow258.3%
unpow258.3%
difference-of-squares60.1%
Applied egg-rr60.1%
add-sqr-sqrt28.3%
pow228.3%
div-inv28.3%
metadata-eval28.3%
Applied egg-rr28.3%
unpow228.3%
add-sqr-sqrt59.9%
*-commutative59.9%
associate-*l*59.7%
metadata-eval59.7%
associate-/r/59.7%
clear-num59.7%
add-cube-cbrt61.2%
associate-*l*59.7%
pow259.7%
clear-num59.7%
associate-/r/59.7%
metadata-eval59.7%
Applied egg-rr59.7%
associate-*r*61.2%
unpow261.2%
add-cube-cbrt59.7%
associate-*r*59.9%
*-commutative59.9%
*-commutative59.9%
metadata-eval59.9%
div-inv60.1%
*-commutative60.1%
add-sqr-sqrt26.2%
sqrt-unprod33.7%
sqr-sin-a24.7%
*-commutative24.7%
div-inv24.6%
metadata-eval24.6%
associate-*r*24.6%
Applied egg-rr33.7%
unpow233.7%
rem-sqrt-square39.0%
*-commutative39.0%
*-commutative39.0%
associate-*l*39.0%
Simplified39.0%
if 5.1e166 < a < 1.04999999999999998e233Initial program 40.2%
associate-*l*40.2%
associate-*l*40.2%
Simplified40.2%
unpow240.2%
unpow240.2%
difference-of-squares52.3%
Applied egg-rr52.3%
add-sqr-sqrt46.3%
pow246.3%
div-inv35.2%
metadata-eval35.2%
Applied egg-rr35.2%
unpow235.2%
add-sqr-sqrt46.7%
*-commutative46.7%
associate-*l*46.7%
metadata-eval46.7%
associate-/r/46.7%
clear-num46.7%
add-cube-cbrt52.3%
associate-*l*74.5%
pow274.5%
clear-num74.5%
associate-/r/74.5%
metadata-eval74.5%
Applied egg-rr74.5%
if 1.04999999999999998e233 < a Initial program 50.5%
associate-*l*50.5%
associate-*l*50.5%
Simplified50.5%
unpow250.5%
unpow250.5%
difference-of-squares75.5%
Applied egg-rr75.5%
Taylor expanded in angle around 0 83.9%
Final simplification43.6%
b_m = (fabs.f64 b)
(FPCore (a b_m angle)
:precision binary64
(let* ((t_0 (* (+ b_m a) (- b_m a)))
(t_1 (* 0.005555555555555556 (* PI angle))))
(if (<= (pow b_m 2.0) 1e+303)
(* 2.0 (* (cos (* PI (/ angle 180.0))) (* t_0 (sin t_1))))
(*
2.0
(*
t_0
(+ t_1 (* -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 = (b_m + a) * (b_m - a);
double t_1 = 0.005555555555555556 * (((double) M_PI) * angle);
double tmp;
if (pow(b_m, 2.0) <= 1e+303) {
tmp = 2.0 * (cos((((double) M_PI) * (angle / 180.0))) * (t_0 * sin(t_1)));
} else {
tmp = 2.0 * (t_0 * (t_1 + (-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 = (b_m + a) * (b_m - a);
double t_1 = 0.005555555555555556 * (Math.PI * angle);
double tmp;
if (Math.pow(b_m, 2.0) <= 1e+303) {
tmp = 2.0 * (Math.cos((Math.PI * (angle / 180.0))) * (t_0 * Math.sin(t_1)));
} else {
tmp = 2.0 * (t_0 * (t_1 + (-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 = (b_m + a) * (b_m - a) t_1 = 0.005555555555555556 * (math.pi * angle) tmp = 0 if math.pow(b_m, 2.0) <= 1e+303: tmp = 2.0 * (math.cos((math.pi * (angle / 180.0))) * (t_0 * math.sin(t_1))) else: tmp = 2.0 * (t_0 * (t_1 + (-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(Float64(b_m + a) * Float64(b_m - a)) t_1 = Float64(0.005555555555555556 * Float64(pi * angle)) tmp = 0.0 if ((b_m ^ 2.0) <= 1e+303) tmp = Float64(2.0 * Float64(cos(Float64(pi * Float64(angle / 180.0))) * Float64(t_0 * sin(t_1)))); else tmp = Float64(2.0 * Float64(t_0 * Float64(t_1 + 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 = (b_m + a) * (b_m - a); t_1 = 0.005555555555555556 * (pi * angle); tmp = 0.0; if ((b_m ^ 2.0) <= 1e+303) tmp = 2.0 * (cos((pi * (angle / 180.0))) * (t_0 * sin(t_1))); else tmp = 2.0 * (t_0 * (t_1 + (-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[(N[(b$95$m + a), $MachinePrecision] * N[(b$95$m - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(0.005555555555555556 * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Power[b$95$m, 2.0], $MachinePrecision], 1e+303], N[(2.0 * N[(N[Cos[N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(t$95$0 * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(t$95$0 * N[(t$95$1 + 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 := \left(b_m + a\right) \cdot \left(b_m - a\right)\\
t_1 := 0.005555555555555556 \cdot \left(\pi \cdot angle\right)\\
\mathbf{if}\;{b_m}^{2} \leq 10^{+303}:\\
\;\;\;\;2 \cdot \left(\cos \left(\pi \cdot \frac{angle}{180}\right) \cdot \left(t_0 \cdot \sin t_1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(t_0 \cdot \left(t_1 + -2.8577960676726107 \cdot 10^{-8} \cdot \left({angle}^{3} \cdot {\pi}^{3}\right)\right)\right)\\
\end{array}
\end{array}
if (pow.f64 b 2) < 1e303Initial program 65.6%
associate-*l*65.6%
associate-*l*65.6%
Simplified65.6%
unpow265.6%
unpow265.6%
difference-of-squares65.6%
Applied egg-rr65.6%
Taylor expanded in angle around 0 66.3%
if 1e303 < (pow.f64 b 2) Initial program 32.8%
associate-*l*32.8%
associate-*l*32.8%
Simplified32.8%
unpow232.8%
unpow232.8%
difference-of-squares46.1%
Applied egg-rr46.1%
Taylor expanded in angle around 0 49.0%
Taylor expanded in angle around 0 54.9%
Final simplification63.2%
b_m = (fabs.f64 b)
(FPCore (a b_m angle)
:precision binary64
(let* ((t_0
(*
(* (+ b_m a) (- b_m a))
(sin (* 0.005555555555555556 (* PI angle))))))
(if (<= (pow b_m 2.0) 2e+307)
(* 2.0 (* (cos (* PI (/ angle 180.0))) t_0))
(* 2.0 t_0))))b_m = fabs(b);
double code(double a, double b_m, double angle) {
double t_0 = ((b_m + a) * (b_m - a)) * sin((0.005555555555555556 * (((double) M_PI) * angle)));
double tmp;
if (pow(b_m, 2.0) <= 2e+307) {
tmp = 2.0 * (cos((((double) M_PI) * (angle / 180.0))) * t_0);
} else {
tmp = 2.0 * 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)) * Math.sin((0.005555555555555556 * (Math.PI * angle)));
double tmp;
if (Math.pow(b_m, 2.0) <= 2e+307) {
tmp = 2.0 * (Math.cos((Math.PI * (angle / 180.0))) * t_0);
} else {
tmp = 2.0 * t_0;
}
return tmp;
}
b_m = math.fabs(b) def code(a, b_m, angle): t_0 = ((b_m + a) * (b_m - a)) * math.sin((0.005555555555555556 * (math.pi * angle))) tmp = 0 if math.pow(b_m, 2.0) <= 2e+307: tmp = 2.0 * (math.cos((math.pi * (angle / 180.0))) * t_0) else: tmp = 2.0 * t_0 return tmp
b_m = abs(b) function code(a, b_m, angle) t_0 = Float64(Float64(Float64(b_m + a) * Float64(b_m - a)) * sin(Float64(0.005555555555555556 * Float64(pi * angle)))) tmp = 0.0 if ((b_m ^ 2.0) <= 2e+307) tmp = Float64(2.0 * Float64(cos(Float64(pi * Float64(angle / 180.0))) * t_0)); else tmp = Float64(2.0 * 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)) * sin((0.005555555555555556 * (pi * angle))); tmp = 0.0; if ((b_m ^ 2.0) <= 2e+307) tmp = 2.0 * (cos((pi * (angle / 180.0))) * t_0); else tmp = 2.0 * 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[(N[(b$95$m + a), $MachinePrecision] * N[(b$95$m - a), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(0.005555555555555556 * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Power[b$95$m, 2.0], $MachinePrecision], 2e+307], N[(2.0 * N[(N[Cos[N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision], N[(2.0 * t$95$0), $MachinePrecision]]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
t_0 := \left(\left(b_m + a\right) \cdot \left(b_m - a\right)\right) \cdot \sin \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)\\
\mathbf{if}\;{b_m}^{2} \leq 2 \cdot 10^{+307}:\\
\;\;\;\;2 \cdot \left(\cos \left(\pi \cdot \frac{angle}{180}\right) \cdot t_0\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot t_0\\
\end{array}
\end{array}
if (pow.f64 b 2) < 1.99999999999999997e307Initial program 65.3%
associate-*l*65.3%
associate-*l*65.3%
Simplified65.3%
unpow265.3%
unpow265.3%
difference-of-squares65.2%
Applied egg-rr65.2%
Taylor expanded in angle around 0 66.0%
if 1.99999999999999997e307 < (pow.f64 b 2) Initial program 33.2%
associate-*l*33.2%
associate-*l*33.2%
Simplified33.2%
unpow233.2%
unpow233.2%
difference-of-squares46.8%
Applied egg-rr46.8%
Taylor expanded in angle around 0 45.3%
Taylor expanded in angle around 0 54.0%
Final simplification62.8%
b_m = (fabs.f64 b) (FPCore (a b_m angle) :precision binary64 (* 2.0 (* (cos (* PI (* angle 0.005555555555555556))) (* (* (+ b_m a) (- b_m a)) (sin (* 0.005555555555555556 (* PI angle)))))))
b_m = fabs(b);
double code(double a, double b_m, double angle) {
return 2.0 * (cos((((double) M_PI) * (angle * 0.005555555555555556))) * (((b_m + a) * (b_m - a)) * sin((0.005555555555555556 * (((double) M_PI) * angle)))));
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle) {
return 2.0 * (Math.cos((Math.PI * (angle * 0.005555555555555556))) * (((b_m + a) * (b_m - a)) * Math.sin((0.005555555555555556 * (Math.PI * angle)))));
}
b_m = math.fabs(b) def code(a, b_m, angle): return 2.0 * (math.cos((math.pi * (angle * 0.005555555555555556))) * (((b_m + a) * (b_m - a)) * math.sin((0.005555555555555556 * (math.pi * angle)))))
b_m = abs(b) function code(a, b_m, angle) return Float64(2.0 * Float64(cos(Float64(pi * Float64(angle * 0.005555555555555556))) * Float64(Float64(Float64(b_m + a) * Float64(b_m - a)) * sin(Float64(0.005555555555555556 * Float64(pi * angle)))))) end
b_m = abs(b); function tmp = code(a, b_m, angle) tmp = 2.0 * (cos((pi * (angle * 0.005555555555555556))) * (((b_m + a) * (b_m - a)) * sin((0.005555555555555556 * (pi * angle))))); end
b_m = N[Abs[b], $MachinePrecision] code[a_, b$95$m_, angle_] := N[(2.0 * N[(N[Cos[N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(N[(b$95$m + a), $MachinePrecision] * N[(b$95$m - a), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(0.005555555555555556 * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
b_m = \left|b\right|
\\
2 \cdot \left(\cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot \left(\left(\left(b_m + a\right) \cdot \left(b_m - a\right)\right) \cdot \sin \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)\right)\right)
\end{array}
Initial program 56.6%
associate-*l*56.6%
associate-*l*56.6%
Simplified56.6%
unpow256.6%
unpow256.6%
difference-of-squares60.3%
Applied egg-rr60.3%
Taylor expanded in angle around 0 60.4%
Taylor expanded in angle around inf 60.2%
*-commutative60.2%
*-commutative60.2%
associate-*r*61.0%
Simplified61.0%
Final simplification61.0%
b_m = (fabs.f64 b) (FPCore (a b_m angle) :precision binary64 (* 2.0 (* (* (+ b_m a) (- b_m a)) (sin (* 0.005555555555555556 (* PI angle))))))
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 * (((double) M_PI) * 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.sin((0.005555555555555556 * (Math.PI * angle))));
}
b_m = math.fabs(b) def code(a, b_m, angle): return 2.0 * (((b_m + a) * (b_m - a)) * math.sin((0.005555555555555556 * (math.pi * 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)) * sin(Float64(0.005555555555555556 * Float64(pi * angle))))) end
b_m = abs(b); function tmp = code(a, b_m, angle) tmp = 2.0 * (((b_m + a) * (b_m - a)) * sin((0.005555555555555556 * (pi * 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[Sin[N[(0.005555555555555556 * N[(Pi * angle), $MachinePrecision]), $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(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)\right)
\end{array}
Initial program 56.6%
associate-*l*56.6%
associate-*l*56.6%
Simplified56.6%
unpow256.6%
unpow256.6%
difference-of-squares60.3%
Applied egg-rr60.3%
Taylor expanded in angle around 0 60.4%
Taylor expanded in angle around 0 60.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 56.6%
associate-*l*56.6%
associate-*l*56.6%
Simplified56.6%
unpow256.6%
unpow256.6%
difference-of-squares60.3%
Applied egg-rr60.3%
Taylor expanded in angle around 0 57.9%
Taylor expanded in angle around 0 57.1%
Final simplification57.1%
b_m = (fabs.f64 b) (FPCore (a b_m angle) :precision binary64 (* 2.0 (* 0.005555555555555556 (* (* (+ b_m a) (- b_m a)) (* PI angle)))))
b_m = fabs(b);
double code(double a, double b_m, double angle) {
return 2.0 * (0.005555555555555556 * (((b_m + a) * (b_m - a)) * (((double) M_PI) * angle)));
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle) {
return 2.0 * (0.005555555555555556 * (((b_m + a) * (b_m - a)) * (Math.PI * angle)));
}
b_m = math.fabs(b) def code(a, b_m, angle): return 2.0 * (0.005555555555555556 * (((b_m + a) * (b_m - a)) * (math.pi * angle)))
b_m = abs(b) function code(a, b_m, angle) return Float64(2.0 * Float64(0.005555555555555556 * Float64(Float64(Float64(b_m + a) * Float64(b_m - a)) * Float64(pi * angle)))) end
b_m = abs(b); function tmp = code(a, b_m, angle) tmp = 2.0 * (0.005555555555555556 * (((b_m + a) * (b_m - a)) * (pi * angle))); end
b_m = N[Abs[b], $MachinePrecision] code[a_, b$95$m_, angle_] := N[(2.0 * N[(0.005555555555555556 * N[(N[(N[(b$95$m + a), $MachinePrecision] * N[(b$95$m - a), $MachinePrecision]), $MachinePrecision] * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
b_m = \left|b\right|
\\
2 \cdot \left(0.005555555555555556 \cdot \left(\left(\left(b_m + a\right) \cdot \left(b_m - a\right)\right) \cdot \left(\pi \cdot angle\right)\right)\right)
\end{array}
Initial program 56.6%
associate-*l*56.6%
associate-*l*56.6%
Simplified56.6%
unpow256.6%
unpow256.6%
difference-of-squares60.3%
Applied egg-rr60.3%
Taylor expanded in angle around 0 57.9%
Taylor expanded in angle around 0 57.1%
associate-*r*57.1%
Simplified57.1%
Final simplification57.1%
b_m = (fabs.f64 b) (FPCore (a b_m angle) :precision binary64 (* 2.0 (* (* (+ b_m a) (- b_m a)) (* angle (* PI 0.005555555555555556)))))
b_m = fabs(b);
double code(double a, double b_m, double angle) {
return 2.0 * (((b_m + a) * (b_m - a)) * (angle * (((double) M_PI) * 0.005555555555555556)));
}
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)) * (angle * (Math.PI * 0.005555555555555556)));
}
b_m = math.fabs(b) def code(a, b_m, angle): return 2.0 * (((b_m + a) * (b_m - a)) * (angle * (math.pi * 0.005555555555555556)))
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(angle * Float64(pi * 0.005555555555555556)))) end
b_m = abs(b); function tmp = code(a, b_m, angle) tmp = 2.0 * (((b_m + a) * (b_m - a)) * (angle * (pi * 0.005555555555555556))); 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[(angle * N[(Pi * 0.005555555555555556), $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(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)
\end{array}
Initial program 56.6%
associate-*l*56.6%
associate-*l*56.6%
Simplified56.6%
unpow256.6%
unpow256.6%
difference-of-squares60.3%
Applied egg-rr60.3%
Taylor expanded in angle around 0 57.9%
Taylor expanded in angle around 0 57.1%
*-commutative57.1%
associate-*l*57.1%
Simplified57.1%
Final simplification57.1%
herbie shell --seed 2024024
(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)))))