
(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 10 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 and D should be sorted in increasing order before calling this function. (FPCore (w0 M D h l d) :precision binary64 (* w0 (sqrt (- 1.0 (* h (/ (pow (* M (* D (/ 0.5 d))) 2.0) l))))))
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
return w0 * sqrt((1.0 - (h * (pow((M * (D * (0.5 / d))), 2.0) / l))));
}
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 * sqrt((1.0d0 - (h * (((m * (d * (0.5d0 / d_1))) ** 2.0d0) / l))))
end function
assert M < D;
public static double code(double w0, double M, double D, double h, double l, double d) {
return w0 * Math.sqrt((1.0 - (h * (Math.pow((M * (D * (0.5 / d))), 2.0) / l))));
}
[M, D] = sort([M, D]) def code(w0, M, D, h, l, d): return w0 * math.sqrt((1.0 - (h * (math.pow((M * (D * (0.5 / d))), 2.0) / l))))
M, D = sort([M, D]) function code(w0, M, D, h, l, d) return Float64(w0 * sqrt(Float64(1.0 - Float64(h * Float64((Float64(M * Float64(D * Float64(0.5 / d))) ^ 2.0) / l))))) end
M, D = num2cell(sort([M, D])){:}
function tmp = code(w0, M, D, h, l, d)
tmp = w0 * sqrt((1.0 - (h * (((M * (D * (0.5 / d))) ^ 2.0) / l))));
end
NOTE: M and D should be sorted in increasing order before calling this function. code[w0_, M_, D_, h_, l_, d_] := N[(w0 * N[Sqrt[N[(1.0 - N[(h * N[(N[Power[N[(M * N[(D * N[(0.5 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[M, D] = \mathsf{sort}([M, D])\\
\\
w0 \cdot \sqrt{1 - h \cdot \frac{{\left(M \cdot \left(D \cdot \frac{0.5}{d}\right)\right)}^{2}}{\ell}}
\end{array}
Initial program 79.3%
associate-/l*80.1%
Simplified80.1%
associate-/l*79.3%
clear-num79.3%
un-div-inv79.3%
associate-*l/77.8%
*-commutative77.8%
associate-/r*77.8%
div-inv77.8%
metadata-eval77.8%
Applied egg-rr77.8%
associate-/r/83.5%
*-commutative83.5%
*-commutative83.5%
associate-*l/83.5%
associate-*l*85.8%
*-commutative85.8%
Simplified85.8%
Final simplification85.8%
NOTE: M and D should be sorted in increasing order before calling this function. (FPCore (w0 M D h l d) :precision binary64 (* w0 (sqrt (- 1.0 (* h (* 0.25 (* (/ (* M D) (* d l)) (* M (/ D d)))))))))
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
return w0 * sqrt((1.0 - (h * (0.25 * (((M * D) / (d * l)) * (M * (D / d)))))));
}
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 * sqrt((1.0d0 - (h * (0.25d0 * (((m * d) / (d_1 * l)) * (m * (d / d_1)))))))
end function
assert M < D;
public static double code(double w0, double M, double D, double h, double l, double d) {
return w0 * Math.sqrt((1.0 - (h * (0.25 * (((M * D) / (d * l)) * (M * (D / d)))))));
}
[M, D] = sort([M, D]) def code(w0, M, D, h, l, d): return w0 * math.sqrt((1.0 - (h * (0.25 * (((M * D) / (d * l)) * (M * (D / d)))))))
M, D = sort([M, D]) function code(w0, M, D, h, l, d) return Float64(w0 * sqrt(Float64(1.0 - Float64(h * Float64(0.25 * Float64(Float64(Float64(M * D) / Float64(d * l)) * Float64(M * Float64(D / d)))))))) end
M, D = num2cell(sort([M, D])){:}
function tmp = code(w0, M, D, h, l, d)
tmp = w0 * sqrt((1.0 - (h * (0.25 * (((M * D) / (d * l)) * (M * (D / d)))))));
end
NOTE: M and D should be sorted in increasing order before calling this function. code[w0_, M_, D_, h_, l_, d_] := N[(w0 * N[Sqrt[N[(1.0 - N[(h * N[(0.25 * N[(N[(N[(M * D), $MachinePrecision] / N[(d * l), $MachinePrecision]), $MachinePrecision] * N[(M * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[M, D] = \mathsf{sort}([M, D])\\
\\
w0 \cdot \sqrt{1 - h \cdot \left(0.25 \cdot \left(\frac{M \cdot D}{d \cdot \ell} \cdot \left(M \cdot \frac{D}{d}\right)\right)\right)}
\end{array}
Initial program 79.3%
associate-/l*80.1%
Simplified80.1%
associate-/l*79.3%
clear-num79.3%
un-div-inv79.3%
associate-*l/77.8%
*-commutative77.8%
associate-/r*77.8%
div-inv77.8%
metadata-eval77.8%
Applied egg-rr77.8%
associate-/r/83.5%
*-commutative83.5%
*-commutative83.5%
associate-*l/83.5%
associate-*l*85.8%
*-commutative85.8%
Simplified85.8%
Taylor expanded in M around 0 59.2%
unpow259.2%
unpow259.2%
unswap-sqr71.7%
unpow271.7%
*-commutative71.7%
associate-*l*76.0%
Simplified76.0%
times-frac83.7%
Applied egg-rr83.7%
div-inv83.7%
Applied egg-rr83.7%
associate-*r/83.7%
*-rgt-identity83.7%
associate-*l/83.0%
*-commutative83.0%
Simplified83.0%
Final simplification83.0%
NOTE: M and D should be sorted in increasing order before calling this function. (FPCore (w0 M D h l d) :precision binary64 (* w0 (sqrt (- 1.0 (* h (* 0.25 (* (/ (* M D) d) (/ (* M D) (* d l)))))))))
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
return w0 * sqrt((1.0 - (h * (0.25 * (((M * D) / d) * ((M * D) / (d * l)))))));
}
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 * sqrt((1.0d0 - (h * (0.25d0 * (((m * d) / d_1) * ((m * d) / (d_1 * l)))))))
end function
assert M < D;
public static double code(double w0, double M, double D, double h, double l, double d) {
return w0 * Math.sqrt((1.0 - (h * (0.25 * (((M * D) / d) * ((M * D) / (d * l)))))));
}
[M, D] = sort([M, D]) def code(w0, M, D, h, l, d): return w0 * math.sqrt((1.0 - (h * (0.25 * (((M * D) / d) * ((M * D) / (d * l)))))))
M, D = sort([M, D]) function code(w0, M, D, h, l, d) return Float64(w0 * sqrt(Float64(1.0 - Float64(h * Float64(0.25 * Float64(Float64(Float64(M * D) / d) * Float64(Float64(M * D) / Float64(d * l)))))))) end
M, D = num2cell(sort([M, D])){:}
function tmp = code(w0, M, D, h, l, d)
tmp = w0 * sqrt((1.0 - (h * (0.25 * (((M * D) / d) * ((M * D) / (d * l)))))));
end
NOTE: M and D should be sorted in increasing order before calling this function. code[w0_, M_, D_, h_, l_, d_] := N[(w0 * N[Sqrt[N[(1.0 - N[(h * N[(0.25 * N[(N[(N[(M * D), $MachinePrecision] / d), $MachinePrecision] * N[(N[(M * D), $MachinePrecision] / N[(d * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[M, D] = \mathsf{sort}([M, D])\\
\\
w0 \cdot \sqrt{1 - h \cdot \left(0.25 \cdot \left(\frac{M \cdot D}{d} \cdot \frac{M \cdot D}{d \cdot \ell}\right)\right)}
\end{array}
Initial program 79.3%
associate-/l*80.1%
Simplified80.1%
associate-/l*79.3%
clear-num79.3%
un-div-inv79.3%
associate-*l/77.8%
*-commutative77.8%
associate-/r*77.8%
div-inv77.8%
metadata-eval77.8%
Applied egg-rr77.8%
associate-/r/83.5%
*-commutative83.5%
*-commutative83.5%
associate-*l/83.5%
associate-*l*85.8%
*-commutative85.8%
Simplified85.8%
Taylor expanded in M around 0 59.2%
unpow259.2%
unpow259.2%
unswap-sqr71.7%
unpow271.7%
*-commutative71.7%
associate-*l*76.0%
Simplified76.0%
times-frac83.7%
Applied egg-rr83.7%
Final simplification83.7%
NOTE: M and D should be sorted in increasing order before calling this function. (FPCore (w0 M D h l d) :precision binary64 (if (or (<= M -2.9e-80) (not (<= M 1.5e-76))) (* w0 (+ 1.0 (* -0.125 (* M (* M (/ (* h D) (/ l (/ D (* d d))))))))) w0))
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if ((M <= -2.9e-80) || !(M <= 1.5e-76)) {
tmp = w0 * (1.0 + (-0.125 * (M * (M * ((h * D) / (l / (D / (d * d))))))));
} else {
tmp = w0;
}
return tmp;
}
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 <= (-2.9d-80)) .or. (.not. (m <= 1.5d-76))) then
tmp = w0 * (1.0d0 + ((-0.125d0) * (m * (m * ((h * d) / (l / (d / (d_1 * d_1))))))))
else
tmp = w0
end if
code = tmp
end function
assert M < D;
public static double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if ((M <= -2.9e-80) || !(M <= 1.5e-76)) {
tmp = w0 * (1.0 + (-0.125 * (M * (M * ((h * D) / (l / (D / (d * d))))))));
} else {
tmp = w0;
}
return tmp;
}
[M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if (M <= -2.9e-80) or not (M <= 1.5e-76): tmp = w0 * (1.0 + (-0.125 * (M * (M * ((h * D) / (l / (D / (d * d)))))))) else: tmp = w0 return tmp
M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if ((M <= -2.9e-80) || !(M <= 1.5e-76)) tmp = Float64(w0 * Float64(1.0 + Float64(-0.125 * Float64(M * Float64(M * Float64(Float64(h * D) / Float64(l / Float64(D / Float64(d * d))))))))); else tmp = w0; end return tmp end
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if ((M <= -2.9e-80) || ~((M <= 1.5e-76)))
tmp = w0 * (1.0 + (-0.125 * (M * (M * ((h * D) / (l / (D / (d * d))))))));
else
tmp = w0;
end
tmp_2 = tmp;
end
NOTE: M and D should be sorted in increasing order before calling this function. code[w0_, M_, D_, h_, l_, d_] := If[Or[LessEqual[M, -2.9e-80], N[Not[LessEqual[M, 1.5e-76]], $MachinePrecision]], N[(w0 * N[(1.0 + N[(-0.125 * N[(M * N[(M * N[(N[(h * D), $MachinePrecision] / N[(l / N[(D / N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], w0]
\begin{array}{l}
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;M \leq -2.9 \cdot 10^{-80} \lor \neg \left(M \leq 1.5 \cdot 10^{-76}\right):\\
\;\;\;\;w0 \cdot \left(1 + -0.125 \cdot \left(M \cdot \left(M \cdot \frac{h \cdot D}{\frac{\ell}{\frac{D}{d \cdot d}}}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;w0\\
\end{array}
\end{array}
if M < -2.89999999999999998e-80 or 1.50000000000000012e-76 < M Initial program 74.9%
associate-/l*76.3%
Simplified76.3%
Taylor expanded in M around 0 47.5%
*-commutative47.5%
associate-/l*48.2%
unpow248.2%
unpow248.2%
*-commutative48.2%
unpow248.2%
Simplified48.2%
Taylor expanded in D around 0 47.5%
unpow247.5%
associate-*r*52.4%
unpow252.4%
*-commutative52.4%
associate-*l/53.2%
unpow253.2%
*-commutative53.2%
associate-*l*60.9%
*-commutative60.9%
associate-*l*63.1%
Simplified63.1%
Taylor expanded in M around 0 58.7%
*-commutative58.7%
*-commutative58.7%
associate-*l*64.9%
*-commutative64.9%
associate-*r/65.7%
associate-*r/67.9%
unpow267.9%
associate-/l*73.3%
associate-*r/71.9%
*-commutative71.9%
associate-/l*72.6%
unpow272.6%
Simplified72.6%
if -2.89999999999999998e-80 < M < 1.50000000000000012e-76Initial program 85.0%
associate-/l*85.0%
Simplified85.0%
Taylor expanded in M around 0 84.9%
Final simplification78.0%
NOTE: M and D should be sorted in increasing order before calling this function. (FPCore (w0 M D h l d) :precision binary64 (if (or (<= D -1.5e-152) (not (<= D 1.05e-46))) (* w0 (+ 1.0 (* -0.125 (* (/ D (/ l M)) (/ D (* (/ d M) (/ d h))))))) w0))
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if ((D <= -1.5e-152) || !(D <= 1.05e-46)) {
tmp = w0 * (1.0 + (-0.125 * ((D / (l / M)) * (D / ((d / M) * (d / h))))));
} else {
tmp = w0;
}
return tmp;
}
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-152)) .or. (.not. (d <= 1.05d-46))) then
tmp = w0 * (1.0d0 + ((-0.125d0) * ((d / (l / m)) * (d / ((d_1 / m) * (d_1 / h))))))
else
tmp = w0
end if
code = tmp
end function
assert M < D;
public static double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if ((D <= -1.5e-152) || !(D <= 1.05e-46)) {
tmp = w0 * (1.0 + (-0.125 * ((D / (l / M)) * (D / ((d / M) * (d / h))))));
} else {
tmp = w0;
}
return tmp;
}
[M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if (D <= -1.5e-152) or not (D <= 1.05e-46): tmp = w0 * (1.0 + (-0.125 * ((D / (l / M)) * (D / ((d / M) * (d / h)))))) else: tmp = w0 return tmp
M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if ((D <= -1.5e-152) || !(D <= 1.05e-46)) tmp = Float64(w0 * Float64(1.0 + Float64(-0.125 * Float64(Float64(D / Float64(l / M)) * Float64(D / Float64(Float64(d / M) * Float64(d / h))))))); else tmp = w0; end return tmp end
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if ((D <= -1.5e-152) || ~((D <= 1.05e-46)))
tmp = w0 * (1.0 + (-0.125 * ((D / (l / M)) * (D / ((d / M) * (d / h))))));
else
tmp = w0;
end
tmp_2 = tmp;
end
NOTE: M and D should be sorted in increasing order before calling this function. code[w0_, M_, D_, h_, l_, d_] := If[Or[LessEqual[D, -1.5e-152], N[Not[LessEqual[D, 1.05e-46]], $MachinePrecision]], N[(w0 * N[(1.0 + N[(-0.125 * N[(N[(D / N[(l / M), $MachinePrecision]), $MachinePrecision] * N[(D / N[(N[(d / M), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], w0]
\begin{array}{l}
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;D \leq -1.5 \cdot 10^{-152} \lor \neg \left(D \leq 1.05 \cdot 10^{-46}\right):\\
\;\;\;\;w0 \cdot \left(1 + -0.125 \cdot \left(\frac{D}{\frac{\ell}{M}} \cdot \frac{D}{\frac{d}{M} \cdot \frac{d}{h}}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;w0\\
\end{array}
\end{array}
if D < -1.5e-152 or 1.04999999999999994e-46 < D Initial program 70.4%
associate-/l*71.7%
Simplified71.7%
Taylor expanded in M around 0 46.7%
*-commutative46.7%
associate-/l*48.1%
unpow248.1%
unpow248.1%
*-commutative48.1%
unpow248.1%
Simplified48.1%
Taylor expanded in l around 0 48.1%
unpow248.1%
associate-*l*50.9%
Simplified50.9%
associate-*r*48.1%
*-commutative48.1%
associate-*l*48.8%
frac-times53.6%
times-frac63.7%
times-frac70.7%
Applied egg-rr70.7%
if -1.5e-152 < D < 1.04999999999999994e-46Initial program 91.0%
associate-/l*91.0%
Simplified91.0%
Taylor expanded in M around 0 94.1%
Final simplification80.9%
NOTE: M and D should be sorted in increasing order before calling this function.
(FPCore (w0 M D h l d)
:precision binary64
(if (<= M -5.2e-81)
(* w0 (+ 1.0 (* -0.125 (* M (* M (/ (* h D) (/ l (/ D (* d d)))))))))
(if (<= M 6.8e-161)
w0
(* w0 (+ 1.0 (* -0.125 (* M (* (* h M) (* (/ D d) (/ D (* d l)))))))))))assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (M <= -5.2e-81) {
tmp = w0 * (1.0 + (-0.125 * (M * (M * ((h * D) / (l / (D / (d * d))))))));
} else if (M <= 6.8e-161) {
tmp = w0;
} else {
tmp = w0 * (1.0 + (-0.125 * (M * ((h * M) * ((D / d) * (D / (d * l)))))));
}
return tmp;
}
NOTE: M and D should be sorted in increasing order before calling this function.
real(8) function code(w0, m, d, h, l, d_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d_1
real(8) :: tmp
if (m <= (-5.2d-81)) then
tmp = w0 * (1.0d0 + ((-0.125d0) * (m * (m * ((h * d) / (l / (d / (d_1 * d_1))))))))
else if (m <= 6.8d-161) then
tmp = w0
else
tmp = w0 * (1.0d0 + ((-0.125d0) * (m * ((h * m) * ((d / d_1) * (d / (d_1 * l)))))))
end if
code = tmp
end function
assert M < D;
public static double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (M <= -5.2e-81) {
tmp = w0 * (1.0 + (-0.125 * (M * (M * ((h * D) / (l / (D / (d * d))))))));
} else if (M <= 6.8e-161) {
tmp = w0;
} else {
tmp = w0 * (1.0 + (-0.125 * (M * ((h * M) * ((D / d) * (D / (d * l)))))));
}
return tmp;
}
[M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if M <= -5.2e-81: tmp = w0 * (1.0 + (-0.125 * (M * (M * ((h * D) / (l / (D / (d * d)))))))) elif M <= 6.8e-161: tmp = w0 else: tmp = w0 * (1.0 + (-0.125 * (M * ((h * M) * ((D / d) * (D / (d * l))))))) return tmp
M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (M <= -5.2e-81) tmp = Float64(w0 * Float64(1.0 + Float64(-0.125 * Float64(M * Float64(M * Float64(Float64(h * D) / Float64(l / Float64(D / Float64(d * d))))))))); elseif (M <= 6.8e-161) tmp = w0; else tmp = Float64(w0 * Float64(1.0 + Float64(-0.125 * Float64(M * Float64(Float64(h * M) * Float64(Float64(D / d) * Float64(D / Float64(d * l)))))))); end return tmp end
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if (M <= -5.2e-81)
tmp = w0 * (1.0 + (-0.125 * (M * (M * ((h * D) / (l / (D / (d * d))))))));
elseif (M <= 6.8e-161)
tmp = w0;
else
tmp = w0 * (1.0 + (-0.125 * (M * ((h * M) * ((D / d) * (D / (d * l)))))));
end
tmp_2 = tmp;
end
NOTE: M and D should be sorted in increasing order before calling this function. code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[M, -5.2e-81], N[(w0 * N[(1.0 + N[(-0.125 * N[(M * N[(M * N[(N[(h * D), $MachinePrecision] / N[(l / N[(D / N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[M, 6.8e-161], w0, N[(w0 * N[(1.0 + N[(-0.125 * N[(M * N[(N[(h * M), $MachinePrecision] * N[(N[(D / d), $MachinePrecision] * N[(D / N[(d * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;M \leq -5.2 \cdot 10^{-81}:\\
\;\;\;\;w0 \cdot \left(1 + -0.125 \cdot \left(M \cdot \left(M \cdot \frac{h \cdot D}{\frac{\ell}{\frac{D}{d \cdot d}}}\right)\right)\right)\\
\mathbf{elif}\;M \leq 6.8 \cdot 10^{-161}:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \left(1 + -0.125 \cdot \left(M \cdot \left(\left(h \cdot M\right) \cdot \left(\frac{D}{d} \cdot \frac{D}{d \cdot \ell}\right)\right)\right)\right)\\
\end{array}
\end{array}
if M < -5.1999999999999998e-81Initial program 70.5%
associate-/l*72.0%
Simplified72.0%
Taylor expanded in M around 0 37.7%
*-commutative37.7%
associate-/l*37.7%
unpow237.7%
unpow237.7%
*-commutative37.7%
unpow237.7%
Simplified37.7%
Taylor expanded in D around 0 37.7%
unpow237.7%
associate-*r*43.8%
unpow243.8%
*-commutative43.8%
associate-*l/43.8%
unpow243.8%
*-commutative43.8%
associate-*l*53.1%
*-commutative53.1%
associate-*l*56.2%
Simplified56.2%
Taylor expanded in M around 0 51.6%
*-commutative51.6%
*-commutative51.6%
associate-*l*57.5%
*-commutative57.5%
associate-*r/59.0%
associate-*r/60.8%
unpow260.8%
associate-/l*66.1%
associate-*r/64.6%
*-commutative64.6%
associate-/l*66.0%
unpow266.0%
Simplified66.0%
if -5.1999999999999998e-81 < M < 6.79999999999999964e-161Initial program 88.1%
associate-/l*88.1%
Simplified88.1%
Taylor expanded in M around 0 83.5%
if 6.79999999999999964e-161 < M Initial program 77.2%
associate-/l*78.2%
Simplified78.2%
Taylor expanded in M around 0 57.2%
*-commutative57.2%
associate-/l*59.3%
unpow259.3%
unpow259.3%
*-commutative59.3%
unpow259.3%
Simplified59.3%
Taylor expanded in D around 0 57.2%
unpow257.2%
associate-*r*60.2%
unpow260.2%
*-commutative60.2%
associate-*l/62.3%
unpow262.3%
*-commutative62.3%
associate-*l*67.4%
*-commutative67.4%
associate-*l*69.6%
Simplified69.6%
Taylor expanded in D around 0 67.4%
unpow267.4%
associate-*r*69.6%
unpow269.6%
times-frac77.8%
Simplified77.8%
Final simplification76.8%
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 -2.7e-80)
(* w0 (+ 1.0 (* -0.125 (* M (* M (/ (* h D) (/ l (/ D (* d d)))))))))
(if (<= M 2.8e-118)
w0
(* w0 (+ 1.0 (* -0.125 (* (* h M) (* M (* (/ D l) (/ (/ D d) d))))))))))assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (M <= -2.7e-80) {
tmp = w0 * (1.0 + (-0.125 * (M * (M * ((h * D) / (l / (D / (d * d))))))));
} else if (M <= 2.8e-118) {
tmp = w0;
} else {
tmp = w0 * (1.0 + (-0.125 * ((h * M) * (M * ((D / l) * ((D / d) / d))))));
}
return tmp;
}
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 <= (-2.7d-80)) then
tmp = w0 * (1.0d0 + ((-0.125d0) * (m * (m * ((h * d) / (l / (d / (d_1 * d_1))))))))
else if (m <= 2.8d-118) then
tmp = w0
else
tmp = w0 * (1.0d0 + ((-0.125d0) * ((h * m) * (m * ((d / l) * ((d / d_1) / d_1))))))
end if
code = tmp
end function
assert M < D;
public static double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (M <= -2.7e-80) {
tmp = w0 * (1.0 + (-0.125 * (M * (M * ((h * D) / (l / (D / (d * d))))))));
} else if (M <= 2.8e-118) {
tmp = w0;
} else {
tmp = w0 * (1.0 + (-0.125 * ((h * M) * (M * ((D / l) * ((D / d) / d))))));
}
return tmp;
}
[M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if M <= -2.7e-80: tmp = w0 * (1.0 + (-0.125 * (M * (M * ((h * D) / (l / (D / (d * d)))))))) elif M <= 2.8e-118: tmp = w0 else: tmp = w0 * (1.0 + (-0.125 * ((h * M) * (M * ((D / l) * ((D / d) / d)))))) return tmp
M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (M <= -2.7e-80) tmp = Float64(w0 * Float64(1.0 + Float64(-0.125 * Float64(M * Float64(M * Float64(Float64(h * D) / Float64(l / Float64(D / Float64(d * d))))))))); elseif (M <= 2.8e-118) tmp = w0; else tmp = Float64(w0 * Float64(1.0 + Float64(-0.125 * Float64(Float64(h * M) * Float64(M * Float64(Float64(D / l) * Float64(Float64(D / d) / d))))))); end return tmp end
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if (M <= -2.7e-80)
tmp = w0 * (1.0 + (-0.125 * (M * (M * ((h * D) / (l / (D / (d * d))))))));
elseif (M <= 2.8e-118)
tmp = w0;
else
tmp = w0 * (1.0 + (-0.125 * ((h * M) * (M * ((D / l) * ((D / d) / d))))));
end
tmp_2 = tmp;
end
NOTE: M and D should be sorted in increasing order before calling this function. code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[M, -2.7e-80], N[(w0 * N[(1.0 + N[(-0.125 * N[(M * N[(M * N[(N[(h * D), $MachinePrecision] / N[(l / N[(D / N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[M, 2.8e-118], w0, N[(w0 * N[(1.0 + N[(-0.125 * N[(N[(h * M), $MachinePrecision] * N[(M * N[(N[(D / l), $MachinePrecision] * N[(N[(D / d), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;M \leq -2.7 \cdot 10^{-80}:\\
\;\;\;\;w0 \cdot \left(1 + -0.125 \cdot \left(M \cdot \left(M \cdot \frac{h \cdot D}{\frac{\ell}{\frac{D}{d \cdot d}}}\right)\right)\right)\\
\mathbf{elif}\;M \leq 2.8 \cdot 10^{-118}:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \left(1 + -0.125 \cdot \left(\left(h \cdot M\right) \cdot \left(M \cdot \left(\frac{D}{\ell} \cdot \frac{\frac{D}{d}}{d}\right)\right)\right)\right)\\
\end{array}
\end{array}
if M < -2.7000000000000002e-80Initial program 70.5%
associate-/l*72.0%
Simplified72.0%
Taylor expanded in M around 0 37.7%
*-commutative37.7%
associate-/l*37.7%
unpow237.7%
unpow237.7%
*-commutative37.7%
unpow237.7%
Simplified37.7%
Taylor expanded in D around 0 37.7%
unpow237.7%
associate-*r*43.8%
unpow243.8%
*-commutative43.8%
associate-*l/43.8%
unpow243.8%
*-commutative43.8%
associate-*l*53.1%
*-commutative53.1%
associate-*l*56.2%
Simplified56.2%
Taylor expanded in M around 0 51.6%
*-commutative51.6%
*-commutative51.6%
associate-*l*57.5%
*-commutative57.5%
associate-*r/59.0%
associate-*r/60.8%
unpow260.8%
associate-/l*66.1%
associate-*r/64.6%
*-commutative64.6%
associate-/l*66.0%
unpow266.0%
Simplified66.0%
if -2.7000000000000002e-80 < M < 2.8e-118Initial program 86.0%
associate-/l*86.0%
Simplified86.0%
Taylor expanded in M around 0 83.9%
if 2.8e-118 < M Initial program 78.4%
associate-/l*79.5%
Simplified79.5%
Taylor expanded in M around 0 58.9%
*-commutative58.9%
associate-/l*61.1%
unpow261.1%
unpow261.1%
*-commutative61.1%
unpow261.1%
Simplified61.1%
Taylor expanded in l around 0 61.1%
unpow261.1%
associate-*l*62.3%
Simplified62.3%
Taylor expanded in D around 0 58.9%
unpow258.9%
unpow258.9%
associate-*r*62.2%
associate-*l/64.5%
unpow264.5%
associate-*r*70.0%
*-commutative70.0%
*-commutative70.0%
unpow270.0%
times-frac74.4%
unpow274.4%
associate-/r*76.6%
Simplified76.6%
Final simplification76.7%
NOTE: M and D should be sorted in increasing order before calling this function.
(FPCore (w0 M D h l d)
:precision binary64
(let* ((t_0 (* (/ d M) (/ d h))))
(if (<= D -5e-150)
(* w0 (+ 1.0 (* -0.125 (* (* D D) (/ 1.0 (* (/ l M) t_0))))))
(if (<= D 1.45e-46)
w0
(* w0 (+ 1.0 (* -0.125 (* (/ D (/ l M)) (/ D t_0)))))))))assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double t_0 = (d / M) * (d / h);
double tmp;
if (D <= -5e-150) {
tmp = w0 * (1.0 + (-0.125 * ((D * D) * (1.0 / ((l / M) * t_0)))));
} else if (D <= 1.45e-46) {
tmp = w0;
} else {
tmp = w0 * (1.0 + (-0.125 * ((D / (l / M)) * (D / t_0))));
}
return tmp;
}
NOTE: M and D should be sorted in increasing order before calling this function.
real(8) function code(w0, m, d, h, l, d_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d_1
real(8) :: t_0
real(8) :: tmp
t_0 = (d_1 / m) * (d_1 / h)
if (d <= (-5d-150)) then
tmp = w0 * (1.0d0 + ((-0.125d0) * ((d * d) * (1.0d0 / ((l / m) * t_0)))))
else if (d <= 1.45d-46) then
tmp = w0
else
tmp = w0 * (1.0d0 + ((-0.125d0) * ((d / (l / m)) * (d / t_0))))
end if
code = tmp
end function
assert M < D;
public static double code(double w0, double M, double D, double h, double l, double d) {
double t_0 = (d / M) * (d / h);
double tmp;
if (D <= -5e-150) {
tmp = w0 * (1.0 + (-0.125 * ((D * D) * (1.0 / ((l / M) * t_0)))));
} else if (D <= 1.45e-46) {
tmp = w0;
} else {
tmp = w0 * (1.0 + (-0.125 * ((D / (l / M)) * (D / t_0))));
}
return tmp;
}
[M, D] = sort([M, D]) def code(w0, M, D, h, l, d): t_0 = (d / M) * (d / h) tmp = 0 if D <= -5e-150: tmp = w0 * (1.0 + (-0.125 * ((D * D) * (1.0 / ((l / M) * t_0))))) elif D <= 1.45e-46: tmp = w0 else: tmp = w0 * (1.0 + (-0.125 * ((D / (l / M)) * (D / t_0)))) return tmp
M, D = sort([M, D]) function code(w0, M, D, h, l, d) t_0 = Float64(Float64(d / M) * Float64(d / h)) tmp = 0.0 if (D <= -5e-150) tmp = Float64(w0 * Float64(1.0 + Float64(-0.125 * Float64(Float64(D * D) * Float64(1.0 / Float64(Float64(l / M) * t_0)))))); elseif (D <= 1.45e-46) tmp = w0; else tmp = Float64(w0 * Float64(1.0 + Float64(-0.125 * Float64(Float64(D / Float64(l / M)) * Float64(D / t_0))))); end return tmp end
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
t_0 = (d / M) * (d / h);
tmp = 0.0;
if (D <= -5e-150)
tmp = w0 * (1.0 + (-0.125 * ((D * D) * (1.0 / ((l / M) * t_0)))));
elseif (D <= 1.45e-46)
tmp = w0;
else
tmp = w0 * (1.0 + (-0.125 * ((D / (l / M)) * (D / t_0))));
end
tmp_2 = tmp;
end
NOTE: M and D should be sorted in increasing order before calling this function.
code[w0_, M_, D_, h_, l_, d_] := Block[{t$95$0 = N[(N[(d / M), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[D, -5e-150], N[(w0 * N[(1.0 + N[(-0.125 * N[(N[(D * D), $MachinePrecision] * N[(1.0 / N[(N[(l / M), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[D, 1.45e-46], w0, N[(w0 * N[(1.0 + N[(-0.125 * N[(N[(D / N[(l / M), $MachinePrecision]), $MachinePrecision] * N[(D / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
t_0 := \frac{d}{M} \cdot \frac{d}{h}\\
\mathbf{if}\;D \leq -5 \cdot 10^{-150}:\\
\;\;\;\;w0 \cdot \left(1 + -0.125 \cdot \left(\left(D \cdot D\right) \cdot \frac{1}{\frac{\ell}{M} \cdot t_0}\right)\right)\\
\mathbf{elif}\;D \leq 1.45 \cdot 10^{-46}:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \left(1 + -0.125 \cdot \left(\frac{D}{\frac{\ell}{M}} \cdot \frac{D}{t_0}\right)\right)\\
\end{array}
\end{array}
if D < -4.9999999999999999e-150Initial program 70.5%
associate-/l*70.5%
Simplified70.5%
Taylor expanded in M around 0 42.1%
*-commutative42.1%
associate-/l*42.1%
unpow242.1%
unpow242.1%
*-commutative42.1%
unpow242.1%
Simplified42.1%
Taylor expanded in l around 0 42.1%
unpow242.1%
associate-*l*45.9%
Simplified45.9%
div-inv45.9%
associate-*r*42.1%
*-commutative42.1%
associate-*l*43.3%
frac-times50.5%
times-frac58.0%
Applied egg-rr58.0%
if -4.9999999999999999e-150 < D < 1.45000000000000002e-46Initial program 91.0%
associate-/l*91.0%
Simplified91.0%
Taylor expanded in M around 0 94.1%
if 1.45000000000000002e-46 < D Initial program 70.1%
associate-/l*73.4%
Simplified73.4%
Taylor expanded in M around 0 52.8%
*-commutative52.8%
associate-/l*56.0%
unpow256.0%
unpow256.0%
*-commutative56.0%
unpow256.0%
Simplified56.0%
Taylor expanded in l around 0 56.0%
unpow256.0%
associate-*l*57.6%
Simplified57.6%
associate-*r*56.0%
*-commutative56.0%
associate-*l*56.1%
frac-times57.6%
times-frac66.5%
times-frac73.0%
Applied egg-rr73.0%
Final simplification77.3%
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.35e+50) w0 (* -0.125 (* w0 (* (* h M) (* M (* (/ D l) (/ (/ D d) d))))))))
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (M <= 1.35e+50) {
tmp = w0;
} else {
tmp = -0.125 * (w0 * ((h * M) * (M * ((D / l) * ((D / d) / d)))));
}
return tmp;
}
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.35d+50) then
tmp = w0
else
tmp = (-0.125d0) * (w0 * ((h * m) * (m * ((d / l) * ((d / d_1) / d_1)))))
end if
code = tmp
end function
assert M < D;
public static double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (M <= 1.35e+50) {
tmp = w0;
} else {
tmp = -0.125 * (w0 * ((h * M) * (M * ((D / l) * ((D / d) / d)))));
}
return tmp;
}
[M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if M <= 1.35e+50: tmp = w0 else: tmp = -0.125 * (w0 * ((h * M) * (M * ((D / l) * ((D / d) / d))))) return tmp
M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (M <= 1.35e+50) tmp = w0; else tmp = Float64(-0.125 * Float64(w0 * Float64(Float64(h * M) * Float64(M * Float64(Float64(D / l) * Float64(Float64(D / d) / d)))))); end return tmp end
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if (M <= 1.35e+50)
tmp = w0;
else
tmp = -0.125 * (w0 * ((h * M) * (M * ((D / l) * ((D / d) / d)))));
end
tmp_2 = tmp;
end
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.35e+50], w0, N[(-0.125 * N[(w0 * N[(N[(h * M), $MachinePrecision] * N[(M * N[(N[(D / l), $MachinePrecision] * N[(N[(D / d), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;M \leq 1.35 \cdot 10^{+50}:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;-0.125 \cdot \left(w0 \cdot \left(\left(h \cdot M\right) \cdot \left(M \cdot \left(\frac{D}{\ell} \cdot \frac{\frac{D}{d}}{d}\right)\right)\right)\right)\\
\end{array}
\end{array}
if M < 1.35e50Initial program 80.2%
associate-/l*80.6%
Simplified80.6%
Taylor expanded in M around 0 73.0%
if 1.35e50 < M Initial program 75.1%
associate-/l*77.4%
Simplified77.4%
Taylor expanded in M around 0 47.4%
*-commutative47.4%
associate-/l*47.4%
unpow247.4%
unpow247.4%
*-commutative47.4%
unpow247.4%
Simplified47.4%
Taylor expanded in D around 0 47.4%
unpow247.4%
associate-*r*54.3%
unpow254.3%
*-commutative54.3%
associate-*l/54.3%
unpow254.3%
*-commutative54.3%
associate-*l*63.6%
*-commutative63.6%
associate-*l*63.8%
Simplified63.8%
Taylor expanded in M around inf 31.4%
*-commutative31.4%
times-frac31.4%
unpow231.4%
*-commutative31.4%
unpow231.4%
unpow231.4%
*-commutative31.4%
unpow231.4%
unpow231.4%
times-frac34.5%
associate-/l*34.4%
Simplified34.4%
Taylor expanded in D around 0 31.4%
unpow231.4%
*-commutative31.4%
unpow231.4%
*-commutative31.4%
associate-*r*31.6%
associate-*l*31.8%
*-commutative31.8%
unpow231.8%
associate-*r*31.6%
unpow231.6%
*-commutative31.6%
associate-*r/31.6%
unpow231.6%
unpow231.6%
associate-*r*31.8%
Simplified35.1%
Final simplification66.6%
NOTE: M and D should be sorted in increasing order before calling this function. (FPCore (w0 M D h l d) :precision binary64 w0)
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
return w0;
}
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
assert M < D;
public static double code(double w0, double M, double D, double h, double l, double d) {
return w0;
}
[M, D] = sort([M, D]) def code(w0, M, D, h, l, d): return w0
M, D = sort([M, D]) function code(w0, M, D, h, l, d) return w0 end
M, D = num2cell(sort([M, D])){:}
function tmp = code(w0, M, D, h, l, d)
tmp = w0;
end
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, D] = \mathsf{sort}([M, D])\\
\\
w0
\end{array}
Initial program 79.3%
associate-/l*80.1%
Simplified80.1%
Taylor expanded in M around 0 69.0%
Final simplification69.0%
herbie shell --seed 2023187
(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))))))