
(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) 1e+61)
(* w0 (sqrt (+ 1.0 (* (* h (pow (* M (/ (/ D 2.0) d)) 2.0)) (/ -1.0 l)))))
(*
w0
(sqrt (+ 1.0 (* (/ (* D h) (* (/ l D) (* (/ d M) (/ d M)))) -0.25))))))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) <= 1e+61) {
tmp = w0 * sqrt((1.0 + ((h * pow((M * ((D / 2.0) / d)), 2.0)) * (-1.0 / l))));
} else {
tmp = w0 * sqrt((1.0 + (((D * h) / ((l / D) * ((d / M) * (d / M)))) * -0.25)));
}
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)) ** 2.0d0) <= 1d+61) then
tmp = w0 * sqrt((1.0d0 + ((h * ((m * ((d / 2.0d0) / d_1)) ** 2.0d0)) * ((-1.0d0) / l))))
else
tmp = w0 * sqrt((1.0d0 + (((d * h) / ((l / d) * ((d_1 / m) * (d_1 / m)))) * (-0.25d0))))
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 (Math.pow(((M * D) / (2.0 * d)), 2.0) <= 1e+61) {
tmp = w0 * Math.sqrt((1.0 + ((h * Math.pow((M * ((D / 2.0) / d)), 2.0)) * (-1.0 / l))));
} else {
tmp = w0 * Math.sqrt((1.0 + (((D * h) / ((l / D) * ((d / M) * (d / M)))) * -0.25)));
}
return tmp;
}
M = abs(M) D = abs(D) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if math.pow(((M * D) / (2.0 * d)), 2.0) <= 1e+61: tmp = w0 * math.sqrt((1.0 + ((h * math.pow((M * ((D / 2.0) / d)), 2.0)) * (-1.0 / l)))) else: tmp = w0 * math.sqrt((1.0 + (((D * h) / ((l / D) * ((d / M) * (d / M)))) * -0.25))) 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)) ^ 2.0) <= 1e+61) tmp = Float64(w0 * sqrt(Float64(1.0 + Float64(Float64(h * (Float64(M * Float64(Float64(D / 2.0) / d)) ^ 2.0)) * Float64(-1.0 / l))))); else tmp = Float64(w0 * sqrt(Float64(1.0 + Float64(Float64(Float64(D * h) / Float64(Float64(l / D) * Float64(Float64(d / M) * Float64(d / M)))) * -0.25)))); 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)) ^ 2.0) <= 1e+61)
tmp = w0 * sqrt((1.0 + ((h * ((M * ((D / 2.0) / d)) ^ 2.0)) * (-1.0 / l))));
else
tmp = w0 * sqrt((1.0 + (((D * h) / ((l / D) * ((d / M) * (d / M)))) * -0.25)));
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[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision], 1e+61], N[(w0 * N[Sqrt[N[(1.0 + N[(N[(h * N[Power[N[(M * N[(N[(D / 2.0), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(-1.0 / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(w0 * N[Sqrt[N[(1.0 + N[(N[(N[(D * h), $MachinePrecision] / N[(N[(l / D), $MachinePrecision] * N[(N[(d / M), $MachinePrecision] * N[(d / M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -0.25), $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} \leq 10^{+61}:\\
\;\;\;\;w0 \cdot \sqrt{1 + \left(h \cdot {\left(M \cdot \frac{\frac{D}{2}}{d}\right)}^{2}\right) \cdot \frac{-1}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{1 + \frac{D \cdot h}{\frac{\ell}{D} \cdot \left(\frac{d}{M} \cdot \frac{d}{M}\right)} \cdot -0.25}\\
\end{array}
\end{array}
if (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) < 9.99999999999999949e60Initial program 92.5%
*-commutative92.5%
times-frac92.5%
Simplified92.5%
associate-*r/99.4%
frac-times99.4%
*-commutative99.4%
clear-num99.4%
*-commutative99.4%
div-inv99.4%
associate-*l*99.9%
associate-/r*99.9%
metadata-eval99.9%
Applied egg-rr99.9%
associate-/r/99.9%
associate-*r/99.9%
*-commutative99.9%
associate-*r/99.9%
metadata-eval99.9%
associate-/r/99.9%
associate-*r/99.9%
*-rgt-identity99.9%
associate-/l*99.9%
associate-*r/99.9%
associate-/r*99.9%
*-commutative99.9%
associate-/r*99.9%
Simplified99.9%
if 9.99999999999999949e60 < (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) Initial program 61.6%
*-commutative61.6%
times-frac62.9%
Simplified62.9%
Taylor expanded in w0 around 0 36.2%
*-commutative36.2%
cancel-sign-sub-inv36.2%
*-commutative36.2%
cancel-sign-sub-inv36.2%
*-commutative36.2%
cancel-sign-sub-inv36.2%
distribute-lft-neg-in36.2%
distribute-rgt-neg-in36.2%
Simplified45.8%
frac-times51.8%
times-frac66.3%
Applied egg-rr66.3%
Final simplification89.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 (<= (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ h l)) 4e-15) (* w0 (sqrt (- 1.0 (* (/ h l) (pow (* (/ D 2.0) (/ M d)) 2.0))))) (* w0 (+ 1.0 (* (* D (/ (/ D (/ (* (/ d M) (/ d M)) h)) 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 ((pow(((M * D) / (2.0 * d)), 2.0) * (h / l)) <= 4e-15) {
tmp = w0 * sqrt((1.0 - ((h / l) * pow(((D / 2.0) * (M / d)), 2.0))));
} else {
tmp = w0 * (1.0 + ((D * ((D / (((d / M) * (d / M)) / h)) / 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 * d) / (2.0d0 * d_1)) ** 2.0d0) * (h / l)) <= 4d-15) then
tmp = w0 * sqrt((1.0d0 - ((h / l) * (((d / 2.0d0) * (m / d_1)) ** 2.0d0))))
else
tmp = w0 * (1.0d0 + ((d * ((d / (((d_1 / m) * (d_1 / m)) / h)) / 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 ((Math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l)) <= 4e-15) {
tmp = w0 * Math.sqrt((1.0 - ((h / l) * Math.pow(((D / 2.0) * (M / d)), 2.0))));
} else {
tmp = w0 * (1.0 + ((D * ((D / (((d / M) * (d / M)) / h)) / 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 (math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l)) <= 4e-15: tmp = w0 * math.sqrt((1.0 - ((h / l) * math.pow(((D / 2.0) * (M / d)), 2.0)))) else: tmp = w0 * (1.0 + ((D * ((D / (((d / M) * (d / M)) / h)) / 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 (Float64((Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0) * Float64(h / l)) <= 4e-15) tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(h / l) * (Float64(Float64(D / 2.0) * Float64(M / d)) ^ 2.0))))); else tmp = Float64(w0 * Float64(1.0 + Float64(Float64(D * Float64(Float64(D / Float64(Float64(Float64(d / M) * Float64(d / M)) / h)) / 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 * D) / (2.0 * d)) ^ 2.0) * (h / l)) <= 4e-15)
tmp = w0 * sqrt((1.0 - ((h / l) * (((D / 2.0) * (M / d)) ^ 2.0))));
else
tmp = w0 * (1.0 + ((D * ((D / (((d / M) * (d / M)) / h)) / 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[N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision], 4e-15], N[(w0 * N[Sqrt[N[(1.0 - N[(N[(h / l), $MachinePrecision] * N[Power[N[(N[(D / 2.0), $MachinePrecision] * N[(M / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(w0 * N[(1.0 + N[(N[(D * N[(N[(D / N[(N[(N[(d / M), $MachinePrecision] * N[(d / M), $MachinePrecision]), $MachinePrecision] / h), $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}\;{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell} \leq 4 \cdot 10^{-15}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{h}{\ell} \cdot {\left(\frac{D}{2} \cdot \frac{M}{d}\right)}^{2}}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \left(1 + \left(D \cdot \frac{\frac{D}{\frac{\frac{d}{M} \cdot \frac{d}{M}}{h}}}{\ell}\right) \cdot -0.125\right)\\
\end{array}
\end{array}
if (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (/.f64 h l)) < 4.0000000000000003e-15Initial program 89.9%
*-commutative89.9%
times-frac89.0%
Simplified89.0%
if 4.0000000000000003e-15 < (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (/.f64 h l)) Initial program 0.0%
*-commutative0.0%
times-frac14.4%
Simplified14.4%
Taylor expanded in M around 0 38.5%
*-commutative38.5%
*-commutative38.5%
times-frac38.5%
*-commutative38.5%
unpow238.5%
unpow238.5%
*-commutative38.5%
unpow238.5%
Simplified38.5%
Taylor expanded in D around 0 38.5%
times-frac38.5%
unpow238.5%
associate-*r/48.0%
unpow248.0%
*-commutative48.0%
associate-*l/52.7%
unpow252.7%
associate-*l*57.5%
*-commutative57.5%
associate-*r/67.1%
*-commutative67.1%
associate-*l*67.1%
*-commutative67.1%
unpow267.1%
associate-*r/57.5%
unpow257.5%
Simplified57.5%
Taylor expanded in M around 0 62.3%
associate-/l*62.3%
unpow262.3%
*-commutative62.3%
associate-/r*67.1%
unpow267.1%
times-frac72.6%
unpow272.6%
Simplified72.6%
unpow272.6%
Applied egg-rr72.6%
Final simplification87.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
(let* ((t_0 (pow (/ (* M D) (* 2.0 d)) 2.0)))
(if (<= t_0 INFINITY)
(* w0 (sqrt (- 1.0 (/ h (/ l t_0)))))
(*
w0
(sqrt (+ 1.0 (* -0.25 (* (* M (* (/ D d) (/ D l))) (/ h (/ d M))))))))))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 = pow(((M * D) / (2.0 * d)), 2.0);
double tmp;
if (t_0 <= ((double) INFINITY)) {
tmp = w0 * sqrt((1.0 - (h / (l / t_0))));
} else {
tmp = w0 * sqrt((1.0 + (-0.25 * ((M * ((D / d) * (D / l))) * (h / (d / M))))));
}
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 t_0 = Math.pow(((M * D) / (2.0 * d)), 2.0);
double tmp;
if (t_0 <= Double.POSITIVE_INFINITY) {
tmp = w0 * Math.sqrt((1.0 - (h / (l / t_0))));
} else {
tmp = w0 * Math.sqrt((1.0 + (-0.25 * ((M * ((D / d) * (D / l))) * (h / (d / M))))));
}
return tmp;
}
M = abs(M) 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) tmp = 0 if t_0 <= math.inf: tmp = w0 * math.sqrt((1.0 - (h / (l / t_0)))) else: tmp = w0 * math.sqrt((1.0 + (-0.25 * ((M * ((D / d) * (D / l))) * (h / (d / M)))))) 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)) ^ 2.0 tmp = 0.0 if (t_0 <= Inf) tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(h / Float64(l / t_0))))); else tmp = Float64(w0 * sqrt(Float64(1.0 + Float64(-0.25 * Float64(Float64(M * Float64(Float64(D / d) * Float64(D / l))) * Float64(h / Float64(d / M))))))); 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)) ^ 2.0;
tmp = 0.0;
if (t_0 <= Inf)
tmp = w0 * sqrt((1.0 - (h / (l / t_0))));
else
tmp = w0 * sqrt((1.0 + (-0.25 * ((M * ((D / d) * (D / l))) * (h / (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: 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[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]}, If[LessEqual[t$95$0, Infinity], N[(w0 * N[Sqrt[N[(1.0 - N[(h / N[(l / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(w0 * N[Sqrt[N[(1.0 + N[(-0.25 * N[(N[(M * N[(N[(D / d), $MachinePrecision] * N[(D / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(h / N[(d / M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
t_0 := {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\\
\mathbf{if}\;t_0 \leq \infty:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{h}{\frac{\ell}{t_0}}}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{1 + -0.25 \cdot \left(\left(M \cdot \left(\frac{D}{d} \cdot \frac{D}{\ell}\right)\right) \cdot \frac{h}{\frac{d}{M}}\right)}\\
\end{array}
\end{array}
if (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) < +inf.0Initial program 82.8%
*-commutative82.8%
times-frac82.8%
Simplified82.8%
associate-*r/87.6%
frac-times87.6%
*-commutative87.6%
clear-num87.6%
*-commutative87.6%
div-inv87.6%
associate-*l*89.5%
associate-/r*89.5%
metadata-eval89.5%
Applied egg-rr89.5%
associate-/r/89.5%
associate-*r/89.5%
*-commutative89.5%
associate-*r/89.5%
metadata-eval89.5%
associate-/r/89.5%
associate-*r/89.5%
*-rgt-identity89.5%
associate-/l*89.5%
associate-*r/89.5%
associate-/r*89.5%
*-commutative89.5%
associate-/r*89.5%
Simplified89.5%
*-un-lft-identity89.5%
associate-*l/89.5%
*-un-lft-identity89.5%
associate-/l/89.5%
Applied egg-rr89.5%
*-lft-identity89.5%
associate-/l*89.8%
associate-*r/88.3%
*-commutative88.3%
*-commutative88.3%
Simplified88.3%
if +inf.0 < (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) Initial program 0.0%
*-commutative0.0%
times-frac100.0%
Simplified100.0%
Taylor expanded in w0 around 0 0.0%
*-commutative0.0%
cancel-sign-sub-inv0.0%
*-commutative0.0%
cancel-sign-sub-inv0.0%
*-commutative0.0%
cancel-sign-sub-inv0.0%
distribute-lft-neg-in0.0%
distribute-rgt-neg-in0.0%
Simplified0.0%
associate-*r/0.0%
associate-/r/0.0%
times-frac100.0%
Applied egg-rr100.0%
times-frac100.0%
*-commutative100.0%
Applied egg-rr100.0%
Taylor expanded in D around 0 0.0%
associate-/l/2.0%
associate-*l/100.0%
unpow2100.0%
associate-*r/100.0%
*-commutative100.0%
associate-*r/8.4%
associate-/l*8.4%
associate-/r/8.4%
Simplified8.4%
Final simplification88.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 (<= (pow (/ (* M D) (* 2.0 d)) 2.0) 1e+61)
(* w0 (sqrt (- 1.0 (/ (* h (pow (* M (* D (/ 0.5 d))) 2.0)) l))))
(*
w0
(sqrt (+ 1.0 (* (/ (* D h) (* (/ l D) (* (/ d M) (/ d M)))) -0.25))))))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) <= 1e+61) {
tmp = w0 * sqrt((1.0 - ((h * pow((M * (D * (0.5 / d))), 2.0)) / l)));
} else {
tmp = w0 * sqrt((1.0 + (((D * h) / ((l / D) * ((d / M) * (d / M)))) * -0.25)));
}
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)) ** 2.0d0) <= 1d+61) then
tmp = w0 * sqrt((1.0d0 - ((h * ((m * (d * (0.5d0 / d_1))) ** 2.0d0)) / l)))
else
tmp = w0 * sqrt((1.0d0 + (((d * h) / ((l / d) * ((d_1 / m) * (d_1 / m)))) * (-0.25d0))))
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 (Math.pow(((M * D) / (2.0 * d)), 2.0) <= 1e+61) {
tmp = w0 * Math.sqrt((1.0 - ((h * Math.pow((M * (D * (0.5 / d))), 2.0)) / l)));
} else {
tmp = w0 * Math.sqrt((1.0 + (((D * h) / ((l / D) * ((d / M) * (d / M)))) * -0.25)));
}
return tmp;
}
M = abs(M) D = abs(D) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if math.pow(((M * D) / (2.0 * d)), 2.0) <= 1e+61: tmp = w0 * math.sqrt((1.0 - ((h * math.pow((M * (D * (0.5 / d))), 2.0)) / l))) else: tmp = w0 * math.sqrt((1.0 + (((D * h) / ((l / D) * ((d / M) * (d / M)))) * -0.25))) 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)) ^ 2.0) <= 1e+61) tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(h * (Float64(M * Float64(D * Float64(0.5 / d))) ^ 2.0)) / l)))); else tmp = Float64(w0 * sqrt(Float64(1.0 + Float64(Float64(Float64(D * h) / Float64(Float64(l / D) * Float64(Float64(d / M) * Float64(d / M)))) * -0.25)))); 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)) ^ 2.0) <= 1e+61)
tmp = w0 * sqrt((1.0 - ((h * ((M * (D * (0.5 / d))) ^ 2.0)) / l)));
else
tmp = w0 * sqrt((1.0 + (((D * h) / ((l / D) * ((d / M) * (d / M)))) * -0.25)));
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[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision], 1e+61], N[(w0 * N[Sqrt[N[(1.0 - N[(N[(h * N[Power[N[(M * N[(D * N[(0.5 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(w0 * N[Sqrt[N[(1.0 + N[(N[(N[(D * h), $MachinePrecision] / N[(N[(l / D), $MachinePrecision] * N[(N[(d / M), $MachinePrecision] * N[(d / M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -0.25), $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} \leq 10^{+61}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{h \cdot {\left(M \cdot \left(D \cdot \frac{0.5}{d}\right)\right)}^{2}}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{1 + \frac{D \cdot h}{\frac{\ell}{D} \cdot \left(\frac{d}{M} \cdot \frac{d}{M}\right)} \cdot -0.25}\\
\end{array}
\end{array}
if (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) < 9.99999999999999949e60Initial program 92.5%
*-commutative92.5%
times-frac92.5%
Simplified92.5%
*-commutative92.5%
frac-times92.5%
*-commutative92.5%
associate-*l/99.4%
div-inv99.4%
associate-*l*99.9%
associate-/r*99.9%
metadata-eval99.9%
Applied egg-rr99.9%
if 9.99999999999999949e60 < (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) Initial program 61.6%
*-commutative61.6%
times-frac62.9%
Simplified62.9%
Taylor expanded in w0 around 0 36.2%
*-commutative36.2%
cancel-sign-sub-inv36.2%
*-commutative36.2%
cancel-sign-sub-inv36.2%
*-commutative36.2%
cancel-sign-sub-inv36.2%
distribute-lft-neg-in36.2%
distribute-rgt-neg-in36.2%
Simplified45.8%
frac-times51.8%
times-frac66.3%
Applied egg-rr66.3%
Final simplification89.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 (<= h -2e+103) (* w0 (sqrt (+ 1.0 (* -0.25 (* (* M (* (/ D d) (/ D l))) (/ h (/ d M))))))) (* w0 (+ 1.0 (* (* D (/ (/ D (/ (* (/ d M) (/ d M)) h)) 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 (h <= -2e+103) {
tmp = w0 * sqrt((1.0 + (-0.25 * ((M * ((D / d) * (D / l))) * (h / (d / M))))));
} else {
tmp = w0 * (1.0 + ((D * ((D / (((d / M) * (d / M)) / h)) / 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 (h <= (-2d+103)) then
tmp = w0 * sqrt((1.0d0 + ((-0.25d0) * ((m * ((d / d_1) * (d / l))) * (h / (d_1 / m))))))
else
tmp = w0 * (1.0d0 + ((d * ((d / (((d_1 / m) * (d_1 / m)) / h)) / 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 (h <= -2e+103) {
tmp = w0 * Math.sqrt((1.0 + (-0.25 * ((M * ((D / d) * (D / l))) * (h / (d / M))))));
} else {
tmp = w0 * (1.0 + ((D * ((D / (((d / M) * (d / M)) / h)) / 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 h <= -2e+103: tmp = w0 * math.sqrt((1.0 + (-0.25 * ((M * ((D / d) * (D / l))) * (h / (d / M)))))) else: tmp = w0 * (1.0 + ((D * ((D / (((d / M) * (d / M)) / h)) / 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 (h <= -2e+103) tmp = Float64(w0 * sqrt(Float64(1.0 + Float64(-0.25 * Float64(Float64(M * Float64(Float64(D / d) * Float64(D / l))) * Float64(h / Float64(d / M))))))); else tmp = Float64(w0 * Float64(1.0 + Float64(Float64(D * Float64(Float64(D / Float64(Float64(Float64(d / M) * Float64(d / M)) / h)) / 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 (h <= -2e+103)
tmp = w0 * sqrt((1.0 + (-0.25 * ((M * ((D / d) * (D / l))) * (h / (d / M))))));
else
tmp = w0 * (1.0 + ((D * ((D / (((d / M) * (d / M)) / h)) / 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[h, -2e+103], N[(w0 * N[Sqrt[N[(1.0 + N[(-0.25 * N[(N[(M * N[(N[(D / d), $MachinePrecision] * N[(D / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(h / N[(d / M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(w0 * N[(1.0 + N[(N[(D * N[(N[(D / N[(N[(N[(d / M), $MachinePrecision] * N[(d / M), $MachinePrecision]), $MachinePrecision] / h), $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}\;h \leq -2 \cdot 10^{+103}:\\
\;\;\;\;w0 \cdot \sqrt{1 + -0.25 \cdot \left(\left(M \cdot \left(\frac{D}{d} \cdot \frac{D}{\ell}\right)\right) \cdot \frac{h}{\frac{d}{M}}\right)}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \left(1 + \left(D \cdot \frac{\frac{D}{\frac{\frac{d}{M} \cdot \frac{d}{M}}{h}}}{\ell}\right) \cdot -0.125\right)\\
\end{array}
\end{array}
if h < -2e103Initial program 76.0%
*-commutative76.0%
times-frac78.6%
Simplified78.6%
Taylor expanded in w0 around 0 58.1%
*-commutative58.1%
cancel-sign-sub-inv58.1%
*-commutative58.1%
cancel-sign-sub-inv58.1%
*-commutative58.1%
cancel-sign-sub-inv58.1%
distribute-lft-neg-in58.1%
distribute-rgt-neg-in58.1%
Simplified63.2%
associate-*r/58.2%
associate-/r/58.2%
times-frac75.9%
Applied egg-rr75.9%
times-frac75.9%
*-commutative75.9%
Applied egg-rr75.9%
Taylor expanded in D around 0 66.0%
associate-/l/68.6%
associate-*l/71.0%
unpow271.0%
associate-*r/73.5%
*-commutative73.5%
associate-*r/73.7%
associate-/l*74.0%
associate-/r/76.3%
Simplified76.3%
if -2e103 < h Initial program 83.7%
*-commutative83.7%
times-frac83.7%
Simplified83.7%
Taylor expanded in M around 0 51.9%
*-commutative51.9%
*-commutative51.9%
times-frac53.7%
*-commutative53.7%
unpow253.7%
unpow253.7%
*-commutative53.7%
unpow253.7%
Simplified53.7%
Taylor expanded in D around 0 51.9%
times-frac52.8%
unpow252.8%
associate-*r/57.5%
unpow257.5%
*-commutative57.5%
associate-*l/58.9%
unpow258.9%
associate-*l*64.7%
*-commutative64.7%
associate-*r/67.7%
*-commutative67.7%
associate-*l*68.5%
*-commutative68.5%
unpow268.5%
associate-*r/66.9%
unpow266.9%
Simplified66.9%
Taylor expanded in M around 0 66.2%
associate-/l*66.2%
unpow266.2%
*-commutative66.2%
associate-/r*67.7%
unpow267.7%
times-frac78.8%
unpow278.8%
Simplified78.8%
unpow278.8%
Applied egg-rr78.8%
Final simplification78.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 4.8e-90) (* w0 (sqrt (+ 1.0 (* -0.25 (* (/ h (/ d M)) (/ (* D (/ D l)) (/ d M))))))) (* w0 (+ 1.0 (* (* D (/ (/ D (/ (* (/ d M) (/ d M)) h)) 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 <= 4.8e-90) {
tmp = w0 * sqrt((1.0 + (-0.25 * ((h / (d / M)) * ((D * (D / l)) / (d / M))))));
} else {
tmp = w0 * (1.0 + ((D * ((D / (((d / M) * (d / M)) / h)) / 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 <= 4.8d-90) then
tmp = w0 * sqrt((1.0d0 + ((-0.25d0) * ((h / (d_1 / m)) * ((d * (d / l)) / (d_1 / m))))))
else
tmp = w0 * (1.0d0 + ((d * ((d / (((d_1 / m) * (d_1 / m)) / h)) / 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 <= 4.8e-90) {
tmp = w0 * Math.sqrt((1.0 + (-0.25 * ((h / (d / M)) * ((D * (D / l)) / (d / M))))));
} else {
tmp = w0 * (1.0 + ((D * ((D / (((d / M) * (d / M)) / h)) / 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 <= 4.8e-90: tmp = w0 * math.sqrt((1.0 + (-0.25 * ((h / (d / M)) * ((D * (D / l)) / (d / M)))))) else: tmp = w0 * (1.0 + ((D * ((D / (((d / M) * (d / M)) / h)) / 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 <= 4.8e-90) tmp = Float64(w0 * sqrt(Float64(1.0 + Float64(-0.25 * Float64(Float64(h / Float64(d / M)) * Float64(Float64(D * Float64(D / l)) / Float64(d / M))))))); else tmp = Float64(w0 * Float64(1.0 + Float64(Float64(D * Float64(Float64(D / Float64(Float64(Float64(d / M) * Float64(d / M)) / h)) / 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 <= 4.8e-90)
tmp = w0 * sqrt((1.0 + (-0.25 * ((h / (d / M)) * ((D * (D / l)) / (d / M))))));
else
tmp = w0 * (1.0 + ((D * ((D / (((d / M) * (d / M)) / h)) / 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, 4.8e-90], N[(w0 * N[Sqrt[N[(1.0 + N[(-0.25 * N[(N[(h / N[(d / M), $MachinePrecision]), $MachinePrecision] * N[(N[(D * N[(D / l), $MachinePrecision]), $MachinePrecision] / N[(d / M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(w0 * N[(1.0 + N[(N[(D * N[(N[(D / N[(N[(N[(d / M), $MachinePrecision] * N[(d / M), $MachinePrecision]), $MachinePrecision] / h), $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 4.8 \cdot 10^{-90}:\\
\;\;\;\;w0 \cdot \sqrt{1 + -0.25 \cdot \left(\frac{h}{\frac{d}{M}} \cdot \frac{D \cdot \frac{D}{\ell}}{\frac{d}{M}}\right)}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \left(1 + \left(D \cdot \frac{\frac{D}{\frac{\frac{d}{M} \cdot \frac{d}{M}}{h}}}{\ell}\right) \cdot -0.125\right)\\
\end{array}
\end{array}
if d < 4.8000000000000003e-90Initial program 81.6%
*-commutative81.6%
times-frac81.1%
Simplified81.1%
Taylor expanded in w0 around 0 52.0%
*-commutative52.0%
cancel-sign-sub-inv52.0%
*-commutative52.0%
cancel-sign-sub-inv52.0%
*-commutative52.0%
cancel-sign-sub-inv52.0%
distribute-lft-neg-in52.0%
distribute-rgt-neg-in52.0%
Simplified58.4%
associate-*r/54.0%
associate-/r/54.0%
times-frac70.9%
Applied egg-rr70.9%
times-frac79.8%
*-commutative79.8%
Applied egg-rr79.8%
if 4.8000000000000003e-90 < d Initial program 83.9%
*-commutative83.9%
times-frac85.9%
Simplified85.9%
Taylor expanded in M around 0 55.2%
*-commutative55.2%
*-commutative55.2%
times-frac56.2%
*-commutative56.2%
unpow256.2%
unpow256.2%
*-commutative56.2%
unpow256.2%
Simplified56.2%
Taylor expanded in D around 0 55.2%
times-frac56.2%
unpow256.2%
associate-*r/59.3%
unpow259.3%
*-commutative59.3%
associate-*l/61.3%
unpow261.3%
associate-*l*70.9%
*-commutative70.9%
associate-*r/74.1%
*-commutative74.1%
associate-*l*76.0%
*-commutative76.0%
unpow276.0%
associate-*r/73.9%
unpow273.9%
Simplified73.9%
Taylor expanded in M around 0 72.0%
associate-/l*72.0%
unpow272.0%
*-commutative72.0%
associate-/r*75.1%
unpow275.1%
times-frac83.4%
unpow283.4%
Simplified83.4%
unpow283.4%
Applied egg-rr83.4%
Final simplification81.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
(let* ((t_0 (* (/ d M) (/ d M))))
(if (<= d 4e-13)
(* w0 (sqrt (+ 1.0 (* (/ (* D h) (* (/ l D) t_0)) -0.25))))
(* w0 (+ 1.0 (* (* D (/ (/ D (/ t_0 h)) 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 t_0 = (d / M) * (d / M);
double tmp;
if (d <= 4e-13) {
tmp = w0 * sqrt((1.0 + (((D * h) / ((l / D) * t_0)) * -0.25)));
} else {
tmp = w0 * (1.0 + ((D * ((D / (t_0 / h)) / 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) :: t_0
real(8) :: tmp
t_0 = (d_1 / m) * (d_1 / m)
if (d_1 <= 4d-13) then
tmp = w0 * sqrt((1.0d0 + (((d * h) / ((l / d) * t_0)) * (-0.25d0))))
else
tmp = w0 * (1.0d0 + ((d * ((d / (t_0 / h)) / 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 t_0 = (d / M) * (d / M);
double tmp;
if (d <= 4e-13) {
tmp = w0 * Math.sqrt((1.0 + (((D * h) / ((l / D) * t_0)) * -0.25)));
} else {
tmp = w0 * (1.0 + ((D * ((D / (t_0 / h)) / l)) * -0.125));
}
return tmp;
}
M = abs(M) D = abs(D) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): t_0 = (d / M) * (d / M) tmp = 0 if d <= 4e-13: tmp = w0 * math.sqrt((1.0 + (((D * h) / ((l / D) * t_0)) * -0.25))) else: tmp = w0 * (1.0 + ((D * ((D / (t_0 / h)) / l)) * -0.125)) 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(d / M) * Float64(d / M)) tmp = 0.0 if (d <= 4e-13) tmp = Float64(w0 * sqrt(Float64(1.0 + Float64(Float64(Float64(D * h) / Float64(Float64(l / D) * t_0)) * -0.25)))); else tmp = Float64(w0 * Float64(1.0 + Float64(Float64(D * Float64(Float64(D / Float64(t_0 / h)) / 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)
t_0 = (d / M) * (d / M);
tmp = 0.0;
if (d <= 4e-13)
tmp = w0 * sqrt((1.0 + (((D * h) / ((l / D) * t_0)) * -0.25)));
else
tmp = w0 * (1.0 + ((D * ((D / (t_0 / h)) / 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_] := Block[{t$95$0 = N[(N[(d / M), $MachinePrecision] * N[(d / M), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, 4e-13], N[(w0 * N[Sqrt[N[(1.0 + N[(N[(N[(D * h), $MachinePrecision] / N[(N[(l / D), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision] * -0.25), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(w0 * N[(1.0 + N[(N[(D * N[(N[(D / N[(t$95$0 / h), $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}
t_0 := \frac{d}{M} \cdot \frac{d}{M}\\
\mathbf{if}\;d \leq 4 \cdot 10^{-13}:\\
\;\;\;\;w0 \cdot \sqrt{1 + \frac{D \cdot h}{\frac{\ell}{D} \cdot t_0} \cdot -0.25}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \left(1 + \left(D \cdot \frac{\frac{D}{\frac{t_0}{h}}}{\ell}\right) \cdot -0.125\right)\\
\end{array}
\end{array}
if d < 4.0000000000000001e-13Initial program 81.8%
*-commutative81.8%
times-frac81.3%
Simplified81.3%
Taylor expanded in w0 around 0 52.5%
*-commutative52.5%
cancel-sign-sub-inv52.5%
*-commutative52.5%
cancel-sign-sub-inv52.5%
*-commutative52.5%
cancel-sign-sub-inv52.5%
distribute-lft-neg-in52.5%
distribute-rgt-neg-in52.5%
Simplified59.0%
frac-times62.0%
times-frac78.2%
Applied egg-rr78.2%
if 4.0000000000000001e-13 < d Initial program 83.9%
*-commutative83.9%
times-frac86.2%
Simplified86.2%
Taylor expanded in M around 0 54.7%
*-commutative54.7%
*-commutative54.7%
times-frac55.8%
*-commutative55.8%
unpow255.8%
unpow255.8%
*-commutative55.8%
unpow255.8%
Simplified55.8%
Taylor expanded in D around 0 54.7%
times-frac55.8%
unpow255.8%
associate-*r/58.1%
unpow258.1%
*-commutative58.1%
associate-*l/61.6%
unpow261.6%
associate-*l*71.3%
*-commutative71.3%
associate-*r/74.9%
*-commutative74.9%
associate-*l*76.0%
*-commutative76.0%
unpow276.0%
associate-*r/72.4%
unpow272.4%
Simplified72.4%
Taylor expanded in M around 0 71.4%
associate-/l*71.4%
unpow271.4%
*-commutative71.4%
associate-/r*75.0%
unpow275.0%
times-frac84.4%
unpow284.4%
Simplified84.4%
unpow284.4%
Applied egg-rr84.4%
Final simplification80.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 4e-122) w0 (* w0 (+ 1.0 (* -0.125 (* D (* (/ D (* d d)) (/ (* h (* M M)) 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 (M <= 4e-122) {
tmp = w0;
} else {
tmp = w0 * (1.0 + (-0.125 * (D * ((D / (d * d)) * ((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: 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 <= 4d-122) then
tmp = w0
else
tmp = w0 * (1.0d0 + ((-0.125d0) * (d * ((d / (d_1 * d_1)) * ((h * (m * m)) / l)))))
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 <= 4e-122) {
tmp = w0;
} else {
tmp = w0 * (1.0 + (-0.125 * (D * ((D / (d * d)) * ((h * (M * M)) / l)))));
}
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 <= 4e-122: tmp = w0 else: tmp = w0 * (1.0 + (-0.125 * (D * ((D / (d * d)) * ((h * (M * M)) / 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 (M <= 4e-122) tmp = w0; else tmp = Float64(w0 * Float64(1.0 + Float64(-0.125 * Float64(D * Float64(Float64(D / Float64(d * d)) * Float64(Float64(h * Float64(M * M)) / l)))))); 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 <= 4e-122)
tmp = w0;
else
tmp = w0 * (1.0 + (-0.125 * (D * ((D / (d * d)) * ((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: M and D should be sorted in increasing order before calling this function. code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[M, 4e-122], w0, N[(w0 * N[(1.0 + N[(-0.125 * N[(D * N[(N[(D / N[(d * d), $MachinePrecision]), $MachinePrecision] * N[(N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision] / l), $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 4 \cdot 10^{-122}:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \left(1 + -0.125 \cdot \left(D \cdot \left(\frac{D}{d \cdot d} \cdot \frac{h \cdot \left(M \cdot M\right)}{\ell}\right)\right)\right)\\
\end{array}
\end{array}
if M < 4.00000000000000024e-122Initial program 83.7%
*-commutative83.7%
times-frac82.1%
Simplified82.1%
Taylor expanded in M around 0 74.3%
if 4.00000000000000024e-122 < M Initial program 79.4%
*-commutative79.4%
times-frac85.1%
Simplified85.1%
Taylor expanded in M around 0 46.4%
*-commutative46.4%
*-commutative46.4%
times-frac49.4%
*-commutative49.4%
unpow249.4%
unpow249.4%
*-commutative49.4%
unpow249.4%
Simplified49.4%
Taylor expanded in D around 0 46.4%
times-frac47.8%
unpow247.8%
associate-*r/54.9%
unpow254.9%
*-commutative54.9%
associate-*l/56.5%
unpow256.5%
associate-*l*59.7%
*-commutative59.7%
associate-*r/61.2%
*-commutative61.2%
associate-*l*62.6%
*-commutative62.6%
unpow262.6%
associate-*r/62.5%
unpow262.5%
Simplified62.5%
Taylor expanded in M around 0 56.7%
unpow256.7%
*-commutative56.7%
unpow256.7%
*-commutative56.7%
times-frac59.7%
unpow259.7%
unpow259.7%
*-commutative59.7%
Simplified59.7%
Final simplification70.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 6.6e-126) w0 (* w0 (+ 1.0 (* -0.125 (* D (/ (* (* M M) (/ (* D h) (* d d))) 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 (M <= 6.6e-126) {
tmp = w0;
} else {
tmp = w0 * (1.0 + (-0.125 * (D * (((M * M) * ((D * 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: 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 <= 6.6d-126) then
tmp = w0
else
tmp = w0 * (1.0d0 + ((-0.125d0) * (d * (((m * m) * ((d * h) / (d_1 * d_1))) / l))))
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 <= 6.6e-126) {
tmp = w0;
} else {
tmp = w0 * (1.0 + (-0.125 * (D * (((M * M) * ((D * h) / (d * d))) / l))));
}
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 <= 6.6e-126: tmp = w0 else: tmp = w0 * (1.0 + (-0.125 * (D * (((M * M) * ((D * h) / (d * d))) / 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 (M <= 6.6e-126) tmp = w0; else tmp = Float64(w0 * Float64(1.0 + Float64(-0.125 * Float64(D * Float64(Float64(Float64(M * M) * Float64(Float64(D * h) / Float64(d * d))) / l))))); 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 <= 6.6e-126)
tmp = w0;
else
tmp = w0 * (1.0 + (-0.125 * (D * (((M * M) * ((D * 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: M and D should be sorted in increasing order before calling this function. code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[M, 6.6e-126], w0, N[(w0 * N[(1.0 + N[(-0.125 * N[(D * N[(N[(N[(M * M), $MachinePrecision] * N[(N[(D * h), $MachinePrecision] / N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $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 6.6 \cdot 10^{-126}:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \left(1 + -0.125 \cdot \left(D \cdot \frac{\left(M \cdot M\right) \cdot \frac{D \cdot h}{d \cdot d}}{\ell}\right)\right)\\
\end{array}
\end{array}
if M < 6.6000000000000001e-126Initial program 83.6%
*-commutative83.6%
times-frac82.0%
Simplified82.0%
Taylor expanded in M around 0 74.2%
if 6.6000000000000001e-126 < M Initial program 79.7%
*-commutative79.7%
times-frac85.3%
Simplified85.3%
Taylor expanded in M around 0 47.1%
*-commutative47.1%
*-commutative47.1%
times-frac50.1%
*-commutative50.1%
unpow250.1%
unpow250.1%
*-commutative50.1%
unpow250.1%
Simplified50.1%
Taylor expanded in D around 0 47.1%
times-frac48.5%
unpow248.5%
associate-*r/55.6%
unpow255.6%
*-commutative55.6%
associate-*l/57.1%
unpow257.1%
associate-*l*60.3%
*-commutative60.3%
associate-*r/61.8%
*-commutative61.8%
associate-*l*63.2%
*-commutative63.2%
unpow263.2%
associate-*r/63.0%
unpow263.0%
Simplified63.0%
Final simplification71.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 (if (<= M 3.5e-153) w0 (* w0 (+ 1.0 (* -0.125 (* D (/ (* (/ (* M M) d) (/ (* D h) d)) 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 (M <= 3.5e-153) {
tmp = w0;
} else {
tmp = w0 * (1.0 + (-0.125 * (D * ((((M * M) / d) * ((D * h) / d)) / l))));
}
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 <= 3.5d-153) then
tmp = w0
else
tmp = w0 * (1.0d0 + ((-0.125d0) * (d * ((((m * m) / d_1) * ((d * h) / d_1)) / l))))
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 <= 3.5e-153) {
tmp = w0;
} else {
tmp = w0 * (1.0 + (-0.125 * (D * ((((M * M) / d) * ((D * h) / d)) / l))));
}
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 <= 3.5e-153: tmp = w0 else: tmp = w0 * (1.0 + (-0.125 * (D * ((((M * M) / d) * ((D * h) / d)) / 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 (M <= 3.5e-153) tmp = w0; else tmp = Float64(w0 * Float64(1.0 + Float64(-0.125 * Float64(D * Float64(Float64(Float64(Float64(M * M) / d) * Float64(Float64(D * h) / d)) / l))))); 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 <= 3.5e-153)
tmp = w0;
else
tmp = w0 * (1.0 + (-0.125 * (D * ((((M * M) / d) * ((D * h) / 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: 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-153], w0, N[(w0 * N[(1.0 + N[(-0.125 * N[(D * N[(N[(N[(N[(M * M), $MachinePrecision] / d), $MachinePrecision] * N[(N[(D * h), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision] / l), $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 3.5 \cdot 10^{-153}:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \left(1 + -0.125 \cdot \left(D \cdot \frac{\frac{M \cdot M}{d} \cdot \frac{D \cdot h}{d}}{\ell}\right)\right)\\
\end{array}
\end{array}
if M < 3.49999999999999981e-153Initial program 83.4%
*-commutative83.4%
times-frac81.8%
Simplified81.8%
Taylor expanded in M around 0 74.3%
if 3.49999999999999981e-153 < M Initial program 80.3%
*-commutative80.3%
times-frac85.4%
Simplified85.4%
Taylor expanded in M around 0 46.8%
*-commutative46.8%
*-commutative46.8%
times-frac49.6%
*-commutative49.6%
unpow249.6%
unpow249.6%
*-commutative49.6%
unpow249.6%
Simplified49.6%
Taylor expanded in D around 0 46.8%
times-frac48.1%
unpow248.1%
associate-*r/54.5%
unpow254.5%
*-commutative54.5%
associate-*l/57.2%
unpow257.2%
associate-*l*60.3%
*-commutative60.3%
associate-*r/61.6%
*-commutative61.6%
associate-*l*62.9%
*-commutative62.9%
unpow262.9%
associate-*r/62.6%
unpow262.6%
Simplified62.6%
Taylor expanded in M around 0 58.8%
*-commutative58.8%
unpow258.8%
*-commutative58.8%
unpow258.8%
unpow258.8%
unpow258.8%
associate-*r*61.2%
*-commutative61.2%
times-frac67.9%
Simplified67.9%
Final simplification72.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 (* w0 (+ 1.0 (* (* D (/ (/ D (/ (* (/ d M) (/ d M)) h)) 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) {
return w0 * (1.0 + ((D * ((D / (((d / M) * (d / M)) / h)) / l)) * -0.125));
}
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 * (1.0d0 + ((d * ((d / (((d_1 / m) * (d_1 / m)) / h)) / l)) * (-0.125d0)))
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 * (1.0 + ((D * ((D / (((d / M) * (d / M)) / h)) / l)) * -0.125));
}
M = abs(M) D = abs(D) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): return w0 * (1.0 + ((D * ((D / (((d / M) * (d / M)) / h)) / l)) * -0.125))
M = abs(M) 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(Float64(Float64(d / M) * Float64(d / M)) / h)) / l)) * -0.125))) end
M = abs(M)
D = abs(D)
M, D = num2cell(sort([M, D])){:}
function tmp = code(w0, M, D, h, l, d)
tmp = w0 * (1.0 + ((D * ((D / (((d / M) * (d / M)) / h)) / l)) * -0.125));
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_] := N[(w0 * N[(1.0 + N[(N[(D * N[(N[(D / N[(N[(N[(d / M), $MachinePrecision] * N[(d / M), $MachinePrecision]), $MachinePrecision] / h), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
w0 \cdot \left(1 + \left(D \cdot \frac{\frac{D}{\frac{\frac{d}{M} \cdot \frac{d}{M}}{h}}}{\ell}\right) \cdot -0.125\right)
\end{array}
Initial program 82.5%
*-commutative82.5%
times-frac82.9%
Simplified82.9%
Taylor expanded in M around 0 52.5%
*-commutative52.5%
*-commutative52.5%
times-frac54.1%
*-commutative54.1%
unpow254.1%
unpow254.1%
*-commutative54.1%
unpow254.1%
Simplified54.1%
Taylor expanded in D around 0 52.5%
times-frac53.3%
unpow253.3%
associate-*r/57.6%
unpow257.6%
*-commutative57.6%
associate-*l/58.4%
unpow258.4%
associate-*l*63.8%
*-commutative63.8%
associate-*r/66.2%
*-commutative66.2%
associate-*l*66.9%
*-commutative66.9%
unpow266.9%
associate-*r/65.2%
unpow265.2%
Simplified65.2%
Taylor expanded in M around 0 65.4%
associate-/l*65.4%
unpow265.4%
*-commutative65.4%
associate-/r*67.1%
unpow267.1%
times-frac77.3%
unpow277.3%
Simplified77.3%
unpow277.3%
Applied egg-rr77.3%
Final simplification77.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 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 82.5%
*-commutative82.5%
times-frac82.9%
Simplified82.9%
Taylor expanded in M around 0 70.8%
Final simplification70.8%
herbie shell --seed 2023242
(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))))))