
(FPCore (a b angle) :precision binary64 (let* ((t_0 (* PI (/ angle 180.0)))) (+ (pow (* a (cos t_0)) 2.0) (pow (* b (sin t_0)) 2.0))))
double code(double a, double b, double angle) {
double t_0 = ((double) M_PI) * (angle / 180.0);
return pow((a * cos(t_0)), 2.0) + pow((b * sin(t_0)), 2.0);
}
public static double code(double a, double b, double angle) {
double t_0 = Math.PI * (angle / 180.0);
return Math.pow((a * Math.cos(t_0)), 2.0) + Math.pow((b * Math.sin(t_0)), 2.0);
}
def code(a, b, angle): t_0 = math.pi * (angle / 180.0) return math.pow((a * math.cos(t_0)), 2.0) + math.pow((b * math.sin(t_0)), 2.0)
function code(a, b, angle) t_0 = Float64(pi * Float64(angle / 180.0)) return Float64((Float64(a * cos(t_0)) ^ 2.0) + (Float64(b * sin(t_0)) ^ 2.0)) end
function tmp = code(a, b, angle) t_0 = pi * (angle / 180.0); tmp = ((a * cos(t_0)) ^ 2.0) + ((b * sin(t_0)) ^ 2.0); end
code[a_, b_, angle_] := Block[{t$95$0 = N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]}, N[(N[Power[N[(a * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \pi \cdot \frac{angle}{180}\\
{\left(a \cdot \cos t\_0\right)}^{2} + {\left(b \cdot \sin t\_0\right)}^{2}
\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)))) (+ (pow (* a (cos t_0)) 2.0) (pow (* b (sin t_0)) 2.0))))
double code(double a, double b, double angle) {
double t_0 = ((double) M_PI) * (angle / 180.0);
return pow((a * cos(t_0)), 2.0) + pow((b * sin(t_0)), 2.0);
}
public static double code(double a, double b, double angle) {
double t_0 = Math.PI * (angle / 180.0);
return Math.pow((a * Math.cos(t_0)), 2.0) + Math.pow((b * Math.sin(t_0)), 2.0);
}
def code(a, b, angle): t_0 = math.pi * (angle / 180.0) return math.pow((a * math.cos(t_0)), 2.0) + math.pow((b * math.sin(t_0)), 2.0)
function code(a, b, angle) t_0 = Float64(pi * Float64(angle / 180.0)) return Float64((Float64(a * cos(t_0)) ^ 2.0) + (Float64(b * sin(t_0)) ^ 2.0)) end
function tmp = code(a, b, angle) t_0 = pi * (angle / 180.0); tmp = ((a * cos(t_0)) ^ 2.0) + ((b * sin(t_0)) ^ 2.0); end
code[a_, b_, angle_] := Block[{t$95$0 = N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]}, N[(N[Power[N[(a * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \pi \cdot \frac{angle}{180}\\
{\left(a \cdot \cos t\_0\right)}^{2} + {\left(b \cdot \sin t\_0\right)}^{2}
\end{array}
\end{array}
(FPCore (a b angle) :precision binary64 (+ (* a a) (pow (* b (sin (/ (/ PI (/ -1.0 angle)) -180.0))) 2.0)))
double code(double a, double b, double angle) {
return (a * a) + pow((b * sin(((((double) M_PI) / (-1.0 / angle)) / -180.0))), 2.0);
}
public static double code(double a, double b, double angle) {
return (a * a) + Math.pow((b * Math.sin(((Math.PI / (-1.0 / angle)) / -180.0))), 2.0);
}
def code(a, b, angle): return (a * a) + math.pow((b * math.sin(((math.pi / (-1.0 / angle)) / -180.0))), 2.0)
function code(a, b, angle) return Float64(Float64(a * a) + (Float64(b * sin(Float64(Float64(pi / Float64(-1.0 / angle)) / -180.0))) ^ 2.0)) end
function tmp = code(a, b, angle) tmp = (a * a) + ((b * sin(((pi / (-1.0 / angle)) / -180.0))) ^ 2.0); end
code[a_, b_, angle_] := N[(N[(a * a), $MachinePrecision] + N[Power[N[(b * N[Sin[N[(N[(Pi / N[(-1.0 / angle), $MachinePrecision]), $MachinePrecision] / -180.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
a \cdot a + {\left(b \cdot \sin \left(\frac{\frac{\pi}{\frac{-1}{angle}}}{-180}\right)\right)}^{2}
\end{array}
Initial program 82.0%
+-lowering-+.f64N/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
pow-lowering-pow.f64N/A
Simplified82.1%
Taylor expanded in angle around 0
unpow2N/A
*-lowering-*.f6482.5%
Simplified82.5%
associate-*l/N/A
associate-/r/N/A
*-un-lft-identityN/A
div-invN/A
times-fracN/A
metadata-evalN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
PI-lowering-PI.f64N/A
/-lowering-/.f6482.5%
Applied egg-rr82.5%
metadata-evalN/A
times-fracN/A
div-invN/A
*-un-lft-identityN/A
associate-/r/N/A
associate-*l/N/A
add-sqr-sqrtN/A
associate-*r*N/A
*-commutativeN/A
rem-exp-logN/A
frac-2negN/A
/-lowering-/.f64N/A
Applied egg-rr82.6%
(FPCore (a b angle) :precision binary64 (+ (* a a) (pow (* b (sin (/ (* PI angle) 180.0))) 2.0)))
double code(double a, double b, double angle) {
return (a * a) + pow((b * sin(((((double) M_PI) * angle) / 180.0))), 2.0);
}
public static double code(double a, double b, double angle) {
return (a * a) + Math.pow((b * Math.sin(((Math.PI * angle) / 180.0))), 2.0);
}
def code(a, b, angle): return (a * a) + math.pow((b * math.sin(((math.pi * angle) / 180.0))), 2.0)
function code(a, b, angle) return Float64(Float64(a * a) + (Float64(b * sin(Float64(Float64(pi * angle) / 180.0))) ^ 2.0)) end
function tmp = code(a, b, angle) tmp = (a * a) + ((b * sin(((pi * angle) / 180.0))) ^ 2.0); end
code[a_, b_, angle_] := N[(N[(a * a), $MachinePrecision] + N[Power[N[(b * N[Sin[N[(N[(Pi * angle), $MachinePrecision] / 180.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
a \cdot a + {\left(b \cdot \sin \left(\frac{\pi \cdot angle}{180}\right)\right)}^{2}
\end{array}
Initial program 82.0%
+-lowering-+.f64N/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
pow-lowering-pow.f64N/A
Simplified82.1%
Taylor expanded in angle around 0
unpow2N/A
*-lowering-*.f6482.5%
Simplified82.5%
(FPCore (a b angle) :precision binary64 (+ (* a a) (pow (* b (sin (* PI (/ angle 180.0)))) 2.0)))
double code(double a, double b, double angle) {
return (a * a) + pow((b * sin((((double) M_PI) * (angle / 180.0)))), 2.0);
}
public static double code(double a, double b, double angle) {
return (a * a) + Math.pow((b * Math.sin((Math.PI * (angle / 180.0)))), 2.0);
}
def code(a, b, angle): return (a * a) + math.pow((b * math.sin((math.pi * (angle / 180.0)))), 2.0)
function code(a, b, angle) return Float64(Float64(a * a) + (Float64(b * sin(Float64(pi * Float64(angle / 180.0)))) ^ 2.0)) end
function tmp = code(a, b, angle) tmp = (a * a) + ((b * sin((pi * (angle / 180.0)))) ^ 2.0); end
code[a_, b_, angle_] := N[(N[(a * a), $MachinePrecision] + N[Power[N[(b * N[Sin[N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
a \cdot a + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2}
\end{array}
Initial program 82.0%
Taylor expanded in angle around 0
unpow2N/A
*-lowering-*.f6482.4%
Simplified82.4%
(FPCore (a b angle)
:precision binary64
(if (<= angle 5e-5)
(+ (* a a) (pow (* angle (* b (* PI 0.005555555555555556))) 2.0))
(+
(* a a)
(* b (* b (- 0.5 (* 0.5 (cos (* 2.0 (/ PI (/ 180.0 angle)))))))))))
double code(double a, double b, double angle) {
double tmp;
if (angle <= 5e-5) {
tmp = (a * a) + pow((angle * (b * (((double) M_PI) * 0.005555555555555556))), 2.0);
} else {
tmp = (a * a) + (b * (b * (0.5 - (0.5 * cos((2.0 * (((double) M_PI) / (180.0 / angle))))))));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (angle <= 5e-5) {
tmp = (a * a) + Math.pow((angle * (b * (Math.PI * 0.005555555555555556))), 2.0);
} else {
tmp = (a * a) + (b * (b * (0.5 - (0.5 * Math.cos((2.0 * (Math.PI / (180.0 / angle))))))));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if angle <= 5e-5: tmp = (a * a) + math.pow((angle * (b * (math.pi * 0.005555555555555556))), 2.0) else: tmp = (a * a) + (b * (b * (0.5 - (0.5 * math.cos((2.0 * (math.pi / (180.0 / angle)))))))) return tmp
function code(a, b, angle) tmp = 0.0 if (angle <= 5e-5) tmp = Float64(Float64(a * a) + (Float64(angle * Float64(b * Float64(pi * 0.005555555555555556))) ^ 2.0)); else tmp = Float64(Float64(a * a) + Float64(b * Float64(b * Float64(0.5 - Float64(0.5 * cos(Float64(2.0 * Float64(pi / Float64(180.0 / angle))))))))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (angle <= 5e-5) tmp = (a * a) + ((angle * (b * (pi * 0.005555555555555556))) ^ 2.0); else tmp = (a * a) + (b * (b * (0.5 - (0.5 * cos((2.0 * (pi / (180.0 / angle)))))))); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[angle, 5e-5], N[(N[(a * a), $MachinePrecision] + N[Power[N[(angle * N[(b * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], N[(N[(a * a), $MachinePrecision] + N[(b * N[(b * N[(0.5 - N[(0.5 * N[Cos[N[(2.0 * N[(Pi / N[(180.0 / angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;angle \leq 5 \cdot 10^{-5}:\\
\;\;\;\;a \cdot a + {\left(angle \cdot \left(b \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)}^{2}\\
\mathbf{else}:\\
\;\;\;\;a \cdot a + b \cdot \left(b \cdot \left(0.5 - 0.5 \cdot \cos \left(2 \cdot \frac{\pi}{\frac{180}{angle}}\right)\right)\right)\\
\end{array}
\end{array}
if angle < 5.00000000000000024e-5Initial program 87.4%
+-lowering-+.f64N/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
pow-lowering-pow.f64N/A
Simplified87.5%
Taylor expanded in angle around 0
unpow2N/A
*-lowering-*.f6487.9%
Simplified87.9%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6483.9%
Simplified83.9%
if 5.00000000000000024e-5 < angle Initial program 61.2%
+-lowering-+.f64N/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
pow-lowering-pow.f64N/A
Simplified61.3%
Taylor expanded in angle around 0
unpow2N/A
*-lowering-*.f6461.7%
Simplified61.7%
+-commutativeN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
associate-*l/N/A
associate-/r/N/A
associate-*r*N/A
associate-*l/N/A
associate-/r/N/A
+-lowering-+.f64N/A
Applied egg-rr61.6%
Final simplification79.3%
(FPCore (a b angle)
:precision binary64
(if (<= angle 0.0038)
(+ (* a a) (pow (* angle (* b (* PI 0.005555555555555556))) 2.0))
(+
(* a a)
(* (- 0.5 (* 0.5 (cos (* 2.0 (/ PI (/ 180.0 angle)))))) (* b b)))))
double code(double a, double b, double angle) {
double tmp;
if (angle <= 0.0038) {
tmp = (a * a) + pow((angle * (b * (((double) M_PI) * 0.005555555555555556))), 2.0);
} else {
tmp = (a * a) + ((0.5 - (0.5 * cos((2.0 * (((double) M_PI) / (180.0 / angle)))))) * (b * b));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (angle <= 0.0038) {
tmp = (a * a) + Math.pow((angle * (b * (Math.PI * 0.005555555555555556))), 2.0);
} else {
tmp = (a * a) + ((0.5 - (0.5 * Math.cos((2.0 * (Math.PI / (180.0 / angle)))))) * (b * b));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if angle <= 0.0038: tmp = (a * a) + math.pow((angle * (b * (math.pi * 0.005555555555555556))), 2.0) else: tmp = (a * a) + ((0.5 - (0.5 * math.cos((2.0 * (math.pi / (180.0 / angle)))))) * (b * b)) return tmp
function code(a, b, angle) tmp = 0.0 if (angle <= 0.0038) tmp = Float64(Float64(a * a) + (Float64(angle * Float64(b * Float64(pi * 0.005555555555555556))) ^ 2.0)); else tmp = Float64(Float64(a * a) + Float64(Float64(0.5 - Float64(0.5 * cos(Float64(2.0 * Float64(pi / Float64(180.0 / angle)))))) * Float64(b * b))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (angle <= 0.0038) tmp = (a * a) + ((angle * (b * (pi * 0.005555555555555556))) ^ 2.0); else tmp = (a * a) + ((0.5 - (0.5 * cos((2.0 * (pi / (180.0 / angle)))))) * (b * b)); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[angle, 0.0038], N[(N[(a * a), $MachinePrecision] + N[Power[N[(angle * N[(b * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], N[(N[(a * a), $MachinePrecision] + N[(N[(0.5 - N[(0.5 * N[Cos[N[(2.0 * N[(Pi / N[(180.0 / angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;angle \leq 0.0038:\\
\;\;\;\;a \cdot a + {\left(angle \cdot \left(b \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)}^{2}\\
\mathbf{else}:\\
\;\;\;\;a \cdot a + \left(0.5 - 0.5 \cdot \cos \left(2 \cdot \frac{\pi}{\frac{180}{angle}}\right)\right) \cdot \left(b \cdot b\right)\\
\end{array}
\end{array}
if angle < 0.00379999999999999999Initial program 87.4%
+-lowering-+.f64N/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
pow-lowering-pow.f64N/A
Simplified87.5%
Taylor expanded in angle around 0
unpow2N/A
*-lowering-*.f6487.9%
Simplified87.9%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6483.9%
Simplified83.9%
if 0.00379999999999999999 < angle Initial program 61.2%
+-lowering-+.f64N/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
pow-lowering-pow.f64N/A
Simplified61.3%
Taylor expanded in angle around 0
unpow2N/A
*-lowering-*.f6461.7%
Simplified61.7%
*-commutativeN/A
unpow-prod-downN/A
*-lowering-*.f64N/A
unpow2N/A
sqr-sin-aN/A
--lowering--.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
associate-*l/N/A
associate-/r/N/A
/-lowering-/.f64N/A
PI-lowering-PI.f64N/A
/-lowering-/.f64N/A
pow2N/A
*-lowering-*.f6461.6%
Applied egg-rr61.6%
Final simplification79.3%
(FPCore (a b angle)
:precision binary64
(if (<= angle 0.0038)
(+ (* a a) (pow (* angle (* b (* PI 0.005555555555555556))) 2.0))
(+
(* a a)
(* (* b b) (+ 0.5 (* (cos (* (* PI angle) 0.011111111111111112)) -0.5))))))
double code(double a, double b, double angle) {
double tmp;
if (angle <= 0.0038) {
tmp = (a * a) + pow((angle * (b * (((double) M_PI) * 0.005555555555555556))), 2.0);
} else {
tmp = (a * a) + ((b * b) * (0.5 + (cos(((((double) M_PI) * angle) * 0.011111111111111112)) * -0.5)));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (angle <= 0.0038) {
tmp = (a * a) + Math.pow((angle * (b * (Math.PI * 0.005555555555555556))), 2.0);
} else {
tmp = (a * a) + ((b * b) * (0.5 + (Math.cos(((Math.PI * angle) * 0.011111111111111112)) * -0.5)));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if angle <= 0.0038: tmp = (a * a) + math.pow((angle * (b * (math.pi * 0.005555555555555556))), 2.0) else: tmp = (a * a) + ((b * b) * (0.5 + (math.cos(((math.pi * angle) * 0.011111111111111112)) * -0.5))) return tmp
function code(a, b, angle) tmp = 0.0 if (angle <= 0.0038) tmp = Float64(Float64(a * a) + (Float64(angle * Float64(b * Float64(pi * 0.005555555555555556))) ^ 2.0)); else tmp = Float64(Float64(a * a) + Float64(Float64(b * b) * Float64(0.5 + Float64(cos(Float64(Float64(pi * angle) * 0.011111111111111112)) * -0.5)))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (angle <= 0.0038) tmp = (a * a) + ((angle * (b * (pi * 0.005555555555555556))) ^ 2.0); else tmp = (a * a) + ((b * b) * (0.5 + (cos(((pi * angle) * 0.011111111111111112)) * -0.5))); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[angle, 0.0038], N[(N[(a * a), $MachinePrecision] + N[Power[N[(angle * N[(b * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], N[(N[(a * a), $MachinePrecision] + N[(N[(b * b), $MachinePrecision] * N[(0.5 + N[(N[Cos[N[(N[(Pi * angle), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;angle \leq 0.0038:\\
\;\;\;\;a \cdot a + {\left(angle \cdot \left(b \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)}^{2}\\
\mathbf{else}:\\
\;\;\;\;a \cdot a + \left(b \cdot b\right) \cdot \left(0.5 + \cos \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right) \cdot -0.5\right)\\
\end{array}
\end{array}
if angle < 0.00379999999999999999Initial program 87.4%
+-lowering-+.f64N/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
pow-lowering-pow.f64N/A
Simplified87.5%
Taylor expanded in angle around 0
unpow2N/A
*-lowering-*.f6487.9%
Simplified87.9%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6483.9%
Simplified83.9%
if 0.00379999999999999999 < angle Initial program 61.2%
+-lowering-+.f64N/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
pow-lowering-pow.f64N/A
Simplified61.3%
Taylor expanded in angle around 0
unpow2N/A
*-lowering-*.f6461.7%
Simplified61.7%
Applied egg-rr4.1%
Taylor expanded in b around 0
+-commutativeN/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
sub-negN/A
+-lowering-+.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
metadata-eval61.8%
Simplified61.8%
Final simplification79.3%
(FPCore (a b angle) :precision binary64 (if (<= b 1.28e-23) (* a a) (+ (* a a) (pow (* angle (* b (* PI 0.005555555555555556))) 2.0))))
double code(double a, double b, double angle) {
double tmp;
if (b <= 1.28e-23) {
tmp = a * a;
} else {
tmp = (a * a) + pow((angle * (b * (((double) M_PI) * 0.005555555555555556))), 2.0);
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (b <= 1.28e-23) {
tmp = a * a;
} else {
tmp = (a * a) + Math.pow((angle * (b * (Math.PI * 0.005555555555555556))), 2.0);
}
return tmp;
}
def code(a, b, angle): tmp = 0 if b <= 1.28e-23: tmp = a * a else: tmp = (a * a) + math.pow((angle * (b * (math.pi * 0.005555555555555556))), 2.0) return tmp
function code(a, b, angle) tmp = 0.0 if (b <= 1.28e-23) tmp = Float64(a * a); else tmp = Float64(Float64(a * a) + (Float64(angle * Float64(b * Float64(pi * 0.005555555555555556))) ^ 2.0)); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (b <= 1.28e-23) tmp = a * a; else tmp = (a * a) + ((angle * (b * (pi * 0.005555555555555556))) ^ 2.0); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[b, 1.28e-23], N[(a * a), $MachinePrecision], N[(N[(a * a), $MachinePrecision] + N[Power[N[(angle * N[(b * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 1.28 \cdot 10^{-23}:\\
\;\;\;\;a \cdot a\\
\mathbf{else}:\\
\;\;\;\;a \cdot a + {\left(angle \cdot \left(b \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)}^{2}\\
\end{array}
\end{array}
if b < 1.28000000000000005e-23Initial program 83.7%
Taylor expanded in angle around 0
unpow2N/A
*-lowering-*.f6469.1%
Simplified69.1%
if 1.28000000000000005e-23 < b Initial program 76.8%
+-lowering-+.f64N/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
pow-lowering-pow.f64N/A
Simplified76.9%
Taylor expanded in angle around 0
unpow2N/A
*-lowering-*.f6478.3%
Simplified78.3%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6472.3%
Simplified72.3%
Final simplification69.9%
(FPCore (a b angle)
:precision binary64
(if (<= b 1.15e-23)
(* a a)
(+
(* a a)
(* (* (* PI (* PI 3.08641975308642e-5)) (* b angle)) (* b angle)))))
double code(double a, double b, double angle) {
double tmp;
if (b <= 1.15e-23) {
tmp = a * a;
} else {
tmp = (a * a) + (((((double) M_PI) * (((double) M_PI) * 3.08641975308642e-5)) * (b * angle)) * (b * angle));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (b <= 1.15e-23) {
tmp = a * a;
} else {
tmp = (a * a) + (((Math.PI * (Math.PI * 3.08641975308642e-5)) * (b * angle)) * (b * angle));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if b <= 1.15e-23: tmp = a * a else: tmp = (a * a) + (((math.pi * (math.pi * 3.08641975308642e-5)) * (b * angle)) * (b * angle)) return tmp
function code(a, b, angle) tmp = 0.0 if (b <= 1.15e-23) tmp = Float64(a * a); else tmp = Float64(Float64(a * a) + Float64(Float64(Float64(pi * Float64(pi * 3.08641975308642e-5)) * Float64(b * angle)) * Float64(b * angle))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (b <= 1.15e-23) tmp = a * a; else tmp = (a * a) + (((pi * (pi * 3.08641975308642e-5)) * (b * angle)) * (b * angle)); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[b, 1.15e-23], N[(a * a), $MachinePrecision], N[(N[(a * a), $MachinePrecision] + N[(N[(N[(Pi * N[(Pi * 3.08641975308642e-5), $MachinePrecision]), $MachinePrecision] * N[(b * angle), $MachinePrecision]), $MachinePrecision] * N[(b * angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 1.15 \cdot 10^{-23}:\\
\;\;\;\;a \cdot a\\
\mathbf{else}:\\
\;\;\;\;a \cdot a + \left(\left(\pi \cdot \left(\pi \cdot 3.08641975308642 \cdot 10^{-5}\right)\right) \cdot \left(b \cdot angle\right)\right) \cdot \left(b \cdot angle\right)\\
\end{array}
\end{array}
if b < 1.15000000000000005e-23Initial program 83.7%
Taylor expanded in angle around 0
unpow2N/A
*-lowering-*.f6469.1%
Simplified69.1%
if 1.15000000000000005e-23 < b Initial program 76.8%
+-lowering-+.f64N/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
pow-lowering-pow.f64N/A
Simplified76.9%
Taylor expanded in angle around 0
unpow2N/A
*-lowering-*.f6478.3%
Simplified78.3%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
+-commutativeN/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
Simplified64.7%
*-commutativeN/A
unswap-sqrN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6472.3%
Applied egg-rr72.3%
(FPCore (a b angle)
:precision binary64
(if (<= b 9.8e-23)
(* a a)
(+
(* a a)
(* 3.08641975308642e-5 (* (* b (* b (* angle angle))) (* PI PI))))))
double code(double a, double b, double angle) {
double tmp;
if (b <= 9.8e-23) {
tmp = a * a;
} else {
tmp = (a * a) + (3.08641975308642e-5 * ((b * (b * (angle * angle))) * (((double) M_PI) * ((double) M_PI))));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (b <= 9.8e-23) {
tmp = a * a;
} else {
tmp = (a * a) + (3.08641975308642e-5 * ((b * (b * (angle * angle))) * (Math.PI * Math.PI)));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if b <= 9.8e-23: tmp = a * a else: tmp = (a * a) + (3.08641975308642e-5 * ((b * (b * (angle * angle))) * (math.pi * math.pi))) return tmp
function code(a, b, angle) tmp = 0.0 if (b <= 9.8e-23) tmp = Float64(a * a); else tmp = Float64(Float64(a * a) + Float64(3.08641975308642e-5 * Float64(Float64(b * Float64(b * Float64(angle * angle))) * Float64(pi * pi)))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (b <= 9.8e-23) tmp = a * a; else tmp = (a * a) + (3.08641975308642e-5 * ((b * (b * (angle * angle))) * (pi * pi))); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[b, 9.8e-23], N[(a * a), $MachinePrecision], N[(N[(a * a), $MachinePrecision] + N[(3.08641975308642e-5 * N[(N[(b * N[(b * N[(angle * angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(Pi * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 9.8 \cdot 10^{-23}:\\
\;\;\;\;a \cdot a\\
\mathbf{else}:\\
\;\;\;\;a \cdot a + 3.08641975308642 \cdot 10^{-5} \cdot \left(\left(b \cdot \left(b \cdot \left(angle \cdot angle\right)\right)\right) \cdot \left(\pi \cdot \pi\right)\right)\\
\end{array}
\end{array}
if b < 9.7999999999999996e-23Initial program 83.7%
Taylor expanded in angle around 0
unpow2N/A
*-lowering-*.f6469.1%
Simplified69.1%
if 9.7999999999999996e-23 < b Initial program 76.8%
+-lowering-+.f64N/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
pow-lowering-pow.f64N/A
Simplified76.9%
Taylor expanded in angle around 0
unpow2N/A
*-lowering-*.f6478.3%
Simplified78.3%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
+-commutativeN/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
Simplified64.7%
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
PI-lowering-PI.f6470.6%
Applied egg-rr70.6%
Final simplification69.5%
(FPCore (a b angle)
:precision binary64
(if (<= b 8.4e-23)
(* a a)
(+
(* a a)
(* (* PI PI) (* 3.08641975308642e-5 (* b (* b (* angle angle))))))))
double code(double a, double b, double angle) {
double tmp;
if (b <= 8.4e-23) {
tmp = a * a;
} else {
tmp = (a * a) + ((((double) M_PI) * ((double) M_PI)) * (3.08641975308642e-5 * (b * (b * (angle * angle)))));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (b <= 8.4e-23) {
tmp = a * a;
} else {
tmp = (a * a) + ((Math.PI * Math.PI) * (3.08641975308642e-5 * (b * (b * (angle * angle)))));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if b <= 8.4e-23: tmp = a * a else: tmp = (a * a) + ((math.pi * math.pi) * (3.08641975308642e-5 * (b * (b * (angle * angle))))) return tmp
function code(a, b, angle) tmp = 0.0 if (b <= 8.4e-23) tmp = Float64(a * a); else tmp = Float64(Float64(a * a) + Float64(Float64(pi * pi) * Float64(3.08641975308642e-5 * Float64(b * Float64(b * Float64(angle * angle)))))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (b <= 8.4e-23) tmp = a * a; else tmp = (a * a) + ((pi * pi) * (3.08641975308642e-5 * (b * (b * (angle * angle))))); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[b, 8.4e-23], N[(a * a), $MachinePrecision], N[(N[(a * a), $MachinePrecision] + N[(N[(Pi * Pi), $MachinePrecision] * N[(3.08641975308642e-5 * N[(b * N[(b * N[(angle * angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 8.4 \cdot 10^{-23}:\\
\;\;\;\;a \cdot a\\
\mathbf{else}:\\
\;\;\;\;a \cdot a + \left(\pi \cdot \pi\right) \cdot \left(3.08641975308642 \cdot 10^{-5} \cdot \left(b \cdot \left(b \cdot \left(angle \cdot angle\right)\right)\right)\right)\\
\end{array}
\end{array}
if b < 8.4000000000000003e-23Initial program 83.7%
Taylor expanded in angle around 0
unpow2N/A
*-lowering-*.f6469.1%
Simplified69.1%
if 8.4000000000000003e-23 < b Initial program 76.8%
+-lowering-+.f64N/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
pow-lowering-pow.f64N/A
Simplified76.9%
Taylor expanded in angle around 0
unpow2N/A
*-lowering-*.f6478.3%
Simplified78.3%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
+-commutativeN/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
Simplified64.7%
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
PI-lowering-PI.f6470.6%
Applied egg-rr70.6%
Final simplification69.5%
(FPCore (a b angle)
:precision binary64
(if (<= b 2.35e-23)
(* a a)
(+
(* a a)
(* PI (* (* PI 3.08641975308642e-5) (* b (* b (* angle angle))))))))
double code(double a, double b, double angle) {
double tmp;
if (b <= 2.35e-23) {
tmp = a * a;
} else {
tmp = (a * a) + (((double) M_PI) * ((((double) M_PI) * 3.08641975308642e-5) * (b * (b * (angle * angle)))));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (b <= 2.35e-23) {
tmp = a * a;
} else {
tmp = (a * a) + (Math.PI * ((Math.PI * 3.08641975308642e-5) * (b * (b * (angle * angle)))));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if b <= 2.35e-23: tmp = a * a else: tmp = (a * a) + (math.pi * ((math.pi * 3.08641975308642e-5) * (b * (b * (angle * angle))))) return tmp
function code(a, b, angle) tmp = 0.0 if (b <= 2.35e-23) tmp = Float64(a * a); else tmp = Float64(Float64(a * a) + Float64(pi * Float64(Float64(pi * 3.08641975308642e-5) * Float64(b * Float64(b * Float64(angle * angle)))))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (b <= 2.35e-23) tmp = a * a; else tmp = (a * a) + (pi * ((pi * 3.08641975308642e-5) * (b * (b * (angle * angle))))); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[b, 2.35e-23], N[(a * a), $MachinePrecision], N[(N[(a * a), $MachinePrecision] + N[(Pi * N[(N[(Pi * 3.08641975308642e-5), $MachinePrecision] * N[(b * N[(b * N[(angle * angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 2.35 \cdot 10^{-23}:\\
\;\;\;\;a \cdot a\\
\mathbf{else}:\\
\;\;\;\;a \cdot a + \pi \cdot \left(\left(\pi \cdot 3.08641975308642 \cdot 10^{-5}\right) \cdot \left(b \cdot \left(b \cdot \left(angle \cdot angle\right)\right)\right)\right)\\
\end{array}
\end{array}
if b < 2.35e-23Initial program 83.7%
Taylor expanded in angle around 0
unpow2N/A
*-lowering-*.f6469.1%
Simplified69.1%
if 2.35e-23 < b Initial program 76.8%
+-lowering-+.f64N/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
pow-lowering-pow.f64N/A
Simplified76.9%
Taylor expanded in angle around 0
unpow2N/A
*-lowering-*.f6478.3%
Simplified78.3%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
+-commutativeN/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
Simplified64.7%
*-commutativeN/A
associate-*l*N/A
associate-*l*N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6470.5%
Applied egg-rr70.5%
(FPCore (a b angle) :precision binary64 (if (<= b 1.55e+147) (* a a) (* (* b angle) (* angle (* b (* PI (* PI 3.08641975308642e-5)))))))
double code(double a, double b, double angle) {
double tmp;
if (b <= 1.55e+147) {
tmp = a * a;
} else {
tmp = (b * angle) * (angle * (b * (((double) M_PI) * (((double) M_PI) * 3.08641975308642e-5))));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (b <= 1.55e+147) {
tmp = a * a;
} else {
tmp = (b * angle) * (angle * (b * (Math.PI * (Math.PI * 3.08641975308642e-5))));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if b <= 1.55e+147: tmp = a * a else: tmp = (b * angle) * (angle * (b * (math.pi * (math.pi * 3.08641975308642e-5)))) return tmp
function code(a, b, angle) tmp = 0.0 if (b <= 1.55e+147) tmp = Float64(a * a); else tmp = Float64(Float64(b * angle) * Float64(angle * Float64(b * Float64(pi * Float64(pi * 3.08641975308642e-5))))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (b <= 1.55e+147) tmp = a * a; else tmp = (b * angle) * (angle * (b * (pi * (pi * 3.08641975308642e-5)))); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[b, 1.55e+147], N[(a * a), $MachinePrecision], N[(N[(b * angle), $MachinePrecision] * N[(angle * N[(b * N[(Pi * N[(Pi * 3.08641975308642e-5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 1.55 \cdot 10^{+147}:\\
\;\;\;\;a \cdot a\\
\mathbf{else}:\\
\;\;\;\;\left(b \cdot angle\right) \cdot \left(angle \cdot \left(b \cdot \left(\pi \cdot \left(\pi \cdot 3.08641975308642 \cdot 10^{-5}\right)\right)\right)\right)\\
\end{array}
\end{array}
if b < 1.55e147Initial program 80.4%
Taylor expanded in angle around 0
unpow2N/A
*-lowering-*.f6465.2%
Simplified65.2%
if 1.55e147 < b Initial program 96.6%
+-lowering-+.f64N/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
pow-lowering-pow.f64N/A
Simplified96.6%
Taylor expanded in angle around 0
unpow2N/A
*-lowering-*.f6496.6%
Simplified96.6%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
+-commutativeN/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
Simplified76.8%
Taylor expanded in a around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*l*N/A
metadata-evalN/A
distribute-rgt-neg-inN/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
distribute-lft-neg-inN/A
metadata-evalN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
PI-lowering-PI.f6476.8%
Simplified76.8%
associate-*l*N/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
PI-lowering-PI.f6484.4%
Applied egg-rr84.4%
Final simplification67.1%
(FPCore (a b angle) :precision binary64 (if (<= b 1.48e+147) (* a a) (* (* (* PI (* PI 3.08641975308642e-5)) (* b angle)) (* b angle))))
double code(double a, double b, double angle) {
double tmp;
if (b <= 1.48e+147) {
tmp = a * a;
} else {
tmp = ((((double) M_PI) * (((double) M_PI) * 3.08641975308642e-5)) * (b * angle)) * (b * angle);
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (b <= 1.48e+147) {
tmp = a * a;
} else {
tmp = ((Math.PI * (Math.PI * 3.08641975308642e-5)) * (b * angle)) * (b * angle);
}
return tmp;
}
def code(a, b, angle): tmp = 0 if b <= 1.48e+147: tmp = a * a else: tmp = ((math.pi * (math.pi * 3.08641975308642e-5)) * (b * angle)) * (b * angle) return tmp
function code(a, b, angle) tmp = 0.0 if (b <= 1.48e+147) tmp = Float64(a * a); else tmp = Float64(Float64(Float64(pi * Float64(pi * 3.08641975308642e-5)) * Float64(b * angle)) * Float64(b * angle)); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (b <= 1.48e+147) tmp = a * a; else tmp = ((pi * (pi * 3.08641975308642e-5)) * (b * angle)) * (b * angle); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[b, 1.48e+147], N[(a * a), $MachinePrecision], N[(N[(N[(Pi * N[(Pi * 3.08641975308642e-5), $MachinePrecision]), $MachinePrecision] * N[(b * angle), $MachinePrecision]), $MachinePrecision] * N[(b * angle), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 1.48 \cdot 10^{+147}:\\
\;\;\;\;a \cdot a\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\pi \cdot \left(\pi \cdot 3.08641975308642 \cdot 10^{-5}\right)\right) \cdot \left(b \cdot angle\right)\right) \cdot \left(b \cdot angle\right)\\
\end{array}
\end{array}
if b < 1.48000000000000002e147Initial program 80.4%
Taylor expanded in angle around 0
unpow2N/A
*-lowering-*.f6465.2%
Simplified65.2%
if 1.48000000000000002e147 < b Initial program 96.6%
+-lowering-+.f64N/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
pow-lowering-pow.f64N/A
Simplified96.6%
Taylor expanded in angle around 0
unpow2N/A
*-lowering-*.f6496.6%
Simplified96.6%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
+-commutativeN/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
Simplified76.8%
Taylor expanded in a around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*l*N/A
metadata-evalN/A
distribute-rgt-neg-inN/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
distribute-lft-neg-inN/A
metadata-evalN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
PI-lowering-PI.f6476.8%
Simplified76.8%
pow2N/A
associate-*r*N/A
pow2N/A
unswap-sqrN/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
PI-lowering-PI.f6484.4%
Applied egg-rr84.4%
Final simplification67.1%
(FPCore (a b angle) :precision binary64 (if (<= b 2.1e+147) (* a a) (* PI (* (* PI 3.08641975308642e-5) (* b (* b (* angle angle)))))))
double code(double a, double b, double angle) {
double tmp;
if (b <= 2.1e+147) {
tmp = a * a;
} else {
tmp = ((double) M_PI) * ((((double) M_PI) * 3.08641975308642e-5) * (b * (b * (angle * angle))));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (b <= 2.1e+147) {
tmp = a * a;
} else {
tmp = Math.PI * ((Math.PI * 3.08641975308642e-5) * (b * (b * (angle * angle))));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if b <= 2.1e+147: tmp = a * a else: tmp = math.pi * ((math.pi * 3.08641975308642e-5) * (b * (b * (angle * angle)))) return tmp
function code(a, b, angle) tmp = 0.0 if (b <= 2.1e+147) tmp = Float64(a * a); else tmp = Float64(pi * Float64(Float64(pi * 3.08641975308642e-5) * Float64(b * Float64(b * Float64(angle * angle))))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (b <= 2.1e+147) tmp = a * a; else tmp = pi * ((pi * 3.08641975308642e-5) * (b * (b * (angle * angle)))); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[b, 2.1e+147], N[(a * a), $MachinePrecision], N[(Pi * N[(N[(Pi * 3.08641975308642e-5), $MachinePrecision] * N[(b * N[(b * N[(angle * angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 2.1 \cdot 10^{+147}:\\
\;\;\;\;a \cdot a\\
\mathbf{else}:\\
\;\;\;\;\pi \cdot \left(\left(\pi \cdot 3.08641975308642 \cdot 10^{-5}\right) \cdot \left(b \cdot \left(b \cdot \left(angle \cdot angle\right)\right)\right)\right)\\
\end{array}
\end{array}
if b < 2.10000000000000006e147Initial program 80.4%
Taylor expanded in angle around 0
unpow2N/A
*-lowering-*.f6465.2%
Simplified65.2%
if 2.10000000000000006e147 < b Initial program 96.6%
+-lowering-+.f64N/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
pow-lowering-pow.f64N/A
Simplified96.6%
Taylor expanded in angle around 0
unpow2N/A
*-lowering-*.f6496.6%
Simplified96.6%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
+-commutativeN/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
Simplified76.8%
Taylor expanded in a around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*l*N/A
metadata-evalN/A
distribute-rgt-neg-inN/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
distribute-lft-neg-inN/A
metadata-evalN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
PI-lowering-PI.f6476.8%
Simplified76.8%
pow2N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
*-commutativeN/A
pow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6480.3%
Applied egg-rr80.3%
(FPCore (a b angle) :precision binary64 (* a a))
double code(double a, double b, double angle) {
return a * a;
}
real(8) function code(a, b, angle)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: angle
code = a * a
end function
public static double code(double a, double b, double angle) {
return a * a;
}
def code(a, b, angle): return a * a
function code(a, b, angle) return Float64(a * a) end
function tmp = code(a, b, angle) tmp = a * a; end
code[a_, b_, angle_] := N[(a * a), $MachinePrecision]
\begin{array}{l}
\\
a \cdot a
\end{array}
Initial program 82.0%
Taylor expanded in angle around 0
unpow2N/A
*-lowering-*.f6461.9%
Simplified61.9%
herbie shell --seed 2024138
(FPCore (a b angle)
:name "ab-angle->ABCF C"
:precision binary64
(+ (pow (* a (cos (* PI (/ angle 180.0)))) 2.0) (pow (* b (sin (* PI (/ angle 180.0)))) 2.0)))