
(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 12 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: M and D should be sorted in increasing order before calling this function.
(FPCore (w0 M D h l d)
:precision binary64
(if (<= (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ h l)) (- INFINITY))
(pow
(*
(cbrt w0)
(pow
(exp 0.16666666666666666)
(fma -2.0 (- (log D)) (log (* -0.25 (* (/ h l) (* (/ M d) (/ M d))))))))
3.0)
(* w0 (sqrt (- 1.0 (/ (* h (pow (* (/ M d) (* D 0.5)) 2.0)) l))))))M = abs(M);
D = abs(D);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if ((pow(((M * D) / (2.0 * d)), 2.0) * (h / l)) <= -((double) INFINITY)) {
tmp = pow((cbrt(w0) * pow(exp(0.16666666666666666), fma(-2.0, -log(D), log((-0.25 * ((h / l) * ((M / d) * (M / d)))))))), 3.0);
} else {
tmp = w0 * sqrt((1.0 - ((h * pow(((M / d) * (D * 0.5)), 2.0)) / l)));
}
return tmp;
}
M = abs(M) D = abs(D) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (Float64((Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0) * Float64(h / l)) <= Float64(-Inf)) tmp = Float64(cbrt(w0) * (exp(0.16666666666666666) ^ fma(-2.0, Float64(-log(D)), log(Float64(-0.25 * Float64(Float64(h / l) * Float64(Float64(M / d) * Float64(M / d)))))))) ^ 3.0; else tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(h * (Float64(Float64(M / d) * Float64(D * 0.5)) ^ 2.0)) / l)))); end return tmp end
NOTE: M 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[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision], (-Infinity)], N[Power[N[(N[Power[w0, 1/3], $MachinePrecision] * N[Power[N[Exp[0.16666666666666666], $MachinePrecision], N[(-2.0 * (-N[Log[D], $MachinePrecision]) + N[Log[N[(-0.25 * N[(N[(h / l), $MachinePrecision] * N[(N[(M / d), $MachinePrecision] * N[(M / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision], N[(w0 * N[Sqrt[N[(1.0 - N[(N[(h * N[Power[N[(N[(M / d), $MachinePrecision] * N[(D * 0.5), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell} \leq -\infty:\\
\;\;\;\;{\left(\sqrt[3]{w0} \cdot {\left(e^{0.16666666666666666}\right)}^{\left(\mathsf{fma}\left(-2, -\log D, \log \left(-0.25 \cdot \left(\frac{h}{\ell} \cdot \left(\frac{M}{d} \cdot \frac{M}{d}\right)\right)\right)\right)\right)}\right)}^{3}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{h \cdot {\left(\frac{M}{d} \cdot \left(D \cdot 0.5\right)\right)}^{2}}{\ell}}\\
\end{array}
\end{array}
if (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (/.f64 h l)) < -inf.0Initial program 53.7%
*-commutative53.7%
times-frac57.0%
Simplified57.0%
Applied egg-rr56.9%
Taylor expanded in D around inf 15.7%
*-commutative15.7%
unpow1/319.6%
*-lft-identity19.6%
exp-prod19.6%
+-commutative19.6%
fma-def19.6%
log-rec19.6%
distribute-lft-neg-in19.6%
metadata-eval19.6%
*-commutative19.6%
*-commutative19.6%
times-frac21.3%
unpow221.3%
unpow221.3%
times-frac25.6%
Simplified25.6%
if -inf.0 < (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (/.f64 h l)) Initial program 87.2%
*-commutative87.2%
times-frac86.8%
Simplified86.8%
*-commutative86.8%
frac-times87.2%
*-commutative87.2%
associate-*l/95.0%
*-commutative95.0%
frac-times95.1%
div-inv95.1%
metadata-eval95.1%
Applied egg-rr95.1%
Final simplification79.1%
NOTE: M 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 (/ (* M D) (* 2.0 d))))
(if (<= t_0 2e-170)
w0
(if (<= t_0 2e+223)
(* w0 (sqrt (- 1.0 (* (pow t_0 2.0) (/ h l)))))
(*
w0
(sqrt
(+ 1.0 (* -0.25 (* (* D (/ D l)) (/ (* h (/ M (/ d M))) d))))))))))M = abs(M);
D = abs(D);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double t_0 = (M * D) / (2.0 * d);
double tmp;
if (t_0 <= 2e-170) {
tmp = w0;
} else if (t_0 <= 2e+223) {
tmp = w0 * sqrt((1.0 - (pow(t_0, 2.0) * (h / l))));
} else {
tmp = w0 * sqrt((1.0 + (-0.25 * ((D * (D / l)) * ((h * (M / (d / M))) / d)))));
}
return tmp;
}
NOTE: M 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)
if (t_0 <= 2d-170) then
tmp = w0
else if (t_0 <= 2d+223) then
tmp = w0 * sqrt((1.0d0 - ((t_0 ** 2.0d0) * (h / l))))
else
tmp = w0 * sqrt((1.0d0 + ((-0.25d0) * ((d * (d / l)) * ((h * (m / (d_1 / m))) / d_1)))))
end if
code = tmp
end function
M = Math.abs(M);
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 = (M * D) / (2.0 * d);
double tmp;
if (t_0 <= 2e-170) {
tmp = w0;
} else if (t_0 <= 2e+223) {
tmp = w0 * Math.sqrt((1.0 - (Math.pow(t_0, 2.0) * (h / l))));
} else {
tmp = w0 * Math.sqrt((1.0 + (-0.25 * ((D * (D / l)) * ((h * (M / (d / M))) / d)))));
}
return tmp;
}
M = abs(M) D = abs(D) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): t_0 = (M * D) / (2.0 * d) tmp = 0 if t_0 <= 2e-170: tmp = w0 elif t_0 <= 2e+223: tmp = w0 * math.sqrt((1.0 - (math.pow(t_0, 2.0) * (h / l)))) else: tmp = w0 * math.sqrt((1.0 + (-0.25 * ((D * (D / l)) * ((h * (M / (d / M))) / d))))) return tmp
M = abs(M) D = abs(D) M, D = sort([M, D]) function code(w0, M, D, h, l, d) t_0 = Float64(Float64(M * D) / Float64(2.0 * d)) tmp = 0.0 if (t_0 <= 2e-170) tmp = w0; elseif (t_0 <= 2e+223) tmp = Float64(w0 * sqrt(Float64(1.0 - Float64((t_0 ^ 2.0) * Float64(h / l))))); else tmp = Float64(w0 * sqrt(Float64(1.0 + Float64(-0.25 * Float64(Float64(D * Float64(D / l)) * Float64(Float64(h * Float64(M / Float64(d / M))) / d)))))); end return tmp end
M = abs(M)
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);
tmp = 0.0;
if (t_0 <= 2e-170)
tmp = w0;
elseif (t_0 <= 2e+223)
tmp = w0 * sqrt((1.0 - ((t_0 ^ 2.0) * (h / l))));
else
tmp = w0 * sqrt((1.0 + (-0.25 * ((D * (D / l)) * ((h * (M / (d / M))) / d)))));
end
tmp_2 = tmp;
end
NOTE: M 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[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 2e-170], w0, If[LessEqual[t$95$0, 2e+223], N[(w0 * N[Sqrt[N[(1.0 - N[(N[Power[t$95$0, 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(w0 * N[Sqrt[N[(1.0 + N[(-0.25 * N[(N[(D * N[(D / l), $MachinePrecision]), $MachinePrecision] * N[(N[(h * N[(M / N[(d / M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
t_0 := \frac{M \cdot D}{2 \cdot d}\\
\mathbf{if}\;t_0 \leq 2 \cdot 10^{-170}:\\
\;\;\;\;w0\\
\mathbf{elif}\;t_0 \leq 2 \cdot 10^{+223}:\\
\;\;\;\;w0 \cdot \sqrt{1 - {t_0}^{2} \cdot \frac{h}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{1 + -0.25 \cdot \left(\left(D \cdot \frac{D}{\ell}\right) \cdot \frac{h \cdot \frac{M}{\frac{d}{M}}}{d}\right)}\\
\end{array}
\end{array}
if (/.f64 (*.f64 M D) (*.f64 2 d)) < 1.99999999999999997e-170Initial program 80.3%
*-commutative80.3%
times-frac79.8%
Simplified79.8%
Taylor expanded in M around 0 76.9%
if 1.99999999999999997e-170 < (/.f64 (*.f64 M D) (*.f64 2 d)) < 2.00000000000000009e223Initial program 94.0%
if 2.00000000000000009e223 < (/.f64 (*.f64 M D) (*.f64 2 d)) Initial program 45.7%
*-commutative45.7%
times-frac61.5%
Simplified61.5%
Taylor expanded in w0 around 0 40.9%
*-commutative40.9%
cancel-sign-sub-inv40.9%
*-commutative40.9%
distribute-lft-neg-in40.9%
*-commutative40.9%
distribute-rgt-neg-in40.9%
Simplified53.3%
associate-*r/53.4%
associate-/l*61.5%
Applied egg-rr61.5%
Taylor expanded in D around 0 61.5%
unpow237.2%
associate-*l/37.3%
*-commutative37.3%
Simplified73.0%
Final simplification79.7%
NOTE: M 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 l) (* (/ h d) (/ (* D (* D (* M M))) d))))))
(if (<= (/ h l) -8e-164)
(* w0 (sqrt (- 1.0 (* (/ h l) (pow (* (/ M d) (/ D 2.0)) 2.0)))))
(if (<= (/ h l) 0.0)
(*
w0
(sqrt (+ 1.0 (* -0.25 (* (* D (/ D l)) (/ (* h (/ M (/ d M))) d))))))
w0))))M = abs(M);
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 / l) * ((h / d) * ((D * (D * (M * M))) / d)))));
} else if ((h / l) <= -8e-164) {
tmp = w0 * sqrt((1.0 - ((h / l) * pow(((M / d) * (D / 2.0)), 2.0))));
} else if ((h / l) <= 0.0) {
tmp = w0 * sqrt((1.0 + (-0.25 * ((D * (D / l)) * ((h * (M / (d / M))) / d)))));
} else {
tmp = w0;
}
return tmp;
}
M = Math.abs(M);
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 / l) * ((h / d) * ((D * (D * (M * M))) / d)))));
} else if ((h / l) <= -8e-164) {
tmp = w0 * Math.sqrt((1.0 - ((h / l) * Math.pow(((M / d) * (D / 2.0)), 2.0))));
} else if ((h / l) <= 0.0) {
tmp = w0 * Math.sqrt((1.0 + (-0.25 * ((D * (D / l)) * ((h * (M / (d / M))) / d)))));
} else {
tmp = w0;
}
return tmp;
}
M = abs(M) 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 / l) * ((h / d) * ((D * (D * (M * M))) / d))))) elif (h / l) <= -8e-164: tmp = w0 * math.sqrt((1.0 - ((h / l) * math.pow(((M / d) * (D / 2.0)), 2.0)))) elif (h / l) <= 0.0: tmp = w0 * math.sqrt((1.0 + (-0.25 * ((D * (D / l)) * ((h * (M / (d / M))) / d))))) else: tmp = w0 return tmp
M = abs(M) 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(Float64(0.25 / l) * Float64(Float64(h / d) * Float64(Float64(D * Float64(D * Float64(M * M))) / d)))))); elseif (Float64(h / l) <= -8e-164) tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(h / l) * (Float64(Float64(M / d) * Float64(D / 2.0)) ^ 2.0))))); elseif (Float64(h / l) <= 0.0) tmp = Float64(w0 * sqrt(Float64(1.0 + Float64(-0.25 * Float64(Float64(D * Float64(D / l)) * Float64(Float64(h * Float64(M / Float64(d / M))) / d)))))); else tmp = w0; end return tmp end
M = abs(M)
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 / l) * ((h / d) * ((D * (D * (M * M))) / d)))));
elseif ((h / l) <= -8e-164)
tmp = w0 * sqrt((1.0 - ((h / l) * (((M / d) * (D / 2.0)) ^ 2.0))));
elseif ((h / l) <= 0.0)
tmp = w0 * sqrt((1.0 + (-0.25 * ((D * (D / l)) * ((h * (M / (d / M))) / 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: 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[(N[(0.25 / l), $MachinePrecision] * N[(N[(h / d), $MachinePrecision] * N[(N[(D * N[(D * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(h / l), $MachinePrecision], -8e-164], 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], If[LessEqual[N[(h / l), $MachinePrecision], 0.0], N[(w0 * N[Sqrt[N[(1.0 + N[(-0.25 * N[(N[(D * N[(D / l), $MachinePrecision]), $MachinePrecision] * N[(N[(h * N[(M / N[(d / M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], w0]]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{h}{\ell} \leq -\infty:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{0.25}{\ell} \cdot \left(\frac{h}{d} \cdot \frac{D \cdot \left(D \cdot \left(M \cdot M\right)\right)}{d}\right)}\\
\mathbf{elif}\;\frac{h}{\ell} \leq -8 \cdot 10^{-164}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{h}{\ell} \cdot {\left(\frac{M}{d} \cdot \frac{D}{2}\right)}^{2}}\\
\mathbf{elif}\;\frac{h}{\ell} \leq 0:\\
\;\;\;\;w0 \cdot \sqrt{1 + -0.25 \cdot \left(\left(D \cdot \frac{D}{\ell}\right) \cdot \frac{h \cdot \frac{M}{\frac{d}{M}}}{d}\right)}\\
\mathbf{else}:\\
\;\;\;\;w0\\
\end{array}
\end{array}
if (/.f64 h l) < -inf.0Initial program 23.8%
*-commutative23.8%
times-frac23.8%
Simplified23.8%
Taylor expanded in M around 0 56.6%
associate-*r/56.6%
*-commutative56.6%
times-frac56.6%
*-commutative56.6%
associate-*l*56.6%
unpow256.6%
unpow256.6%
swap-sqr73.5%
*-commutative73.5%
*-commutative73.5%
swap-sqr56.6%
unpow256.6%
Simplified56.6%
times-frac56.6%
associate-*l*63.3%
Applied egg-rr63.3%
if -inf.0 < (/.f64 h l) < -7.99999999999999969e-164Initial program 85.5%
*-commutative85.5%
times-frac85.6%
Simplified85.6%
if -7.99999999999999969e-164 < (/.f64 h l) < -0.0Initial program 73.1%
*-commutative73.1%
times-frac73.2%
Simplified73.2%
Taylor expanded in w0 around 0 48.9%
*-commutative48.9%
cancel-sign-sub-inv48.9%
*-commutative48.9%
distribute-lft-neg-in48.9%
*-commutative48.9%
distribute-rgt-neg-in48.9%
Simplified55.8%
associate-*r/55.9%
associate-/l*59.4%
Applied egg-rr59.4%
Taylor expanded in D around 0 59.4%
unpow245.6%
associate-*l/59.4%
*-commutative59.4%
Simplified78.1%
if -0.0 < (/.f64 h l) Initial program 89.3%
*-commutative89.3%
times-frac90.7%
Simplified90.7%
Taylor expanded in M around 0 100.0%
Final simplification86.6%
NOTE: M 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+223)
(* w0 (sqrt (- 1.0 (/ (* h (pow (* (/ M d) (* D 0.5)) 2.0)) l))))
(*
w0
(sqrt (+ 1.0 (* -0.25 (* (* D (/ D l)) (/ (* h (/ M (/ d M))) d))))))))M = abs(M);
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+223) {
tmp = w0 * sqrt((1.0 - ((h * pow(((M / d) * (D * 0.5)), 2.0)) / l)));
} else {
tmp = w0 * sqrt((1.0 + (-0.25 * ((D * (D / l)) * ((h * (M / (d / M))) / d)))));
}
return tmp;
}
NOTE: M 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+223) then
tmp = w0 * sqrt((1.0d0 - ((h * (((m / d_1) * (d * 0.5d0)) ** 2.0d0)) / l)))
else
tmp = w0 * sqrt((1.0d0 + ((-0.25d0) * ((d * (d / l)) * ((h * (m / (d_1 / m))) / d_1)))))
end if
code = tmp
end function
M = Math.abs(M);
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+223) {
tmp = w0 * Math.sqrt((1.0 - ((h * Math.pow(((M / d) * (D * 0.5)), 2.0)) / l)));
} else {
tmp = w0 * Math.sqrt((1.0 + (-0.25 * ((D * (D / l)) * ((h * (M / (d / M))) / d)))));
}
return tmp;
}
M = abs(M) 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+223: tmp = w0 * math.sqrt((1.0 - ((h * math.pow(((M / d) * (D * 0.5)), 2.0)) / l))) else: tmp = w0 * math.sqrt((1.0 + (-0.25 * ((D * (D / l)) * ((h * (M / (d / M))) / d))))) return tmp
M = abs(M) 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+223) tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(h * (Float64(Float64(M / d) * Float64(D * 0.5)) ^ 2.0)) / l)))); else tmp = Float64(w0 * sqrt(Float64(1.0 + Float64(-0.25 * Float64(Float64(D * Float64(D / l)) * Float64(Float64(h * Float64(M / Float64(d / M))) / d)))))); end return tmp end
M = abs(M)
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+223)
tmp = w0 * sqrt((1.0 - ((h * (((M / d) * (D * 0.5)) ^ 2.0)) / l)));
else
tmp = w0 * sqrt((1.0 + (-0.25 * ((D * (D / l)) * ((h * (M / (d / M))) / d)))));
end
tmp_2 = tmp;
end
NOTE: M 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+223], N[(w0 * N[Sqrt[N[(1.0 - N[(N[(h * N[Power[N[(N[(M / d), $MachinePrecision] * N[(D * 0.5), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(w0 * N[Sqrt[N[(1.0 + N[(-0.25 * N[(N[(D * N[(D / l), $MachinePrecision]), $MachinePrecision] * N[(N[(h * N[(M / N[(d / M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{M \cdot D}{2 \cdot d} \leq 2 \cdot 10^{+223}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{h \cdot {\left(\frac{M}{d} \cdot \left(D \cdot 0.5\right)\right)}^{2}}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{1 + -0.25 \cdot \left(\left(D \cdot \frac{D}{\ell}\right) \cdot \frac{h \cdot \frac{M}{\frac{d}{M}}}{d}\right)}\\
\end{array}
\end{array}
if (/.f64 (*.f64 M D) (*.f64 2 d)) < 2.00000000000000009e223Initial program 83.1%
*-commutative83.1%
times-frac81.9%
Simplified81.9%
*-commutative81.9%
frac-times83.1%
*-commutative83.1%
associate-*l/89.7%
*-commutative89.7%
frac-times88.9%
div-inv88.9%
metadata-eval88.9%
Applied egg-rr88.9%
if 2.00000000000000009e223 < (/.f64 (*.f64 M D) (*.f64 2 d)) Initial program 45.7%
*-commutative45.7%
times-frac61.5%
Simplified61.5%
Taylor expanded in w0 around 0 40.9%
*-commutative40.9%
cancel-sign-sub-inv40.9%
*-commutative40.9%
distribute-lft-neg-in40.9%
*-commutative40.9%
distribute-rgt-neg-in40.9%
Simplified53.3%
associate-*r/53.4%
associate-/l*61.5%
Applied egg-rr61.5%
Taylor expanded in D around 0 61.5%
unpow237.2%
associate-*l/37.3%
*-commutative37.3%
Simplified73.0%
Final simplification87.4%
NOTE: M 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.25e-53)
(* w0 (sqrt (+ 1.0 (* -0.25 (* (* D (/ D l)) (/ (* h (/ M (/ d M))) d))))))
(if (<= d 4e+154)
(* w0 (sqrt (- 1.0 (* (/ 0.25 l) (* (/ h d) (/ (* D (* D (* M M))) d))))))
(* w0 (+ 1.0 (* (* (pow (/ D d) 2.0) (/ (* h (* M M)) l)) -0.125))))))M = abs(M);
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.25e-53) {
tmp = w0 * sqrt((1.0 + (-0.25 * ((D * (D / l)) * ((h * (M / (d / M))) / d)))));
} else if (d <= 4e+154) {
tmp = w0 * sqrt((1.0 - ((0.25 / l) * ((h / d) * ((D * (D * (M * M))) / d)))));
} else {
tmp = w0 * (1.0 + ((pow((D / d), 2.0) * ((h * (M * M)) / l)) * -0.125));
}
return tmp;
}
NOTE: M 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.25d-53) then
tmp = w0 * sqrt((1.0d0 + ((-0.25d0) * ((d * (d / l)) * ((h * (m / (d_1 / m))) / d_1)))))
else if (d_1 <= 4d+154) then
tmp = w0 * sqrt((1.0d0 - ((0.25d0 / l) * ((h / d_1) * ((d * (d * (m * m))) / d_1)))))
else
tmp = w0 * (1.0d0 + ((((d / d_1) ** 2.0d0) * ((h * (m * m)) / l)) * (-0.125d0)))
end if
code = tmp
end function
M = Math.abs(M);
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.25e-53) {
tmp = w0 * Math.sqrt((1.0 + (-0.25 * ((D * (D / l)) * ((h * (M / (d / M))) / d)))));
} else if (d <= 4e+154) {
tmp = w0 * Math.sqrt((1.0 - ((0.25 / l) * ((h / d) * ((D * (D * (M * M))) / d)))));
} else {
tmp = w0 * (1.0 + ((Math.pow((D / d), 2.0) * ((h * (M * M)) / l)) * -0.125));
}
return tmp;
}
M = abs(M) D = abs(D) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if d <= 1.25e-53: tmp = w0 * math.sqrt((1.0 + (-0.25 * ((D * (D / l)) * ((h * (M / (d / M))) / d))))) elif d <= 4e+154: tmp = w0 * math.sqrt((1.0 - ((0.25 / l) * ((h / d) * ((D * (D * (M * M))) / d))))) else: tmp = w0 * (1.0 + ((math.pow((D / d), 2.0) * ((h * (M * M)) / l)) * -0.125)) return tmp
M = abs(M) D = abs(D) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (d <= 1.25e-53) tmp = Float64(w0 * sqrt(Float64(1.0 + Float64(-0.25 * Float64(Float64(D * Float64(D / l)) * Float64(Float64(h * Float64(M / Float64(d / M))) / d)))))); elseif (d <= 4e+154) tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(0.25 / l) * Float64(Float64(h / d) * Float64(Float64(D * Float64(D * Float64(M * M))) / d)))))); else tmp = Float64(w0 * Float64(1.0 + Float64(Float64((Float64(D / d) ^ 2.0) * Float64(Float64(h * Float64(M * M)) / l)) * -0.125))); end return tmp end
M = abs(M)
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.25e-53)
tmp = w0 * sqrt((1.0 + (-0.25 * ((D * (D / l)) * ((h * (M / (d / M))) / d)))));
elseif (d <= 4e+154)
tmp = w0 * sqrt((1.0 - ((0.25 / l) * ((h / d) * ((D * (D * (M * M))) / d)))));
else
tmp = w0 * (1.0 + ((((D / d) ^ 2.0) * ((h * (M * M)) / 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: M and D should be sorted in increasing order before calling this function. code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[d, 1.25e-53], N[(w0 * N[Sqrt[N[(1.0 + N[(-0.25 * N[(N[(D * N[(D / l), $MachinePrecision]), $MachinePrecision] * N[(N[(h * N[(M / N[(d / M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 4e+154], N[(w0 * N[Sqrt[N[(1.0 - N[(N[(0.25 / l), $MachinePrecision] * N[(N[(h / d), $MachinePrecision] * N[(N[(D * N[(D * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(w0 * N[(1.0 + N[(N[(N[Power[N[(D / d), $MachinePrecision], 2.0], $MachinePrecision] * N[(N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;d \leq 1.25 \cdot 10^{-53}:\\
\;\;\;\;w0 \cdot \sqrt{1 + -0.25 \cdot \left(\left(D \cdot \frac{D}{\ell}\right) \cdot \frac{h \cdot \frac{M}{\frac{d}{M}}}{d}\right)}\\
\mathbf{elif}\;d \leq 4 \cdot 10^{+154}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{0.25}{\ell} \cdot \left(\frac{h}{d} \cdot \frac{D \cdot \left(D \cdot \left(M \cdot M\right)\right)}{d}\right)}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \left(1 + \left({\left(\frac{D}{d}\right)}^{2} \cdot \frac{h \cdot \left(M \cdot M\right)}{\ell}\right) \cdot -0.125\right)\\
\end{array}
\end{array}
if d < 1.25e-53Initial program 80.3%
*-commutative80.3%
times-frac79.8%
Simplified79.8%
Taylor expanded in w0 around 0 51.5%
*-commutative51.5%
cancel-sign-sub-inv51.5%
*-commutative51.5%
distribute-lft-neg-in51.5%
*-commutative51.5%
distribute-rgt-neg-in51.5%
Simplified58.3%
associate-*r/61.3%
associate-/l*63.1%
Applied egg-rr63.1%
Taylor expanded in D around 0 63.1%
unpow248.7%
associate-*l/52.4%
*-commutative52.4%
Simplified67.4%
if 1.25e-53 < d < 4.00000000000000015e154Initial program 74.2%
*-commutative74.2%
times-frac72.1%
Simplified72.1%
Taylor expanded in M around 0 49.8%
associate-*r/49.8%
*-commutative49.8%
times-frac50.4%
*-commutative50.4%
associate-*l*52.8%
unpow252.8%
unpow252.8%
swap-sqr75.0%
*-commutative75.0%
*-commutative75.0%
swap-sqr52.8%
unpow252.8%
Simplified52.8%
times-frac56.6%
associate-*l*66.0%
Applied egg-rr66.0%
if 4.00000000000000015e154 < d Initial program 81.8%
*-commutative81.8%
times-frac88.6%
Simplified88.6%
*-commutative88.6%
frac-times81.8%
*-commutative81.8%
associate-*l/93.2%
*-commutative93.2%
frac-times97.8%
div-inv97.8%
metadata-eval97.8%
Applied egg-rr97.8%
Taylor expanded in h around 0 54.5%
*-commutative54.5%
*-commutative54.5%
times-frac54.5%
unpow254.5%
unpow254.5%
times-frac70.8%
unpow270.8%
unpow270.8%
Simplified70.8%
Final simplification67.7%
NOTE: M 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.85e+84) (* w0 (sqrt (+ 1.0 (* -0.25 (* (* D (/ D l)) (/ (* h (/ M (/ d M))) d)))))) (* w0 (+ 1.0 (* (* (pow (/ D d) 2.0) (/ (* h (* M M)) l)) -0.125)))))
M = abs(M);
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.85e+84) {
tmp = w0 * sqrt((1.0 + (-0.25 * ((D * (D / l)) * ((h * (M / (d / M))) / d)))));
} else {
tmp = w0 * (1.0 + ((pow((D / d), 2.0) * ((h * (M * M)) / l)) * -0.125));
}
return tmp;
}
NOTE: M 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.85d+84) then
tmp = w0 * sqrt((1.0d0 + ((-0.25d0) * ((d * (d / l)) * ((h * (m / (d_1 / m))) / d_1)))))
else
tmp = w0 * (1.0d0 + ((((d / d_1) ** 2.0d0) * ((h * (m * m)) / l)) * (-0.125d0)))
end if
code = tmp
end function
M = Math.abs(M);
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.85e+84) {
tmp = w0 * Math.sqrt((1.0 + (-0.25 * ((D * (D / l)) * ((h * (M / (d / M))) / d)))));
} else {
tmp = w0 * (1.0 + ((Math.pow((D / d), 2.0) * ((h * (M * M)) / l)) * -0.125));
}
return tmp;
}
M = abs(M) D = abs(D) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if d <= 1.85e+84: tmp = w0 * math.sqrt((1.0 + (-0.25 * ((D * (D / l)) * ((h * (M / (d / M))) / d))))) else: tmp = w0 * (1.0 + ((math.pow((D / d), 2.0) * ((h * (M * M)) / l)) * -0.125)) return tmp
M = abs(M) D = abs(D) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (d <= 1.85e+84) tmp = Float64(w0 * sqrt(Float64(1.0 + Float64(-0.25 * Float64(Float64(D * Float64(D / l)) * Float64(Float64(h * Float64(M / Float64(d / M))) / d)))))); else tmp = Float64(w0 * Float64(1.0 + Float64(Float64((Float64(D / d) ^ 2.0) * Float64(Float64(h * Float64(M * M)) / l)) * -0.125))); end return tmp end
M = abs(M)
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.85e+84)
tmp = w0 * sqrt((1.0 + (-0.25 * ((D * (D / l)) * ((h * (M / (d / M))) / d)))));
else
tmp = w0 * (1.0 + ((((D / d) ^ 2.0) * ((h * (M * M)) / 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: M and D should be sorted in increasing order before calling this function. code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[d, 1.85e+84], N[(w0 * N[Sqrt[N[(1.0 + N[(-0.25 * N[(N[(D * N[(D / l), $MachinePrecision]), $MachinePrecision] * N[(N[(h * N[(M / N[(d / M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(w0 * N[(1.0 + N[(N[(N[Power[N[(D / d), $MachinePrecision], 2.0], $MachinePrecision] * N[(N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;d \leq 1.85 \cdot 10^{+84}:\\
\;\;\;\;w0 \cdot \sqrt{1 + -0.25 \cdot \left(\left(D \cdot \frac{D}{\ell}\right) \cdot \frac{h \cdot \frac{M}{\frac{d}{M}}}{d}\right)}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \left(1 + \left({\left(\frac{D}{d}\right)}^{2} \cdot \frac{h \cdot \left(M \cdot M\right)}{\ell}\right) \cdot -0.125\right)\\
\end{array}
\end{array}
if d < 1.85e84Initial program 80.4%
*-commutative80.4%
times-frac79.5%
Simplified79.5%
Taylor expanded in w0 around 0 53.0%
*-commutative53.0%
cancel-sign-sub-inv53.0%
*-commutative53.0%
distribute-lft-neg-in53.0%
*-commutative53.0%
distribute-rgt-neg-in53.0%
Simplified58.8%
associate-*r/61.4%
associate-/l*63.4%
Applied egg-rr63.4%
Taylor expanded in D around 0 63.4%
unpow250.5%
associate-*l/54.2%
*-commutative54.2%
Simplified68.2%
if 1.85e84 < d Initial program 76.6%
*-commutative76.6%
times-frac81.3%
Simplified81.3%
*-commutative81.3%
frac-times76.6%
*-commutative76.6%
associate-*l/87.7%
*-commutative87.7%
frac-times90.9%
div-inv90.9%
metadata-eval90.9%
Applied egg-rr90.9%
Taylor expanded in h around 0 48.0%
*-commutative48.0%
*-commutative48.0%
times-frac46.7%
unpow246.7%
unpow246.7%
times-frac64.5%
unpow264.5%
unpow264.5%
Simplified64.5%
Final simplification67.3%
NOTE: M 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 5.8e-152) w0 (* w0 (+ 1.0 (* (* (pow (/ D d) 2.0) (/ (* h (* M M)) l)) -0.125)))))
M = abs(M);
D = abs(D);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (M <= 5.8e-152) {
tmp = w0;
} else {
tmp = w0 * (1.0 + ((pow((D / d), 2.0) * ((h * (M * M)) / l)) * -0.125));
}
return tmp;
}
NOTE: M 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 <= 5.8d-152) then
tmp = w0
else
tmp = w0 * (1.0d0 + ((((d / d_1) ** 2.0d0) * ((h * (m * m)) / l)) * (-0.125d0)))
end if
code = tmp
end function
M = Math.abs(M);
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 <= 5.8e-152) {
tmp = w0;
} else {
tmp = w0 * (1.0 + ((Math.pow((D / d), 2.0) * ((h * (M * M)) / l)) * -0.125));
}
return tmp;
}
M = abs(M) D = abs(D) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if M <= 5.8e-152: tmp = w0 else: tmp = w0 * (1.0 + ((math.pow((D / d), 2.0) * ((h * (M * M)) / l)) * -0.125)) return tmp
M = abs(M) D = abs(D) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (M <= 5.8e-152) tmp = w0; else tmp = Float64(w0 * Float64(1.0 + Float64(Float64((Float64(D / d) ^ 2.0) * Float64(Float64(h * Float64(M * M)) / l)) * -0.125))); end return tmp end
M = abs(M)
D = abs(D)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if (M <= 5.8e-152)
tmp = w0;
else
tmp = w0 * (1.0 + ((((D / d) ^ 2.0) * ((h * (M * M)) / 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: M and D should be sorted in increasing order before calling this function. code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[M, 5.8e-152], w0, N[(w0 * N[(1.0 + N[(N[(N[Power[N[(D / d), $MachinePrecision], 2.0], $MachinePrecision] * N[(N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;M \leq 5.8 \cdot 10^{-152}:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \left(1 + \left({\left(\frac{D}{d}\right)}^{2} \cdot \frac{h \cdot \left(M \cdot M\right)}{\ell}\right) \cdot -0.125\right)\\
\end{array}
\end{array}
if M < 5.8000000000000003e-152Initial program 77.3%
*-commutative77.3%
times-frac78.0%
Simplified78.0%
Taylor expanded in M around 0 72.0%
if 5.8000000000000003e-152 < M Initial program 83.3%
*-commutative83.3%
times-frac83.3%
Simplified83.3%
*-commutative83.3%
frac-times83.3%
*-commutative83.3%
associate-*l/89.7%
*-commutative89.7%
frac-times89.8%
div-inv89.8%
metadata-eval89.8%
Applied egg-rr89.8%
Taylor expanded in h around 0 56.6%
*-commutative56.6%
*-commutative56.6%
times-frac55.5%
unpow255.5%
unpow255.5%
times-frac66.5%
unpow266.5%
unpow266.5%
Simplified66.5%
Final simplification70.0%
NOTE: M 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.32e-65) w0 (* w0 (+ 1.0 (* -0.125 (* D (* (/ D l) (* (/ M (/ d M)) (/ h d)))))))))
M = abs(M);
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.32e-65) {
tmp = w0;
} else {
tmp = w0 * (1.0 + (-0.125 * (D * ((D / l) * ((M / (d / M)) * (h / d))))));
}
return tmp;
}
NOTE: M 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.32d-65) then
tmp = w0
else
tmp = w0 * (1.0d0 + ((-0.125d0) * (d * ((d / l) * ((m / (d_1 / m)) * (h / d_1))))))
end if
code = tmp
end function
M = Math.abs(M);
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.32e-65) {
tmp = w0;
} else {
tmp = w0 * (1.0 + (-0.125 * (D * ((D / l) * ((M / (d / M)) * (h / d))))));
}
return tmp;
}
M = abs(M) D = abs(D) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if M <= 1.32e-65: tmp = w0 else: tmp = w0 * (1.0 + (-0.125 * (D * ((D / l) * ((M / (d / M)) * (h / d)))))) return tmp
M = abs(M) D = abs(D) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (M <= 1.32e-65) tmp = w0; else tmp = Float64(w0 * Float64(1.0 + Float64(-0.125 * Float64(D * Float64(Float64(D / l) * Float64(Float64(M / Float64(d / M)) * Float64(h / d))))))); end return tmp end
M = abs(M)
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.32e-65)
tmp = w0;
else
tmp = w0 * (1.0 + (-0.125 * (D * ((D / l) * ((M / (d / M)) * (h / d))))));
end
tmp_2 = tmp;
end
NOTE: M 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.32e-65], w0, N[(w0 * N[(1.0 + N[(-0.125 * N[(D * N[(N[(D / l), $MachinePrecision] * N[(N[(M / N[(d / M), $MachinePrecision]), $MachinePrecision] * N[(h / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;M \leq 1.32 \cdot 10^{-65}:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \left(1 + -0.125 \cdot \left(D \cdot \left(\frac{D}{\ell} \cdot \left(\frac{M}{\frac{d}{M}} \cdot \frac{h}{d}\right)\right)\right)\right)\\
\end{array}
\end{array}
if M < 1.32e-65Initial program 78.1%
*-commutative78.1%
times-frac78.7%
Simplified78.7%
Taylor expanded in M around 0 73.3%
if 1.32e-65 < M Initial program 83.0%
*-commutative83.0%
times-frac83.1%
Simplified83.1%
Taylor expanded in M around 0 50.8%
associate-*r/50.8%
*-commutative50.8%
associate-*r/50.8%
*-commutative50.8%
times-frac49.4%
unpow249.4%
*-commutative49.4%
unpow249.4%
unpow249.4%
Simplified49.4%
associate-*r/50.8%
associate-/l*54.9%
*-commutative54.9%
Applied egg-rr54.9%
associate-/l*50.8%
associate-*r/54.9%
*-commutative54.9%
associate-*r/53.5%
frac-times62.0%
associate-*l*63.5%
associate-/l*72.9%
Applied egg-rr72.9%
Final simplification73.2%
NOTE: M 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.06e+48) w0 (* -0.125 (* (* D (/ D l)) (/ (* (* M M) (* h w0)) (* d d))))))
M = abs(M);
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.06e+48) {
tmp = w0;
} else {
tmp = -0.125 * ((D * (D / l)) * (((M * M) * (h * w0)) / (d * d)));
}
return tmp;
}
NOTE: M 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.06d+48) then
tmp = w0
else
tmp = (-0.125d0) * ((d * (d / l)) * (((m * m) * (h * w0)) / (d_1 * d_1)))
end if
code = tmp
end function
M = Math.abs(M);
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.06e+48) {
tmp = w0;
} else {
tmp = -0.125 * ((D * (D / l)) * (((M * M) * (h * w0)) / (d * d)));
}
return tmp;
}
M = abs(M) D = abs(D) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if M <= 1.06e+48: tmp = w0 else: tmp = -0.125 * ((D * (D / l)) * (((M * M) * (h * w0)) / (d * d))) return tmp
M = abs(M) D = abs(D) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (M <= 1.06e+48) tmp = w0; else tmp = Float64(-0.125 * Float64(Float64(D * Float64(D / l)) * Float64(Float64(Float64(M * M) * Float64(h * w0)) / Float64(d * d)))); end return tmp end
M = abs(M)
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.06e+48)
tmp = w0;
else
tmp = -0.125 * ((D * (D / l)) * (((M * M) * (h * w0)) / (d * d)));
end
tmp_2 = tmp;
end
NOTE: M 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.06e+48], w0, N[(-0.125 * N[(N[(D * N[(D / l), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(M * M), $MachinePrecision] * N[(h * w0), $MachinePrecision]), $MachinePrecision] / N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;M \leq 1.06 \cdot 10^{+48}:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;-0.125 \cdot \left(\left(D \cdot \frac{D}{\ell}\right) \cdot \frac{\left(M \cdot M\right) \cdot \left(h \cdot w0\right)}{d \cdot d}\right)\\
\end{array}
\end{array}
if M < 1.06e48Initial program 79.6%
*-commutative79.6%
times-frac80.1%
Simplified80.1%
Taylor expanded in M around 0 74.0%
if 1.06e48 < M Initial program 79.1%
*-commutative79.1%
times-frac79.2%
Simplified79.2%
Taylor expanded in M around 0 43.9%
associate-*r/43.9%
*-commutative43.9%
associate-*r/43.9%
*-commutative43.9%
times-frac43.9%
unpow243.9%
*-commutative43.9%
unpow243.9%
unpow243.9%
Simplified43.9%
Taylor expanded in D around 0 43.9%
unpow243.9%
associate-*l/45.9%
*-commutative45.9%
Simplified45.9%
Taylor expanded in D around inf 25.0%
unpow225.0%
*-commutative25.0%
times-frac24.9%
unpow224.9%
associate-/l*26.9%
unpow226.9%
associate-*r*27.0%
Simplified27.0%
associate-/r/27.0%
Applied egg-rr27.0%
Final simplification64.6%
NOTE: M 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.75e+47) w0 (* -0.125 (* (/ D (/ l D)) (/ (* w0 (* M (/ M d))) (/ d h))))))
M = abs(M);
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.75e+47) {
tmp = w0;
} else {
tmp = -0.125 * ((D / (l / D)) * ((w0 * (M * (M / d))) / (d / h)));
}
return tmp;
}
NOTE: M 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.75d+47) then
tmp = w0
else
tmp = (-0.125d0) * ((d / (l / d)) * ((w0 * (m * (m / d_1))) / (d_1 / h)))
end if
code = tmp
end function
M = Math.abs(M);
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.75e+47) {
tmp = w0;
} else {
tmp = -0.125 * ((D / (l / D)) * ((w0 * (M * (M / d))) / (d / h)));
}
return tmp;
}
M = abs(M) D = abs(D) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if M <= 1.75e+47: tmp = w0 else: tmp = -0.125 * ((D / (l / D)) * ((w0 * (M * (M / d))) / (d / h))) return tmp
M = abs(M) D = abs(D) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (M <= 1.75e+47) tmp = w0; else tmp = Float64(-0.125 * Float64(Float64(D / Float64(l / D)) * Float64(Float64(w0 * Float64(M * Float64(M / d))) / Float64(d / h)))); end return tmp end
M = abs(M)
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.75e+47)
tmp = w0;
else
tmp = -0.125 * ((D / (l / D)) * ((w0 * (M * (M / d))) / (d / h)));
end
tmp_2 = tmp;
end
NOTE: M 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.75e+47], w0, N[(-0.125 * N[(N[(D / N[(l / D), $MachinePrecision]), $MachinePrecision] * N[(N[(w0 * N[(M * N[(M / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;M \leq 1.75 \cdot 10^{+47}:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;-0.125 \cdot \left(\frac{D}{\frac{\ell}{D}} \cdot \frac{w0 \cdot \left(M \cdot \frac{M}{d}\right)}{\frac{d}{h}}\right)\\
\end{array}
\end{array}
if M < 1.75000000000000008e47Initial program 79.6%
*-commutative79.6%
times-frac80.1%
Simplified80.1%
Taylor expanded in M around 0 74.0%
if 1.75000000000000008e47 < M Initial program 79.1%
*-commutative79.1%
times-frac79.2%
Simplified79.2%
Taylor expanded in M around 0 43.9%
associate-*r/43.9%
*-commutative43.9%
associate-*r/43.9%
*-commutative43.9%
times-frac43.9%
unpow243.9%
*-commutative43.9%
unpow243.9%
unpow243.9%
Simplified43.9%
Taylor expanded in D around 0 43.9%
unpow243.9%
associate-*l/45.9%
*-commutative45.9%
Simplified45.9%
Taylor expanded in D around inf 25.0%
unpow225.0%
*-commutative25.0%
times-frac24.9%
unpow224.9%
associate-/l*26.9%
unpow226.9%
associate-*r*27.0%
Simplified27.0%
Taylor expanded in w0 around 0 26.9%
*-commutative26.9%
associate-*r*27.0%
unpow227.0%
times-frac33.6%
unpow233.6%
associate-*r/33.9%
*-commutative33.9%
associate-/l*33.8%
associate-*r/33.8%
Simplified33.8%
Final simplification66.0%
NOTE: M 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.85e+47) w0 (* -0.125 (/ (* (/ D (/ d M)) (/ (* h w0) (/ d M))) (/ l D)))))
M = abs(M);
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.85e+47) {
tmp = w0;
} else {
tmp = -0.125 * (((D / (d / M)) * ((h * w0) / (d / M))) / (l / D));
}
return tmp;
}
NOTE: M 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.85d+47) then
tmp = w0
else
tmp = (-0.125d0) * (((d / (d_1 / m)) * ((h * w0) / (d_1 / m))) / (l / d))
end if
code = tmp
end function
M = Math.abs(M);
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.85e+47) {
tmp = w0;
} else {
tmp = -0.125 * (((D / (d / M)) * ((h * w0) / (d / M))) / (l / D));
}
return tmp;
}
M = abs(M) D = abs(D) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if M <= 1.85e+47: tmp = w0 else: tmp = -0.125 * (((D / (d / M)) * ((h * w0) / (d / M))) / (l / D)) return tmp
M = abs(M) D = abs(D) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (M <= 1.85e+47) tmp = w0; else tmp = Float64(-0.125 * Float64(Float64(Float64(D / Float64(d / M)) * Float64(Float64(h * w0) / Float64(d / M))) / Float64(l / D))); end return tmp end
M = abs(M)
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.85e+47)
tmp = w0;
else
tmp = -0.125 * (((D / (d / M)) * ((h * w0) / (d / M))) / (l / D));
end
tmp_2 = tmp;
end
NOTE: M 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.85e+47], w0, N[(-0.125 * N[(N[(N[(D / N[(d / M), $MachinePrecision]), $MachinePrecision] * N[(N[(h * w0), $MachinePrecision] / N[(d / M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(l / D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;M \leq 1.85 \cdot 10^{+47}:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;-0.125 \cdot \frac{\frac{D}{\frac{d}{M}} \cdot \frac{h \cdot w0}{\frac{d}{M}}}{\frac{\ell}{D}}\\
\end{array}
\end{array}
if M < 1.8500000000000002e47Initial program 79.6%
*-commutative79.6%
times-frac80.1%
Simplified80.1%
Taylor expanded in M around 0 74.0%
if 1.8500000000000002e47 < M Initial program 79.1%
*-commutative79.1%
times-frac79.2%
Simplified79.2%
Taylor expanded in M around 0 43.9%
associate-*r/43.9%
*-commutative43.9%
associate-*r/43.9%
*-commutative43.9%
times-frac43.9%
unpow243.9%
*-commutative43.9%
unpow243.9%
unpow243.9%
Simplified43.9%
Taylor expanded in D around 0 43.9%
unpow243.9%
associate-*l/45.9%
*-commutative45.9%
Simplified45.9%
Taylor expanded in D around inf 25.0%
unpow225.0%
*-commutative25.0%
times-frac24.9%
unpow224.9%
associate-/l*26.9%
unpow226.9%
associate-*r*27.0%
Simplified27.0%
associate-*l/27.4%
associate-/l*27.6%
Applied egg-rr27.6%
associate-*r/27.6%
times-frac34.5%
times-frac34.5%
Simplified34.5%
Final simplification66.1%
NOTE: M 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);
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: 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);
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) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): return w0
M = abs(M) 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)
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: 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|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
w0
\end{array}
Initial program 79.5%
*-commutative79.5%
times-frac79.9%
Simplified79.9%
Taylor expanded in M around 0 68.1%
Final simplification68.1%
herbie shell --seed 2023256
(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))))))