
(FPCore (w0 M D h l d) :precision binary64 (* w0 (sqrt (- 1.0 (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ h l))))))
double code(double w0, double M, double D, double h, double l, double d) {
return w0 * sqrt((1.0 - (pow(((M * D) / (2.0 * d)), 2.0) * (h / l))));
}
real(8) function code(w0, m, d, h, l, d_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d_1
code = w0 * sqrt((1.0d0 - ((((m * d) / (2.0d0 * d_1)) ** 2.0d0) * (h / l))))
end function
public static double code(double w0, double M, double D, double h, double l, double d) {
return w0 * Math.sqrt((1.0 - (Math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l))));
}
def code(w0, M, D, h, l, d): return w0 * math.sqrt((1.0 - (math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l))))
function code(w0, M, D, h, l, d) return Float64(w0 * sqrt(Float64(1.0 - Float64((Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0) * Float64(h / l))))) end
function tmp = code(w0, M, D, h, l, d) tmp = w0 * sqrt((1.0 - ((((M * D) / (2.0 * d)) ^ 2.0) * (h / l)))); end
code[w0_, M_, D_, h_, l_, d_] := N[(w0 * N[Sqrt[N[(1.0 - N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (w0 M D h l d) :precision binary64 (* w0 (sqrt (- 1.0 (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ h l))))))
double code(double w0, double M, double D, double h, double l, double d) {
return w0 * sqrt((1.0 - (pow(((M * D) / (2.0 * d)), 2.0) * (h / l))));
}
real(8) function code(w0, m, d, h, l, d_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d_1
code = w0 * sqrt((1.0d0 - ((((m * d) / (2.0d0 * d_1)) ** 2.0d0) * (h / l))))
end function
public static double code(double w0, double M, double D, double h, double l, double d) {
return w0 * Math.sqrt((1.0 - (Math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l))));
}
def code(w0, M, D, h, l, d): return w0 * math.sqrt((1.0 - (math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l))))
function code(w0, M, D, h, l, d) return Float64(w0 * sqrt(Float64(1.0 - Float64((Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0) * Float64(h / l))))) end
function tmp = code(w0, M, D, h, l, d) tmp = w0 * sqrt((1.0 - ((((M * D) / (2.0 * d)) ^ 2.0) * (h / l)))); end
code[w0_, M_, D_, h_, l_, d_] := N[(w0 * N[Sqrt[N[(1.0 - N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}}
\end{array}
NOTE: M should be positive before calling this function
NOTE: 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
(* w0 (sqrt (- 1.0 (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ h l)))))))
(if (<= t_0 5e+278)
t_0
(*
w0
(sqrt
(+
1.0
(/ -1.0 (/ l (* 0.25 (* (/ D d) (* (* M (/ D d)) (* M h))))))))))))M = abs(M);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double t_0 = w0 * sqrt((1.0 - (pow(((M * D) / (2.0 * d)), 2.0) * (h / l))));
double tmp;
if (t_0 <= 5e+278) {
tmp = t_0;
} else {
tmp = w0 * sqrt((1.0 + (-1.0 / (l / (0.25 * ((D / d) * ((M * (D / d)) * (M * h))))))));
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
real(8) function code(w0, m, d, h, l, d_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d_1
real(8) :: t_0
real(8) :: tmp
t_0 = w0 * sqrt((1.0d0 - ((((m * d) / (2.0d0 * d_1)) ** 2.0d0) * (h / l))))
if (t_0 <= 5d+278) then
tmp = t_0
else
tmp = w0 * sqrt((1.0d0 + ((-1.0d0) / (l / (0.25d0 * ((d / d_1) * ((m * (d / d_1)) * (m * h))))))))
end if
code = tmp
end function
M = Math.abs(M);
assert M < D;
public static double code(double w0, double M, double D, double h, double l, double d) {
double t_0 = w0 * Math.sqrt((1.0 - (Math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l))));
double tmp;
if (t_0 <= 5e+278) {
tmp = t_0;
} else {
tmp = w0 * Math.sqrt((1.0 + (-1.0 / (l / (0.25 * ((D / d) * ((M * (D / d)) * (M * h))))))));
}
return tmp;
}
M = abs(M) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): t_0 = w0 * math.sqrt((1.0 - (math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l)))) tmp = 0 if t_0 <= 5e+278: tmp = t_0 else: tmp = w0 * math.sqrt((1.0 + (-1.0 / (l / (0.25 * ((D / d) * ((M * (D / d)) * (M * h)))))))) return tmp
M = abs(M) M, D = sort([M, D]) function code(w0, M, D, h, l, d) t_0 = Float64(w0 * sqrt(Float64(1.0 - Float64((Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0) * Float64(h / l))))) tmp = 0.0 if (t_0 <= 5e+278) tmp = t_0; else tmp = Float64(w0 * sqrt(Float64(1.0 + Float64(-1.0 / Float64(l / Float64(0.25 * Float64(Float64(D / d) * Float64(Float64(M * Float64(D / d)) * Float64(M * h))))))))); end return tmp end
M = abs(M)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
t_0 = w0 * sqrt((1.0 - ((((M * D) / (2.0 * d)) ^ 2.0) * (h / l))));
tmp = 0.0;
if (t_0 <= 5e+278)
tmp = t_0;
else
tmp = w0 * sqrt((1.0 + (-1.0 / (l / (0.25 * ((D / d) * ((M * (D / d)) * (M * h))))))));
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
code[w0_, M_, D_, h_, l_, d_] := Block[{t$95$0 = N[(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]}, If[LessEqual[t$95$0, 5e+278], t$95$0, N[(w0 * N[Sqrt[N[(1.0 + N[(-1.0 / N[(l / N[(0.25 * N[(N[(D / d), $MachinePrecision] * N[(N[(M * N[(D / d), $MachinePrecision]), $MachinePrecision] * N[(M * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
M = |M|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
t_0 := w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}}\\
\mathbf{if}\;t_0 \leq 5 \cdot 10^{+278}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{1 + \frac{-1}{\frac{\ell}{0.25 \cdot \left(\frac{D}{d} \cdot \left(\left(M \cdot \frac{D}{d}\right) \cdot \left(M \cdot h\right)\right)\right)}}}\\
\end{array}
\end{array}
if (*.f64 w0 (sqrt.f64 (-.f64 1 (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (/.f64 h l))))) < 5.00000000000000029e278Initial program 90.5%
if 5.00000000000000029e278 < (*.f64 w0 (sqrt.f64 (-.f64 1 (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (/.f64 h l))))) Initial program 39.2%
Simplified43.6%
associate-*r/65.3%
frac-times60.9%
*-commutative60.9%
clear-num60.9%
*-commutative60.9%
*-commutative60.9%
frac-times65.3%
div-inv65.3%
metadata-eval65.3%
associate-*l*65.3%
Applied egg-rr65.3%
Taylor expanded in h around 0 40.9%
unpow240.9%
associate-*r*42.9%
associate-/l*42.3%
associate-/r/42.9%
unpow242.9%
unpow242.9%
times-frac59.2%
associate-*l*63.6%
associate-*r*71.0%
Simplified71.0%
Final simplification85.5%
NOTE: M 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.4e-231)
(* w0 (sqrt (- 1.0 (* (/ h l) (pow (* (/ D 2.0) (/ M d)) 2.0)))))
(*
w0
(sqrt
(+ 1.0 (/ -1.0 (/ l (* 0.25 (* (/ D d) (* (* M (/ D d)) (* M h)))))))))))M = abs(M);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (d <= 2.4e-231) {
tmp = w0 * sqrt((1.0 - ((h / l) * pow(((D / 2.0) * (M / d)), 2.0))));
} else {
tmp = w0 * sqrt((1.0 + (-1.0 / (l / (0.25 * ((D / d) * ((M * (D / d)) * (M * h))))))));
}
return tmp;
}
NOTE: M 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.4d-231) then
tmp = w0 * sqrt((1.0d0 - ((h / l) * (((d / 2.0d0) * (m / d_1)) ** 2.0d0))))
else
tmp = w0 * sqrt((1.0d0 + ((-1.0d0) / (l / (0.25d0 * ((d / d_1) * ((m * (d / d_1)) * (m * h))))))))
end if
code = tmp
end function
M = Math.abs(M);
assert M < D;
public static double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (d <= 2.4e-231) {
tmp = w0 * Math.sqrt((1.0 - ((h / l) * Math.pow(((D / 2.0) * (M / d)), 2.0))));
} else {
tmp = w0 * Math.sqrt((1.0 + (-1.0 / (l / (0.25 * ((D / d) * ((M * (D / d)) * (M * h))))))));
}
return tmp;
}
M = abs(M) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if d <= 2.4e-231: tmp = w0 * math.sqrt((1.0 - ((h / l) * math.pow(((D / 2.0) * (M / d)), 2.0)))) else: tmp = w0 * math.sqrt((1.0 + (-1.0 / (l / (0.25 * ((D / d) * ((M * (D / d)) * (M * h)))))))) return tmp
M = abs(M) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (d <= 2.4e-231) tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(h / l) * (Float64(Float64(D / 2.0) * Float64(M / d)) ^ 2.0))))); else tmp = Float64(w0 * sqrt(Float64(1.0 + Float64(-1.0 / Float64(l / Float64(0.25 * Float64(Float64(D / d) * Float64(Float64(M * Float64(D / d)) * Float64(M * h))))))))); end return tmp end
M = abs(M)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if (d <= 2.4e-231)
tmp = w0 * sqrt((1.0 - ((h / l) * (((D / 2.0) * (M / d)) ^ 2.0))));
else
tmp = w0 * sqrt((1.0 + (-1.0 / (l / (0.25 * ((D / d) * ((M * (D / d)) * (M * h))))))));
end
tmp_2 = tmp;
end
NOTE: M 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.4e-231], N[(w0 * N[Sqrt[N[(1.0 - N[(N[(h / l), $MachinePrecision] * N[Power[N[(N[(D / 2.0), $MachinePrecision] * N[(M / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(w0 * N[Sqrt[N[(1.0 + N[(-1.0 / N[(l / N[(0.25 * N[(N[(D / d), $MachinePrecision] * N[(N[(M * N[(D / d), $MachinePrecision]), $MachinePrecision] * N[(M * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;d \leq 2.4 \cdot 10^{-231}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{h}{\ell} \cdot {\left(\frac{D}{2} \cdot \frac{M}{d}\right)}^{2}}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{1 + \frac{-1}{\frac{\ell}{0.25 \cdot \left(\frac{D}{d} \cdot \left(\left(M \cdot \frac{D}{d}\right) \cdot \left(M \cdot h\right)\right)\right)}}}\\
\end{array}
\end{array}
if d < 2.39999999999999992e-231Initial program 76.4%
Simplified77.0%
if 2.39999999999999992e-231 < d Initial program 78.3%
Simplified77.5%
associate-*r/85.2%
frac-times86.1%
*-commutative86.1%
clear-num86.1%
*-commutative86.1%
*-commutative86.1%
frac-times85.3%
div-inv85.3%
metadata-eval85.3%
associate-*l*85.3%
Applied egg-rr85.3%
Taylor expanded in h around 0 62.9%
unpow262.9%
associate-*r*65.7%
associate-/l*64.6%
associate-/r/65.8%
unpow265.8%
unpow265.8%
times-frac74.9%
associate-*l*79.6%
associate-*r*84.3%
Simplified84.3%
Final simplification80.3%
NOTE: M 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 8e-111) (* w0 (sqrt (- 1.0 (* (/ D d) (/ D (/ (/ (* (/ l h) (/ d M)) M) 0.25)))))) (* w0 (sqrt (- 1.0 (* (/ D d) (* 0.25 (* (/ D d) (* (* M h) (/ M l))))))))))
M = abs(M);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (d <= 8e-111) {
tmp = w0 * sqrt((1.0 - ((D / d) * (D / ((((l / h) * (d / M)) / M) / 0.25)))));
} else {
tmp = w0 * sqrt((1.0 - ((D / d) * (0.25 * ((D / d) * ((M * h) * (M / l)))))));
}
return tmp;
}
NOTE: M 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 <= 8d-111) then
tmp = w0 * sqrt((1.0d0 - ((d / d_1) * (d / ((((l / h) * (d_1 / m)) / m) / 0.25d0)))))
else
tmp = w0 * sqrt((1.0d0 - ((d / d_1) * (0.25d0 * ((d / d_1) * ((m * h) * (m / l)))))))
end if
code = tmp
end function
M = Math.abs(M);
assert M < D;
public static double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (d <= 8e-111) {
tmp = w0 * Math.sqrt((1.0 - ((D / d) * (D / ((((l / h) * (d / M)) / M) / 0.25)))));
} else {
tmp = w0 * Math.sqrt((1.0 - ((D / d) * (0.25 * ((D / d) * ((M * h) * (M / l)))))));
}
return tmp;
}
M = abs(M) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if d <= 8e-111: tmp = w0 * math.sqrt((1.0 - ((D / d) * (D / ((((l / h) * (d / M)) / M) / 0.25))))) else: tmp = w0 * math.sqrt((1.0 - ((D / d) * (0.25 * ((D / d) * ((M * h) * (M / l))))))) return tmp
M = abs(M) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (d <= 8e-111) tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(D / d) * Float64(D / Float64(Float64(Float64(Float64(l / h) * Float64(d / M)) / M) / 0.25)))))); else tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(D / d) * Float64(0.25 * Float64(Float64(D / d) * Float64(Float64(M * h) * Float64(M / l)))))))); end return tmp end
M = abs(M)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if (d <= 8e-111)
tmp = w0 * sqrt((1.0 - ((D / d) * (D / ((((l / h) * (d / M)) / M) / 0.25)))));
else
tmp = w0 * sqrt((1.0 - ((D / d) * (0.25 * ((D / d) * ((M * h) * (M / l)))))));
end
tmp_2 = tmp;
end
NOTE: M 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, 8e-111], N[(w0 * N[Sqrt[N[(1.0 - N[(N[(D / d), $MachinePrecision] * N[(D / N[(N[(N[(N[(l / h), $MachinePrecision] * N[(d / M), $MachinePrecision]), $MachinePrecision] / M), $MachinePrecision] / 0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(w0 * N[Sqrt[N[(1.0 - N[(N[(D / d), $MachinePrecision] * N[(0.25 * N[(N[(D / d), $MachinePrecision] * N[(N[(M * h), $MachinePrecision] * N[(M / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;d \leq 8 \cdot 10^{-111}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{D}{d} \cdot \frac{D}{\frac{\frac{\frac{\ell}{h} \cdot \frac{d}{M}}{M}}{0.25}}}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{D}{d} \cdot \left(0.25 \cdot \left(\frac{D}{d} \cdot \left(\left(M \cdot h\right) \cdot \frac{M}{\ell}\right)\right)\right)}\\
\end{array}
\end{array}
if d < 8.00000000000000071e-111Initial program 75.5%
Simplified75.5%
Taylor expanded in D around 0 48.4%
*-commutative48.4%
times-frac48.9%
unpow248.9%
unpow248.9%
unpow248.9%
Simplified48.9%
*-un-lft-identity48.9%
associate-*l*48.9%
times-frac65.8%
associate-*l*67.1%
Applied egg-rr67.1%
*-lft-identity67.1%
associate-*l*71.2%
associate-*l/71.2%
Simplified71.2%
Taylor expanded in D around 0 67.4%
*-commutative67.4%
times-frac69.4%
associate-*l*69.4%
unpow269.4%
associate-*r*71.2%
associate-*l/71.2%
associate-*r*71.2%
times-frac69.4%
*-commutative69.4%
associate-/l*70.6%
associate-*r*70.6%
associate-/r*70.6%
*-commutative70.6%
associate-/r*74.8%
*-commutative74.8%
times-frac75.9%
Simplified75.9%
if 8.00000000000000071e-111 < d Initial program 80.2%
Simplified80.2%
*-commutative80.2%
frac-times80.2%
*-commutative80.2%
associate-*l/88.7%
*-commutative88.7%
frac-times88.7%
div-inv88.7%
metadata-eval88.7%
associate-*l*88.7%
Applied egg-rr88.7%
Taylor expanded in h around 0 62.1%
unpow262.1%
associate-*r*65.6%
times-frac65.3%
unpow265.3%
unpow265.3%
times-frac70.7%
*-commutative70.7%
associate-*l*75.6%
associate-*l*75.6%
associate-/l*76.7%
associate-/r/75.7%
Simplified75.7%
Final simplification75.8%
NOTE: M 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.7e-99) (* w0 (sqrt (- 1.0 (* (/ D d) (/ D (/ (/ (* (/ l h) (/ d M)) M) 0.25)))))) (* w0 (sqrt (- 1.0 (* (/ D d) (/ (* (/ D d) (* M (* 0.25 (* M h)))) l)))))))
M = abs(M);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (d <= 1.7e-99) {
tmp = w0 * sqrt((1.0 - ((D / d) * (D / ((((l / h) * (d / M)) / M) / 0.25)))));
} else {
tmp = w0 * sqrt((1.0 - ((D / d) * (((D / d) * (M * (0.25 * (M * h)))) / l))));
}
return tmp;
}
NOTE: M 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.7d-99) then
tmp = w0 * sqrt((1.0d0 - ((d / d_1) * (d / ((((l / h) * (d_1 / m)) / m) / 0.25d0)))))
else
tmp = w0 * sqrt((1.0d0 - ((d / d_1) * (((d / d_1) * (m * (0.25d0 * (m * h)))) / l))))
end if
code = tmp
end function
M = Math.abs(M);
assert M < D;
public static double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (d <= 1.7e-99) {
tmp = w0 * Math.sqrt((1.0 - ((D / d) * (D / ((((l / h) * (d / M)) / M) / 0.25)))));
} else {
tmp = w0 * Math.sqrt((1.0 - ((D / d) * (((D / d) * (M * (0.25 * (M * h)))) / l))));
}
return tmp;
}
M = abs(M) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if d <= 1.7e-99: tmp = w0 * math.sqrt((1.0 - ((D / d) * (D / ((((l / h) * (d / M)) / M) / 0.25))))) else: tmp = w0 * math.sqrt((1.0 - ((D / d) * (((D / d) * (M * (0.25 * (M * h)))) / l)))) return tmp
M = abs(M) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (d <= 1.7e-99) tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(D / d) * Float64(D / Float64(Float64(Float64(Float64(l / h) * Float64(d / M)) / M) / 0.25)))))); else tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(D / d) * Float64(Float64(Float64(D / d) * Float64(M * Float64(0.25 * Float64(M * h)))) / l))))); end return tmp end
M = abs(M)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if (d <= 1.7e-99)
tmp = w0 * sqrt((1.0 - ((D / d) * (D / ((((l / h) * (d / M)) / M) / 0.25)))));
else
tmp = w0 * sqrt((1.0 - ((D / d) * (((D / d) * (M * (0.25 * (M * h)))) / l))));
end
tmp_2 = tmp;
end
NOTE: M 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.7e-99], N[(w0 * N[Sqrt[N[(1.0 - N[(N[(D / d), $MachinePrecision] * N[(D / N[(N[(N[(N[(l / h), $MachinePrecision] * N[(d / M), $MachinePrecision]), $MachinePrecision] / M), $MachinePrecision] / 0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(w0 * N[Sqrt[N[(1.0 - N[(N[(D / d), $MachinePrecision] * N[(N[(N[(D / d), $MachinePrecision] * N[(M * N[(0.25 * N[(M * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;d \leq 1.7 \cdot 10^{-99}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{D}{d} \cdot \frac{D}{\frac{\frac{\frac{\ell}{h} \cdot \frac{d}{M}}{M}}{0.25}}}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{D}{d} \cdot \frac{\frac{D}{d} \cdot \left(M \cdot \left(0.25 \cdot \left(M \cdot h\right)\right)\right)}{\ell}}\\
\end{array}
\end{array}
if d < 1.70000000000000003e-99Initial program 75.1%
Simplified75.1%
Taylor expanded in D around 0 48.2%
*-commutative48.2%
times-frac48.6%
unpow248.6%
unpow248.6%
unpow248.6%
Simplified48.6%
*-un-lft-identity48.6%
associate-*l*48.6%
times-frac65.0%
associate-*l*66.3%
Applied egg-rr66.3%
*-lft-identity66.3%
associate-*l*70.7%
associate-*l/70.7%
Simplified70.7%
Taylor expanded in D around 0 67.0%
*-commutative67.0%
times-frac68.9%
associate-*l*68.9%
unpow268.9%
associate-*r*70.7%
associate-*l/70.7%
associate-*r*70.7%
times-frac68.9%
*-commutative68.9%
associate-/l*70.0%
associate-*r*70.0%
associate-/r*70.0%
*-commutative70.0%
associate-/r*74.2%
*-commutative74.2%
times-frac75.2%
Simplified75.2%
if 1.70000000000000003e-99 < d Initial program 81.3%
Simplified81.3%
Taylor expanded in D around 0 63.3%
*-commutative63.3%
times-frac63.4%
unpow263.4%
unpow263.4%
unpow263.4%
Simplified63.4%
*-un-lft-identity63.4%
associate-*l*63.4%
times-frac69.0%
associate-*l*72.4%
Applied egg-rr72.4%
*-lft-identity72.4%
associate-*l*76.9%
associate-*l/76.9%
Simplified76.9%
associate-*r/82.3%
associate-*l*82.3%
Applied egg-rr82.3%
Final simplification77.7%
NOTE: M 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 (sqrt (+ 1.0 (/ -1.0 (/ l (* 0.25 (* (/ D d) (* (* M (/ D d)) (* M h))))))))))
M = abs(M);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
return w0 * sqrt((1.0 + (-1.0 / (l / (0.25 * ((D / d) * ((M * (D / d)) * (M * h))))))));
}
NOTE: M 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 * sqrt((1.0d0 + ((-1.0d0) / (l / (0.25d0 * ((d / d_1) * ((m * (d / d_1)) * (m * h))))))))
end function
M = Math.abs(M);
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 + (-1.0 / (l / (0.25 * ((D / d) * ((M * (D / d)) * (M * h))))))));
}
M = abs(M) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): return w0 * math.sqrt((1.0 + (-1.0 / (l / (0.25 * ((D / d) * ((M * (D / d)) * (M * h))))))))
M = abs(M) M, D = sort([M, D]) function code(w0, M, D, h, l, d) return Float64(w0 * sqrt(Float64(1.0 + Float64(-1.0 / Float64(l / Float64(0.25 * Float64(Float64(D / d) * Float64(Float64(M * Float64(D / d)) * Float64(M * h))))))))) end
M = abs(M)
M, D = num2cell(sort([M, D])){:}
function tmp = code(w0, M, D, h, l, d)
tmp = w0 * sqrt((1.0 + (-1.0 / (l / (0.25 * ((D / d) * ((M * (D / d)) * (M * h))))))));
end
NOTE: M 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[Sqrt[N[(1.0 + N[(-1.0 / N[(l / N[(0.25 * N[(N[(D / d), $MachinePrecision] * N[(N[(M * N[(D / d), $MachinePrecision]), $MachinePrecision] * N[(M * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
M = |M|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
w0 \cdot \sqrt{1 + \frac{-1}{\frac{\ell}{0.25 \cdot \left(\frac{D}{d} \cdot \left(\left(M \cdot \frac{D}{d}\right) \cdot \left(M \cdot h\right)\right)\right)}}}
\end{array}
Initial program 77.3%
Simplified77.2%
associate-*r/82.0%
frac-times82.1%
*-commutative82.1%
clear-num82.1%
*-commutative82.1%
*-commutative82.1%
frac-times82.0%
div-inv82.0%
metadata-eval82.0%
associate-*l*82.0%
Applied egg-rr82.0%
Taylor expanded in h around 0 56.2%
unpow256.2%
associate-*r*58.4%
associate-/l*57.4%
associate-/r/58.3%
unpow258.3%
unpow258.3%
times-frac71.5%
associate-*l*76.1%
associate-*r*81.2%
Simplified81.2%
Final simplification81.2%
NOTE: M 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 (sqrt (- 1.0 (* (/ D d) (* 0.25 (* (/ D d) (* (* M h) (/ M l)))))))))
M = abs(M);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
return w0 * sqrt((1.0 - ((D / d) * (0.25 * ((D / d) * ((M * h) * (M / l)))))));
}
NOTE: M 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 * sqrt((1.0d0 - ((d / d_1) * (0.25d0 * ((d / d_1) * ((m * h) * (m / l)))))))
end function
M = Math.abs(M);
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 - ((D / d) * (0.25 * ((D / d) * ((M * h) * (M / l)))))));
}
M = abs(M) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): return w0 * math.sqrt((1.0 - ((D / d) * (0.25 * ((D / d) * ((M * h) * (M / l)))))))
M = abs(M) M, D = sort([M, D]) function code(w0, M, D, h, l, d) return Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(D / d) * Float64(0.25 * Float64(Float64(D / d) * Float64(Float64(M * h) * Float64(M / l)))))))) end
M = abs(M)
M, D = num2cell(sort([M, D])){:}
function tmp = code(w0, M, D, h, l, d)
tmp = w0 * sqrt((1.0 - ((D / d) * (0.25 * ((D / d) * ((M * h) * (M / l)))))));
end
NOTE: M 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[Sqrt[N[(1.0 - N[(N[(D / d), $MachinePrecision] * N[(0.25 * N[(N[(D / d), $MachinePrecision] * N[(N[(M * h), $MachinePrecision] * N[(M / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
M = |M|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
w0 \cdot \sqrt{1 - \frac{D}{d} \cdot \left(0.25 \cdot \left(\frac{D}{d} \cdot \left(\left(M \cdot h\right) \cdot \frac{M}{\ell}\right)\right)\right)}
\end{array}
Initial program 77.3%
Simplified77.2%
*-commutative77.2%
frac-times77.3%
*-commutative77.3%
associate-*l/82.1%
*-commutative82.1%
frac-times82.0%
div-inv82.0%
metadata-eval82.0%
associate-*l*82.0%
Applied egg-rr82.0%
Taylor expanded in h around 0 53.4%
unpow253.4%
associate-*r*55.6%
times-frac55.8%
unpow255.8%
unpow255.8%
times-frac68.4%
*-commutative68.4%
associate-*l*72.8%
associate-*l*72.8%
associate-/l*75.2%
associate-/r/72.9%
Simplified72.9%
Final simplification72.9%
NOTE: M 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.36e-139) w0 (* w0 (+ 1.0 (* -0.125 (* (* (/ D d) (/ D d)) (/ (* h (* M M)) l)))))))
M = abs(M);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (M <= 1.36e-139) {
tmp = w0;
} else {
tmp = w0 * (1.0 + (-0.125 * (((D / d) * (D / d)) * ((h * (M * M)) / l))));
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: 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.36d-139) then
tmp = w0
else
tmp = w0 * (1.0d0 + ((-0.125d0) * (((d / d_1) * (d / d_1)) * ((h * (m * m)) / l))))
end if
code = tmp
end function
M = Math.abs(M);
assert M < D;
public static double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (M <= 1.36e-139) {
tmp = w0;
} else {
tmp = w0 * (1.0 + (-0.125 * (((D / d) * (D / d)) * ((h * (M * M)) / l))));
}
return tmp;
}
M = abs(M) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if M <= 1.36e-139: tmp = w0 else: tmp = w0 * (1.0 + (-0.125 * (((D / d) * (D / d)) * ((h * (M * M)) / l)))) return tmp
M = abs(M) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (M <= 1.36e-139) tmp = w0; else tmp = Float64(w0 * Float64(1.0 + Float64(-0.125 * Float64(Float64(Float64(D / d) * Float64(D / d)) * Float64(Float64(h * Float64(M * M)) / l))))); end return tmp end
M = abs(M)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if (M <= 1.36e-139)
tmp = w0;
else
tmp = w0 * (1.0 + (-0.125 * (((D / d) * (D / d)) * ((h * (M * M)) / l))));
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[M, 1.36e-139], w0, N[(w0 * N[(1.0 + N[(-0.125 * N[(N[(N[(D / d), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision] * N[(N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;M \leq 1.36 \cdot 10^{-139}:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \left(1 + -0.125 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \frac{h \cdot \left(M \cdot M\right)}{\ell}\right)\right)\\
\end{array}
\end{array}
if M < 1.36000000000000003e-139Initial program 78.4%
Simplified79.0%
Taylor expanded in D around 0 63.0%
if 1.36000000000000003e-139 < M Initial program 75.7%
Simplified74.8%
Taylor expanded in D around 0 56.4%
times-frac54.5%
unpow254.5%
unpow254.5%
unpow254.5%
Simplified54.5%
Taylor expanded in D around 0 54.5%
unpow254.5%
unpow254.5%
times-frac63.9%
Simplified63.9%
Final simplification63.4%
NOTE: M 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 2.35e+59) w0 (* -0.125 (* (* M (* M (* w0 h))) (* (/ D l) (/ D (* d d)))))))
M = abs(M);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (M <= 2.35e+59) {
tmp = w0;
} else {
tmp = -0.125 * ((M * (M * (w0 * h))) * ((D / l) * (D / (d * d))));
}
return tmp;
}
NOTE: M 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 <= 2.35d+59) then
tmp = w0
else
tmp = (-0.125d0) * ((m * (m * (w0 * h))) * ((d / l) * (d / (d_1 * d_1))))
end if
code = tmp
end function
M = Math.abs(M);
assert M < D;
public static double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (M <= 2.35e+59) {
tmp = w0;
} else {
tmp = -0.125 * ((M * (M * (w0 * h))) * ((D / l) * (D / (d * d))));
}
return tmp;
}
M = abs(M) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if M <= 2.35e+59: tmp = w0 else: tmp = -0.125 * ((M * (M * (w0 * h))) * ((D / l) * (D / (d * d)))) return tmp
M = abs(M) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (M <= 2.35e+59) tmp = w0; else tmp = Float64(-0.125 * Float64(Float64(M * Float64(M * Float64(w0 * h))) * Float64(Float64(D / l) * Float64(D / Float64(d * d))))); end return tmp end
M = abs(M)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if (M <= 2.35e+59)
tmp = w0;
else
tmp = -0.125 * ((M * (M * (w0 * h))) * ((D / l) * (D / (d * d))));
end
tmp_2 = tmp;
end
NOTE: M 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, 2.35e+59], w0, N[(-0.125 * N[(N[(M * N[(M * N[(w0 * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(D / l), $MachinePrecision] * N[(D / N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;M \leq 2.35 \cdot 10^{+59}:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;-0.125 \cdot \left(\left(M \cdot \left(M \cdot \left(w0 \cdot h\right)\right)\right) \cdot \left(\frac{D}{\ell} \cdot \frac{D}{d \cdot d}\right)\right)\\
\end{array}
\end{array}
if M < 2.35e59Initial program 77.9%
Simplified78.3%
Taylor expanded in D around 0 65.1%
if 2.35e59 < M Initial program 74.8%
Simplified72.7%
Taylor expanded in D around 0 48.9%
+-commutative48.9%
fma-def48.9%
*-commutative48.9%
*-commutative48.9%
associate-*r*48.9%
unpow248.9%
unpow248.9%
swap-sqr57.2%
*-commutative57.2%
associate-*l*55.2%
unpow255.2%
associate-*l*57.3%
Simplified57.3%
Taylor expanded in h around inf 31.1%
associate-/l*31.0%
unpow231.0%
unpow231.0%
unpow231.0%
Simplified31.0%
Taylor expanded in D around 0 31.1%
unpow231.1%
unpow231.1%
unpow231.1%
associate-*r*31.4%
*-commutative31.4%
associate-*l/31.7%
*-commutative31.7%
times-frac33.9%
Simplified33.9%
Final simplification59.0%
NOTE: M 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.85e+76) w0 (* -0.125 (/ (* D D) (* (/ l (* w0 h)) (* (/ d M) (/ d M)))))))
M = abs(M);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (M <= 1.85e+76) {
tmp = w0;
} else {
tmp = -0.125 * ((D * D) / ((l / (w0 * h)) * ((d / M) * (d / M))));
}
return tmp;
}
NOTE: M 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.85d+76) then
tmp = w0
else
tmp = (-0.125d0) * ((d * d) / ((l / (w0 * h)) * ((d_1 / m) * (d_1 / m))))
end if
code = tmp
end function
M = Math.abs(M);
assert M < D;
public static double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (M <= 1.85e+76) {
tmp = w0;
} else {
tmp = -0.125 * ((D * D) / ((l / (w0 * h)) * ((d / M) * (d / M))));
}
return tmp;
}
M = abs(M) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if M <= 1.85e+76: tmp = w0 else: tmp = -0.125 * ((D * D) / ((l / (w0 * h)) * ((d / M) * (d / M)))) return tmp
M = abs(M) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (M <= 1.85e+76) tmp = w0; else tmp = Float64(-0.125 * Float64(Float64(D * D) / Float64(Float64(l / Float64(w0 * h)) * Float64(Float64(d / M) * Float64(d / M))))); end return tmp end
M = abs(M)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if (M <= 1.85e+76)
tmp = w0;
else
tmp = -0.125 * ((D * D) / ((l / (w0 * h)) * ((d / M) * (d / M))));
end
tmp_2 = tmp;
end
NOTE: M 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.85e+76], w0, N[(-0.125 * N[(N[(D * D), $MachinePrecision] / N[(N[(l / N[(w0 * h), $MachinePrecision]), $MachinePrecision] * N[(N[(d / M), $MachinePrecision] * N[(d / M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;M \leq 1.85 \cdot 10^{+76}:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;-0.125 \cdot \frac{D \cdot D}{\frac{\ell}{w0 \cdot h} \cdot \left(\frac{d}{M} \cdot \frac{d}{M}\right)}\\
\end{array}
\end{array}
if M < 1.85e76Initial program 77.5%
Simplified77.5%
Taylor expanded in D around 0 64.6%
if 1.85e76 < M Initial program 76.2%
Simplified76.1%
Taylor expanded in D around 0 49.6%
+-commutative49.6%
fma-def49.6%
*-commutative49.6%
*-commutative49.6%
associate-*r*49.6%
unpow249.6%
unpow249.6%
swap-sqr58.9%
*-commutative58.9%
associate-*l*56.7%
unpow256.7%
associate-*l*59.0%
Simplified59.0%
Taylor expanded in h around inf 32.1%
associate-/l*32.0%
unpow232.0%
unpow232.0%
unpow232.0%
Simplified32.0%
Taylor expanded in d around 0 32.0%
unpow232.0%
times-frac32.0%
unpow232.0%
times-frac36.8%
Simplified36.8%
Final simplification59.7%
NOTE: M 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 7.2e+34) w0 (* -0.125 (/ (* D D) (/ (* d (/ l (* w0 h))) (/ M (/ d M)))))))
M = abs(M);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (M <= 7.2e+34) {
tmp = w0;
} else {
tmp = -0.125 * ((D * D) / ((d * (l / (w0 * h))) / (M / (d / M))));
}
return tmp;
}
NOTE: M 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 <= 7.2d+34) then
tmp = w0
else
tmp = (-0.125d0) * ((d * d) / ((d_1 * (l / (w0 * h))) / (m / (d_1 / m))))
end if
code = tmp
end function
M = Math.abs(M);
assert M < D;
public static double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (M <= 7.2e+34) {
tmp = w0;
} else {
tmp = -0.125 * ((D * D) / ((d * (l / (w0 * h))) / (M / (d / M))));
}
return tmp;
}
M = abs(M) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if M <= 7.2e+34: tmp = w0 else: tmp = -0.125 * ((D * D) / ((d * (l / (w0 * h))) / (M / (d / M)))) return tmp
M = abs(M) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (M <= 7.2e+34) tmp = w0; else tmp = Float64(-0.125 * Float64(Float64(D * D) / Float64(Float64(d * Float64(l / Float64(w0 * h))) / Float64(M / Float64(d / M))))); end return tmp end
M = abs(M)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if (M <= 7.2e+34)
tmp = w0;
else
tmp = -0.125 * ((D * D) / ((d * (l / (w0 * h))) / (M / (d / M))));
end
tmp_2 = tmp;
end
NOTE: M 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, 7.2e+34], w0, N[(-0.125 * N[(N[(D * D), $MachinePrecision] / N[(N[(d * N[(l / N[(w0 * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(M / N[(d / M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;M \leq 7.2 \cdot 10^{+34}:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;-0.125 \cdot \frac{D \cdot D}{\frac{d \cdot \frac{\ell}{w0 \cdot h}}{\frac{M}{\frac{d}{M}}}}\\
\end{array}
\end{array}
if M < 7.2000000000000001e34Initial program 78.2%
Simplified78.6%
Taylor expanded in D around 0 65.5%
if 7.2000000000000001e34 < M Initial program 74.1%
Simplified72.2%
Taylor expanded in D around 0 49.1%
+-commutative49.1%
fma-def49.1%
*-commutative49.1%
*-commutative49.1%
associate-*r*49.1%
unpow249.1%
unpow249.1%
swap-sqr56.6%
*-commutative56.6%
associate-*l*54.8%
unpow254.8%
associate-*l*56.7%
Simplified56.7%
Taylor expanded in h around inf 29.9%
associate-/l*29.8%
unpow229.8%
unpow229.8%
unpow229.8%
Simplified29.8%
Taylor expanded in d around 0 29.8%
unpow229.8%
times-frac29.8%
associate-/l*33.4%
associate-*l/33.5%
unpow233.5%
associate-/l*33.7%
Simplified33.7%
Final simplification58.5%
NOTE: M 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) (* (/ D d) (* (* M h) (/ M l))))))))
M = abs(M);
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) * ((D / d) * ((M * h) * (M / l))))));
}
NOTE: M 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_1) * ((d / d_1) * ((m * h) * (m / l))))))
end function
M = Math.abs(M);
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) * ((D / d) * ((M * h) * (M / l))))));
}
M = abs(M) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): return w0 * (1.0 + (-0.125 * ((D / d) * ((D / d) * ((M * h) * (M / l))))))
M = abs(M) M, D = sort([M, D]) function code(w0, M, D, h, l, d) return Float64(w0 * Float64(1.0 + Float64(-0.125 * Float64(Float64(D / d) * Float64(Float64(D / d) * Float64(Float64(M * h) * Float64(M / l))))))) end
M = abs(M)
M, D = num2cell(sort([M, D])){:}
function tmp = code(w0, M, D, h, l, d)
tmp = w0 * (1.0 + (-0.125 * ((D / d) * ((D / d) * ((M * h) * (M / l))))));
end
NOTE: M 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[(N[(D / d), $MachinePrecision] * N[(N[(D / d), $MachinePrecision] * N[(N[(M * h), $MachinePrecision] * N[(M / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
M = |M|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
w0 \cdot \left(1 + -0.125 \cdot \left(\frac{D}{d} \cdot \left(\frac{D}{d} \cdot \left(\left(M \cdot h\right) \cdot \frac{M}{\ell}\right)\right)\right)\right)
\end{array}
Initial program 77.3%
Simplified77.2%
Taylor expanded in D around 0 51.6%
times-frac52.7%
unpow252.7%
unpow252.7%
unpow252.7%
Simplified52.7%
Taylor expanded in D around 0 51.6%
unpow251.6%
associate-*r*53.3%
times-frac54.3%
unpow254.3%
unpow254.3%
times-frac66.3%
unpow166.3%
sqr-pow66.3%
associate-*l*66.3%
Simplified69.4%
Final simplification69.4%
NOTE: M 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);
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: 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);
assert M < D;
public static double code(double w0, double M, double D, double h, double l, double d) {
return w0;
}
M = abs(M) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): return w0
M = abs(M) M, D = sort([M, D]) function code(w0, M, D, h, l, d) return w0 end
M = abs(M)
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: 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|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
w0
\end{array}
Initial program 77.3%
Simplified77.2%
Taylor expanded in D around 0 58.9%
Final simplification58.9%
herbie shell --seed 2023293
(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))))))