
(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 9 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (w0 M D h l d) :precision binary64 (* w0 (sqrt (- 1.0 (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ h l))))))
double code(double w0, double M, double D, double h, double l, double d) {
return w0 * sqrt((1.0 - (pow(((M * D) / (2.0 * d)), 2.0) * (h / l))));
}
real(8) function code(w0, m, d, h, l, d_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d_1
code = w0 * sqrt((1.0d0 - ((((m * d) / (2.0d0 * d_1)) ** 2.0d0) * (h / l))))
end function
public static double code(double w0, double M, double D, double h, double l, double d) {
return w0 * Math.sqrt((1.0 - (Math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l))));
}
def code(w0, M, D, h, l, d): return w0 * math.sqrt((1.0 - (math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l))))
function code(w0, M, D, h, l, d) return Float64(w0 * sqrt(Float64(1.0 - Float64((Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0) * Float64(h / l))))) end
function tmp = code(w0, M, D, h, l, d) tmp = w0 * sqrt((1.0 - ((((M * D) / (2.0 * d)) ^ 2.0) * (h / l)))); end
code[w0_, M_, D_, h_, l_, d_] := N[(w0 * N[Sqrt[N[(1.0 - N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}}
\end{array}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
(FPCore (w0 M D h l d)
:precision binary64
(if (<= (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ h l)) -2e+295)
(pow
(*
(cbrt w0)
(*
(pow
(exp 0.16666666666666666)
(log (* -0.25 (* (/ M d) (* (/ h l) (/ M d))))))
(pow (exp 0.16666666666666666) (* -2.0 (- (log D))))))
3.0)
(* w0 (sqrt (- 1.0 (* h (/ (pow (* D (* M (/ 0.5 d))) 2.0) l)))))))M = abs(M);
D = abs(D);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if ((pow(((M * D) / (2.0 * d)), 2.0) * (h / l)) <= -2e+295) {
tmp = pow((cbrt(w0) * (pow(exp(0.16666666666666666), log((-0.25 * ((M / d) * ((h / l) * (M / d)))))) * pow(exp(0.16666666666666666), (-2.0 * -log(D))))), 3.0);
} else {
tmp = w0 * sqrt((1.0 - (h * (pow((D * (M * (0.5 / d))), 2.0) / l))));
}
return tmp;
}
M = Math.abs(M);
D = Math.abs(D);
assert M < D;
public static double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if ((Math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l)) <= -2e+295) {
tmp = Math.pow((Math.cbrt(w0) * (Math.pow(Math.exp(0.16666666666666666), Math.log((-0.25 * ((M / d) * ((h / l) * (M / d)))))) * Math.pow(Math.exp(0.16666666666666666), (-2.0 * -Math.log(D))))), 3.0);
} else {
tmp = w0 * Math.sqrt((1.0 - (h * (Math.pow((D * (M * (0.5 / d))), 2.0) / l))));
}
return tmp;
}
M = abs(M) D = abs(D) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (Float64((Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0) * Float64(h / l)) <= -2e+295) tmp = Float64(cbrt(w0) * Float64((exp(0.16666666666666666) ^ log(Float64(-0.25 * Float64(Float64(M / d) * Float64(Float64(h / l) * Float64(M / d)))))) * (exp(0.16666666666666666) ^ Float64(-2.0 * Float64(-log(D)))))) ^ 3.0; else tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(h * Float64((Float64(D * Float64(M * Float64(0.5 / d))) ^ 2.0) / l))))); end return tmp end
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision], -2e+295], N[Power[N[(N[Power[w0, 1/3], $MachinePrecision] * N[(N[Power[N[Exp[0.16666666666666666], $MachinePrecision], N[Log[N[(-0.25 * N[(N[(M / d), $MachinePrecision] * N[(N[(h / l), $MachinePrecision] * N[(M / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[Power[N[Exp[0.16666666666666666], $MachinePrecision], N[(-2.0 * (-N[Log[D], $MachinePrecision])), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision], N[(w0 * N[Sqrt[N[(1.0 - N[(h * N[(N[Power[N[(D * N[(M * N[(0.5 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $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}\;{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell} \leq -2 \cdot 10^{+295}:\\
\;\;\;\;{\left(\sqrt[3]{w0} \cdot \left({\left(e^{0.16666666666666666}\right)}^{\log \left(-0.25 \cdot \left(\frac{M}{d} \cdot \left(\frac{h}{\ell} \cdot \frac{M}{d}\right)\right)\right)} \cdot {\left(e^{0.16666666666666666}\right)}^{\left(-2 \cdot \left(-\log D\right)\right)}\right)\right)}^{3}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{1 - h \cdot \frac{{\left(D \cdot \left(M \cdot \frac{0.5}{d}\right)\right)}^{2}}{\ell}}\\
\end{array}
\end{array}
if (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (/.f64 h l)) < -2e295Initial program 48.2%
Simplified48.2%
Applied egg-rr45.5%
Taylor expanded in D around inf 12.8%
*-commutative12.8%
unpow1/332.9%
*-lft-identity32.9%
exp-prod32.5%
distribute-lft-neg-in32.5%
metadata-eval32.5%
unpow232.5%
times-frac31.2%
unpow231.2%
log-rec31.2%
Simplified31.2%
unpow-prod-up31.2%
times-frac37.4%
Applied egg-rr37.4%
Simplified39.7%
if -2e295 < (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (/.f64 h l)) Initial program 88.6%
Simplified89.2%
frac-times88.6%
*-commutative88.6%
clear-num88.6%
un-div-inv88.7%
div-inv88.7%
associate-*l*87.1%
associate-/r*87.1%
metadata-eval87.1%
Applied egg-rr87.1%
associate-/r/93.2%
*-commutative93.2%
associate-*r*95.3%
*-commutative95.3%
Simplified95.3%
Final simplification80.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 D) (* 2.0 d)) 1e+168)
(* w0 (sqrt (- 1.0 (* h (/ (pow (* D (* M (/ 0.5 d))) 2.0) l)))))
(pow
(*
(cbrt w0)
(exp
(*
0.16666666666666666
(- (log (* -0.25 (* (/ h l) (* (/ M d) (/ M d))))) (* -2.0 (log D))))))
3.0)))M = abs(M);
D = abs(D);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (((M * D) / (2.0 * d)) <= 1e+168) {
tmp = w0 * sqrt((1.0 - (h * (pow((D * (M * (0.5 / d))), 2.0) / l))));
} else {
tmp = pow((cbrt(w0) * exp((0.16666666666666666 * (log((-0.25 * ((h / l) * ((M / d) * (M / d))))) - (-2.0 * log(D)))))), 3.0);
}
return tmp;
}
M = Math.abs(M);
D = Math.abs(D);
assert M < D;
public static double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (((M * D) / (2.0 * d)) <= 1e+168) {
tmp = w0 * Math.sqrt((1.0 - (h * (Math.pow((D * (M * (0.5 / d))), 2.0) / l))));
} else {
tmp = Math.pow((Math.cbrt(w0) * Math.exp((0.16666666666666666 * (Math.log((-0.25 * ((h / l) * ((M / d) * (M / d))))) - (-2.0 * Math.log(D)))))), 3.0);
}
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)) <= 1e+168) tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(h * Float64((Float64(D * Float64(M * Float64(0.5 / d))) ^ 2.0) / l))))); else tmp = Float64(cbrt(w0) * exp(Float64(0.16666666666666666 * Float64(log(Float64(-0.25 * Float64(Float64(h / l) * Float64(Float64(M / d) * Float64(M / d))))) - Float64(-2.0 * log(D)))))) ^ 3.0; end return tmp end
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 1e+168], N[(w0 * N[Sqrt[N[(1.0 - N[(h * N[(N[Power[N[(D * N[(M * N[(0.5 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Power[N[(N[Power[w0, 1/3], $MachinePrecision] * N[Exp[N[(0.16666666666666666 * N[(N[Log[N[(-0.25 * N[(N[(h / l), $MachinePrecision] * N[(N[(M / d), $MachinePrecision] * N[(M / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - N[(-2.0 * N[Log[D], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{M \cdot D}{2 \cdot d} \leq 10^{+168}:\\
\;\;\;\;w0 \cdot \sqrt{1 - h \cdot \frac{{\left(D \cdot \left(M \cdot \frac{0.5}{d}\right)\right)}^{2}}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;{\left(\sqrt[3]{w0} \cdot e^{0.16666666666666666 \cdot \left(\log \left(-0.25 \cdot \left(\frac{h}{\ell} \cdot \left(\frac{M}{d} \cdot \frac{M}{d}\right)\right)\right) - -2 \cdot \log D\right)}\right)}^{3}\\
\end{array}
\end{array}
if (/.f64 (*.f64 M D) (*.f64 2 d)) < 9.9999999999999993e167Initial program 83.4%
Simplified83.4%
frac-times83.4%
*-commutative83.4%
clear-num83.4%
un-div-inv83.4%
div-inv83.4%
associate-*l*80.9%
associate-/r*80.9%
metadata-eval80.9%
Applied egg-rr80.9%
associate-/r/86.6%
*-commutative86.6%
associate-*r*88.8%
*-commutative88.8%
Simplified88.8%
if 9.9999999999999993e167 < (/.f64 (*.f64 M D) (*.f64 2 d)) Initial program 28.3%
Simplified32.0%
Applied egg-rr31.9%
Taylor expanded in D around inf 11.0%
*-commutative11.0%
unpow1/326.1%
*-lft-identity26.1%
exp-prod25.6%
distribute-lft-neg-in25.6%
metadata-eval25.6%
unpow225.6%
times-frac22.7%
unpow222.7%
log-rec22.7%
Simplified22.7%
pow-exp22.9%
times-frac26.8%
Applied egg-rr26.8%
Final simplification82.2%
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
(FPCore (w0 M D h l d)
:precision binary64
(if (<= (pow (/ (* M D) (* 2.0 d)) 2.0) 4e+286)
(* w0 (sqrt (- 1.0 (* h (/ (pow (* D (* M (/ 0.5 d))) 2.0) l)))))
(*
w0
(sqrt (+ 1.0 (* (/ (* D -0.25) (/ l D)) (* (/ M d) (/ M (/ d h)))))))))M = abs(M);
D = abs(D);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (pow(((M * D) / (2.0 * d)), 2.0) <= 4e+286) {
tmp = w0 * sqrt((1.0 - (h * (pow((D * (M * (0.5 / d))), 2.0) / l))));
} else {
tmp = w0 * sqrt((1.0 + (((D * -0.25) / (l / D)) * ((M / d) * (M / (d / h))))));
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
real(8) function code(w0, m, d, h, l, d_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d_1
real(8) :: tmp
if ((((m * d) / (2.0d0 * d_1)) ** 2.0d0) <= 4d+286) then
tmp = w0 * sqrt((1.0d0 - (h * (((d * (m * (0.5d0 / d_1))) ** 2.0d0) / l))))
else
tmp = w0 * sqrt((1.0d0 + (((d * (-0.25d0)) / (l / d)) * ((m / d_1) * (m / (d_1 / h))))))
end if
code = tmp
end function
M = Math.abs(M);
D = Math.abs(D);
assert M < D;
public static double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (Math.pow(((M * D) / (2.0 * d)), 2.0) <= 4e+286) {
tmp = w0 * Math.sqrt((1.0 - (h * (Math.pow((D * (M * (0.5 / d))), 2.0) / l))));
} else {
tmp = w0 * Math.sqrt((1.0 + (((D * -0.25) / (l / D)) * ((M / d) * (M / (d / h))))));
}
return tmp;
}
M = abs(M) D = abs(D) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if math.pow(((M * D) / (2.0 * d)), 2.0) <= 4e+286: tmp = w0 * math.sqrt((1.0 - (h * (math.pow((D * (M * (0.5 / d))), 2.0) / l)))) else: tmp = w0 * math.sqrt((1.0 + (((D * -0.25) / (l / D)) * ((M / d) * (M / (d / h)))))) return tmp
M = abs(M) D = abs(D) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if ((Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0) <= 4e+286) tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(h * Float64((Float64(D * Float64(M * Float64(0.5 / d))) ^ 2.0) / l))))); else tmp = Float64(w0 * sqrt(Float64(1.0 + Float64(Float64(Float64(D * -0.25) / Float64(l / D)) * Float64(Float64(M / d) * Float64(M / Float64(d / h))))))); end return tmp end
M = abs(M)
D = abs(D)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if ((((M * D) / (2.0 * d)) ^ 2.0) <= 4e+286)
tmp = w0 * sqrt((1.0 - (h * (((D * (M * (0.5 / d))) ^ 2.0) / l))));
else
tmp = w0 * sqrt((1.0 + (((D * -0.25) / (l / D)) * ((M / d) * (M / (d / h))))));
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision], 4e+286], N[(w0 * N[Sqrt[N[(1.0 - N[(h * N[(N[Power[N[(D * N[(M * N[(0.5 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(w0 * N[Sqrt[N[(1.0 + N[(N[(N[(D * -0.25), $MachinePrecision] / N[(l / D), $MachinePrecision]), $MachinePrecision] * N[(N[(M / d), $MachinePrecision] * N[(M / N[(d / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \leq 4 \cdot 10^{+286}:\\
\;\;\;\;w0 \cdot \sqrt{1 - h \cdot \frac{{\left(D \cdot \left(M \cdot \frac{0.5}{d}\right)\right)}^{2}}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{1 + \frac{D \cdot -0.25}{\frac{\ell}{D}} \cdot \left(\frac{M}{d} \cdot \frac{M}{\frac{d}{h}}\right)}\\
\end{array}
\end{array}
if (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) < 4.00000000000000013e286Initial program 88.3%
Simplified88.3%
frac-times88.3%
*-commutative88.3%
clear-num88.3%
un-div-inv88.3%
div-inv88.3%
associate-*l*85.4%
associate-/r*85.4%
metadata-eval85.4%
Applied egg-rr85.4%
associate-/r/92.0%
*-commutative92.0%
associate-*r*94.6%
*-commutative94.6%
Simplified94.6%
if 4.00000000000000013e286 < (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) Initial program 44.0%
Simplified45.7%
clear-num45.7%
un-div-inv45.7%
div-inv45.7%
metadata-eval45.7%
Applied egg-rr45.7%
Taylor expanded in w0 around 0 40.3%
*-commutative40.3%
cancel-sign-sub-inv40.3%
*-commutative40.3%
metadata-eval40.3%
times-frac37.2%
unpow237.2%
associate-*l/40.3%
associate-/r/40.4%
unpow240.4%
unpow240.4%
associate-/r*42.5%
*-commutative42.5%
associate-*r*47.2%
Simplified48.5%
Final simplification83.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 5e-86)
(* w0 (sqrt (+ 1.0 (* (/ (* D -0.25) (/ l D)) (* (/ M d) (/ M (/ d h)))))))
(if (<= d 1.18e+86)
(* w0 (sqrt (- 1.0 (* 0.25 (/ (* D (* D (* M (* M h)))) (* l (* d d)))))))
w0)))M = abs(M);
D = abs(D);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (d <= 5e-86) {
tmp = w0 * sqrt((1.0 + (((D * -0.25) / (l / D)) * ((M / d) * (M / (d / h))))));
} else if (d <= 1.18e+86) {
tmp = w0 * sqrt((1.0 - (0.25 * ((D * (D * (M * (M * h)))) / (l * (d * d))))));
} else {
tmp = w0;
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: 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 <= 5d-86) then
tmp = w0 * sqrt((1.0d0 + (((d * (-0.25d0)) / (l / d)) * ((m / d_1) * (m / (d_1 / h))))))
else if (d_1 <= 1.18d+86) then
tmp = w0 * sqrt((1.0d0 - (0.25d0 * ((d * (d * (m * (m * h)))) / (l * (d_1 * d_1))))))
else
tmp = w0
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 <= 5e-86) {
tmp = w0 * Math.sqrt((1.0 + (((D * -0.25) / (l / D)) * ((M / d) * (M / (d / h))))));
} else if (d <= 1.18e+86) {
tmp = w0 * Math.sqrt((1.0 - (0.25 * ((D * (D * (M * (M * h)))) / (l * (d * d))))));
} else {
tmp = w0;
}
return tmp;
}
M = abs(M) D = abs(D) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if d <= 5e-86: tmp = w0 * math.sqrt((1.0 + (((D * -0.25) / (l / D)) * ((M / d) * (M / (d / h)))))) elif d <= 1.18e+86: tmp = w0 * math.sqrt((1.0 - (0.25 * ((D * (D * (M * (M * h)))) / (l * (d * d)))))) else: tmp = w0 return tmp
M = abs(M) D = abs(D) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (d <= 5e-86) tmp = Float64(w0 * sqrt(Float64(1.0 + Float64(Float64(Float64(D * -0.25) / Float64(l / D)) * Float64(Float64(M / d) * Float64(M / Float64(d / h))))))); elseif (d <= 1.18e+86) tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(0.25 * Float64(Float64(D * Float64(D * Float64(M * Float64(M * h)))) / Float64(l * Float64(d * d))))))); else tmp = w0; end return tmp end
M = abs(M)
D = abs(D)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if (d <= 5e-86)
tmp = w0 * sqrt((1.0 + (((D * -0.25) / (l / D)) * ((M / d) * (M / (d / h))))));
elseif (d <= 1.18e+86)
tmp = w0 * sqrt((1.0 - (0.25 * ((D * (D * (M * (M * h)))) / (l * (d * d))))));
else
tmp = w0;
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[d, 5e-86], N[(w0 * N[Sqrt[N[(1.0 + N[(N[(N[(D * -0.25), $MachinePrecision] / N[(l / D), $MachinePrecision]), $MachinePrecision] * N[(N[(M / d), $MachinePrecision] * N[(M / N[(d / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 1.18e+86], N[(w0 * N[Sqrt[N[(1.0 - N[(0.25 * N[(N[(D * N[(D * N[(M * N[(M * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(l * N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], w0]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;d \leq 5 \cdot 10^{-86}:\\
\;\;\;\;w0 \cdot \sqrt{1 + \frac{D \cdot -0.25}{\frac{\ell}{D}} \cdot \left(\frac{M}{d} \cdot \frac{M}{\frac{d}{h}}\right)}\\
\mathbf{elif}\;d \leq 1.18 \cdot 10^{+86}:\\
\;\;\;\;w0 \cdot \sqrt{1 - 0.25 \cdot \frac{D \cdot \left(D \cdot \left(M \cdot \left(M \cdot h\right)\right)\right)}{\ell \cdot \left(d \cdot d\right)}}\\
\mathbf{else}:\\
\;\;\;\;w0\\
\end{array}
\end{array}
if d < 4.9999999999999999e-86Initial program 72.9%
Simplified73.6%
clear-num73.6%
un-div-inv73.6%
div-inv73.6%
metadata-eval73.6%
Applied egg-rr73.6%
Taylor expanded in w0 around 0 43.1%
*-commutative43.1%
cancel-sign-sub-inv43.1%
*-commutative43.1%
metadata-eval43.1%
times-frac49.1%
unpow249.1%
associate-*l/51.0%
associate-/r/51.0%
unpow251.0%
unpow251.0%
associate-/r*58.2%
*-commutative58.2%
associate-*r*61.8%
Simplified63.3%
if 4.9999999999999999e-86 < d < 1.18e86Initial program 80.2%
Simplified80.2%
Taylor expanded in D around 0 64.7%
unpow264.7%
unpow264.7%
unpow264.7%
Simplified64.7%
Taylor expanded in D around 0 64.7%
unpow261.6%
associate-*r*64.1%
unpow264.1%
associate-*r*77.1%
Simplified80.2%
if 1.18e86 < d Initial program 90.5%
Simplified90.5%
Taylor expanded in D around 0 94.1%
Final simplification72.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 (<= d 1.9e+52) (* w0 (sqrt (+ 1.0 (* (/ (* D -0.25) (/ l D)) (* (/ M d) (/ M (/ d h))))))) w0))
M = abs(M);
D = abs(D);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (d <= 1.9e+52) {
tmp = w0 * sqrt((1.0 + (((D * -0.25) / (l / D)) * ((M / d) * (M / (d / h))))));
} else {
tmp = w0;
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
real(8) function code(w0, m, d, h, l, d_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d_1
real(8) :: tmp
if (d_1 <= 1.9d+52) then
tmp = w0 * sqrt((1.0d0 + (((d * (-0.25d0)) / (l / d)) * ((m / d_1) * (m / (d_1 / h))))))
else
tmp = w0
end if
code = tmp
end function
M = Math.abs(M);
D = Math.abs(D);
assert M < D;
public static double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (d <= 1.9e+52) {
tmp = w0 * Math.sqrt((1.0 + (((D * -0.25) / (l / D)) * ((M / d) * (M / (d / h))))));
} else {
tmp = w0;
}
return tmp;
}
M = abs(M) D = abs(D) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if d <= 1.9e+52: tmp = w0 * math.sqrt((1.0 + (((D * -0.25) / (l / D)) * ((M / d) * (M / (d / h)))))) else: tmp = w0 return tmp
M = abs(M) D = abs(D) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (d <= 1.9e+52) tmp = Float64(w0 * sqrt(Float64(1.0 + Float64(Float64(Float64(D * -0.25) / Float64(l / D)) * Float64(Float64(M / d) * Float64(M / Float64(d / h))))))); else tmp = w0; end return tmp end
M = abs(M)
D = abs(D)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if (d <= 1.9e+52)
tmp = w0 * sqrt((1.0 + (((D * -0.25) / (l / D)) * ((M / d) * (M / (d / h))))));
else
tmp = w0;
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[d, 1.9e+52], N[(w0 * N[Sqrt[N[(1.0 + N[(N[(N[(D * -0.25), $MachinePrecision] / N[(l / D), $MachinePrecision]), $MachinePrecision] * N[(N[(M / d), $MachinePrecision] * N[(M / N[(d / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], w0]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;d \leq 1.9 \cdot 10^{+52}:\\
\;\;\;\;w0 \cdot \sqrt{1 + \frac{D \cdot -0.25}{\frac{\ell}{D}} \cdot \left(\frac{M}{d} \cdot \frac{M}{\frac{d}{h}}\right)}\\
\mathbf{else}:\\
\;\;\;\;w0\\
\end{array}
\end{array}
if d < 1.9e52Initial program 74.1%
Simplified74.6%
clear-num74.6%
un-div-inv74.7%
div-inv74.7%
metadata-eval74.7%
Applied egg-rr74.7%
Taylor expanded in w0 around 0 46.3%
*-commutative46.3%
cancel-sign-sub-inv46.3%
*-commutative46.3%
metadata-eval46.3%
times-frac51.4%
unpow251.4%
associate-*l/54.5%
associate-/r/54.5%
unpow254.5%
unpow254.5%
associate-/r*60.5%
*-commutative60.5%
associate-*r*64.2%
Simplified65.4%
if 1.9e52 < d Initial program 88.8%
Simplified88.8%
Taylor expanded in D around 0 90.2%
Final simplification71.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 (<= d 9.5e-66)
(* w0 (+ 1.0 (* (* (/ D (/ l D)) (* h (* (/ M d) (/ M d)))) -0.125)))
(if (<= d 9e+85)
(* w0 (+ 1.0 (* (/ (* D (* D (* M (* M h)))) (* l (* d d))) -0.125)))
w0)))M = abs(M);
D = abs(D);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (d <= 9.5e-66) {
tmp = w0 * (1.0 + (((D / (l / D)) * (h * ((M / d) * (M / d)))) * -0.125));
} else if (d <= 9e+85) {
tmp = w0 * (1.0 + (((D * (D * (M * (M * h)))) / (l * (d * d))) * -0.125));
} else {
tmp = w0;
}
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 <= 9.5d-66) then
tmp = w0 * (1.0d0 + (((d / (l / d)) * (h * ((m / d_1) * (m / d_1)))) * (-0.125d0)))
else if (d_1 <= 9d+85) then
tmp = w0 * (1.0d0 + (((d * (d * (m * (m * h)))) / (l * (d_1 * d_1))) * (-0.125d0)))
else
tmp = w0
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 <= 9.5e-66) {
tmp = w0 * (1.0 + (((D / (l / D)) * (h * ((M / d) * (M / d)))) * -0.125));
} else if (d <= 9e+85) {
tmp = w0 * (1.0 + (((D * (D * (M * (M * h)))) / (l * (d * d))) * -0.125));
} else {
tmp = w0;
}
return tmp;
}
M = abs(M) D = abs(D) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if d <= 9.5e-66: tmp = w0 * (1.0 + (((D / (l / D)) * (h * ((M / d) * (M / d)))) * -0.125)) elif d <= 9e+85: tmp = w0 * (1.0 + (((D * (D * (M * (M * h)))) / (l * (d * d))) * -0.125)) else: tmp = w0 return tmp
M = abs(M) D = abs(D) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (d <= 9.5e-66) tmp = Float64(w0 * Float64(1.0 + Float64(Float64(Float64(D / Float64(l / D)) * Float64(h * Float64(Float64(M / d) * Float64(M / d)))) * -0.125))); elseif (d <= 9e+85) tmp = Float64(w0 * Float64(1.0 + Float64(Float64(Float64(D * Float64(D * Float64(M * Float64(M * h)))) / Float64(l * Float64(d * d))) * -0.125))); else tmp = w0; end return tmp end
M = abs(M)
D = abs(D)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if (d <= 9.5e-66)
tmp = w0 * (1.0 + (((D / (l / D)) * (h * ((M / d) * (M / d)))) * -0.125));
elseif (d <= 9e+85)
tmp = w0 * (1.0 + (((D * (D * (M * (M * h)))) / (l * (d * d))) * -0.125));
else
tmp = w0;
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[d, 9.5e-66], N[(w0 * N[(1.0 + N[(N[(N[(D / N[(l / D), $MachinePrecision]), $MachinePrecision] * N[(h * N[(N[(M / d), $MachinePrecision] * N[(M / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 9e+85], N[(w0 * N[(1.0 + N[(N[(N[(D * N[(D * N[(M * N[(M * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(l * N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], w0]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;d \leq 9.5 \cdot 10^{-66}:\\
\;\;\;\;w0 \cdot \left(1 + \left(\frac{D}{\frac{\ell}{D}} \cdot \left(h \cdot \left(\frac{M}{d} \cdot \frac{M}{d}\right)\right)\right) \cdot -0.125\right)\\
\mathbf{elif}\;d \leq 9 \cdot 10^{+85}:\\
\;\;\;\;w0 \cdot \left(1 + \frac{D \cdot \left(D \cdot \left(M \cdot \left(M \cdot h\right)\right)\right)}{\ell \cdot \left(d \cdot d\right)} \cdot -0.125\right)\\
\mathbf{else}:\\
\;\;\;\;w0\\
\end{array}
\end{array}
if d < 9.5000000000000004e-66Initial program 73.2%
Simplified73.9%
Taylor expanded in D around 0 42.7%
*-commutative42.7%
unpow242.7%
unpow242.7%
unpow242.7%
Simplified42.7%
Taylor expanded in D around 0 42.7%
associate-/r*49.8%
unpow249.8%
associate-*r*52.3%
associate-*l/51.7%
unpow251.7%
associate-*r/51.2%
associate-/l*53.0%
associate-*r*49.9%
associate-*l/49.4%
unpow249.4%
*-commutative49.4%
Simplified49.4%
Taylor expanded in M around 0 49.4%
unpow249.4%
unpow249.4%
times-frac60.4%
Simplified60.4%
if 9.5000000000000004e-66 < d < 9.00000000000000013e85Initial program 79.1%
Simplified79.1%
Taylor expanded in D around 0 59.6%
*-commutative59.6%
unpow259.6%
unpow259.6%
unpow259.6%
Simplified59.6%
Taylor expanded in D around 0 59.6%
unpow259.6%
associate-*r*62.2%
unpow262.2%
associate-*r*75.9%
Simplified75.9%
if 9.00000000000000013e85 < d Initial program 90.5%
Simplified90.5%
Taylor expanded in D around 0 94.1%
Final simplification69.5%
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 2.8e+53) (* w0 (+ 1.0 (* (* (/ D (/ l D)) (* h (* (/ M d) (/ M d)))) -0.125))) w0))
M = abs(M);
D = abs(D);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (d <= 2.8e+53) {
tmp = w0 * (1.0 + (((D / (l / D)) * (h * ((M / d) * (M / d)))) * -0.125));
} else {
tmp = w0;
}
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 <= 2.8d+53) then
tmp = w0 * (1.0d0 + (((d / (l / d)) * (h * ((m / d_1) * (m / d_1)))) * (-0.125d0)))
else
tmp = w0
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 <= 2.8e+53) {
tmp = w0 * (1.0 + (((D / (l / D)) * (h * ((M / d) * (M / d)))) * -0.125));
} else {
tmp = w0;
}
return tmp;
}
M = abs(M) D = abs(D) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if d <= 2.8e+53: tmp = w0 * (1.0 + (((D / (l / D)) * (h * ((M / d) * (M / d)))) * -0.125)) else: tmp = w0 return tmp
M = abs(M) D = abs(D) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (d <= 2.8e+53) tmp = Float64(w0 * Float64(1.0 + Float64(Float64(Float64(D / Float64(l / D)) * Float64(h * Float64(Float64(M / d) * Float64(M / d)))) * -0.125))); else tmp = w0; end return tmp end
M = abs(M)
D = abs(D)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if (d <= 2.8e+53)
tmp = w0 * (1.0 + (((D / (l / D)) * (h * ((M / d) * (M / d)))) * -0.125));
else
tmp = w0;
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[d, 2.8e+53], N[(w0 * N[(1.0 + N[(N[(N[(D / N[(l / D), $MachinePrecision]), $MachinePrecision] * N[(h * N[(N[(M / d), $MachinePrecision] * N[(M / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], w0]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;d \leq 2.8 \cdot 10^{+53}:\\
\;\;\;\;w0 \cdot \left(1 + \left(\frac{D}{\frac{\ell}{D}} \cdot \left(h \cdot \left(\frac{M}{d} \cdot \frac{M}{d}\right)\right)\right) \cdot -0.125\right)\\
\mathbf{else}:\\
\;\;\;\;w0\\
\end{array}
\end{array}
if d < 2.8e53Initial program 74.1%
Simplified74.6%
Taylor expanded in D around 0 44.7%
*-commutative44.7%
unpow244.7%
unpow244.7%
unpow244.7%
Simplified44.7%
Taylor expanded in D around 0 44.7%
associate-/r*50.8%
unpow250.8%
associate-*r*53.4%
associate-*l/52.9%
unpow252.9%
associate-*r/52.5%
associate-/l*55.6%
associate-*r*52.5%
associate-*l/52.0%
unpow252.0%
*-commutative52.0%
Simplified52.0%
Taylor expanded in M around 0 52.0%
unpow252.0%
unpow252.0%
times-frac61.5%
Simplified61.5%
if 2.8e53 < d Initial program 88.8%
Simplified88.8%
Taylor expanded in D around 0 90.2%
Final simplification68.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 6e+31) w0 (* -0.125 (* (* (/ D d) (/ D d)) (/ (* w0 (* M (* M h))) 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 <= 6e+31) {
tmp = w0;
} else {
tmp = -0.125 * (((D / d) * (D / d)) * ((w0 * (M * (M * h))) / 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 <= 6d+31) then
tmp = w0
else
tmp = (-0.125d0) * (((d / d_1) * (d / d_1)) * ((w0 * (m * (m * h))) / 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 <= 6e+31) {
tmp = w0;
} else {
tmp = -0.125 * (((D / d) * (D / d)) * ((w0 * (M * (M * h))) / 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 <= 6e+31: tmp = w0 else: tmp = -0.125 * (((D / d) * (D / d)) * ((w0 * (M * (M * h))) / 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 <= 6e+31) tmp = w0; else tmp = Float64(-0.125 * Float64(Float64(Float64(D / d) * Float64(D / d)) * Float64(Float64(w0 * Float64(M * Float64(M * h))) / 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 <= 6e+31)
tmp = w0;
else
tmp = -0.125 * (((D / d) * (D / d)) * ((w0 * (M * (M * h))) / 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, 6e+31], w0, N[(-0.125 * N[(N[(N[(D / d), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision] * N[(N[(w0 * N[(M * N[(M * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;M \leq 6 \cdot 10^{+31}:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;-0.125 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \frac{w0 \cdot \left(M \cdot \left(M \cdot h\right)\right)}{\ell}\right)\\
\end{array}
\end{array}
if M < 5.99999999999999978e31Initial program 81.7%
Simplified82.2%
Taylor expanded in D around 0 71.8%
if 5.99999999999999978e31 < M Initial program 60.3%
Simplified60.3%
Taylor expanded in D around 0 36.2%
*-commutative36.2%
unpow236.2%
unpow236.2%
unpow236.2%
Simplified36.2%
Taylor expanded in D around 0 36.2%
associate-/r*36.3%
unpow236.3%
associate-*r*44.4%
associate-*l/46.4%
unpow246.4%
associate-*r/44.3%
associate-/l*50.7%
associate-*r*42.6%
associate-*l/44.7%
unpow244.7%
*-commutative44.7%
Simplified44.7%
Taylor expanded in D around inf 20.7%
times-frac20.4%
unpow220.4%
unpow220.4%
unpow220.4%
*-commutative20.4%
associate-*r*20.6%
Simplified20.6%
frac-times21.3%
Applied egg-rr21.3%
Final simplification62.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 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 77.6%
Simplified78.0%
Taylor expanded in D around 0 66.7%
Final simplification66.7%
herbie shell --seed 2023274
(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))))))