
(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}
(FPCore (w0 M D h l d)
:precision binary64
(let* ((t_0 (- 1.0 (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ h l)))))
(if (<= t_0 1e+283)
(* w0 (sqrt t_0))
(*
w0
(sqrt (+ 1.0 (* (* h (pow (* 0.5 (/ M (/ d D))) 2.0)) (/ -1.0 l))))))))
double code(double w0, double M, double D, double h, double l, double d) {
double t_0 = 1.0 - (pow(((M * D) / (2.0 * d)), 2.0) * (h / l));
double tmp;
if (t_0 <= 1e+283) {
tmp = w0 * sqrt(t_0);
} else {
tmp = w0 * sqrt((1.0 + ((h * pow((0.5 * (M / (d / D))), 2.0)) * (-1.0 / l))));
}
return tmp;
}
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 = 1.0d0 - ((((m * d) / (2.0d0 * d_1)) ** 2.0d0) * (h / l))
if (t_0 <= 1d+283) then
tmp = w0 * sqrt(t_0)
else
tmp = w0 * sqrt((1.0d0 + ((h * ((0.5d0 * (m / (d_1 / d))) ** 2.0d0)) * ((-1.0d0) / l))))
end if
code = tmp
end function
public static double code(double w0, double M, double D, double h, double l, double d) {
double t_0 = 1.0 - (Math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l));
double tmp;
if (t_0 <= 1e+283) {
tmp = w0 * Math.sqrt(t_0);
} else {
tmp = w0 * Math.sqrt((1.0 + ((h * Math.pow((0.5 * (M / (d / D))), 2.0)) * (-1.0 / l))));
}
return tmp;
}
def code(w0, M, D, h, l, d): t_0 = 1.0 - (math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l)) tmp = 0 if t_0 <= 1e+283: tmp = w0 * math.sqrt(t_0) else: tmp = w0 * math.sqrt((1.0 + ((h * math.pow((0.5 * (M / (d / D))), 2.0)) * (-1.0 / l)))) return tmp
function code(w0, M, D, h, l, d) t_0 = Float64(1.0 - Float64((Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0) * Float64(h / l))) tmp = 0.0 if (t_0 <= 1e+283) tmp = Float64(w0 * sqrt(t_0)); else tmp = Float64(w0 * sqrt(Float64(1.0 + Float64(Float64(h * (Float64(0.5 * Float64(M / Float64(d / D))) ^ 2.0)) * Float64(-1.0 / l))))); end return tmp end
function tmp_2 = code(w0, M, D, h, l, d) t_0 = 1.0 - ((((M * D) / (2.0 * d)) ^ 2.0) * (h / l)); tmp = 0.0; if (t_0 <= 1e+283) tmp = w0 * sqrt(t_0); else tmp = w0 * sqrt((1.0 + ((h * ((0.5 * (M / (d / D))) ^ 2.0)) * (-1.0 / l)))); end tmp_2 = tmp; end
code[w0_, M_, D_, h_, l_, d_] := Block[{t$95$0 = 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]}, If[LessEqual[t$95$0, 1e+283], N[(w0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(w0 * N[Sqrt[N[(1.0 + N[(N[(h * N[Power[N[(0.5 * N[(M / N[(d / D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(-1.0 / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}\\
\mathbf{if}\;t_0 \leq 10^{+283}:\\
\;\;\;\;w0 \cdot \sqrt{t_0}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{1 + \left(h \cdot {\left(0.5 \cdot \frac{M}{\frac{d}{D}}\right)}^{2}\right) \cdot \frac{-1}{\ell}}\\
\end{array}
\end{array}
if (-.f64 1 (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (/.f64 h l))) < 9.99999999999999955e282Initial program 99.9%
if 9.99999999999999955e282 < (-.f64 1 (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (/.f64 h l))) Initial program 38.1%
times-frac40.7%
Simplified40.7%
associate-*r/64.6%
clear-num64.6%
frac-times60.3%
div-inv60.3%
associate-*l*64.6%
associate-/r*64.6%
metadata-eval64.6%
Applied egg-rr64.6%
associate-/r/64.6%
*-commutative64.6%
*-commutative64.6%
associate-*r*63.3%
associate-*r/63.3%
associate-/r/64.6%
*-commutative64.6%
associate-*r/64.6%
Simplified64.6%
Final simplification89.3%
(FPCore (w0 M D h l d)
:precision binary64
(let* ((t_0 (- 1.0 (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ h l)))))
(if (<= t_0 INFINITY)
(* w0 (sqrt t_0))
(* w0 (+ 1.0 (* (/ (* D (* (/ D d) (* M (* h (/ M d))))) l) -0.125))))))
double code(double w0, double M, double D, double h, double l, double d) {
double t_0 = 1.0 - (pow(((M * D) / (2.0 * d)), 2.0) * (h / l));
double tmp;
if (t_0 <= ((double) INFINITY)) {
tmp = w0 * sqrt(t_0);
} else {
tmp = w0 * (1.0 + (((D * ((D / d) * (M * (h * (M / d))))) / l) * -0.125));
}
return tmp;
}
public static double code(double w0, double M, double D, double h, double l, double d) {
double t_0 = 1.0 - (Math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l));
double tmp;
if (t_0 <= Double.POSITIVE_INFINITY) {
tmp = w0 * Math.sqrt(t_0);
} else {
tmp = w0 * (1.0 + (((D * ((D / d) * (M * (h * (M / d))))) / l) * -0.125));
}
return tmp;
}
def code(w0, M, D, h, l, d): t_0 = 1.0 - (math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l)) tmp = 0 if t_0 <= math.inf: tmp = w0 * math.sqrt(t_0) else: tmp = w0 * (1.0 + (((D * ((D / d) * (M * (h * (M / d))))) / l) * -0.125)) return tmp
function code(w0, M, D, h, l, d) t_0 = Float64(1.0 - Float64((Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0) * Float64(h / l))) tmp = 0.0 if (t_0 <= Inf) tmp = Float64(w0 * sqrt(t_0)); else tmp = Float64(w0 * Float64(1.0 + Float64(Float64(Float64(D * Float64(Float64(D / d) * Float64(M * Float64(h * Float64(M / d))))) / l) * -0.125))); end return tmp end
function tmp_2 = code(w0, M, D, h, l, d) t_0 = 1.0 - ((((M * D) / (2.0 * d)) ^ 2.0) * (h / l)); tmp = 0.0; if (t_0 <= Inf) tmp = w0 * sqrt(t_0); else tmp = w0 * (1.0 + (((D * ((D / d) * (M * (h * (M / d))))) / l) * -0.125)); end tmp_2 = tmp; end
code[w0_, M_, D_, h_, l_, d_] := Block[{t$95$0 = 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]}, If[LessEqual[t$95$0, Infinity], N[(w0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(w0 * N[(1.0 + N[(N[(N[(D * N[(N[(D / d), $MachinePrecision] * N[(M * N[(h * N[(M / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}\\
\mathbf{if}\;t_0 \leq \infty:\\
\;\;\;\;w0 \cdot \sqrt{t_0}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \left(1 + \frac{D \cdot \left(\frac{D}{d} \cdot \left(M \cdot \left(h \cdot \frac{M}{d}\right)\right)\right)}{\ell} \cdot -0.125\right)\\
\end{array}
\end{array}
if (-.f64 1 (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (/.f64 h l))) < +inf.0Initial program 89.3%
if +inf.0 < (-.f64 1 (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (/.f64 h l))) Initial program 0.0%
times-frac4.5%
Simplified4.5%
Taylor expanded in M around 0 41.1%
associate-*r/41.1%
*-commutative41.1%
associate-*r/41.1%
*-commutative41.1%
times-frac44.1%
unpow244.1%
*-commutative44.1%
unpow244.1%
unpow244.1%
Simplified44.1%
div-inv40.0%
*-commutative40.0%
Applied egg-rr40.0%
Taylor expanded in D around 0 41.1%
unpow241.1%
*-commutative41.1%
times-frac44.1%
associate-*l/44.3%
unpow244.3%
*-commutative44.3%
associate-*r*48.5%
unpow248.5%
associate-*l*59.1%
times-frac67.8%
associate-*r*73.2%
associate-*r/72.8%
associate-/l*73.2%
associate-/r/77.6%
associate-/l*72.9%
Simplified72.9%
associate-*l/81.6%
associate-*l*72.1%
associate-/r/76.8%
Applied egg-rr76.8%
Final simplification88.2%
(FPCore (w0 M D h l d)
:precision binary64
(let* ((t_0 (- 1.0 (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ h l)))))
(if (<= t_0 1e+283)
(* w0 (sqrt t_0))
(* w0 (sqrt (- 1.0 (/ (* h (* 0.25 (pow (* D (/ M d)) 2.0))) l)))))))
double code(double w0, double M, double D, double h, double l, double d) {
double t_0 = 1.0 - (pow(((M * D) / (2.0 * d)), 2.0) * (h / l));
double tmp;
if (t_0 <= 1e+283) {
tmp = w0 * sqrt(t_0);
} else {
tmp = w0 * sqrt((1.0 - ((h * (0.25 * pow((D * (M / d)), 2.0))) / l)));
}
return tmp;
}
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 = 1.0d0 - ((((m * d) / (2.0d0 * d_1)) ** 2.0d0) * (h / l))
if (t_0 <= 1d+283) then
tmp = w0 * sqrt(t_0)
else
tmp = w0 * sqrt((1.0d0 - ((h * (0.25d0 * ((d * (m / d_1)) ** 2.0d0))) / l)))
end if
code = tmp
end function
public static double code(double w0, double M, double D, double h, double l, double d) {
double t_0 = 1.0 - (Math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l));
double tmp;
if (t_0 <= 1e+283) {
tmp = w0 * Math.sqrt(t_0);
} else {
tmp = w0 * Math.sqrt((1.0 - ((h * (0.25 * Math.pow((D * (M / d)), 2.0))) / l)));
}
return tmp;
}
def code(w0, M, D, h, l, d): t_0 = 1.0 - (math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l)) tmp = 0 if t_0 <= 1e+283: tmp = w0 * math.sqrt(t_0) else: tmp = w0 * math.sqrt((1.0 - ((h * (0.25 * math.pow((D * (M / d)), 2.0))) / l))) return tmp
function code(w0, M, D, h, l, d) t_0 = Float64(1.0 - Float64((Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0) * Float64(h / l))) tmp = 0.0 if (t_0 <= 1e+283) tmp = Float64(w0 * sqrt(t_0)); else tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(h * Float64(0.25 * (Float64(D * Float64(M / d)) ^ 2.0))) / l)))); end return tmp end
function tmp_2 = code(w0, M, D, h, l, d) t_0 = 1.0 - ((((M * D) / (2.0 * d)) ^ 2.0) * (h / l)); tmp = 0.0; if (t_0 <= 1e+283) tmp = w0 * sqrt(t_0); else tmp = w0 * sqrt((1.0 - ((h * (0.25 * ((D * (M / d)) ^ 2.0))) / l))); end tmp_2 = tmp; end
code[w0_, M_, D_, h_, l_, d_] := Block[{t$95$0 = 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]}, If[LessEqual[t$95$0, 1e+283], N[(w0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(w0 * N[Sqrt[N[(1.0 - N[(N[(h * N[(0.25 * N[Power[N[(D * N[(M / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}\\
\mathbf{if}\;t_0 \leq 10^{+283}:\\
\;\;\;\;w0 \cdot \sqrt{t_0}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{h \cdot \left(0.25 \cdot {\left(D \cdot \frac{M}{d}\right)}^{2}\right)}{\ell}}\\
\end{array}
\end{array}
if (-.f64 1 (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (/.f64 h l))) < 9.99999999999999955e282Initial program 99.9%
if 9.99999999999999955e282 < (-.f64 1 (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (/.f64 h l))) Initial program 38.1%
times-frac40.7%
Simplified40.7%
associate-*r/64.6%
clear-num64.6%
frac-times60.3%
div-inv60.3%
associate-*l*64.6%
associate-/r*64.6%
metadata-eval64.6%
Applied egg-rr64.6%
associate-/r/64.6%
*-commutative64.6%
*-commutative64.6%
associate-*r*63.3%
associate-*r/63.3%
associate-/r/64.6%
*-commutative64.6%
associate-*r/64.6%
Simplified64.6%
associate-*l/64.6%
*-un-lft-identity64.6%
unpow-prod-down64.6%
metadata-eval64.6%
associate-/r/63.3%
Applied egg-rr63.3%
Final simplification88.9%
(FPCore (w0 M D h l d)
:precision binary64
(let* ((t_0 (- 1.0 (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ h l)))))
(if (<= t_0 1e+283)
(* w0 (sqrt t_0))
(* w0 (sqrt (- 1.0 (/ (* h (pow (* M (* D (/ 0.5 d))) 2.0)) l)))))))
double code(double w0, double M, double D, double h, double l, double d) {
double t_0 = 1.0 - (pow(((M * D) / (2.0 * d)), 2.0) * (h / l));
double tmp;
if (t_0 <= 1e+283) {
tmp = w0 * sqrt(t_0);
} else {
tmp = w0 * sqrt((1.0 - ((h * pow((M * (D * (0.5 / d))), 2.0)) / l)));
}
return tmp;
}
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 = 1.0d0 - ((((m * d) / (2.0d0 * d_1)) ** 2.0d0) * (h / l))
if (t_0 <= 1d+283) then
tmp = w0 * sqrt(t_0)
else
tmp = w0 * sqrt((1.0d0 - ((h * ((m * (d * (0.5d0 / d_1))) ** 2.0d0)) / l)))
end if
code = tmp
end function
public static double code(double w0, double M, double D, double h, double l, double d) {
double t_0 = 1.0 - (Math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l));
double tmp;
if (t_0 <= 1e+283) {
tmp = w0 * Math.sqrt(t_0);
} else {
tmp = w0 * Math.sqrt((1.0 - ((h * Math.pow((M * (D * (0.5 / d))), 2.0)) / l)));
}
return tmp;
}
def code(w0, M, D, h, l, d): t_0 = 1.0 - (math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l)) tmp = 0 if t_0 <= 1e+283: tmp = w0 * math.sqrt(t_0) else: tmp = w0 * math.sqrt((1.0 - ((h * math.pow((M * (D * (0.5 / d))), 2.0)) / l))) return tmp
function code(w0, M, D, h, l, d) t_0 = Float64(1.0 - Float64((Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0) * Float64(h / l))) tmp = 0.0 if (t_0 <= 1e+283) tmp = Float64(w0 * sqrt(t_0)); else tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(h * (Float64(M * Float64(D * Float64(0.5 / d))) ^ 2.0)) / l)))); end return tmp end
function tmp_2 = code(w0, M, D, h, l, d) t_0 = 1.0 - ((((M * D) / (2.0 * d)) ^ 2.0) * (h / l)); tmp = 0.0; if (t_0 <= 1e+283) tmp = w0 * sqrt(t_0); else tmp = w0 * sqrt((1.0 - ((h * ((M * (D * (0.5 / d))) ^ 2.0)) / l))); end tmp_2 = tmp; end
code[w0_, M_, D_, h_, l_, d_] := Block[{t$95$0 = 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]}, If[LessEqual[t$95$0, 1e+283], N[(w0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(w0 * N[Sqrt[N[(1.0 - N[(N[(h * N[Power[N[(M * N[(D * N[(0.5 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}\\
\mathbf{if}\;t_0 \leq 10^{+283}:\\
\;\;\;\;w0 \cdot \sqrt{t_0}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{h \cdot {\left(M \cdot \left(D \cdot \frac{0.5}{d}\right)\right)}^{2}}{\ell}}\\
\end{array}
\end{array}
if (-.f64 1 (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (/.f64 h l))) < 9.99999999999999955e282Initial program 99.9%
if 9.99999999999999955e282 < (-.f64 1 (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (/.f64 h l))) Initial program 38.1%
times-frac40.7%
Simplified40.7%
unpow240.7%
unpow240.7%
frac-times38.1%
associate-*r/60.3%
frac-times64.6%
unpow264.6%
unpow264.6%
frac-times60.3%
div-inv60.3%
associate-*l*64.6%
associate-/r*64.6%
metadata-eval64.6%
Applied egg-rr64.6%
Final simplification89.3%
(FPCore (w0 M D h l d)
:precision binary64
(if (<= (/ h l) (- INFINITY))
(* w0 (sqrt (- 1.0 (* 0.25 (* (* (/ D d) (/ D d)) (/ (* M (* M h)) l))))))
(if (<= (/ h l) -1e-270)
(* w0 (sqrt (- 1.0 (* (/ h l) (pow (* (/ D d) (/ M 2.0)) 2.0)))))
w0)))
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if ((h / l) <= -((double) INFINITY)) {
tmp = w0 * sqrt((1.0 - (0.25 * (((D / d) * (D / d)) * ((M * (M * h)) / l)))));
} else if ((h / l) <= -1e-270) {
tmp = w0 * sqrt((1.0 - ((h / l) * pow(((D / d) * (M / 2.0)), 2.0))));
} else {
tmp = w0;
}
return tmp;
}
public static double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if ((h / l) <= -Double.POSITIVE_INFINITY) {
tmp = w0 * Math.sqrt((1.0 - (0.25 * (((D / d) * (D / d)) * ((M * (M * h)) / l)))));
} else if ((h / l) <= -1e-270) {
tmp = w0 * Math.sqrt((1.0 - ((h / l) * Math.pow(((D / d) * (M / 2.0)), 2.0))));
} else {
tmp = w0;
}
return tmp;
}
def code(w0, M, D, h, l, d): tmp = 0 if (h / l) <= -math.inf: tmp = w0 * math.sqrt((1.0 - (0.25 * (((D / d) * (D / d)) * ((M * (M * h)) / l))))) elif (h / l) <= -1e-270: tmp = w0 * math.sqrt((1.0 - ((h / l) * math.pow(((D / d) * (M / 2.0)), 2.0)))) else: tmp = w0 return tmp
function code(w0, M, D, h, l, d) tmp = 0.0 if (Float64(h / l) <= Float64(-Inf)) tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(0.25 * Float64(Float64(Float64(D / d) * Float64(D / d)) * Float64(Float64(M * Float64(M * h)) / l)))))); elseif (Float64(h / l) <= -1e-270) tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(h / l) * (Float64(Float64(D / d) * Float64(M / 2.0)) ^ 2.0))))); else tmp = w0; end return tmp end
function tmp_2 = code(w0, M, D, h, l, d) tmp = 0.0; if ((h / l) <= -Inf) tmp = w0 * sqrt((1.0 - (0.25 * (((D / d) * (D / d)) * ((M * (M * h)) / l))))); elseif ((h / l) <= -1e-270) tmp = w0 * sqrt((1.0 - ((h / l) * (((D / d) * (M / 2.0)) ^ 2.0)))); else tmp = w0; end tmp_2 = tmp; end
code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[N[(h / l), $MachinePrecision], (-Infinity)], N[(w0 * N[Sqrt[N[(1.0 - N[(0.25 * N[(N[(N[(D / d), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision] * N[(N[(M * N[(M * h), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(h / l), $MachinePrecision], -1e-270], N[(w0 * N[Sqrt[N[(1.0 - N[(N[(h / l), $MachinePrecision] * N[Power[N[(N[(D / d), $MachinePrecision] * N[(M / 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], w0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{h}{\ell} \leq -\infty:\\
\;\;\;\;w0 \cdot \sqrt{1 - 0.25 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \frac{M \cdot \left(M \cdot h\right)}{\ell}\right)}\\
\mathbf{elif}\;\frac{h}{\ell} \leq -1 \cdot 10^{-270}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{h}{\ell} \cdot {\left(\frac{D}{d} \cdot \frac{M}{2}\right)}^{2}}\\
\mathbf{else}:\\
\;\;\;\;w0\\
\end{array}
\end{array}
if (/.f64 h l) < -inf.0Initial program 40.4%
times-frac40.5%
Simplified40.5%
Taylor expanded in M around 0 35.0%
*-commutative35.0%
times-frac44.1%
*-commutative44.1%
unpow244.1%
unpow244.1%
times-frac70.3%
unpow270.3%
*-commutative70.3%
unpow270.3%
associate-*l*74.5%
Simplified74.5%
unpow274.5%
Applied egg-rr74.5%
if -inf.0 < (/.f64 h l) < -1e-270Initial program 85.1%
times-frac85.2%
Simplified85.2%
if -1e-270 < (/.f64 h l) Initial program 85.6%
times-frac85.6%
Simplified85.6%
Taylor expanded in M around 0 94.9%
Final simplification88.4%
(FPCore (w0 M D h l d)
:precision binary64
(if (<= (/ h l) (- INFINITY))
(* w0 (sqrt (- 1.0 (* 0.25 (* (* (/ D d) (/ D d)) (/ (* M (* M h)) l))))))
(if (<= (/ h l) -1e-308)
(* w0 (sqrt (- 1.0 (* (/ h l) (pow (* (/ M d) (/ D 2.0)) 2.0)))))
(* w0 (+ 1.0 (* (/ (* D (* (/ D d) (* M (* h (/ M d))))) l) -0.125))))))
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if ((h / l) <= -((double) INFINITY)) {
tmp = w0 * sqrt((1.0 - (0.25 * (((D / d) * (D / d)) * ((M * (M * h)) / l)))));
} else if ((h / l) <= -1e-308) {
tmp = w0 * sqrt((1.0 - ((h / l) * pow(((M / d) * (D / 2.0)), 2.0))));
} else {
tmp = w0 * (1.0 + (((D * ((D / d) * (M * (h * (M / d))))) / l) * -0.125));
}
return tmp;
}
public static double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if ((h / l) <= -Double.POSITIVE_INFINITY) {
tmp = w0 * Math.sqrt((1.0 - (0.25 * (((D / d) * (D / d)) * ((M * (M * h)) / l)))));
} else if ((h / l) <= -1e-308) {
tmp = w0 * Math.sqrt((1.0 - ((h / l) * Math.pow(((M / d) * (D / 2.0)), 2.0))));
} else {
tmp = w0 * (1.0 + (((D * ((D / d) * (M * (h * (M / d))))) / l) * -0.125));
}
return tmp;
}
def code(w0, M, D, h, l, d): tmp = 0 if (h / l) <= -math.inf: tmp = w0 * math.sqrt((1.0 - (0.25 * (((D / d) * (D / d)) * ((M * (M * h)) / l))))) elif (h / l) <= -1e-308: tmp = w0 * math.sqrt((1.0 - ((h / l) * math.pow(((M / d) * (D / 2.0)), 2.0)))) else: tmp = w0 * (1.0 + (((D * ((D / d) * (M * (h * (M / d))))) / l) * -0.125)) return tmp
function code(w0, M, D, h, l, d) tmp = 0.0 if (Float64(h / l) <= Float64(-Inf)) tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(0.25 * Float64(Float64(Float64(D / d) * Float64(D / d)) * Float64(Float64(M * Float64(M * h)) / l)))))); elseif (Float64(h / l) <= -1e-308) tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(h / l) * (Float64(Float64(M / d) * Float64(D / 2.0)) ^ 2.0))))); else tmp = Float64(w0 * Float64(1.0 + Float64(Float64(Float64(D * Float64(Float64(D / d) * Float64(M * Float64(h * Float64(M / d))))) / l) * -0.125))); end return tmp end
function tmp_2 = code(w0, M, D, h, l, d) tmp = 0.0; if ((h / l) <= -Inf) tmp = w0 * sqrt((1.0 - (0.25 * (((D / d) * (D / d)) * ((M * (M * h)) / l))))); elseif ((h / l) <= -1e-308) tmp = w0 * sqrt((1.0 - ((h / l) * (((M / d) * (D / 2.0)) ^ 2.0)))); else tmp = w0 * (1.0 + (((D * ((D / d) * (M * (h * (M / d))))) / l) * -0.125)); end tmp_2 = tmp; end
code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[N[(h / l), $MachinePrecision], (-Infinity)], N[(w0 * N[Sqrt[N[(1.0 - N[(0.25 * N[(N[(N[(D / d), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision] * N[(N[(M * N[(M * h), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(h / l), $MachinePrecision], -1e-308], 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[(w0 * N[(1.0 + N[(N[(N[(D * N[(N[(D / d), $MachinePrecision] * N[(M * N[(h * N[(M / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{h}{\ell} \leq -\infty:\\
\;\;\;\;w0 \cdot \sqrt{1 - 0.25 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \frac{M \cdot \left(M \cdot h\right)}{\ell}\right)}\\
\mathbf{elif}\;\frac{h}{\ell} \leq -1 \cdot 10^{-308}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{h}{\ell} \cdot {\left(\frac{M}{d} \cdot \frac{D}{2}\right)}^{2}}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \left(1 + \frac{D \cdot \left(\frac{D}{d} \cdot \left(M \cdot \left(h \cdot \frac{M}{d}\right)\right)\right)}{\ell} \cdot -0.125\right)\\
\end{array}
\end{array}
if (/.f64 h l) < -inf.0Initial program 40.4%
times-frac40.5%
Simplified40.5%
Taylor expanded in M around 0 35.0%
*-commutative35.0%
times-frac44.1%
*-commutative44.1%
unpow244.1%
unpow244.1%
times-frac70.3%
unpow270.3%
*-commutative70.3%
unpow270.3%
associate-*l*74.5%
Simplified74.5%
unpow274.5%
Applied egg-rr74.5%
if -inf.0 < (/.f64 h l) < -9.9999999999999991e-309Initial program 85.5%
*-commutative85.5%
times-frac83.2%
Simplified83.2%
if -9.9999999999999991e-309 < (/.f64 h l) Initial program 85.2%
times-frac85.2%
Simplified85.2%
Taylor expanded in M around 0 64.1%
associate-*r/64.1%
*-commutative64.1%
associate-*r/64.1%
*-commutative64.1%
times-frac60.3%
unpow260.3%
*-commutative60.3%
unpow260.3%
unpow260.3%
Simplified60.3%
div-inv59.4%
*-commutative59.4%
Applied egg-rr59.4%
Taylor expanded in D around 0 64.1%
unpow264.1%
*-commutative64.1%
times-frac60.3%
associate-*l/63.1%
unpow263.1%
*-commutative63.1%
associate-*r*69.5%
unpow269.5%
associate-*l*75.5%
times-frac85.7%
associate-*r*88.7%
associate-*r/88.6%
associate-/l*88.7%
associate-/r/88.6%
associate-/l*88.7%
Simplified88.7%
associate-*l/93.3%
associate-*l*87.5%
associate-/r/89.4%
Applied egg-rr89.4%
Final simplification85.0%
(FPCore (w0 M D h l d) :precision binary64 (if (<= M 5e-84) (* w0 (+ 1.0 (* -0.125 (* h (/ (pow (* D (/ M d)) 2.0) l))))) (* w0 (sqrt (- 1.0 (* 0.25 (* (* (/ D d) (/ D d)) (/ (* M (* M h)) l))))))))
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (M <= 5e-84) {
tmp = w0 * (1.0 + (-0.125 * (h * (pow((D * (M / d)), 2.0) / l))));
} else {
tmp = w0 * sqrt((1.0 - (0.25 * (((D / d) * (D / d)) * ((M * (M * h)) / l)))));
}
return tmp;
}
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 <= 5d-84) then
tmp = w0 * (1.0d0 + ((-0.125d0) * (h * (((d * (m / d_1)) ** 2.0d0) / l))))
else
tmp = w0 * sqrt((1.0d0 - (0.25d0 * (((d / d_1) * (d / d_1)) * ((m * (m * h)) / l)))))
end if
code = tmp
end function
public static double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (M <= 5e-84) {
tmp = w0 * (1.0 + (-0.125 * (h * (Math.pow((D * (M / d)), 2.0) / l))));
} else {
tmp = w0 * Math.sqrt((1.0 - (0.25 * (((D / d) * (D / d)) * ((M * (M * h)) / l)))));
}
return tmp;
}
def code(w0, M, D, h, l, d): tmp = 0 if M <= 5e-84: tmp = w0 * (1.0 + (-0.125 * (h * (math.pow((D * (M / d)), 2.0) / l)))) else: tmp = w0 * math.sqrt((1.0 - (0.25 * (((D / d) * (D / d)) * ((M * (M * h)) / l))))) return tmp
function code(w0, M, D, h, l, d) tmp = 0.0 if (M <= 5e-84) tmp = Float64(w0 * Float64(1.0 + Float64(-0.125 * Float64(h * Float64((Float64(D * Float64(M / d)) ^ 2.0) / l))))); else tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(0.25 * Float64(Float64(Float64(D / d) * Float64(D / d)) * Float64(Float64(M * Float64(M * h)) / l)))))); end return tmp end
function tmp_2 = code(w0, M, D, h, l, d) tmp = 0.0; if (M <= 5e-84) tmp = w0 * (1.0 + (-0.125 * (h * (((D * (M / d)) ^ 2.0) / l)))); else tmp = w0 * sqrt((1.0 - (0.25 * (((D / d) * (D / d)) * ((M * (M * h)) / l))))); end tmp_2 = tmp; end
code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[M, 5e-84], N[(w0 * N[(1.0 + N[(-0.125 * N[(h * N[(N[Power[N[(D * N[(M / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(w0 * N[Sqrt[N[(1.0 - N[(0.25 * N[(N[(N[(D / d), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision] * N[(N[(M * N[(M * h), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;M \leq 5 \cdot 10^{-84}:\\
\;\;\;\;w0 \cdot \left(1 + -0.125 \cdot \left(h \cdot \frac{{\left(D \cdot \frac{M}{d}\right)}^{2}}{\ell}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{1 - 0.25 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \frac{M \cdot \left(M \cdot h\right)}{\ell}\right)}\\
\end{array}
\end{array}
if M < 5.0000000000000002e-84Initial program 80.7%
times-frac80.7%
Simplified80.7%
Taylor expanded in M around 0 57.7%
associate-*r/57.7%
*-commutative57.7%
associate-*r/57.7%
*-commutative57.7%
times-frac57.8%
unpow257.8%
*-commutative57.8%
unpow257.8%
unpow257.8%
Simplified57.8%
Taylor expanded in D around 0 57.7%
times-frac61.3%
unpow261.3%
unpow261.3%
times-frac69.8%
unpow269.8%
unpow269.8%
associate-/l*65.6%
associate-*r/67.3%
unpow267.3%
swap-sqr76.3%
*-commutative76.3%
associate-*r/75.8%
associate-*l/75.2%
*-commutative75.2%
associate-*r/75.2%
associate-*l/75.7%
unpow275.7%
*-commutative75.7%
Simplified75.7%
associate-/r/81.6%
Applied egg-rr81.6%
if 5.0000000000000002e-84 < M Initial program 82.7%
times-frac82.9%
Simplified82.9%
Taylor expanded in M around 0 48.9%
*-commutative48.9%
times-frac47.6%
*-commutative47.6%
unpow247.6%
unpow247.6%
times-frac62.7%
unpow262.7%
*-commutative62.7%
unpow262.7%
associate-*l*74.7%
Simplified74.7%
unpow274.7%
Applied egg-rr74.7%
Final simplification79.6%
(FPCore (w0 M D h l d) :precision binary64 (* w0 (+ 1.0 (* -0.125 (* h (/ (pow (* D (/ M d)) 2.0) l))))))
double code(double w0, double M, double D, double h, double l, double d) {
return w0 * (1.0 + (-0.125 * (h * (pow((D * (M / d)), 2.0) / 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 * (1.0d0 + ((-0.125d0) * (h * (((d * (m / d_1)) ** 2.0d0) / l))))
end function
public static double code(double w0, double M, double D, double h, double l, double d) {
return w0 * (1.0 + (-0.125 * (h * (Math.pow((D * (M / d)), 2.0) / l))));
}
def code(w0, M, D, h, l, d): return w0 * (1.0 + (-0.125 * (h * (math.pow((D * (M / d)), 2.0) / l))))
function code(w0, M, D, h, l, d) return Float64(w0 * Float64(1.0 + Float64(-0.125 * Float64(h * Float64((Float64(D * Float64(M / d)) ^ 2.0) / l))))) end
function tmp = code(w0, M, D, h, l, d) tmp = w0 * (1.0 + (-0.125 * (h * (((D * (M / d)) ^ 2.0) / l)))); end
code[w0_, M_, D_, h_, l_, d_] := N[(w0 * N[(1.0 + N[(-0.125 * N[(h * N[(N[Power[N[(D * N[(M / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
w0 \cdot \left(1 + -0.125 \cdot \left(h \cdot \frac{{\left(D \cdot \frac{M}{d}\right)}^{2}}{\ell}\right)\right)
\end{array}
Initial program 81.3%
times-frac81.4%
Simplified81.4%
Taylor expanded in M around 0 54.3%
associate-*r/54.3%
*-commutative54.3%
associate-*r/54.3%
*-commutative54.3%
times-frac53.5%
unpow253.5%
*-commutative53.5%
unpow253.5%
unpow253.5%
Simplified53.5%
Taylor expanded in D around 0 54.3%
times-frac56.0%
unpow256.0%
unpow256.0%
times-frac65.0%
unpow265.0%
unpow265.0%
associate-/l*62.0%
associate-*r/64.4%
unpow264.4%
swap-sqr74.8%
*-commutative74.8%
associate-*r/74.4%
associate-*l/73.9%
*-commutative73.9%
associate-*r/73.9%
associate-*l/74.3%
unpow274.3%
*-commutative74.3%
Simplified74.3%
associate-/r/79.3%
Applied egg-rr79.3%
Final simplification79.3%
(FPCore (w0 M D h l d) :precision binary64 (if (<= M 9e-128) w0 (* w0 (+ 1.0 (* -0.125 (* (/ D l) (* (* M (/ D d)) (/ M (/ d h)))))))))
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (M <= 9e-128) {
tmp = w0;
} else {
tmp = w0 * (1.0 + (-0.125 * ((D / l) * ((M * (D / d)) * (M / (d / h))))));
}
return tmp;
}
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-128) then
tmp = w0
else
tmp = w0 * (1.0d0 + ((-0.125d0) * ((d / l) * ((m * (d / d_1)) * (m / (d_1 / h))))))
end if
code = tmp
end function
public static double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (M <= 9e-128) {
tmp = w0;
} else {
tmp = w0 * (1.0 + (-0.125 * ((D / l) * ((M * (D / d)) * (M / (d / h))))));
}
return tmp;
}
def code(w0, M, D, h, l, d): tmp = 0 if M <= 9e-128: tmp = w0 else: tmp = w0 * (1.0 + (-0.125 * ((D / l) * ((M * (D / d)) * (M / (d / h)))))) return tmp
function code(w0, M, D, h, l, d) tmp = 0.0 if (M <= 9e-128) tmp = w0; else tmp = Float64(w0 * Float64(1.0 + Float64(-0.125 * Float64(Float64(D / l) * Float64(Float64(M * Float64(D / d)) * Float64(M / Float64(d / h))))))); end return tmp end
function tmp_2 = code(w0, M, D, h, l, d) tmp = 0.0; if (M <= 9e-128) tmp = w0; else tmp = w0 * (1.0 + (-0.125 * ((D / l) * ((M * (D / d)) * (M / (d / h)))))); end tmp_2 = tmp; end
code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[M, 9e-128], w0, N[(w0 * N[(1.0 + N[(-0.125 * N[(N[(D / l), $MachinePrecision] * N[(N[(M * N[(D / d), $MachinePrecision]), $MachinePrecision] * N[(M / N[(d / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;M \leq 9 \cdot 10^{-128}:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \left(1 + -0.125 \cdot \left(\frac{D}{\ell} \cdot \left(\left(M \cdot \frac{D}{d}\right) \cdot \frac{M}{\frac{d}{h}}\right)\right)\right)\\
\end{array}
\end{array}
if M < 8.9999999999999998e-128Initial program 80.6%
times-frac80.6%
Simplified80.6%
Taylor expanded in M around 0 73.2%
if 8.9999999999999998e-128 < M Initial program 82.5%
times-frac82.7%
Simplified82.7%
Taylor expanded in M around 0 49.9%
associate-*r/49.9%
*-commutative49.9%
associate-*r/49.9%
*-commutative49.9%
times-frac47.7%
unpow247.7%
*-commutative47.7%
unpow247.7%
unpow247.7%
Simplified47.7%
div-inv46.7%
*-commutative46.7%
Applied egg-rr46.7%
Taylor expanded in D around 0 49.9%
unpow249.9%
*-commutative49.9%
times-frac47.7%
associate-*l/49.1%
unpow249.1%
*-commutative49.1%
associate-*r*54.6%
unpow254.6%
associate-*l*60.5%
times-frac67.3%
associate-*r*71.7%
associate-*r/72.7%
associate-/l*71.7%
associate-/r/72.7%
associate-/l*71.6%
Simplified71.6%
Final simplification72.7%
(FPCore (w0 M D h l d) :precision binary64 (if (<= M 2.5e-201) w0 (* w0 (+ 1.0 (* (/ (* D (* (/ D d) (* M (* h (/ M d))))) l) -0.125)))))
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (M <= 2.5e-201) {
tmp = w0;
} else {
tmp = w0 * (1.0 + (((D * ((D / d) * (M * (h * (M / d))))) / l) * -0.125));
}
return tmp;
}
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.5d-201) then
tmp = w0
else
tmp = w0 * (1.0d0 + (((d * ((d / d_1) * (m * (h * (m / d_1))))) / l) * (-0.125d0)))
end if
code = tmp
end function
public static double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (M <= 2.5e-201) {
tmp = w0;
} else {
tmp = w0 * (1.0 + (((D * ((D / d) * (M * (h * (M / d))))) / l) * -0.125));
}
return tmp;
}
def code(w0, M, D, h, l, d): tmp = 0 if M <= 2.5e-201: tmp = w0 else: tmp = w0 * (1.0 + (((D * ((D / d) * (M * (h * (M / d))))) / l) * -0.125)) return tmp
function code(w0, M, D, h, l, d) tmp = 0.0 if (M <= 2.5e-201) tmp = w0; else tmp = Float64(w0 * Float64(1.0 + Float64(Float64(Float64(D * Float64(Float64(D / d) * Float64(M * Float64(h * Float64(M / d))))) / l) * -0.125))); end return tmp end
function tmp_2 = code(w0, M, D, h, l, d) tmp = 0.0; if (M <= 2.5e-201) tmp = w0; else tmp = w0 * (1.0 + (((D * ((D / d) * (M * (h * (M / d))))) / l) * -0.125)); end tmp_2 = tmp; end
code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[M, 2.5e-201], w0, N[(w0 * N[(1.0 + N[(N[(N[(D * N[(N[(D / d), $MachinePrecision] * N[(M * N[(h * N[(M / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;M \leq 2.5 \cdot 10^{-201}:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \left(1 + \frac{D \cdot \left(\frac{D}{d} \cdot \left(M \cdot \left(h \cdot \frac{M}{d}\right)\right)\right)}{\ell} \cdot -0.125\right)\\
\end{array}
\end{array}
if M < 2.5e-201Initial program 80.4%
times-frac80.4%
Simplified80.4%
Taylor expanded in M around 0 73.3%
if 2.5e-201 < M Initial program 82.6%
times-frac82.7%
Simplified82.7%
Taylor expanded in M around 0 50.4%
associate-*r/50.4%
*-commutative50.4%
associate-*r/50.4%
*-commutative50.4%
times-frac50.5%
unpow250.5%
*-commutative50.5%
unpow250.5%
unpow250.5%
Simplified50.5%
div-inv49.6%
*-commutative49.6%
Applied egg-rr49.6%
Taylor expanded in D around 0 50.4%
unpow250.4%
*-commutative50.4%
times-frac50.5%
associate-*l/51.6%
unpow251.6%
*-commutative51.6%
associate-*r*56.3%
unpow256.3%
associate-*l*61.2%
times-frac68.1%
associate-*r*71.8%
associate-*r/72.7%
associate-/l*71.8%
associate-/r/72.7%
associate-/l*71.7%
Simplified71.7%
associate-*l/74.7%
associate-*l*71.0%
associate-/r/72.9%
Applied egg-rr72.9%
Final simplification73.1%
(FPCore (w0 M D h l d) :precision binary64 (if (<= M 3e+74) w0 (* -0.125 (* (* D (/ D l)) (* (/ h d) (* M (* M (/ w0 d))))))))
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (M <= 3e+74) {
tmp = w0;
} else {
tmp = -0.125 * ((D * (D / l)) * ((h / d) * (M * (M * (w0 / d)))));
}
return tmp;
}
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 <= 3d+74) then
tmp = w0
else
tmp = (-0.125d0) * ((d * (d / l)) * ((h / d_1) * (m * (m * (w0 / d_1)))))
end if
code = tmp
end function
public static double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (M <= 3e+74) {
tmp = w0;
} else {
tmp = -0.125 * ((D * (D / l)) * ((h / d) * (M * (M * (w0 / d)))));
}
return tmp;
}
def code(w0, M, D, h, l, d): tmp = 0 if M <= 3e+74: tmp = w0 else: tmp = -0.125 * ((D * (D / l)) * ((h / d) * (M * (M * (w0 / d))))) return tmp
function code(w0, M, D, h, l, d) tmp = 0.0 if (M <= 3e+74) tmp = w0; else tmp = Float64(-0.125 * Float64(Float64(D * Float64(D / l)) * Float64(Float64(h / d) * Float64(M * Float64(M * Float64(w0 / d)))))); end return tmp end
function tmp_2 = code(w0, M, D, h, l, d) tmp = 0.0; if (M <= 3e+74) tmp = w0; else tmp = -0.125 * ((D * (D / l)) * ((h / d) * (M * (M * (w0 / d))))); end tmp_2 = tmp; end
code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[M, 3e+74], w0, N[(-0.125 * N[(N[(D * N[(D / l), $MachinePrecision]), $MachinePrecision] * N[(N[(h / d), $MachinePrecision] * N[(M * N[(M * N[(w0 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;M \leq 3 \cdot 10^{+74}:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;-0.125 \cdot \left(\left(D \cdot \frac{D}{\ell}\right) \cdot \left(\frac{h}{d} \cdot \left(M \cdot \left(M \cdot \frac{w0}{d}\right)\right)\right)\right)\\
\end{array}
\end{array}
if M < 3e74Initial program 81.6%
times-frac81.6%
Simplified81.6%
Taylor expanded in M around 0 71.4%
if 3e74 < M Initial program 79.6%
times-frac79.9%
Simplified79.9%
Taylor expanded in M around 0 43.7%
+-commutative43.7%
associate-*r/43.7%
*-commutative43.7%
associate-*r/43.7%
*-commutative43.7%
fma-def43.7%
*-commutative43.7%
times-frac38.7%
unpow238.7%
unpow238.7%
times-frac44.3%
unpow244.3%
*-commutative44.3%
unpow244.3%
associate-*l*62.1%
Simplified62.1%
Taylor expanded in D around inf 26.6%
associate-/l*26.6%
*-commutative26.6%
associate-/l*26.6%
times-frac26.7%
unpow226.7%
unpow226.7%
*-commutative26.7%
associate-*r*26.8%
unpow226.8%
Simplified26.8%
Taylor expanded in D around 0 26.6%
unpow226.6%
*-commutative26.6%
times-frac26.7%
associate-*l/26.7%
*-commutative26.7%
*-commutative26.7%
unpow226.7%
associate-*r*27.4%
unpow227.4%
times-frac32.5%
associate-*r*31.9%
associate-*r/31.7%
*-commutative31.7%
associate-*l*31.7%
Simplified31.7%
Taylor expanded in M around 0 31.7%
unpow231.7%
*-commutative31.7%
associate-*r/31.7%
associate-*l*32.4%
Simplified32.4%
Final simplification65.4%
(FPCore (w0 M D h l d) :precision binary64 (if (<= M 3e+74) w0 (* -0.125 (* (/ (* D D) l) (* (/ (* M (* M h)) d) (/ w0 d))))))
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (M <= 3e+74) {
tmp = w0;
} else {
tmp = -0.125 * (((D * D) / l) * (((M * (M * h)) / d) * (w0 / d)));
}
return tmp;
}
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 <= 3d+74) then
tmp = w0
else
tmp = (-0.125d0) * (((d * d) / l) * (((m * (m * h)) / d_1) * (w0 / d_1)))
end if
code = tmp
end function
public static double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (M <= 3e+74) {
tmp = w0;
} else {
tmp = -0.125 * (((D * D) / l) * (((M * (M * h)) / d) * (w0 / d)));
}
return tmp;
}
def code(w0, M, D, h, l, d): tmp = 0 if M <= 3e+74: tmp = w0 else: tmp = -0.125 * (((D * D) / l) * (((M * (M * h)) / d) * (w0 / d))) return tmp
function code(w0, M, D, h, l, d) tmp = 0.0 if (M <= 3e+74) tmp = w0; else tmp = Float64(-0.125 * Float64(Float64(Float64(D * D) / l) * Float64(Float64(Float64(M * Float64(M * h)) / d) * Float64(w0 / d)))); end return tmp end
function tmp_2 = code(w0, M, D, h, l, d) tmp = 0.0; if (M <= 3e+74) tmp = w0; else tmp = -0.125 * (((D * D) / l) * (((M * (M * h)) / d) * (w0 / d))); end tmp_2 = tmp; end
code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[M, 3e+74], w0, N[(-0.125 * N[(N[(N[(D * D), $MachinePrecision] / l), $MachinePrecision] * N[(N[(N[(M * N[(M * h), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision] * N[(w0 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;M \leq 3 \cdot 10^{+74}:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;-0.125 \cdot \left(\frac{D \cdot D}{\ell} \cdot \left(\frac{M \cdot \left(M \cdot h\right)}{d} \cdot \frac{w0}{d}\right)\right)\\
\end{array}
\end{array}
if M < 3e74Initial program 81.6%
times-frac81.6%
Simplified81.6%
Taylor expanded in M around 0 71.4%
if 3e74 < M Initial program 79.6%
times-frac79.9%
Simplified79.9%
Taylor expanded in M around 0 43.7%
+-commutative43.7%
associate-*r/43.7%
*-commutative43.7%
associate-*r/43.7%
*-commutative43.7%
fma-def43.7%
*-commutative43.7%
times-frac38.7%
unpow238.7%
unpow238.7%
times-frac44.3%
unpow244.3%
*-commutative44.3%
unpow244.3%
associate-*l*62.1%
Simplified62.1%
Taylor expanded in D around inf 26.6%
associate-/l*26.6%
*-commutative26.6%
associate-/l*26.6%
times-frac26.7%
unpow226.7%
unpow226.7%
*-commutative26.7%
associate-*r*26.8%
unpow226.8%
Simplified26.8%
*-commutative26.8%
*-commutative26.8%
associate-*l*26.7%
times-frac31.9%
associate-*l*32.5%
Applied egg-rr32.5%
Final simplification65.4%
(FPCore (w0 M D h l d) :precision binary64 w0)
double code(double w0, double M, double D, double h, double l, double d) {
return w0;
}
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
public static double code(double w0, double M, double D, double h, double l, double d) {
return w0;
}
def code(w0, M, D, h, l, d): return w0
function code(w0, M, D, h, l, d) return w0 end
function tmp = code(w0, M, D, h, l, d) tmp = w0; end
code[w0_, M_, D_, h_, l_, d_] := w0
\begin{array}{l}
\\
w0
\end{array}
Initial program 81.3%
times-frac81.4%
Simplified81.4%
Taylor expanded in M around 0 69.1%
Final simplification69.1%
herbie shell --seed 2023243
(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))))))