
(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 8 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}
M_m = (fabs.f64 M)
D_m = (fabs.f64 D)
d_m = (fabs.f64 d)
(FPCore (w0 M_m D_m h l d_m)
:precision binary64
(if (<= (* (pow (/ (* M_m D_m) (* 2.0 d_m)) 2.0) (/ h l)) -2e+257)
(*
w0
(pow
(exp
(*
0.25
(+
(+ (+ (* 2.0 (log M_m)) (log (* (/ h l) -0.25))) (* 2.0 (log D_m)))
(* -2.0 (log d_m)))))
2.0))
(*
w0
(sqrt
(-
1.0
(*
(/ (* h (* (* M_m 0.5) (/ D_m d_m))) l)
(* 0.5 (* D_m (/ M_m d_m)))))))))M_m = fabs(M);
D_m = fabs(D);
d_m = fabs(d);
double code(double w0, double M_m, double D_m, double h, double l, double d_m) {
double tmp;
if ((pow(((M_m * D_m) / (2.0 * d_m)), 2.0) * (h / l)) <= -2e+257) {
tmp = w0 * pow(exp((0.25 * ((((2.0 * log(M_m)) + log(((h / l) * -0.25))) + (2.0 * log(D_m))) + (-2.0 * log(d_m))))), 2.0);
} else {
tmp = w0 * sqrt((1.0 - (((h * ((M_m * 0.5) * (D_m / d_m))) / l) * (0.5 * (D_m * (M_m / d_m))))));
}
return tmp;
}
M_m = abs(M)
D_m = abs(D)
d_m = abs(d)
real(8) function code(w0, m_m, d_m, h, l, d_m_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m_m
real(8), intent (in) :: d_m
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d_m_1
real(8) :: tmp
if (((((m_m * d_m) / (2.0d0 * d_m_1)) ** 2.0d0) * (h / l)) <= (-2d+257)) then
tmp = w0 * (exp((0.25d0 * ((((2.0d0 * log(m_m)) + log(((h / l) * (-0.25d0)))) + (2.0d0 * log(d_m))) + ((-2.0d0) * log(d_m_1))))) ** 2.0d0)
else
tmp = w0 * sqrt((1.0d0 - (((h * ((m_m * 0.5d0) * (d_m / d_m_1))) / l) * (0.5d0 * (d_m * (m_m / d_m_1))))))
end if
code = tmp
end function
M_m = Math.abs(M);
D_m = Math.abs(D);
d_m = Math.abs(d);
public static double code(double w0, double M_m, double D_m, double h, double l, double d_m) {
double tmp;
if ((Math.pow(((M_m * D_m) / (2.0 * d_m)), 2.0) * (h / l)) <= -2e+257) {
tmp = w0 * Math.pow(Math.exp((0.25 * ((((2.0 * Math.log(M_m)) + Math.log(((h / l) * -0.25))) + (2.0 * Math.log(D_m))) + (-2.0 * Math.log(d_m))))), 2.0);
} else {
tmp = w0 * Math.sqrt((1.0 - (((h * ((M_m * 0.5) * (D_m / d_m))) / l) * (0.5 * (D_m * (M_m / d_m))))));
}
return tmp;
}
M_m = math.fabs(M) D_m = math.fabs(D) d_m = math.fabs(d) def code(w0, M_m, D_m, h, l, d_m): tmp = 0 if (math.pow(((M_m * D_m) / (2.0 * d_m)), 2.0) * (h / l)) <= -2e+257: tmp = w0 * math.pow(math.exp((0.25 * ((((2.0 * math.log(M_m)) + math.log(((h / l) * -0.25))) + (2.0 * math.log(D_m))) + (-2.0 * math.log(d_m))))), 2.0) else: tmp = w0 * math.sqrt((1.0 - (((h * ((M_m * 0.5) * (D_m / d_m))) / l) * (0.5 * (D_m * (M_m / d_m)))))) return tmp
M_m = abs(M) D_m = abs(D) d_m = abs(d) function code(w0, M_m, D_m, h, l, d_m) tmp = 0.0 if (Float64((Float64(Float64(M_m * D_m) / Float64(2.0 * d_m)) ^ 2.0) * Float64(h / l)) <= -2e+257) tmp = Float64(w0 * (exp(Float64(0.25 * Float64(Float64(Float64(Float64(2.0 * log(M_m)) + log(Float64(Float64(h / l) * -0.25))) + Float64(2.0 * log(D_m))) + Float64(-2.0 * log(d_m))))) ^ 2.0)); else tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(Float64(h * Float64(Float64(M_m * 0.5) * Float64(D_m / d_m))) / l) * Float64(0.5 * Float64(D_m * Float64(M_m / d_m))))))); end return tmp end
M_m = abs(M); D_m = abs(D); d_m = abs(d); function tmp_2 = code(w0, M_m, D_m, h, l, d_m) tmp = 0.0; if (((((M_m * D_m) / (2.0 * d_m)) ^ 2.0) * (h / l)) <= -2e+257) tmp = w0 * (exp((0.25 * ((((2.0 * log(M_m)) + log(((h / l) * -0.25))) + (2.0 * log(D_m))) + (-2.0 * log(d_m))))) ^ 2.0); else tmp = w0 * sqrt((1.0 - (((h * ((M_m * 0.5) * (D_m / d_m))) / l) * (0.5 * (D_m * (M_m / d_m)))))); end tmp_2 = tmp; end
M_m = N[Abs[M], $MachinePrecision] D_m = N[Abs[D], $MachinePrecision] d_m = N[Abs[d], $MachinePrecision] code[w0_, M$95$m_, D$95$m_, h_, l_, d$95$m_] := If[LessEqual[N[(N[Power[N[(N[(M$95$m * D$95$m), $MachinePrecision] / N[(2.0 * d$95$m), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision], -2e+257], N[(w0 * N[Power[N[Exp[N[(0.25 * N[(N[(N[(N[(2.0 * N[Log[M$95$m], $MachinePrecision]), $MachinePrecision] + N[Log[N[(N[(h / l), $MachinePrecision] * -0.25), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[Log[D$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-2.0 * N[Log[d$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], N[(w0 * N[Sqrt[N[(1.0 - N[(N[(N[(h * N[(N[(M$95$m * 0.5), $MachinePrecision] * N[(D$95$m / d$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(0.5 * N[(D$95$m * N[(M$95$m / d$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
d_m = \left|d\right|
\\
\begin{array}{l}
\mathbf{if}\;{\left(\frac{M\_m \cdot D\_m}{2 \cdot d\_m}\right)}^{2} \cdot \frac{h}{\ell} \leq -2 \cdot 10^{+257}:\\
\;\;\;\;w0 \cdot {\left(e^{0.25 \cdot \left(\left(\left(2 \cdot \log M\_m + \log \left(\frac{h}{\ell} \cdot -0.25\right)\right) + 2 \cdot \log D\_m\right) + -2 \cdot \log d\_m\right)}\right)}^{2}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{h \cdot \left(\left(M\_m \cdot 0.5\right) \cdot \frac{D\_m}{d\_m}\right)}{\ell} \cdot \left(0.5 \cdot \left(D\_m \cdot \frac{M\_m}{d\_m}\right)\right)}\\
\end{array}
\end{array}
if (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (/.f64 h l)) < -2.00000000000000006e257Initial program 60.5%
Simplified63.2%
add-sqr-sqrt63.2%
pow263.2%
Applied egg-rr63.2%
Taylor expanded in d around 0 35.6%
Taylor expanded in D around 0 9.1%
distribute-lft-neg-in9.1%
metadata-eval9.1%
associate-/l*8.3%
Simplified8.3%
Taylor expanded in M around 0 2.7%
+-commutative2.7%
Simplified2.7%
if -2.00000000000000006e257 < (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (/.f64 h l)) Initial program 89.2%
Simplified90.3%
associate-*r/97.1%
add-sqr-sqrt97.1%
pow297.1%
unpow297.1%
sqrt-prod62.6%
add-sqr-sqrt97.1%
*-un-lft-identity97.1%
times-frac97.1%
metadata-eval97.1%
Applied egg-rr97.1%
associate-*r/90.3%
*-commutative90.3%
unpow290.3%
associate-*r*91.5%
associate-*r/91.5%
associate-*r/91.5%
Applied egg-rr91.5%
associate-*l/99.4%
associate-*r/99.4%
associate-*r*99.4%
Applied egg-rr99.4%
Taylor expanded in M around 0 97.0%
associate-/l*98.4%
Simplified98.4%
Final simplification72.2%
M_m = (fabs.f64 M)
D_m = (fabs.f64 D)
d_m = (fabs.f64 d)
(FPCore (w0 M_m D_m h l d_m)
:precision binary64
(if (<= (* (pow (/ (* M_m D_m) (* 2.0 d_m)) 2.0) (/ h l)) -2e+265)
(*
w0
(pow
(exp
(*
0.25
(+
(log (* -0.25 (/ (* h (pow M_m 2.0)) l)))
(+ (* 2.0 (log D_m)) (* -2.0 (log d_m))))))
2.0))
(*
w0
(sqrt
(-
1.0
(*
(/ (* h (* (* M_m 0.5) (/ D_m d_m))) l)
(* 0.5 (* D_m (/ M_m d_m)))))))))M_m = fabs(M);
D_m = fabs(D);
d_m = fabs(d);
double code(double w0, double M_m, double D_m, double h, double l, double d_m) {
double tmp;
if ((pow(((M_m * D_m) / (2.0 * d_m)), 2.0) * (h / l)) <= -2e+265) {
tmp = w0 * pow(exp((0.25 * (log((-0.25 * ((h * pow(M_m, 2.0)) / l))) + ((2.0 * log(D_m)) + (-2.0 * log(d_m)))))), 2.0);
} else {
tmp = w0 * sqrt((1.0 - (((h * ((M_m * 0.5) * (D_m / d_m))) / l) * (0.5 * (D_m * (M_m / d_m))))));
}
return tmp;
}
M_m = abs(M)
D_m = abs(D)
d_m = abs(d)
real(8) function code(w0, m_m, d_m, h, l, d_m_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m_m
real(8), intent (in) :: d_m
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d_m_1
real(8) :: tmp
if (((((m_m * d_m) / (2.0d0 * d_m_1)) ** 2.0d0) * (h / l)) <= (-2d+265)) then
tmp = w0 * (exp((0.25d0 * (log(((-0.25d0) * ((h * (m_m ** 2.0d0)) / l))) + ((2.0d0 * log(d_m)) + ((-2.0d0) * log(d_m_1)))))) ** 2.0d0)
else
tmp = w0 * sqrt((1.0d0 - (((h * ((m_m * 0.5d0) * (d_m / d_m_1))) / l) * (0.5d0 * (d_m * (m_m / d_m_1))))))
end if
code = tmp
end function
M_m = Math.abs(M);
D_m = Math.abs(D);
d_m = Math.abs(d);
public static double code(double w0, double M_m, double D_m, double h, double l, double d_m) {
double tmp;
if ((Math.pow(((M_m * D_m) / (2.0 * d_m)), 2.0) * (h / l)) <= -2e+265) {
tmp = w0 * Math.pow(Math.exp((0.25 * (Math.log((-0.25 * ((h * Math.pow(M_m, 2.0)) / l))) + ((2.0 * Math.log(D_m)) + (-2.0 * Math.log(d_m)))))), 2.0);
} else {
tmp = w0 * Math.sqrt((1.0 - (((h * ((M_m * 0.5) * (D_m / d_m))) / l) * (0.5 * (D_m * (M_m / d_m))))));
}
return tmp;
}
M_m = math.fabs(M) D_m = math.fabs(D) d_m = math.fabs(d) def code(w0, M_m, D_m, h, l, d_m): tmp = 0 if (math.pow(((M_m * D_m) / (2.0 * d_m)), 2.0) * (h / l)) <= -2e+265: tmp = w0 * math.pow(math.exp((0.25 * (math.log((-0.25 * ((h * math.pow(M_m, 2.0)) / l))) + ((2.0 * math.log(D_m)) + (-2.0 * math.log(d_m)))))), 2.0) else: tmp = w0 * math.sqrt((1.0 - (((h * ((M_m * 0.5) * (D_m / d_m))) / l) * (0.5 * (D_m * (M_m / d_m)))))) return tmp
M_m = abs(M) D_m = abs(D) d_m = abs(d) function code(w0, M_m, D_m, h, l, d_m) tmp = 0.0 if (Float64((Float64(Float64(M_m * D_m) / Float64(2.0 * d_m)) ^ 2.0) * Float64(h / l)) <= -2e+265) tmp = Float64(w0 * (exp(Float64(0.25 * Float64(log(Float64(-0.25 * Float64(Float64(h * (M_m ^ 2.0)) / l))) + Float64(Float64(2.0 * log(D_m)) + Float64(-2.0 * log(d_m)))))) ^ 2.0)); else tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(Float64(h * Float64(Float64(M_m * 0.5) * Float64(D_m / d_m))) / l) * Float64(0.5 * Float64(D_m * Float64(M_m / d_m))))))); end return tmp end
M_m = abs(M); D_m = abs(D); d_m = abs(d); function tmp_2 = code(w0, M_m, D_m, h, l, d_m) tmp = 0.0; if (((((M_m * D_m) / (2.0 * d_m)) ^ 2.0) * (h / l)) <= -2e+265) tmp = w0 * (exp((0.25 * (log((-0.25 * ((h * (M_m ^ 2.0)) / l))) + ((2.0 * log(D_m)) + (-2.0 * log(d_m)))))) ^ 2.0); else tmp = w0 * sqrt((1.0 - (((h * ((M_m * 0.5) * (D_m / d_m))) / l) * (0.5 * (D_m * (M_m / d_m)))))); end tmp_2 = tmp; end
M_m = N[Abs[M], $MachinePrecision] D_m = N[Abs[D], $MachinePrecision] d_m = N[Abs[d], $MachinePrecision] code[w0_, M$95$m_, D$95$m_, h_, l_, d$95$m_] := If[LessEqual[N[(N[Power[N[(N[(M$95$m * D$95$m), $MachinePrecision] / N[(2.0 * d$95$m), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision], -2e+265], N[(w0 * N[Power[N[Exp[N[(0.25 * N[(N[Log[N[(-0.25 * N[(N[(h * N[Power[M$95$m, 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + N[(N[(2.0 * N[Log[D$95$m], $MachinePrecision]), $MachinePrecision] + N[(-2.0 * N[Log[d$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], N[(w0 * N[Sqrt[N[(1.0 - N[(N[(N[(h * N[(N[(M$95$m * 0.5), $MachinePrecision] * N[(D$95$m / d$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(0.5 * N[(D$95$m * N[(M$95$m / d$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
d_m = \left|d\right|
\\
\begin{array}{l}
\mathbf{if}\;{\left(\frac{M\_m \cdot D\_m}{2 \cdot d\_m}\right)}^{2} \cdot \frac{h}{\ell} \leq -2 \cdot 10^{+265}:\\
\;\;\;\;w0 \cdot {\left(e^{0.25 \cdot \left(\log \left(-0.25 \cdot \frac{h \cdot {M\_m}^{2}}{\ell}\right) + \left(2 \cdot \log D\_m + -2 \cdot \log d\_m\right)\right)}\right)}^{2}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{h \cdot \left(\left(M\_m \cdot 0.5\right) \cdot \frac{D\_m}{d\_m}\right)}{\ell} \cdot \left(0.5 \cdot \left(D\_m \cdot \frac{M\_m}{d\_m}\right)\right)}\\
\end{array}
\end{array}
if (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (/.f64 h l)) < -2.00000000000000013e265Initial program 59.4%
Simplified62.2%
add-sqr-sqrt62.1%
pow262.1%
Applied egg-rr62.1%
Taylor expanded in d around 0 36.6%
Taylor expanded in l around 0 22.4%
mul-1-neg22.4%
unsub-neg22.4%
distribute-lft-neg-in22.4%
metadata-eval22.4%
associate-*r*22.4%
associate-*r*23.7%
associate-*r*23.7%
unpow223.7%
unpow223.7%
swap-sqr23.7%
unpow223.7%
associate-*r*23.7%
log-div37.9%
associate-*r/37.9%
associate-/l*37.1%
Simplified37.1%
Taylor expanded in D around 0 9.4%
if -2.00000000000000013e265 < (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (/.f64 h l)) Initial program 89.3%
Simplified90.4%
associate-*r/97.2%
add-sqr-sqrt97.2%
pow297.2%
unpow297.2%
sqrt-prod62.5%
add-sqr-sqrt97.2%
*-un-lft-identity97.2%
times-frac97.2%
metadata-eval97.2%
Applied egg-rr97.2%
associate-*r/90.4%
*-commutative90.4%
unpow290.4%
associate-*r*91.6%
associate-*r/91.6%
associate-*r/91.6%
Applied egg-rr91.6%
associate-*l/99.4%
associate-*r/99.4%
associate-*r*99.4%
Applied egg-rr99.4%
Taylor expanded in M around 0 97.1%
associate-/l*97.9%
Simplified97.9%
Final simplification74.4%
M_m = (fabs.f64 M)
D_m = (fabs.f64 D)
d_m = (fabs.f64 d)
(FPCore (w0 M_m D_m h l d_m)
:precision binary64
(if (<= h -5e-307)
(* w0 (sqrt (- 1.0 (/ (* h (pow (* D_m (/ (* M_m 0.5) d_m)) 2.0)) l))))
(*
w0
(sqrt (- 1.0 (/ (pow (* (sqrt h) (* D_m (* M_m (/ 0.5 d_m)))) 2.0) l))))))M_m = fabs(M);
D_m = fabs(D);
d_m = fabs(d);
double code(double w0, double M_m, double D_m, double h, double l, double d_m) {
double tmp;
if (h <= -5e-307) {
tmp = w0 * sqrt((1.0 - ((h * pow((D_m * ((M_m * 0.5) / d_m)), 2.0)) / l)));
} else {
tmp = w0 * sqrt((1.0 - (pow((sqrt(h) * (D_m * (M_m * (0.5 / d_m)))), 2.0) / l)));
}
return tmp;
}
M_m = abs(M)
D_m = abs(D)
d_m = abs(d)
real(8) function code(w0, m_m, d_m, h, l, d_m_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m_m
real(8), intent (in) :: d_m
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d_m_1
real(8) :: tmp
if (h <= (-5d-307)) then
tmp = w0 * sqrt((1.0d0 - ((h * ((d_m * ((m_m * 0.5d0) / d_m_1)) ** 2.0d0)) / l)))
else
tmp = w0 * sqrt((1.0d0 - (((sqrt(h) * (d_m * (m_m * (0.5d0 / d_m_1)))) ** 2.0d0) / l)))
end if
code = tmp
end function
M_m = Math.abs(M);
D_m = Math.abs(D);
d_m = Math.abs(d);
public static double code(double w0, double M_m, double D_m, double h, double l, double d_m) {
double tmp;
if (h <= -5e-307) {
tmp = w0 * Math.sqrt((1.0 - ((h * Math.pow((D_m * ((M_m * 0.5) / d_m)), 2.0)) / l)));
} else {
tmp = w0 * Math.sqrt((1.0 - (Math.pow((Math.sqrt(h) * (D_m * (M_m * (0.5 / d_m)))), 2.0) / l)));
}
return tmp;
}
M_m = math.fabs(M) D_m = math.fabs(D) d_m = math.fabs(d) def code(w0, M_m, D_m, h, l, d_m): tmp = 0 if h <= -5e-307: tmp = w0 * math.sqrt((1.0 - ((h * math.pow((D_m * ((M_m * 0.5) / d_m)), 2.0)) / l))) else: tmp = w0 * math.sqrt((1.0 - (math.pow((math.sqrt(h) * (D_m * (M_m * (0.5 / d_m)))), 2.0) / l))) return tmp
M_m = abs(M) D_m = abs(D) d_m = abs(d) function code(w0, M_m, D_m, h, l, d_m) tmp = 0.0 if (h <= -5e-307) tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(h * (Float64(D_m * Float64(Float64(M_m * 0.5) / d_m)) ^ 2.0)) / l)))); else tmp = Float64(w0 * sqrt(Float64(1.0 - Float64((Float64(sqrt(h) * Float64(D_m * Float64(M_m * Float64(0.5 / d_m)))) ^ 2.0) / l)))); end return tmp end
M_m = abs(M); D_m = abs(D); d_m = abs(d); function tmp_2 = code(w0, M_m, D_m, h, l, d_m) tmp = 0.0; if (h <= -5e-307) tmp = w0 * sqrt((1.0 - ((h * ((D_m * ((M_m * 0.5) / d_m)) ^ 2.0)) / l))); else tmp = w0 * sqrt((1.0 - (((sqrt(h) * (D_m * (M_m * (0.5 / d_m)))) ^ 2.0) / l))); end tmp_2 = tmp; end
M_m = N[Abs[M], $MachinePrecision] D_m = N[Abs[D], $MachinePrecision] d_m = N[Abs[d], $MachinePrecision] code[w0_, M$95$m_, D$95$m_, h_, l_, d$95$m_] := If[LessEqual[h, -5e-307], N[(w0 * N[Sqrt[N[(1.0 - N[(N[(h * N[Power[N[(D$95$m * N[(N[(M$95$m * 0.5), $MachinePrecision] / d$95$m), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(w0 * N[Sqrt[N[(1.0 - N[(N[Power[N[(N[Sqrt[h], $MachinePrecision] * N[(D$95$m * N[(M$95$m * N[(0.5 / d$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
d_m = \left|d\right|
\\
\begin{array}{l}
\mathbf{if}\;h \leq -5 \cdot 10^{-307}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{h \cdot {\left(D\_m \cdot \frac{M\_m \cdot 0.5}{d\_m}\right)}^{2}}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{{\left(\sqrt{h} \cdot \left(D\_m \cdot \left(M\_m \cdot \frac{0.5}{d\_m}\right)\right)\right)}^{2}}{\ell}}\\
\end{array}
\end{array}
if h < -5.00000000000000014e-307Initial program 82.5%
Simplified83.3%
associate-*r/88.6%
add-sqr-sqrt88.6%
pow288.6%
unpow288.6%
sqrt-prod53.1%
add-sqr-sqrt88.6%
*-un-lft-identity88.6%
times-frac88.6%
metadata-eval88.6%
Applied egg-rr88.6%
associate-*r*88.6%
clear-num88.6%
un-div-inv88.6%
Applied egg-rr88.6%
associate-/r/86.5%
Simplified86.5%
if -5.00000000000000014e-307 < h Initial program 79.9%
Simplified82.4%
associate-*r/88.9%
add-sqr-sqrt88.9%
pow288.9%
unpow288.9%
sqrt-prod53.9%
add-sqr-sqrt88.9%
*-un-lft-identity88.9%
times-frac88.9%
metadata-eval88.9%
Applied egg-rr88.9%
add-sqr-sqrt88.9%
*-un-lft-identity88.9%
times-frac88.9%
sqrt-prod88.9%
unpow288.9%
sqrt-prod53.9%
add-sqr-sqrt77.9%
associate-*r/77.9%
Applied egg-rr94.3%
/-rgt-identity94.3%
associate-*r/94.2%
unpow294.2%
*-commutative94.2%
*-commutative94.2%
*-commutative94.2%
associate-/r/94.3%
associate-*r/94.3%
associate-/r/94.3%
Simplified94.3%
Final simplification90.1%
M_m = (fabs.f64 M)
D_m = (fabs.f64 D)
d_m = (fabs.f64 d)
(FPCore (w0 M_m D_m h l d_m)
:precision binary64
(let* ((t_0 (* M_m (/ (* D_m 0.5) d_m))))
(if (<= M_m 1.45e-19)
(*
w0
(sqrt
(-
1.0
(*
(* h (/ (/ (* M_m (* D_m 0.5)) d_m) l))
(/ (* D_m (* M_m 0.5)) d_m)))))
(* w0 (sqrt (- 1.0 (* t_0 (* (/ h l) t_0))))))))M_m = fabs(M);
D_m = fabs(D);
d_m = fabs(d);
double code(double w0, double M_m, double D_m, double h, double l, double d_m) {
double t_0 = M_m * ((D_m * 0.5) / d_m);
double tmp;
if (M_m <= 1.45e-19) {
tmp = w0 * sqrt((1.0 - ((h * (((M_m * (D_m * 0.5)) / d_m) / l)) * ((D_m * (M_m * 0.5)) / d_m))));
} else {
tmp = w0 * sqrt((1.0 - (t_0 * ((h / l) * t_0))));
}
return tmp;
}
M_m = abs(M)
D_m = abs(D)
d_m = abs(d)
real(8) function code(w0, m_m, d_m, h, l, d_m_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m_m
real(8), intent (in) :: d_m
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d_m_1
real(8) :: t_0
real(8) :: tmp
t_0 = m_m * ((d_m * 0.5d0) / d_m_1)
if (m_m <= 1.45d-19) then
tmp = w0 * sqrt((1.0d0 - ((h * (((m_m * (d_m * 0.5d0)) / d_m_1) / l)) * ((d_m * (m_m * 0.5d0)) / d_m_1))))
else
tmp = w0 * sqrt((1.0d0 - (t_0 * ((h / l) * t_0))))
end if
code = tmp
end function
M_m = Math.abs(M);
D_m = Math.abs(D);
d_m = Math.abs(d);
public static double code(double w0, double M_m, double D_m, double h, double l, double d_m) {
double t_0 = M_m * ((D_m * 0.5) / d_m);
double tmp;
if (M_m <= 1.45e-19) {
tmp = w0 * Math.sqrt((1.0 - ((h * (((M_m * (D_m * 0.5)) / d_m) / l)) * ((D_m * (M_m * 0.5)) / d_m))));
} else {
tmp = w0 * Math.sqrt((1.0 - (t_0 * ((h / l) * t_0))));
}
return tmp;
}
M_m = math.fabs(M) D_m = math.fabs(D) d_m = math.fabs(d) def code(w0, M_m, D_m, h, l, d_m): t_0 = M_m * ((D_m * 0.5) / d_m) tmp = 0 if M_m <= 1.45e-19: tmp = w0 * math.sqrt((1.0 - ((h * (((M_m * (D_m * 0.5)) / d_m) / l)) * ((D_m * (M_m * 0.5)) / d_m)))) else: tmp = w0 * math.sqrt((1.0 - (t_0 * ((h / l) * t_0)))) return tmp
M_m = abs(M) D_m = abs(D) d_m = abs(d) function code(w0, M_m, D_m, h, l, d_m) t_0 = Float64(M_m * Float64(Float64(D_m * 0.5) / d_m)) tmp = 0.0 if (M_m <= 1.45e-19) tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(h * Float64(Float64(Float64(M_m * Float64(D_m * 0.5)) / d_m) / l)) * Float64(Float64(D_m * Float64(M_m * 0.5)) / d_m))))); else tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(t_0 * Float64(Float64(h / l) * t_0))))); end return tmp end
M_m = abs(M); D_m = abs(D); d_m = abs(d); function tmp_2 = code(w0, M_m, D_m, h, l, d_m) t_0 = M_m * ((D_m * 0.5) / d_m); tmp = 0.0; if (M_m <= 1.45e-19) tmp = w0 * sqrt((1.0 - ((h * (((M_m * (D_m * 0.5)) / d_m) / l)) * ((D_m * (M_m * 0.5)) / d_m)))); else tmp = w0 * sqrt((1.0 - (t_0 * ((h / l) * t_0)))); end tmp_2 = tmp; end
M_m = N[Abs[M], $MachinePrecision]
D_m = N[Abs[D], $MachinePrecision]
d_m = N[Abs[d], $MachinePrecision]
code[w0_, M$95$m_, D$95$m_, h_, l_, d$95$m_] := Block[{t$95$0 = N[(M$95$m * N[(N[(D$95$m * 0.5), $MachinePrecision] / d$95$m), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[M$95$m, 1.45e-19], N[(w0 * N[Sqrt[N[(1.0 - N[(N[(h * N[(N[(N[(M$95$m * N[(D$95$m * 0.5), $MachinePrecision]), $MachinePrecision] / d$95$m), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] * N[(N[(D$95$m * N[(M$95$m * 0.5), $MachinePrecision]), $MachinePrecision] / d$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(w0 * N[Sqrt[N[(1.0 - N[(t$95$0 * N[(N[(h / l), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
d_m = \left|d\right|
\\
\begin{array}{l}
t_0 := M\_m \cdot \frac{D\_m \cdot 0.5}{d\_m}\\
\mathbf{if}\;M\_m \leq 1.45 \cdot 10^{-19}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \left(h \cdot \frac{\frac{M\_m \cdot \left(D\_m \cdot 0.5\right)}{d\_m}}{\ell}\right) \cdot \frac{D\_m \cdot \left(M\_m \cdot 0.5\right)}{d\_m}}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{1 - t\_0 \cdot \left(\frac{h}{\ell} \cdot t\_0\right)}\\
\end{array}
\end{array}
if M < 1.45e-19Initial program 84.0%
Simplified84.5%
associate-*r/91.3%
add-sqr-sqrt91.3%
pow291.3%
unpow291.3%
sqrt-prod59.1%
add-sqr-sqrt91.3%
*-un-lft-identity91.3%
times-frac91.3%
metadata-eval91.3%
Applied egg-rr91.3%
associate-*r/84.5%
*-commutative84.5%
unpow284.5%
associate-*r*86.1%
associate-*r/86.1%
associate-*r/86.1%
Applied egg-rr86.1%
associate-*l/93.5%
associate-*r/93.5%
associate-*r*93.5%
Applied egg-rr93.5%
associate-/l*93.0%
associate-*r/91.1%
associate-*l*91.1%
Simplified91.1%
associate-*r/91.1%
associate-*r*91.1%
Applied egg-rr91.1%
if 1.45e-19 < M Initial program 73.9%
Simplified78.3%
associate-*r/81.4%
add-sqr-sqrt81.4%
pow281.4%
unpow281.4%
sqrt-prod37.4%
add-sqr-sqrt81.4%
*-un-lft-identity81.4%
times-frac81.4%
metadata-eval81.4%
Applied egg-rr81.4%
associate-*r/78.3%
*-commutative78.3%
unpow278.3%
associate-*r*81.3%
associate-*r/81.3%
associate-*r/81.3%
Applied egg-rr81.3%
Final simplification88.6%
M_m = (fabs.f64 M)
D_m = (fabs.f64 D)
d_m = (fabs.f64 d)
(FPCore (w0 M_m D_m h l d_m)
:precision binary64
(*
w0
(sqrt
(-
1.0
(* (* h (/ (/ (* M_m (* D_m 0.5)) d_m) l)) (* M_m (/ (* D_m 0.5) d_m)))))))M_m = fabs(M);
D_m = fabs(D);
d_m = fabs(d);
double code(double w0, double M_m, double D_m, double h, double l, double d_m) {
return w0 * sqrt((1.0 - ((h * (((M_m * (D_m * 0.5)) / d_m) / l)) * (M_m * ((D_m * 0.5) / d_m)))));
}
M_m = abs(M)
D_m = abs(D)
d_m = abs(d)
real(8) function code(w0, m_m, d_m, h, l, d_m_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m_m
real(8), intent (in) :: d_m
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d_m_1
code = w0 * sqrt((1.0d0 - ((h * (((m_m * (d_m * 0.5d0)) / d_m_1) / l)) * (m_m * ((d_m * 0.5d0) / d_m_1)))))
end function
M_m = Math.abs(M);
D_m = Math.abs(D);
d_m = Math.abs(d);
public static double code(double w0, double M_m, double D_m, double h, double l, double d_m) {
return w0 * Math.sqrt((1.0 - ((h * (((M_m * (D_m * 0.5)) / d_m) / l)) * (M_m * ((D_m * 0.5) / d_m)))));
}
M_m = math.fabs(M) D_m = math.fabs(D) d_m = math.fabs(d) def code(w0, M_m, D_m, h, l, d_m): return w0 * math.sqrt((1.0 - ((h * (((M_m * (D_m * 0.5)) / d_m) / l)) * (M_m * ((D_m * 0.5) / d_m)))))
M_m = abs(M) D_m = abs(D) d_m = abs(d) function code(w0, M_m, D_m, h, l, d_m) return Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(h * Float64(Float64(Float64(M_m * Float64(D_m * 0.5)) / d_m) / l)) * Float64(M_m * Float64(Float64(D_m * 0.5) / d_m)))))) end
M_m = abs(M); D_m = abs(D); d_m = abs(d); function tmp = code(w0, M_m, D_m, h, l, d_m) tmp = w0 * sqrt((1.0 - ((h * (((M_m * (D_m * 0.5)) / d_m) / l)) * (M_m * ((D_m * 0.5) / d_m))))); end
M_m = N[Abs[M], $MachinePrecision] D_m = N[Abs[D], $MachinePrecision] d_m = N[Abs[d], $MachinePrecision] code[w0_, M$95$m_, D$95$m_, h_, l_, d$95$m_] := N[(w0 * N[Sqrt[N[(1.0 - N[(N[(h * N[(N[(N[(M$95$m * N[(D$95$m * 0.5), $MachinePrecision]), $MachinePrecision] / d$95$m), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] * N[(M$95$m * N[(N[(D$95$m * 0.5), $MachinePrecision] / d$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
d_m = \left|d\right|
\\
w0 \cdot \sqrt{1 - \left(h \cdot \frac{\frac{M\_m \cdot \left(D\_m \cdot 0.5\right)}{d\_m}}{\ell}\right) \cdot \left(M\_m \cdot \frac{D\_m \cdot 0.5}{d\_m}\right)}
\end{array}
Initial program 81.3%
Simplified82.9%
associate-*r/88.7%
add-sqr-sqrt88.7%
pow288.7%
unpow288.7%
sqrt-prod53.4%
add-sqr-sqrt88.7%
*-un-lft-identity88.7%
times-frac88.7%
metadata-eval88.7%
Applied egg-rr88.7%
associate-*r/82.9%
*-commutative82.9%
unpow282.9%
associate-*r*84.9%
associate-*r/84.9%
associate-*r/84.9%
Applied egg-rr84.9%
associate-*l/91.0%
associate-*r/91.0%
associate-*r*91.0%
Applied egg-rr91.0%
associate-/l*90.3%
associate-*r/87.5%
associate-*l*87.5%
Simplified87.5%
Final simplification87.5%
M_m = (fabs.f64 M)
D_m = (fabs.f64 D)
d_m = (fabs.f64 d)
(FPCore (w0 M_m D_m h l d_m)
:precision binary64
(*
w0
(sqrt
(-
1.0
(* (* h (/ (/ (* M_m (* D_m 0.5)) d_m) l)) (/ (* D_m (* M_m 0.5)) d_m))))))M_m = fabs(M);
D_m = fabs(D);
d_m = fabs(d);
double code(double w0, double M_m, double D_m, double h, double l, double d_m) {
return w0 * sqrt((1.0 - ((h * (((M_m * (D_m * 0.5)) / d_m) / l)) * ((D_m * (M_m * 0.5)) / d_m))));
}
M_m = abs(M)
D_m = abs(D)
d_m = abs(d)
real(8) function code(w0, m_m, d_m, h, l, d_m_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m_m
real(8), intent (in) :: d_m
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d_m_1
code = w0 * sqrt((1.0d0 - ((h * (((m_m * (d_m * 0.5d0)) / d_m_1) / l)) * ((d_m * (m_m * 0.5d0)) / d_m_1))))
end function
M_m = Math.abs(M);
D_m = Math.abs(D);
d_m = Math.abs(d);
public static double code(double w0, double M_m, double D_m, double h, double l, double d_m) {
return w0 * Math.sqrt((1.0 - ((h * (((M_m * (D_m * 0.5)) / d_m) / l)) * ((D_m * (M_m * 0.5)) / d_m))));
}
M_m = math.fabs(M) D_m = math.fabs(D) d_m = math.fabs(d) def code(w0, M_m, D_m, h, l, d_m): return w0 * math.sqrt((1.0 - ((h * (((M_m * (D_m * 0.5)) / d_m) / l)) * ((D_m * (M_m * 0.5)) / d_m))))
M_m = abs(M) D_m = abs(D) d_m = abs(d) function code(w0, M_m, D_m, h, l, d_m) return Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(h * Float64(Float64(Float64(M_m * Float64(D_m * 0.5)) / d_m) / l)) * Float64(Float64(D_m * Float64(M_m * 0.5)) / d_m))))) end
M_m = abs(M); D_m = abs(D); d_m = abs(d); function tmp = code(w0, M_m, D_m, h, l, d_m) tmp = w0 * sqrt((1.0 - ((h * (((M_m * (D_m * 0.5)) / d_m) / l)) * ((D_m * (M_m * 0.5)) / d_m)))); end
M_m = N[Abs[M], $MachinePrecision] D_m = N[Abs[D], $MachinePrecision] d_m = N[Abs[d], $MachinePrecision] code[w0_, M$95$m_, D$95$m_, h_, l_, d$95$m_] := N[(w0 * N[Sqrt[N[(1.0 - N[(N[(h * N[(N[(N[(M$95$m * N[(D$95$m * 0.5), $MachinePrecision]), $MachinePrecision] / d$95$m), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] * N[(N[(D$95$m * N[(M$95$m * 0.5), $MachinePrecision]), $MachinePrecision] / d$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
d_m = \left|d\right|
\\
w0 \cdot \sqrt{1 - \left(h \cdot \frac{\frac{M\_m \cdot \left(D\_m \cdot 0.5\right)}{d\_m}}{\ell}\right) \cdot \frac{D\_m \cdot \left(M\_m \cdot 0.5\right)}{d\_m}}
\end{array}
Initial program 81.3%
Simplified82.9%
associate-*r/88.7%
add-sqr-sqrt88.7%
pow288.7%
unpow288.7%
sqrt-prod53.4%
add-sqr-sqrt88.7%
*-un-lft-identity88.7%
times-frac88.7%
metadata-eval88.7%
Applied egg-rr88.7%
associate-*r/82.9%
*-commutative82.9%
unpow282.9%
associate-*r*84.9%
associate-*r/84.9%
associate-*r/84.9%
Applied egg-rr84.9%
associate-*l/91.0%
associate-*r/91.0%
associate-*r*91.0%
Applied egg-rr91.0%
associate-/l*90.3%
associate-*r/87.5%
associate-*l*87.5%
Simplified87.5%
associate-*r/87.5%
associate-*r*87.5%
Applied egg-rr87.5%
Final simplification87.5%
M_m = (fabs.f64 M)
D_m = (fabs.f64 D)
d_m = (fabs.f64 d)
(FPCore (w0 M_m D_m h l d_m)
:precision binary64
(*
w0
(sqrt
(-
1.0
(* (/ (* h (* (* M_m 0.5) (/ D_m d_m))) l) (* 0.5 (* D_m (/ M_m d_m))))))))M_m = fabs(M);
D_m = fabs(D);
d_m = fabs(d);
double code(double w0, double M_m, double D_m, double h, double l, double d_m) {
return w0 * sqrt((1.0 - (((h * ((M_m * 0.5) * (D_m / d_m))) / l) * (0.5 * (D_m * (M_m / d_m))))));
}
M_m = abs(M)
D_m = abs(D)
d_m = abs(d)
real(8) function code(w0, m_m, d_m, h, l, d_m_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m_m
real(8), intent (in) :: d_m
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d_m_1
code = w0 * sqrt((1.0d0 - (((h * ((m_m * 0.5d0) * (d_m / d_m_1))) / l) * (0.5d0 * (d_m * (m_m / d_m_1))))))
end function
M_m = Math.abs(M);
D_m = Math.abs(D);
d_m = Math.abs(d);
public static double code(double w0, double M_m, double D_m, double h, double l, double d_m) {
return w0 * Math.sqrt((1.0 - (((h * ((M_m * 0.5) * (D_m / d_m))) / l) * (0.5 * (D_m * (M_m / d_m))))));
}
M_m = math.fabs(M) D_m = math.fabs(D) d_m = math.fabs(d) def code(w0, M_m, D_m, h, l, d_m): return w0 * math.sqrt((1.0 - (((h * ((M_m * 0.5) * (D_m / d_m))) / l) * (0.5 * (D_m * (M_m / d_m))))))
M_m = abs(M) D_m = abs(D) d_m = abs(d) function code(w0, M_m, D_m, h, l, d_m) return Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(Float64(h * Float64(Float64(M_m * 0.5) * Float64(D_m / d_m))) / l) * Float64(0.5 * Float64(D_m * Float64(M_m / d_m))))))) end
M_m = abs(M); D_m = abs(D); d_m = abs(d); function tmp = code(w0, M_m, D_m, h, l, d_m) tmp = w0 * sqrt((1.0 - (((h * ((M_m * 0.5) * (D_m / d_m))) / l) * (0.5 * (D_m * (M_m / d_m)))))); end
M_m = N[Abs[M], $MachinePrecision] D_m = N[Abs[D], $MachinePrecision] d_m = N[Abs[d], $MachinePrecision] code[w0_, M$95$m_, D$95$m_, h_, l_, d$95$m_] := N[(w0 * N[Sqrt[N[(1.0 - N[(N[(N[(h * N[(N[(M$95$m * 0.5), $MachinePrecision] * N[(D$95$m / d$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(0.5 * N[(D$95$m * N[(M$95$m / d$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
d_m = \left|d\right|
\\
w0 \cdot \sqrt{1 - \frac{h \cdot \left(\left(M\_m \cdot 0.5\right) \cdot \frac{D\_m}{d\_m}\right)}{\ell} \cdot \left(0.5 \cdot \left(D\_m \cdot \frac{M\_m}{d\_m}\right)\right)}
\end{array}
Initial program 81.3%
Simplified82.9%
associate-*r/88.7%
add-sqr-sqrt88.7%
pow288.7%
unpow288.7%
sqrt-prod53.4%
add-sqr-sqrt88.7%
*-un-lft-identity88.7%
times-frac88.7%
metadata-eval88.7%
Applied egg-rr88.7%
associate-*r/82.9%
*-commutative82.9%
unpow282.9%
associate-*r*84.9%
associate-*r/84.9%
associate-*r/84.9%
Applied egg-rr84.9%
associate-*l/91.0%
associate-*r/91.0%
associate-*r*91.0%
Applied egg-rr91.0%
Taylor expanded in M around 0 88.2%
associate-/l*89.5%
Simplified89.5%
Final simplification89.5%
M_m = (fabs.f64 M) D_m = (fabs.f64 D) d_m = (fabs.f64 d) (FPCore (w0 M_m D_m h l d_m) :precision binary64 w0)
M_m = fabs(M);
D_m = fabs(D);
d_m = fabs(d);
double code(double w0, double M_m, double D_m, double h, double l, double d_m) {
return w0;
}
M_m = abs(M)
D_m = abs(D)
d_m = abs(d)
real(8) function code(w0, m_m, d_m, h, l, d_m_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m_m
real(8), intent (in) :: d_m
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d_m_1
code = w0
end function
M_m = Math.abs(M);
D_m = Math.abs(D);
d_m = Math.abs(d);
public static double code(double w0, double M_m, double D_m, double h, double l, double d_m) {
return w0;
}
M_m = math.fabs(M) D_m = math.fabs(D) d_m = math.fabs(d) def code(w0, M_m, D_m, h, l, d_m): return w0
M_m = abs(M) D_m = abs(D) d_m = abs(d) function code(w0, M_m, D_m, h, l, d_m) return w0 end
M_m = abs(M); D_m = abs(D); d_m = abs(d); function tmp = code(w0, M_m, D_m, h, l, d_m) tmp = w0; end
M_m = N[Abs[M], $MachinePrecision] D_m = N[Abs[D], $MachinePrecision] d_m = N[Abs[d], $MachinePrecision] code[w0_, M$95$m_, D$95$m_, h_, l_, d$95$m_] := w0
\begin{array}{l}
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
d_m = \left|d\right|
\\
w0
\end{array}
Initial program 81.3%
Simplified82.9%
Taylor expanded in M around 0 68.6%
Final simplification68.6%
herbie shell --seed 2024040
(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))))))