
(FPCore (w0 M D h l d) :precision binary64 (* w0 (sqrt (- 1.0 (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ h l))))))
double code(double w0, double M, double D, double h, double l, double d) {
return w0 * sqrt((1.0 - (pow(((M * D) / (2.0 * d)), 2.0) * (h / l))));
}
real(8) function code(w0, m, d, h, l, d_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d_1
code = w0 * sqrt((1.0d0 - ((((m * d) / (2.0d0 * d_1)) ** 2.0d0) * (h / l))))
end function
public static double code(double w0, double M, double D, double h, double l, double d) {
return w0 * Math.sqrt((1.0 - (Math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l))));
}
def code(w0, M, D, h, l, d): return w0 * math.sqrt((1.0 - (math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l))))
function code(w0, M, D, h, l, d) return Float64(w0 * sqrt(Float64(1.0 - Float64((Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0) * Float64(h / l))))) end
function tmp = code(w0, M, D, h, l, d) tmp = w0 * sqrt((1.0 - ((((M * D) / (2.0 * d)) ^ 2.0) * (h / l)))); end
code[w0_, M_, D_, h_, l_, d_] := N[(w0 * N[Sqrt[N[(1.0 - N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 10 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (w0 M D h l d) :precision binary64 (* w0 (sqrt (- 1.0 (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ h l))))))
double code(double w0, double M, double D, double h, double l, double d) {
return w0 * sqrt((1.0 - (pow(((M * D) / (2.0 * d)), 2.0) * (h / l))));
}
real(8) function code(w0, m, d, h, l, d_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d_1
code = w0 * sqrt((1.0d0 - ((((m * d) / (2.0d0 * d_1)) ** 2.0d0) * (h / l))))
end function
public static double code(double w0, double M, double D, double h, double l, double d) {
return w0 * Math.sqrt((1.0 - (Math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l))));
}
def code(w0, M, D, h, l, d): return w0 * math.sqrt((1.0 - (math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l))))
function code(w0, M, D, h, l, d) return Float64(w0 * sqrt(Float64(1.0 - Float64((Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0) * Float64(h / l))))) end
function tmp = code(w0, M, D, h, l, d) tmp = w0 * sqrt((1.0 - ((((M * D) / (2.0 * d)) ^ 2.0) * (h / l)))); end
code[w0_, M_, D_, h_, l_, d_] := N[(w0 * N[Sqrt[N[(1.0 - N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}}
\end{array}
NOTE: 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) -1e-246) (* w0 (sqrt (- 1.0 (/ (* h (pow (* M (* D (/ 0.5 d))) 2.0)) l)))) (* w0 (sqrt (- 1.0 (* 0.25 (/ D (* (* (/ d M) (/ (/ d M) h)) (/ l 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) <= -1e-246) {
tmp = w0 * sqrt((1.0 - ((h * pow((M * (D * (0.5 / d))), 2.0)) / l)));
} else {
tmp = w0 * sqrt((1.0 - (0.25 * (D / (((d / M) * ((d / M) / h)) * (l / D))))));
}
return tmp;
}
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) <= (-1d-246)) then
tmp = w0 * sqrt((1.0d0 - ((h * ((m * (d * (0.5d0 / d_1))) ** 2.0d0)) / l)))
else
tmp = w0 * sqrt((1.0d0 - (0.25d0 * (d / (((d_1 / m) * ((d_1 / m) / h)) * (l / d))))))
end if
code = tmp
end function
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) <= -1e-246) {
tmp = w0 * Math.sqrt((1.0 - ((h * Math.pow((M * (D * (0.5 / d))), 2.0)) / l)));
} else {
tmp = w0 * Math.sqrt((1.0 - (0.25 * (D / (((d / M) * ((d / M) / h)) * (l / D))))));
}
return tmp;
}
D = abs(D) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if (h / l) <= -1e-246: tmp = w0 * math.sqrt((1.0 - ((h * math.pow((M * (D * (0.5 / d))), 2.0)) / l))) else: tmp = w0 * math.sqrt((1.0 - (0.25 * (D / (((d / M) * ((d / M) / h)) * (l / D)))))) return tmp
D = abs(D) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (Float64(h / l) <= -1e-246) tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(h * (Float64(M * Float64(D * Float64(0.5 / d))) ^ 2.0)) / l)))); else tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(0.25 * Float64(D / Float64(Float64(Float64(d / M) * Float64(Float64(d / M) / h)) * Float64(l / D))))))); end return tmp end
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) <= -1e-246)
tmp = w0 * sqrt((1.0 - ((h * ((M * (D * (0.5 / d))) ^ 2.0)) / l)));
else
tmp = w0 * sqrt((1.0 - (0.25 * (D / (((d / M) * ((d / M) / h)) * (l / D))))));
end
tmp_2 = tmp;
end
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], -1e-246], 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], N[(w0 * N[Sqrt[N[(1.0 - N[(0.25 * N[(D / N[(N[(N[(d / M), $MachinePrecision] * N[(N[(d / M), $MachinePrecision] / h), $MachinePrecision]), $MachinePrecision] * N[(l / D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{h}{\ell} \leq -1 \cdot 10^{-246}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{h \cdot {\left(M \cdot \left(D \cdot \frac{0.5}{d}\right)\right)}^{2}}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{1 - 0.25 \cdot \frac{D}{\left(\frac{d}{M} \cdot \frac{\frac{d}{M}}{h}\right) \cdot \frac{\ell}{D}}}\\
\end{array}
\end{array}
if (/.f64 h l) < -9.99999999999999956e-247Initial program 79.7%
times-frac79.8%
Simplified79.8%
associate-*r/84.1%
frac-times84.0%
div-inv84.1%
associate-*l*84.1%
associate-/r*84.1%
metadata-eval84.1%
Applied egg-rr84.1%
if -9.99999999999999956e-247 < (/.f64 h l) Initial program 84.1%
times-frac84.1%
Simplified84.1%
Taylor expanded in M around 0 52.9%
associate-*r/52.9%
*-commutative52.9%
associate-*r/52.9%
associate-/l*52.9%
unpow252.9%
unpow252.9%
*-commutative52.9%
unpow252.9%
Simplified52.9%
expm1-log1p-u50.8%
expm1-udef50.8%
associate-/l*61.1%
times-frac61.9%
Applied egg-rr61.9%
expm1-def61.9%
expm1-log1p64.8%
associate-/l*65.6%
associate-/l*72.3%
Simplified72.3%
associate-/r/73.2%
Applied egg-rr73.2%
Taylor expanded in l around 0 64.0%
*-commutative64.0%
*-commutative64.0%
unpow264.0%
*-commutative64.0%
associate-*r*69.7%
times-frac72.3%
unpow272.3%
*-commutative72.3%
times-frac90.0%
associate-/r*92.6%
Simplified92.6%
Final simplification88.0%
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 (<=
(* w0 (sqrt (- 1.0 (* (/ h l) (pow (/ (* M D) (* d 2.0)) 2.0)))))
1e+200)
(* w0 (sqrt (- 1.0 (* (/ h l) (pow (* (/ M 2.0) (/ D d)) 2.0)))))
(* w0 (sqrt (- 1.0 (* 0.25 (/ D (* (* (/ d M) (/ (/ d M) h)) (/ l D)))))))))D = abs(D);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if ((w0 * sqrt((1.0 - ((h / l) * pow(((M * D) / (d * 2.0)), 2.0))))) <= 1e+200) {
tmp = w0 * sqrt((1.0 - ((h / l) * pow(((M / 2.0) * (D / d)), 2.0))));
} else {
tmp = w0 * sqrt((1.0 - (0.25 * (D / (((d / M) * ((d / M) / h)) * (l / D))))));
}
return tmp;
}
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 ((w0 * sqrt((1.0d0 - ((h / l) * (((m * d) / (d_1 * 2.0d0)) ** 2.0d0))))) <= 1d+200) then
tmp = w0 * sqrt((1.0d0 - ((h / l) * (((m / 2.0d0) * (d / d_1)) ** 2.0d0))))
else
tmp = w0 * sqrt((1.0d0 - (0.25d0 * (d / (((d_1 / m) * ((d_1 / m) / h)) * (l / d))))))
end if
code = tmp
end function
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 ((w0 * Math.sqrt((1.0 - ((h / l) * Math.pow(((M * D) / (d * 2.0)), 2.0))))) <= 1e+200) {
tmp = w0 * Math.sqrt((1.0 - ((h / l) * Math.pow(((M / 2.0) * (D / d)), 2.0))));
} else {
tmp = w0 * Math.sqrt((1.0 - (0.25 * (D / (((d / M) * ((d / M) / h)) * (l / D))))));
}
return tmp;
}
D = abs(D) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if (w0 * math.sqrt((1.0 - ((h / l) * math.pow(((M * D) / (d * 2.0)), 2.0))))) <= 1e+200: tmp = w0 * math.sqrt((1.0 - ((h / l) * math.pow(((M / 2.0) * (D / d)), 2.0)))) else: tmp = w0 * math.sqrt((1.0 - (0.25 * (D / (((d / M) * ((d / M) / h)) * (l / D)))))) return tmp
D = abs(D) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(h / l) * (Float64(Float64(M * D) / Float64(d * 2.0)) ^ 2.0))))) <= 1e+200) tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(h / l) * (Float64(Float64(M / 2.0) * Float64(D / d)) ^ 2.0))))); else tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(0.25 * Float64(D / Float64(Float64(Float64(d / M) * Float64(Float64(d / M) / h)) * Float64(l / D))))))); end return tmp end
D = abs(D)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if ((w0 * sqrt((1.0 - ((h / l) * (((M * D) / (d * 2.0)) ^ 2.0))))) <= 1e+200)
tmp = w0 * sqrt((1.0 - ((h / l) * (((M / 2.0) * (D / d)) ^ 2.0))));
else
tmp = w0 * sqrt((1.0 - (0.25 * (D / (((d / M) * ((d / M) / h)) * (l / D))))));
end
tmp_2 = tmp;
end
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[(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], 1e+200], N[(w0 * N[Sqrt[N[(1.0 - N[(N[(h / l), $MachinePrecision] * N[Power[N[(N[(M / 2.0), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(w0 * N[Sqrt[N[(1.0 - N[(0.25 * N[(D / N[(N[(N[(d / M), $MachinePrecision] * N[(N[(d / M), $MachinePrecision] / h), $MachinePrecision]), $MachinePrecision] * N[(l / D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;w0 \cdot \sqrt{1 - \frac{h}{\ell} \cdot {\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2}} \leq 10^{+200}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{h}{\ell} \cdot {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2}}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{1 - 0.25 \cdot \frac{D}{\left(\frac{d}{M} \cdot \frac{\frac{d}{M}}{h}\right) \cdot \frac{\ell}{D}}}\\
\end{array}
\end{array}
if (*.f64 w0 (sqrt.f64 (-.f64 1 (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (/.f64 h l))))) < 9.9999999999999997e199Initial program 90.3%
times-frac90.4%
Simplified90.4%
if 9.9999999999999997e199 < (*.f64 w0 (sqrt.f64 (-.f64 1 (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (/.f64 h l))))) Initial program 51.7%
times-frac51.7%
Simplified51.7%
Taylor expanded in M around 0 50.3%
associate-*r/50.3%
*-commutative50.3%
associate-*r/50.3%
associate-/l*50.3%
unpow250.3%
unpow250.3%
*-commutative50.3%
unpow250.3%
Simplified50.3%
expm1-log1p-u21.1%
expm1-udef21.1%
associate-/l*21.1%
times-frac21.1%
Applied egg-rr21.1%
expm1-def21.1%
expm1-log1p51.8%
associate-/l*51.8%
associate-/l*57.1%
Simplified57.1%
associate-/r/60.7%
Applied egg-rr60.7%
Taylor expanded in l around 0 52.0%
*-commutative52.0%
*-commutative52.0%
unpow252.0%
*-commutative52.0%
associate-*r*53.7%
times-frac57.0%
unpow257.0%
*-commutative57.0%
times-frac78.1%
associate-/r*79.8%
Simplified79.8%
Final simplification88.0%
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 7.4e-47)
(* w0 (sqrt (- 1.0 (* 0.25 (/ D (* (* (/ d M) (/ (/ d M) h)) (/ l D)))))))
(if (<= d 1.15e+154)
(* w0 (sqrt (- 1.0 (* 0.25 (/ D (* (/ (* d d) D) (/ l (* M (* h M)))))))))
(* w0 (+ 1.0 (* (* D (/ D (* l (* (/ d M) (/ d (* h M)))))) -0.125))))))D = abs(D);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (d <= 7.4e-47) {
tmp = w0 * sqrt((1.0 - (0.25 * (D / (((d / M) * ((d / M) / h)) * (l / D))))));
} else if (d <= 1.15e+154) {
tmp = w0 * sqrt((1.0 - (0.25 * (D / (((d * d) / D) * (l / (M * (h * M))))))));
} else {
tmp = w0 * (1.0 + ((D * (D / (l * ((d / M) * (d / (h * M)))))) * -0.125));
}
return tmp;
}
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_1 <= 7.4d-47) then
tmp = w0 * sqrt((1.0d0 - (0.25d0 * (d / (((d_1 / m) * ((d_1 / m) / h)) * (l / d))))))
else if (d_1 <= 1.15d+154) then
tmp = w0 * sqrt((1.0d0 - (0.25d0 * (d / (((d_1 * d_1) / d) * (l / (m * (h * m))))))))
else
tmp = w0 * (1.0d0 + ((d * (d / (l * ((d_1 / m) * (d_1 / (h * m)))))) * (-0.125d0)))
end if
code = tmp
end function
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 <= 7.4e-47) {
tmp = w0 * Math.sqrt((1.0 - (0.25 * (D / (((d / M) * ((d / M) / h)) * (l / D))))));
} else if (d <= 1.15e+154) {
tmp = w0 * Math.sqrt((1.0 - (0.25 * (D / (((d * d) / D) * (l / (M * (h * M))))))));
} else {
tmp = w0 * (1.0 + ((D * (D / (l * ((d / M) * (d / (h * M)))))) * -0.125));
}
return tmp;
}
D = abs(D) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if d <= 7.4e-47: tmp = w0 * math.sqrt((1.0 - (0.25 * (D / (((d / M) * ((d / M) / h)) * (l / D)))))) elif d <= 1.15e+154: tmp = w0 * math.sqrt((1.0 - (0.25 * (D / (((d * d) / D) * (l / (M * (h * M)))))))) else: tmp = w0 * (1.0 + ((D * (D / (l * ((d / M) * (d / (h * M)))))) * -0.125)) return tmp
D = abs(D) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (d <= 7.4e-47) tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(0.25 * Float64(D / Float64(Float64(Float64(d / M) * Float64(Float64(d / M) / h)) * Float64(l / D))))))); elseif (d <= 1.15e+154) tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(0.25 * Float64(D / Float64(Float64(Float64(d * d) / D) * Float64(l / Float64(M * Float64(h * M))))))))); else tmp = Float64(w0 * Float64(1.0 + Float64(Float64(D * Float64(D / Float64(l * Float64(Float64(d / M) * Float64(d / Float64(h * M)))))) * -0.125))); end return tmp end
D = abs(D)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if (d <= 7.4e-47)
tmp = w0 * sqrt((1.0 - (0.25 * (D / (((d / M) * ((d / M) / h)) * (l / D))))));
elseif (d <= 1.15e+154)
tmp = w0 * sqrt((1.0 - (0.25 * (D / (((d * d) / D) * (l / (M * (h * M))))))));
else
tmp = w0 * (1.0 + ((D * (D / (l * ((d / M) * (d / (h * M)))))) * -0.125));
end
tmp_2 = tmp;
end
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, 7.4e-47], N[(w0 * N[Sqrt[N[(1.0 - N[(0.25 * N[(D / N[(N[(N[(d / M), $MachinePrecision] * N[(N[(d / M), $MachinePrecision] / h), $MachinePrecision]), $MachinePrecision] * N[(l / D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 1.15e+154], N[(w0 * N[Sqrt[N[(1.0 - N[(0.25 * N[(D / N[(N[(N[(d * d), $MachinePrecision] / D), $MachinePrecision] * N[(l / N[(M * N[(h * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(w0 * N[(1.0 + N[(N[(D * N[(D / N[(l * N[(N[(d / M), $MachinePrecision] * N[(d / N[(h * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;d \leq 7.4 \cdot 10^{-47}:\\
\;\;\;\;w0 \cdot \sqrt{1 - 0.25 \cdot \frac{D}{\left(\frac{d}{M} \cdot \frac{\frac{d}{M}}{h}\right) \cdot \frac{\ell}{D}}}\\
\mathbf{elif}\;d \leq 1.15 \cdot 10^{+154}:\\
\;\;\;\;w0 \cdot \sqrt{1 - 0.25 \cdot \frac{D}{\frac{d \cdot d}{D} \cdot \frac{\ell}{M \cdot \left(h \cdot M\right)}}}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \left(1 + \left(D \cdot \frac{D}{\ell \cdot \left(\frac{d}{M} \cdot \frac{d}{h \cdot M}\right)}\right) \cdot -0.125\right)\\
\end{array}
\end{array}
if d < 7.4000000000000001e-47Initial program 79.0%
times-frac78.5%
Simplified78.5%
Taylor expanded in M around 0 47.2%
associate-*r/47.2%
*-commutative47.2%
associate-*r/47.2%
associate-/l*46.1%
unpow246.1%
unpow246.1%
*-commutative46.1%
unpow246.1%
Simplified46.1%
expm1-log1p-u31.1%
expm1-udef31.1%
associate-/l*37.4%
times-frac35.6%
Applied egg-rr35.6%
expm1-def35.6%
expm1-log1p51.4%
associate-/l*51.3%
associate-/l*58.5%
Simplified58.5%
associate-/r/62.2%
Applied egg-rr62.2%
Taylor expanded in l around 0 54.8%
*-commutative54.8%
*-commutative54.8%
unpow254.8%
*-commutative54.8%
associate-*r*57.7%
times-frac59.4%
unpow259.4%
*-commutative59.4%
times-frac78.0%
associate-/r*79.2%
Simplified79.2%
if 7.4000000000000001e-47 < d < 1.15e154Initial program 89.7%
times-frac89.7%
Simplified89.7%
Taylor expanded in M around 0 66.5%
associate-*r/66.5%
*-commutative66.5%
associate-*r/66.5%
associate-/l*66.4%
unpow266.4%
unpow266.4%
*-commutative66.4%
unpow266.4%
Simplified66.4%
expm1-log1p-u55.3%
expm1-udef55.3%
associate-/l*64.2%
times-frac66.3%
Applied egg-rr66.3%
expm1-def66.3%
expm1-log1p77.6%
associate-/l*79.4%
associate-/l*79.4%
Simplified79.4%
Taylor expanded in l around 0 77.3%
unpow277.3%
*-commutative77.3%
times-frac75.3%
unpow275.3%
*-commutative75.3%
associate-*r*81.3%
*-commutative81.3%
Simplified81.3%
if 1.15e154 < d Initial program 83.7%
times-frac86.0%
Simplified86.0%
Taylor expanded in M around 0 45.2%
*-commutative45.2%
*-commutative45.2%
associate-/l*47.6%
unpow247.6%
unpow247.6%
*-commutative47.6%
unpow247.6%
Simplified47.6%
expm1-log1p-u47.6%
expm1-udef47.6%
associate-/l*57.4%
times-frac59.8%
Applied egg-rr59.8%
expm1-def59.8%
expm1-log1p59.8%
associate-/r/59.8%
unpow259.8%
unpow259.8%
times-frac57.4%
*-commutative57.4%
times-frac57.4%
unpow257.4%
unpow257.4%
Simplified57.4%
Taylor expanded in l around 0 57.4%
unpow257.4%
unpow257.4%
*-rgt-identity57.4%
associate-*r*60.0%
associate-*r/60.0%
associate-*l*60.0%
associate-*r/60.0%
*-rgt-identity60.0%
times-frac77.2%
*-commutative77.2%
Simplified77.2%
Final simplification79.3%
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 6.2e+139) (* w0 (sqrt (- 1.0 (* 0.25 (/ D (* (* (/ d M) (/ (/ d M) h)) (/ l D))))))) (* w0 (+ 1.0 (* (* D (/ D (* l (* (/ d M) (/ d (* h M)))))) -0.125)))))
D = abs(D);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (d <= 6.2e+139) {
tmp = w0 * sqrt((1.0 - (0.25 * (D / (((d / M) * ((d / M) / h)) * (l / D))))));
} else {
tmp = w0 * (1.0 + ((D * (D / (l * ((d / M) * (d / (h * M)))))) * -0.125));
}
return tmp;
}
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_1 <= 6.2d+139) then
tmp = w0 * sqrt((1.0d0 - (0.25d0 * (d / (((d_1 / m) * ((d_1 / m) / h)) * (l / d))))))
else
tmp = w0 * (1.0d0 + ((d * (d / (l * ((d_1 / m) * (d_1 / (h * m)))))) * (-0.125d0)))
end if
code = tmp
end function
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 <= 6.2e+139) {
tmp = w0 * Math.sqrt((1.0 - (0.25 * (D / (((d / M) * ((d / M) / h)) * (l / D))))));
} else {
tmp = w0 * (1.0 + ((D * (D / (l * ((d / M) * (d / (h * M)))))) * -0.125));
}
return tmp;
}
D = abs(D) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if d <= 6.2e+139: tmp = w0 * math.sqrt((1.0 - (0.25 * (D / (((d / M) * ((d / M) / h)) * (l / D)))))) else: tmp = w0 * (1.0 + ((D * (D / (l * ((d / M) * (d / (h * M)))))) * -0.125)) return tmp
D = abs(D) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (d <= 6.2e+139) tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(0.25 * Float64(D / Float64(Float64(Float64(d / M) * Float64(Float64(d / M) / h)) * Float64(l / D))))))); else tmp = Float64(w0 * Float64(1.0 + Float64(Float64(D * Float64(D / Float64(l * Float64(Float64(d / M) * Float64(d / Float64(h * M)))))) * -0.125))); end return tmp end
D = abs(D)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if (d <= 6.2e+139)
tmp = w0 * sqrt((1.0 - (0.25 * (D / (((d / M) * ((d / M) / h)) * (l / D))))));
else
tmp = w0 * (1.0 + ((D * (D / (l * ((d / M) * (d / (h * M)))))) * -0.125));
end
tmp_2 = tmp;
end
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, 6.2e+139], N[(w0 * N[Sqrt[N[(1.0 - N[(0.25 * N[(D / N[(N[(N[(d / M), $MachinePrecision] * N[(N[(d / M), $MachinePrecision] / h), $MachinePrecision]), $MachinePrecision] * N[(l / D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(w0 * N[(1.0 + N[(N[(D * N[(D / N[(l * N[(N[(d / M), $MachinePrecision] * N[(d / N[(h * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;d \leq 6.2 \cdot 10^{+139}:\\
\;\;\;\;w0 \cdot \sqrt{1 - 0.25 \cdot \frac{D}{\left(\frac{d}{M} \cdot \frac{\frac{d}{M}}{h}\right) \cdot \frac{\ell}{D}}}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \left(1 + \left(D \cdot \frac{D}{\ell \cdot \left(\frac{d}{M} \cdot \frac{d}{h \cdot M}\right)}\right) \cdot -0.125\right)\\
\end{array}
\end{array}
if d < 6.2e139Initial program 80.8%
times-frac80.4%
Simplified80.4%
Taylor expanded in M around 0 51.5%
associate-*r/51.5%
*-commutative51.5%
associate-*r/51.5%
associate-/l*50.6%
unpow250.6%
unpow250.6%
*-commutative50.6%
unpow250.6%
Simplified50.6%
expm1-log1p-u36.5%
expm1-udef36.5%
associate-/l*42.6%
times-frac41.6%
Applied egg-rr41.6%
expm1-def41.6%
expm1-log1p56.4%
associate-/l*56.7%
associate-/l*62.4%
Simplified62.4%
associate-/r/65.5%
Applied egg-rr65.5%
Taylor expanded in l around 0 58.6%
*-commutative58.6%
*-commutative58.6%
unpow258.6%
*-commutative58.6%
associate-*r*61.9%
times-frac63.2%
unpow263.2%
*-commutative63.2%
times-frac79.1%
associate-/r*80.0%
Simplified80.0%
if 6.2e139 < d Initial program 85.7%
times-frac87.7%
Simplified87.7%
Taylor expanded in M around 0 45.9%
*-commutative45.9%
*-commutative45.9%
associate-/l*47.9%
unpow247.9%
unpow247.9%
*-commutative47.9%
unpow247.9%
Simplified47.9%
expm1-log1p-u45.8%
expm1-udef45.8%
associate-/l*58.7%
times-frac60.8%
Applied egg-rr60.8%
expm1-def60.8%
expm1-log1p62.9%
associate-/r/62.9%
unpow262.9%
unpow262.9%
times-frac60.8%
*-commutative60.8%
times-frac60.8%
unpow260.8%
unpow260.8%
Simplified60.8%
Taylor expanded in l around 0 60.8%
unpow260.8%
unpow260.8%
*-rgt-identity60.8%
associate-*r*63.1%
associate-*r/63.1%
associate-*l*63.1%
associate-*r/63.1%
*-rgt-identity63.1%
times-frac78.1%
*-commutative78.1%
Simplified78.1%
Final simplification79.7%
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-24) (* w0 (sqrt (- 1.0 (* 0.25 (/ D (* (* (/ d M) (/ (/ d M) h)) (/ l D))))))) (* w0 (sqrt (- 1.0 (* 0.25 (/ D (/ (/ l (* M M)) (* (/ D d) (/ h 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-24) {
tmp = w0 * sqrt((1.0 - (0.25 * (D / (((d / M) * ((d / M) / h)) * (l / D))))));
} else {
tmp = w0 * sqrt((1.0 - (0.25 * (D / ((l / (M * M)) / ((D / d) * (h / d)))))));
}
return tmp;
}
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_1 <= 1d-24) then
tmp = w0 * sqrt((1.0d0 - (0.25d0 * (d / (((d_1 / m) * ((d_1 / m) / h)) * (l / d))))))
else
tmp = w0 * sqrt((1.0d0 - (0.25d0 * (d / ((l / (m * m)) / ((d / d_1) * (h / d_1)))))))
end if
code = tmp
end function
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-24) {
tmp = w0 * Math.sqrt((1.0 - (0.25 * (D / (((d / M) * ((d / M) / h)) * (l / D))))));
} else {
tmp = w0 * Math.sqrt((1.0 - (0.25 * (D / ((l / (M * M)) / ((D / d) * (h / d)))))));
}
return tmp;
}
D = abs(D) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if d <= 1e-24: tmp = w0 * math.sqrt((1.0 - (0.25 * (D / (((d / M) * ((d / M) / h)) * (l / D)))))) else: tmp = w0 * math.sqrt((1.0 - (0.25 * (D / ((l / (M * M)) / ((D / d) * (h / d))))))) return tmp
D = abs(D) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (d <= 1e-24) tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(0.25 * Float64(D / Float64(Float64(Float64(d / M) * Float64(Float64(d / M) / h)) * Float64(l / D))))))); else tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(0.25 * Float64(D / Float64(Float64(l / Float64(M * M)) / Float64(Float64(D / d) * Float64(h / d)))))))); end return tmp end
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-24)
tmp = w0 * sqrt((1.0 - (0.25 * (D / (((d / M) * ((d / M) / h)) * (l / D))))));
else
tmp = w0 * sqrt((1.0 - (0.25 * (D / ((l / (M * M)) / ((D / d) * (h / d)))))));
end
tmp_2 = tmp;
end
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-24], N[(w0 * N[Sqrt[N[(1.0 - N[(0.25 * N[(D / N[(N[(N[(d / M), $MachinePrecision] * N[(N[(d / M), $MachinePrecision] / h), $MachinePrecision]), $MachinePrecision] * N[(l / D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(w0 * N[Sqrt[N[(1.0 - N[(0.25 * N[(D / N[(N[(l / N[(M * M), $MachinePrecision]), $MachinePrecision] / N[(N[(D / d), $MachinePrecision] * N[(h / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;d \leq 10^{-24}:\\
\;\;\;\;w0 \cdot \sqrt{1 - 0.25 \cdot \frac{D}{\left(\frac{d}{M} \cdot \frac{\frac{d}{M}}{h}\right) \cdot \frac{\ell}{D}}}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{1 - 0.25 \cdot \frac{D}{\frac{\frac{\ell}{M \cdot M}}{\frac{D}{d} \cdot \frac{h}{d}}}}\\
\end{array}
\end{array}
if d < 9.99999999999999924e-25Initial program 79.4%
times-frac78.9%
Simplified78.9%
Taylor expanded in M around 0 47.6%
associate-*r/47.6%
*-commutative47.6%
associate-*r/47.6%
associate-/l*46.5%
unpow246.5%
unpow246.5%
*-commutative46.5%
unpow246.5%
Simplified46.5%
expm1-log1p-u31.8%
expm1-udef31.8%
associate-/l*38.5%
times-frac36.1%
Applied egg-rr36.1%
expm1-def36.1%
expm1-log1p51.7%
associate-/l*51.6%
associate-/l*58.6%
Simplified58.6%
associate-/r/62.3%
Applied egg-rr62.3%
Taylor expanded in l around 0 55.6%
*-commutative55.6%
*-commutative55.6%
unpow255.6%
*-commutative55.6%
associate-*r*58.5%
times-frac60.1%
unpow260.1%
*-commutative60.1%
times-frac78.4%
associate-/r*79.6%
Simplified79.6%
if 9.99999999999999924e-25 < d Initial program 86.4%
times-frac87.5%
Simplified87.5%
Taylor expanded in M around 0 56.1%
associate-*r/56.1%
*-commutative56.1%
associate-*r/56.1%
associate-/l*57.2%
unpow257.2%
unpow257.2%
*-commutative57.2%
unpow257.2%
Simplified57.2%
expm1-log1p-u51.2%
expm1-udef51.2%
associate-/l*59.6%
times-frac63.1%
Applied egg-rr63.1%
expm1-def63.1%
expm1-log1p69.3%
associate-/l*70.3%
associate-/l*71.6%
Simplified71.6%
associate-/r/73.9%
Applied egg-rr73.9%
Final simplification77.7%
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 7.6e-39) w0 (* w0 (+ 1.0 (* -0.125 (* D (* (/ D l) (/ M (/ d (/ (* h M) 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 <= 7.6e-39) {
tmp = w0;
} else {
tmp = w0 * (1.0 + (-0.125 * (D * ((D / l) * (M / (d / ((h * M) / d)))))));
}
return tmp;
}
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 <= 7.6d-39) then
tmp = w0
else
tmp = w0 * (1.0d0 + ((-0.125d0) * (d * ((d / l) * (m / (d_1 / ((h * m) / d_1)))))))
end if
code = tmp
end function
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 <= 7.6e-39) {
tmp = w0;
} else {
tmp = w0 * (1.0 + (-0.125 * (D * ((D / l) * (M / (d / ((h * M) / d)))))));
}
return tmp;
}
D = abs(D) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if M <= 7.6e-39: tmp = w0 else: tmp = w0 * (1.0 + (-0.125 * (D * ((D / l) * (M / (d / ((h * M) / d))))))) return tmp
D = abs(D) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (M <= 7.6e-39) tmp = w0; else tmp = Float64(w0 * Float64(1.0 + Float64(-0.125 * Float64(D * Float64(Float64(D / l) * Float64(M / Float64(d / Float64(Float64(h * M) / d)))))))); end return tmp end
D = abs(D)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if (M <= 7.6e-39)
tmp = w0;
else
tmp = w0 * (1.0 + (-0.125 * (D * ((D / l) * (M / (d / ((h * M) / d)))))));
end
tmp_2 = tmp;
end
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, 7.6e-39], w0, N[(w0 * N[(1.0 + N[(-0.125 * N[(D * N[(N[(D / l), $MachinePrecision] * N[(M / N[(d / N[(N[(h * M), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;M \leq 7.6 \cdot 10^{-39}:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \left(1 + -0.125 \cdot \left(D \cdot \left(\frac{D}{\ell} \cdot \frac{M}{\frac{d}{\frac{h \cdot M}{d}}}\right)\right)\right)\\
\end{array}
\end{array}
if M < 7.6000000000000004e-39Initial program 85.2%
times-frac85.2%
Simplified85.2%
Taylor expanded in M around 0 73.8%
if 7.6000000000000004e-39 < M Initial program 73.9%
times-frac73.9%
Simplified73.9%
Taylor expanded in M around 0 41.8%
*-commutative41.8%
*-commutative41.8%
associate-/l*43.0%
unpow243.0%
unpow243.0%
*-commutative43.0%
unpow243.0%
Simplified43.0%
expm1-log1p-u26.9%
expm1-udef26.9%
associate-/l*29.7%
times-frac34.9%
Applied egg-rr34.9%
expm1-def34.9%
expm1-log1p51.3%
associate-/r/51.3%
unpow251.3%
unpow251.3%
times-frac46.3%
*-commutative46.3%
times-frac49.9%
unpow249.9%
unpow249.9%
Simplified49.9%
Taylor expanded in D around 0 44.9%
unpow244.9%
times-frac46.1%
unpow246.1%
associate-*r*50.1%
associate-/l*62.9%
associate-/l*64.2%
*-commutative64.2%
Simplified64.2%
Final simplification70.9%
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-117) w0 (* w0 (+ 1.0 (* -0.125 (* D (* (/ (/ D d) d) (/ M (/ (/ l h) M)))))))))
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-117) {
tmp = w0;
} else {
tmp = w0 * (1.0 + (-0.125 * (D * (((D / d) / d) * (M / ((l / h) / M))))));
}
return tmp;
}
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-117) then
tmp = w0
else
tmp = w0 * (1.0d0 + ((-0.125d0) * (d * (((d / d_1) / d_1) * (m / ((l / h) / m))))))
end if
code = tmp
end function
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-117) {
tmp = w0;
} else {
tmp = w0 * (1.0 + (-0.125 * (D * (((D / d) / d) * (M / ((l / h) / M))))));
}
return tmp;
}
D = abs(D) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if M <= 1.7e-117: tmp = w0 else: tmp = w0 * (1.0 + (-0.125 * (D * (((D / d) / d) * (M / ((l / h) / M)))))) return tmp
D = abs(D) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (M <= 1.7e-117) tmp = w0; else tmp = Float64(w0 * Float64(1.0 + Float64(-0.125 * Float64(D * Float64(Float64(Float64(D / d) / d) * Float64(M / Float64(Float64(l / h) / M))))))); end return tmp end
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-117)
tmp = w0;
else
tmp = w0 * (1.0 + (-0.125 * (D * (((D / d) / d) * (M / ((l / h) / M))))));
end
tmp_2 = tmp;
end
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-117], w0, N[(w0 * N[(1.0 + N[(-0.125 * N[(D * N[(N[(N[(D / d), $MachinePrecision] / d), $MachinePrecision] * N[(M / N[(N[(l / h), $MachinePrecision] / M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;M \leq 1.7 \cdot 10^{-117}:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \left(1 + -0.125 \cdot \left(D \cdot \left(\frac{\frac{D}{d}}{d} \cdot \frac{M}{\frac{\frac{\ell}{h}}{M}}\right)\right)\right)\\
\end{array}
\end{array}
if M < 1.70000000000000017e-117Initial program 85.2%
times-frac85.2%
Simplified85.2%
Taylor expanded in M around 0 73.4%
if 1.70000000000000017e-117 < M Initial program 75.4%
times-frac75.5%
Simplified75.5%
Taylor expanded in M around 0 43.6%
*-commutative43.6%
*-commutative43.6%
associate-/l*44.6%
unpow244.6%
unpow244.6%
*-commutative44.6%
unpow244.6%
Simplified44.6%
expm1-log1p-u29.7%
expm1-udef29.7%
associate-/l*34.3%
times-frac38.7%
Applied egg-rr38.7%
expm1-def38.7%
expm1-log1p54.0%
associate-/r/54.0%
unpow254.0%
unpow254.0%
times-frac49.7%
*-commutative49.7%
times-frac52.9%
unpow252.9%
unpow252.9%
Simplified52.9%
Taylor expanded in D around 0 48.5%
unpow248.5%
*-commutative48.5%
times-frac49.7%
associate-/r*54.0%
unpow254.0%
associate-*r*59.5%
associate-/l*62.8%
associate-/l/64.9%
Simplified64.9%
Final simplification70.4%
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 2.8e+41) w0 (* -0.125 (* (* (* h M) (/ M d)) (/ (* D (/ D l)) (/ d w0))))))
D = abs(D);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (M <= 2.8e+41) {
tmp = w0;
} else {
tmp = -0.125 * (((h * M) * (M / d)) * ((D * (D / l)) / (d / w0)));
}
return tmp;
}
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 <= 2.8d+41) then
tmp = w0
else
tmp = (-0.125d0) * (((h * m) * (m / d_1)) * ((d * (d / l)) / (d_1 / w0)))
end if
code = tmp
end function
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 <= 2.8e+41) {
tmp = w0;
} else {
tmp = -0.125 * (((h * M) * (M / d)) * ((D * (D / l)) / (d / w0)));
}
return tmp;
}
D = abs(D) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if M <= 2.8e+41: tmp = w0 else: tmp = -0.125 * (((h * M) * (M / d)) * ((D * (D / l)) / (d / w0))) return tmp
D = abs(D) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (M <= 2.8e+41) tmp = w0; else tmp = Float64(-0.125 * Float64(Float64(Float64(h * M) * Float64(M / d)) * Float64(Float64(D * Float64(D / l)) / Float64(d / w0)))); end return tmp end
D = abs(D)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if (M <= 2.8e+41)
tmp = w0;
else
tmp = -0.125 * (((h * M) * (M / d)) * ((D * (D / l)) / (d / w0)));
end
tmp_2 = tmp;
end
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, 2.8e+41], w0, N[(-0.125 * N[(N[(N[(h * M), $MachinePrecision] * N[(M / d), $MachinePrecision]), $MachinePrecision] * N[(N[(D * N[(D / l), $MachinePrecision]), $MachinePrecision] / N[(d / w0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;M \leq 2.8 \cdot 10^{+41}:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;-0.125 \cdot \left(\left(\left(h \cdot M\right) \cdot \frac{M}{d}\right) \cdot \frac{D \cdot \frac{D}{\ell}}{\frac{d}{w0}}\right)\\
\end{array}
\end{array}
if M < 2.7999999999999999e41Initial program 83.9%
times-frac83.9%
Simplified83.9%
Taylor expanded in M around 0 73.8%
if 2.7999999999999999e41 < M Initial program 74.0%
times-frac74.1%
Simplified74.1%
Taylor expanded in M around 0 31.1%
fma-def31.1%
*-commutative31.1%
times-frac35.2%
associate-*r/35.2%
unpow235.2%
unpow235.2%
times-frac35.8%
unpow235.8%
*-commutative35.8%
*-commutative35.8%
associate-*l*42.7%
unpow242.7%
Simplified42.7%
expm1-log1p-u29.9%
expm1-udef29.9%
associate-/l*28.1%
Applied egg-rr28.1%
expm1-def28.1%
expm1-log1p40.9%
unpow240.9%
associate-/r*42.2%
unpow242.2%
associate-/r*51.3%
Simplified51.3%
Taylor expanded in D around inf 19.1%
*-commutative19.1%
unpow219.1%
unpow219.1%
*-commutative19.1%
times-frac19.6%
*-commutative19.6%
unpow219.6%
associate-*r*19.9%
associate-/l*19.6%
Simplified19.6%
Taylor expanded in D around 0 19.1%
*-commutative19.1%
times-frac19.6%
*-commutative19.6%
unpow219.6%
associate-*r*20.0%
unpow220.0%
times-frac19.7%
associate-*r*19.9%
unpow219.9%
associate-/l*20.4%
associate-/l*21.2%
associate-*r*21.0%
associate-*r/21.4%
associate-/l*20.9%
associate-*r/21.1%
Simplified21.1%
Final simplification62.3%
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 (* (* D (/ D (* l (* (/ d M) (/ d (* h M)))))) -0.125))))
D = abs(D);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
return w0 * (1.0 + ((D * (D / (l * ((d / M) * (d / (h * M)))))) * -0.125));
}
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 + ((d * (d / (l * ((d_1 / m) * (d_1 / (h * m)))))) * (-0.125d0)))
end function
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 + ((D * (D / (l * ((d / M) * (d / (h * M)))))) * -0.125));
}
D = abs(D) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): return w0 * (1.0 + ((D * (D / (l * ((d / M) * (d / (h * M)))))) * -0.125))
D = abs(D) M, D = sort([M, D]) function code(w0, M, D, h, l, d) return Float64(w0 * Float64(1.0 + Float64(Float64(D * Float64(D / Float64(l * Float64(Float64(d / M) * Float64(d / Float64(h * M)))))) * -0.125))) end
D = abs(D)
M, D = num2cell(sort([M, D])){:}
function tmp = code(w0, M, D, h, l, d)
tmp = w0 * (1.0 + ((D * (D / (l * ((d / M) * (d / (h * M)))))) * -0.125));
end
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[(N[(D * N[(D / N[(l * N[(N[(d / M), $MachinePrecision] * N[(d / N[(h * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
w0 \cdot \left(1 + \left(D \cdot \frac{D}{\ell \cdot \left(\frac{d}{M} \cdot \frac{d}{h \cdot M}\right)}\right) \cdot -0.125\right)
\end{array}
Initial program 81.7%
times-frac81.8%
Simplified81.8%
Taylor expanded in M around 0 48.7%
*-commutative48.7%
*-commutative48.7%
associate-/l*48.3%
unpow248.3%
unpow248.3%
*-commutative48.3%
unpow248.3%
Simplified48.3%
expm1-log1p-u38.3%
expm1-udef38.3%
associate-/l*45.6%
times-frac45.2%
Applied egg-rr45.2%
expm1-def45.2%
expm1-log1p55.8%
associate-/r/55.8%
unpow255.8%
unpow255.8%
times-frac55.9%
*-commutative55.9%
times-frac56.9%
unpow256.9%
unpow256.9%
Simplified56.9%
Taylor expanded in l around 0 55.9%
unpow255.9%
unpow255.9%
*-rgt-identity55.9%
associate-*r*59.0%
associate-*r/58.6%
associate-*l*59.5%
associate-*r/59.9%
*-rgt-identity59.9%
times-frac74.1%
*-commutative74.1%
Simplified74.1%
Final simplification74.1%
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)
D = abs(D);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
return w0;
}
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
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;
}
D = abs(D) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): return w0
D = abs(D) M, D = sort([M, D]) function code(w0, M, D, h, l, d) return w0 end
D = abs(D)
M, D = num2cell(sort([M, D])){:}
function tmp = code(w0, M, D, h, l, d)
tmp = w0;
end
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}
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
w0
\end{array}
Initial program 81.7%
times-frac81.8%
Simplified81.8%
Taylor expanded in M around 0 69.9%
Final simplification69.9%
herbie shell --seed 2023214
(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))))))