
(FPCore (d h l M D) :precision binary64 (* (* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0))) (- 1.0 (* (* (/ 1.0 2.0) (pow (/ (* M D) (* 2.0 d)) 2.0)) (/ h l)))))
double code(double d, double h, double l, double M, double D) {
return (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
code = (((d / h) ** (1.0d0 / 2.0d0)) * ((d / l) ** (1.0d0 / 2.0d0))) * (1.0d0 - (((1.0d0 / 2.0d0) * (((m * d_1) / (2.0d0 * d)) ** 2.0d0)) * (h / l)))
end function
public static double code(double d, double h, double l, double M, double D) {
return (Math.pow((d / h), (1.0 / 2.0)) * Math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * Math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
}
def code(d, h, l, M, D): return (math.pow((d / h), (1.0 / 2.0)) * math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)))
function code(d, h, l, M, D) return Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 - Float64(Float64(Float64(1.0 / 2.0) * (Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l)))) end
function tmp = code(d, h, l, M, D) tmp = (((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * (((M * D) / (2.0 * d)) ^ 2.0)) * (h / l))); end
code[d_, h_, l_, M_, D_] := N[(N[(N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(1.0 / 2.0), $MachinePrecision] * N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (d h l M D) :precision binary64 (* (* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0))) (- 1.0 (* (* (/ 1.0 2.0) (pow (/ (* M D) (* 2.0 d)) 2.0)) (/ h l)))))
double code(double d, double h, double l, double M, double D) {
return (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
code = (((d / h) ** (1.0d0 / 2.0d0)) * ((d / l) ** (1.0d0 / 2.0d0))) * (1.0d0 - (((1.0d0 / 2.0d0) * (((m * d_1) / (2.0d0 * d)) ** 2.0d0)) * (h / l)))
end function
public static double code(double d, double h, double l, double M, double D) {
return (Math.pow((d / h), (1.0 / 2.0)) * Math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * Math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
}
def code(d, h, l, M, D): return (math.pow((d / h), (1.0 / 2.0)) * math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)))
function code(d, h, l, M, D) return Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 - Float64(Float64(Float64(1.0 / 2.0) * (Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l)))) end
function tmp = code(d, h, l, M, D) tmp = (((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * (((M * D) / (2.0 * d)) ^ 2.0)) * (h / l))); end
code[d_, h_, l_, M_, D_] := N[(N[(N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(1.0 / 2.0), $MachinePrecision] * N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)
\end{array}
(FPCore (d h l M D)
:precision binary64
(let* ((t_0
(*
(* (pow (/ d h) 0.5) (pow (/ d l) 0.5))
(- 1.0 (* (/ h l) (* 0.5 (pow (/ (* D M) (* d 2.0)) 2.0))))))
(t_1 (* (sqrt (/ d l)) (sqrt (/ d h)))))
(if (<= t_0 -5e-150)
(* t_1 (- 1.0 (/ (* h (* 0.5 (pow (* (/ D d) (* 0.5 M)) 2.0))) l)))
(if (or (<= t_0 0.0) (not (<= t_0 1e+241)))
(/ (fabs d) (sqrt (* h l)))
(* (- 1.0 (* h (/ (pow (* D (/ 0.5 (/ d M))) 2.0) (/ l 0.5)))) t_1)))))
double code(double d, double h, double l, double M, double D) {
double t_0 = (pow((d / h), 0.5) * pow((d / l), 0.5)) * (1.0 - ((h / l) * (0.5 * pow(((D * M) / (d * 2.0)), 2.0))));
double t_1 = sqrt((d / l)) * sqrt((d / h));
double tmp;
if (t_0 <= -5e-150) {
tmp = t_1 * (1.0 - ((h * (0.5 * pow(((D / d) * (0.5 * M)), 2.0))) / l));
} else if ((t_0 <= 0.0) || !(t_0 <= 1e+241)) {
tmp = fabs(d) / sqrt((h * l));
} else {
tmp = (1.0 - (h * (pow((D * (0.5 / (d / M))), 2.0) / (l / 0.5)))) * t_1;
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = (((d / h) ** 0.5d0) * ((d / l) ** 0.5d0)) * (1.0d0 - ((h / l) * (0.5d0 * (((d_1 * m) / (d * 2.0d0)) ** 2.0d0))))
t_1 = sqrt((d / l)) * sqrt((d / h))
if (t_0 <= (-5d-150)) then
tmp = t_1 * (1.0d0 - ((h * (0.5d0 * (((d_1 / d) * (0.5d0 * m)) ** 2.0d0))) / l))
else if ((t_0 <= 0.0d0) .or. (.not. (t_0 <= 1d+241))) then
tmp = abs(d) / sqrt((h * l))
else
tmp = (1.0d0 - (h * (((d_1 * (0.5d0 / (d / m))) ** 2.0d0) / (l / 0.5d0)))) * t_1
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = (Math.pow((d / h), 0.5) * Math.pow((d / l), 0.5)) * (1.0 - ((h / l) * (0.5 * Math.pow(((D * M) / (d * 2.0)), 2.0))));
double t_1 = Math.sqrt((d / l)) * Math.sqrt((d / h));
double tmp;
if (t_0 <= -5e-150) {
tmp = t_1 * (1.0 - ((h * (0.5 * Math.pow(((D / d) * (0.5 * M)), 2.0))) / l));
} else if ((t_0 <= 0.0) || !(t_0 <= 1e+241)) {
tmp = Math.abs(d) / Math.sqrt((h * l));
} else {
tmp = (1.0 - (h * (Math.pow((D * (0.5 / (d / M))), 2.0) / (l / 0.5)))) * t_1;
}
return tmp;
}
def code(d, h, l, M, D): t_0 = (math.pow((d / h), 0.5) * math.pow((d / l), 0.5)) * (1.0 - ((h / l) * (0.5 * math.pow(((D * M) / (d * 2.0)), 2.0)))) t_1 = math.sqrt((d / l)) * math.sqrt((d / h)) tmp = 0 if t_0 <= -5e-150: tmp = t_1 * (1.0 - ((h * (0.5 * math.pow(((D / d) * (0.5 * M)), 2.0))) / l)) elif (t_0 <= 0.0) or not (t_0 <= 1e+241): tmp = math.fabs(d) / math.sqrt((h * l)) else: tmp = (1.0 - (h * (math.pow((D * (0.5 / (d / M))), 2.0) / (l / 0.5)))) * t_1 return tmp
function code(d, h, l, M, D) t_0 = Float64(Float64((Float64(d / h) ^ 0.5) * (Float64(d / l) ^ 0.5)) * Float64(1.0 - Float64(Float64(h / l) * Float64(0.5 * (Float64(Float64(D * M) / Float64(d * 2.0)) ^ 2.0))))) t_1 = Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))) tmp = 0.0 if (t_0 <= -5e-150) tmp = Float64(t_1 * Float64(1.0 - Float64(Float64(h * Float64(0.5 * (Float64(Float64(D / d) * Float64(0.5 * M)) ^ 2.0))) / l))); elseif ((t_0 <= 0.0) || !(t_0 <= 1e+241)) tmp = Float64(abs(d) / sqrt(Float64(h * l))); else tmp = Float64(Float64(1.0 - Float64(h * Float64((Float64(D * Float64(0.5 / Float64(d / M))) ^ 2.0) / Float64(l / 0.5)))) * t_1); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = (((d / h) ^ 0.5) * ((d / l) ^ 0.5)) * (1.0 - ((h / l) * (0.5 * (((D * M) / (d * 2.0)) ^ 2.0)))); t_1 = sqrt((d / l)) * sqrt((d / h)); tmp = 0.0; if (t_0 <= -5e-150) tmp = t_1 * (1.0 - ((h * (0.5 * (((D / d) * (0.5 * M)) ^ 2.0))) / l)); elseif ((t_0 <= 0.0) || ~((t_0 <= 1e+241))) tmp = abs(d) / sqrt((h * l)); else tmp = (1.0 - (h * (((D * (0.5 / (d / M))) ^ 2.0) / (l / 0.5)))) * t_1; end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(N[Power[N[(d / h), $MachinePrecision], 0.5], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(h / l), $MachinePrecision] * N[(0.5 * N[Power[N[(N[(D * M), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -5e-150], N[(t$95$1 * N[(1.0 - N[(N[(h * N[(0.5 * N[Power[N[(N[(D / d), $MachinePrecision] * N[(0.5 * M), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t$95$0, 0.0], N[Not[LessEqual[t$95$0, 1e+241]], $MachinePrecision]], N[(N[Abs[d], $MachinePrecision] / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - N[(h * N[(N[Power[N[(D * N[(0.5 / N[(d / M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] / N[(l / 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left({\left(\frac{d}{h}\right)}^{0.5} \cdot {\left(\frac{d}{\ell}\right)}^{0.5}\right) \cdot \left(1 - \frac{h}{\ell} \cdot \left(0.5 \cdot {\left(\frac{D \cdot M}{d \cdot 2}\right)}^{2}\right)\right)\\
t_1 := \sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\
\mathbf{if}\;t_0 \leq -5 \cdot 10^{-150}:\\
\;\;\;\;t_1 \cdot \left(1 - \frac{h \cdot \left(0.5 \cdot {\left(\frac{D}{d} \cdot \left(0.5 \cdot M\right)\right)}^{2}\right)}{\ell}\right)\\
\mathbf{elif}\;t_0 \leq 0 \lor \neg \left(t_0 \leq 10^{+241}\right):\\
\;\;\;\;\frac{\left|d\right|}{\sqrt{h \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\left(1 - h \cdot \frac{{\left(D \cdot \frac{0.5}{\frac{d}{M}}\right)}^{2}}{\frac{\ell}{0.5}}\right) \cdot t_1\\
\end{array}
\end{array}
if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 1 2)) (pow.f64 (/.f64 d l) (/.f64 1 2))) (-.f64 1 (*.f64 (*.f64 (/.f64 1 2) (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2)) (/.f64 h l)))) < -4.9999999999999999e-150Initial program 90.9%
metadata-eval90.9%
unpow1/290.9%
metadata-eval90.9%
unpow1/290.9%
*-commutative90.9%
associate-*l*90.9%
times-frac90.9%
metadata-eval90.9%
Simplified90.9%
associate-*r*90.9%
frac-times90.9%
*-commutative90.9%
metadata-eval90.9%
associate-*r/90.9%
metadata-eval90.9%
*-commutative90.9%
frac-times90.9%
*-commutative90.9%
div-inv90.9%
metadata-eval90.9%
Applied egg-rr90.9%
if -4.9999999999999999e-150 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 1 2)) (pow.f64 (/.f64 d l) (/.f64 1 2))) (-.f64 1 (*.f64 (*.f64 (/.f64 1 2) (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2)) (/.f64 h l)))) < -0.0 or 1.0000000000000001e241 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 1 2)) (pow.f64 (/.f64 d l) (/.f64 1 2))) (-.f64 1 (*.f64 (*.f64 (/.f64 1 2) (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2)) (/.f64 h l)))) Initial program 27.1%
associate-*l*27.1%
metadata-eval27.1%
unpow1/227.1%
metadata-eval27.1%
unpow1/227.1%
sub-neg27.1%
+-commutative27.1%
*-commutative27.1%
associate-*l*27.1%
distribute-rgt-neg-in27.1%
*-commutative27.1%
Simplified27.1%
Taylor expanded in M around 0 34.5%
*-rgt-identity34.5%
expm1-log1p-u34.2%
expm1-udef31.6%
sqrt-unprod29.3%
Applied egg-rr29.3%
expm1-def31.9%
expm1-log1p32.0%
Simplified32.0%
Taylor expanded in d around 0 36.3%
unpow236.3%
*-commutative36.3%
Simplified36.3%
sqrt-div42.4%
Applied egg-rr42.4%
rem-sqrt-square63.7%
Simplified63.7%
if -0.0 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 1 2)) (pow.f64 (/.f64 d l) (/.f64 1 2))) (-.f64 1 (*.f64 (*.f64 (/.f64 1 2) (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2)) (/.f64 h l)))) < 1.0000000000000001e241Initial program 99.5%
metadata-eval99.5%
unpow1/299.5%
metadata-eval99.5%
unpow1/299.5%
*-commutative99.5%
associate-*l*99.5%
times-frac97.9%
metadata-eval97.9%
Simplified97.9%
associate-*r*97.9%
frac-times99.5%
*-commutative99.5%
metadata-eval99.5%
clear-num99.5%
un-div-inv99.5%
metadata-eval99.5%
*-commutative99.5%
frac-times97.9%
*-commutative97.9%
div-inv97.9%
metadata-eval97.9%
Applied egg-rr97.9%
associate-/r/97.9%
*-commutative97.9%
associate-/l*97.9%
/-rgt-identity97.9%
associate-/l*97.9%
metadata-eval97.9%
times-frac99.5%
associate-*r/99.5%
associate-/l/99.5%
metadata-eval99.5%
associate-/l*99.5%
/-rgt-identity99.5%
*-commutative99.5%
associate-/l*99.5%
Simplified99.5%
Final simplification81.3%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ d l))))
(if (<= d -1e-310)
(*
(* (/ (sqrt (- d)) (sqrt (- h))) t_0)
(- 1.0 (* h (/ (pow (* D (/ 0.5 (/ d M))) 2.0) (/ l 0.5)))))
(if (<= d 5.8e-224)
(* (/ (* (* D M) (* D M)) d) (* (/ (sqrt h) (pow l 1.5)) -0.125))
(*
(* t_0 (/ (sqrt d) (sqrt h)))
(- 1.0 (* (pow (* (/ M 2.0) (/ D d)) 2.0) (* 0.5 (/ h l)))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((d / l));
double tmp;
if (d <= -1e-310) {
tmp = ((sqrt(-d) / sqrt(-h)) * t_0) * (1.0 - (h * (pow((D * (0.5 / (d / M))), 2.0) / (l / 0.5))));
} else if (d <= 5.8e-224) {
tmp = (((D * M) * (D * M)) / d) * ((sqrt(h) / pow(l, 1.5)) * -0.125);
} else {
tmp = (t_0 * (sqrt(d) / sqrt(h))) * (1.0 - (pow(((M / 2.0) * (D / d)), 2.0) * (0.5 * (h / l))));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: t_0
real(8) :: tmp
t_0 = sqrt((d / l))
if (d <= (-1d-310)) then
tmp = ((sqrt(-d) / sqrt(-h)) * t_0) * (1.0d0 - (h * (((d_1 * (0.5d0 / (d / m))) ** 2.0d0) / (l / 0.5d0))))
else if (d <= 5.8d-224) then
tmp = (((d_1 * m) * (d_1 * m)) / d) * ((sqrt(h) / (l ** 1.5d0)) * (-0.125d0))
else
tmp = (t_0 * (sqrt(d) / sqrt(h))) * (1.0d0 - ((((m / 2.0d0) * (d_1 / d)) ** 2.0d0) * (0.5d0 * (h / l))))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.sqrt((d / l));
double tmp;
if (d <= -1e-310) {
tmp = ((Math.sqrt(-d) / Math.sqrt(-h)) * t_0) * (1.0 - (h * (Math.pow((D * (0.5 / (d / M))), 2.0) / (l / 0.5))));
} else if (d <= 5.8e-224) {
tmp = (((D * M) * (D * M)) / d) * ((Math.sqrt(h) / Math.pow(l, 1.5)) * -0.125);
} else {
tmp = (t_0 * (Math.sqrt(d) / Math.sqrt(h))) * (1.0 - (Math.pow(((M / 2.0) * (D / d)), 2.0) * (0.5 * (h / l))));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt((d / l)) tmp = 0 if d <= -1e-310: tmp = ((math.sqrt(-d) / math.sqrt(-h)) * t_0) * (1.0 - (h * (math.pow((D * (0.5 / (d / M))), 2.0) / (l / 0.5)))) elif d <= 5.8e-224: tmp = (((D * M) * (D * M)) / d) * ((math.sqrt(h) / math.pow(l, 1.5)) * -0.125) else: tmp = (t_0 * (math.sqrt(d) / math.sqrt(h))) * (1.0 - (math.pow(((M / 2.0) * (D / d)), 2.0) * (0.5 * (h / l)))) return tmp
function code(d, h, l, M, D) t_0 = sqrt(Float64(d / l)) tmp = 0.0 if (d <= -1e-310) tmp = Float64(Float64(Float64(sqrt(Float64(-d)) / sqrt(Float64(-h))) * t_0) * Float64(1.0 - Float64(h * Float64((Float64(D * Float64(0.5 / Float64(d / M))) ^ 2.0) / Float64(l / 0.5))))); elseif (d <= 5.8e-224) tmp = Float64(Float64(Float64(Float64(D * M) * Float64(D * M)) / d) * Float64(Float64(sqrt(h) / (l ^ 1.5)) * -0.125)); else tmp = Float64(Float64(t_0 * Float64(sqrt(d) / sqrt(h))) * Float64(1.0 - Float64((Float64(Float64(M / 2.0) * Float64(D / d)) ^ 2.0) * Float64(0.5 * Float64(h / l))))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = sqrt((d / l)); tmp = 0.0; if (d <= -1e-310) tmp = ((sqrt(-d) / sqrt(-h)) * t_0) * (1.0 - (h * (((D * (0.5 / (d / M))) ^ 2.0) / (l / 0.5)))); elseif (d <= 5.8e-224) tmp = (((D * M) * (D * M)) / d) * ((sqrt(h) / (l ^ 1.5)) * -0.125); else tmp = (t_0 * (sqrt(d) / sqrt(h))) * (1.0 - ((((M / 2.0) * (D / d)) ^ 2.0) * (0.5 * (h / l)))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[d, -1e-310], N[(N[(N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision] * N[(1.0 - N[(h * N[(N[Power[N[(D * N[(0.5 / N[(d / M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] / N[(l / 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 5.8e-224], N[(N[(N[(N[(D * M), $MachinePrecision] * N[(D * M), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision] * N[(N[(N[Sqrt[h], $MachinePrecision] / N[Power[l, 1.5], $MachinePrecision]), $MachinePrecision] * -0.125), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$0 * N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[Power[N[(N[(M / 2.0), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(0.5 * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{\ell}}\\
\mathbf{if}\;d \leq -1 \cdot 10^{-310}:\\
\;\;\;\;\left(\frac{\sqrt{-d}}{\sqrt{-h}} \cdot t_0\right) \cdot \left(1 - h \cdot \frac{{\left(D \cdot \frac{0.5}{\frac{d}{M}}\right)}^{2}}{\frac{\ell}{0.5}}\right)\\
\mathbf{elif}\;d \leq 5.8 \cdot 10^{-224}:\\
\;\;\;\;\frac{\left(D \cdot M\right) \cdot \left(D \cdot M\right)}{d} \cdot \left(\frac{\sqrt{h}}{{\ell}^{1.5}} \cdot -0.125\right)\\
\mathbf{else}:\\
\;\;\;\;\left(t_0 \cdot \frac{\sqrt{d}}{\sqrt{h}}\right) \cdot \left(1 - {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)\\
\end{array}
\end{array}
if d < -9.999999999999969e-311Initial program 65.9%
metadata-eval65.9%
unpow1/265.9%
metadata-eval65.9%
unpow1/265.9%
*-commutative65.9%
associate-*l*65.9%
times-frac65.9%
metadata-eval65.9%
Simplified65.9%
associate-*r*65.9%
frac-times65.9%
*-commutative65.9%
metadata-eval65.9%
clear-num65.9%
un-div-inv66.8%
metadata-eval66.8%
*-commutative66.8%
frac-times66.8%
*-commutative66.8%
div-inv66.8%
metadata-eval66.8%
Applied egg-rr66.8%
associate-/r/69.5%
*-commutative69.5%
associate-/l*69.5%
/-rgt-identity69.5%
associate-/l*69.5%
metadata-eval69.5%
times-frac69.4%
associate-*r/69.4%
associate-/l/69.4%
metadata-eval69.4%
associate-/l*69.4%
/-rgt-identity69.4%
*-commutative69.4%
associate-/l*69.4%
Simplified69.4%
frac-2neg69.4%
sqrt-div80.6%
Applied egg-rr80.6%
if -9.999999999999969e-311 < d < 5.8000000000000001e-224Initial program 34.0%
metadata-eval34.0%
unpow1/234.0%
metadata-eval34.0%
unpow1/234.0%
*-commutative34.0%
associate-*l*34.0%
times-frac22.9%
metadata-eval22.9%
Simplified22.9%
associate-*r*22.9%
frac-times34.0%
*-commutative34.0%
metadata-eval34.0%
clear-num34.0%
un-div-inv34.0%
metadata-eval34.0%
*-commutative34.0%
frac-times22.9%
*-commutative22.9%
div-inv22.9%
metadata-eval22.9%
Applied egg-rr22.9%
associate-/r/23.2%
*-commutative23.2%
associate-/l*23.2%
/-rgt-identity23.2%
associate-/l*23.2%
metadata-eval23.2%
times-frac34.2%
associate-*r/34.2%
associate-/l/34.2%
metadata-eval34.2%
associate-/l*34.2%
/-rgt-identity34.2%
*-commutative34.2%
associate-/l*34.2%
Simplified34.2%
Taylor expanded in d around 0 28.6%
*-commutative28.6%
associate-*l*28.6%
unpow228.6%
unpow228.6%
unswap-sqr45.4%
Simplified45.4%
sqrt-div45.4%
Applied egg-rr45.4%
sqr-pow45.4%
rem-sqrt-square72.2%
sqr-pow72.2%
fabs-sqr72.2%
sqr-pow72.2%
metadata-eval72.2%
Simplified72.2%
if 5.8000000000000001e-224 < d Initial program 70.2%
metadata-eval70.2%
unpow1/270.2%
metadata-eval70.2%
unpow1/270.2%
*-commutative70.2%
associate-*l*70.2%
times-frac71.0%
metadata-eval71.0%
Simplified71.0%
sqrt-div80.3%
div-inv80.2%
Applied egg-rr80.2%
associate-*r/80.3%
*-rgt-identity80.3%
Simplified80.3%
Final simplification79.9%
(FPCore (d h l M D)
:precision binary64
(if (<= D 7.2e+46)
(/ (fabs d) (sqrt (* h l)))
(*
(- 1.0 (* h (/ (pow (* D (/ 0.5 (/ d M))) 2.0) (/ l 0.5))))
(* (sqrt (/ d l)) (sqrt (/ d h))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (D <= 7.2e+46) {
tmp = fabs(d) / sqrt((h * l));
} else {
tmp = (1.0 - (h * (pow((D * (0.5 / (d / M))), 2.0) / (l / 0.5)))) * (sqrt((d / l)) * sqrt((d / h)));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (d_1 <= 7.2d+46) then
tmp = abs(d) / sqrt((h * l))
else
tmp = (1.0d0 - (h * (((d_1 * (0.5d0 / (d / m))) ** 2.0d0) / (l / 0.5d0)))) * (sqrt((d / l)) * sqrt((d / h)))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (D <= 7.2e+46) {
tmp = Math.abs(d) / Math.sqrt((h * l));
} else {
tmp = (1.0 - (h * (Math.pow((D * (0.5 / (d / M))), 2.0) / (l / 0.5)))) * (Math.sqrt((d / l)) * Math.sqrt((d / h)));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if D <= 7.2e+46: tmp = math.fabs(d) / math.sqrt((h * l)) else: tmp = (1.0 - (h * (math.pow((D * (0.5 / (d / M))), 2.0) / (l / 0.5)))) * (math.sqrt((d / l)) * math.sqrt((d / h))) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (D <= 7.2e+46) tmp = Float64(abs(d) / sqrt(Float64(h * l))); else tmp = Float64(Float64(1.0 - Float64(h * Float64((Float64(D * Float64(0.5 / Float64(d / M))) ^ 2.0) / Float64(l / 0.5)))) * Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (D <= 7.2e+46) tmp = abs(d) / sqrt((h * l)); else tmp = (1.0 - (h * (((D * (0.5 / (d / M))) ^ 2.0) / (l / 0.5)))) * (sqrt((d / l)) * sqrt((d / h))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[D, 7.2e+46], N[(N[Abs[d], $MachinePrecision] / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - N[(h * N[(N[Power[N[(D * N[(0.5 / N[(d / M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] / N[(l / 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;D \leq 7.2 \cdot 10^{+46}:\\
\;\;\;\;\frac{\left|d\right|}{\sqrt{h \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\left(1 - h \cdot \frac{{\left(D \cdot \frac{0.5}{\frac{d}{M}}\right)}^{2}}{\frac{\ell}{0.5}}\right) \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right)\\
\end{array}
\end{array}
if D < 7.1999999999999997e46Initial program 65.2%
associate-*l*64.7%
metadata-eval64.7%
unpow1/264.7%
metadata-eval64.7%
unpow1/264.7%
sub-neg64.7%
+-commutative64.7%
*-commutative64.7%
associate-*l*64.7%
distribute-rgt-neg-in64.7%
*-commutative64.7%
Simplified64.3%
Taylor expanded in M around 0 45.2%
*-rgt-identity45.2%
expm1-log1p-u44.0%
expm1-udef29.6%
sqrt-unprod25.9%
Applied egg-rr25.9%
expm1-def37.6%
expm1-log1p38.4%
Simplified38.4%
Taylor expanded in d around 0 32.7%
unpow232.7%
*-commutative32.7%
Simplified32.7%
sqrt-div39.2%
Applied egg-rr39.2%
rem-sqrt-square53.9%
Simplified53.9%
if 7.1999999999999997e46 < D Initial program 67.2%
metadata-eval67.2%
unpow1/267.2%
metadata-eval67.2%
unpow1/267.2%
*-commutative67.2%
associate-*l*67.2%
times-frac67.1%
metadata-eval67.1%
Simplified67.1%
associate-*r*67.1%
frac-times67.2%
*-commutative67.2%
metadata-eval67.2%
clear-num65.3%
un-div-inv65.3%
metadata-eval65.3%
*-commutative65.3%
frac-times65.2%
*-commutative65.2%
div-inv65.2%
metadata-eval65.2%
Applied egg-rr65.2%
associate-/r/67.1%
*-commutative67.1%
associate-/l*67.1%
/-rgt-identity67.1%
associate-/l*67.1%
metadata-eval67.1%
times-frac67.2%
associate-*r/65.3%
associate-/l/65.3%
metadata-eval65.3%
associate-/l*65.3%
/-rgt-identity65.3%
*-commutative65.3%
associate-/l*65.3%
Simplified65.3%
Final simplification56.2%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (* (sqrt (/ d l)) (sqrt (/ d h))))
(t_1 (/ (fabs d) (sqrt (* h l)))))
(if (<= M 6.4e-284)
t_1
(if (<= M 4.4e-267)
(* t_0 (- 1.0 (* h (* (/ (* D M) (/ l (* D M))) (/ 0.125 (* d d))))))
(if (<= M 7e-247)
t_1
(if (<= M 1.35e-220)
(*
(sqrt (* (/ d l) (/ d h)))
(+ 1.0 (* (* h (/ (pow (* 0.5 (/ (* D M) d)) 2.0) l)) -0.5)))
(if (<= M 3.2e-140)
t_1
(*
t_0
(-
1.0
(* (* (/ D d) (/ D d)) (* 0.125 (/ (* M (* h M)) l))))))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((d / l)) * sqrt((d / h));
double t_1 = fabs(d) / sqrt((h * l));
double tmp;
if (M <= 6.4e-284) {
tmp = t_1;
} else if (M <= 4.4e-267) {
tmp = t_0 * (1.0 - (h * (((D * M) / (l / (D * M))) * (0.125 / (d * d)))));
} else if (M <= 7e-247) {
tmp = t_1;
} else if (M <= 1.35e-220) {
tmp = sqrt(((d / l) * (d / h))) * (1.0 + ((h * (pow((0.5 * ((D * M) / d)), 2.0) / l)) * -0.5));
} else if (M <= 3.2e-140) {
tmp = t_1;
} else {
tmp = t_0 * (1.0 - (((D / d) * (D / d)) * (0.125 * ((M * (h * M)) / l))));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = sqrt((d / l)) * sqrt((d / h))
t_1 = abs(d) / sqrt((h * l))
if (m <= 6.4d-284) then
tmp = t_1
else if (m <= 4.4d-267) then
tmp = t_0 * (1.0d0 - (h * (((d_1 * m) / (l / (d_1 * m))) * (0.125d0 / (d * d)))))
else if (m <= 7d-247) then
tmp = t_1
else if (m <= 1.35d-220) then
tmp = sqrt(((d / l) * (d / h))) * (1.0d0 + ((h * (((0.5d0 * ((d_1 * m) / d)) ** 2.0d0) / l)) * (-0.5d0)))
else if (m <= 3.2d-140) then
tmp = t_1
else
tmp = t_0 * (1.0d0 - (((d_1 / d) * (d_1 / d)) * (0.125d0 * ((m * (h * m)) / l))))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.sqrt((d / l)) * Math.sqrt((d / h));
double t_1 = Math.abs(d) / Math.sqrt((h * l));
double tmp;
if (M <= 6.4e-284) {
tmp = t_1;
} else if (M <= 4.4e-267) {
tmp = t_0 * (1.0 - (h * (((D * M) / (l / (D * M))) * (0.125 / (d * d)))));
} else if (M <= 7e-247) {
tmp = t_1;
} else if (M <= 1.35e-220) {
tmp = Math.sqrt(((d / l) * (d / h))) * (1.0 + ((h * (Math.pow((0.5 * ((D * M) / d)), 2.0) / l)) * -0.5));
} else if (M <= 3.2e-140) {
tmp = t_1;
} else {
tmp = t_0 * (1.0 - (((D / d) * (D / d)) * (0.125 * ((M * (h * M)) / l))));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt((d / l)) * math.sqrt((d / h)) t_1 = math.fabs(d) / math.sqrt((h * l)) tmp = 0 if M <= 6.4e-284: tmp = t_1 elif M <= 4.4e-267: tmp = t_0 * (1.0 - (h * (((D * M) / (l / (D * M))) * (0.125 / (d * d))))) elif M <= 7e-247: tmp = t_1 elif M <= 1.35e-220: tmp = math.sqrt(((d / l) * (d / h))) * (1.0 + ((h * (math.pow((0.5 * ((D * M) / d)), 2.0) / l)) * -0.5)) elif M <= 3.2e-140: tmp = t_1 else: tmp = t_0 * (1.0 - (((D / d) * (D / d)) * (0.125 * ((M * (h * M)) / l)))) return tmp
function code(d, h, l, M, D) t_0 = Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))) t_1 = Float64(abs(d) / sqrt(Float64(h * l))) tmp = 0.0 if (M <= 6.4e-284) tmp = t_1; elseif (M <= 4.4e-267) tmp = Float64(t_0 * Float64(1.0 - Float64(h * Float64(Float64(Float64(D * M) / Float64(l / Float64(D * M))) * Float64(0.125 / Float64(d * d)))))); elseif (M <= 7e-247) tmp = t_1; elseif (M <= 1.35e-220) tmp = Float64(sqrt(Float64(Float64(d / l) * Float64(d / h))) * Float64(1.0 + Float64(Float64(h * Float64((Float64(0.5 * Float64(Float64(D * M) / d)) ^ 2.0) / l)) * -0.5))); elseif (M <= 3.2e-140) tmp = t_1; else tmp = Float64(t_0 * Float64(1.0 - Float64(Float64(Float64(D / d) * Float64(D / d)) * Float64(0.125 * Float64(Float64(M * Float64(h * M)) / l))))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = sqrt((d / l)) * sqrt((d / h)); t_1 = abs(d) / sqrt((h * l)); tmp = 0.0; if (M <= 6.4e-284) tmp = t_1; elseif (M <= 4.4e-267) tmp = t_0 * (1.0 - (h * (((D * M) / (l / (D * M))) * (0.125 / (d * d))))); elseif (M <= 7e-247) tmp = t_1; elseif (M <= 1.35e-220) tmp = sqrt(((d / l) * (d / h))) * (1.0 + ((h * (((0.5 * ((D * M) / d)) ^ 2.0) / l)) * -0.5)); elseif (M <= 3.2e-140) tmp = t_1; else tmp = t_0 * (1.0 - (((D / d) * (D / d)) * (0.125 * ((M * (h * M)) / l)))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Abs[d], $MachinePrecision] / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[M, 6.4e-284], t$95$1, If[LessEqual[M, 4.4e-267], N[(t$95$0 * N[(1.0 - N[(h * N[(N[(N[(D * M), $MachinePrecision] / N[(l / N[(D * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(0.125 / N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[M, 7e-247], t$95$1, If[LessEqual[M, 1.35e-220], N[(N[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(N[(h * N[(N[Power[N[(0.5 * N[(N[(D * M), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[M, 3.2e-140], t$95$1, N[(t$95$0 * N[(1.0 - N[(N[(N[(D / d), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision] * N[(0.125 * N[(N[(M * N[(h * M), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\
t_1 := \frac{\left|d\right|}{\sqrt{h \cdot \ell}}\\
\mathbf{if}\;M \leq 6.4 \cdot 10^{-284}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;M \leq 4.4 \cdot 10^{-267}:\\
\;\;\;\;t_0 \cdot \left(1 - h \cdot \left(\frac{D \cdot M}{\frac{\ell}{D \cdot M}} \cdot \frac{0.125}{d \cdot d}\right)\right)\\
\mathbf{elif}\;M \leq 7 \cdot 10^{-247}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;M \leq 1.35 \cdot 10^{-220}:\\
\;\;\;\;\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \cdot \left(1 + \left(h \cdot \frac{{\left(0.5 \cdot \frac{D \cdot M}{d}\right)}^{2}}{\ell}\right) \cdot -0.5\right)\\
\mathbf{elif}\;M \leq 3.2 \cdot 10^{-140}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0 \cdot \left(1 - \left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \left(0.125 \cdot \frac{M \cdot \left(h \cdot M\right)}{\ell}\right)\right)\\
\end{array}
\end{array}
if M < 6.40000000000000047e-284 or 4.39999999999999976e-267 < M < 6.9999999999999998e-247 or 1.35e-220 < M < 3.2000000000000001e-140Initial program 63.0%
associate-*l*62.9%
metadata-eval62.9%
unpow1/262.9%
metadata-eval62.9%
unpow1/262.9%
sub-neg62.9%
+-commutative62.9%
*-commutative62.9%
associate-*l*62.9%
distribute-rgt-neg-in62.9%
*-commutative62.9%
Simplified61.7%
Taylor expanded in M around 0 40.3%
*-rgt-identity40.3%
expm1-log1p-u38.8%
expm1-udef28.6%
sqrt-unprod24.4%
Applied egg-rr24.4%
expm1-def33.2%
expm1-log1p34.2%
Simplified34.2%
Taylor expanded in d around 0 30.0%
unpow230.0%
*-commutative30.0%
Simplified30.0%
sqrt-div37.2%
Applied egg-rr37.2%
rem-sqrt-square52.4%
Simplified52.4%
if 6.40000000000000047e-284 < M < 4.39999999999999976e-267Initial program 100.0%
metadata-eval100.0%
unpow1/2100.0%
metadata-eval100.0%
unpow1/2100.0%
*-commutative100.0%
associate-*l*100.0%
times-frac100.0%
metadata-eval100.0%
Simplified100.0%
associate-*r*100.0%
frac-times100.0%
*-commutative100.0%
metadata-eval100.0%
clear-num100.0%
un-div-inv100.0%
metadata-eval100.0%
*-commutative100.0%
frac-times100.0%
*-commutative100.0%
div-inv100.0%
metadata-eval100.0%
Applied egg-rr100.0%
associate-/r/100.0%
*-commutative100.0%
associate-/l*100.0%
/-rgt-identity100.0%
associate-/l*100.0%
metadata-eval100.0%
times-frac100.0%
associate-*r/100.0%
associate-/l/100.0%
metadata-eval100.0%
associate-/l*100.0%
/-rgt-identity100.0%
*-commutative100.0%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in D around 0 100.0%
associate-*r/100.0%
*-commutative100.0%
times-frac100.0%
*-commutative100.0%
unpow2100.0%
unpow2100.0%
unswap-sqr100.0%
associate-/l*100.0%
*-commutative100.0%
*-commutative100.0%
unpow2100.0%
Simplified100.0%
if 6.9999999999999998e-247 < M < 1.35e-220Initial program 79.7%
metadata-eval79.7%
unpow1/279.7%
metadata-eval79.7%
unpow1/279.7%
*-commutative79.7%
associate-*l*79.7%
times-frac79.4%
metadata-eval79.4%
Simplified79.4%
associate-*r*79.4%
frac-times79.7%
*-commutative79.7%
metadata-eval79.7%
clear-num79.7%
un-div-inv79.7%
metadata-eval79.7%
*-commutative79.7%
frac-times79.2%
*-commutative79.2%
div-inv79.2%
metadata-eval79.2%
Applied egg-rr79.2%
associate-/r/80.2%
*-commutative80.2%
associate-/l*80.2%
/-rgt-identity80.2%
associate-/l*80.2%
metadata-eval80.2%
times-frac80.6%
associate-*r/80.2%
associate-/l/80.2%
metadata-eval80.2%
associate-/l*80.2%
/-rgt-identity80.2%
*-commutative80.2%
associate-/l*80.2%
Simplified80.2%
expm1-log1p-u38.9%
expm1-udef19.7%
sqrt-unprod19.7%
associate-/r/19.7%
associate-/r/19.7%
Applied egg-rr19.7%
Simplified80.6%
if 3.2000000000000001e-140 < M Initial program 69.1%
metadata-eval69.1%
unpow1/269.1%
metadata-eval69.1%
unpow1/269.1%
*-commutative69.1%
associate-*l*69.1%
times-frac69.2%
metadata-eval69.2%
Simplified69.2%
Taylor expanded in M around 0 48.8%
*-commutative48.8%
*-commutative48.8%
times-frac47.6%
*-commutative47.6%
associate-*l*47.6%
unpow247.6%
unpow247.6%
times-frac62.1%
unpow262.1%
associate-*r*62.2%
Simplified62.2%
Final simplification56.6%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0
(*
(* (sqrt (/ d l)) (sqrt (/ d h)))
(- 1.0 (* h (* (/ (* D M) (/ l (* D M))) (/ 0.125 (* d d))))))))
(if (<= d -1.45e+169)
(* d (- (sqrt (/ (/ 1.0 l) h))))
(if (<= d -1e-309)
t_0
(if (<= d 1.08e-106)
(* (/ (* (* D M) (* D M)) d) (* (/ (sqrt h) (pow l 1.5)) -0.125))
(if (<= d 5.9e+119) t_0 (* d (sqrt (/ 1.0 (* h l))))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = (sqrt((d / l)) * sqrt((d / h))) * (1.0 - (h * (((D * M) / (l / (D * M))) * (0.125 / (d * d)))));
double tmp;
if (d <= -1.45e+169) {
tmp = d * -sqrt(((1.0 / l) / h));
} else if (d <= -1e-309) {
tmp = t_0;
} else if (d <= 1.08e-106) {
tmp = (((D * M) * (D * M)) / d) * ((sqrt(h) / pow(l, 1.5)) * -0.125);
} else if (d <= 5.9e+119) {
tmp = t_0;
} else {
tmp = d * sqrt((1.0 / (h * l)));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: t_0
real(8) :: tmp
t_0 = (sqrt((d / l)) * sqrt((d / h))) * (1.0d0 - (h * (((d_1 * m) / (l / (d_1 * m))) * (0.125d0 / (d * d)))))
if (d <= (-1.45d+169)) then
tmp = d * -sqrt(((1.0d0 / l) / h))
else if (d <= (-1d-309)) then
tmp = t_0
else if (d <= 1.08d-106) then
tmp = (((d_1 * m) * (d_1 * m)) / d) * ((sqrt(h) / (l ** 1.5d0)) * (-0.125d0))
else if (d <= 5.9d+119) then
tmp = t_0
else
tmp = d * sqrt((1.0d0 / (h * l)))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = (Math.sqrt((d / l)) * Math.sqrt((d / h))) * (1.0 - (h * (((D * M) / (l / (D * M))) * (0.125 / (d * d)))));
double tmp;
if (d <= -1.45e+169) {
tmp = d * -Math.sqrt(((1.0 / l) / h));
} else if (d <= -1e-309) {
tmp = t_0;
} else if (d <= 1.08e-106) {
tmp = (((D * M) * (D * M)) / d) * ((Math.sqrt(h) / Math.pow(l, 1.5)) * -0.125);
} else if (d <= 5.9e+119) {
tmp = t_0;
} else {
tmp = d * Math.sqrt((1.0 / (h * l)));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = (math.sqrt((d / l)) * math.sqrt((d / h))) * (1.0 - (h * (((D * M) / (l / (D * M))) * (0.125 / (d * d))))) tmp = 0 if d <= -1.45e+169: tmp = d * -math.sqrt(((1.0 / l) / h)) elif d <= -1e-309: tmp = t_0 elif d <= 1.08e-106: tmp = (((D * M) * (D * M)) / d) * ((math.sqrt(h) / math.pow(l, 1.5)) * -0.125) elif d <= 5.9e+119: tmp = t_0 else: tmp = d * math.sqrt((1.0 / (h * l))) return tmp
function code(d, h, l, M, D) t_0 = Float64(Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))) * Float64(1.0 - Float64(h * Float64(Float64(Float64(D * M) / Float64(l / Float64(D * M))) * Float64(0.125 / Float64(d * d)))))) tmp = 0.0 if (d <= -1.45e+169) tmp = Float64(d * Float64(-sqrt(Float64(Float64(1.0 / l) / h)))); elseif (d <= -1e-309) tmp = t_0; elseif (d <= 1.08e-106) tmp = Float64(Float64(Float64(Float64(D * M) * Float64(D * M)) / d) * Float64(Float64(sqrt(h) / (l ^ 1.5)) * -0.125)); elseif (d <= 5.9e+119) tmp = t_0; else tmp = Float64(d * sqrt(Float64(1.0 / Float64(h * l)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = (sqrt((d / l)) * sqrt((d / h))) * (1.0 - (h * (((D * M) / (l / (D * M))) * (0.125 / (d * d))))); tmp = 0.0; if (d <= -1.45e+169) tmp = d * -sqrt(((1.0 / l) / h)); elseif (d <= -1e-309) tmp = t_0; elseif (d <= 1.08e-106) tmp = (((D * M) * (D * M)) / d) * ((sqrt(h) / (l ^ 1.5)) * -0.125); elseif (d <= 5.9e+119) tmp = t_0; else tmp = d * sqrt((1.0 / (h * l))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(h * N[(N[(N[(D * M), $MachinePrecision] / N[(l / N[(D * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(0.125 / N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -1.45e+169], N[(d * (-N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], If[LessEqual[d, -1e-309], t$95$0, If[LessEqual[d, 1.08e-106], N[(N[(N[(N[(D * M), $MachinePrecision] * N[(D * M), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision] * N[(N[(N[Sqrt[h], $MachinePrecision] / N[Power[l, 1.5], $MachinePrecision]), $MachinePrecision] * -0.125), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 5.9e+119], t$95$0, N[(d * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - h \cdot \left(\frac{D \cdot M}{\frac{\ell}{D \cdot M}} \cdot \frac{0.125}{d \cdot d}\right)\right)\\
\mathbf{if}\;d \leq -1.45 \cdot 10^{+169}:\\
\;\;\;\;d \cdot \left(-\sqrt{\frac{\frac{1}{\ell}}{h}}\right)\\
\mathbf{elif}\;d \leq -1 \cdot 10^{-309}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;d \leq 1.08 \cdot 10^{-106}:\\
\;\;\;\;\frac{\left(D \cdot M\right) \cdot \left(D \cdot M\right)}{d} \cdot \left(\frac{\sqrt{h}}{{\ell}^{1.5}} \cdot -0.125\right)\\
\mathbf{elif}\;d \leq 5.9 \cdot 10^{+119}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;d \cdot \sqrt{\frac{1}{h \cdot \ell}}\\
\end{array}
\end{array}
if d < -1.45e169Initial program 68.7%
metadata-eval68.7%
unpow1/268.7%
metadata-eval68.7%
unpow1/268.7%
*-commutative68.7%
associate-*l*68.7%
times-frac68.9%
metadata-eval68.9%
Simplified68.9%
Taylor expanded in M around 0 39.4%
*-commutative39.4%
*-commutative39.4%
times-frac36.0%
*-commutative36.0%
associate-*l*36.0%
unpow236.0%
unpow236.0%
times-frac65.5%
unpow265.5%
associate-*r*65.8%
Simplified65.8%
clear-num65.8%
sqrt-div68.6%
metadata-eval68.6%
Applied egg-rr68.6%
Taylor expanded in d around -inf 80.6%
mul-1-neg80.6%
*-commutative80.6%
distribute-rgt-neg-in80.6%
associate-/r*81.2%
Simplified81.2%
if -1.45e169 < d < -1.000000000000002e-309 or 1.08e-106 < d < 5.9000000000000001e119Initial program 70.7%
metadata-eval70.7%
unpow1/270.7%
metadata-eval70.7%
unpow1/270.7%
*-commutative70.7%
associate-*l*70.7%
times-frac70.7%
metadata-eval70.7%
Simplified70.7%
associate-*r*70.7%
frac-times70.7%
*-commutative70.7%
metadata-eval70.7%
clear-num69.9%
un-div-inv70.6%
metadata-eval70.6%
*-commutative70.6%
frac-times70.6%
*-commutative70.6%
div-inv70.6%
metadata-eval70.6%
Applied egg-rr70.6%
associate-/r/74.4%
*-commutative74.4%
associate-/l*74.4%
/-rgt-identity74.4%
associate-/l*74.4%
metadata-eval74.4%
times-frac74.4%
associate-*r/73.7%
associate-/l/73.7%
metadata-eval73.7%
associate-/l*73.7%
/-rgt-identity73.7%
*-commutative73.7%
associate-/l*73.6%
Simplified73.6%
Taylor expanded in D around 0 58.3%
associate-*r/58.3%
*-commutative58.3%
times-frac60.0%
*-commutative60.0%
unpow260.0%
unpow260.0%
unswap-sqr68.9%
associate-/l*72.1%
*-commutative72.1%
*-commutative72.1%
unpow272.1%
Simplified72.1%
if -1.000000000000002e-309 < d < 1.08e-106Initial program 49.9%
metadata-eval49.9%
unpow1/249.9%
metadata-eval49.9%
unpow1/249.9%
*-commutative49.9%
associate-*l*49.9%
times-frac45.6%
metadata-eval45.6%
Simplified45.6%
associate-*r*45.6%
frac-times49.9%
*-commutative49.9%
metadata-eval49.9%
clear-num49.9%
un-div-inv49.9%
metadata-eval49.9%
*-commutative49.9%
frac-times45.6%
*-commutative45.6%
div-inv45.6%
metadata-eval45.6%
Applied egg-rr45.6%
associate-/r/45.7%
*-commutative45.7%
associate-/l*45.7%
/-rgt-identity45.7%
associate-/l*45.7%
metadata-eval45.7%
times-frac50.0%
associate-*r/49.9%
associate-/l/49.9%
metadata-eval49.9%
associate-/l*49.9%
/-rgt-identity49.9%
*-commutative49.9%
associate-/l*49.9%
Simplified49.9%
Taylor expanded in d around 0 30.8%
*-commutative30.8%
associate-*l*30.8%
unpow230.8%
unpow230.8%
unswap-sqr48.0%
Simplified48.0%
sqrt-div50.1%
Applied egg-rr50.1%
sqr-pow50.1%
rem-sqrt-square66.6%
sqr-pow66.6%
fabs-sqr66.6%
sqr-pow66.6%
metadata-eval66.6%
Simplified66.6%
if 5.9000000000000001e119 < d Initial program 64.0%
metadata-eval64.0%
unpow1/264.0%
metadata-eval64.0%
unpow1/264.0%
*-commutative64.0%
associate-*l*64.0%
times-frac66.5%
metadata-eval66.5%
Simplified66.5%
associate-*r*66.5%
frac-times64.0%
*-commutative64.0%
metadata-eval64.0%
clear-num64.0%
un-div-inv64.0%
metadata-eval64.0%
*-commutative64.0%
frac-times66.5%
*-commutative66.5%
div-inv66.5%
metadata-eval66.5%
Applied egg-rr66.5%
associate-/r/69.3%
*-commutative69.3%
associate-/l*69.3%
/-rgt-identity69.3%
associate-/l*69.3%
metadata-eval69.3%
times-frac66.8%
associate-*r/69.3%
associate-/l/69.3%
metadata-eval69.3%
associate-/l*69.3%
/-rgt-identity69.3%
*-commutative69.3%
associate-/l*69.3%
Simplified69.3%
Taylor expanded in d around inf 70.7%
Final simplification72.0%
(FPCore (d h l M D)
:precision binary64
(if (<= D 7.5e+49)
(/ (fabs d) (sqrt (* h l)))
(*
(sqrt (* (/ d l) (/ d h)))
(+ 1.0 (* (* h (/ (pow (* 0.5 (/ (* D M) d)) 2.0) l)) -0.5)))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (D <= 7.5e+49) {
tmp = fabs(d) / sqrt((h * l));
} else {
tmp = sqrt(((d / l) * (d / h))) * (1.0 + ((h * (pow((0.5 * ((D * M) / d)), 2.0) / l)) * -0.5));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (d_1 <= 7.5d+49) then
tmp = abs(d) / sqrt((h * l))
else
tmp = sqrt(((d / l) * (d / h))) * (1.0d0 + ((h * (((0.5d0 * ((d_1 * m) / d)) ** 2.0d0) / l)) * (-0.5d0)))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (D <= 7.5e+49) {
tmp = Math.abs(d) / Math.sqrt((h * l));
} else {
tmp = Math.sqrt(((d / l) * (d / h))) * (1.0 + ((h * (Math.pow((0.5 * ((D * M) / d)), 2.0) / l)) * -0.5));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if D <= 7.5e+49: tmp = math.fabs(d) / math.sqrt((h * l)) else: tmp = math.sqrt(((d / l) * (d / h))) * (1.0 + ((h * (math.pow((0.5 * ((D * M) / d)), 2.0) / l)) * -0.5)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (D <= 7.5e+49) tmp = Float64(abs(d) / sqrt(Float64(h * l))); else tmp = Float64(sqrt(Float64(Float64(d / l) * Float64(d / h))) * Float64(1.0 + Float64(Float64(h * Float64((Float64(0.5 * Float64(Float64(D * M) / d)) ^ 2.0) / l)) * -0.5))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (D <= 7.5e+49) tmp = abs(d) / sqrt((h * l)); else tmp = sqrt(((d / l) * (d / h))) * (1.0 + ((h * (((0.5 * ((D * M) / d)) ^ 2.0) / l)) * -0.5)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[D, 7.5e+49], N[(N[Abs[d], $MachinePrecision] / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(N[(h * N[(N[Power[N[(0.5 * N[(N[(D * M), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;D \leq 7.5 \cdot 10^{+49}:\\
\;\;\;\;\frac{\left|d\right|}{\sqrt{h \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \cdot \left(1 + \left(h \cdot \frac{{\left(0.5 \cdot \frac{D \cdot M}{d}\right)}^{2}}{\ell}\right) \cdot -0.5\right)\\
\end{array}
\end{array}
if D < 7.4999999999999995e49Initial program 65.5%
associate-*l*65.0%
metadata-eval65.0%
unpow1/265.0%
metadata-eval65.0%
unpow1/265.0%
sub-neg65.0%
+-commutative65.0%
*-commutative65.0%
associate-*l*65.0%
distribute-rgt-neg-in65.0%
*-commutative65.0%
Simplified64.6%
Taylor expanded in M around 0 45.1%
*-rgt-identity45.1%
expm1-log1p-u43.9%
expm1-udef29.4%
sqrt-unprod25.7%
Applied egg-rr25.7%
expm1-def37.3%
expm1-log1p38.1%
Simplified38.1%
Taylor expanded in d around 0 32.4%
unpow232.4%
*-commutative32.4%
Simplified32.4%
sqrt-div39.1%
Applied egg-rr39.1%
rem-sqrt-square53.7%
Simplified53.7%
if 7.4999999999999995e49 < D Initial program 65.9%
metadata-eval65.9%
unpow1/265.9%
metadata-eval65.9%
unpow1/265.9%
*-commutative65.9%
associate-*l*65.9%
times-frac65.8%
metadata-eval65.8%
Simplified65.8%
associate-*r*65.8%
frac-times65.9%
*-commutative65.9%
metadata-eval65.9%
clear-num63.9%
un-div-inv63.9%
metadata-eval63.9%
*-commutative63.9%
frac-times63.8%
*-commutative63.8%
div-inv63.8%
metadata-eval63.8%
Applied egg-rr63.8%
associate-/r/65.8%
*-commutative65.8%
associate-/l*65.8%
/-rgt-identity65.8%
associate-/l*65.8%
metadata-eval65.8%
times-frac65.9%
associate-*r/63.9%
associate-/l/63.9%
metadata-eval63.9%
associate-/l*63.9%
/-rgt-identity63.9%
*-commutative63.9%
associate-/l*63.9%
Simplified63.9%
expm1-log1p-u12.0%
expm1-udef10.1%
sqrt-unprod8.3%
associate-/r/8.3%
associate-/r/8.3%
Applied egg-rr8.3%
Simplified53.7%
Final simplification53.7%
(FPCore (d h l M D)
:precision binary64
(if (<= M 3.8e-36)
(/ (fabs d) (sqrt (* h l)))
(*
(sqrt (/ (/ d h) (/ l d)))
(+ 1.0 (* -0.125 (* (/ (* D D) (* d d)) (/ (* M M) (/ l h))))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (M <= 3.8e-36) {
tmp = fabs(d) / sqrt((h * l));
} else {
tmp = sqrt(((d / h) / (l / d))) * (1.0 + (-0.125 * (((D * D) / (d * d)) * ((M * M) / (l / h)))));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (m <= 3.8d-36) then
tmp = abs(d) / sqrt((h * l))
else
tmp = sqrt(((d / h) / (l / d))) * (1.0d0 + ((-0.125d0) * (((d_1 * d_1) / (d * d)) * ((m * m) / (l / h)))))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (M <= 3.8e-36) {
tmp = Math.abs(d) / Math.sqrt((h * l));
} else {
tmp = Math.sqrt(((d / h) / (l / d))) * (1.0 + (-0.125 * (((D * D) / (d * d)) * ((M * M) / (l / h)))));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if M <= 3.8e-36: tmp = math.fabs(d) / math.sqrt((h * l)) else: tmp = math.sqrt(((d / h) / (l / d))) * (1.0 + (-0.125 * (((D * D) / (d * d)) * ((M * M) / (l / h))))) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (M <= 3.8e-36) tmp = Float64(abs(d) / sqrt(Float64(h * l))); else tmp = Float64(sqrt(Float64(Float64(d / h) / Float64(l / d))) * Float64(1.0 + Float64(-0.125 * Float64(Float64(Float64(D * D) / Float64(d * d)) * Float64(Float64(M * M) / Float64(l / h)))))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (M <= 3.8e-36) tmp = abs(d) / sqrt((h * l)); else tmp = sqrt(((d / h) / (l / d))) * (1.0 + (-0.125 * (((D * D) / (d * d)) * ((M * M) / (l / h))))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[M, 3.8e-36], N[(N[Abs[d], $MachinePrecision] / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(N[(d / h), $MachinePrecision] / N[(l / d), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(-0.125 * N[(N[(N[(D * D), $MachinePrecision] / N[(d * d), $MachinePrecision]), $MachinePrecision] * N[(N[(M * M), $MachinePrecision] / N[(l / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;M \leq 3.8 \cdot 10^{-36}:\\
\;\;\;\;\frac{\left|d\right|}{\sqrt{h \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 + -0.125 \cdot \left(\frac{D \cdot D}{d \cdot d} \cdot \frac{M \cdot M}{\frac{\ell}{h}}\right)\right)\\
\end{array}
\end{array}
if M < 3.79999999999999971e-36Initial program 64.1%
associate-*l*63.6%
metadata-eval63.6%
unpow1/263.6%
metadata-eval63.6%
unpow1/263.6%
sub-neg63.6%
+-commutative63.6%
*-commutative63.6%
associate-*l*63.6%
distribute-rgt-neg-in63.6%
*-commutative63.6%
Simplified62.5%
Taylor expanded in M around 0 42.6%
*-rgt-identity42.6%
expm1-log1p-u41.2%
expm1-udef27.9%
sqrt-unprod24.3%
Applied egg-rr24.3%
expm1-def34.9%
expm1-log1p35.8%
Simplified35.8%
Taylor expanded in d around 0 30.7%
unpow230.7%
*-commutative30.7%
Simplified30.7%
sqrt-div37.4%
Applied egg-rr37.4%
rem-sqrt-square52.0%
Simplified52.0%
if 3.79999999999999971e-36 < M Initial program 69.7%
metadata-eval69.7%
unpow1/269.7%
metadata-eval69.7%
unpow1/269.7%
*-commutative69.7%
associate-*l*69.7%
times-frac69.7%
metadata-eval69.7%
Simplified69.7%
sqrt-div41.3%
div-inv41.3%
Applied egg-rr41.3%
associate-*r/41.3%
*-rgt-identity41.3%
Simplified41.3%
pow141.3%
sqrt-div69.7%
sqrt-prod58.2%
frac-times48.1%
*-commutative48.1%
div-inv48.1%
metadata-eval48.1%
Applied egg-rr48.1%
unpow148.1%
times-frac58.2%
associate-*r/51.0%
associate-/l*58.2%
sub-neg58.2%
+-commutative58.2%
distribute-rgt-neg-in58.2%
fma-def58.2%
Simplified58.2%
Taylor expanded in D around 0 35.8%
+-commutative35.8%
fma-def35.8%
times-frac35.6%
unpow235.6%
unpow235.6%
times-frac48.9%
unpow248.9%
unpow248.9%
associate-*r*49.0%
associate-/l*50.5%
fma-def50.5%
*-commutative50.5%
associate-*r*50.5%
+-commutative50.5%
associate-*r*50.5%
*-commutative50.5%
Simplified35.6%
Final simplification47.6%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0
(*
(sqrt (/ (/ d h) (/ l d)))
(+ 1.0 (* -0.125 (* (/ (* D D) (* d d)) (/ (* M M) (/ l h)))))))
(t_1 (* d (- (sqrt (/ (/ 1.0 l) h))))))
(if (<= l -5.2e+96)
t_1
(if (<= l -4.8e-40)
t_0
(if (<= l -3.3e-245)
t_1
(if (<= l 1.5e-108) t_0 (* d (sqrt (/ 1.0 (* h l))))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt(((d / h) / (l / d))) * (1.0 + (-0.125 * (((D * D) / (d * d)) * ((M * M) / (l / h)))));
double t_1 = d * -sqrt(((1.0 / l) / h));
double tmp;
if (l <= -5.2e+96) {
tmp = t_1;
} else if (l <= -4.8e-40) {
tmp = t_0;
} else if (l <= -3.3e-245) {
tmp = t_1;
} else if (l <= 1.5e-108) {
tmp = t_0;
} else {
tmp = d * sqrt((1.0 / (h * l)));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = sqrt(((d / h) / (l / d))) * (1.0d0 + ((-0.125d0) * (((d_1 * d_1) / (d * d)) * ((m * m) / (l / h)))))
t_1 = d * -sqrt(((1.0d0 / l) / h))
if (l <= (-5.2d+96)) then
tmp = t_1
else if (l <= (-4.8d-40)) then
tmp = t_0
else if (l <= (-3.3d-245)) then
tmp = t_1
else if (l <= 1.5d-108) then
tmp = t_0
else
tmp = d * sqrt((1.0d0 / (h * l)))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.sqrt(((d / h) / (l / d))) * (1.0 + (-0.125 * (((D * D) / (d * d)) * ((M * M) / (l / h)))));
double t_1 = d * -Math.sqrt(((1.0 / l) / h));
double tmp;
if (l <= -5.2e+96) {
tmp = t_1;
} else if (l <= -4.8e-40) {
tmp = t_0;
} else if (l <= -3.3e-245) {
tmp = t_1;
} else if (l <= 1.5e-108) {
tmp = t_0;
} else {
tmp = d * Math.sqrt((1.0 / (h * l)));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt(((d / h) / (l / d))) * (1.0 + (-0.125 * (((D * D) / (d * d)) * ((M * M) / (l / h))))) t_1 = d * -math.sqrt(((1.0 / l) / h)) tmp = 0 if l <= -5.2e+96: tmp = t_1 elif l <= -4.8e-40: tmp = t_0 elif l <= -3.3e-245: tmp = t_1 elif l <= 1.5e-108: tmp = t_0 else: tmp = d * math.sqrt((1.0 / (h * l))) return tmp
function code(d, h, l, M, D) t_0 = Float64(sqrt(Float64(Float64(d / h) / Float64(l / d))) * Float64(1.0 + Float64(-0.125 * Float64(Float64(Float64(D * D) / Float64(d * d)) * Float64(Float64(M * M) / Float64(l / h)))))) t_1 = Float64(d * Float64(-sqrt(Float64(Float64(1.0 / l) / h)))) tmp = 0.0 if (l <= -5.2e+96) tmp = t_1; elseif (l <= -4.8e-40) tmp = t_0; elseif (l <= -3.3e-245) tmp = t_1; elseif (l <= 1.5e-108) tmp = t_0; else tmp = Float64(d * sqrt(Float64(1.0 / Float64(h * l)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = sqrt(((d / h) / (l / d))) * (1.0 + (-0.125 * (((D * D) / (d * d)) * ((M * M) / (l / h))))); t_1 = d * -sqrt(((1.0 / l) / h)); tmp = 0.0; if (l <= -5.2e+96) tmp = t_1; elseif (l <= -4.8e-40) tmp = t_0; elseif (l <= -3.3e-245) tmp = t_1; elseif (l <= 1.5e-108) tmp = t_0; else tmp = d * sqrt((1.0 / (h * l))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[Sqrt[N[(N[(d / h), $MachinePrecision] / N[(l / d), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(-0.125 * N[(N[(N[(D * D), $MachinePrecision] / N[(d * d), $MachinePrecision]), $MachinePrecision] * N[(N[(M * M), $MachinePrecision] / N[(l / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(d * (-N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]}, If[LessEqual[l, -5.2e+96], t$95$1, If[LessEqual[l, -4.8e-40], t$95$0, If[LessEqual[l, -3.3e-245], t$95$1, If[LessEqual[l, 1.5e-108], t$95$0, N[(d * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 + -0.125 \cdot \left(\frac{D \cdot D}{d \cdot d} \cdot \frac{M \cdot M}{\frac{\ell}{h}}\right)\right)\\
t_1 := d \cdot \left(-\sqrt{\frac{\frac{1}{\ell}}{h}}\right)\\
\mathbf{if}\;\ell \leq -5.2 \cdot 10^{+96}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;\ell \leq -4.8 \cdot 10^{-40}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;\ell \leq -3.3 \cdot 10^{-245}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;\ell \leq 1.5 \cdot 10^{-108}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;d \cdot \sqrt{\frac{1}{h \cdot \ell}}\\
\end{array}
\end{array}
if l < -5.2e96 or -4.79999999999999982e-40 < l < -3.3000000000000001e-245Initial program 60.3%
metadata-eval60.3%
unpow1/260.3%
metadata-eval60.3%
unpow1/260.3%
*-commutative60.3%
associate-*l*60.3%
times-frac60.4%
metadata-eval60.4%
Simplified60.4%
Taylor expanded in M around 0 38.5%
*-commutative38.5%
*-commutative38.5%
times-frac39.7%
*-commutative39.7%
associate-*l*39.7%
unpow239.7%
unpow239.7%
times-frac53.1%
unpow253.1%
associate-*r*53.3%
Simplified53.3%
clear-num52.1%
sqrt-div53.7%
metadata-eval53.7%
Applied egg-rr53.7%
Taylor expanded in d around -inf 58.3%
mul-1-neg58.3%
*-commutative58.3%
distribute-rgt-neg-in58.3%
associate-/r*58.6%
Simplified58.6%
if -5.2e96 < l < -4.79999999999999982e-40 or -3.3000000000000001e-245 < l < 1.49999999999999996e-108Initial program 76.0%
metadata-eval76.0%
unpow1/276.0%
metadata-eval76.0%
unpow1/276.0%
*-commutative76.0%
associate-*l*76.0%
times-frac76.0%
metadata-eval76.0%
Simplified76.0%
sqrt-div42.0%
div-inv42.0%
Applied egg-rr42.0%
associate-*r/42.0%
*-rgt-identity42.0%
Simplified42.0%
pow142.0%
sqrt-div76.0%
sqrt-prod69.2%
frac-times55.3%
*-commutative55.3%
div-inv55.3%
metadata-eval55.3%
Applied egg-rr55.3%
unpow155.3%
times-frac69.2%
associate-*r/63.2%
associate-/l*69.2%
sub-neg69.2%
+-commutative69.2%
distribute-rgt-neg-in69.2%
fma-def69.2%
Simplified68.1%
Taylor expanded in D around 0 53.3%
+-commutative53.3%
fma-def53.3%
times-frac55.6%
unpow255.6%
unpow255.6%
times-frac65.1%
unpow265.1%
unpow265.1%
associate-*r*65.8%
associate-/l*68.1%
fma-def68.1%
*-commutative68.1%
associate-*r*68.1%
+-commutative68.1%
associate-*r*68.1%
*-commutative68.1%
Simplified51.7%
if 1.49999999999999996e-108 < l Initial program 60.3%
metadata-eval60.3%
unpow1/260.3%
metadata-eval60.3%
unpow1/260.3%
*-commutative60.3%
associate-*l*60.3%
times-frac59.1%
metadata-eval59.1%
Simplified59.1%
associate-*r*59.1%
frac-times60.3%
*-commutative60.3%
metadata-eval60.3%
clear-num59.1%
un-div-inv59.1%
metadata-eval59.1%
*-commutative59.1%
frac-times57.9%
*-commutative57.9%
div-inv57.9%
metadata-eval57.9%
Applied egg-rr57.9%
associate-/r/60.3%
*-commutative60.3%
associate-/l*60.3%
/-rgt-identity60.3%
associate-/l*60.3%
metadata-eval60.3%
times-frac61.5%
associate-*r/62.6%
associate-/l/62.6%
metadata-eval62.6%
associate-/l*62.6%
/-rgt-identity62.6%
*-commutative62.6%
associate-/l*62.6%
Simplified62.6%
Taylor expanded in d around inf 48.5%
Final simplification52.9%
(FPCore (d h l M D) :precision binary64 (let* ((t_0 (sqrt (/ 1.0 (* h l))))) (if (<= d 8e-167) (* (- d) t_0) (* d t_0))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((1.0 / (h * l)));
double tmp;
if (d <= 8e-167) {
tmp = -d * t_0;
} else {
tmp = d * t_0;
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: t_0
real(8) :: tmp
t_0 = sqrt((1.0d0 / (h * l)))
if (d <= 8d-167) then
tmp = -d * t_0
else
tmp = d * t_0
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.sqrt((1.0 / (h * l)));
double tmp;
if (d <= 8e-167) {
tmp = -d * t_0;
} else {
tmp = d * t_0;
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt((1.0 / (h * l))) tmp = 0 if d <= 8e-167: tmp = -d * t_0 else: tmp = d * t_0 return tmp
function code(d, h, l, M, D) t_0 = sqrt(Float64(1.0 / Float64(h * l))) tmp = 0.0 if (d <= 8e-167) tmp = Float64(Float64(-d) * t_0); else tmp = Float64(d * t_0); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = sqrt((1.0 / (h * l))); tmp = 0.0; if (d <= 8e-167) tmp = -d * t_0; else tmp = d * t_0; end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[d, 8e-167], N[((-d) * t$95$0), $MachinePrecision], N[(d * t$95$0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{1}{h \cdot \ell}}\\
\mathbf{if}\;d \leq 8 \cdot 10^{-167}:\\
\;\;\;\;\left(-d\right) \cdot t_0\\
\mathbf{else}:\\
\;\;\;\;d \cdot t_0\\
\end{array}
\end{array}
if d < 8.00000000000000002e-167Initial program 62.7%
associate-*l*62.1%
metadata-eval62.1%
unpow1/262.1%
metadata-eval62.1%
unpow1/262.1%
sub-neg62.1%
+-commutative62.1%
*-commutative62.1%
associate-*l*62.1%
distribute-rgt-neg-in62.1%
*-commutative62.1%
Simplified60.9%
Taylor expanded in M around 0 35.8%
*-rgt-identity35.8%
expm1-log1p-u34.9%
expm1-udef23.8%
sqrt-unprod21.1%
Applied egg-rr21.1%
expm1-def30.1%
expm1-log1p30.7%
Simplified30.7%
Taylor expanded in d around -inf 44.3%
mul-1-neg44.3%
*-commutative44.3%
distribute-rgt-neg-in44.3%
*-commutative44.3%
Simplified44.3%
if 8.00000000000000002e-167 < d Initial program 70.3%
metadata-eval70.3%
unpow1/270.3%
metadata-eval70.3%
unpow1/270.3%
*-commutative70.3%
associate-*l*70.3%
times-frac71.2%
metadata-eval71.2%
Simplified71.2%
associate-*r*71.2%
frac-times70.3%
*-commutative70.3%
metadata-eval70.3%
clear-num69.2%
un-div-inv69.2%
metadata-eval69.2%
*-commutative69.2%
frac-times70.2%
*-commutative70.2%
div-inv70.2%
metadata-eval70.2%
Applied egg-rr70.2%
associate-/r/74.4%
*-commutative74.4%
associate-/l*74.4%
/-rgt-identity74.4%
associate-/l*74.4%
metadata-eval74.4%
times-frac73.4%
associate-*r/73.4%
associate-/l/73.4%
metadata-eval73.4%
associate-/l*73.4%
/-rgt-identity73.4%
*-commutative73.4%
associate-/l*73.4%
Simplified73.4%
Taylor expanded in d around inf 52.9%
Final simplification47.6%
(FPCore (d h l M D) :precision binary64 (if (<= d 8e-167) (* d (- (sqrt (/ (/ 1.0 l) h)))) (* d (sqrt (/ 1.0 (* h l))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= 8e-167) {
tmp = d * -sqrt(((1.0 / l) / h));
} else {
tmp = d * sqrt((1.0 / (h * l)));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (d <= 8d-167) then
tmp = d * -sqrt(((1.0d0 / l) / h))
else
tmp = d * sqrt((1.0d0 / (h * l)))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= 8e-167) {
tmp = d * -Math.sqrt(((1.0 / l) / h));
} else {
tmp = d * Math.sqrt((1.0 / (h * l)));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if d <= 8e-167: tmp = d * -math.sqrt(((1.0 / l) / h)) else: tmp = d * math.sqrt((1.0 / (h * l))) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (d <= 8e-167) tmp = Float64(d * Float64(-sqrt(Float64(Float64(1.0 / l) / h)))); else tmp = Float64(d * sqrt(Float64(1.0 / Float64(h * l)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (d <= 8e-167) tmp = d * -sqrt(((1.0 / l) / h)); else tmp = d * sqrt((1.0 / (h * l))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, 8e-167], N[(d * (-N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], N[(d * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d \leq 8 \cdot 10^{-167}:\\
\;\;\;\;d \cdot \left(-\sqrt{\frac{\frac{1}{\ell}}{h}}\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \sqrt{\frac{1}{h \cdot \ell}}\\
\end{array}
\end{array}
if d < 8.00000000000000002e-167Initial program 62.7%
metadata-eval62.7%
unpow1/262.7%
metadata-eval62.7%
unpow1/262.7%
*-commutative62.7%
associate-*l*62.7%
times-frac61.4%
metadata-eval61.4%
Simplified61.4%
Taylor expanded in M around 0 43.7%
*-commutative43.7%
*-commutative43.7%
times-frac44.4%
*-commutative44.4%
associate-*l*44.4%
unpow244.4%
unpow244.4%
times-frac56.6%
unpow256.6%
associate-*r*57.1%
Simplified57.1%
clear-num56.5%
sqrt-div57.3%
metadata-eval57.3%
Applied egg-rr57.3%
Taylor expanded in d around -inf 44.3%
mul-1-neg44.3%
*-commutative44.3%
distribute-rgt-neg-in44.3%
associate-/r*44.4%
Simplified44.4%
if 8.00000000000000002e-167 < d Initial program 70.3%
metadata-eval70.3%
unpow1/270.3%
metadata-eval70.3%
unpow1/270.3%
*-commutative70.3%
associate-*l*70.3%
times-frac71.2%
metadata-eval71.2%
Simplified71.2%
associate-*r*71.2%
frac-times70.3%
*-commutative70.3%
metadata-eval70.3%
clear-num69.2%
un-div-inv69.2%
metadata-eval69.2%
*-commutative69.2%
frac-times70.2%
*-commutative70.2%
div-inv70.2%
metadata-eval70.2%
Applied egg-rr70.2%
associate-/r/74.4%
*-commutative74.4%
associate-/l*74.4%
/-rgt-identity74.4%
associate-/l*74.4%
metadata-eval74.4%
times-frac73.4%
associate-*r/73.4%
associate-/l/73.4%
metadata-eval73.4%
associate-/l*73.4%
/-rgt-identity73.4%
*-commutative73.4%
associate-/l*73.4%
Simplified73.4%
Taylor expanded in d around inf 52.9%
Final simplification47.7%
(FPCore (d h l M D) :precision binary64 (if (<= h 1.7e-284) (sqrt (* (/ d l) (/ d h))) (/ d (sqrt (* h l)))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (h <= 1.7e-284) {
tmp = sqrt(((d / l) * (d / h)));
} else {
tmp = d / sqrt((h * l));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (h <= 1.7d-284) then
tmp = sqrt(((d / l) * (d / h)))
else
tmp = d / sqrt((h * l))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (h <= 1.7e-284) {
tmp = Math.sqrt(((d / l) * (d / h)));
} else {
tmp = d / Math.sqrt((h * l));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if h <= 1.7e-284: tmp = math.sqrt(((d / l) * (d / h))) else: tmp = d / math.sqrt((h * l)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (h <= 1.7e-284) tmp = sqrt(Float64(Float64(d / l) * Float64(d / h))); else tmp = Float64(d / sqrt(Float64(h * l))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (h <= 1.7e-284) tmp = sqrt(((d / l) * (d / h))); else tmp = d / sqrt((h * l)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[h, 1.7e-284], N[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(d / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;h \leq 1.7 \cdot 10^{-284}:\\
\;\;\;\;\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h \cdot \ell}}\\
\end{array}
\end{array}
if h < 1.69999999999999996e-284Initial program 65.9%
associate-*l*65.2%
metadata-eval65.2%
unpow1/265.2%
metadata-eval65.2%
unpow1/265.2%
sub-neg65.2%
+-commutative65.2%
*-commutative65.2%
associate-*l*65.2%
distribute-rgt-neg-in65.2%
*-commutative65.2%
Simplified65.3%
Taylor expanded in M around 0 43.9%
*-rgt-identity43.9%
expm1-log1p-u42.7%
expm1-udef29.9%
sqrt-unprod26.6%
Applied egg-rr26.6%
expm1-def36.9%
expm1-log1p37.7%
Simplified37.7%
if 1.69999999999999996e-284 < h Initial program 65.2%
associate-*l*65.2%
metadata-eval65.2%
unpow1/265.2%
metadata-eval65.2%
unpow1/265.2%
sub-neg65.2%
+-commutative65.2%
*-commutative65.2%
associate-*l*65.2%
distribute-rgt-neg-in65.2%
*-commutative65.2%
Simplified63.6%
Taylor expanded in M around 0 34.0%
*-rgt-identity34.0%
expm1-log1p-u33.0%
expm1-udef21.7%
sqrt-unprod18.4%
Applied egg-rr18.4%
expm1-def27.4%
expm1-log1p28.1%
Simplified28.1%
Taylor expanded in d around 0 23.5%
unpow223.5%
*-commutative23.5%
Simplified23.5%
sqrt-div29.5%
Applied egg-rr29.5%
rem-sqrt-square42.2%
unpow142.2%
sqr-pow42.1%
fabs-sqr42.1%
sqr-pow42.2%
unpow142.2%
Simplified42.2%
Final simplification39.9%
(FPCore (d h l M D) :precision binary64 (if (<= h 5.8e-284) (sqrt (* (/ d l) (/ d h))) (* d (sqrt (/ (/ 1.0 l) h)))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (h <= 5.8e-284) {
tmp = sqrt(((d / l) * (d / h)));
} else {
tmp = d * sqrt(((1.0 / l) / h));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (h <= 5.8d-284) then
tmp = sqrt(((d / l) * (d / h)))
else
tmp = d * sqrt(((1.0d0 / l) / h))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (h <= 5.8e-284) {
tmp = Math.sqrt(((d / l) * (d / h)));
} else {
tmp = d * Math.sqrt(((1.0 / l) / h));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if h <= 5.8e-284: tmp = math.sqrt(((d / l) * (d / h))) else: tmp = d * math.sqrt(((1.0 / l) / h)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (h <= 5.8e-284) tmp = sqrt(Float64(Float64(d / l) * Float64(d / h))); else tmp = Float64(d * sqrt(Float64(Float64(1.0 / l) / h))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (h <= 5.8e-284) tmp = sqrt(((d / l) * (d / h))); else tmp = d * sqrt(((1.0 / l) / h)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[h, 5.8e-284], N[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(d * N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;h \leq 5.8 \cdot 10^{-284}:\\
\;\;\;\;\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\\
\end{array}
\end{array}
if h < 5.8000000000000002e-284Initial program 65.9%
associate-*l*65.2%
metadata-eval65.2%
unpow1/265.2%
metadata-eval65.2%
unpow1/265.2%
sub-neg65.2%
+-commutative65.2%
*-commutative65.2%
associate-*l*65.2%
distribute-rgt-neg-in65.2%
*-commutative65.2%
Simplified65.3%
Taylor expanded in M around 0 43.9%
*-rgt-identity43.9%
expm1-log1p-u42.7%
expm1-udef29.9%
sqrt-unprod26.6%
Applied egg-rr26.6%
expm1-def36.9%
expm1-log1p37.7%
Simplified37.7%
if 5.8000000000000002e-284 < h Initial program 65.2%
metadata-eval65.2%
unpow1/265.2%
metadata-eval65.2%
unpow1/265.2%
*-commutative65.2%
associate-*l*65.2%
times-frac64.4%
metadata-eval64.4%
Simplified64.4%
associate-*r*64.4%
frac-times65.2%
*-commutative65.2%
metadata-eval65.2%
clear-num64.4%
un-div-inv64.4%
metadata-eval64.4%
*-commutative64.4%
frac-times63.6%
*-commutative63.6%
div-inv63.6%
metadata-eval63.6%
Applied egg-rr63.6%
associate-/r/66.1%
*-commutative66.1%
associate-/l*66.1%
/-rgt-identity66.1%
associate-/l*66.1%
metadata-eval66.1%
times-frac66.9%
associate-*r/66.1%
associate-/l/66.1%
metadata-eval66.1%
associate-/l*66.1%
/-rgt-identity66.1%
*-commutative66.1%
associate-/l*66.1%
Simplified66.1%
Taylor expanded in d around inf 42.3%
*-commutative42.3%
associate-/r*42.2%
Simplified42.2%
Final simplification39.9%
(FPCore (d h l M D) :precision binary64 (if (<= h 9.2e-281) (sqrt (* (/ d l) (/ d h))) (* d (sqrt (/ 1.0 (* h l))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (h <= 9.2e-281) {
tmp = sqrt(((d / l) * (d / h)));
} else {
tmp = d * sqrt((1.0 / (h * l)));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (h <= 9.2d-281) then
tmp = sqrt(((d / l) * (d / h)))
else
tmp = d * sqrt((1.0d0 / (h * l)))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (h <= 9.2e-281) {
tmp = Math.sqrt(((d / l) * (d / h)));
} else {
tmp = d * Math.sqrt((1.0 / (h * l)));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if h <= 9.2e-281: tmp = math.sqrt(((d / l) * (d / h))) else: tmp = d * math.sqrt((1.0 / (h * l))) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (h <= 9.2e-281) tmp = sqrt(Float64(Float64(d / l) * Float64(d / h))); else tmp = Float64(d * sqrt(Float64(1.0 / Float64(h * l)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (h <= 9.2e-281) tmp = sqrt(((d / l) * (d / h))); else tmp = d * sqrt((1.0 / (h * l))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[h, 9.2e-281], N[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(d * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;h \leq 9.2 \cdot 10^{-281}:\\
\;\;\;\;\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \sqrt{\frac{1}{h \cdot \ell}}\\
\end{array}
\end{array}
if h < 9.19999999999999956e-281Initial program 65.9%
associate-*l*65.2%
metadata-eval65.2%
unpow1/265.2%
metadata-eval65.2%
unpow1/265.2%
sub-neg65.2%
+-commutative65.2%
*-commutative65.2%
associate-*l*65.2%
distribute-rgt-neg-in65.2%
*-commutative65.2%
Simplified65.3%
Taylor expanded in M around 0 43.9%
*-rgt-identity43.9%
expm1-log1p-u42.7%
expm1-udef29.9%
sqrt-unprod26.6%
Applied egg-rr26.6%
expm1-def36.9%
expm1-log1p37.7%
Simplified37.7%
if 9.19999999999999956e-281 < h Initial program 65.2%
metadata-eval65.2%
unpow1/265.2%
metadata-eval65.2%
unpow1/265.2%
*-commutative65.2%
associate-*l*65.2%
times-frac64.4%
metadata-eval64.4%
Simplified64.4%
associate-*r*64.4%
frac-times65.2%
*-commutative65.2%
metadata-eval65.2%
clear-num64.4%
un-div-inv64.4%
metadata-eval64.4%
*-commutative64.4%
frac-times63.6%
*-commutative63.6%
div-inv63.6%
metadata-eval63.6%
Applied egg-rr63.6%
associate-/r/66.1%
*-commutative66.1%
associate-/l*66.1%
/-rgt-identity66.1%
associate-/l*66.1%
metadata-eval66.1%
times-frac66.9%
associate-*r/66.1%
associate-/l/66.1%
metadata-eval66.1%
associate-/l*66.1%
/-rgt-identity66.1%
*-commutative66.1%
associate-/l*66.1%
Simplified66.1%
Taylor expanded in d around inf 42.3%
Final simplification39.9%
(FPCore (d h l M D) :precision binary64 (/ d (sqrt (* h l))))
double code(double d, double h, double l, double M, double D) {
return d / sqrt((h * l));
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
code = d / sqrt((h * l))
end function
public static double code(double d, double h, double l, double M, double D) {
return d / Math.sqrt((h * l));
}
def code(d, h, l, M, D): return d / math.sqrt((h * l))
function code(d, h, l, M, D) return Float64(d / sqrt(Float64(h * l))) end
function tmp = code(d, h, l, M, D) tmp = d / sqrt((h * l)); end
code[d_, h_, l_, M_, D_] := N[(d / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{d}{\sqrt{h \cdot \ell}}
\end{array}
Initial program 65.6%
associate-*l*65.2%
metadata-eval65.2%
unpow1/265.2%
metadata-eval65.2%
unpow1/265.2%
sub-neg65.2%
+-commutative65.2%
*-commutative65.2%
associate-*l*65.2%
distribute-rgt-neg-in65.2%
*-commutative65.2%
Simplified64.4%
Taylor expanded in M around 0 39.0%
*-rgt-identity39.0%
expm1-log1p-u37.9%
expm1-udef25.9%
sqrt-unprod22.6%
Applied egg-rr22.6%
expm1-def32.2%
expm1-log1p33.0%
Simplified33.0%
Taylor expanded in d around 0 27.7%
unpow227.7%
*-commutative27.7%
Simplified27.7%
sqrt-div33.4%
Applied egg-rr33.4%
rem-sqrt-square46.7%
unpow146.7%
sqr-pow21.5%
fabs-sqr21.5%
sqr-pow25.8%
unpow125.8%
Simplified25.8%
Final simplification25.8%
herbie shell --seed 2023252
(FPCore (d h l M D)
:name "Henrywood and Agarwal, Equation (12)"
:precision binary64
(* (* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0))) (- 1.0 (* (* (/ 1.0 2.0) (pow (/ (* M D) (* 2.0 d)) 2.0)) (/ h l)))))