
(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 15 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}
NOTE: a should be positive before calling this function
(FPCore (a b angle)
:precision binary64
(if (<= a 3.7e+247)
(*
(*
(- b a)
(sin (* 2.0 (/ 0.005555555555555556 (* (/ 1.0 PI) (/ 1.0 angle))))))
(+ a b))
(*
(- b a)
(* (+ a b) (* 2.0 (sin (* angle (/ (* (sqrt PI) (sqrt PI)) 180.0))))))))a = abs(a);
double code(double a, double b, double angle) {
double tmp;
if (a <= 3.7e+247) {
tmp = ((b - a) * sin((2.0 * (0.005555555555555556 / ((1.0 / ((double) M_PI)) * (1.0 / angle)))))) * (a + b);
} else {
tmp = (b - a) * ((a + b) * (2.0 * sin((angle * ((sqrt(((double) M_PI)) * sqrt(((double) M_PI))) / 180.0)))));
}
return tmp;
}
a = Math.abs(a);
public static double code(double a, double b, double angle) {
double tmp;
if (a <= 3.7e+247) {
tmp = ((b - a) * Math.sin((2.0 * (0.005555555555555556 / ((1.0 / Math.PI) * (1.0 / angle)))))) * (a + b);
} else {
tmp = (b - a) * ((a + b) * (2.0 * Math.sin((angle * ((Math.sqrt(Math.PI) * Math.sqrt(Math.PI)) / 180.0)))));
}
return tmp;
}
a = abs(a) def code(a, b, angle): tmp = 0 if a <= 3.7e+247: tmp = ((b - a) * math.sin((2.0 * (0.005555555555555556 / ((1.0 / math.pi) * (1.0 / angle)))))) * (a + b) else: tmp = (b - a) * ((a + b) * (2.0 * math.sin((angle * ((math.sqrt(math.pi) * math.sqrt(math.pi)) / 180.0))))) return tmp
a = abs(a) function code(a, b, angle) tmp = 0.0 if (a <= 3.7e+247) tmp = Float64(Float64(Float64(b - a) * sin(Float64(2.0 * Float64(0.005555555555555556 / Float64(Float64(1.0 / pi) * Float64(1.0 / angle)))))) * Float64(a + b)); else tmp = Float64(Float64(b - a) * Float64(Float64(a + b) * Float64(2.0 * sin(Float64(angle * Float64(Float64(sqrt(pi) * sqrt(pi)) / 180.0)))))); end return tmp end
a = abs(a) function tmp_2 = code(a, b, angle) tmp = 0.0; if (a <= 3.7e+247) tmp = ((b - a) * sin((2.0 * (0.005555555555555556 / ((1.0 / pi) * (1.0 / angle)))))) * (a + b); else tmp = (b - a) * ((a + b) * (2.0 * sin((angle * ((sqrt(pi) * sqrt(pi)) / 180.0))))); end tmp_2 = tmp; end
NOTE: a should be positive before calling this function code[a_, b_, angle_] := If[LessEqual[a, 3.7e+247], N[(N[(N[(b - a), $MachinePrecision] * N[Sin[N[(2.0 * N[(0.005555555555555556 / N[(N[(1.0 / Pi), $MachinePrecision] * N[(1.0 / angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(a + b), $MachinePrecision]), $MachinePrecision], N[(N[(b - a), $MachinePrecision] * N[(N[(a + b), $MachinePrecision] * N[(2.0 * N[Sin[N[(angle * N[(N[(N[Sqrt[Pi], $MachinePrecision] * N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision] / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
a = |a|\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq 3.7 \cdot 10^{+247}:\\
\;\;\;\;\left(\left(b - a\right) \cdot \sin \left(2 \cdot \frac{0.005555555555555556}{\frac{1}{\pi} \cdot \frac{1}{angle}}\right)\right) \cdot \left(a + b\right)\\
\mathbf{else}:\\
\;\;\;\;\left(b - a\right) \cdot \left(\left(a + b\right) \cdot \left(2 \cdot \sin \left(angle \cdot \frac{\sqrt{\pi} \cdot \sqrt{\pi}}{180}\right)\right)\right)\\
\end{array}
\end{array}
if a < 3.6999999999999998e247Initial program 53.7%
*-commutative53.7%
associate-*l*53.7%
associate-*l*53.7%
unpow253.7%
unpow253.7%
sqr-neg53.7%
difference-of-squares58.3%
sub-neg58.3%
sub-neg58.3%
remove-double-neg58.3%
Simplified58.3%
*-commutative58.3%
associate-*l*69.0%
flip-+53.7%
*-commutative53.7%
flip--28.4%
div-inv28.4%
associate-/r*28.4%
*-inverses69.0%
associate-*l/69.0%
Applied egg-rr68.5%
associate-/r/68.5%
/-rgt-identity68.5%
associate-*l*68.5%
*-commutative68.5%
*-commutative68.5%
Simplified68.5%
*-commutative68.5%
associate-*l*67.8%
metadata-eval67.8%
associate-/r/65.6%
div-inv66.4%
associate-/r*69.0%
metadata-eval69.0%
*-commutative69.0%
associate-/r*69.5%
Applied egg-rr69.5%
div-inv69.8%
Applied egg-rr69.8%
if 3.6999999999999998e247 < a Initial program 40.8%
*-commutative40.8%
associate-*l*40.8%
associate-*l*40.8%
unpow240.8%
unpow240.8%
sqr-neg40.8%
difference-of-squares54.1%
sub-neg54.1%
sub-neg54.1%
remove-double-neg54.1%
Simplified54.1%
Taylor expanded in angle around 0 47.4%
log1p-expm1-u_binary6447.4%
Applied rewrite-once47.4%
log1p-expm147.4%
*-rgt-identity47.4%
associate-*l*59.9%
+-commutative59.9%
associate-*r/66.6%
associate-*l/53.3%
*-commutative53.3%
Simplified53.3%
add-sqr-sqrt_binary6493.2%
Applied rewrite-once93.2%
Final simplification71.2%
NOTE: a should be positive before calling this function (FPCore (a b angle) :precision binary64 (* (* (- b a) (sin (* 2.0 (/ 0.005555555555555556 (* (/ 1.0 PI) (/ 1.0 angle)))))) (+ a b)))
a = abs(a);
double code(double a, double b, double angle) {
return ((b - a) * sin((2.0 * (0.005555555555555556 / ((1.0 / ((double) M_PI)) * (1.0 / angle)))))) * (a + b);
}
a = Math.abs(a);
public static double code(double a, double b, double angle) {
return ((b - a) * Math.sin((2.0 * (0.005555555555555556 / ((1.0 / Math.PI) * (1.0 / angle)))))) * (a + b);
}
a = abs(a) def code(a, b, angle): return ((b - a) * math.sin((2.0 * (0.005555555555555556 / ((1.0 / math.pi) * (1.0 / angle)))))) * (a + b)
a = abs(a) function code(a, b, angle) return Float64(Float64(Float64(b - a) * sin(Float64(2.0 * Float64(0.005555555555555556 / Float64(Float64(1.0 / pi) * Float64(1.0 / angle)))))) * Float64(a + b)) end
a = abs(a) function tmp = code(a, b, angle) tmp = ((b - a) * sin((2.0 * (0.005555555555555556 / ((1.0 / pi) * (1.0 / angle)))))) * (a + b); end
NOTE: a should be positive before calling this function code[a_, b_, angle_] := N[(N[(N[(b - a), $MachinePrecision] * N[Sin[N[(2.0 * N[(0.005555555555555556 / N[(N[(1.0 / Pi), $MachinePrecision] * N[(1.0 / angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(a + b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
a = |a|\\
\\
\left(\left(b - a\right) \cdot \sin \left(2 \cdot \frac{0.005555555555555556}{\frac{1}{\pi} \cdot \frac{1}{angle}}\right)\right) \cdot \left(a + b\right)
\end{array}
Initial program 53.0%
*-commutative53.0%
associate-*l*53.0%
associate-*l*53.0%
unpow253.0%
unpow253.0%
sqr-neg53.0%
difference-of-squares58.1%
sub-neg58.1%
sub-neg58.1%
remove-double-neg58.1%
Simplified58.1%
*-commutative58.1%
associate-*l*68.9%
flip-+52.9%
*-commutative52.9%
flip--26.7%
div-inv26.7%
associate-/r*26.7%
*-inverses68.9%
associate-*l/68.9%
Applied egg-rr68.4%
associate-/r/68.4%
/-rgt-identity68.4%
associate-*l*68.4%
*-commutative68.4%
*-commutative68.4%
Simplified68.4%
*-commutative68.4%
associate-*l*68.1%
metadata-eval68.1%
associate-/r/65.6%
div-inv66.8%
associate-/r*69.2%
metadata-eval69.2%
*-commutative69.2%
associate-/r*69.7%
Applied egg-rr69.7%
div-inv70.0%
Applied egg-rr70.0%
Final simplification70.0%
NOTE: a should be positive before calling this function (FPCore (a b angle) :precision binary64 (* (+ a b) (* (- b a) (sin (* 2.0 (/ 0.005555555555555556 (/ 1.0 (* PI angle))))))))
a = abs(a);
double code(double a, double b, double angle) {
return (a + b) * ((b - a) * sin((2.0 * (0.005555555555555556 / (1.0 / (((double) M_PI) * angle))))));
}
a = Math.abs(a);
public static double code(double a, double b, double angle) {
return (a + b) * ((b - a) * Math.sin((2.0 * (0.005555555555555556 / (1.0 / (Math.PI * angle))))));
}
a = abs(a) def code(a, b, angle): return (a + b) * ((b - a) * math.sin((2.0 * (0.005555555555555556 / (1.0 / (math.pi * angle))))))
a = abs(a) function code(a, b, angle) return Float64(Float64(a + b) * Float64(Float64(b - a) * sin(Float64(2.0 * Float64(0.005555555555555556 / Float64(1.0 / Float64(pi * angle))))))) end
a = abs(a) function tmp = code(a, b, angle) tmp = (a + b) * ((b - a) * sin((2.0 * (0.005555555555555556 / (1.0 / (pi * angle)))))); end
NOTE: a should be positive before calling this function code[a_, b_, angle_] := N[(N[(a + b), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[Sin[N[(2.0 * N[(0.005555555555555556 / N[(1.0 / N[(Pi * angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
a = |a|\\
\\
\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \left(2 \cdot \frac{0.005555555555555556}{\frac{1}{\pi \cdot angle}}\right)\right)
\end{array}
Initial program 53.0%
*-commutative53.0%
associate-*l*53.0%
associate-*l*53.0%
unpow253.0%
unpow253.0%
sqr-neg53.0%
difference-of-squares58.1%
sub-neg58.1%
sub-neg58.1%
remove-double-neg58.1%
Simplified58.1%
*-commutative58.1%
associate-*l*68.9%
flip-+52.9%
*-commutative52.9%
flip--26.7%
div-inv26.7%
associate-/r*26.7%
*-inverses68.9%
associate-*l/68.9%
Applied egg-rr68.4%
associate-/r/68.4%
/-rgt-identity68.4%
associate-*l*68.4%
*-commutative68.4%
*-commutative68.4%
Simplified68.4%
*-commutative68.4%
associate-*l*68.1%
metadata-eval68.1%
associate-/r/65.6%
div-inv66.8%
associate-/r*69.2%
metadata-eval69.2%
*-commutative69.2%
associate-/r*69.7%
Applied egg-rr69.7%
Taylor expanded in angle around 0 69.2%
Final simplification69.2%
NOTE: a should be positive before calling this function (FPCore (a b angle) :precision binary64 (* (+ a b) (* (- b a) (sin (* 2.0 (/ 0.005555555555555556 (/ (/ 1.0 PI) angle)))))))
a = abs(a);
double code(double a, double b, double angle) {
return (a + b) * ((b - a) * sin((2.0 * (0.005555555555555556 / ((1.0 / ((double) M_PI)) / angle)))));
}
a = Math.abs(a);
public static double code(double a, double b, double angle) {
return (a + b) * ((b - a) * Math.sin((2.0 * (0.005555555555555556 / ((1.0 / Math.PI) / angle)))));
}
a = abs(a) def code(a, b, angle): return (a + b) * ((b - a) * math.sin((2.0 * (0.005555555555555556 / ((1.0 / math.pi) / angle)))))
a = abs(a) function code(a, b, angle) return Float64(Float64(a + b) * Float64(Float64(b - a) * sin(Float64(2.0 * Float64(0.005555555555555556 / Float64(Float64(1.0 / pi) / angle)))))) end
a = abs(a) function tmp = code(a, b, angle) tmp = (a + b) * ((b - a) * sin((2.0 * (0.005555555555555556 / ((1.0 / pi) / angle))))); end
NOTE: a should be positive before calling this function code[a_, b_, angle_] := N[(N[(a + b), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[Sin[N[(2.0 * N[(0.005555555555555556 / N[(N[(1.0 / Pi), $MachinePrecision] / angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
a = |a|\\
\\
\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \left(2 \cdot \frac{0.005555555555555556}{\frac{\frac{1}{\pi}}{angle}}\right)\right)
\end{array}
Initial program 53.0%
*-commutative53.0%
associate-*l*53.0%
associate-*l*53.0%
unpow253.0%
unpow253.0%
sqr-neg53.0%
difference-of-squares58.1%
sub-neg58.1%
sub-neg58.1%
remove-double-neg58.1%
Simplified58.1%
*-commutative58.1%
associate-*l*68.9%
flip-+52.9%
*-commutative52.9%
flip--26.7%
div-inv26.7%
associate-/r*26.7%
*-inverses68.9%
associate-*l/68.9%
Applied egg-rr68.4%
associate-/r/68.4%
/-rgt-identity68.4%
associate-*l*68.4%
*-commutative68.4%
*-commutative68.4%
Simplified68.4%
*-commutative68.4%
associate-*l*68.1%
metadata-eval68.1%
associate-/r/65.6%
div-inv66.8%
associate-/r*69.2%
metadata-eval69.2%
*-commutative69.2%
associate-/r*69.7%
Applied egg-rr69.7%
Final simplification69.7%
NOTE: a should be positive before calling this function (FPCore (a b angle) :precision binary64 (* (+ a b) (* (- b a) (sin (* PI (* angle 0.011111111111111112))))))
a = abs(a);
double code(double a, double b, double angle) {
return (a + b) * ((b - a) * sin((((double) M_PI) * (angle * 0.011111111111111112))));
}
a = Math.abs(a);
public static double code(double a, double b, double angle) {
return (a + b) * ((b - a) * Math.sin((Math.PI * (angle * 0.011111111111111112))));
}
a = abs(a) def code(a, b, angle): return (a + b) * ((b - a) * math.sin((math.pi * (angle * 0.011111111111111112))))
a = abs(a) function code(a, b, angle) return Float64(Float64(a + b) * Float64(Float64(b - a) * sin(Float64(pi * Float64(angle * 0.011111111111111112))))) end
a = abs(a) function tmp = code(a, b, angle) tmp = (a + b) * ((b - a) * sin((pi * (angle * 0.011111111111111112)))); end
NOTE: a should be positive before calling this function code[a_, b_, angle_] := N[(N[(a + b), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[Sin[N[(Pi * N[(angle * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
a = |a|\\
\\
\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.011111111111111112\right)\right)\right)
\end{array}
Initial program 53.0%
*-commutative53.0%
associate-*l*53.0%
associate-*l*53.0%
unpow253.0%
unpow253.0%
sqr-neg53.0%
difference-of-squares58.1%
sub-neg58.1%
sub-neg58.1%
remove-double-neg58.1%
Simplified58.1%
*-commutative58.1%
associate-*l*68.9%
flip-+52.9%
*-commutative52.9%
flip--26.7%
div-inv26.7%
associate-/r*26.7%
*-inverses68.9%
associate-*l/68.9%
Applied egg-rr68.4%
associate-/r/68.4%
/-rgt-identity68.4%
associate-*l*68.4%
*-commutative68.4%
*-commutative68.4%
Simplified68.4%
add-log-exp_binary6427.9%
Applied rewrite-once27.9%
rem-log-exp68.4%
*-commutative68.4%
associate-*l*68.1%
metadata-eval68.1%
associate-/r/69.2%
associate-/l/69.7%
associate-*r/69.7%
metadata-eval69.7%
associate-/l/69.2%
associate-/r/68.1%
metadata-eval68.1%
associate-*r*68.4%
*-commutative68.4%
*-commutative68.4%
Applied egg-rr68.4%
Final simplification68.4%
NOTE: a should be positive before calling this function (FPCore (a b angle) :precision binary64 (if (<= b 1.06e-176) (* a (* (sin (* (* PI angle) 0.011111111111111112)) (- a))) (* (+ a b) (* (- b a) (* PI (* angle 0.011111111111111112))))))
a = abs(a);
double code(double a, double b, double angle) {
double tmp;
if (b <= 1.06e-176) {
tmp = a * (sin(((((double) M_PI) * angle) * 0.011111111111111112)) * -a);
} else {
tmp = (a + b) * ((b - a) * (((double) M_PI) * (angle * 0.011111111111111112)));
}
return tmp;
}
a = Math.abs(a);
public static double code(double a, double b, double angle) {
double tmp;
if (b <= 1.06e-176) {
tmp = a * (Math.sin(((Math.PI * angle) * 0.011111111111111112)) * -a);
} else {
tmp = (a + b) * ((b - a) * (Math.PI * (angle * 0.011111111111111112)));
}
return tmp;
}
a = abs(a) def code(a, b, angle): tmp = 0 if b <= 1.06e-176: tmp = a * (math.sin(((math.pi * angle) * 0.011111111111111112)) * -a) else: tmp = (a + b) * ((b - a) * (math.pi * (angle * 0.011111111111111112))) return tmp
a = abs(a) function code(a, b, angle) tmp = 0.0 if (b <= 1.06e-176) tmp = Float64(a * Float64(sin(Float64(Float64(pi * angle) * 0.011111111111111112)) * Float64(-a))); else tmp = Float64(Float64(a + b) * Float64(Float64(b - a) * Float64(pi * Float64(angle * 0.011111111111111112)))); end return tmp end
a = abs(a) function tmp_2 = code(a, b, angle) tmp = 0.0; if (b <= 1.06e-176) tmp = a * (sin(((pi * angle) * 0.011111111111111112)) * -a); else tmp = (a + b) * ((b - a) * (pi * (angle * 0.011111111111111112))); end tmp_2 = tmp; end
NOTE: a should be positive before calling this function code[a_, b_, angle_] := If[LessEqual[b, 1.06e-176], N[(a * N[(N[Sin[N[(N[(Pi * angle), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]], $MachinePrecision] * (-a)), $MachinePrecision]), $MachinePrecision], N[(N[(a + b), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[(Pi * N[(angle * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
a = |a|\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq 1.06 \cdot 10^{-176}:\\
\;\;\;\;a \cdot \left(\sin \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right) \cdot \left(-a\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \left(\pi \cdot \left(angle \cdot 0.011111111111111112\right)\right)\right)\\
\end{array}
\end{array}
if b < 1.06000000000000006e-176Initial program 54.2%
*-commutative54.2%
associate-*l*54.2%
associate-*l*54.3%
unpow254.3%
unpow254.3%
sqr-neg54.3%
difference-of-squares59.4%
sub-neg59.4%
sub-neg59.4%
remove-double-neg59.4%
Simplified59.4%
*-commutative59.4%
associate-*l*69.9%
flip-+54.2%
*-commutative54.2%
flip--29.9%
div-inv29.9%
associate-/r*29.9%
*-inverses69.9%
associate-*l/69.9%
Applied egg-rr71.1%
associate-/r/71.1%
/-rgt-identity71.1%
associate-*l*71.1%
*-commutative71.1%
*-commutative71.1%
Simplified71.1%
Taylor expanded in b around 0 39.5%
associate-*r*39.5%
mul-1-neg39.5%
unpow239.5%
distribute-rgt-neg-out39.5%
*-commutative39.5%
*-commutative39.5%
associate-*r*39.7%
associate-*l*46.7%
*-commutative46.7%
associate-*r*46.6%
*-commutative46.6%
*-commutative46.6%
Simplified46.6%
if 1.06000000000000006e-176 < b Initial program 51.0%
*-commutative51.0%
associate-*l*51.0%
associate-*l*51.0%
unpow251.0%
unpow251.0%
sqr-neg51.0%
difference-of-squares56.0%
sub-neg56.0%
sub-neg56.0%
remove-double-neg56.0%
Simplified56.0%
*-commutative56.0%
associate-*l*67.2%
flip-+51.0%
*-commutative51.0%
flip--21.7%
div-inv21.6%
associate-/r*21.6%
*-inverses67.2%
associate-*l/67.2%
Applied egg-rr64.1%
associate-/r/64.1%
/-rgt-identity64.1%
associate-*l*64.1%
*-commutative64.1%
*-commutative64.1%
Simplified64.1%
*-commutative64.1%
associate-*l*64.3%
metadata-eval64.3%
associate-/r/61.2%
div-inv64.1%
associate-/r*65.3%
metadata-eval65.3%
*-commutative65.3%
associate-/r*66.4%
Applied egg-rr66.4%
div-inv66.7%
Applied egg-rr66.7%
Taylor expanded in angle around 0 62.4%
Simplified62.3%
Final simplification52.7%
NOTE: a should be positive before calling this function (FPCore (a b angle) :precision binary64 (if (<= a 2.25e-142) (* b (* b (sin (* (* PI angle) 0.011111111111111112)))) (* (- b a) (* 0.011111111111111112 (* angle (* PI (+ a b)))))))
a = abs(a);
double code(double a, double b, double angle) {
double tmp;
if (a <= 2.25e-142) {
tmp = b * (b * sin(((((double) M_PI) * angle) * 0.011111111111111112)));
} else {
tmp = (b - a) * (0.011111111111111112 * (angle * (((double) M_PI) * (a + b))));
}
return tmp;
}
a = Math.abs(a);
public static double code(double a, double b, double angle) {
double tmp;
if (a <= 2.25e-142) {
tmp = b * (b * Math.sin(((Math.PI * angle) * 0.011111111111111112)));
} else {
tmp = (b - a) * (0.011111111111111112 * (angle * (Math.PI * (a + b))));
}
return tmp;
}
a = abs(a) def code(a, b, angle): tmp = 0 if a <= 2.25e-142: tmp = b * (b * math.sin(((math.pi * angle) * 0.011111111111111112))) else: tmp = (b - a) * (0.011111111111111112 * (angle * (math.pi * (a + b)))) return tmp
a = abs(a) function code(a, b, angle) tmp = 0.0 if (a <= 2.25e-142) tmp = Float64(b * Float64(b * sin(Float64(Float64(pi * angle) * 0.011111111111111112)))); else tmp = Float64(Float64(b - a) * Float64(0.011111111111111112 * Float64(angle * Float64(pi * Float64(a + b))))); end return tmp end
a = abs(a) function tmp_2 = code(a, b, angle) tmp = 0.0; if (a <= 2.25e-142) tmp = b * (b * sin(((pi * angle) * 0.011111111111111112))); else tmp = (b - a) * (0.011111111111111112 * (angle * (pi * (a + b)))); end tmp_2 = tmp; end
NOTE: a should be positive before calling this function code[a_, b_, angle_] := If[LessEqual[a, 2.25e-142], N[(b * N[(b * N[Sin[N[(N[(Pi * angle), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b - a), $MachinePrecision] * N[(0.011111111111111112 * N[(angle * N[(Pi * N[(a + b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
a = |a|\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq 2.25 \cdot 10^{-142}:\\
\;\;\;\;b \cdot \left(b \cdot \sin \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(b - a\right) \cdot \left(0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(a + b\right)\right)\right)\right)\\
\end{array}
\end{array}
if a < 2.25000000000000009e-142Initial program 60.0%
*-commutative60.0%
associate-*l*60.0%
associate-*l*60.0%
unpow260.0%
unpow260.0%
sqr-neg60.0%
difference-of-squares65.2%
sub-neg65.2%
sub-neg65.2%
remove-double-neg65.2%
Simplified65.2%
*-commutative65.2%
associate-*l*71.2%
flip-+59.9%
*-commutative59.9%
flip--27.9%
div-inv27.9%
associate-/r*27.9%
*-inverses71.2%
associate-*l/71.2%
Applied egg-rr69.3%
associate-/r/69.3%
/-rgt-identity69.3%
associate-*l*69.3%
*-commutative69.3%
*-commutative69.3%
Simplified69.3%
Taylor expanded in b around inf 43.2%
unpow243.2%
*-commutative43.2%
*-commutative43.2%
associate-*r*43.0%
associate-*l*46.0%
associate-*r*46.2%
*-commutative46.2%
*-commutative46.2%
Simplified46.2%
if 2.25000000000000009e-142 < a Initial program 42.2%
*-commutative42.2%
associate-*l*42.2%
associate-*l*42.2%
unpow242.2%
unpow242.2%
sqr-neg42.2%
difference-of-squares47.1%
sub-neg47.1%
sub-neg47.1%
remove-double-neg47.1%
Simplified47.1%
Taylor expanded in angle around 0 43.1%
log1p-expm1-u_binary6436.2%
Applied rewrite-once36.2%
log1p-expm143.1%
*-rgt-identity43.1%
associate-*l*61.3%
+-commutative61.3%
associate-*r/63.7%
associate-*l/61.4%
*-commutative61.4%
Simplified61.4%
Taylor expanded in angle around 0 62.8%
Final simplification52.8%
NOTE: a should be positive before calling this function (FPCore (a b angle) :precision binary64 (if (<= a 6.9e+176) (* 0.011111111111111112 (* angle (* PI (* (- b a) (+ a b))))) (* 0.011111111111111112 (* a (* a (* PI (- angle)))))))
a = abs(a);
double code(double a, double b, double angle) {
double tmp;
if (a <= 6.9e+176) {
tmp = 0.011111111111111112 * (angle * (((double) M_PI) * ((b - a) * (a + b))));
} else {
tmp = 0.011111111111111112 * (a * (a * (((double) M_PI) * -angle)));
}
return tmp;
}
a = Math.abs(a);
public static double code(double a, double b, double angle) {
double tmp;
if (a <= 6.9e+176) {
tmp = 0.011111111111111112 * (angle * (Math.PI * ((b - a) * (a + b))));
} else {
tmp = 0.011111111111111112 * (a * (a * (Math.PI * -angle)));
}
return tmp;
}
a = abs(a) def code(a, b, angle): tmp = 0 if a <= 6.9e+176: tmp = 0.011111111111111112 * (angle * (math.pi * ((b - a) * (a + b)))) else: tmp = 0.011111111111111112 * (a * (a * (math.pi * -angle))) return tmp
a = abs(a) function code(a, b, angle) tmp = 0.0 if (a <= 6.9e+176) tmp = Float64(0.011111111111111112 * Float64(angle * Float64(pi * Float64(Float64(b - a) * Float64(a + b))))); else tmp = Float64(0.011111111111111112 * Float64(a * Float64(a * Float64(pi * Float64(-angle))))); end return tmp end
a = abs(a) function tmp_2 = code(a, b, angle) tmp = 0.0; if (a <= 6.9e+176) tmp = 0.011111111111111112 * (angle * (pi * ((b - a) * (a + b)))); else tmp = 0.011111111111111112 * (a * (a * (pi * -angle))); end tmp_2 = tmp; end
NOTE: a should be positive before calling this function code[a_, b_, angle_] := If[LessEqual[a, 6.9e+176], N[(0.011111111111111112 * N[(angle * N[(Pi * N[(N[(b - a), $MachinePrecision] * N[(a + b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(a * N[(a * N[(Pi * (-angle)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
a = |a|\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq 6.9 \cdot 10^{+176}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(\left(b - a\right) \cdot \left(a + b\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(a \cdot \left(a \cdot \left(\pi \cdot \left(-angle\right)\right)\right)\right)\\
\end{array}
\end{array}
if a < 6.9000000000000002e176Initial program 55.7%
*-commutative55.7%
associate-*l*55.7%
associate-*l*55.7%
unpow255.7%
unpow255.7%
sqr-neg55.7%
difference-of-squares60.3%
sub-neg60.3%
sub-neg60.3%
remove-double-neg60.3%
Simplified60.3%
Taylor expanded in angle around 0 53.5%
if 6.9000000000000002e176 < a Initial program 33.6%
*-commutative33.6%
associate-*l*33.6%
associate-*l*33.6%
unpow233.6%
unpow233.6%
sqr-neg33.6%
difference-of-squares43.0%
sub-neg43.0%
sub-neg43.0%
remove-double-neg43.0%
Simplified43.0%
Taylor expanded in angle around 0 49.3%
Taylor expanded in a around inf 33.6%
*-commutative33.6%
associate-*r*33.6%
mul-1-neg33.6%
unpow233.6%
distribute-rgt-neg-out33.6%
associate-*l*65.2%
*-commutative65.2%
Simplified65.2%
Final simplification55.0%
NOTE: a should be positive before calling this function (FPCore (a b angle) :precision binary64 (if (<= a 5.1e+29) (* PI (/ (* (* b b) -0.011111111111111112) (/ -1.0 angle))) (* 0.011111111111111112 (* a (* a (* PI (- angle)))))))
a = abs(a);
double code(double a, double b, double angle) {
double tmp;
if (a <= 5.1e+29) {
tmp = ((double) M_PI) * (((b * b) * -0.011111111111111112) / (-1.0 / angle));
} else {
tmp = 0.011111111111111112 * (a * (a * (((double) M_PI) * -angle)));
}
return tmp;
}
a = Math.abs(a);
public static double code(double a, double b, double angle) {
double tmp;
if (a <= 5.1e+29) {
tmp = Math.PI * (((b * b) * -0.011111111111111112) / (-1.0 / angle));
} else {
tmp = 0.011111111111111112 * (a * (a * (Math.PI * -angle)));
}
return tmp;
}
a = abs(a) def code(a, b, angle): tmp = 0 if a <= 5.1e+29: tmp = math.pi * (((b * b) * -0.011111111111111112) / (-1.0 / angle)) else: tmp = 0.011111111111111112 * (a * (a * (math.pi * -angle))) return tmp
a = abs(a) function code(a, b, angle) tmp = 0.0 if (a <= 5.1e+29) tmp = Float64(pi * Float64(Float64(Float64(b * b) * -0.011111111111111112) / Float64(-1.0 / angle))); else tmp = Float64(0.011111111111111112 * Float64(a * Float64(a * Float64(pi * Float64(-angle))))); end return tmp end
a = abs(a) function tmp_2 = code(a, b, angle) tmp = 0.0; if (a <= 5.1e+29) tmp = pi * (((b * b) * -0.011111111111111112) / (-1.0 / angle)); else tmp = 0.011111111111111112 * (a * (a * (pi * -angle))); end tmp_2 = tmp; end
NOTE: a should be positive before calling this function code[a_, b_, angle_] := If[LessEqual[a, 5.1e+29], N[(Pi * N[(N[(N[(b * b), $MachinePrecision] * -0.011111111111111112), $MachinePrecision] / N[(-1.0 / angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(a * N[(a * N[(Pi * (-angle)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
a = |a|\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq 5.1 \cdot 10^{+29}:\\
\;\;\;\;\pi \cdot \frac{\left(b \cdot b\right) \cdot -0.011111111111111112}{\frac{-1}{angle}}\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(a \cdot \left(a \cdot \left(\pi \cdot \left(-angle\right)\right)\right)\right)\\
\end{array}
\end{array}
if a < 5.1000000000000001e29Initial program 60.3%
*-commutative60.3%
associate-*l*60.3%
associate-*l*60.3%
unpow260.3%
unpow260.3%
sqr-neg60.3%
difference-of-squares64.6%
sub-neg64.6%
sub-neg64.6%
remove-double-neg64.6%
Simplified64.6%
Taylor expanded in angle around 0 58.0%
Taylor expanded in a around 0 41.1%
*-commutative41.1%
unpow241.1%
Simplified41.1%
associate-*r*41.1%
associate-*r*41.1%
metadata-eval41.1%
associate-/r/41.1%
metadata-eval41.1%
associate-/l/41.1%
associate-*r/41.1%
frac-2neg41.1%
associate-*r/41.1%
associate-*l/41.1%
metadata-eval41.1%
metadata-eval41.1%
associate-/l/41.1%
distribute-neg-frac41.1%
metadata-eval41.1%
associate-/r*41.1%
Applied egg-rr41.1%
associate-/r/41.1%
*-commutative41.1%
Simplified41.1%
if 5.1000000000000001e29 < a Initial program 33.6%
*-commutative33.6%
associate-*l*33.6%
associate-*l*33.6%
unpow233.6%
unpow233.6%
sqr-neg33.6%
difference-of-squares40.8%
sub-neg40.8%
sub-neg40.8%
remove-double-neg40.8%
Simplified40.8%
Taylor expanded in angle around 0 39.8%
Taylor expanded in a around inf 30.9%
*-commutative30.9%
associate-*r*30.9%
mul-1-neg30.9%
unpow230.9%
distribute-rgt-neg-out30.9%
associate-*l*48.1%
*-commutative48.1%
Simplified48.1%
Final simplification43.0%
NOTE: a should be positive before calling this function (FPCore (a b angle) :precision binary64 (if (<= a 1.15e+34) (/ (* 2.0 (* b b)) (/ (/ 180.0 angle) PI)) (* 0.011111111111111112 (* a (* a (* PI (- angle)))))))
a = abs(a);
double code(double a, double b, double angle) {
double tmp;
if (a <= 1.15e+34) {
tmp = (2.0 * (b * b)) / ((180.0 / angle) / ((double) M_PI));
} else {
tmp = 0.011111111111111112 * (a * (a * (((double) M_PI) * -angle)));
}
return tmp;
}
a = Math.abs(a);
public static double code(double a, double b, double angle) {
double tmp;
if (a <= 1.15e+34) {
tmp = (2.0 * (b * b)) / ((180.0 / angle) / Math.PI);
} else {
tmp = 0.011111111111111112 * (a * (a * (Math.PI * -angle)));
}
return tmp;
}
a = abs(a) def code(a, b, angle): tmp = 0 if a <= 1.15e+34: tmp = (2.0 * (b * b)) / ((180.0 / angle) / math.pi) else: tmp = 0.011111111111111112 * (a * (a * (math.pi * -angle))) return tmp
a = abs(a) function code(a, b, angle) tmp = 0.0 if (a <= 1.15e+34) tmp = Float64(Float64(2.0 * Float64(b * b)) / Float64(Float64(180.0 / angle) / pi)); else tmp = Float64(0.011111111111111112 * Float64(a * Float64(a * Float64(pi * Float64(-angle))))); end return tmp end
a = abs(a) function tmp_2 = code(a, b, angle) tmp = 0.0; if (a <= 1.15e+34) tmp = (2.0 * (b * b)) / ((180.0 / angle) / pi); else tmp = 0.011111111111111112 * (a * (a * (pi * -angle))); end tmp_2 = tmp; end
NOTE: a should be positive before calling this function code[a_, b_, angle_] := If[LessEqual[a, 1.15e+34], N[(N[(2.0 * N[(b * b), $MachinePrecision]), $MachinePrecision] / N[(N[(180.0 / angle), $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(a * N[(a * N[(Pi * (-angle)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
a = |a|\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq 1.15 \cdot 10^{+34}:\\
\;\;\;\;\frac{2 \cdot \left(b \cdot b\right)}{\frac{\frac{180}{angle}}{\pi}}\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(a \cdot \left(a \cdot \left(\pi \cdot \left(-angle\right)\right)\right)\right)\\
\end{array}
\end{array}
if a < 1.1499999999999999e34Initial program 60.3%
*-commutative60.3%
associate-*l*60.3%
associate-*l*60.3%
unpow260.3%
unpow260.3%
sqr-neg60.3%
difference-of-squares64.6%
sub-neg64.6%
sub-neg64.6%
remove-double-neg64.6%
Simplified64.6%
Taylor expanded in angle around 0 58.0%
Taylor expanded in a around 0 41.1%
*-commutative41.1%
unpow241.1%
Simplified41.1%
associate-*r*41.1%
associate-*r*41.1%
metadata-eval41.1%
associate-*r*41.1%
metadata-eval41.1%
associate-/r/41.1%
associate-/l/41.1%
clear-num41.1%
un-div-inv41.1%
associate-*l/41.1%
associate-/l/41.1%
associate-/l/41.1%
associate-/r*41.1%
metadata-eval41.1%
associate-/r*41.2%
Applied egg-rr41.2%
if 1.1499999999999999e34 < a Initial program 33.6%
*-commutative33.6%
associate-*l*33.6%
associate-*l*33.6%
unpow233.6%
unpow233.6%
sqr-neg33.6%
difference-of-squares40.8%
sub-neg40.8%
sub-neg40.8%
remove-double-neg40.8%
Simplified40.8%
Taylor expanded in angle around 0 39.8%
Taylor expanded in a around inf 30.9%
*-commutative30.9%
associate-*r*30.9%
mul-1-neg30.9%
unpow230.9%
distribute-rgt-neg-out30.9%
associate-*l*48.1%
*-commutative48.1%
Simplified48.1%
Final simplification43.0%
NOTE: a should be positive before calling this function (FPCore (a b angle) :precision binary64 (* (+ a b) (* (- b a) (* (* PI angle) 0.011111111111111112))))
a = abs(a);
double code(double a, double b, double angle) {
return (a + b) * ((b - a) * ((((double) M_PI) * angle) * 0.011111111111111112));
}
a = Math.abs(a);
public static double code(double a, double b, double angle) {
return (a + b) * ((b - a) * ((Math.PI * angle) * 0.011111111111111112));
}
a = abs(a) def code(a, b, angle): return (a + b) * ((b - a) * ((math.pi * angle) * 0.011111111111111112))
a = abs(a) function code(a, b, angle) return Float64(Float64(a + b) * Float64(Float64(b - a) * Float64(Float64(pi * angle) * 0.011111111111111112))) end
a = abs(a) function tmp = code(a, b, angle) tmp = (a + b) * ((b - a) * ((pi * angle) * 0.011111111111111112)); end
NOTE: a should be positive before calling this function code[a_, b_, angle_] := N[(N[(a + b), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[(N[(Pi * angle), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
a = |a|\\
\\
\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right)\right)
\end{array}
Initial program 53.0%
*-commutative53.0%
associate-*l*53.0%
associate-*l*53.0%
unpow253.0%
unpow253.0%
sqr-neg53.0%
difference-of-squares58.1%
sub-neg58.1%
sub-neg58.1%
remove-double-neg58.1%
Simplified58.1%
*-commutative58.1%
associate-*l*68.9%
flip-+52.9%
*-commutative52.9%
flip--26.7%
div-inv26.7%
associate-/r*26.7%
*-inverses68.9%
associate-*l/68.9%
Applied egg-rr68.4%
associate-/r/68.4%
/-rgt-identity68.4%
associate-*l*68.4%
*-commutative68.4%
*-commutative68.4%
Simplified68.4%
Taylor expanded in angle around 0 61.9%
Final simplification61.9%
NOTE: a should be positive before calling this function (FPCore (a b angle) :precision binary64 (* (- b a) (* 0.011111111111111112 (* angle (* PI (+ a b))))))
a = abs(a);
double code(double a, double b, double angle) {
return (b - a) * (0.011111111111111112 * (angle * (((double) M_PI) * (a + b))));
}
a = Math.abs(a);
public static double code(double a, double b, double angle) {
return (b - a) * (0.011111111111111112 * (angle * (Math.PI * (a + b))));
}
a = abs(a) def code(a, b, angle): return (b - a) * (0.011111111111111112 * (angle * (math.pi * (a + b))))
a = abs(a) function code(a, b, angle) return Float64(Float64(b - a) * Float64(0.011111111111111112 * Float64(angle * Float64(pi * Float64(a + b))))) end
a = abs(a) function tmp = code(a, b, angle) tmp = (b - a) * (0.011111111111111112 * (angle * (pi * (a + b)))); end
NOTE: a should be positive before calling this function code[a_, b_, angle_] := N[(N[(b - a), $MachinePrecision] * N[(0.011111111111111112 * N[(angle * N[(Pi * N[(a + b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
a = |a|\\
\\
\left(b - a\right) \cdot \left(0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(a + b\right)\right)\right)\right)
\end{array}
Initial program 53.0%
*-commutative53.0%
associate-*l*53.0%
associate-*l*53.0%
unpow253.0%
unpow253.0%
sqr-neg53.0%
difference-of-squares58.1%
sub-neg58.1%
sub-neg58.1%
remove-double-neg58.1%
Simplified58.1%
Taylor expanded in angle around 0 53.1%
log1p-expm1-u_binary6445.8%
Applied rewrite-once45.8%
log1p-expm153.1%
*-rgt-identity53.1%
associate-*l*63.9%
+-commutative63.9%
associate-*r/65.8%
associate-*l/64.0%
*-commutative64.0%
Simplified64.0%
Taylor expanded in angle around 0 61.9%
Final simplification61.9%
NOTE: a should be positive before calling this function (FPCore (a b angle) :precision binary64 (if (<= a 7.8e+31) (* 0.011111111111111112 (* angle (* PI (* b b)))) (* 0.011111111111111112 (* a (* a (* PI (- angle)))))))
a = abs(a);
double code(double a, double b, double angle) {
double tmp;
if (a <= 7.8e+31) {
tmp = 0.011111111111111112 * (angle * (((double) M_PI) * (b * b)));
} else {
tmp = 0.011111111111111112 * (a * (a * (((double) M_PI) * -angle)));
}
return tmp;
}
a = Math.abs(a);
public static double code(double a, double b, double angle) {
double tmp;
if (a <= 7.8e+31) {
tmp = 0.011111111111111112 * (angle * (Math.PI * (b * b)));
} else {
tmp = 0.011111111111111112 * (a * (a * (Math.PI * -angle)));
}
return tmp;
}
a = abs(a) def code(a, b, angle): tmp = 0 if a <= 7.8e+31: tmp = 0.011111111111111112 * (angle * (math.pi * (b * b))) else: tmp = 0.011111111111111112 * (a * (a * (math.pi * -angle))) return tmp
a = abs(a) function code(a, b, angle) tmp = 0.0 if (a <= 7.8e+31) tmp = Float64(0.011111111111111112 * Float64(angle * Float64(pi * Float64(b * b)))); else tmp = Float64(0.011111111111111112 * Float64(a * Float64(a * Float64(pi * Float64(-angle))))); end return tmp end
a = abs(a) function tmp_2 = code(a, b, angle) tmp = 0.0; if (a <= 7.8e+31) tmp = 0.011111111111111112 * (angle * (pi * (b * b))); else tmp = 0.011111111111111112 * (a * (a * (pi * -angle))); end tmp_2 = tmp; end
NOTE: a should be positive before calling this function code[a_, b_, angle_] := If[LessEqual[a, 7.8e+31], N[(0.011111111111111112 * N[(angle * N[(Pi * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(a * N[(a * N[(Pi * (-angle)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
a = |a|\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq 7.8 \cdot 10^{+31}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(b \cdot b\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(a \cdot \left(a \cdot \left(\pi \cdot \left(-angle\right)\right)\right)\right)\\
\end{array}
\end{array}
if a < 7.79999999999999999e31Initial program 60.3%
*-commutative60.3%
associate-*l*60.3%
associate-*l*60.3%
unpow260.3%
unpow260.3%
sqr-neg60.3%
difference-of-squares64.6%
sub-neg64.6%
sub-neg64.6%
remove-double-neg64.6%
Simplified64.6%
Taylor expanded in angle around 0 58.0%
Taylor expanded in a around 0 41.1%
*-commutative41.1%
unpow241.1%
Simplified41.1%
if 7.79999999999999999e31 < a Initial program 33.6%
*-commutative33.6%
associate-*l*33.6%
associate-*l*33.6%
unpow233.6%
unpow233.6%
sqr-neg33.6%
difference-of-squares40.8%
sub-neg40.8%
sub-neg40.8%
remove-double-neg40.8%
Simplified40.8%
Taylor expanded in angle around 0 39.8%
Taylor expanded in a around inf 30.9%
*-commutative30.9%
associate-*r*30.9%
mul-1-neg30.9%
unpow230.9%
distribute-rgt-neg-out30.9%
associate-*l*48.1%
*-commutative48.1%
Simplified48.1%
Final simplification43.0%
NOTE: a should be positive before calling this function (FPCore (a b angle) :precision binary64 (if (<= a 4.5e+30) (* 0.011111111111111112 (* angle (* PI (* b b)))) (* (* PI angle) (* -0.011111111111111112 (* a a)))))
a = abs(a);
double code(double a, double b, double angle) {
double tmp;
if (a <= 4.5e+30) {
tmp = 0.011111111111111112 * (angle * (((double) M_PI) * (b * b)));
} else {
tmp = (((double) M_PI) * angle) * (-0.011111111111111112 * (a * a));
}
return tmp;
}
a = Math.abs(a);
public static double code(double a, double b, double angle) {
double tmp;
if (a <= 4.5e+30) {
tmp = 0.011111111111111112 * (angle * (Math.PI * (b * b)));
} else {
tmp = (Math.PI * angle) * (-0.011111111111111112 * (a * a));
}
return tmp;
}
a = abs(a) def code(a, b, angle): tmp = 0 if a <= 4.5e+30: tmp = 0.011111111111111112 * (angle * (math.pi * (b * b))) else: tmp = (math.pi * angle) * (-0.011111111111111112 * (a * a)) return tmp
a = abs(a) function code(a, b, angle) tmp = 0.0 if (a <= 4.5e+30) tmp = Float64(0.011111111111111112 * Float64(angle * Float64(pi * Float64(b * b)))); else tmp = Float64(Float64(pi * angle) * Float64(-0.011111111111111112 * Float64(a * a))); end return tmp end
a = abs(a) function tmp_2 = code(a, b, angle) tmp = 0.0; if (a <= 4.5e+30) tmp = 0.011111111111111112 * (angle * (pi * (b * b))); else tmp = (pi * angle) * (-0.011111111111111112 * (a * a)); end tmp_2 = tmp; end
NOTE: a should be positive before calling this function code[a_, b_, angle_] := If[LessEqual[a, 4.5e+30], N[(0.011111111111111112 * N[(angle * N[(Pi * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(Pi * angle), $MachinePrecision] * N[(-0.011111111111111112 * N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
a = |a|\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq 4.5 \cdot 10^{+30}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(b \cdot b\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\pi \cdot angle\right) \cdot \left(-0.011111111111111112 \cdot \left(a \cdot a\right)\right)\\
\end{array}
\end{array}
if a < 4.49999999999999995e30Initial program 60.3%
*-commutative60.3%
associate-*l*60.3%
associate-*l*60.3%
unpow260.3%
unpow260.3%
sqr-neg60.3%
difference-of-squares64.6%
sub-neg64.6%
sub-neg64.6%
remove-double-neg64.6%
Simplified64.6%
Taylor expanded in angle around 0 58.0%
Taylor expanded in a around 0 41.1%
*-commutative41.1%
unpow241.1%
Simplified41.1%
if 4.49999999999999995e30 < a Initial program 33.6%
*-commutative33.6%
associate-*l*33.6%
associate-*l*33.6%
unpow233.6%
unpow233.6%
sqr-neg33.6%
difference-of-squares40.8%
sub-neg40.8%
sub-neg40.8%
remove-double-neg40.8%
Simplified40.8%
Taylor expanded in angle around 0 39.8%
Taylor expanded in a around inf 30.9%
*-commutative30.9%
associate-*r*31.0%
unpow231.0%
*-commutative31.0%
Simplified31.0%
Final simplification38.4%
NOTE: a should be positive before calling this function (FPCore (a b angle) :precision binary64 (* 0.011111111111111112 (* angle (* PI (* b b)))))
a = abs(a);
double code(double a, double b, double angle) {
return 0.011111111111111112 * (angle * (((double) M_PI) * (b * b)));
}
a = Math.abs(a);
public static double code(double a, double b, double angle) {
return 0.011111111111111112 * (angle * (Math.PI * (b * b)));
}
a = abs(a) def code(a, b, angle): return 0.011111111111111112 * (angle * (math.pi * (b * b)))
a = abs(a) function code(a, b, angle) return Float64(0.011111111111111112 * Float64(angle * Float64(pi * Float64(b * b)))) end
a = abs(a) function tmp = code(a, b, angle) tmp = 0.011111111111111112 * (angle * (pi * (b * b))); end
NOTE: a should be positive before calling this function code[a_, b_, angle_] := N[(0.011111111111111112 * N[(angle * N[(Pi * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
a = |a|\\
\\
0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(b \cdot b\right)\right)\right)
\end{array}
Initial program 53.0%
*-commutative53.0%
associate-*l*53.0%
associate-*l*53.0%
unpow253.0%
unpow253.0%
sqr-neg53.0%
difference-of-squares58.1%
sub-neg58.1%
sub-neg58.1%
remove-double-neg58.1%
Simplified58.1%
Taylor expanded in angle around 0 53.0%
Taylor expanded in a around 0 34.3%
*-commutative34.3%
unpow234.3%
Simplified34.3%
Final simplification34.3%
herbie shell --seed 2023297
(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)))))