
(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 13 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: d should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
(FPCore (w0 M D h l d)
:precision binary64
(if (<= (/ (* M D) (* 2.0 d)) 500.0)
(* w0 (sqrt (- 1.0 (/ (* (pow (* M (* 0.5 (/ D d))) 2.0) h) l))))
(*
w0
(pow (+ 1.0 (* -0.25 (/ D (/ (/ d M) (/ (* h (* M D)) (* d l)))))) 0.5))))M = abs(M);
D = abs(D);
d = abs(d);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (((M * D) / (2.0 * d)) <= 500.0) {
tmp = w0 * sqrt((1.0 - ((pow((M * (0.5 * (D / d))), 2.0) * h) / l)));
} else {
tmp = w0 * pow((1.0 + (-0.25 * (D / ((d / M) / ((h * (M * D)) / (d * l)))))), 0.5);
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: d should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
real(8) function code(w0, m, d, h, l, d_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d_1
real(8) :: tmp
if (((m * d) / (2.0d0 * d_1)) <= 500.0d0) then
tmp = w0 * sqrt((1.0d0 - ((((m * (0.5d0 * (d / d_1))) ** 2.0d0) * h) / l)))
else
tmp = w0 * ((1.0d0 + ((-0.25d0) * (d / ((d_1 / m) / ((h * (m * d)) / (d_1 * l)))))) ** 0.5d0)
end if
code = tmp
end function
M = Math.abs(M);
D = Math.abs(D);
d = Math.abs(d);
assert M < D;
public static double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (((M * D) / (2.0 * d)) <= 500.0) {
tmp = w0 * Math.sqrt((1.0 - ((Math.pow((M * (0.5 * (D / d))), 2.0) * h) / l)));
} else {
tmp = w0 * Math.pow((1.0 + (-0.25 * (D / ((d / M) / ((h * (M * D)) / (d * l)))))), 0.5);
}
return tmp;
}
M = abs(M) D = abs(D) d = abs(d) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if ((M * D) / (2.0 * d)) <= 500.0: tmp = w0 * math.sqrt((1.0 - ((math.pow((M * (0.5 * (D / d))), 2.0) * h) / l))) else: tmp = w0 * math.pow((1.0 + (-0.25 * (D / ((d / M) / ((h * (M * D)) / (d * l)))))), 0.5) return tmp
M = abs(M) D = abs(D) d = abs(d) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (Float64(Float64(M * D) / Float64(2.0 * d)) <= 500.0) tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64((Float64(M * Float64(0.5 * Float64(D / d))) ^ 2.0) * h) / l)))); else tmp = Float64(w0 * (Float64(1.0 + Float64(-0.25 * Float64(D / Float64(Float64(d / M) / Float64(Float64(h * Float64(M * D)) / Float64(d * l)))))) ^ 0.5)); end return tmp end
M = abs(M)
D = abs(D)
d = abs(d)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if (((M * D) / (2.0 * d)) <= 500.0)
tmp = w0 * sqrt((1.0 - ((((M * (0.5 * (D / d))) ^ 2.0) * h) / l)));
else
tmp = w0 * ((1.0 + (-0.25 * (D / ((d / M) / ((h * (M * D)) / (d * l)))))) ^ 0.5);
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: d should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 500.0], N[(w0 * N[Sqrt[N[(1.0 - N[(N[(N[Power[N[(M * N[(0.5 * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * h), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(w0 * N[Power[N[(1.0 + N[(-0.25 * N[(D / N[(N[(d / M), $MachinePrecision] / N[(N[(h * N[(M * D), $MachinePrecision]), $MachinePrecision] / N[(d * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
d = |d|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{M \cdot D}{2 \cdot d} \leq 500:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{{\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2} \cdot h}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot {\left(1 + -0.25 \cdot \frac{D}{\frac{\frac{d}{M}}{\frac{h \cdot \left(M \cdot D\right)}{d \cdot \ell}}}\right)}^{0.5}\\
\end{array}
\end{array}
if (/.f64 (*.f64 M D) (*.f64 2 d)) < 500Initial program 85.3%
*-commutative85.3%
times-frac84.0%
Simplified84.0%
unpow284.0%
associate-*l*85.7%
div-inv85.7%
associate-*l*83.8%
times-frac83.8%
*-un-lft-identity83.8%
*-commutative83.8%
clear-num83.8%
div-inv84.3%
div-inv84.3%
associate-*l*85.0%
times-frac85.0%
*-un-lft-identity85.0%
*-commutative85.0%
clear-num85.0%
div-inv85.5%
associate-*l*84.3%
Applied egg-rr90.1%
if 500 < (/.f64 (*.f64 M D) (*.f64 2 d)) Initial program 58.4%
*-commutative58.4%
times-frac58.5%
Simplified58.5%
Taylor expanded in M around 0 35.7%
associate-*r/35.7%
*-commutative35.7%
associate-*r/35.7%
associate-/l*35.7%
unpow235.7%
*-commutative35.7%
unpow235.7%
associate-*l*37.7%
*-commutative37.7%
unpow237.7%
associate-*l*41.8%
Simplified41.8%
pow1/241.8%
Applied egg-rr52.4%
*-un-lft-identity52.4%
associate-/l*53.1%
associate-/l*57.1%
Applied egg-rr57.1%
Taylor expanded in D around 0 54.7%
*-commutative54.7%
associate-*r*56.7%
*-commutative56.7%
Simplified56.7%
Final simplification83.7%
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: d should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
(FPCore (w0 M D h l d)
:precision binary64
(if (<= (/ (* M D) (* 2.0 d)) 500.0)
(* w0 (sqrt (+ 1.0 (* -0.25 (/ (/ D (/ d (* M D))) (* l (/ d (* M h))))))))
(*
w0
(pow (+ 1.0 (* -0.25 (/ D (/ (/ d M) (/ (* h (* M D)) (* d l)))))) 0.5))))M = abs(M);
D = abs(D);
d = abs(d);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (((M * D) / (2.0 * d)) <= 500.0) {
tmp = w0 * sqrt((1.0 + (-0.25 * ((D / (d / (M * D))) / (l * (d / (M * h)))))));
} else {
tmp = w0 * pow((1.0 + (-0.25 * (D / ((d / M) / ((h * (M * D)) / (d * l)))))), 0.5);
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: d should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
real(8) function code(w0, m, d, h, l, d_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d_1
real(8) :: tmp
if (((m * d) / (2.0d0 * d_1)) <= 500.0d0) then
tmp = w0 * sqrt((1.0d0 + ((-0.25d0) * ((d / (d_1 / (m * d))) / (l * (d_1 / (m * h)))))))
else
tmp = w0 * ((1.0d0 + ((-0.25d0) * (d / ((d_1 / m) / ((h * (m * d)) / (d_1 * l)))))) ** 0.5d0)
end if
code = tmp
end function
M = Math.abs(M);
D = Math.abs(D);
d = Math.abs(d);
assert M < D;
public static double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (((M * D) / (2.0 * d)) <= 500.0) {
tmp = w0 * Math.sqrt((1.0 + (-0.25 * ((D / (d / (M * D))) / (l * (d / (M * h)))))));
} else {
tmp = w0 * Math.pow((1.0 + (-0.25 * (D / ((d / M) / ((h * (M * D)) / (d * l)))))), 0.5);
}
return tmp;
}
M = abs(M) D = abs(D) d = abs(d) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if ((M * D) / (2.0 * d)) <= 500.0: tmp = w0 * math.sqrt((1.0 + (-0.25 * ((D / (d / (M * D))) / (l * (d / (M * h))))))) else: tmp = w0 * math.pow((1.0 + (-0.25 * (D / ((d / M) / ((h * (M * D)) / (d * l)))))), 0.5) return tmp
M = abs(M) D = abs(D) d = abs(d) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (Float64(Float64(M * D) / Float64(2.0 * d)) <= 500.0) tmp = Float64(w0 * sqrt(Float64(1.0 + Float64(-0.25 * Float64(Float64(D / Float64(d / Float64(M * D))) / Float64(l * Float64(d / Float64(M * h)))))))); else tmp = Float64(w0 * (Float64(1.0 + Float64(-0.25 * Float64(D / Float64(Float64(d / M) / Float64(Float64(h * Float64(M * D)) / Float64(d * l)))))) ^ 0.5)); end return tmp end
M = abs(M)
D = abs(D)
d = abs(d)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if (((M * D) / (2.0 * d)) <= 500.0)
tmp = w0 * sqrt((1.0 + (-0.25 * ((D / (d / (M * D))) / (l * (d / (M * h)))))));
else
tmp = w0 * ((1.0 + (-0.25 * (D / ((d / M) / ((h * (M * D)) / (d * l)))))) ^ 0.5);
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: d should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 500.0], N[(w0 * N[Sqrt[N[(1.0 + N[(-0.25 * N[(N[(D / N[(d / N[(M * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(l * N[(d / N[(M * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(w0 * N[Power[N[(1.0 + N[(-0.25 * N[(D / N[(N[(d / M), $MachinePrecision] / N[(N[(h * N[(M * D), $MachinePrecision]), $MachinePrecision] / N[(d * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
d = |d|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{M \cdot D}{2 \cdot d} \leq 500:\\
\;\;\;\;w0 \cdot \sqrt{1 + -0.25 \cdot \frac{\frac{D}{\frac{d}{M \cdot D}}}{\ell \cdot \frac{d}{M \cdot h}}}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot {\left(1 + -0.25 \cdot \frac{D}{\frac{\frac{d}{M}}{\frac{h \cdot \left(M \cdot D\right)}{d \cdot \ell}}}\right)}^{0.5}\\
\end{array}
\end{array}
if (/.f64 (*.f64 M D) (*.f64 2 d)) < 500Initial program 85.3%
*-commutative85.3%
times-frac84.0%
Simplified84.0%
Taylor expanded in M around 0 60.7%
associate-*r/60.7%
*-commutative60.7%
associate-*r/60.7%
associate-/l*61.2%
unpow261.2%
*-commutative61.2%
unpow261.2%
associate-*l*65.1%
*-commutative65.1%
unpow265.1%
associate-*l*68.9%
Simplified68.9%
pow1/268.9%
Applied egg-rr87.1%
*-un-lft-identity87.1%
associate-/l*88.5%
associate-/l*87.1%
Applied egg-rr87.1%
*-un-lft-identity87.1%
unpow1/287.1%
*-un-lft-identity87.1%
associate-/r/87.0%
associate-/r/89.0%
associate-/l/85.7%
Applied egg-rr85.7%
*-lft-identity85.7%
associate-/r*84.1%
associate-/l/84.1%
*-commutative84.1%
associate-/l/87.4%
Simplified87.4%
if 500 < (/.f64 (*.f64 M D) (*.f64 2 d)) Initial program 58.4%
*-commutative58.4%
times-frac58.5%
Simplified58.5%
Taylor expanded in M around 0 35.7%
associate-*r/35.7%
*-commutative35.7%
associate-*r/35.7%
associate-/l*35.7%
unpow235.7%
*-commutative35.7%
unpow235.7%
associate-*l*37.7%
*-commutative37.7%
unpow237.7%
associate-*l*41.8%
Simplified41.8%
pow1/241.8%
Applied egg-rr52.4%
*-un-lft-identity52.4%
associate-/l*53.1%
associate-/l*57.1%
Applied egg-rr57.1%
Taylor expanded in D around 0 54.7%
*-commutative54.7%
associate-*r*56.7%
*-commutative56.7%
Simplified56.7%
Final simplification81.5%
NOTE: M should be positive before calling this function
NOTE: D 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 (<= (/ h l) -4e+292)
(fma -0.125 (* (/ (* D w0) (* (/ d M) (/ (/ d M) h))) (/ D l)) w0)
(if (<= (/ h l) -2e-296)
(*
w0
(sqrt (+ 1.0 (* -0.25 (* D (/ D (* (/ d M) (* (/ d M) (/ l h)))))))))
(* w0 (+ 1.0 (* -0.125 (/ D (/ (* (/ d M) (/ (* d l) (* M h))) D))))))))M = abs(M);
D = abs(D);
d = abs(d);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if ((h / l) <= -4e+292) {
tmp = fma(-0.125, (((D * w0) / ((d / M) * ((d / M) / h))) * (D / l)), w0);
} else if ((h / l) <= -2e-296) {
tmp = w0 * sqrt((1.0 + (-0.25 * (D * (D / ((d / M) * ((d / M) * (l / h))))))));
} else {
tmp = w0 * (1.0 + (-0.125 * (D / (((d / M) * ((d * l) / (M * h))) / D))));
}
return tmp;
}
M = abs(M) D = abs(D) d = abs(d) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (Float64(h / l) <= -4e+292) tmp = fma(-0.125, Float64(Float64(Float64(D * w0) / Float64(Float64(d / M) * Float64(Float64(d / M) / h))) * Float64(D / l)), w0); elseif (Float64(h / l) <= -2e-296) tmp = Float64(w0 * sqrt(Float64(1.0 + Float64(-0.25 * Float64(D * Float64(D / Float64(Float64(d / M) * Float64(Float64(d / M) * Float64(l / h))))))))); else tmp = Float64(w0 * Float64(1.0 + Float64(-0.125 * Float64(D / Float64(Float64(Float64(d / M) * Float64(Float64(d * l) / Float64(M * h))) / D))))); end return tmp end
NOTE: M should be positive before calling this function NOTE: D 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[(h / l), $MachinePrecision], -4e+292], N[(-0.125 * N[(N[(N[(D * w0), $MachinePrecision] / N[(N[(d / M), $MachinePrecision] * N[(N[(d / M), $MachinePrecision] / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(D / l), $MachinePrecision]), $MachinePrecision] + w0), $MachinePrecision], If[LessEqual[N[(h / l), $MachinePrecision], -2e-296], N[(w0 * N[Sqrt[N[(1.0 + N[(-0.25 * N[(D * N[(D / N[(N[(d / M), $MachinePrecision] * N[(N[(d / M), $MachinePrecision] * N[(l / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(w0 * N[(1.0 + N[(-0.125 * N[(D / N[(N[(N[(d / M), $MachinePrecision] * N[(N[(d * l), $MachinePrecision] / N[(M * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
M = |M|\\
D = |D|\\
d = |d|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{h}{\ell} \leq -4 \cdot 10^{+292}:\\
\;\;\;\;\mathsf{fma}\left(-0.125, \frac{D \cdot w0}{\frac{d}{M} \cdot \frac{\frac{d}{M}}{h}} \cdot \frac{D}{\ell}, w0\right)\\
\mathbf{elif}\;\frac{h}{\ell} \leq -2 \cdot 10^{-296}:\\
\;\;\;\;w0 \cdot \sqrt{1 + -0.25 \cdot \left(D \cdot \frac{D}{\frac{d}{M} \cdot \left(\frac{d}{M} \cdot \frac{\ell}{h}\right)}\right)}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \left(1 + -0.125 \cdot \frac{D}{\frac{\frac{d}{M} \cdot \frac{d \cdot \ell}{M \cdot h}}{D}}\right)\\
\end{array}
\end{array}
if (/.f64 h l) < -4.0000000000000001e292Initial program 43.3%
*-commutative43.3%
times-frac43.3%
Simplified43.3%
Taylor expanded in M around 0 53.1%
fma-def53.1%
times-frac53.1%
*-commutative53.1%
unpow253.1%
associate-/l*58.8%
*-commutative58.8%
*-commutative58.8%
unpow258.8%
times-frac58.8%
*-commutative58.8%
unpow258.8%
associate-*l*58.8%
Simplified58.8%
Taylor expanded in D around 0 53.1%
*-commutative53.1%
unpow253.1%
associate-*r*53.1%
*-commutative53.1%
times-frac53.1%
unpow253.1%
unpow253.1%
associate-*l/58.8%
*-commutative58.8%
associate-*r*58.8%
Simplified74.8%
if -4.0000000000000001e292 < (/.f64 h l) < -2e-296Initial program 83.9%
*-commutative83.9%
times-frac82.7%
Simplified82.7%
Taylor expanded in M around 0 52.3%
associate-*r/52.3%
*-commutative52.3%
associate-*r/52.3%
associate-/l*53.1%
unpow253.1%
*-commutative53.1%
unpow253.1%
associate-*l*57.3%
*-commutative57.3%
unpow257.3%
associate-*l*60.7%
Simplified60.7%
*-un-lft-identity60.7%
cancel-sign-sub-inv60.7%
metadata-eval60.7%
associate-/l*64.8%
associate-*r*60.0%
*-commutative60.0%
associate-*r*57.2%
*-commutative57.2%
associate-*r*61.5%
associate-*r*64.8%
times-frac75.8%
Applied egg-rr75.8%
Simplified81.3%
if -2e-296 < (/.f64 h l) Initial program 82.0%
*-commutative82.0%
times-frac80.9%
Simplified80.9%
Taylor expanded in M around 0 61.9%
associate-*r/61.9%
*-commutative61.9%
associate-*r/61.9%
*-commutative61.9%
associate-/l*61.9%
unpow261.9%
unpow261.9%
*-commutative61.9%
unpow261.9%
Simplified61.9%
*-un-lft-identity61.9%
associate-/l*74.9%
*-commutative74.9%
associate-*r*77.3%
associate-*r*82.4%
times-frac89.8%
Applied egg-rr89.8%
Final simplification83.9%
NOTE: M should be positive before calling this function
NOTE: D 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 (<= (/ h l) -5e-195)
(*
w0
(pow (+ 1.0 (* -0.25 (/ D (/ (/ d M) (/ D (/ d (/ (* M h) l))))))) 0.5))
(*
w0
(pow (+ 1.0 (* -0.25 (/ D (/ (/ d M) (/ (* D (* M h)) (* d l)))))) 0.5))))M = abs(M);
D = abs(D);
d = abs(d);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if ((h / l) <= -5e-195) {
tmp = w0 * pow((1.0 + (-0.25 * (D / ((d / M) / (D / (d / ((M * h) / l))))))), 0.5);
} else {
tmp = w0 * pow((1.0 + (-0.25 * (D / ((d / M) / ((D * (M * h)) / (d * l)))))), 0.5);
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: D 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 ((h / l) <= (-5d-195)) then
tmp = w0 * ((1.0d0 + ((-0.25d0) * (d / ((d_1 / m) / (d / (d_1 / ((m * h) / l))))))) ** 0.5d0)
else
tmp = w0 * ((1.0d0 + ((-0.25d0) * (d / ((d_1 / m) / ((d * (m * h)) / (d_1 * l)))))) ** 0.5d0)
end if
code = tmp
end function
M = Math.abs(M);
D = Math.abs(D);
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 ((h / l) <= -5e-195) {
tmp = w0 * Math.pow((1.0 + (-0.25 * (D / ((d / M) / (D / (d / ((M * h) / l))))))), 0.5);
} else {
tmp = w0 * Math.pow((1.0 + (-0.25 * (D / ((d / M) / ((D * (M * h)) / (d * l)))))), 0.5);
}
return tmp;
}
M = abs(M) D = abs(D) d = abs(d) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if (h / l) <= -5e-195: tmp = w0 * math.pow((1.0 + (-0.25 * (D / ((d / M) / (D / (d / ((M * h) / l))))))), 0.5) else: tmp = w0 * math.pow((1.0 + (-0.25 * (D / ((d / M) / ((D * (M * h)) / (d * l)))))), 0.5) return tmp
M = abs(M) D = abs(D) d = abs(d) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (Float64(h / l) <= -5e-195) tmp = Float64(w0 * (Float64(1.0 + Float64(-0.25 * Float64(D / Float64(Float64(d / M) / Float64(D / Float64(d / Float64(Float64(M * h) / l))))))) ^ 0.5)); else tmp = Float64(w0 * (Float64(1.0 + Float64(-0.25 * Float64(D / Float64(Float64(d / M) / Float64(Float64(D * Float64(M * h)) / Float64(d * l)))))) ^ 0.5)); end return tmp end
M = abs(M)
D = abs(D)
d = abs(d)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if ((h / l) <= -5e-195)
tmp = w0 * ((1.0 + (-0.25 * (D / ((d / M) / (D / (d / ((M * h) / l))))))) ^ 0.5);
else
tmp = w0 * ((1.0 + (-0.25 * (D / ((d / M) / ((D * (M * h)) / (d * l)))))) ^ 0.5);
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function NOTE: D 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[(h / l), $MachinePrecision], -5e-195], N[(w0 * N[Power[N[(1.0 + N[(-0.25 * N[(D / N[(N[(d / M), $MachinePrecision] / N[(D / N[(d / N[(N[(M * h), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision], N[(w0 * N[Power[N[(1.0 + N[(-0.25 * N[(D / N[(N[(d / M), $MachinePrecision] / N[(N[(D * N[(M * h), $MachinePrecision]), $MachinePrecision] / N[(d * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
d = |d|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{h}{\ell} \leq -5 \cdot 10^{-195}:\\
\;\;\;\;w0 \cdot {\left(1 + -0.25 \cdot \frac{D}{\frac{\frac{d}{M}}{\frac{D}{\frac{d}{\frac{M \cdot h}{\ell}}}}}\right)}^{0.5}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot {\left(1 + -0.25 \cdot \frac{D}{\frac{\frac{d}{M}}{\frac{D \cdot \left(M \cdot h\right)}{d \cdot \ell}}}\right)}^{0.5}\\
\end{array}
\end{array}
if (/.f64 h l) < -5.00000000000000009e-195Initial program 79.0%
*-commutative79.0%
times-frac77.8%
Simplified77.8%
Taylor expanded in M around 0 52.1%
associate-*r/52.1%
*-commutative52.1%
associate-*r/52.1%
associate-/l*52.9%
unpow252.9%
*-commutative52.9%
unpow252.9%
associate-*l*55.9%
*-commutative55.9%
unpow255.9%
associate-*l*58.8%
Simplified58.8%
pow1/258.8%
Applied egg-rr72.0%
*-un-lft-identity72.0%
associate-/l*74.4%
associate-/l*76.6%
Applied egg-rr76.6%
if -5.00000000000000009e-195 < (/.f64 h l) Initial program 81.4%
*-commutative81.4%
times-frac80.6%
Simplified80.6%
Taylor expanded in M around 0 60.1%
associate-*r/60.1%
*-commutative60.1%
associate-*r/60.1%
associate-/l*60.1%
unpow260.1%
*-commutative60.1%
unpow260.1%
associate-*l*64.2%
*-commutative64.2%
unpow264.2%
associate-*l*69.1%
Simplified69.1%
pow1/269.1%
Applied egg-rr89.8%
*-un-lft-identity89.8%
associate-/l*89.8%
associate-/l*86.6%
Applied egg-rr86.6%
Taylor expanded in M around -inf 91.3%
Final simplification83.6%
NOTE: M should be positive before calling this function
NOTE: D 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
(let* ((t_0 (/ d (* M D))))
(if (<= D 4e+137)
(* w0 (sqrt (+ 1.0 (* -0.25 (/ (/ D t_0) (* l (/ d (* M h))))))))
(* w0 (pow (+ 1.0 (* -0.25 (/ D (* t_0 (* l (/ (/ d h) M)))))) 0.5)))))M = abs(M);
D = abs(D);
d = abs(d);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double t_0 = d / (M * D);
double tmp;
if (D <= 4e+137) {
tmp = w0 * sqrt((1.0 + (-0.25 * ((D / t_0) / (l * (d / (M * h)))))));
} else {
tmp = w0 * pow((1.0 + (-0.25 * (D / (t_0 * (l * ((d / h) / M)))))), 0.5);
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: D 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) :: t_0
real(8) :: tmp
t_0 = d_1 / (m * d)
if (d <= 4d+137) then
tmp = w0 * sqrt((1.0d0 + ((-0.25d0) * ((d / t_0) / (l * (d_1 / (m * h)))))))
else
tmp = w0 * ((1.0d0 + ((-0.25d0) * (d / (t_0 * (l * ((d_1 / h) / m)))))) ** 0.5d0)
end if
code = tmp
end function
M = Math.abs(M);
D = Math.abs(D);
d = Math.abs(d);
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);
double tmp;
if (D <= 4e+137) {
tmp = w0 * Math.sqrt((1.0 + (-0.25 * ((D / t_0) / (l * (d / (M * h)))))));
} else {
tmp = w0 * Math.pow((1.0 + (-0.25 * (D / (t_0 * (l * ((d / h) / M)))))), 0.5);
}
return tmp;
}
M = abs(M) D = abs(D) d = abs(d) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): t_0 = d / (M * D) tmp = 0 if D <= 4e+137: tmp = w0 * math.sqrt((1.0 + (-0.25 * ((D / t_0) / (l * (d / (M * h))))))) else: tmp = w0 * math.pow((1.0 + (-0.25 * (D / (t_0 * (l * ((d / h) / M)))))), 0.5) return tmp
M = abs(M) D = abs(D) d = abs(d) M, D = sort([M, D]) function code(w0, M, D, h, l, d) t_0 = Float64(d / Float64(M * D)) tmp = 0.0 if (D <= 4e+137) tmp = Float64(w0 * sqrt(Float64(1.0 + Float64(-0.25 * Float64(Float64(D / t_0) / Float64(l * Float64(d / Float64(M * h)))))))); else tmp = Float64(w0 * (Float64(1.0 + Float64(-0.25 * Float64(D / Float64(t_0 * Float64(l * Float64(Float64(d / h) / M)))))) ^ 0.5)); end return tmp end
M = abs(M)
D = abs(D)
d = abs(d)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
t_0 = d / (M * D);
tmp = 0.0;
if (D <= 4e+137)
tmp = w0 * sqrt((1.0 + (-0.25 * ((D / t_0) / (l * (d / (M * h)))))));
else
tmp = w0 * ((1.0 + (-0.25 * (D / (t_0 * (l * ((d / h) / M)))))) ^ 0.5);
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function
NOTE: D 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_] := Block[{t$95$0 = N[(d / N[(M * D), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[D, 4e+137], N[(w0 * N[Sqrt[N[(1.0 + N[(-0.25 * N[(N[(D / t$95$0), $MachinePrecision] / N[(l * N[(d / N[(M * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(w0 * N[Power[N[(1.0 + N[(-0.25 * N[(D / N[(t$95$0 * N[(l * N[(N[(d / h), $MachinePrecision] / M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
M = |M|\\
D = |D|\\
d = |d|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
t_0 := \frac{d}{M \cdot D}\\
\mathbf{if}\;D \leq 4 \cdot 10^{+137}:\\
\;\;\;\;w0 \cdot \sqrt{1 + -0.25 \cdot \frac{\frac{D}{t_0}}{\ell \cdot \frac{d}{M \cdot h}}}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot {\left(1 + -0.25 \cdot \frac{D}{t_0 \cdot \left(\ell \cdot \frac{\frac{d}{h}}{M}\right)}\right)}^{0.5}\\
\end{array}
\end{array}
if D < 4.0000000000000001e137Initial program 81.5%
*-commutative81.5%
times-frac80.2%
Simplified80.2%
Taylor expanded in M around 0 58.9%
associate-*r/58.9%
*-commutative58.9%
associate-*r/58.9%
associate-/l*59.4%
unpow259.4%
*-commutative59.4%
unpow259.4%
associate-*l*63.1%
*-commutative63.1%
unpow263.1%
associate-*l*66.8%
Simplified66.8%
pow1/266.8%
Applied egg-rr82.1%
*-un-lft-identity82.1%
associate-/l*83.2%
associate-/l*82.8%
Applied egg-rr82.8%
*-un-lft-identity82.8%
unpow1/282.7%
*-un-lft-identity82.7%
associate-/r/82.6%
associate-/r/84.5%
associate-/l/80.9%
Applied egg-rr80.9%
*-lft-identity80.9%
associate-/r*79.0%
associate-/l/79.6%
*-commutative79.6%
associate-/l/83.1%
Simplified83.1%
if 4.0000000000000001e137 < D Initial program 72.5%
*-commutative72.5%
times-frac73.4%
Simplified73.4%
Taylor expanded in M around 0 39.0%
associate-*r/39.0%
*-commutative39.0%
associate-*r/39.0%
associate-/l*39.0%
unpow239.0%
*-commutative39.0%
unpow239.0%
associate-*l*41.6%
*-commutative41.6%
unpow241.6%
associate-*l*46.5%
Simplified46.5%
pow1/246.5%
Applied egg-rr71.5%
Taylor expanded in d around 0 58.2%
*-commutative58.2%
unpow258.2%
associate-*r*65.5%
associate-/r*63.1%
associate-*r*58.2%
times-frac53.3%
associate-/r*64.0%
associate-/r/66.4%
unpow266.4%
associate-*r/69.0%
*-commutative69.0%
associate-/l*68.8%
associate-*r/69.1%
associate-*l/73.4%
*-commutative73.4%
associate-/r/76.2%
associate-/r*78.5%
*-commutative78.5%
associate-/l/76.2%
associate-/r*78.6%
associate-/r*76.0%
Simplified76.0%
Final simplification82.1%
NOTE: M should be positive before calling this function
NOTE: D 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 1e+167)
(* w0 (sqrt (+ 1.0 (* -0.25 (* D (/ D (* (/ d M) (/ d (/ (* M h) l)))))))))
(*
w0
(sqrt (+ 1.0 (* -0.25 (/ D (* (/ (/ d M) D) (* l (/ (/ d h) M))))))))))M = abs(M);
D = abs(D);
d = abs(d);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (D <= 1e+167) {
tmp = w0 * sqrt((1.0 + (-0.25 * (D * (D / ((d / M) * (d / ((M * h) / l))))))));
} else {
tmp = w0 * sqrt((1.0 + (-0.25 * (D / (((d / M) / D) * (l * ((d / h) / M)))))));
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: D 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 <= 1d+167) then
tmp = w0 * sqrt((1.0d0 + ((-0.25d0) * (d * (d / ((d_1 / m) * (d_1 / ((m * h) / l))))))))
else
tmp = w0 * sqrt((1.0d0 + ((-0.25d0) * (d / (((d_1 / m) / d) * (l * ((d_1 / h) / m)))))))
end if
code = tmp
end function
M = Math.abs(M);
D = Math.abs(D);
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 <= 1e+167) {
tmp = w0 * Math.sqrt((1.0 + (-0.25 * (D * (D / ((d / M) * (d / ((M * h) / l))))))));
} else {
tmp = w0 * Math.sqrt((1.0 + (-0.25 * (D / (((d / M) / D) * (l * ((d / h) / M)))))));
}
return tmp;
}
M = abs(M) D = abs(D) d = abs(d) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if D <= 1e+167: tmp = w0 * math.sqrt((1.0 + (-0.25 * (D * (D / ((d / M) * (d / ((M * h) / l)))))))) else: tmp = w0 * math.sqrt((1.0 + (-0.25 * (D / (((d / M) / D) * (l * ((d / h) / M))))))) return tmp
M = abs(M) D = abs(D) d = abs(d) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (D <= 1e+167) tmp = Float64(w0 * sqrt(Float64(1.0 + Float64(-0.25 * Float64(D * Float64(D / Float64(Float64(d / M) * Float64(d / Float64(Float64(M * h) / l))))))))); else tmp = Float64(w0 * sqrt(Float64(1.0 + Float64(-0.25 * Float64(D / Float64(Float64(Float64(d / M) / D) * Float64(l * Float64(Float64(d / h) / M)))))))); end return tmp end
M = abs(M)
D = abs(D)
d = abs(d)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if (D <= 1e+167)
tmp = w0 * sqrt((1.0 + (-0.25 * (D * (D / ((d / M) * (d / ((M * h) / l))))))));
else
tmp = w0 * sqrt((1.0 + (-0.25 * (D / (((d / M) / D) * (l * ((d / h) / M)))))));
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function NOTE: D 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, 1e+167], N[(w0 * N[Sqrt[N[(1.0 + N[(-0.25 * N[(D * N[(D / N[(N[(d / M), $MachinePrecision] * N[(d / N[(N[(M * h), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(w0 * N[Sqrt[N[(1.0 + N[(-0.25 * N[(D / N[(N[(N[(d / M), $MachinePrecision] / D), $MachinePrecision] * N[(l * N[(N[(d / h), $MachinePrecision] / M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
d = |d|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;D \leq 10^{+167}:\\
\;\;\;\;w0 \cdot \sqrt{1 + -0.25 \cdot \left(D \cdot \frac{D}{\frac{d}{M} \cdot \frac{d}{\frac{M \cdot h}{\ell}}}\right)}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{1 + -0.25 \cdot \frac{D}{\frac{\frac{d}{M}}{D} \cdot \left(\ell \cdot \frac{\frac{d}{h}}{M}\right)}}\\
\end{array}
\end{array}
if D < 1e167Initial program 81.3%
*-commutative81.3%
times-frac79.9%
Simplified79.9%
Taylor expanded in M around 0 58.5%
associate-*r/58.5%
*-commutative58.5%
associate-*r/58.5%
associate-/l*59.0%
unpow259.0%
*-commutative59.0%
unpow259.0%
associate-*l*62.5%
*-commutative62.5%
unpow262.5%
associate-*l*66.5%
Simplified66.5%
pow1/266.5%
Applied egg-rr81.8%
unpow1/281.8%
associate-/r/81.8%
*-commutative81.8%
associate-/l*81.4%
Applied egg-rr81.4%
if 1e167 < D Initial program 72.5%
*-commutative72.5%
times-frac73.5%
Simplified73.5%
Taylor expanded in M around 0 37.9%
associate-*r/37.9%
*-commutative37.9%
associate-*r/37.9%
associate-/l*37.9%
unpow237.9%
*-commutative37.9%
unpow237.9%
associate-*l*41.0%
*-commutative41.0%
unpow241.0%
associate-*l*44.2%
Simplified44.2%
pow1/244.2%
Applied egg-rr71.2%
*-un-lft-identity71.2%
associate-/l*74.0%
associate-/l*73.9%
Applied egg-rr73.9%
unpow1/273.9%
*-un-lft-identity73.9%
associate-/r/73.5%
associate-/r/77.0%
associate-/l/79.8%
Applied egg-rr79.8%
Final simplification81.2%
NOTE: M should be positive before calling this function
NOTE: D 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 4.4e+139)
(* w0 (sqrt (+ 1.0 (* -0.25 (/ (/ D (/ d (* M D))) (* l (/ d (* M h))))))))
(*
w0
(sqrt (+ 1.0 (* -0.25 (/ D (* (/ (/ d M) D) (* l (/ (/ d h) M))))))))))M = abs(M);
D = abs(D);
d = abs(d);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (D <= 4.4e+139) {
tmp = w0 * sqrt((1.0 + (-0.25 * ((D / (d / (M * D))) / (l * (d / (M * h)))))));
} else {
tmp = w0 * sqrt((1.0 + (-0.25 * (D / (((d / M) / D) * (l * ((d / h) / M)))))));
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: D 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 <= 4.4d+139) then
tmp = w0 * sqrt((1.0d0 + ((-0.25d0) * ((d / (d_1 / (m * d))) / (l * (d_1 / (m * h)))))))
else
tmp = w0 * sqrt((1.0d0 + ((-0.25d0) * (d / (((d_1 / m) / d) * (l * ((d_1 / h) / m)))))))
end if
code = tmp
end function
M = Math.abs(M);
D = Math.abs(D);
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 <= 4.4e+139) {
tmp = w0 * Math.sqrt((1.0 + (-0.25 * ((D / (d / (M * D))) / (l * (d / (M * h)))))));
} else {
tmp = w0 * Math.sqrt((1.0 + (-0.25 * (D / (((d / M) / D) * (l * ((d / h) / M)))))));
}
return tmp;
}
M = abs(M) D = abs(D) d = abs(d) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if D <= 4.4e+139: tmp = w0 * math.sqrt((1.0 + (-0.25 * ((D / (d / (M * D))) / (l * (d / (M * h))))))) else: tmp = w0 * math.sqrt((1.0 + (-0.25 * (D / (((d / M) / D) * (l * ((d / h) / M))))))) return tmp
M = abs(M) D = abs(D) d = abs(d) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (D <= 4.4e+139) tmp = Float64(w0 * sqrt(Float64(1.0 + Float64(-0.25 * Float64(Float64(D / Float64(d / Float64(M * D))) / Float64(l * Float64(d / Float64(M * h)))))))); else tmp = Float64(w0 * sqrt(Float64(1.0 + Float64(-0.25 * Float64(D / Float64(Float64(Float64(d / M) / D) * Float64(l * Float64(Float64(d / h) / M)))))))); end return tmp end
M = abs(M)
D = abs(D)
d = abs(d)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if (D <= 4.4e+139)
tmp = w0 * sqrt((1.0 + (-0.25 * ((D / (d / (M * D))) / (l * (d / (M * h)))))));
else
tmp = w0 * sqrt((1.0 + (-0.25 * (D / (((d / M) / D) * (l * ((d / h) / M)))))));
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function NOTE: D 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, 4.4e+139], N[(w0 * N[Sqrt[N[(1.0 + N[(-0.25 * N[(N[(D / N[(d / N[(M * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(l * N[(d / N[(M * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(w0 * N[Sqrt[N[(1.0 + N[(-0.25 * N[(D / N[(N[(N[(d / M), $MachinePrecision] / D), $MachinePrecision] * N[(l * N[(N[(d / h), $MachinePrecision] / M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
d = |d|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;D \leq 4.4 \cdot 10^{+139}:\\
\;\;\;\;w0 \cdot \sqrt{1 + -0.25 \cdot \frac{\frac{D}{\frac{d}{M \cdot D}}}{\ell \cdot \frac{d}{M \cdot h}}}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{1 + -0.25 \cdot \frac{D}{\frac{\frac{d}{M}}{D} \cdot \left(\ell \cdot \frac{\frac{d}{h}}{M}\right)}}\\
\end{array}
\end{array}
if D < 4.3999999999999999e139Initial program 81.5%
*-commutative81.5%
times-frac80.2%
Simplified80.2%
Taylor expanded in M around 0 58.9%
associate-*r/58.9%
*-commutative58.9%
associate-*r/58.9%
associate-/l*59.4%
unpow259.4%
*-commutative59.4%
unpow259.4%
associate-*l*63.1%
*-commutative63.1%
unpow263.1%
associate-*l*66.8%
Simplified66.8%
pow1/266.8%
Applied egg-rr82.1%
*-un-lft-identity82.1%
associate-/l*83.2%
associate-/l*82.8%
Applied egg-rr82.8%
*-un-lft-identity82.8%
unpow1/282.7%
*-un-lft-identity82.7%
associate-/r/82.6%
associate-/r/84.5%
associate-/l/80.9%
Applied egg-rr80.9%
*-lft-identity80.9%
associate-/r*79.0%
associate-/l/79.6%
*-commutative79.6%
associate-/l/83.1%
Simplified83.1%
if 4.3999999999999999e139 < D Initial program 72.5%
*-commutative72.5%
times-frac73.4%
Simplified73.4%
Taylor expanded in M around 0 39.0%
associate-*r/39.0%
*-commutative39.0%
associate-*r/39.0%
associate-/l*39.0%
unpow239.0%
*-commutative39.0%
unpow239.0%
associate-*l*41.6%
*-commutative41.6%
unpow241.6%
associate-*l*46.5%
Simplified46.5%
pow1/246.5%
Applied egg-rr71.5%
*-un-lft-identity71.5%
associate-/l*73.8%
associate-/l*73.7%
Applied egg-rr73.7%
unpow1/273.7%
*-un-lft-identity73.7%
associate-/r/73.4%
associate-/r/76.2%
associate-/l/78.6%
Applied egg-rr78.6%
Final simplification82.4%
NOTE: M should be positive before calling this function NOTE: D 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 (sqrt (+ 1.0 (* -0.25 (* D (/ D (* (/ d M) (/ d (/ (* M h) l))))))))))
M = abs(M);
D = abs(D);
d = abs(d);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
return w0 * sqrt((1.0 + (-0.25 * (D * (D / ((d / M) * (d / ((M * h) / l))))))));
}
NOTE: M should be positive before calling this function
NOTE: D 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 * sqrt((1.0d0 + ((-0.25d0) * (d * (d / ((d_1 / m) * (d_1 / ((m * h) / l))))))))
end function
M = Math.abs(M);
D = Math.abs(D);
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 * Math.sqrt((1.0 + (-0.25 * (D * (D / ((d / M) * (d / ((M * h) / l))))))));
}
M = abs(M) D = abs(D) d = abs(d) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): return w0 * math.sqrt((1.0 + (-0.25 * (D * (D / ((d / M) * (d / ((M * h) / l))))))))
M = abs(M) D = abs(D) d = abs(d) M, D = sort([M, D]) function code(w0, M, D, h, l, d) return Float64(w0 * sqrt(Float64(1.0 + Float64(-0.25 * Float64(D * Float64(D / Float64(Float64(d / M) * Float64(d / Float64(Float64(M * h) / l))))))))) end
M = abs(M)
D = abs(D)
d = abs(d)
M, D = num2cell(sort([M, D])){:}
function tmp = code(w0, M, D, h, l, d)
tmp = w0 * sqrt((1.0 + (-0.25 * (D * (D / ((d / M) * (d / ((M * h) / l))))))));
end
NOTE: M should be positive before calling this function NOTE: D 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[Sqrt[N[(1.0 + N[(-0.25 * N[(D * N[(D / N[(N[(d / M), $MachinePrecision] * N[(d / N[(N[(M * h), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
M = |M|\\
D = |D|\\
d = |d|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
w0 \cdot \sqrt{1 + -0.25 \cdot \left(D \cdot \frac{D}{\frac{d}{M} \cdot \frac{d}{\frac{M \cdot h}{\ell}}}\right)}
\end{array}
Initial program 80.2%
*-commutative80.2%
times-frac79.1%
Simplified79.1%
Taylor expanded in M around 0 55.9%
associate-*r/55.9%
*-commutative55.9%
associate-*r/55.9%
associate-/l*56.3%
unpow256.3%
*-commutative56.3%
unpow256.3%
associate-*l*59.8%
*-commutative59.8%
unpow259.8%
associate-*l*63.7%
Simplified63.7%
pow1/263.7%
Applied egg-rr80.5%
unpow1/280.5%
associate-/r/80.5%
*-commutative80.5%
associate-/l*79.7%
Applied egg-rr79.7%
Final simplification79.7%
NOTE: M should be positive before calling this function NOTE: D 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.7e-168) w0 (* w0 (+ 1.0 (* -0.125 (* (* D (/ D l)) (* (/ M d) (/ (* M h) d))))))))
M = abs(M);
D = abs(D);
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.7e-168) {
tmp = w0;
} else {
tmp = w0 * (1.0 + (-0.125 * ((D * (D / l)) * ((M / d) * ((M * h) / d)))));
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: D 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.7d-168) then
tmp = w0
else
tmp = w0 * (1.0d0 + ((-0.125d0) * ((d * (d / l)) * ((m / d_1) * ((m * h) / d_1)))))
end if
code = tmp
end function
M = Math.abs(M);
D = Math.abs(D);
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.7e-168) {
tmp = w0;
} else {
tmp = w0 * (1.0 + (-0.125 * ((D * (D / l)) * ((M / d) * ((M * h) / d)))));
}
return tmp;
}
M = abs(M) D = abs(D) d = abs(d) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if M <= 1.7e-168: tmp = w0 else: tmp = w0 * (1.0 + (-0.125 * ((D * (D / l)) * ((M / d) * ((M * h) / d))))) return tmp
M = abs(M) D = abs(D) d = abs(d) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (M <= 1.7e-168) tmp = w0; else tmp = Float64(w0 * Float64(1.0 + Float64(-0.125 * Float64(Float64(D * Float64(D / l)) * Float64(Float64(M / d) * Float64(Float64(M * h) / d)))))); end return tmp end
M = abs(M)
D = abs(D)
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.7e-168)
tmp = w0;
else
tmp = w0 * (1.0 + (-0.125 * ((D * (D / l)) * ((M / d) * ((M * h) / d)))));
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function NOTE: D 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.7e-168], w0, N[(w0 * N[(1.0 + N[(-0.125 * N[(N[(D * N[(D / l), $MachinePrecision]), $MachinePrecision] * N[(N[(M / d), $MachinePrecision] * N[(N[(M * h), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
d = |d|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;M \leq 1.7 \cdot 10^{-168}:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \left(1 + -0.125 \cdot \left(\left(D \cdot \frac{D}{\ell}\right) \cdot \left(\frac{M}{d} \cdot \frac{M \cdot h}{d}\right)\right)\right)\\
\end{array}
\end{array}
if M < 1.70000000000000011e-168Initial program 80.4%
*-commutative80.4%
times-frac79.0%
Simplified79.0%
Taylor expanded in M around 0 65.6%
if 1.70000000000000011e-168 < M Initial program 79.6%
*-commutative79.6%
times-frac79.5%
Simplified79.5%
Taylor expanded in M around 0 60.0%
associate-*r/60.0%
*-commutative60.0%
associate-*r/60.0%
*-commutative60.0%
associate-/l*60.1%
unpow260.1%
unpow260.1%
*-commutative60.1%
unpow260.1%
Simplified60.1%
Taylor expanded in D around 0 60.0%
*-commutative60.0%
times-frac60.1%
unpow260.1%
associate-*r/60.2%
unpow260.2%
unpow260.2%
associate-*r*61.7%
times-frac65.7%
Simplified65.7%
Final simplification65.7%
NOTE: M should be positive before calling this function NOTE: D 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 8.6e-180) w0 (* w0 (+ 1.0 (* -0.125 (* (* (/ D d) (/ D (* d l))) (* M (* M h))))))))
M = abs(M);
D = abs(D);
d = abs(d);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (M <= 8.6e-180) {
tmp = w0;
} else {
tmp = w0 * (1.0 + (-0.125 * (((D / d) * (D / (d * l))) * (M * (M * h)))));
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: D 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 <= 8.6d-180) then
tmp = w0
else
tmp = w0 * (1.0d0 + ((-0.125d0) * (((d / d_1) * (d / (d_1 * l))) * (m * (m * h)))))
end if
code = tmp
end function
M = Math.abs(M);
D = Math.abs(D);
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 <= 8.6e-180) {
tmp = w0;
} else {
tmp = w0 * (1.0 + (-0.125 * (((D / d) * (D / (d * l))) * (M * (M * h)))));
}
return tmp;
}
M = abs(M) D = abs(D) d = abs(d) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if M <= 8.6e-180: tmp = w0 else: tmp = w0 * (1.0 + (-0.125 * (((D / d) * (D / (d * l))) * (M * (M * h))))) return tmp
M = abs(M) D = abs(D) d = abs(d) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (M <= 8.6e-180) tmp = w0; else tmp = Float64(w0 * Float64(1.0 + Float64(-0.125 * Float64(Float64(Float64(D / d) * Float64(D / Float64(d * l))) * Float64(M * Float64(M * h)))))); end return tmp end
M = abs(M)
D = abs(D)
d = abs(d)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if (M <= 8.6e-180)
tmp = w0;
else
tmp = w0 * (1.0 + (-0.125 * (((D / d) * (D / (d * l))) * (M * (M * 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: 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, 8.6e-180], w0, N[(w0 * N[(1.0 + N[(-0.125 * N[(N[(N[(D / d), $MachinePrecision] * N[(D / N[(d * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(M * N[(M * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
d = |d|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;M \leq 8.6 \cdot 10^{-180}:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \left(1 + -0.125 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d \cdot \ell}\right) \cdot \left(M \cdot \left(M \cdot h\right)\right)\right)\right)\\
\end{array}
\end{array}
if M < 8.5999999999999991e-180Initial program 80.2%
*-commutative80.2%
times-frac78.7%
Simplified78.7%
Taylor expanded in M around 0 65.2%
if 8.5999999999999991e-180 < M Initial program 80.1%
*-commutative80.1%
times-frac80.0%
Simplified80.0%
Taylor expanded in M around 0 61.0%
associate-*r/61.0%
*-commutative61.0%
associate-*r/61.0%
*-commutative61.0%
associate-/l*61.1%
unpow261.1%
unpow261.1%
*-commutative61.1%
unpow261.1%
Simplified61.1%
Taylor expanded in D around 0 61.0%
unpow261.0%
associate-*r*63.6%
unpow263.6%
associate-*r*66.1%
associate-*l/65.1%
unpow265.1%
times-frac66.6%
*-commutative66.6%
Simplified66.6%
Final simplification65.7%
NOTE: M should be positive before calling this function NOTE: D 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 23000000000.0) w0 (* -0.125 (* (* D (/ D l)) (* (/ (* w0 h) d) (/ (* M M) d))))))
M = abs(M);
D = abs(D);
d = abs(d);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (M <= 23000000000.0) {
tmp = w0;
} else {
tmp = -0.125 * ((D * (D / l)) * (((w0 * h) / d) * ((M * M) / d)));
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: D 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 <= 23000000000.0d0) then
tmp = w0
else
tmp = (-0.125d0) * ((d * (d / l)) * (((w0 * h) / d_1) * ((m * m) / d_1)))
end if
code = tmp
end function
M = Math.abs(M);
D = Math.abs(D);
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 <= 23000000000.0) {
tmp = w0;
} else {
tmp = -0.125 * ((D * (D / l)) * (((w0 * h) / d) * ((M * M) / d)));
}
return tmp;
}
M = abs(M) D = abs(D) d = abs(d) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if M <= 23000000000.0: tmp = w0 else: tmp = -0.125 * ((D * (D / l)) * (((w0 * h) / d) * ((M * M) / d))) return tmp
M = abs(M) D = abs(D) d = abs(d) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (M <= 23000000000.0) tmp = w0; else tmp = Float64(-0.125 * Float64(Float64(D * Float64(D / l)) * Float64(Float64(Float64(w0 * h) / d) * Float64(Float64(M * M) / d)))); end return tmp end
M = abs(M)
D = abs(D)
d = abs(d)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if (M <= 23000000000.0)
tmp = w0;
else
tmp = -0.125 * ((D * (D / l)) * (((w0 * h) / d) * ((M * M) / d)));
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function NOTE: D 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, 23000000000.0], w0, N[(-0.125 * N[(N[(D * N[(D / l), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(w0 * h), $MachinePrecision] / d), $MachinePrecision] * N[(N[(M * M), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
d = |d|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;M \leq 23000000000:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;-0.125 \cdot \left(\left(D \cdot \frac{D}{\ell}\right) \cdot \left(\frac{w0 \cdot h}{d} \cdot \frac{M \cdot M}{d}\right)\right)\\
\end{array}
\end{array}
if M < 2.3e10Initial program 81.0%
*-commutative81.0%
times-frac79.8%
Simplified79.8%
Taylor expanded in M around 0 63.9%
if 2.3e10 < M Initial program 76.2%
*-commutative76.2%
times-frac76.1%
Simplified76.1%
Taylor expanded in M around 0 51.8%
associate-*r/51.8%
*-commutative51.8%
associate-*r/51.8%
*-commutative51.8%
associate-/l*51.8%
unpow251.8%
unpow251.8%
*-commutative51.8%
unpow251.8%
Simplified51.8%
Taylor expanded in D around 0 51.8%
*-commutative51.8%
times-frac51.8%
unpow251.8%
associate-*r/52.0%
unpow252.0%
unpow252.0%
associate-*r*54.6%
times-frac57.3%
Simplified57.3%
Taylor expanded in D around inf 21.9%
associate-*r/21.9%
*-commutative21.9%
unpow221.9%
*-commutative21.9%
unpow221.9%
associate-*r/21.9%
times-frac24.0%
unpow224.0%
associate-*r/24.2%
unpow224.2%
unpow224.2%
associate-*r*24.3%
Simplified24.3%
times-frac26.8%
*-commutative26.8%
Applied egg-rr26.8%
Final simplification57.4%
NOTE: M should be positive before calling this function NOTE: D 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) (/ (* d l) (* M h))) D))))))
M = abs(M);
D = abs(D);
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) * ((d * l) / (M * h))) / D))));
}
NOTE: M should be positive before calling this function
NOTE: D 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_1 / m) * ((d_1 * l) / (m * h))) / d))))
end function
M = Math.abs(M);
D = Math.abs(D);
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) * ((d * l) / (M * h))) / D))));
}
M = abs(M) D = abs(D) 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) * ((d * l) / (M * h))) / D))))
M = abs(M) D = abs(D) 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(Float64(Float64(d / M) * Float64(Float64(d * l) / Float64(M * h))) / D))))) end
M = abs(M)
D = abs(D)
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) * ((d * l) / (M * h))) / D))));
end
NOTE: M should be positive before calling this function NOTE: D 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[(N[(N[(d / M), $MachinePrecision] * N[(N[(d * l), $MachinePrecision] / N[(M * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
M = |M|\\
D = |D|\\
d = |d|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
w0 \cdot \left(1 + -0.125 \cdot \frac{D}{\frac{\frac{d}{M} \cdot \frac{d \cdot \ell}{M \cdot h}}{D}}\right)
\end{array}
Initial program 80.2%
*-commutative80.2%
times-frac79.1%
Simplified79.1%
Taylor expanded in M around 0 54.5%
associate-*r/54.5%
*-commutative54.5%
associate-*r/54.5%
*-commutative54.5%
associate-/l*54.9%
unpow254.9%
unpow254.9%
*-commutative54.9%
unpow254.9%
Simplified54.9%
*-un-lft-identity54.9%
associate-/l*62.4%
*-commutative62.4%
associate-*r*65.3%
associate-*r*68.3%
times-frac74.5%
Applied egg-rr74.5%
Final simplification74.5%
NOTE: M should be positive before calling this function NOTE: D 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);
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: 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);
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) d = abs(d) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): return w0
M = abs(M) D = abs(D) 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)
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: 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|\\
d = |d|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
w0
\end{array}
Initial program 80.2%
*-commutative80.2%
times-frac79.1%
Simplified79.1%
Taylor expanded in M around 0 61.0%
Final simplification61.0%
herbie shell --seed 2023228
(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))))))