
(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 (<= (* M D) 1e-29)
(*
w0
(sqrt
(+ 1.0 (/ -1.0 (/ l (/ (* (/ 0.25 d) (* (* M h) (* D (* M D)))) d))))))
(if (<= (* M D) 1e+139)
(* w0 (sqrt (- 1.0 (* 0.25 (/ (* D (* M (* M D))) (* l (/ d (/ h d))))))))
(*
w0
(sqrt (- 1.0 (* 0.25 (* (* (/ D d) (/ D d)) (/ (* M M) (/ l h))))))))))M = abs(M);
D = abs(D);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if ((M * D) <= 1e-29) {
tmp = w0 * sqrt((1.0 + (-1.0 / (l / (((0.25 / d) * ((M * h) * (D * (M * D)))) / d)))));
} else if ((M * D) <= 1e+139) {
tmp = w0 * sqrt((1.0 - (0.25 * ((D * (M * (M * D))) / (l * (d / (h / d)))))));
} else {
tmp = w0 * sqrt((1.0 - (0.25 * (((D / d) * (D / d)) * ((M * M) / (l / 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) <= 1d-29) then
tmp = w0 * sqrt((1.0d0 + ((-1.0d0) / (l / (((0.25d0 / d_1) * ((m * h) * (d * (m * d)))) / d_1)))))
else if ((m * d) <= 1d+139) then
tmp = w0 * sqrt((1.0d0 - (0.25d0 * ((d * (m * (m * d))) / (l * (d_1 / (h / d_1)))))))
else
tmp = w0 * sqrt((1.0d0 - (0.25d0 * (((d / d_1) * (d / d_1)) * ((m * m) / (l / h))))))
end if
code = tmp
end function
M = Math.abs(M);
D = Math.abs(D);
assert M < D;
public static double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if ((M * D) <= 1e-29) {
tmp = w0 * Math.sqrt((1.0 + (-1.0 / (l / (((0.25 / d) * ((M * h) * (D * (M * D)))) / d)))));
} else if ((M * D) <= 1e+139) {
tmp = w0 * Math.sqrt((1.0 - (0.25 * ((D * (M * (M * D))) / (l * (d / (h / d)))))));
} else {
tmp = w0 * Math.sqrt((1.0 - (0.25 * (((D / d) * (D / d)) * ((M * M) / (l / h))))));
}
return tmp;
}
M = abs(M) D = abs(D) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if (M * D) <= 1e-29: tmp = w0 * math.sqrt((1.0 + (-1.0 / (l / (((0.25 / d) * ((M * h) * (D * (M * D)))) / d))))) elif (M * D) <= 1e+139: tmp = w0 * math.sqrt((1.0 - (0.25 * ((D * (M * (M * D))) / (l * (d / (h / d))))))) else: tmp = w0 * math.sqrt((1.0 - (0.25 * (((D / d) * (D / d)) * ((M * M) / (l / 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(M * D) <= 1e-29) tmp = Float64(w0 * sqrt(Float64(1.0 + Float64(-1.0 / Float64(l / Float64(Float64(Float64(0.25 / d) * Float64(Float64(M * h) * Float64(D * Float64(M * D)))) / d)))))); elseif (Float64(M * D) <= 1e+139) tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(0.25 * Float64(Float64(D * Float64(M * Float64(M * D))) / Float64(l * Float64(d / Float64(h / d)))))))); else tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(0.25 * Float64(Float64(Float64(D / d) * Float64(D / d)) * Float64(Float64(M * M) / Float64(l / 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) <= 1e-29)
tmp = w0 * sqrt((1.0 + (-1.0 / (l / (((0.25 / d) * ((M * h) * (D * (M * D)))) / d)))));
elseif ((M * D) <= 1e+139)
tmp = w0 * sqrt((1.0 - (0.25 * ((D * (M * (M * D))) / (l * (d / (h / d)))))));
else
tmp = w0 * sqrt((1.0 - (0.25 * (((D / d) * (D / d)) * ((M * M) / (l / 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[(M * D), $MachinePrecision], 1e-29], N[(w0 * N[Sqrt[N[(1.0 + N[(-1.0 / N[(l / N[(N[(N[(0.25 / d), $MachinePrecision] * N[(N[(M * h), $MachinePrecision] * N[(D * N[(M * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(M * D), $MachinePrecision], 1e+139], N[(w0 * N[Sqrt[N[(1.0 - N[(0.25 * N[(N[(D * N[(M * N[(M * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(l * N[(d / N[(h / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(w0 * N[Sqrt[N[(1.0 - N[(0.25 * N[(N[(N[(D / d), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision] * N[(N[(M * M), $MachinePrecision] / N[(l / 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}\;M \cdot D \leq 10^{-29}:\\
\;\;\;\;w0 \cdot \sqrt{1 + \frac{-1}{\frac{\ell}{\frac{\frac{0.25}{d} \cdot \left(\left(M \cdot h\right) \cdot \left(D \cdot \left(M \cdot D\right)\right)\right)}{d}}}}\\
\mathbf{elif}\;M \cdot D \leq 10^{+139}:\\
\;\;\;\;w0 \cdot \sqrt{1 - 0.25 \cdot \frac{D \cdot \left(M \cdot \left(M \cdot D\right)\right)}{\ell \cdot \frac{d}{\frac{h}{d}}}}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{1 - 0.25 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \frac{M \cdot M}{\frac{\ell}{h}}\right)}\\
\end{array}
\end{array}
if (*.f64 M D) < 9.99999999999999943e-30Initial program 87.1%
associate-*r/92.4%
clear-num92.4%
div-inv92.4%
associate-*l*91.9%
associate-/r*91.9%
metadata-eval91.9%
Applied egg-rr91.9%
Taylor expanded in M around 0 64.6%
unpow264.6%
associate-*r/64.6%
times-frac74.2%
unpow274.2%
unpow274.2%
associate-*r*77.9%
associate-*r*81.1%
*-commutative81.1%
associate-*l*87.3%
Simplified87.3%
associate-*r/87.3%
*-commutative87.3%
Applied egg-rr87.3%
if 9.99999999999999943e-30 < (*.f64 M D) < 1.00000000000000003e139Initial program 67.5%
Taylor expanded in M around 0 35.5%
associate-*r*35.5%
*-commutative35.5%
unpow235.5%
unpow235.5%
swap-sqr70.1%
associate-/l*74.2%
*-commutative74.2%
*-commutative74.2%
swap-sqr35.5%
unpow235.5%
Simplified35.5%
Taylor expanded in d around 0 35.5%
unpow235.5%
associate-*l/35.5%
*-commutative35.5%
associate-/l*38.1%
Simplified38.1%
Taylor expanded in D around 0 38.1%
unpow238.1%
unpow238.1%
unswap-sqr81.2%
associate-*l*68.7%
Simplified68.7%
if 1.00000000000000003e139 < (*.f64 M D) Initial program 59.1%
clear-num59.1%
un-div-inv59.1%
div-inv59.1%
associate-*l*59.1%
associate-/r*59.1%
metadata-eval59.1%
Applied egg-rr59.1%
associate-/r/59.3%
Applied egg-rr59.3%
Taylor expanded in M around 0 48.0%
times-frac48.3%
unpow248.3%
unpow248.3%
times-frac62.9%
unpow262.9%
associate-/l*62.7%
Simplified62.7%
Final simplification81.9%
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
(FPCore (w0 M D h l d)
:precision binary64
(if (<= M 1.25e-177)
w0
(if (<= M 1.95e-20)
(* w0 (sqrt (- 1.0 (* 0.25 (/ (* D (* M (* M D))) (* l (/ d (/ h d))))))))
(*
w0
(sqrt (- 1.0 (* 0.25 (* (* (/ D d) (/ D d)) (/ (* M M) (/ l h))))))))))M = abs(M);
D = abs(D);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (M <= 1.25e-177) {
tmp = w0;
} else if (M <= 1.95e-20) {
tmp = w0 * sqrt((1.0 - (0.25 * ((D * (M * (M * D))) / (l * (d / (h / d)))))));
} else {
tmp = w0 * sqrt((1.0 - (0.25 * (((D / d) * (D / d)) * ((M * M) / (l / h))))));
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
real(8) function code(w0, m, d, h, l, d_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d_1
real(8) :: tmp
if (m <= 1.25d-177) then
tmp = w0
else if (m <= 1.95d-20) then
tmp = w0 * sqrt((1.0d0 - (0.25d0 * ((d * (m * (m * d))) / (l * (d_1 / (h / d_1)))))))
else
tmp = w0 * sqrt((1.0d0 - (0.25d0 * (((d / d_1) * (d / d_1)) * ((m * m) / (l / h))))))
end if
code = tmp
end function
M = Math.abs(M);
D = Math.abs(D);
assert M < D;
public static double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (M <= 1.25e-177) {
tmp = w0;
} else if (M <= 1.95e-20) {
tmp = w0 * Math.sqrt((1.0 - (0.25 * ((D * (M * (M * D))) / (l * (d / (h / d)))))));
} else {
tmp = w0 * Math.sqrt((1.0 - (0.25 * (((D / d) * (D / d)) * ((M * M) / (l / h))))));
}
return tmp;
}
M = abs(M) D = abs(D) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if M <= 1.25e-177: tmp = w0 elif M <= 1.95e-20: tmp = w0 * math.sqrt((1.0 - (0.25 * ((D * (M * (M * D))) / (l * (d / (h / d))))))) else: tmp = w0 * math.sqrt((1.0 - (0.25 * (((D / d) * (D / d)) * ((M * M) / (l / h)))))) return tmp
M = abs(M) D = abs(D) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (M <= 1.25e-177) tmp = w0; elseif (M <= 1.95e-20) tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(0.25 * Float64(Float64(D * Float64(M * Float64(M * D))) / Float64(l * Float64(d / Float64(h / d)))))))); else tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(0.25 * Float64(Float64(Float64(D / d) * Float64(D / d)) * Float64(Float64(M * M) / Float64(l / h))))))); end return tmp end
M = abs(M)
D = abs(D)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if (M <= 1.25e-177)
tmp = w0;
elseif (M <= 1.95e-20)
tmp = w0 * sqrt((1.0 - (0.25 * ((D * (M * (M * D))) / (l * (d / (h / d)))))));
else
tmp = w0 * sqrt((1.0 - (0.25 * (((D / d) * (D / d)) * ((M * M) / (l / h))))));
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[M, 1.25e-177], w0, If[LessEqual[M, 1.95e-20], N[(w0 * N[Sqrt[N[(1.0 - N[(0.25 * N[(N[(D * N[(M * N[(M * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(l * N[(d / N[(h / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(w0 * N[Sqrt[N[(1.0 - N[(0.25 * N[(N[(N[(D / d), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision] * N[(N[(M * M), $MachinePrecision] / N[(l / 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}\;M \leq 1.25 \cdot 10^{-177}:\\
\;\;\;\;w0\\
\mathbf{elif}\;M \leq 1.95 \cdot 10^{-20}:\\
\;\;\;\;w0 \cdot \sqrt{1 - 0.25 \cdot \frac{D \cdot \left(M \cdot \left(M \cdot D\right)\right)}{\ell \cdot \frac{d}{\frac{h}{d}}}}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{1 - 0.25 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \frac{M \cdot M}{\frac{\ell}{h}}\right)}\\
\end{array}
\end{array}
if M < 1.25e-177Initial program 88.0%
Taylor expanded in M around 0 73.9%
if 1.25e-177 < M < 1.95000000000000004e-20Initial program 81.5%
Taylor expanded in M around 0 62.3%
associate-*r*65.6%
*-commutative65.6%
unpow265.6%
unpow265.6%
swap-sqr78.7%
associate-/l*75.5%
*-commutative75.5%
*-commutative75.5%
swap-sqr62.3%
unpow262.3%
Simplified62.3%
Taylor expanded in d around 0 62.3%
unpow262.3%
associate-*l/65.6%
*-commutative65.6%
associate-/l*65.6%
Simplified65.6%
Taylor expanded in D around 0 65.6%
unpow265.6%
unpow265.6%
unswap-sqr81.3%
associate-*l*81.4%
Simplified81.4%
if 1.95000000000000004e-20 < M Initial program 63.3%
clear-num63.3%
un-div-inv63.3%
div-inv63.3%
associate-*l*63.3%
associate-/r*63.3%
metadata-eval63.3%
Applied egg-rr63.3%
associate-/r/68.2%
Applied egg-rr68.2%
Taylor expanded in M around 0 45.6%
times-frac42.5%
unpow242.5%
unpow242.5%
times-frac53.9%
unpow253.9%
associate-/l*54.8%
Simplified54.8%
Final simplification70.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 1.8e-78)
(*
w0
(sqrt
(+ 1.0 (/ -1.0 (/ l (* (/ 0.25 d) (/ (* (* M h) (* D (* M D))) d)))))))
(* w0 (sqrt (- 1.0 (* 0.25 (* (* (/ D d) (/ D d)) (/ (* M M) (/ l h)))))))))M = abs(M);
D = abs(D);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (M <= 1.8e-78) {
tmp = w0 * sqrt((1.0 + (-1.0 / (l / ((0.25 / d) * (((M * h) * (D * (M * D))) / d))))));
} else {
tmp = w0 * sqrt((1.0 - (0.25 * (((D / d) * (D / d)) * ((M * M) / (l / h))))));
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
real(8) function code(w0, m, d, h, l, d_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d_1
real(8) :: tmp
if (m <= 1.8d-78) then
tmp = w0 * sqrt((1.0d0 + ((-1.0d0) / (l / ((0.25d0 / d_1) * (((m * h) * (d * (m * d))) / d_1))))))
else
tmp = w0 * sqrt((1.0d0 - (0.25d0 * (((d / d_1) * (d / d_1)) * ((m * m) / (l / h))))))
end if
code = tmp
end function
M = Math.abs(M);
D = Math.abs(D);
assert M < D;
public static double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (M <= 1.8e-78) {
tmp = w0 * Math.sqrt((1.0 + (-1.0 / (l / ((0.25 / d) * (((M * h) * (D * (M * D))) / d))))));
} else {
tmp = w0 * Math.sqrt((1.0 - (0.25 * (((D / d) * (D / d)) * ((M * M) / (l / h))))));
}
return tmp;
}
M = abs(M) D = abs(D) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if M <= 1.8e-78: tmp = w0 * math.sqrt((1.0 + (-1.0 / (l / ((0.25 / d) * (((M * h) * (D * (M * D))) / d)))))) else: tmp = w0 * math.sqrt((1.0 - (0.25 * (((D / d) * (D / d)) * ((M * M) / (l / h)))))) return tmp
M = abs(M) D = abs(D) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (M <= 1.8e-78) tmp = Float64(w0 * sqrt(Float64(1.0 + Float64(-1.0 / Float64(l / Float64(Float64(0.25 / d) * Float64(Float64(Float64(M * h) * Float64(D * Float64(M * D))) / d))))))); else tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(0.25 * Float64(Float64(Float64(D / d) * Float64(D / d)) * Float64(Float64(M * M) / Float64(l / h))))))); end return tmp end
M = abs(M)
D = abs(D)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if (M <= 1.8e-78)
tmp = w0 * sqrt((1.0 + (-1.0 / (l / ((0.25 / d) * (((M * h) * (D * (M * D))) / d))))));
else
tmp = w0 * sqrt((1.0 - (0.25 * (((D / d) * (D / d)) * ((M * M) / (l / h))))));
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[M, 1.8e-78], N[(w0 * N[Sqrt[N[(1.0 + N[(-1.0 / N[(l / N[(N[(0.25 / d), $MachinePrecision] * N[(N[(N[(M * h), $MachinePrecision] * N[(D * N[(M * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(w0 * N[Sqrt[N[(1.0 - N[(0.25 * N[(N[(N[(D / d), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision] * N[(N[(M * M), $MachinePrecision] / N[(l / 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}\;M \leq 1.8 \cdot 10^{-78}:\\
\;\;\;\;w0 \cdot \sqrt{1 + \frac{-1}{\frac{\ell}{\frac{0.25}{d} \cdot \frac{\left(M \cdot h\right) \cdot \left(D \cdot \left(M \cdot D\right)\right)}{d}}}}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{1 - 0.25 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \frac{M \cdot M}{\frac{\ell}{h}}\right)}\\
\end{array}
\end{array}
if M < 1.8000000000000001e-78Initial program 87.0%
associate-*r/91.4%
clear-num91.4%
div-inv91.3%
associate-*l*90.8%
associate-/r*90.8%
metadata-eval90.8%
Applied egg-rr90.8%
Taylor expanded in M around 0 61.5%
unpow261.5%
associate-*r/61.5%
times-frac70.1%
unpow270.1%
unpow270.1%
associate-*r*74.0%
associate-*r*78.0%
*-commutative78.0%
associate-*l*87.7%
Simplified87.7%
if 1.8000000000000001e-78 < M Initial program 67.2%
clear-num67.2%
un-div-inv67.2%
div-inv67.2%
associate-*l*67.2%
associate-/r*67.2%
metadata-eval67.2%
Applied egg-rr67.2%
associate-/r/71.2%
Applied egg-rr71.2%
Taylor expanded in M around 0 51.2%
times-frac48.6%
unpow248.6%
unpow248.6%
times-frac59.4%
unpow259.4%
associate-/l*60.2%
Simplified60.2%
Final simplification79.6%
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. (FPCore (w0 M D h l d) :precision binary64 (if (<= M 1.1e-77) (* w0 (+ 1.0 (* (* D (* D (* (/ M d) (/ (/ M l) (/ d h))))) -0.125))) (* w0 (sqrt (- 1.0 (* 0.25 (* (* (/ D d) (/ D d)) (/ (* M M) (/ l h)))))))))
M = abs(M);
D = abs(D);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (M <= 1.1e-77) {
tmp = w0 * (1.0 + ((D * (D * ((M / d) * ((M / l) / (d / h))))) * -0.125));
} else {
tmp = w0 * sqrt((1.0 - (0.25 * (((D / d) * (D / d)) * ((M * M) / (l / h))))));
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
real(8) function code(w0, m, d, h, l, d_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d_1
real(8) :: tmp
if (m <= 1.1d-77) then
tmp = w0 * (1.0d0 + ((d * (d * ((m / d_1) * ((m / l) / (d_1 / h))))) * (-0.125d0)))
else
tmp = w0 * sqrt((1.0d0 - (0.25d0 * (((d / d_1) * (d / d_1)) * ((m * m) / (l / h))))))
end if
code = tmp
end function
M = Math.abs(M);
D = Math.abs(D);
assert M < D;
public static double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (M <= 1.1e-77) {
tmp = w0 * (1.0 + ((D * (D * ((M / d) * ((M / l) / (d / h))))) * -0.125));
} else {
tmp = w0 * Math.sqrt((1.0 - (0.25 * (((D / d) * (D / d)) * ((M * M) / (l / h))))));
}
return tmp;
}
M = abs(M) D = abs(D) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if M <= 1.1e-77: tmp = w0 * (1.0 + ((D * (D * ((M / d) * ((M / l) / (d / h))))) * -0.125)) else: tmp = w0 * math.sqrt((1.0 - (0.25 * (((D / d) * (D / d)) * ((M * M) / (l / h)))))) return tmp
M = abs(M) D = abs(D) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (M <= 1.1e-77) tmp = Float64(w0 * Float64(1.0 + Float64(Float64(D * Float64(D * Float64(Float64(M / d) * Float64(Float64(M / l) / Float64(d / h))))) * -0.125))); else tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(0.25 * Float64(Float64(Float64(D / d) * Float64(D / d)) * Float64(Float64(M * M) / Float64(l / h))))))); end return tmp end
M = abs(M)
D = abs(D)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if (M <= 1.1e-77)
tmp = w0 * (1.0 + ((D * (D * ((M / d) * ((M / l) / (d / h))))) * -0.125));
else
tmp = w0 * sqrt((1.0 - (0.25 * (((D / d) * (D / d)) * ((M * M) / (l / h))))));
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[M, 1.1e-77], N[(w0 * N[(1.0 + N[(N[(D * N[(D * N[(N[(M / d), $MachinePrecision] * N[(N[(M / l), $MachinePrecision] / N[(d / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(w0 * N[Sqrt[N[(1.0 - N[(0.25 * N[(N[(N[(D / d), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision] * N[(N[(M * M), $MachinePrecision] / N[(l / 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}\;M \leq 1.1 \cdot 10^{-77}:\\
\;\;\;\;w0 \cdot \left(1 + \left(D \cdot \left(D \cdot \left(\frac{M}{d} \cdot \frac{\frac{M}{\ell}}{\frac{d}{h}}\right)\right)\right) \cdot -0.125\right)\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{1 - 0.25 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \frac{M \cdot M}{\frac{\ell}{h}}\right)}\\
\end{array}
\end{array}
if M < 1.10000000000000003e-77Initial program 87.1%
Taylor expanded in M around 0 58.4%
*-commutative58.4%
times-frac57.8%
unpow257.8%
unpow257.8%
unpow257.8%
Simplified57.8%
Taylor expanded in D around 0 58.4%
unpow258.4%
associate-*r*60.0%
unpow260.0%
unpow260.0%
times-frac59.4%
associate-/r/58.3%
*-rgt-identity58.3%
associate-*r/57.7%
unpow257.7%
associate-*l*57.2%
associate-*l*64.8%
associate-*r/65.4%
*-commutative65.4%
*-lft-identity65.4%
unpow265.4%
associate-/r/65.2%
*-commutative65.2%
associate-/l*67.4%
Simplified67.4%
times-frac75.4%
Applied egg-rr75.4%
Taylor expanded in M around 0 65.7%
associate-/r*68.5%
unpow268.5%
associate-/l*67.4%
unpow267.4%
associate-*l/70.9%
associate-/r*67.4%
associate-/l/69.2%
associate-*r/72.0%
*-commutative72.0%
times-frac79.2%
Simplified79.2%
if 1.10000000000000003e-77 < M Initial program 66.8%
clear-num66.7%
un-div-inv66.7%
div-inv66.7%
associate-*l*66.7%
associate-/r*66.7%
metadata-eval66.7%
Applied egg-rr66.7%
associate-/r/70.9%
Applied egg-rr70.9%
Taylor expanded in M around 0 50.6%
times-frac47.9%
unpow247.9%
unpow247.9%
times-frac58.8%
unpow258.8%
associate-/l*59.6%
Simplified59.6%
Final simplification73.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 5.2e+80) (* w0 (+ 1.0 (* -0.125 (* D (* D (* (/ M l) (/ (/ M d) (/ d h)))))))) (* w0 (+ 1.0 (* -0.125 (/ (* (* (/ D d) (/ D d)) (* 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 (d <= 5.2e+80) {
tmp = w0 * (1.0 + (-0.125 * (D * (D * ((M / l) * ((M / d) / (d / h)))))));
} else {
tmp = w0 * (1.0 + (-0.125 * ((((D / d) * (D / d)) * (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 (d_1 <= 5.2d+80) then
tmp = w0 * (1.0d0 + ((-0.125d0) * (d * (d * ((m / l) * ((m / d_1) / (d_1 / h)))))))
else
tmp = w0 * (1.0d0 + ((-0.125d0) * ((((d / d_1) * (d / d_1)) * (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 (d <= 5.2e+80) {
tmp = w0 * (1.0 + (-0.125 * (D * (D * ((M / l) * ((M / d) / (d / h)))))));
} else {
tmp = w0 * (1.0 + (-0.125 * ((((D / d) * (D / d)) * (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 d <= 5.2e+80: tmp = w0 * (1.0 + (-0.125 * (D * (D * ((M / l) * ((M / d) / (d / h))))))) else: tmp = w0 * (1.0 + (-0.125 * ((((D / d) * (D / d)) * (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 (d <= 5.2e+80) tmp = Float64(w0 * Float64(1.0 + Float64(-0.125 * Float64(D * Float64(D * Float64(Float64(M / l) * Float64(Float64(M / d) / Float64(d / h)))))))); else tmp = Float64(w0 * Float64(1.0 + Float64(-0.125 * Float64(Float64(Float64(Float64(D / d) * Float64(D / d)) * 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 (d <= 5.2e+80)
tmp = w0 * (1.0 + (-0.125 * (D * (D * ((M / l) * ((M / d) / (d / h)))))));
else
tmp = w0 * (1.0 + (-0.125 * ((((D / d) * (D / d)) * (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[d, 5.2e+80], N[(w0 * N[(1.0 + N[(-0.125 * N[(D * N[(D * N[(N[(M / l), $MachinePrecision] * N[(N[(M / d), $MachinePrecision] / N[(d / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(w0 * N[(1.0 + N[(-0.125 * N[(N[(N[(N[(D / d), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision] * N[(M * N[(M * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;d \leq 5.2 \cdot 10^{+80}:\\
\;\;\;\;w0 \cdot \left(1 + -0.125 \cdot \left(D \cdot \left(D \cdot \left(\frac{M}{\ell} \cdot \frac{\frac{M}{d}}{\frac{d}{h}}\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \left(1 + -0.125 \cdot \frac{\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \left(M \cdot \left(M \cdot h\right)\right)}{\ell}\right)\\
\end{array}
\end{array}
if d < 5.19999999999999963e80Initial program 80.2%
Taylor expanded in M around 0 53.7%
*-commutative53.7%
times-frac52.7%
unpow252.7%
unpow252.7%
unpow252.7%
Simplified52.7%
Taylor expanded in D around 0 53.7%
unpow253.7%
associate-*r*54.7%
unpow254.7%
unpow254.7%
times-frac54.2%
associate-/r/53.5%
*-rgt-identity53.5%
associate-*r/53.0%
unpow253.0%
associate-*l*52.6%
associate-*l*58.4%
associate-*r/58.9%
*-commutative58.9%
*-lft-identity58.9%
unpow258.9%
associate-/r/58.8%
*-commutative58.8%
associate-/l*61.3%
Simplified61.3%
Taylor expanded in M around 0 59.3%
associate-/r*61.8%
unpow261.8%
unpow261.8%
times-frac66.8%
associate-/r/63.8%
associate-*r/70.9%
associate-*l/68.8%
associate-/r/68.8%
*-commutative68.8%
associate-/r*71.8%
Simplified71.8%
if 5.19999999999999963e80 < d Initial program 84.8%
Taylor expanded in M around 0 63.6%
*-commutative63.6%
times-frac61.7%
unpow261.7%
unpow261.7%
unpow261.7%
Simplified61.7%
associate-*r/63.7%
associate-/l*74.7%
associate-*l*80.4%
Applied egg-rr80.4%
Taylor expanded in D around 0 69.4%
unpow269.4%
unpow269.4%
times-frac81.3%
Simplified81.3%
Final simplification73.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 (* w0 (+ 1.0 (* (* D (* D (* (/ M d) (/ (/ M l) (/ d h))))) -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 * ((M / d) * ((M / l) / (d / h))))) * -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 * ((m / d_1) * ((m / l) / (d_1 / h))))) * (-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 * ((M / d) * ((M / l) / (d / h))))) * -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 * ((M / d) * ((M / l) / (d / h))))) * -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(D * Float64(Float64(M / d) * Float64(Float64(M / l) / Float64(d / h))))) * -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 * ((M / d) * ((M / l) / (d / h))))) * -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[(D * N[(N[(M / d), $MachinePrecision] * N[(N[(M / l), $MachinePrecision] / N[(d / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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 \left(D \cdot \left(\frac{M}{d} \cdot \frac{\frac{M}{\ell}}{\frac{d}{h}}\right)\right)\right) \cdot -0.125\right)
\end{array}
Initial program 81.1%
Taylor expanded in M around 0 55.7%
*-commutative55.7%
times-frac54.5%
unpow254.5%
unpow254.5%
unpow254.5%
Simplified54.5%
Taylor expanded in D around 0 55.7%
unpow255.7%
associate-*r*56.9%
unpow256.9%
unpow256.9%
times-frac55.3%
associate-/r/54.0%
*-rgt-identity54.0%
associate-*r/53.6%
unpow253.6%
associate-*l*53.6%
associate-*l*60.6%
associate-*r/60.9%
*-commutative60.9%
*-lft-identity60.9%
unpow260.9%
associate-/r/61.7%
*-commutative61.7%
associate-/l*63.7%
Simplified63.7%
times-frac71.6%
Applied egg-rr71.6%
Taylor expanded in M around 0 62.4%
associate-/r*64.4%
unpow264.4%
associate-/l*63.3%
unpow263.3%
associate-*l/66.1%
associate-/r*63.7%
associate-/l/63.4%
associate-*r/66.1%
*-commutative66.1%
times-frac74.0%
Simplified74.0%
Final simplification74.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 (* w0 (+ 1.0 (* -0.125 (* D (* D (* (/ M l) (/ (/ M d) (/ d h)))))))))
M = abs(M);
D = abs(D);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
return w0 * (1.0 + (-0.125 * (D * (D * ((M / l) * ((M / d) / (d / h)))))));
}
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 + ((-0.125d0) * (d * (d * ((m / l) * ((m / d_1) / (d_1 / h)))))))
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 + (-0.125 * (D * (D * ((M / l) * ((M / d) / (d / h)))))));
}
M = abs(M) D = abs(D) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): return w0 * (1.0 + (-0.125 * (D * (D * ((M / l) * ((M / d) / (d / h)))))))
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(-0.125 * Float64(D * Float64(D * Float64(Float64(M / l) * Float64(Float64(M / d) / Float64(d / h)))))))) 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 + (-0.125 * (D * (D * ((M / l) * ((M / d) / (d / h)))))));
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[(-0.125 * N[(D * N[(D * N[(N[(M / l), $MachinePrecision] * N[(N[(M / d), $MachinePrecision] / N[(d / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
w0 \cdot \left(1 + -0.125 \cdot \left(D \cdot \left(D \cdot \left(\frac{M}{\ell} \cdot \frac{\frac{M}{d}}{\frac{d}{h}}\right)\right)\right)\right)
\end{array}
Initial program 81.1%
Taylor expanded in M around 0 55.7%
*-commutative55.7%
times-frac54.5%
unpow254.5%
unpow254.5%
unpow254.5%
Simplified54.5%
Taylor expanded in D around 0 55.7%
unpow255.7%
associate-*r*56.9%
unpow256.9%
unpow256.9%
times-frac55.3%
associate-/r/54.0%
*-rgt-identity54.0%
associate-*r/53.6%
unpow253.6%
associate-*l*53.6%
associate-*l*60.6%
associate-*r/60.9%
*-commutative60.9%
*-lft-identity60.9%
unpow260.9%
associate-/r/61.7%
*-commutative61.7%
associate-/l*63.7%
Simplified63.7%
Taylor expanded in M around 0 62.4%
associate-/r*64.4%
unpow264.4%
unpow264.4%
times-frac68.9%
associate-/r/66.1%
associate-*r/73.7%
associate-*l/71.6%
associate-/r/71.6%
*-commutative71.6%
associate-/r*74.4%
Simplified74.4%
Final simplification74.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 (* w0 (+ 1.0 (* -0.125 (* D (* D (/ (* M (* (/ h d) (/ M 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) {
return w0 * (1.0 + (-0.125 * (D * (D * ((M * ((h / d) * (M / d))) / l)))));
}
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 + ((-0.125d0) * (d * (d * ((m * ((h / d_1) * (m / d_1))) / l)))))
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 + (-0.125 * (D * (D * ((M * ((h / d) * (M / d))) / l)))));
}
M = abs(M) D = abs(D) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): return w0 * (1.0 + (-0.125 * (D * (D * ((M * ((h / d) * (M / d))) / l)))))
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(-0.125 * Float64(D * Float64(D * Float64(Float64(M * Float64(Float64(h / d) * Float64(M / d))) / l)))))) 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 + (-0.125 * (D * (D * ((M * ((h / d) * (M / d))) / l)))));
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[(-0.125 * N[(D * N[(D * N[(N[(M * N[(N[(h / d), $MachinePrecision] * N[(M / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
w0 \cdot \left(1 + -0.125 \cdot \left(D \cdot \left(D \cdot \frac{M \cdot \left(\frac{h}{d} \cdot \frac{M}{d}\right)}{\ell}\right)\right)\right)
\end{array}
Initial program 81.1%
Taylor expanded in M around 0 55.7%
*-commutative55.7%
times-frac54.5%
unpow254.5%
unpow254.5%
unpow254.5%
Simplified54.5%
Taylor expanded in D around 0 55.7%
unpow255.7%
associate-*r*56.9%
unpow256.9%
unpow256.9%
times-frac55.3%
associate-/r/54.0%
*-rgt-identity54.0%
associate-*r/53.6%
unpow253.6%
associate-*l*53.6%
associate-*l*60.6%
associate-*r/60.9%
*-commutative60.9%
*-lft-identity60.9%
unpow260.9%
associate-/r/61.7%
*-commutative61.7%
associate-/l*63.7%
Simplified63.7%
times-frac71.6%
Applied egg-rr71.6%
associate-*l/73.7%
associate-/r/76.4%
Applied egg-rr76.4%
Final simplification76.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 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 81.1%
Taylor expanded in M around 0 67.6%
Final simplification67.6%
herbie shell --seed 2023279
(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))))))