
(FPCore (w0 M D h l d) :precision binary64 (* w0 (sqrt (- 1.0 (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ h l))))))
double code(double w0, double M, double D, double h, double l, double d) {
return w0 * sqrt((1.0 - (pow(((M * D) / (2.0 * d)), 2.0) * (h / l))));
}
real(8) function code(w0, m, d, h, l, d_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d_1
code = w0 * sqrt((1.0d0 - ((((m * d) / (2.0d0 * d_1)) ** 2.0d0) * (h / l))))
end function
public static double code(double w0, double M, double D, double h, double l, double d) {
return w0 * Math.sqrt((1.0 - (Math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l))));
}
def code(w0, M, D, h, l, d): return w0 * math.sqrt((1.0 - (math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l))))
function code(w0, M, D, h, l, d) return Float64(w0 * sqrt(Float64(1.0 - Float64((Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0) * Float64(h / l))))) end
function tmp = code(w0, M, D, h, l, d) tmp = w0 * sqrt((1.0 - ((((M * D) / (2.0 * d)) ^ 2.0) * (h / l)))); end
code[w0_, M_, D_, h_, l_, d_] := N[(w0 * N[Sqrt[N[(1.0 - N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (w0 M D h l d) :precision binary64 (* w0 (sqrt (- 1.0 (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ h l))))))
double code(double w0, double M, double D, double h, double l, double d) {
return w0 * sqrt((1.0 - (pow(((M * D) / (2.0 * d)), 2.0) * (h / l))));
}
real(8) function code(w0, m, d, h, l, d_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d_1
code = w0 * sqrt((1.0d0 - ((((m * d) / (2.0d0 * d_1)) ** 2.0d0) * (h / l))))
end function
public static double code(double w0, double M, double D, double h, double l, double d) {
return w0 * Math.sqrt((1.0 - (Math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l))));
}
def code(w0, M, D, h, l, d): return w0 * math.sqrt((1.0 - (math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l))))
function code(w0, M, D, h, l, d) return Float64(w0 * sqrt(Float64(1.0 - Float64((Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0) * Float64(h / l))))) end
function tmp = code(w0, M, D, h, l, d) tmp = w0 * sqrt((1.0 - ((((M * D) / (2.0 * d)) ^ 2.0) * (h / l)))); end
code[w0_, M_, D_, h_, l_, d_] := N[(w0 * N[Sqrt[N[(1.0 - N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}}
\end{array}
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: d should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. (FPCore (w0 M D h l d) :precision binary64 (if (<= (/ (* M D) (* 2.0 d)) 2e+140) (* w0 (sqrt (- 1.0 (/ h (/ l (pow (/ (* D (* M 0.5)) d) 2.0)))))) (* w0 (sqrt (- 1.0 (* 0.25 (/ (/ (* D (* D h)) (pow (/ d M) 2.0)) l)))))))
M = abs(M);
D = abs(D);
d = abs(d);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (((M * D) / (2.0 * d)) <= 2e+140) {
tmp = w0 * sqrt((1.0 - (h / (l / pow(((D * (M * 0.5)) / d), 2.0)))));
} else {
tmp = w0 * sqrt((1.0 - (0.25 * (((D * (D * h)) / pow((d / M), 2.0)) / l))));
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: d should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
real(8) function code(w0, m, d, h, l, d_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d_1
real(8) :: tmp
if (((m * d) / (2.0d0 * d_1)) <= 2d+140) then
tmp = w0 * sqrt((1.0d0 - (h / (l / (((d * (m * 0.5d0)) / d_1) ** 2.0d0)))))
else
tmp = w0 * sqrt((1.0d0 - (0.25d0 * (((d * (d * h)) / ((d_1 / m) ** 2.0d0)) / l))))
end if
code = tmp
end function
M = Math.abs(M);
D = Math.abs(D);
d = Math.abs(d);
assert M < D;
public static double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (((M * D) / (2.0 * d)) <= 2e+140) {
tmp = w0 * Math.sqrt((1.0 - (h / (l / Math.pow(((D * (M * 0.5)) / d), 2.0)))));
} else {
tmp = w0 * Math.sqrt((1.0 - (0.25 * (((D * (D * h)) / Math.pow((d / M), 2.0)) / l))));
}
return tmp;
}
M = abs(M) D = abs(D) d = abs(d) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if ((M * D) / (2.0 * d)) <= 2e+140: tmp = w0 * math.sqrt((1.0 - (h / (l / math.pow(((D * (M * 0.5)) / d), 2.0))))) else: tmp = w0 * math.sqrt((1.0 - (0.25 * (((D * (D * h)) / math.pow((d / M), 2.0)) / l)))) return tmp
M = abs(M) D = abs(D) d = abs(d) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (Float64(Float64(M * D) / Float64(2.0 * d)) <= 2e+140) tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(h / Float64(l / (Float64(Float64(D * Float64(M * 0.5)) / d) ^ 2.0)))))); else tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(0.25 * Float64(Float64(Float64(D * Float64(D * h)) / (Float64(d / M) ^ 2.0)) / l))))); end return tmp end
M = abs(M)
D = abs(D)
d = abs(d)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if (((M * D) / (2.0 * d)) <= 2e+140)
tmp = w0 * sqrt((1.0 - (h / (l / (((D * (M * 0.5)) / d) ^ 2.0)))));
else
tmp = w0 * sqrt((1.0 - (0.25 * (((D * (D * h)) / ((d / M) ^ 2.0)) / l))));
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: d should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2e+140], N[(w0 * N[Sqrt[N[(1.0 - N[(h / N[(l / N[Power[N[(N[(D * N[(M * 0.5), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(w0 * N[Sqrt[N[(1.0 - N[(0.25 * N[(N[(N[(D * N[(D * h), $MachinePrecision]), $MachinePrecision] / N[Power[N[(d / M), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
d = |d|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{M \cdot D}{2 \cdot d} \leq 2 \cdot 10^{+140}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{h}{\frac{\ell}{{\left(\frac{D \cdot \left(M \cdot 0.5\right)}{d}\right)}^{2}}}}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{1 - 0.25 \cdot \frac{\frac{D \cdot \left(D \cdot h\right)}{{\left(\frac{d}{M}\right)}^{2}}}{\ell}}\\
\end{array}
\end{array}
if (/.f64 (*.f64 M D) (*.f64 2 d)) < 2.00000000000000012e140Initial program 84.9%
Simplified83.2%
associate-*r/88.6%
frac-times90.4%
*-commutative90.4%
clear-num90.3%
*-commutative90.3%
div-inv90.3%
associate-*l*91.2%
associate-/r*91.2%
metadata-eval91.2%
Applied egg-rr91.2%
associate-/r/91.2%
associate-*r/91.2%
*-commutative91.2%
associate-*r/91.2%
associate-*l*91.2%
Simplified91.2%
associate-*r/90.3%
Applied egg-rr90.3%
associate-*l/90.4%
*-un-lft-identity90.4%
associate-/l*91.2%
Applied egg-rr91.2%
associate-/l*92.0%
associate-/r/89.4%
associate-*l/91.2%
associate-*r*91.2%
*-commutative91.2%
*-commutative91.2%
associate-*l*91.2%
*-commutative91.2%
Simplified91.2%
if 2.00000000000000012e140 < (/.f64 (*.f64 M D) (*.f64 2 d)) Initial program 52.2%
Simplified52.2%
associate-*r/55.7%
frac-times55.7%
*-commutative55.7%
clear-num55.7%
*-commutative55.7%
div-inv55.7%
associate-*l*55.7%
associate-/r*55.7%
metadata-eval55.7%
Applied egg-rr55.7%
associate-/r/55.7%
associate-*r/55.7%
*-commutative55.7%
associate-*r/55.7%
associate-*l*55.7%
Simplified55.7%
associate-*r/55.7%
Applied egg-rr55.7%
Taylor expanded in l around 0 51.8%
*-commutative51.8%
*-commutative51.8%
associate-/r*51.8%
associate-*r/51.8%
associate-*l/51.6%
unpow251.6%
associate-*r/54.9%
unpow254.9%
associate-*r/54.9%
unpow254.9%
associate-*r/54.9%
associate-/l*54.9%
Simplified62.1%
Final simplification87.8%
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: d should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. (FPCore (w0 M D h l d) :precision binary64 (let* ((t_0 (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ h l)))) (if (<= t_0 2e-12) (* w0 (sqrt (- 1.0 t_0))) w0)))
M = abs(M);
D = abs(D);
d = abs(d);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double t_0 = pow(((M * D) / (2.0 * d)), 2.0) * (h / l);
double tmp;
if (t_0 <= 2e-12) {
tmp = w0 * sqrt((1.0 - t_0));
} else {
tmp = w0;
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: d should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
real(8) function code(w0, m, d, h, l, d_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d_1
real(8) :: t_0
real(8) :: tmp
t_0 = (((m * d) / (2.0d0 * d_1)) ** 2.0d0) * (h / l)
if (t_0 <= 2d-12) then
tmp = w0 * sqrt((1.0d0 - t_0))
else
tmp = w0
end if
code = tmp
end function
M = Math.abs(M);
D = Math.abs(D);
d = Math.abs(d);
assert M < D;
public static double code(double w0, double M, double D, double h, double l, double d) {
double t_0 = Math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l);
double tmp;
if (t_0 <= 2e-12) {
tmp = w0 * Math.sqrt((1.0 - t_0));
} else {
tmp = w0;
}
return tmp;
}
M = abs(M) D = abs(D) d = abs(d) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): t_0 = math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l) tmp = 0 if t_0 <= 2e-12: tmp = w0 * math.sqrt((1.0 - t_0)) else: tmp = w0 return tmp
M = abs(M) D = abs(D) d = abs(d) M, D = sort([M, D]) function code(w0, M, D, h, l, d) t_0 = Float64((Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0) * Float64(h / l)) tmp = 0.0 if (t_0 <= 2e-12) tmp = Float64(w0 * sqrt(Float64(1.0 - t_0))); else tmp = w0; end return tmp end
M = abs(M)
D = abs(D)
d = abs(d)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
t_0 = (((M * D) / (2.0 * d)) ^ 2.0) * (h / l);
tmp = 0.0;
if (t_0 <= 2e-12)
tmp = w0 * sqrt((1.0 - t_0));
else
tmp = w0;
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: d should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
code[w0_, M_, D_, h_, l_, d_] := Block[{t$95$0 = N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 2e-12], N[(w0 * N[Sqrt[N[(1.0 - t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], w0]]
\begin{array}{l}
M = |M|\\
D = |D|\\
d = |d|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
t_0 := {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}\\
\mathbf{if}\;t_0 \leq 2 \cdot 10^{-12}:\\
\;\;\;\;w0 \cdot \sqrt{1 - t_0}\\
\mathbf{else}:\\
\;\;\;\;w0\\
\end{array}
\end{array}
if (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (/.f64 h l)) < 1.99999999999999996e-12Initial program 88.0%
if 1.99999999999999996e-12 < (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (/.f64 h l)) Initial program 0.0%
Simplified10.0%
Taylor expanded in D around 0 71.5%
Final simplification86.7%
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: d should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
(FPCore (w0 M D h l d)
:precision binary64
(if (<= (/ h l) (- INFINITY))
(* w0 (sqrt (- 1.0 (* 0.25 (* D (/ (* D (* M (* M (/ h (* d d))))) l))))))
(if (<= (/ h l) -1e-224)
(* w0 (sqrt (- 1.0 (* (/ h l) (pow (* (/ M d) (/ D 2.0)) 2.0)))))
(* w0 (+ 1.0 (* (* D (/ (* D (* M (/ (* M (/ h d)) d))) l)) -0.125))))))M = abs(M);
D = abs(D);
d = abs(d);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if ((h / l) <= -((double) INFINITY)) {
tmp = w0 * sqrt((1.0 - (0.25 * (D * ((D * (M * (M * (h / (d * d))))) / l)))));
} else if ((h / l) <= -1e-224) {
tmp = w0 * sqrt((1.0 - ((h / l) * pow(((M / d) * (D / 2.0)), 2.0))));
} else {
tmp = w0 * (1.0 + ((D * ((D * (M * ((M * (h / d)) / d))) / l)) * -0.125));
}
return tmp;
}
M = Math.abs(M);
D = Math.abs(D);
d = Math.abs(d);
assert M < D;
public static double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if ((h / l) <= -Double.POSITIVE_INFINITY) {
tmp = w0 * Math.sqrt((1.0 - (0.25 * (D * ((D * (M * (M * (h / (d * d))))) / l)))));
} else if ((h / l) <= -1e-224) {
tmp = w0 * Math.sqrt((1.0 - ((h / l) * Math.pow(((M / d) * (D / 2.0)), 2.0))));
} else {
tmp = w0 * (1.0 + ((D * ((D * (M * ((M * (h / d)) / d))) / l)) * -0.125));
}
return tmp;
}
M = abs(M) D = abs(D) d = abs(d) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if (h / l) <= -math.inf: tmp = w0 * math.sqrt((1.0 - (0.25 * (D * ((D * (M * (M * (h / (d * d))))) / l))))) elif (h / l) <= -1e-224: tmp = w0 * math.sqrt((1.0 - ((h / l) * math.pow(((M / d) * (D / 2.0)), 2.0)))) else: tmp = w0 * (1.0 + ((D * ((D * (M * ((M * (h / d)) / d))) / l)) * -0.125)) return tmp
M = abs(M) D = abs(D) d = abs(d) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (Float64(h / l) <= Float64(-Inf)) tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(0.25 * Float64(D * Float64(Float64(D * Float64(M * Float64(M * Float64(h / Float64(d * d))))) / l)))))); elseif (Float64(h / l) <= -1e-224) tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(h / l) * (Float64(Float64(M / d) * Float64(D / 2.0)) ^ 2.0))))); else tmp = Float64(w0 * Float64(1.0 + Float64(Float64(D * Float64(Float64(D * Float64(M * Float64(Float64(M * Float64(h / d)) / d))) / l)) * -0.125))); end return tmp end
M = abs(M)
D = abs(D)
d = abs(d)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if ((h / l) <= -Inf)
tmp = w0 * sqrt((1.0 - (0.25 * (D * ((D * (M * (M * (h / (d * d))))) / l)))));
elseif ((h / l) <= -1e-224)
tmp = w0 * sqrt((1.0 - ((h / l) * (((M / d) * (D / 2.0)) ^ 2.0))));
else
tmp = w0 * (1.0 + ((D * ((D * (M * ((M * (h / d)) / d))) / l)) * -0.125));
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: d should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[N[(h / l), $MachinePrecision], (-Infinity)], N[(w0 * N[Sqrt[N[(1.0 - N[(0.25 * N[(D * N[(N[(D * N[(M * N[(M * N[(h / N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(h / l), $MachinePrecision], -1e-224], N[(w0 * N[Sqrt[N[(1.0 - N[(N[(h / l), $MachinePrecision] * N[Power[N[(N[(M / d), $MachinePrecision] * N[(D / 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(w0 * N[(1.0 + N[(N[(D * N[(N[(D * N[(M * N[(N[(M * N[(h / d), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
M = |M|\\
D = |D|\\
d = |d|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{h}{\ell} \leq -\infty:\\
\;\;\;\;w0 \cdot \sqrt{1 - 0.25 \cdot \left(D \cdot \frac{D \cdot \left(M \cdot \left(M \cdot \frac{h}{d \cdot d}\right)\right)}{\ell}\right)}\\
\mathbf{elif}\;\frac{h}{\ell} \leq -1 \cdot 10^{-224}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{h}{\ell} \cdot {\left(\frac{M}{d} \cdot \frac{D}{2}\right)}^{2}}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \left(1 + \left(D \cdot \frac{D \cdot \left(M \cdot \frac{M \cdot \frac{h}{d}}{d}\right)}{\ell}\right) \cdot -0.125\right)\\
\end{array}
\end{array}
if (/.f64 h l) < -inf.0Initial program 53.7%
Simplified49.4%
associate-*r/79.5%
frac-times83.7%
*-commutative83.7%
clear-num83.5%
*-commutative83.5%
div-inv83.5%
associate-*l*83.6%
associate-/r*83.6%
metadata-eval83.6%
Applied egg-rr83.6%
associate-/r/83.7%
associate-*r/83.7%
*-commutative83.7%
associate-*r/83.7%
associate-*l*83.7%
Simplified83.7%
Taylor expanded in l around 0 57.7%
*-commutative57.7%
times-frac53.2%
unpow253.2%
associate-*l/53.3%
unpow253.3%
unpow253.3%
times-frac61.9%
*-commutative61.9%
associate-*r*66.2%
*-commutative66.2%
*-commutative66.2%
times-frac57.6%
*-commutative57.6%
unpow257.6%
associate-/l*66.2%
associate-/l/66.5%
unpow266.5%
associate-/r/66.7%
*-commutative66.7%
Simplified66.7%
associate-*l/67.3%
Applied egg-rr75.5%
if -inf.0 < (/.f64 h l) < -1e-224Initial program 83.9%
Simplified83.1%
if -1e-224 < (/.f64 h l) Initial program 83.7%
Simplified82.0%
Taylor expanded in D around 0 51.0%
associate-*r/51.0%
*-commutative51.0%
associate-*r/51.0%
*-commutative51.0%
times-frac58.0%
unpow258.0%
*-commutative58.0%
unpow258.0%
unpow258.0%
Simplified58.0%
Taylor expanded in D around 0 51.0%
*-commutative51.0%
times-frac58.0%
unpow258.0%
associate-*l/64.0%
unpow264.0%
unpow264.0%
times-frac70.9%
*-commutative70.9%
associate-*r*78.8%
*-commutative78.8%
*-commutative78.8%
times-frac71.8%
*-commutative71.8%
unpow271.8%
associate-/l*74.5%
associate-/l/81.5%
unpow281.5%
associate-/r/81.5%
*-commutative81.5%
unpow281.5%
Simplified78.9%
Taylor expanded in M around 0 78.0%
unpow278.0%
times-frac84.9%
Simplified84.9%
associate-*l/86.7%
associate-*l/86.7%
Applied egg-rr86.7%
Final simplification84.0%
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: d should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
(FPCore (w0 M D h l d)
:precision binary64
(if (<= (/ h l) -1e+308)
(* w0 (sqrt (- 1.0 (* 0.25 (* D (/ (* D (* M (* M (/ h (* d d))))) l))))))
(if (<= (/ h l) -1e-224)
(* w0 (sqrt (- 1.0 (* (/ h l) (pow (/ D (/ 2.0 (/ M d))) 2.0)))))
(* w0 (+ 1.0 (* (* D (/ (* D (* M (/ (* M (/ h d)) d))) l)) -0.125))))))M = abs(M);
D = abs(D);
d = abs(d);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if ((h / l) <= -1e+308) {
tmp = w0 * sqrt((1.0 - (0.25 * (D * ((D * (M * (M * (h / (d * d))))) / l)))));
} else if ((h / l) <= -1e-224) {
tmp = w0 * sqrt((1.0 - ((h / l) * pow((D / (2.0 / (M / d))), 2.0))));
} else {
tmp = w0 * (1.0 + ((D * ((D * (M * ((M * (h / d)) / d))) / l)) * -0.125));
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: d should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
real(8) function code(w0, m, d, h, l, d_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d_1
real(8) :: tmp
if ((h / l) <= (-1d+308)) then
tmp = w0 * sqrt((1.0d0 - (0.25d0 * (d * ((d * (m * (m * (h / (d_1 * d_1))))) / l)))))
else if ((h / l) <= (-1d-224)) then
tmp = w0 * sqrt((1.0d0 - ((h / l) * ((d / (2.0d0 / (m / d_1))) ** 2.0d0))))
else
tmp = w0 * (1.0d0 + ((d * ((d * (m * ((m * (h / d_1)) / d_1))) / l)) * (-0.125d0)))
end if
code = tmp
end function
M = Math.abs(M);
D = Math.abs(D);
d = Math.abs(d);
assert M < D;
public static double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if ((h / l) <= -1e+308) {
tmp = w0 * Math.sqrt((1.0 - (0.25 * (D * ((D * (M * (M * (h / (d * d))))) / l)))));
} else if ((h / l) <= -1e-224) {
tmp = w0 * Math.sqrt((1.0 - ((h / l) * Math.pow((D / (2.0 / (M / d))), 2.0))));
} else {
tmp = w0 * (1.0 + ((D * ((D * (M * ((M * (h / d)) / d))) / l)) * -0.125));
}
return tmp;
}
M = abs(M) D = abs(D) d = abs(d) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if (h / l) <= -1e+308: tmp = w0 * math.sqrt((1.0 - (0.25 * (D * ((D * (M * (M * (h / (d * d))))) / l))))) elif (h / l) <= -1e-224: tmp = w0 * math.sqrt((1.0 - ((h / l) * math.pow((D / (2.0 / (M / d))), 2.0)))) else: tmp = w0 * (1.0 + ((D * ((D * (M * ((M * (h / d)) / d))) / l)) * -0.125)) return tmp
M = abs(M) D = abs(D) d = abs(d) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (Float64(h / l) <= -1e+308) tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(0.25 * Float64(D * Float64(Float64(D * Float64(M * Float64(M * Float64(h / Float64(d * d))))) / l)))))); elseif (Float64(h / l) <= -1e-224) tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(h / l) * (Float64(D / Float64(2.0 / Float64(M / d))) ^ 2.0))))); else tmp = Float64(w0 * Float64(1.0 + Float64(Float64(D * Float64(Float64(D * Float64(M * Float64(Float64(M * Float64(h / d)) / d))) / l)) * -0.125))); end return tmp end
M = abs(M)
D = abs(D)
d = abs(d)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if ((h / l) <= -1e+308)
tmp = w0 * sqrt((1.0 - (0.25 * (D * ((D * (M * (M * (h / (d * d))))) / l)))));
elseif ((h / l) <= -1e-224)
tmp = w0 * sqrt((1.0 - ((h / l) * ((D / (2.0 / (M / d))) ^ 2.0))));
else
tmp = w0 * (1.0 + ((D * ((D * (M * ((M * (h / d)) / d))) / l)) * -0.125));
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: d should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[N[(h / l), $MachinePrecision], -1e+308], N[(w0 * N[Sqrt[N[(1.0 - N[(0.25 * N[(D * N[(N[(D * N[(M * N[(M * N[(h / N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(h / l), $MachinePrecision], -1e-224], N[(w0 * N[Sqrt[N[(1.0 - N[(N[(h / l), $MachinePrecision] * N[Power[N[(D / N[(2.0 / N[(M / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(w0 * N[(1.0 + N[(N[(D * N[(N[(D * N[(M * N[(N[(M * N[(h / d), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
M = |M|\\
D = |D|\\
d = |d|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{h}{\ell} \leq -1 \cdot 10^{+308}:\\
\;\;\;\;w0 \cdot \sqrt{1 - 0.25 \cdot \left(D \cdot \frac{D \cdot \left(M \cdot \left(M \cdot \frac{h}{d \cdot d}\right)\right)}{\ell}\right)}\\
\mathbf{elif}\;\frac{h}{\ell} \leq -1 \cdot 10^{-224}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{h}{\ell} \cdot {\left(\frac{D}{\frac{2}{\frac{M}{d}}}\right)}^{2}}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \left(1 + \left(D \cdot \frac{D \cdot \left(M \cdot \frac{M \cdot \frac{h}{d}}{d}\right)}{\ell}\right) \cdot -0.125\right)\\
\end{array}
\end{array}
if (/.f64 h l) < -1e308Initial program 55.7%
Simplified51.5%
associate-*r/80.4%
frac-times84.3%
*-commutative84.3%
clear-num84.2%
*-commutative84.2%
div-inv84.1%
associate-*l*84.3%
associate-/r*84.3%
metadata-eval84.3%
Applied egg-rr84.3%
associate-/r/84.3%
associate-*r/84.3%
*-commutative84.3%
associate-*r/84.3%
associate-*l*84.3%
Simplified84.3%
Taylor expanded in l around 0 59.4%
*-commutative59.4%
times-frac51.0%
unpow251.0%
associate-*l/51.2%
unpow251.2%
unpow251.2%
times-frac59.4%
*-commutative59.4%
associate-*r*67.6%
*-commutative67.6%
*-commutative67.6%
times-frac59.4%
*-commutative59.4%
unpow259.4%
associate-/l*67.6%
associate-/l/67.9%
unpow267.9%
associate-/r/68.1%
*-commutative68.1%
Simplified68.1%
associate-*l/64.7%
Applied egg-rr76.5%
if -1e308 < (/.f64 h l) < -1e-224Initial program 83.8%
Simplified82.9%
associate-*l/82.9%
associate-/l*82.9%
Applied egg-rr82.9%
if -1e-224 < (/.f64 h l) Initial program 83.7%
Simplified82.0%
Taylor expanded in D around 0 51.0%
associate-*r/51.0%
*-commutative51.0%
associate-*r/51.0%
*-commutative51.0%
times-frac58.0%
unpow258.0%
*-commutative58.0%
unpow258.0%
unpow258.0%
Simplified58.0%
Taylor expanded in D around 0 51.0%
*-commutative51.0%
times-frac58.0%
unpow258.0%
associate-*l/64.0%
unpow264.0%
unpow264.0%
times-frac70.9%
*-commutative70.9%
associate-*r*78.8%
*-commutative78.8%
*-commutative78.8%
times-frac71.8%
*-commutative71.8%
unpow271.8%
associate-/l*74.5%
associate-/l/81.5%
unpow281.5%
associate-/r/81.5%
*-commutative81.5%
unpow281.5%
Simplified78.9%
Taylor expanded in M around 0 78.0%
unpow278.0%
times-frac84.9%
Simplified84.9%
associate-*l/86.7%
associate-*l/86.7%
Applied egg-rr86.7%
Final simplification84.0%
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: d should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. (FPCore (w0 M D h l d) :precision binary64 (if (<= (/ (* M D) (* 2.0 d)) 5e+130) (* w0 (sqrt (- 1.0 (/ h (/ l (pow (/ (* D (* M 0.5)) d) 2.0)))))) (* w0 (sqrt (- 1.0 (* (/ D (/ l D)) (* 0.25 (/ h (* (/ d M) (/ d M))))))))))
M = abs(M);
D = abs(D);
d = abs(d);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (((M * D) / (2.0 * d)) <= 5e+130) {
tmp = w0 * sqrt((1.0 - (h / (l / pow(((D * (M * 0.5)) / d), 2.0)))));
} else {
tmp = w0 * sqrt((1.0 - ((D / (l / D)) * (0.25 * (h / ((d / M) * (d / M)))))));
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: d should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
real(8) function code(w0, m, d, h, l, d_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d_1
real(8) :: tmp
if (((m * d) / (2.0d0 * d_1)) <= 5d+130) then
tmp = w0 * sqrt((1.0d0 - (h / (l / (((d * (m * 0.5d0)) / d_1) ** 2.0d0)))))
else
tmp = w0 * sqrt((1.0d0 - ((d / (l / d)) * (0.25d0 * (h / ((d_1 / m) * (d_1 / m)))))))
end if
code = tmp
end function
M = Math.abs(M);
D = Math.abs(D);
d = Math.abs(d);
assert M < D;
public static double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (((M * D) / (2.0 * d)) <= 5e+130) {
tmp = w0 * Math.sqrt((1.0 - (h / (l / Math.pow(((D * (M * 0.5)) / d), 2.0)))));
} else {
tmp = w0 * Math.sqrt((1.0 - ((D / (l / D)) * (0.25 * (h / ((d / M) * (d / M)))))));
}
return tmp;
}
M = abs(M) D = abs(D) d = abs(d) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if ((M * D) / (2.0 * d)) <= 5e+130: tmp = w0 * math.sqrt((1.0 - (h / (l / math.pow(((D * (M * 0.5)) / d), 2.0))))) else: tmp = w0 * math.sqrt((1.0 - ((D / (l / D)) * (0.25 * (h / ((d / M) * (d / M))))))) return tmp
M = abs(M) D = abs(D) d = abs(d) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (Float64(Float64(M * D) / Float64(2.0 * d)) <= 5e+130) tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(h / Float64(l / (Float64(Float64(D * Float64(M * 0.5)) / d) ^ 2.0)))))); else tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(D / Float64(l / D)) * Float64(0.25 * Float64(h / Float64(Float64(d / M) * Float64(d / M)))))))); end return tmp end
M = abs(M)
D = abs(D)
d = abs(d)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if (((M * D) / (2.0 * d)) <= 5e+130)
tmp = w0 * sqrt((1.0 - (h / (l / (((D * (M * 0.5)) / d) ^ 2.0)))));
else
tmp = w0 * sqrt((1.0 - ((D / (l / D)) * (0.25 * (h / ((d / M) * (d / M)))))));
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: d should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 5e+130], N[(w0 * N[Sqrt[N[(1.0 - N[(h / N[(l / N[Power[N[(N[(D * N[(M * 0.5), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(w0 * N[Sqrt[N[(1.0 - N[(N[(D / N[(l / D), $MachinePrecision]), $MachinePrecision] * N[(0.25 * N[(h / N[(N[(d / M), $MachinePrecision] * N[(d / M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
d = |d|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{M \cdot D}{2 \cdot d} \leq 5 \cdot 10^{+130}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{h}{\frac{\ell}{{\left(\frac{D \cdot \left(M \cdot 0.5\right)}{d}\right)}^{2}}}}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{D}{\frac{\ell}{D}} \cdot \left(0.25 \cdot \frac{h}{\frac{d}{M} \cdot \frac{d}{M}}\right)}\\
\end{array}
\end{array}
if (/.f64 (*.f64 M D) (*.f64 2 d)) < 4.9999999999999996e130Initial program 84.9%
Simplified83.1%
associate-*r/88.5%
frac-times90.3%
*-commutative90.3%
clear-num90.3%
*-commutative90.3%
div-inv90.3%
associate-*l*91.1%
associate-/r*91.1%
metadata-eval91.1%
Applied egg-rr91.1%
associate-/r/91.1%
associate-*r/91.1%
*-commutative91.1%
associate-*r/91.1%
associate-*l*91.1%
Simplified91.1%
associate-*r/90.3%
Applied egg-rr90.3%
associate-*l/90.3%
*-un-lft-identity90.3%
associate-/l*91.1%
Applied egg-rr91.1%
associate-/l*92.0%
associate-/r/89.4%
associate-*l/91.1%
associate-*r*91.1%
*-commutative91.1%
*-commutative91.1%
associate-*l*91.1%
*-commutative91.1%
Simplified91.1%
if 4.9999999999999996e130 < (/.f64 (*.f64 M D) (*.f64 2 d)) Initial program 53.8%
Simplified53.8%
Taylor expanded in D around 0 50.2%
associate-*r/50.2%
*-commutative50.2%
associate-*r/50.2%
*-commutative50.2%
times-frac50.0%
associate-*l*50.0%
unpow250.0%
associate-/l*53.3%
associate-/l*53.3%
unpow253.3%
unpow253.3%
Simplified53.3%
Taylor expanded in d around 0 53.3%
unpow253.3%
unpow253.3%
times-frac60.2%
Simplified60.2%
Final simplification87.4%
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: d should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
(FPCore (w0 M D h l d)
:precision binary64
(if (<= d 7.2e-116)
(* w0 (+ 1.0 (* -0.125 (* D (* (/ D l) (/ h (pow (/ d M) 2.0)))))))
(if (<= d 1.4e+119)
(* w0 (sqrt (- 1.0 (* 0.25 (* D (* (/ D l) (* M (/ (* M h) (* d d)))))))))
(* w0 (+ 1.0 (* (* D (/ (* D (* M (/ (* M (/ h d)) d))) l)) -0.125))))))M = abs(M);
D = abs(D);
d = abs(d);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (d <= 7.2e-116) {
tmp = w0 * (1.0 + (-0.125 * (D * ((D / l) * (h / pow((d / M), 2.0))))));
} else if (d <= 1.4e+119) {
tmp = w0 * sqrt((1.0 - (0.25 * (D * ((D / l) * (M * ((M * h) / (d * d))))))));
} else {
tmp = w0 * (1.0 + ((D * ((D * (M * ((M * (h / d)) / d))) / l)) * -0.125));
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: d should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
real(8) function code(w0, m, d, h, l, d_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d_1
real(8) :: tmp
if (d_1 <= 7.2d-116) then
tmp = w0 * (1.0d0 + ((-0.125d0) * (d * ((d / l) * (h / ((d_1 / m) ** 2.0d0))))))
else if (d_1 <= 1.4d+119) then
tmp = w0 * sqrt((1.0d0 - (0.25d0 * (d * ((d / l) * (m * ((m * h) / (d_1 * d_1))))))))
else
tmp = w0 * (1.0d0 + ((d * ((d * (m * ((m * (h / d_1)) / d_1))) / l)) * (-0.125d0)))
end if
code = tmp
end function
M = Math.abs(M);
D = Math.abs(D);
d = Math.abs(d);
assert M < D;
public static double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (d <= 7.2e-116) {
tmp = w0 * (1.0 + (-0.125 * (D * ((D / l) * (h / Math.pow((d / M), 2.0))))));
} else if (d <= 1.4e+119) {
tmp = w0 * Math.sqrt((1.0 - (0.25 * (D * ((D / l) * (M * ((M * h) / (d * d))))))));
} else {
tmp = w0 * (1.0 + ((D * ((D * (M * ((M * (h / d)) / d))) / l)) * -0.125));
}
return tmp;
}
M = abs(M) D = abs(D) d = abs(d) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if d <= 7.2e-116: tmp = w0 * (1.0 + (-0.125 * (D * ((D / l) * (h / math.pow((d / M), 2.0)))))) elif d <= 1.4e+119: tmp = w0 * math.sqrt((1.0 - (0.25 * (D * ((D / l) * (M * ((M * h) / (d * d)))))))) else: tmp = w0 * (1.0 + ((D * ((D * (M * ((M * (h / d)) / d))) / l)) * -0.125)) return tmp
M = abs(M) D = abs(D) d = abs(d) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (d <= 7.2e-116) tmp = Float64(w0 * Float64(1.0 + Float64(-0.125 * Float64(D * Float64(Float64(D / l) * Float64(h / (Float64(d / M) ^ 2.0))))))); elseif (d <= 1.4e+119) tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(0.25 * Float64(D * Float64(Float64(D / l) * Float64(M * Float64(Float64(M * h) / Float64(d * d))))))))); else tmp = Float64(w0 * Float64(1.0 + Float64(Float64(D * Float64(Float64(D * Float64(M * Float64(Float64(M * Float64(h / d)) / d))) / l)) * -0.125))); end return tmp end
M = abs(M)
D = abs(D)
d = abs(d)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if (d <= 7.2e-116)
tmp = w0 * (1.0 + (-0.125 * (D * ((D / l) * (h / ((d / M) ^ 2.0))))));
elseif (d <= 1.4e+119)
tmp = w0 * sqrt((1.0 - (0.25 * (D * ((D / l) * (M * ((M * h) / (d * d))))))));
else
tmp = w0 * (1.0 + ((D * ((D * (M * ((M * (h / d)) / d))) / l)) * -0.125));
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: d should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[d, 7.2e-116], N[(w0 * N[(1.0 + N[(-0.125 * N[(D * N[(N[(D / l), $MachinePrecision] * N[(h / N[Power[N[(d / M), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 1.4e+119], N[(w0 * N[Sqrt[N[(1.0 - N[(0.25 * N[(D * N[(N[(D / l), $MachinePrecision] * N[(M * N[(N[(M * h), $MachinePrecision] / N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(w0 * N[(1.0 + N[(N[(D * N[(N[(D * N[(M * N[(N[(M * N[(h / d), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
M = |M|\\
D = |D|\\
d = |d|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;d \leq 7.2 \cdot 10^{-116}:\\
\;\;\;\;w0 \cdot \left(1 + -0.125 \cdot \left(D \cdot \left(\frac{D}{\ell} \cdot \frac{h}{{\left(\frac{d}{M}\right)}^{2}}\right)\right)\right)\\
\mathbf{elif}\;d \leq 1.4 \cdot 10^{+119}:\\
\;\;\;\;w0 \cdot \sqrt{1 - 0.25 \cdot \left(D \cdot \left(\frac{D}{\ell} \cdot \left(M \cdot \frac{M \cdot h}{d \cdot d}\right)\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \left(1 + \left(D \cdot \frac{D \cdot \left(M \cdot \frac{M \cdot \frac{h}{d}}{d}\right)}{\ell}\right) \cdot -0.125\right)\\
\end{array}
\end{array}
if d < 7.19999999999999951e-116Initial program 81.3%
Simplified80.1%
Taylor expanded in D around 0 48.4%
associate-*r/48.4%
*-commutative48.4%
associate-*r/48.4%
*-commutative48.4%
times-frac52.7%
unpow252.7%
*-commutative52.7%
unpow252.7%
unpow252.7%
Simplified52.7%
Taylor expanded in D around 0 48.4%
*-commutative48.4%
times-frac52.7%
unpow252.7%
associate-*l/56.5%
unpow256.5%
unpow256.5%
times-frac62.2%
*-commutative62.2%
associate-*r*67.3%
*-commutative67.3%
*-commutative67.3%
times-frac61.6%
*-commutative61.6%
unpow261.6%
associate-/l*62.2%
associate-/l/67.5%
unpow267.5%
associate-/r/68.1%
*-commutative68.1%
unpow268.1%
Simplified66.9%
Taylor expanded in D around 0 58.0%
*-commutative58.0%
times-frac61.6%
associate-/l*62.2%
unpow262.2%
unpow262.2%
times-frac72.4%
unpow272.4%
Simplified72.4%
if 7.19999999999999951e-116 < d < 1.40000000000000007e119Initial program 76.6%
Simplified72.2%
associate-*r/78.8%
frac-times83.2%
*-commutative83.2%
clear-num83.1%
*-commutative83.1%
div-inv83.1%
associate-*l*83.1%
associate-/r*83.1%
metadata-eval83.1%
Applied egg-rr83.1%
associate-/r/83.2%
associate-*r/83.2%
*-commutative83.2%
associate-*r/83.2%
associate-*l*83.2%
Simplified83.2%
Taylor expanded in l around 0 58.9%
*-commutative58.9%
times-frac61.2%
unpow261.2%
associate-*l/61.2%
unpow261.2%
unpow261.2%
times-frac61.1%
*-commutative61.1%
associate-*r*63.7%
*-commutative63.7%
*-commutative63.7%
times-frac63.7%
*-commutative63.7%
unpow263.7%
associate-/l*65.9%
associate-/l/65.9%
unpow265.9%
associate-/r/68.1%
*-commutative68.1%
Simplified65.7%
associate-*r/67.9%
Applied egg-rr67.9%
if 1.40000000000000007e119 < d Initial program 84.4%
Simplified84.6%
Taylor expanded in D around 0 52.3%
associate-*r/52.3%
*-commutative52.3%
associate-*r/52.3%
*-commutative52.3%
times-frac50.1%
unpow250.1%
*-commutative50.1%
unpow250.1%
unpow250.1%
Simplified50.1%
Taylor expanded in D around 0 52.3%
*-commutative52.3%
times-frac50.1%
unpow250.1%
associate-*l/52.1%
unpow252.1%
unpow252.1%
times-frac58.6%
*-commutative58.6%
associate-*r*63.0%
*-commutative63.0%
*-commutative63.0%
times-frac56.4%
*-commutative56.4%
unpow256.4%
associate-/l*62.4%
associate-/l/77.0%
unpow277.0%
associate-/r/77.0%
*-commutative77.0%
unpow277.0%
Simplified77.0%
Taylor expanded in M around 0 72.9%
unpow272.9%
times-frac77.2%
Simplified77.2%
associate-*l/83.4%
associate-*l/83.4%
Applied egg-rr83.4%
Final simplification73.8%
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: d should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. (FPCore (w0 M D h l d) :precision binary64 (if (<= d 7.5e-99) (* w0 (+ 1.0 (* -0.125 (* D (* (/ D l) (/ h (pow (/ d M) 2.0))))))) (* w0 (sqrt (- 1.0 (* 0.25 (* D (/ (* D (* M (* M (/ h (* d d))))) l))))))))
M = abs(M);
D = abs(D);
d = abs(d);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (d <= 7.5e-99) {
tmp = w0 * (1.0 + (-0.125 * (D * ((D / l) * (h / pow((d / M), 2.0))))));
} else {
tmp = w0 * sqrt((1.0 - (0.25 * (D * ((D * (M * (M * (h / (d * d))))) / l)))));
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: d should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
real(8) function code(w0, m, d, h, l, d_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d_1
real(8) :: tmp
if (d_1 <= 7.5d-99) then
tmp = w0 * (1.0d0 + ((-0.125d0) * (d * ((d / l) * (h / ((d_1 / m) ** 2.0d0))))))
else
tmp = w0 * sqrt((1.0d0 - (0.25d0 * (d * ((d * (m * (m * (h / (d_1 * d_1))))) / l)))))
end if
code = tmp
end function
M = Math.abs(M);
D = Math.abs(D);
d = Math.abs(d);
assert M < D;
public static double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (d <= 7.5e-99) {
tmp = w0 * (1.0 + (-0.125 * (D * ((D / l) * (h / Math.pow((d / M), 2.0))))));
} else {
tmp = w0 * Math.sqrt((1.0 - (0.25 * (D * ((D * (M * (M * (h / (d * d))))) / l)))));
}
return tmp;
}
M = abs(M) D = abs(D) d = abs(d) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if d <= 7.5e-99: tmp = w0 * (1.0 + (-0.125 * (D * ((D / l) * (h / math.pow((d / M), 2.0)))))) else: tmp = w0 * math.sqrt((1.0 - (0.25 * (D * ((D * (M * (M * (h / (d * d))))) / l))))) return tmp
M = abs(M) D = abs(D) d = abs(d) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (d <= 7.5e-99) tmp = Float64(w0 * Float64(1.0 + Float64(-0.125 * Float64(D * Float64(Float64(D / l) * Float64(h / (Float64(d / M) ^ 2.0))))))); else tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(0.25 * Float64(D * Float64(Float64(D * Float64(M * Float64(M * Float64(h / Float64(d * d))))) / l)))))); end return tmp end
M = abs(M)
D = abs(D)
d = abs(d)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if (d <= 7.5e-99)
tmp = w0 * (1.0 + (-0.125 * (D * ((D / l) * (h / ((d / M) ^ 2.0))))));
else
tmp = w0 * sqrt((1.0 - (0.25 * (D * ((D * (M * (M * (h / (d * d))))) / l)))));
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: d should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[d, 7.5e-99], N[(w0 * N[(1.0 + N[(-0.125 * N[(D * N[(N[(D / l), $MachinePrecision] * N[(h / N[Power[N[(d / M), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(w0 * N[Sqrt[N[(1.0 - N[(0.25 * N[(D * N[(N[(D * N[(M * N[(M * N[(h / N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
d = |d|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;d \leq 7.5 \cdot 10^{-99}:\\
\;\;\;\;w0 \cdot \left(1 + -0.125 \cdot \left(D \cdot \left(\frac{D}{\ell} \cdot \frac{h}{{\left(\frac{d}{M}\right)}^{2}}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{1 - 0.25 \cdot \left(D \cdot \frac{D \cdot \left(M \cdot \left(M \cdot \frac{h}{d \cdot d}\right)\right)}{\ell}\right)}\\
\end{array}
\end{array}
if d < 7.4999999999999999e-99Initial program 81.1%
Simplified79.8%
Taylor expanded in D around 0 48.1%
associate-*r/48.1%
*-commutative48.1%
associate-*r/48.1%
*-commutative48.1%
times-frac53.0%
unpow253.0%
*-commutative53.0%
unpow253.0%
unpow253.0%
Simplified53.0%
Taylor expanded in D around 0 48.1%
*-commutative48.1%
times-frac53.0%
unpow253.0%
associate-*l/56.7%
unpow256.7%
unpow256.7%
times-frac61.6%
*-commutative61.6%
associate-*r*66.7%
*-commutative66.7%
*-commutative66.7%
times-frac61.7%
*-commutative61.7%
unpow261.7%
associate-/l*62.3%
associate-/l/67.5%
unpow267.5%
associate-/r/68.1%
*-commutative68.1%
unpow268.1%
Simplified66.3%
Taylor expanded in D around 0 57.6%
*-commutative57.6%
times-frac61.7%
associate-/l*62.3%
unpow262.3%
unpow262.3%
times-frac72.3%
unpow272.3%
Simplified72.3%
if 7.4999999999999999e-99 < d Initial program 81.2%
Simplified79.1%
associate-*r/84.5%
frac-times86.7%
*-commutative86.7%
clear-num86.7%
*-commutative86.7%
div-inv86.7%
associate-*l*87.7%
associate-/r*87.7%
metadata-eval87.7%
Applied egg-rr87.7%
associate-/r/87.7%
associate-*r/87.7%
*-commutative87.7%
associate-*r/87.7%
associate-*l*87.7%
Simplified87.7%
Taylor expanded in l around 0 56.1%
*-commutative56.1%
times-frac55.0%
unpow255.0%
associate-*l/56.1%
unpow256.1%
unpow256.1%
times-frac60.7%
*-commutative60.7%
associate-*r*64.2%
*-commutative64.2%
*-commutative64.2%
times-frac59.6%
*-commutative59.6%
unpow259.6%
associate-/l*63.9%
associate-/l/72.8%
unpow272.8%
associate-/r/73.9%
*-commutative73.9%
Simplified73.8%
associate-*l/73.4%
Applied egg-rr78.3%
Final simplification74.4%
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: d should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. (FPCore (w0 M D h l d) :precision binary64 (if (<= d 1.4e-90) (* w0 (sqrt (- 1.0 (* (/ D (/ l D)) (* 0.25 (/ h (* (/ d M) (/ d M)))))))) (* w0 (sqrt (- 1.0 (* 0.25 (* D (/ (* D (* M (* M (/ h (* d d))))) l))))))))
M = abs(M);
D = abs(D);
d = abs(d);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (d <= 1.4e-90) {
tmp = w0 * sqrt((1.0 - ((D / (l / D)) * (0.25 * (h / ((d / M) * (d / M)))))));
} else {
tmp = w0 * sqrt((1.0 - (0.25 * (D * ((D * (M * (M * (h / (d * d))))) / l)))));
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: d should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
real(8) function code(w0, m, d, h, l, d_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d_1
real(8) :: tmp
if (d_1 <= 1.4d-90) then
tmp = w0 * sqrt((1.0d0 - ((d / (l / d)) * (0.25d0 * (h / ((d_1 / m) * (d_1 / m)))))))
else
tmp = w0 * sqrt((1.0d0 - (0.25d0 * (d * ((d * (m * (m * (h / (d_1 * d_1))))) / l)))))
end if
code = tmp
end function
M = Math.abs(M);
D = Math.abs(D);
d = Math.abs(d);
assert M < D;
public static double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (d <= 1.4e-90) {
tmp = w0 * Math.sqrt((1.0 - ((D / (l / D)) * (0.25 * (h / ((d / M) * (d / M)))))));
} else {
tmp = w0 * Math.sqrt((1.0 - (0.25 * (D * ((D * (M * (M * (h / (d * d))))) / l)))));
}
return tmp;
}
M = abs(M) D = abs(D) d = abs(d) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if d <= 1.4e-90: tmp = w0 * math.sqrt((1.0 - ((D / (l / D)) * (0.25 * (h / ((d / M) * (d / M))))))) else: tmp = w0 * math.sqrt((1.0 - (0.25 * (D * ((D * (M * (M * (h / (d * d))))) / l))))) return tmp
M = abs(M) D = abs(D) d = abs(d) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (d <= 1.4e-90) tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(D / Float64(l / D)) * Float64(0.25 * Float64(h / Float64(Float64(d / M) * Float64(d / M)))))))); else tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(0.25 * Float64(D * Float64(Float64(D * Float64(M * Float64(M * Float64(h / Float64(d * d))))) / l)))))); end return tmp end
M = abs(M)
D = abs(D)
d = abs(d)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if (d <= 1.4e-90)
tmp = w0 * sqrt((1.0 - ((D / (l / D)) * (0.25 * (h / ((d / M) * (d / M)))))));
else
tmp = w0 * sqrt((1.0 - (0.25 * (D * ((D * (M * (M * (h / (d * d))))) / l)))));
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: d should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[d, 1.4e-90], N[(w0 * N[Sqrt[N[(1.0 - N[(N[(D / N[(l / D), $MachinePrecision]), $MachinePrecision] * N[(0.25 * N[(h / N[(N[(d / M), $MachinePrecision] * N[(d / M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(w0 * N[Sqrt[N[(1.0 - N[(0.25 * N[(D * N[(N[(D * N[(M * N[(M * N[(h / N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
d = |d|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;d \leq 1.4 \cdot 10^{-90}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{D}{\frac{\ell}{D}} \cdot \left(0.25 \cdot \frac{h}{\frac{d}{M} \cdot \frac{d}{M}}\right)}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{1 - 0.25 \cdot \left(D \cdot \frac{D \cdot \left(M \cdot \left(M \cdot \frac{h}{d \cdot d}\right)\right)}{\ell}\right)}\\
\end{array}
\end{array}
if d < 1.3999999999999999e-90Initial program 80.4%
Simplified78.6%
Taylor expanded in D around 0 48.1%
associate-*r/48.1%
*-commutative48.1%
associate-*r/48.1%
*-commutative48.1%
times-frac52.9%
associate-*l*52.9%
unpow252.9%
associate-/l*57.1%
associate-/l*57.1%
unpow257.1%
unpow257.1%
Simplified57.1%
Taylor expanded in d around 0 57.1%
unpow257.1%
unpow257.1%
times-frac68.5%
Simplified68.5%
if 1.3999999999999999e-90 < d Initial program 82.5%
Simplified81.5%
associate-*r/87.2%
frac-times88.3%
*-commutative88.3%
clear-num88.3%
*-commutative88.3%
div-inv88.3%
associate-*l*89.3%
associate-/r*89.3%
metadata-eval89.3%
Applied egg-rr89.3%
associate-/r/89.3%
associate-*r/89.3%
*-commutative89.3%
associate-*r/89.3%
associate-*l*89.3%
Simplified89.3%
Taylor expanded in l around 0 58.6%
*-commutative58.6%
times-frac56.3%
unpow256.3%
associate-*l/57.4%
unpow257.4%
unpow257.4%
times-frac62.2%
*-commutative62.2%
associate-*r*66.0%
*-commutative66.0%
*-commutative66.0%
times-frac61.1%
*-commutative61.1%
unpow261.1%
associate-/l*65.6%
associate-/l/74.9%
unpow274.9%
associate-/r/76.1%
*-commutative76.1%
Simplified76.0%
associate-*l/75.5%
Applied egg-rr80.7%
Final simplification72.7%
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: d should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. (FPCore (w0 M D h l d) :precision binary64 (if (<= M 1.25e-87) w0 (* w0 (+ 1.0 (* -0.125 (* D (* (* M (* M (/ h (* d d)))) (/ D l))))))))
M = abs(M);
D = abs(D);
d = abs(d);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (M <= 1.25e-87) {
tmp = w0;
} else {
tmp = w0 * (1.0 + (-0.125 * (D * ((M * (M * (h / (d * d)))) * (D / l)))));
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: d should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
real(8) function code(w0, m, d, h, l, d_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d_1
real(8) :: tmp
if (m <= 1.25d-87) then
tmp = w0
else
tmp = w0 * (1.0d0 + ((-0.125d0) * (d * ((m * (m * (h / (d_1 * d_1)))) * (d / l)))))
end if
code = tmp
end function
M = Math.abs(M);
D = Math.abs(D);
d = Math.abs(d);
assert M < D;
public static double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (M <= 1.25e-87) {
tmp = w0;
} else {
tmp = w0 * (1.0 + (-0.125 * (D * ((M * (M * (h / (d * d)))) * (D / l)))));
}
return tmp;
}
M = abs(M) D = abs(D) d = abs(d) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if M <= 1.25e-87: tmp = w0 else: tmp = w0 * (1.0 + (-0.125 * (D * ((M * (M * (h / (d * d)))) * (D / l))))) return tmp
M = abs(M) D = abs(D) d = abs(d) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (M <= 1.25e-87) tmp = w0; else tmp = Float64(w0 * Float64(1.0 + Float64(-0.125 * Float64(D * Float64(Float64(M * Float64(M * Float64(h / Float64(d * d)))) * Float64(D / l)))))); end return tmp end
M = abs(M)
D = abs(D)
d = abs(d)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if (M <= 1.25e-87)
tmp = w0;
else
tmp = w0 * (1.0 + (-0.125 * (D * ((M * (M * (h / (d * d)))) * (D / l)))));
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: d should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[M, 1.25e-87], w0, N[(w0 * N[(1.0 + N[(-0.125 * N[(D * N[(N[(M * N[(M * N[(h / N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(D / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
d = |d|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;M \leq 1.25 \cdot 10^{-87}:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \left(1 + -0.125 \cdot \left(D \cdot \left(\left(M \cdot \left(M \cdot \frac{h}{d \cdot d}\right)\right) \cdot \frac{D}{\ell}\right)\right)\right)\\
\end{array}
\end{array}
if M < 1.25000000000000011e-87Initial program 82.7%
Simplified81.0%
Taylor expanded in D around 0 71.2%
if 1.25000000000000011e-87 < M Initial program 77.6%
Simplified76.4%
Taylor expanded in D around 0 44.0%
associate-*r/44.0%
*-commutative44.0%
associate-*r/44.0%
*-commutative44.0%
times-frac46.5%
unpow246.5%
*-commutative46.5%
unpow246.5%
unpow246.5%
Simplified46.5%
Taylor expanded in D around 0 44.0%
*-commutative44.0%
times-frac46.5%
unpow246.5%
associate-*l/50.2%
unpow250.2%
unpow250.2%
times-frac53.1%
*-commutative53.1%
associate-*r*57.0%
*-commutative57.0%
*-commutative57.0%
times-frac54.0%
*-commutative54.0%
unpow254.0%
associate-/l*55.3%
associate-/l/67.8%
unpow267.8%
associate-/r/70.3%
*-commutative70.3%
unpow270.3%
Simplified69.0%
Final simplification70.5%
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: d should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. (FPCore (w0 M D h l d) :precision binary64 (if (<= d 8e+125) (* w0 (+ 1.0 (* -0.125 (* D (* (/ D l) (* M (* (/ M d) (/ h d)))))))) w0))
M = abs(M);
D = abs(D);
d = abs(d);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (d <= 8e+125) {
tmp = w0 * (1.0 + (-0.125 * (D * ((D / l) * (M * ((M / d) * (h / d)))))));
} else {
tmp = w0;
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: d should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
real(8) function code(w0, m, d, h, l, d_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d_1
real(8) :: tmp
if (d_1 <= 8d+125) then
tmp = w0 * (1.0d0 + ((-0.125d0) * (d * ((d / l) * (m * ((m / d_1) * (h / d_1)))))))
else
tmp = w0
end if
code = tmp
end function
M = Math.abs(M);
D = Math.abs(D);
d = Math.abs(d);
assert M < D;
public static double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (d <= 8e+125) {
tmp = w0 * (1.0 + (-0.125 * (D * ((D / l) * (M * ((M / d) * (h / d)))))));
} else {
tmp = w0;
}
return tmp;
}
M = abs(M) D = abs(D) d = abs(d) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if d <= 8e+125: tmp = w0 * (1.0 + (-0.125 * (D * ((D / l) * (M * ((M / d) * (h / d))))))) else: tmp = w0 return tmp
M = abs(M) D = abs(D) d = abs(d) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (d <= 8e+125) tmp = Float64(w0 * Float64(1.0 + Float64(-0.125 * Float64(D * Float64(Float64(D / l) * Float64(M * Float64(Float64(M / d) * Float64(h / d)))))))); else tmp = w0; end return tmp end
M = abs(M)
D = abs(D)
d = abs(d)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if (d <= 8e+125)
tmp = w0 * (1.0 + (-0.125 * (D * ((D / l) * (M * ((M / d) * (h / d)))))));
else
tmp = w0;
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: d should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[d, 8e+125], N[(w0 * N[(1.0 + N[(-0.125 * N[(D * N[(N[(D / l), $MachinePrecision] * N[(M * N[(N[(M / d), $MachinePrecision] * N[(h / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], w0]
\begin{array}{l}
M = |M|\\
D = |D|\\
d = |d|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;d \leq 8 \cdot 10^{+125}:\\
\;\;\;\;w0 \cdot \left(1 + -0.125 \cdot \left(D \cdot \left(\frac{D}{\ell} \cdot \left(M \cdot \left(\frac{M}{d} \cdot \frac{h}{d}\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;w0\\
\end{array}
\end{array}
if d < 7.9999999999999994e125Initial program 80.3%
Simplified78.4%
Taylor expanded in D around 0 49.8%
associate-*r/49.8%
*-commutative49.8%
associate-*r/49.8%
*-commutative49.8%
times-frac54.1%
unpow254.1%
*-commutative54.1%
unpow254.1%
unpow254.1%
Simplified54.1%
Taylor expanded in D around 0 49.8%
*-commutative49.8%
times-frac54.1%
unpow254.1%
associate-*l/57.1%
unpow257.1%
unpow257.1%
times-frac61.1%
*-commutative61.1%
associate-*r*65.6%
*-commutative65.6%
*-commutative65.6%
times-frac61.6%
*-commutative61.6%
unpow261.6%
associate-/l*62.2%
associate-/l/66.3%
unpow266.3%
associate-/r/67.2%
*-commutative67.2%
unpow267.2%
Simplified65.3%
Taylor expanded in M around 0 64.7%
unpow264.7%
times-frac70.1%
Simplified70.1%
if 7.9999999999999994e125 < d Initial program 84.4%
Simplified84.6%
Taylor expanded in D around 0 83.3%
Final simplification72.7%
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: d should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. (FPCore (w0 M D h l d) :precision binary64 (if (<= M 3.5e-141) w0 (* w0 (+ 1.0 (* (* D (/ (* D (* M (* M (/ h (* d d))))) l)) -0.125)))))
M = abs(M);
D = abs(D);
d = abs(d);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (M <= 3.5e-141) {
tmp = w0;
} else {
tmp = w0 * (1.0 + ((D * ((D * (M * (M * (h / (d * d))))) / l)) * -0.125));
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: d should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
real(8) function code(w0, m, d, h, l, d_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d_1
real(8) :: tmp
if (m <= 3.5d-141) then
tmp = w0
else
tmp = w0 * (1.0d0 + ((d * ((d * (m * (m * (h / (d_1 * d_1))))) / l)) * (-0.125d0)))
end if
code = tmp
end function
M = Math.abs(M);
D = Math.abs(D);
d = Math.abs(d);
assert M < D;
public static double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (M <= 3.5e-141) {
tmp = w0;
} else {
tmp = w0 * (1.0 + ((D * ((D * (M * (M * (h / (d * d))))) / l)) * -0.125));
}
return tmp;
}
M = abs(M) D = abs(D) d = abs(d) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if M <= 3.5e-141: tmp = w0 else: tmp = w0 * (1.0 + ((D * ((D * (M * (M * (h / (d * d))))) / l)) * -0.125)) return tmp
M = abs(M) D = abs(D) d = abs(d) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (M <= 3.5e-141) tmp = w0; else tmp = Float64(w0 * Float64(1.0 + Float64(Float64(D * Float64(Float64(D * Float64(M * Float64(M * Float64(h / Float64(d * d))))) / l)) * -0.125))); end return tmp end
M = abs(M)
D = abs(D)
d = abs(d)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if (M <= 3.5e-141)
tmp = w0;
else
tmp = w0 * (1.0 + ((D * ((D * (M * (M * (h / (d * d))))) / l)) * -0.125));
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: d should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[M, 3.5e-141], w0, N[(w0 * N[(1.0 + N[(N[(D * N[(N[(D * N[(M * N[(M * N[(h / N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
d = |d|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;M \leq 3.5 \cdot 10^{-141}:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \left(1 + \left(D \cdot \frac{D \cdot \left(M \cdot \left(M \cdot \frac{h}{d \cdot d}\right)\right)}{\ell}\right) \cdot -0.125\right)\\
\end{array}
\end{array}
if M < 3.5000000000000003e-141Initial program 81.7%
Simplified79.9%
Taylor expanded in D around 0 70.0%
if 3.5000000000000003e-141 < M Initial program 80.1%
Simplified79.0%
Taylor expanded in D around 0 48.0%
associate-*r/48.0%
*-commutative48.0%
associate-*r/48.0%
*-commutative48.0%
times-frac50.2%
unpow250.2%
*-commutative50.2%
unpow250.2%
unpow250.2%
Simplified50.2%
Taylor expanded in D around 0 48.0%
*-commutative48.0%
times-frac50.2%
unpow250.2%
associate-*l/53.5%
unpow253.5%
unpow253.5%
times-frac57.3%
*-commutative57.3%
associate-*r*60.7%
*-commutative60.7%
*-commutative60.7%
times-frac56.9%
*-commutative56.9%
unpow256.9%
associate-/l*58.0%
associate-/l/69.2%
unpow269.2%
associate-/r/71.4%
*-commutative71.4%
unpow271.4%
Simplified70.3%
associate-*l/71.7%
Applied egg-rr71.7%
Final simplification70.6%
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: d should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. (FPCore (w0 M D h l d) :precision binary64 (if (<= M 9e+51) w0 (* -0.125 (* (/ (* D D) (* d d)) (/ (* w0 (* h (* M M))) l)))))
M = abs(M);
D = abs(D);
d = abs(d);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (M <= 9e+51) {
tmp = w0;
} else {
tmp = -0.125 * (((D * D) / (d * d)) * ((w0 * (h * (M * M))) / l));
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: d should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
real(8) function code(w0, m, d, h, l, d_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d_1
real(8) :: tmp
if (m <= 9d+51) then
tmp = w0
else
tmp = (-0.125d0) * (((d * d) / (d_1 * d_1)) * ((w0 * (h * (m * m))) / l))
end if
code = tmp
end function
M = Math.abs(M);
D = Math.abs(D);
d = Math.abs(d);
assert M < D;
public static double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (M <= 9e+51) {
tmp = w0;
} else {
tmp = -0.125 * (((D * D) / (d * d)) * ((w0 * (h * (M * M))) / l));
}
return tmp;
}
M = abs(M) D = abs(D) d = abs(d) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if M <= 9e+51: tmp = w0 else: tmp = -0.125 * (((D * D) / (d * d)) * ((w0 * (h * (M * M))) / l)) return tmp
M = abs(M) D = abs(D) d = abs(d) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (M <= 9e+51) tmp = w0; else tmp = Float64(-0.125 * Float64(Float64(Float64(D * D) / Float64(d * d)) * Float64(Float64(w0 * Float64(h * Float64(M * M))) / l))); end return tmp end
M = abs(M)
D = abs(D)
d = abs(d)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if (M <= 9e+51)
tmp = w0;
else
tmp = -0.125 * (((D * D) / (d * d)) * ((w0 * (h * (M * M))) / l));
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: d should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[M, 9e+51], w0, N[(-0.125 * N[(N[(N[(D * D), $MachinePrecision] / N[(d * d), $MachinePrecision]), $MachinePrecision] * N[(N[(w0 * N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
d = |d|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;M \leq 9 \cdot 10^{+51}:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;-0.125 \cdot \left(\frac{D \cdot D}{d \cdot d} \cdot \frac{w0 \cdot \left(h \cdot \left(M \cdot M\right)\right)}{\ell}\right)\\
\end{array}
\end{array}
if M < 8.9999999999999999e51Initial program 82.9%
Simplified81.5%
Taylor expanded in D around 0 70.8%
if 8.9999999999999999e51 < M Initial program 73.7%
Simplified71.8%
Taylor expanded in D around 0 34.1%
associate-*r/34.1%
*-commutative34.1%
associate-*r/34.1%
*-commutative34.1%
times-frac34.1%
unpow234.1%
*-commutative34.1%
unpow234.1%
unpow234.1%
Simplified34.1%
Taylor expanded in D around 0 34.1%
*-commutative34.1%
times-frac34.1%
unpow234.1%
associate-*l/36.1%
unpow236.1%
unpow236.1%
times-frac38.8%
*-commutative38.8%
associate-*r*42.9%
*-commutative42.9%
*-commutative42.9%
times-frac40.2%
*-commutative40.2%
unpow240.2%
associate-/l*42.2%
associate-/l/62.1%
unpow262.1%
associate-/r/66.0%
*-commutative66.0%
unpow266.0%
Simplified64.0%
Taylor expanded in D around 0 42.2%
*-commutative42.2%
times-frac40.2%
associate-/l*42.2%
unpow242.2%
unpow242.2%
times-frac62.4%
unpow262.4%
Simplified62.4%
Taylor expanded in D around inf 21.0%
associate-/l*21.0%
*-commutative21.0%
associate-/l*21.0%
times-frac20.9%
unpow220.9%
unpow220.9%
unpow220.9%
Simplified20.9%
Final simplification60.8%
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: d should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. (FPCore (w0 M D h l d) :precision binary64 (* w0 (+ 1.0 (* (* D (/ (* D (* M (/ (* M (/ h d)) d))) l)) -0.125))))
M = abs(M);
D = abs(D);
d = abs(d);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
return w0 * (1.0 + ((D * ((D * (M * ((M * (h / d)) / d))) / l)) * -0.125));
}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: d should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
real(8) function code(w0, m, d, h, l, d_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d_1
code = w0 * (1.0d0 + ((d * ((d * (m * ((m * (h / d_1)) / d_1))) / l)) * (-0.125d0)))
end function
M = Math.abs(M);
D = Math.abs(D);
d = Math.abs(d);
assert M < D;
public static double code(double w0, double M, double D, double h, double l, double d) {
return w0 * (1.0 + ((D * ((D * (M * ((M * (h / d)) / d))) / l)) * -0.125));
}
M = abs(M) D = abs(D) d = abs(d) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): return w0 * (1.0 + ((D * ((D * (M * ((M * (h / d)) / d))) / l)) * -0.125))
M = abs(M) D = abs(D) d = abs(d) M, D = sort([M, D]) function code(w0, M, D, h, l, d) return Float64(w0 * Float64(1.0 + Float64(Float64(D * Float64(Float64(D * Float64(M * Float64(Float64(M * Float64(h / d)) / d))) / l)) * -0.125))) end
M = abs(M)
D = abs(D)
d = abs(d)
M, D = num2cell(sort([M, D])){:}
function tmp = code(w0, M, D, h, l, d)
tmp = w0 * (1.0 + ((D * ((D * (M * ((M * (h / d)) / d))) / l)) * -0.125));
end
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: d should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[w0_, M_, D_, h_, l_, d_] := N[(w0 * N[(1.0 + N[(N[(D * N[(N[(D * N[(M * N[(N[(M * N[(h / d), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
M = |M|\\
D = |D|\\
d = |d|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
w0 \cdot \left(1 + \left(D \cdot \frac{D \cdot \left(M \cdot \frac{M \cdot \frac{h}{d}}{d}\right)}{\ell}\right) \cdot -0.125\right)
\end{array}
Initial program 81.1%
Simplified79.6%
Taylor expanded in D around 0 50.3%
associate-*r/50.3%
*-commutative50.3%
associate-*r/50.3%
*-commutative50.3%
times-frac53.3%
unpow253.3%
*-commutative53.3%
unpow253.3%
unpow253.3%
Simplified53.3%
Taylor expanded in D around 0 50.3%
*-commutative50.3%
times-frac53.3%
unpow253.3%
associate-*l/56.1%
unpow256.1%
unpow256.1%
times-frac60.6%
*-commutative60.6%
associate-*r*65.1%
*-commutative65.1%
*-commutative65.1%
times-frac60.6%
*-commutative60.6%
unpow260.6%
associate-/l*62.2%
associate-/l/68.4%
unpow268.4%
associate-/r/69.1%
*-commutative69.1%
unpow269.1%
Simplified67.6%
Taylor expanded in M around 0 66.3%
unpow266.3%
times-frac71.5%
Simplified71.5%
associate-*l/75.3%
associate-*l/75.3%
Applied egg-rr75.3%
Final simplification75.3%
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: d should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. (FPCore (w0 M D h l d) :precision binary64 w0)
M = abs(M);
D = abs(D);
d = abs(d);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
return w0;
}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: d should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
real(8) function code(w0, m, d, h, l, d_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d_1
code = w0
end function
M = Math.abs(M);
D = Math.abs(D);
d = Math.abs(d);
assert M < D;
public static double code(double w0, double M, double D, double h, double l, double d) {
return w0;
}
M = abs(M) D = abs(D) d = abs(d) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): return w0
M = abs(M) D = abs(D) d = abs(d) M, D = sort([M, D]) function code(w0, M, D, h, l, d) return w0 end
M = abs(M)
D = abs(D)
d = abs(d)
M, D = num2cell(sort([M, D])){:}
function tmp = code(w0, M, D, h, l, d)
tmp = w0;
end
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: d should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[w0_, M_, D_, h_, l_, d_] := w0
\begin{array}{l}
M = |M|\\
D = |D|\\
d = |d|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
w0
\end{array}
Initial program 81.1%
Simplified79.6%
Taylor expanded in D around 0 67.6%
Final simplification67.6%
herbie shell --seed 2023271
(FPCore (w0 M D h l d)
:name "Henrywood and Agarwal, Equation (9a)"
:precision binary64
(* w0 (sqrt (- 1.0 (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ h l))))))