
(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 11 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
(FPCore (w0 M D h l d)
:precision binary64
(if (<= (/ (* M D) (* 2.0 d)) 5e+151)
(* w0 (sqrt (- 1.0 (/ (* (pow (* M (* 0.5 (/ D d))) 2.0) h) l))))
(*
w0
(exp
(*
0.5
(fma -2.0 (log d) (log (/ (* -0.25 (* h (* (* M D) (* M D)))) l))))))))M = abs(M);
D = abs(D);
d = abs(d);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (((M * D) / (2.0 * d)) <= 5e+151) {
tmp = w0 * sqrt((1.0 - ((pow((M * (0.5 * (D / d))), 2.0) * h) / l)));
} else {
tmp = w0 * exp((0.5 * fma(-2.0, log(d), log(((-0.25 * (h * ((M * D) * (M * D)))) / l)))));
}
return tmp;
}
M = abs(M) D = abs(D) d = abs(d) function code(w0, M, D, h, l, d) tmp = 0.0 if (Float64(Float64(M * D) / Float64(2.0 * d)) <= 5e+151) 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 * exp(Float64(0.5 * fma(-2.0, log(d), log(Float64(Float64(-0.25 * Float64(h * Float64(Float64(M * D) * Float64(M * D)))) / l)))))); 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 code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 5e+151], 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[Exp[N[(0.5 * N[(-2.0 * N[Log[d], $MachinePrecision] + N[Log[N[(N[(-0.25 * N[(h * N[(N[(M * D), $MachinePrecision] * N[(M * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
d = |d|\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{M \cdot D}{2 \cdot d} \leq 5 \cdot 10^{+151}:\\
\;\;\;\;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 e^{0.5 \cdot \mathsf{fma}\left(-2, \log d, \log \left(\frac{-0.25 \cdot \left(h \cdot \left(\left(M \cdot D\right) \cdot \left(M \cdot D\right)\right)\right)}{\ell}\right)\right)}\\
\end{array}
\end{array}
if (/.f64 (*.f64 M D) (*.f64 2 d)) < 5.0000000000000002e151Initial program 87.9%
*-commutative87.9%
times-frac87.1%
Simplified87.1%
unpow287.1%
associate-*l*87.9%
div-inv88.0%
associate-*l*87.5%
times-frac87.5%
*-un-lft-identity87.5%
*-commutative87.5%
clear-num87.5%
div-inv87.5%
div-inv87.5%
associate-*l*88.4%
times-frac88.4%
*-un-lft-identity88.4%
*-commutative88.4%
clear-num88.4%
div-inv88.4%
associate-*l*87.5%
Applied egg-rr91.4%
if 5.0000000000000002e151 < (/.f64 (*.f64 M D) (*.f64 2 d)) Initial program 54.6%
*-commutative54.6%
times-frac58.8%
Simplified58.8%
Applied egg-rr58.6%
Taylor expanded in d around 0 22.5%
+-commutative22.5%
fma-def22.5%
associate-*r/22.5%
*-commutative22.5%
associate-*r*22.5%
unpow222.5%
unpow222.5%
unswap-sqr26.9%
Simplified26.9%
Final simplification85.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 (FPCore (w0 M D h l d) :precision binary64 (if (<= (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ h l)) 5e-48) (* w0 (sqrt (- 1.0 (* (/ h l) (pow (* (/ M d) (/ D 2.0)) 2.0))))) (fma -0.125 (/ (/ (* D w0) (* (/ d M) (/ (/ d h) M))) (/ l D)) w0)))
M = abs(M);
D = abs(D);
d = abs(d);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if ((pow(((M * D) / (2.0 * d)), 2.0) * (h / l)) <= 5e-48) {
tmp = w0 * sqrt((1.0 - ((h / l) * pow(((M / d) * (D / 2.0)), 2.0))));
} else {
tmp = fma(-0.125, (((D * w0) / ((d / M) * ((d / h) / M))) / (l / D)), w0);
}
return tmp;
}
M = abs(M) D = abs(D) d = abs(d) function code(w0, M, D, h, l, d) tmp = 0.0 if (Float64((Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0) * Float64(h / l)) <= 5e-48) tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(h / l) * (Float64(Float64(M / d) * Float64(D / 2.0)) ^ 2.0))))); else tmp = fma(-0.125, Float64(Float64(Float64(D * w0) / Float64(Float64(d / M) * Float64(Float64(d / h) / M))) / Float64(l / D)), w0); 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 code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision], 5e-48], N[(w0 * N[Sqrt[N[(1.0 - N[(N[(h / l), $MachinePrecision] * N[Power[N[(N[(M / d), $MachinePrecision] * N[(D / 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(-0.125 * N[(N[(N[(D * w0), $MachinePrecision] / N[(N[(d / M), $MachinePrecision] * N[(N[(d / h), $MachinePrecision] / M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(l / D), $MachinePrecision]), $MachinePrecision] + w0), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
d = |d|\\
\\
\begin{array}{l}
\mathbf{if}\;{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell} \leq 5 \cdot 10^{-48}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{h}{\ell} \cdot {\left(\frac{M}{d} \cdot \frac{D}{2}\right)}^{2}}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-0.125, \frac{\frac{D \cdot w0}{\frac{d}{M} \cdot \frac{\frac{d}{h}}{M}}}{\frac{\ell}{D}}, w0\right)\\
\end{array}
\end{array}
if (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (/.f64 h l)) < 4.9999999999999999e-48Initial program 89.8%
*-commutative89.8%
times-frac89.4%
Simplified89.4%
if 4.9999999999999999e-48 < (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (/.f64 h l)) Initial program 0.0%
*-commutative0.0%
times-frac0.0%
Simplified0.0%
Taylor expanded in M around 0 43.5%
fma-def43.5%
times-frac43.7%
*-commutative43.7%
unpow243.7%
associate-/l*43.7%
*-commutative43.7%
*-commutative43.7%
unpow243.7%
times-frac51.1%
*-commutative51.1%
unpow251.1%
associate-*l*51.3%
Simplified51.3%
associate-*l/51.3%
frac-times43.9%
Applied egg-rr43.9%
*-commutative43.9%
associate-*r*43.7%
unpow243.7%
*-commutative43.7%
unpow243.7%
associate-/l*50.9%
associate-*r/50.9%
unpow250.9%
*-commutative50.9%
unpow250.9%
associate-*r*51.0%
Simplified51.0%
Taylor expanded in d around 0 50.9%
unpow250.9%
unpow250.9%
associate-*r*51.0%
times-frac51.4%
associate-/l/72.8%
Simplified72.8%
Final simplification88.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 (FPCore (w0 M D h l d) :precision binary64 (* w0 (sqrt (- 1.0 (/ (* (pow (* M (* 0.5 (/ D d))) 2.0) h) l)))))
M = abs(M);
D = abs(D);
d = abs(d);
double code(double w0, double M, double D, double h, double l, double d) {
return w0 * sqrt((1.0 - ((pow((M * (0.5 * (D / d))), 2.0) * 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
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 * (0.5d0 * (d / d_1))) ** 2.0d0) * h) / l)))
end function
M = Math.abs(M);
D = Math.abs(D);
d = Math.abs(d);
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 * (0.5 * (D / d))), 2.0) * h) / l)));
}
M = abs(M) D = abs(D) d = abs(d) def code(w0, M, D, h, l, d): return w0 * math.sqrt((1.0 - ((math.pow((M * (0.5 * (D / d))), 2.0) * h) / l)))
M = abs(M) D = abs(D) d = abs(d) function code(w0, M, D, h, l, d) return Float64(w0 * sqrt(Float64(1.0 - Float64(Float64((Float64(M * Float64(0.5 * Float64(D / d))) ^ 2.0) * h) / l)))) end
M = abs(M) D = abs(D) d = abs(d) function tmp = code(w0, M, D, h, l, d) tmp = w0 * sqrt((1.0 - ((((M * (0.5 * (D / d))) ^ 2.0) * 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 code[w0_, M_, D_, h_, l_, d_] := 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]
\begin{array}{l}
M = |M|\\
D = |D|\\
d = |d|\\
\\
w0 \cdot \sqrt{1 - \frac{{\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2} \cdot h}{\ell}}
\end{array}
Initial program 84.9%
*-commutative84.9%
times-frac84.5%
Simplified84.5%
unpow284.5%
associate-*l*85.7%
div-inv85.7%
associate-*l*85.3%
times-frac85.4%
*-un-lft-identity85.4%
*-commutative85.4%
clear-num85.4%
div-inv85.4%
div-inv85.3%
associate-*l*86.1%
times-frac86.1%
*-un-lft-identity86.1%
*-commutative86.1%
clear-num86.1%
div-inv86.1%
associate-*l*84.9%
Applied egg-rr88.5%
Final simplification88.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
(FPCore (w0 M D h l d)
:precision binary64
(if (<= (* M D) 1e-160)
w0
(if (<= (* M D) 2e+130)
(* w0 (+ 1.0 (* -0.125 (/ (pow (* M D) 2.0) (/ (* d (* d l)) h)))))
(fma -0.125 (/ (* (* M h) (* M (* (/ D d) (/ w0 d)))) (/ l D)) w0))))M = abs(M);
D = abs(D);
d = abs(d);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if ((M * D) <= 1e-160) {
tmp = w0;
} else if ((M * D) <= 2e+130) {
tmp = w0 * (1.0 + (-0.125 * (pow((M * D), 2.0) / ((d * (d * l)) / h))));
} else {
tmp = fma(-0.125, (((M * h) * (M * ((D / d) * (w0 / d)))) / (l / D)), w0);
}
return tmp;
}
M = abs(M) D = abs(D) d = abs(d) function code(w0, M, D, h, l, d) tmp = 0.0 if (Float64(M * D) <= 1e-160) tmp = w0; elseif (Float64(M * D) <= 2e+130) tmp = Float64(w0 * Float64(1.0 + Float64(-0.125 * Float64((Float64(M * D) ^ 2.0) / Float64(Float64(d * Float64(d * l)) / h))))); else tmp = fma(-0.125, Float64(Float64(Float64(M * h) * Float64(M * Float64(Float64(D / d) * Float64(w0 / d)))) / Float64(l / D)), w0); 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 code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[N[(M * D), $MachinePrecision], 1e-160], w0, If[LessEqual[N[(M * D), $MachinePrecision], 2e+130], N[(w0 * N[(1.0 + N[(-0.125 * N[(N[Power[N[(M * D), $MachinePrecision], 2.0], $MachinePrecision] / N[(N[(d * N[(d * l), $MachinePrecision]), $MachinePrecision] / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-0.125 * N[(N[(N[(M * h), $MachinePrecision] * N[(M * N[(N[(D / d), $MachinePrecision] * N[(w0 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(l / D), $MachinePrecision]), $MachinePrecision] + w0), $MachinePrecision]]]
\begin{array}{l}
M = |M|\\
D = |D|\\
d = |d|\\
\\
\begin{array}{l}
\mathbf{if}\;M \cdot D \leq 10^{-160}:\\
\;\;\;\;w0\\
\mathbf{elif}\;M \cdot D \leq 2 \cdot 10^{+130}:\\
\;\;\;\;w0 \cdot \left(1 + -0.125 \cdot \frac{{\left(M \cdot D\right)}^{2}}{\frac{d \cdot \left(d \cdot \ell\right)}{h}}\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-0.125, \frac{\left(M \cdot h\right) \cdot \left(M \cdot \left(\frac{D}{d} \cdot \frac{w0}{d}\right)\right)}{\frac{\ell}{D}}, w0\right)\\
\end{array}
\end{array}
if (*.f64 M D) < 9.9999999999999999e-161Initial program 86.6%
*-commutative86.6%
times-frac86.6%
Simplified86.6%
Taylor expanded in M around 0 73.6%
if 9.9999999999999999e-161 < (*.f64 M D) < 2.0000000000000001e130Initial program 91.3%
*-commutative91.3%
times-frac89.5%
Simplified89.5%
Taylor expanded in M around 0 54.0%
associate-*r/54.0%
*-commutative54.0%
associate-*r/54.0%
*-commutative54.0%
associate-/l*55.8%
unpow255.8%
unpow255.8%
*-commutative55.8%
unpow255.8%
Simplified55.8%
associate-*r*59.3%
associate-/r/59.3%
Applied egg-rr59.3%
Taylor expanded in D around 0 54.0%
*-commutative54.0%
associate-*r*59.4%
*-commutative59.4%
unpow259.4%
unpow259.4%
swap-sqr81.1%
unpow281.1%
*-commutative81.1%
associate-/l*84.7%
*-commutative84.7%
unpow284.7%
associate-*l*86.9%
Simplified86.9%
if 2.0000000000000001e130 < (*.f64 M D) Initial program 66.3%
*-commutative66.3%
times-frac66.3%
Simplified66.3%
Taylor expanded in M around 0 43.1%
fma-def43.1%
times-frac43.0%
*-commutative43.0%
unpow243.0%
associate-/l*51.8%
*-commutative51.8%
*-commutative51.8%
unpow251.8%
times-frac51.8%
*-commutative51.8%
unpow251.8%
associate-*l*54.8%
Simplified54.8%
associate-*l/58.2%
frac-times55.2%
Applied egg-rr55.2%
Taylor expanded in D around 0 52.2%
associate-*r*46.4%
*-commutative46.4%
unpow246.4%
associate-*r*46.4%
associate-*l/49.4%
unpow249.4%
associate-*r*55.6%
times-frac64.2%
*-commutative64.2%
Simplified64.2%
Final simplification75.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
(FPCore (w0 M D h l d)
:precision binary64
(if (<= (* M D) 1e-160)
(fma -0.125 (/ (/ (* D w0) (* (/ d M) (/ d (* M h)))) (/ l D)) w0)
(if (<= (* M D) 2e+130)
(* w0 (+ 1.0 (* -0.125 (/ (pow (* M D) 2.0) (/ (* d (* d l)) h)))))
(fma -0.125 (/ (* (* M h) (* M (* (/ D d) (/ w0 d)))) (/ l D)) w0))))M = abs(M);
D = abs(D);
d = abs(d);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if ((M * D) <= 1e-160) {
tmp = fma(-0.125, (((D * w0) / ((d / M) * (d / (M * h)))) / (l / D)), w0);
} else if ((M * D) <= 2e+130) {
tmp = w0 * (1.0 + (-0.125 * (pow((M * D), 2.0) / ((d * (d * l)) / h))));
} else {
tmp = fma(-0.125, (((M * h) * (M * ((D / d) * (w0 / d)))) / (l / D)), w0);
}
return tmp;
}
M = abs(M) D = abs(D) d = abs(d) function code(w0, M, D, h, l, d) tmp = 0.0 if (Float64(M * D) <= 1e-160) tmp = fma(-0.125, Float64(Float64(Float64(D * w0) / Float64(Float64(d / M) * Float64(d / Float64(M * h)))) / Float64(l / D)), w0); elseif (Float64(M * D) <= 2e+130) tmp = Float64(w0 * Float64(1.0 + Float64(-0.125 * Float64((Float64(M * D) ^ 2.0) / Float64(Float64(d * Float64(d * l)) / h))))); else tmp = fma(-0.125, Float64(Float64(Float64(M * h) * Float64(M * Float64(Float64(D / d) * Float64(w0 / d)))) / Float64(l / D)), w0); 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 code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[N[(M * D), $MachinePrecision], 1e-160], N[(-0.125 * N[(N[(N[(D * w0), $MachinePrecision] / N[(N[(d / M), $MachinePrecision] * N[(d / N[(M * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(l / D), $MachinePrecision]), $MachinePrecision] + w0), $MachinePrecision], If[LessEqual[N[(M * D), $MachinePrecision], 2e+130], N[(w0 * N[(1.0 + N[(-0.125 * N[(N[Power[N[(M * D), $MachinePrecision], 2.0], $MachinePrecision] / N[(N[(d * N[(d * l), $MachinePrecision]), $MachinePrecision] / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-0.125 * N[(N[(N[(M * h), $MachinePrecision] * N[(M * N[(N[(D / d), $MachinePrecision] * N[(w0 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(l / D), $MachinePrecision]), $MachinePrecision] + w0), $MachinePrecision]]]
\begin{array}{l}
M = |M|\\
D = |D|\\
d = |d|\\
\\
\begin{array}{l}
\mathbf{if}\;M \cdot D \leq 10^{-160}:\\
\;\;\;\;\mathsf{fma}\left(-0.125, \frac{\frac{D \cdot w0}{\frac{d}{M} \cdot \frac{d}{M \cdot h}}}{\frac{\ell}{D}}, w0\right)\\
\mathbf{elif}\;M \cdot D \leq 2 \cdot 10^{+130}:\\
\;\;\;\;w0 \cdot \left(1 + -0.125 \cdot \frac{{\left(M \cdot D\right)}^{2}}{\frac{d \cdot \left(d \cdot \ell\right)}{h}}\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-0.125, \frac{\left(M \cdot h\right) \cdot \left(M \cdot \left(\frac{D}{d} \cdot \frac{w0}{d}\right)\right)}{\frac{\ell}{D}}, w0\right)\\
\end{array}
\end{array}
if (*.f64 M D) < 9.9999999999999999e-161Initial program 86.6%
*-commutative86.6%
times-frac86.6%
Simplified86.6%
Taylor expanded in M around 0 54.6%
fma-def54.6%
times-frac51.5%
*-commutative51.5%
unpow251.5%
associate-/l*56.5%
*-commutative56.5%
*-commutative56.5%
unpow256.5%
times-frac63.0%
*-commutative63.0%
unpow263.0%
associate-*l*66.5%
Simplified66.5%
associate-*l/69.7%
frac-times61.5%
Applied egg-rr61.5%
*-commutative61.5%
associate-*r*59.6%
unpow259.6%
*-commutative59.6%
unpow259.6%
associate-/l*60.2%
associate-*r/57.8%
unpow257.8%
*-commutative57.8%
unpow257.8%
associate-*r*62.0%
Simplified62.0%
times-frac75.7%
Applied egg-rr75.7%
if 9.9999999999999999e-161 < (*.f64 M D) < 2.0000000000000001e130Initial program 91.3%
*-commutative91.3%
times-frac89.5%
Simplified89.5%
Taylor expanded in M around 0 54.0%
associate-*r/54.0%
*-commutative54.0%
associate-*r/54.0%
*-commutative54.0%
associate-/l*55.8%
unpow255.8%
unpow255.8%
*-commutative55.8%
unpow255.8%
Simplified55.8%
associate-*r*59.3%
associate-/r/59.3%
Applied egg-rr59.3%
Taylor expanded in D around 0 54.0%
*-commutative54.0%
associate-*r*59.4%
*-commutative59.4%
unpow259.4%
unpow259.4%
swap-sqr81.1%
unpow281.1%
*-commutative81.1%
associate-/l*84.7%
*-commutative84.7%
unpow284.7%
associate-*l*86.9%
Simplified86.9%
if 2.0000000000000001e130 < (*.f64 M D) Initial program 66.3%
*-commutative66.3%
times-frac66.3%
Simplified66.3%
Taylor expanded in M around 0 43.1%
fma-def43.1%
times-frac43.0%
*-commutative43.0%
unpow243.0%
associate-/l*51.8%
*-commutative51.8%
*-commutative51.8%
unpow251.8%
times-frac51.8%
*-commutative51.8%
unpow251.8%
associate-*l*54.8%
Simplified54.8%
associate-*l/58.2%
frac-times55.2%
Applied egg-rr55.2%
Taylor expanded in D around 0 52.2%
associate-*r*46.4%
*-commutative46.4%
unpow246.4%
associate-*r*46.4%
associate-*l/49.4%
unpow249.4%
associate-*r*55.6%
times-frac64.2%
*-commutative64.2%
Simplified64.2%
Final simplification76.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
(FPCore (w0 M D h l d)
:precision binary64
(let* ((t_0 (* d (* d l))))
(if (<= (* M D) 1e-160)
w0
(if (<= (* M D) 5e+102)
(* w0 (+ 1.0 (* -0.125 (/ (pow (* M D) 2.0) (/ t_0 h)))))
(* w0 (+ 1.0 (* -0.125 (* (* D (/ D t_0)) (* M (* M h))))))))))M = abs(M);
D = abs(D);
d = abs(d);
double code(double w0, double M, double D, double h, double l, double d) {
double t_0 = d * (d * l);
double tmp;
if ((M * D) <= 1e-160) {
tmp = w0;
} else if ((M * D) <= 5e+102) {
tmp = w0 * (1.0 + (-0.125 * (pow((M * D), 2.0) / (t_0 / h))));
} else {
tmp = w0 * (1.0 + (-0.125 * ((D * (D / t_0)) * (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
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 * (d_1 * l)
if ((m * d) <= 1d-160) then
tmp = w0
else if ((m * d) <= 5d+102) then
tmp = w0 * (1.0d0 + ((-0.125d0) * (((m * d) ** 2.0d0) / (t_0 / h))))
else
tmp = w0 * (1.0d0 + ((-0.125d0) * ((d * (d / t_0)) * (m * (m * h)))))
end if
code = tmp
end function
M = Math.abs(M);
D = Math.abs(D);
d = Math.abs(d);
public static double code(double w0, double M, double D, double h, double l, double d) {
double t_0 = d * (d * l);
double tmp;
if ((M * D) <= 1e-160) {
tmp = w0;
} else if ((M * D) <= 5e+102) {
tmp = w0 * (1.0 + (-0.125 * (Math.pow((M * D), 2.0) / (t_0 / h))));
} else {
tmp = w0 * (1.0 + (-0.125 * ((D * (D / t_0)) * (M * (M * h)))));
}
return tmp;
}
M = abs(M) D = abs(D) d = abs(d) def code(w0, M, D, h, l, d): t_0 = d * (d * l) tmp = 0 if (M * D) <= 1e-160: tmp = w0 elif (M * D) <= 5e+102: tmp = w0 * (1.0 + (-0.125 * (math.pow((M * D), 2.0) / (t_0 / h)))) else: tmp = w0 * (1.0 + (-0.125 * ((D * (D / t_0)) * (M * (M * h))))) return tmp
M = abs(M) D = abs(D) d = abs(d) function code(w0, M, D, h, l, d) t_0 = Float64(d * Float64(d * l)) tmp = 0.0 if (Float64(M * D) <= 1e-160) tmp = w0; elseif (Float64(M * D) <= 5e+102) tmp = Float64(w0 * Float64(1.0 + Float64(-0.125 * Float64((Float64(M * D) ^ 2.0) / Float64(t_0 / h))))); else tmp = Float64(w0 * Float64(1.0 + Float64(-0.125 * Float64(Float64(D * Float64(D / t_0)) * Float64(M * Float64(M * h)))))); end return tmp end
M = abs(M) D = abs(D) d = abs(d) function tmp_2 = code(w0, M, D, h, l, d) t_0 = d * (d * l); tmp = 0.0; if ((M * D) <= 1e-160) tmp = w0; elseif ((M * D) <= 5e+102) tmp = w0 * (1.0 + (-0.125 * (((M * D) ^ 2.0) / (t_0 / h)))); else tmp = w0 * (1.0 + (-0.125 * ((D * (D / t_0)) * (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
code[w0_, M_, D_, h_, l_, d_] := Block[{t$95$0 = N[(d * N[(d * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(M * D), $MachinePrecision], 1e-160], w0, If[LessEqual[N[(M * D), $MachinePrecision], 5e+102], N[(w0 * N[(1.0 + N[(-0.125 * N[(N[Power[N[(M * D), $MachinePrecision], 2.0], $MachinePrecision] / N[(t$95$0 / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(w0 * N[(1.0 + N[(-0.125 * N[(N[(D * N[(D / t$95$0), $MachinePrecision]), $MachinePrecision] * N[(M * N[(M * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
M = |M|\\
D = |D|\\
d = |d|\\
\\
\begin{array}{l}
t_0 := d \cdot \left(d \cdot \ell\right)\\
\mathbf{if}\;M \cdot D \leq 10^{-160}:\\
\;\;\;\;w0\\
\mathbf{elif}\;M \cdot D \leq 5 \cdot 10^{+102}:\\
\;\;\;\;w0 \cdot \left(1 + -0.125 \cdot \frac{{\left(M \cdot D\right)}^{2}}{\frac{t_0}{h}}\right)\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \left(1 + -0.125 \cdot \left(\left(D \cdot \frac{D}{t_0}\right) \cdot \left(M \cdot \left(M \cdot h\right)\right)\right)\right)\\
\end{array}
\end{array}
if (*.f64 M D) < 9.9999999999999999e-161Initial program 86.6%
*-commutative86.6%
times-frac86.6%
Simplified86.6%
Taylor expanded in M around 0 73.6%
if 9.9999999999999999e-161 < (*.f64 M D) < 5e102Initial program 93.7%
*-commutative93.7%
times-frac91.6%
Simplified91.6%
Taylor expanded in M around 0 58.6%
associate-*r/58.6%
*-commutative58.6%
associate-*r/58.6%
*-commutative58.6%
associate-/l*58.6%
unpow258.6%
unpow258.6%
*-commutative58.6%
unpow258.6%
Simplified58.6%
associate-*r*62.7%
associate-/r/62.7%
Applied egg-rr62.7%
Taylor expanded in D around 0 58.6%
*-commutative58.6%
associate-*r*64.8%
*-commutative64.8%
unpow264.8%
unpow264.8%
swap-sqr87.7%
unpow287.7%
*-commutative87.7%
associate-/l*89.8%
*-commutative89.8%
unpow289.8%
associate-*l*90.4%
Simplified90.4%
if 5e102 < (*.f64 M D) Initial program 68.3%
*-commutative68.3%
times-frac68.3%
Simplified68.3%
Taylor expanded in M around 0 39.9%
associate-*r/39.9%
*-commutative39.9%
associate-*r/39.9%
*-commutative39.9%
associate-/l*42.4%
unpow242.4%
unpow242.4%
*-commutative42.4%
unpow242.4%
Simplified42.4%
associate-*r*44.8%
associate-/r/44.7%
Applied egg-rr44.7%
Taylor expanded in D around 0 44.7%
*-commutative44.7%
*-rgt-identity44.7%
unpow244.7%
associate-*r/44.7%
unpow244.7%
associate-*l*54.6%
unpow254.6%
*-commutative54.6%
associate-*r/54.6%
*-commutative54.6%
*-lft-identity54.6%
*-commutative54.6%
unpow254.6%
associate-*l*56.8%
Simplified56.8%
Final simplification74.0%
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 (FPCore (w0 M D h l d) :precision binary64 (if (<= M 2.9e-154) w0 (* w0 (+ 1.0 (* -0.125 (* (* D (/ D (* d (* d l)))) (* M (* M h))))))))
M = abs(M);
D = abs(D);
d = abs(d);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (M <= 2.9e-154) {
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
real(8) function code(w0, m, d, h, l, d_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d_1
real(8) :: tmp
if (m <= 2.9d-154) then
tmp = w0
else
tmp = w0 * (1.0d0 + ((-0.125d0) * ((d * (d / (d_1 * (d_1 * l)))) * (m * (m * h)))))
end if
code = tmp
end function
M = Math.abs(M);
D = Math.abs(D);
d = Math.abs(d);
public static double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (M <= 2.9e-154) {
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) def code(w0, M, D, h, l, d): tmp = 0 if M <= 2.9e-154: 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) function code(w0, M, D, h, l, d) tmp = 0.0 if (M <= 2.9e-154) tmp = w0; else tmp = Float64(w0 * Float64(1.0 + Float64(-0.125 * Float64(Float64(D * Float64(D / Float64(d * Float64(d * l)))) * Float64(M * Float64(M * h)))))); end return tmp end
M = abs(M) D = abs(D) d = abs(d) function tmp_2 = code(w0, M, D, h, l, d) tmp = 0.0; if (M <= 2.9e-154) 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 code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[M, 2.9e-154], w0, N[(w0 * N[(1.0 + N[(-0.125 * N[(N[(D * N[(D / N[(d * N[(d * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(M * N[(M * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
d = |d|\\
\\
\begin{array}{l}
\mathbf{if}\;M \leq 2.9 \cdot 10^{-154}:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \left(1 + -0.125 \cdot \left(\left(D \cdot \frac{D}{d \cdot \left(d \cdot \ell\right)}\right) \cdot \left(M \cdot \left(M \cdot h\right)\right)\right)\right)\\
\end{array}
\end{array}
if M < 2.9e-154Initial program 87.9%
*-commutative87.9%
times-frac87.3%
Simplified87.3%
Taylor expanded in M around 0 72.4%
if 2.9e-154 < M Initial program 79.8%
*-commutative79.8%
times-frac79.8%
Simplified79.8%
Taylor expanded in M around 0 47.0%
associate-*r/47.0%
*-commutative47.0%
associate-*r/47.0%
*-commutative47.0%
associate-/l*48.0%
unpow248.0%
unpow248.0%
*-commutative48.0%
unpow248.0%
Simplified48.0%
associate-*r*56.4%
associate-/r/56.5%
Applied egg-rr56.5%
Taylor expanded in D around 0 56.5%
*-commutative56.5%
*-rgt-identity56.5%
unpow256.5%
associate-*r/56.5%
unpow256.5%
associate-*l*62.2%
unpow262.2%
*-commutative62.2%
associate-*r/62.2%
*-commutative62.2%
*-lft-identity62.2%
*-commutative62.2%
unpow262.2%
associate-*l*63.5%
Simplified63.5%
Final simplification69.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 (FPCore (w0 M D h l d) :precision binary64 (if (<= M 4.2e+72) w0 (* -0.125 (* D (/ (/ D d) (* (/ d w0) (/ l (* h (* M M)))))))))
M = abs(M);
D = abs(D);
d = abs(d);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (M <= 4.2e+72) {
tmp = w0;
} else {
tmp = -0.125 * (D * ((D / d) / ((d / w0) * (l / (h * (M * 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
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 <= 4.2d+72) then
tmp = w0
else
tmp = (-0.125d0) * (d * ((d / d_1) / ((d_1 / w0) * (l / (h * (m * m))))))
end if
code = tmp
end function
M = Math.abs(M);
D = Math.abs(D);
d = Math.abs(d);
public static double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (M <= 4.2e+72) {
tmp = w0;
} else {
tmp = -0.125 * (D * ((D / d) / ((d / w0) * (l / (h * (M * M))))));
}
return tmp;
}
M = abs(M) D = abs(D) d = abs(d) def code(w0, M, D, h, l, d): tmp = 0 if M <= 4.2e+72: tmp = w0 else: tmp = -0.125 * (D * ((D / d) / ((d / w0) * (l / (h * (M * M)))))) return tmp
M = abs(M) D = abs(D) d = abs(d) function code(w0, M, D, h, l, d) tmp = 0.0 if (M <= 4.2e+72) tmp = w0; else tmp = Float64(-0.125 * Float64(D * Float64(Float64(D / d) / Float64(Float64(d / w0) * Float64(l / Float64(h * Float64(M * M))))))); end return tmp end
M = abs(M) D = abs(D) d = abs(d) function tmp_2 = code(w0, M, D, h, l, d) tmp = 0.0; if (M <= 4.2e+72) tmp = w0; else tmp = -0.125 * (D * ((D / d) / ((d / w0) * (l / (h * (M * 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 code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[M, 4.2e+72], w0, N[(-0.125 * N[(D * N[(N[(D / d), $MachinePrecision] / N[(N[(d / w0), $MachinePrecision] * N[(l / N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
d = |d|\\
\\
\begin{array}{l}
\mathbf{if}\;M \leq 4.2 \cdot 10^{+72}:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;-0.125 \cdot \left(D \cdot \frac{\frac{D}{d}}{\frac{d}{w0} \cdot \frac{\ell}{h \cdot \left(M \cdot M\right)}}\right)\\
\end{array}
\end{array}
if M < 4.2000000000000003e72Initial program 88.3%
*-commutative88.3%
times-frac88.3%
Simplified88.3%
Taylor expanded in M around 0 73.5%
if 4.2000000000000003e72 < M Initial program 70.2%
*-commutative70.2%
times-frac68.2%
Simplified68.2%
Taylor expanded in M around 0 24.1%
associate-*r/24.1%
*-commutative24.1%
associate-*r/24.1%
*-commutative24.1%
associate-/l*24.1%
unpow224.1%
unpow224.1%
*-commutative24.1%
unpow224.1%
Simplified24.1%
associate-*r*40.8%
associate-/r/40.8%
Applied egg-rr40.8%
Taylor expanded in D around inf 18.2%
Simplified20.7%
Taylor expanded in l around 0 21.9%
*-commutative21.9%
*-commutative21.9%
times-frac24.0%
*-commutative24.0%
unpow224.0%
Simplified24.0%
Final simplification64.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 (FPCore (w0 M D h l d) :precision binary64 (if (<= M 2.1e+74) w0 (* -0.125 (* D (/ (/ D d) (/ l (* (/ w0 d) (* h (* M M)))))))))
M = abs(M);
D = abs(D);
d = abs(d);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (M <= 2.1e+74) {
tmp = w0;
} else {
tmp = -0.125 * (D * ((D / d) / (l / ((w0 / d) * (h * (M * 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
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.1d+74) then
tmp = w0
else
tmp = (-0.125d0) * (d * ((d / d_1) / (l / ((w0 / d_1) * (h * (m * m))))))
end if
code = tmp
end function
M = Math.abs(M);
D = Math.abs(D);
d = Math.abs(d);
public static double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (M <= 2.1e+74) {
tmp = w0;
} else {
tmp = -0.125 * (D * ((D / d) / (l / ((w0 / d) * (h * (M * M))))));
}
return tmp;
}
M = abs(M) D = abs(D) d = abs(d) def code(w0, M, D, h, l, d): tmp = 0 if M <= 2.1e+74: tmp = w0 else: tmp = -0.125 * (D * ((D / d) / (l / ((w0 / d) * (h * (M * M)))))) return tmp
M = abs(M) D = abs(D) d = abs(d) function code(w0, M, D, h, l, d) tmp = 0.0 if (M <= 2.1e+74) tmp = w0; else tmp = Float64(-0.125 * Float64(D * Float64(Float64(D / d) / Float64(l / Float64(Float64(w0 / d) * Float64(h * Float64(M * M))))))); end return tmp end
M = abs(M) D = abs(D) d = abs(d) function tmp_2 = code(w0, M, D, h, l, d) tmp = 0.0; if (M <= 2.1e+74) tmp = w0; else tmp = -0.125 * (D * ((D / d) / (l / ((w0 / d) * (h * (M * 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 code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[M, 2.1e+74], w0, N[(-0.125 * N[(D * N[(N[(D / d), $MachinePrecision] / N[(l / N[(N[(w0 / d), $MachinePrecision] * N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
d = |d|\\
\\
\begin{array}{l}
\mathbf{if}\;M \leq 2.1 \cdot 10^{+74}:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;-0.125 \cdot \left(D \cdot \frac{\frac{D}{d}}{\frac{\ell}{\frac{w0}{d} \cdot \left(h \cdot \left(M \cdot M\right)\right)}}\right)\\
\end{array}
\end{array}
if M < 2.0999999999999999e74Initial program 88.3%
*-commutative88.3%
times-frac88.3%
Simplified88.3%
Taylor expanded in M around 0 73.5%
if 2.0999999999999999e74 < M Initial program 70.2%
*-commutative70.2%
times-frac68.2%
Simplified68.2%
Taylor expanded in M around 0 24.1%
associate-*r/24.1%
*-commutative24.1%
associate-*r/24.1%
*-commutative24.1%
associate-/l*24.1%
unpow224.1%
unpow224.1%
*-commutative24.1%
unpow224.1%
Simplified24.1%
associate-*r*40.8%
associate-/r/40.8%
Applied egg-rr40.8%
Taylor expanded in D around inf 18.2%
Simplified20.7%
Taylor expanded in w0 around 0 24.3%
associate-/l*24.3%
*-commutative24.3%
unpow224.3%
associate-*r*24.6%
associate-/r/24.6%
associate-*r*24.3%
unpow224.3%
*-commutative24.3%
unpow224.3%
Simplified24.3%
Final simplification64.3%
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 (FPCore (w0 M D h l d) :precision binary64 (if (<= M 9e+72) w0 (* -0.125 (* D (/ (/ D d) (/ l (* M (/ w0 (/ d (* M h))))))))))
M = abs(M);
D = abs(D);
d = abs(d);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (M <= 9e+72) {
tmp = w0;
} else {
tmp = -0.125 * (D * ((D / d) / (l / (M * (w0 / (d / (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
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 <= 9d+72) then
tmp = w0
else
tmp = (-0.125d0) * (d * ((d / d_1) / (l / (m * (w0 / (d_1 / (m * h)))))))
end if
code = tmp
end function
M = Math.abs(M);
D = Math.abs(D);
d = Math.abs(d);
public static double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (M <= 9e+72) {
tmp = w0;
} else {
tmp = -0.125 * (D * ((D / d) / (l / (M * (w0 / (d / (M * h)))))));
}
return tmp;
}
M = abs(M) D = abs(D) d = abs(d) def code(w0, M, D, h, l, d): tmp = 0 if M <= 9e+72: tmp = w0 else: tmp = -0.125 * (D * ((D / d) / (l / (M * (w0 / (d / (M * h))))))) return tmp
M = abs(M) D = abs(D) d = abs(d) function code(w0, M, D, h, l, d) tmp = 0.0 if (M <= 9e+72) tmp = w0; else tmp = Float64(-0.125 * Float64(D * Float64(Float64(D / d) / Float64(l / Float64(M * Float64(w0 / Float64(d / Float64(M * h)))))))); end return tmp end
M = abs(M) D = abs(D) d = abs(d) function tmp_2 = code(w0, M, D, h, l, d) tmp = 0.0; if (M <= 9e+72) tmp = w0; else tmp = -0.125 * (D * ((D / d) / (l / (M * (w0 / (d / (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 code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[M, 9e+72], w0, N[(-0.125 * N[(D * N[(N[(D / d), $MachinePrecision] / N[(l / N[(M * N[(w0 / N[(d / N[(M * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
d = |d|\\
\\
\begin{array}{l}
\mathbf{if}\;M \leq 9 \cdot 10^{+72}:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;-0.125 \cdot \left(D \cdot \frac{\frac{D}{d}}{\frac{\ell}{M \cdot \frac{w0}{\frac{d}{M \cdot h}}}}\right)\\
\end{array}
\end{array}
if M < 8.9999999999999997e72Initial program 88.3%
*-commutative88.3%
times-frac88.3%
Simplified88.3%
Taylor expanded in M around 0 73.5%
if 8.9999999999999997e72 < M Initial program 70.2%
*-commutative70.2%
times-frac68.2%
Simplified68.2%
Taylor expanded in M around 0 24.1%
associate-*r/24.1%
*-commutative24.1%
associate-*r/24.1%
*-commutative24.1%
associate-/l*24.1%
unpow224.1%
unpow224.1%
*-commutative24.1%
unpow224.1%
Simplified24.1%
associate-*r*40.8%
associate-/r/40.8%
Applied egg-rr40.8%
Taylor expanded in D around inf 18.2%
Simplified20.7%
associate-/r/20.7%
associate-/l/24.8%
Applied egg-rr24.8%
Final simplification64.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 (FPCore (w0 M D h l d) :precision binary64 w0)
M = abs(M);
D = abs(D);
d = abs(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
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);
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) def code(w0, M, D, h, l, d): return w0
M = abs(M) D = abs(D) d = abs(d) function code(w0, M, D, h, l, d) return w0 end
M = abs(M) D = abs(D) d = abs(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 code[w0_, M_, D_, h_, l_, d_] := w0
\begin{array}{l}
M = |M|\\
D = |D|\\
d = |d|\\
\\
w0
\end{array}
Initial program 84.9%
*-commutative84.9%
times-frac84.5%
Simplified84.5%
Taylor expanded in M around 0 67.9%
Final simplification67.9%
herbie shell --seed 2023194
(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))))))