
(FPCore (c0 A V l) :precision binary64 (* c0 (sqrt (/ A (* V l)))))
double code(double c0, double A, double V, double l) {
return c0 * sqrt((A / (V * l)));
}
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
code = c0 * sqrt((a / (v * l)))
end function
public static double code(double c0, double A, double V, double l) {
return c0 * Math.sqrt((A / (V * l)));
}
def code(c0, A, V, l): return c0 * math.sqrt((A / (V * l)))
function code(c0, A, V, l) return Float64(c0 * sqrt(Float64(A / Float64(V * l)))) end
function tmp = code(c0, A, V, l) tmp = c0 * sqrt((A / (V * l))); end
code[c0_, A_, V_, l_] := N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (c0 A V l) :precision binary64 (* c0 (sqrt (/ A (* V l)))))
double code(double c0, double A, double V, double l) {
return c0 * sqrt((A / (V * l)));
}
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
code = c0 * sqrt((a / (v * l)))
end function
public static double code(double c0, double A, double V, double l) {
return c0 * Math.sqrt((A / (V * l)));
}
def code(c0, A, V, l): return c0 * math.sqrt((A / (V * l)))
function code(c0, A, V, l) return Float64(c0 * sqrt(Float64(A / Float64(V * l)))) end
function tmp = code(c0, A, V, l) tmp = c0 * sqrt((A / (V * l))); end
code[c0_, A_, V_, l_] := N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\end{array}
NOTE: V and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* V l) -5e-267)
(* c0 (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (<= (* V l) 0.0)
(* (* c0 (pow (/ V A) -0.5)) (pow l -0.5))
(/ c0 (/ (sqrt (* V l)) (sqrt A))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -5e-267) {
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = (c0 * pow((V / A), -0.5)) * pow(l, -0.5);
} else {
tmp = c0 / (sqrt((V * l)) / sqrt(A));
}
return tmp;
}
NOTE: V and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if ((v * l) <= (-5d-267)) then
tmp = c0 * (sqrt(-a) / sqrt((v * -l)))
else if ((v * l) <= 0.0d0) then
tmp = (c0 * ((v / a) ** (-0.5d0))) * (l ** (-0.5d0))
else
tmp = c0 / (sqrt((v * l)) / sqrt(a))
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -5e-267) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = (c0 * Math.pow((V / A), -0.5)) * Math.pow(l, -0.5);
} else {
tmp = c0 / (Math.sqrt((V * l)) / Math.sqrt(A));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= -5e-267: tmp = c0 * (math.sqrt(-A) / math.sqrt((V * -l))) elif (V * l) <= 0.0: tmp = (c0 * math.pow((V / A), -0.5)) * math.pow(l, -0.5) else: tmp = c0 / (math.sqrt((V * l)) / math.sqrt(A)) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= -5e-267) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif (Float64(V * l) <= 0.0) tmp = Float64(Float64(c0 * (Float64(V / A) ^ -0.5)) * (l ^ -0.5)); else tmp = Float64(c0 / Float64(sqrt(Float64(V * l)) / sqrt(A))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((V * l) <= -5e-267)
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
elseif ((V * l) <= 0.0)
tmp = (c0 * ((V / A) ^ -0.5)) * (l ^ -0.5);
else
tmp = c0 / (sqrt((V * l)) / sqrt(A));
end
tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], -5e-267], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(N[(c0 * N[Power[N[(V / A), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision], N[(c0 / N[(N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -5 \cdot 10^{-267}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;\left(c0 \cdot {\left(\frac{V}{A}\right)}^{-0.5}\right) \cdot {\ell}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{V \cdot \ell}}{\sqrt{A}}}\\
\end{array}
\end{array}
if (*.f64 V l) < -4.9999999999999999e-267Initial program 88.0%
frac-2neg88.0%
sqrt-div94.3%
*-commutative94.3%
distribute-rgt-neg-in94.3%
Applied egg-rr94.3%
if -4.9999999999999999e-267 < (*.f64 V l) < -0.0Initial program 49.5%
sqrt-div12.9%
associate-*r/12.9%
Applied egg-rr12.9%
associate-/l*12.9%
Simplified12.9%
clear-num12.9%
inv-pow12.9%
sqrt-div49.5%
associate-/r*65.4%
Applied egg-rr65.4%
unpow-165.4%
Simplified65.4%
associate-/r/65.4%
/-rgt-identity65.4%
clear-num65.3%
inv-pow65.3%
div-inv65.3%
clear-num65.3%
*-commutative65.3%
metadata-eval65.3%
pow-prod-up65.3%
sqrt-unprod65.2%
add-sqr-sqrt65.3%
unpow-prod-down45.7%
associate-*r*45.7%
Applied egg-rr45.7%
if -0.0 < (*.f64 V l) Initial program 82.9%
sqrt-div95.7%
associate-*r/90.8%
Applied egg-rr90.8%
associate-/l*95.9%
Simplified95.9%
Final simplification88.6%
NOTE: V and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* V l) -5e-241)
(* c0 (pow (/ (* V l) A) -0.5))
(if (<= (* V l) 0.0)
(* c0 (sqrt (/ (* A (/ 1.0 V)) l)))
(* c0 (/ (sqrt A) (sqrt (* V l)))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -5e-241) {
tmp = c0 * pow(((V * l) / A), -0.5);
} else if ((V * l) <= 0.0) {
tmp = c0 * sqrt(((A * (1.0 / V)) / l));
} else {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
}
return tmp;
}
NOTE: V and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if ((v * l) <= (-5d-241)) then
tmp = c0 * (((v * l) / a) ** (-0.5d0))
else if ((v * l) <= 0.0d0) then
tmp = c0 * sqrt(((a * (1.0d0 / v)) / l))
else
tmp = c0 * (sqrt(a) / sqrt((v * l)))
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -5e-241) {
tmp = c0 * Math.pow(((V * l) / A), -0.5);
} else if ((V * l) <= 0.0) {
tmp = c0 * Math.sqrt(((A * (1.0 / V)) / l));
} else {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= -5e-241: tmp = c0 * math.pow(((V * l) / A), -0.5) elif (V * l) <= 0.0: tmp = c0 * math.sqrt(((A * (1.0 / V)) / l)) else: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= -5e-241) tmp = Float64(c0 * (Float64(Float64(V * l) / A) ^ -0.5)); elseif (Float64(V * l) <= 0.0) tmp = Float64(c0 * sqrt(Float64(Float64(A * Float64(1.0 / V)) / l))); else tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((V * l) <= -5e-241)
tmp = c0 * (((V * l) / A) ^ -0.5);
elseif ((V * l) <= 0.0)
tmp = c0 * sqrt(((A * (1.0 / V)) / l));
else
tmp = c0 * (sqrt(A) / sqrt((V * l)));
end
tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], -5e-241], N[(c0 * N[Power[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(c0 * N[Sqrt[N[(N[(A * N[(1.0 / V), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -5 \cdot 10^{-241}:\\
\;\;\;\;c0 \cdot {\left(\frac{V \cdot \ell}{A}\right)}^{-0.5}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A \cdot \frac{1}{V}}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -4.9999999999999998e-241Initial program 87.6%
pow1/287.6%
clear-num87.5%
inv-pow87.5%
pow-pow88.9%
associate-/l*81.6%
metadata-eval81.6%
Applied egg-rr81.6%
associate-/l*88.9%
Simplified88.9%
if -4.9999999999999998e-241 < (*.f64 V l) < -0.0Initial program 56.0%
clear-num56.0%
associate-/r/54.9%
Applied egg-rr54.9%
associate-/r*55.0%
associate-*l/69.9%
Applied egg-rr69.9%
if -0.0 < (*.f64 V l) Initial program 82.9%
pow1/282.9%
clear-num82.9%
inv-pow82.9%
pow-pow83.8%
associate-/l*76.2%
metadata-eval76.2%
Applied egg-rr76.2%
associate-/l*83.8%
Simplified83.8%
add-sqr-sqrt83.5%
sqrt-unprod82.8%
pow-prod-up82.9%
metadata-eval82.9%
inv-pow82.9%
clear-num82.9%
sqrt-div95.7%
*-un-lft-identity95.7%
add-sqr-sqrt95.4%
times-frac95.5%
pow1/295.5%
metadata-eval95.5%
sqrt-pow195.5%
metadata-eval95.5%
metadata-eval95.5%
pow1/295.5%
metadata-eval95.5%
sqrt-pow195.5%
metadata-eval95.5%
metadata-eval95.5%
Applied egg-rr95.5%
associate-*l/95.5%
*-lft-identity95.5%
associate-/l/95.4%
pow-sqr95.7%
metadata-eval95.7%
unpow1/295.7%
Simplified95.7%
Final simplification88.7%
NOTE: V and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* V l) -1e-262)
(* c0 (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (<= (* V l) 0.0)
(/ c0 (* (sqrt (/ V A)) (sqrt l)))
(/ c0 (/ (sqrt (* V l)) (sqrt A))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -1e-262) {
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = c0 / (sqrt((V / A)) * sqrt(l));
} else {
tmp = c0 / (sqrt((V * l)) / sqrt(A));
}
return tmp;
}
NOTE: V and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if ((v * l) <= (-1d-262)) then
tmp = c0 * (sqrt(-a) / sqrt((v * -l)))
else if ((v * l) <= 0.0d0) then
tmp = c0 / (sqrt((v / a)) * sqrt(l))
else
tmp = c0 / (sqrt((v * l)) / sqrt(a))
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -1e-262) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = c0 / (Math.sqrt((V / A)) * Math.sqrt(l));
} else {
tmp = c0 / (Math.sqrt((V * l)) / Math.sqrt(A));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= -1e-262: tmp = c0 * (math.sqrt(-A) / math.sqrt((V * -l))) elif (V * l) <= 0.0: tmp = c0 / (math.sqrt((V / A)) * math.sqrt(l)) else: tmp = c0 / (math.sqrt((V * l)) / math.sqrt(A)) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= -1e-262) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif (Float64(V * l) <= 0.0) tmp = Float64(c0 / Float64(sqrt(Float64(V / A)) * sqrt(l))); else tmp = Float64(c0 / Float64(sqrt(Float64(V * l)) / sqrt(A))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((V * l) <= -1e-262)
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
elseif ((V * l) <= 0.0)
tmp = c0 / (sqrt((V / A)) * sqrt(l));
else
tmp = c0 / (sqrt((V * l)) / sqrt(A));
end
tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], -1e-262], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(c0 / N[(N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 / N[(N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -1 \cdot 10^{-262}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V}{A}} \cdot \sqrt{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{V \cdot \ell}}{\sqrt{A}}}\\
\end{array}
\end{array}
if (*.f64 V l) < -1.00000000000000001e-262Initial program 87.8%
frac-2neg87.8%
sqrt-div94.1%
*-commutative94.1%
distribute-rgt-neg-in94.1%
Applied egg-rr94.1%
if -1.00000000000000001e-262 < (*.f64 V l) < -0.0Initial program 53.6%
sqrt-div11.8%
associate-*r/11.8%
Applied egg-rr11.8%
associate-/l*11.8%
Simplified11.8%
clear-num11.8%
inv-pow11.8%
sqrt-div53.6%
associate-/r*68.2%
Applied egg-rr68.2%
unpow-168.2%
Simplified68.2%
sqrt-div44.5%
associate-/r/44.5%
metadata-eval44.5%
sqrt-div44.5%
clear-num44.6%
Applied egg-rr44.6%
if -0.0 < (*.f64 V l) Initial program 82.9%
sqrt-div95.7%
associate-*r/90.8%
Applied egg-rr90.8%
associate-/l*95.9%
Simplified95.9%
Final simplification87.8%
NOTE: V and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= A -4.6e+88)
(* c0 (pow (/ (* V l) A) -0.5))
(if (<= A -5e-310)
(* c0 (/ (sqrt (/ A V)) (sqrt l)))
(* c0 (/ (sqrt A) (sqrt (* V l)))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -4.6e+88) {
tmp = c0 * pow(((V * l) / A), -0.5);
} else if (A <= -5e-310) {
tmp = c0 * (sqrt((A / V)) / sqrt(l));
} else {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
}
return tmp;
}
NOTE: V and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if (a <= (-4.6d+88)) then
tmp = c0 * (((v * l) / a) ** (-0.5d0))
else if (a <= (-5d-310)) then
tmp = c0 * (sqrt((a / v)) / sqrt(l))
else
tmp = c0 * (sqrt(a) / sqrt((v * l)))
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -4.6e+88) {
tmp = c0 * Math.pow(((V * l) / A), -0.5);
} else if (A <= -5e-310) {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
} else {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): tmp = 0 if A <= -4.6e+88: tmp = c0 * math.pow(((V * l) / A), -0.5) elif A <= -5e-310: tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) else: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) tmp = 0.0 if (A <= -4.6e+88) tmp = Float64(c0 * (Float64(Float64(V * l) / A) ^ -0.5)); elseif (A <= -5e-310) tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))); else tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if (A <= -4.6e+88)
tmp = c0 * (((V * l) / A) ^ -0.5);
elseif (A <= -5e-310)
tmp = c0 * (sqrt((A / V)) / sqrt(l));
else
tmp = c0 * (sqrt(A) / sqrt((V * l)));
end
tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[A, -4.6e+88], N[(c0 * N[Power[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[A, -5e-310], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;A \leq -4.6 \cdot 10^{+88}:\\
\;\;\;\;c0 \cdot {\left(\frac{V \cdot \ell}{A}\right)}^{-0.5}\\
\mathbf{elif}\;A \leq -5 \cdot 10^{-310}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\end{array}
\end{array}
if A < -4.6000000000000003e88Initial program 82.1%
pow1/282.1%
clear-num82.0%
inv-pow82.0%
pow-pow85.1%
associate-/l*73.7%
metadata-eval73.7%
Applied egg-rr73.7%
associate-/l*85.1%
Simplified85.1%
if -4.6000000000000003e88 < A < -4.999999999999985e-310Initial program 81.7%
associate-/r*78.4%
sqrt-div40.4%
Applied egg-rr40.4%
if -4.999999999999985e-310 < A Initial program 80.0%
pow1/280.0%
clear-num79.9%
inv-pow79.9%
pow-pow80.8%
associate-/l*74.7%
metadata-eval74.7%
Applied egg-rr74.7%
associate-/l*80.8%
Simplified80.8%
add-sqr-sqrt80.6%
sqrt-unprod79.9%
pow-prod-up79.9%
metadata-eval79.9%
inv-pow79.9%
clear-num80.0%
sqrt-div91.7%
*-un-lft-identity91.7%
add-sqr-sqrt91.4%
times-frac91.5%
pow1/291.5%
metadata-eval91.5%
sqrt-pow191.6%
metadata-eval91.6%
metadata-eval91.6%
pow1/291.6%
metadata-eval91.6%
sqrt-pow191.6%
metadata-eval91.6%
metadata-eval91.6%
Applied egg-rr91.6%
associate-*l/91.6%
*-lft-identity91.6%
associate-/l/91.5%
pow-sqr91.7%
metadata-eval91.7%
unpow1/291.7%
Simplified91.7%
Final simplification71.0%
NOTE: V and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (if (<= l -1e-309) (* c0 (/ (sqrt A) (sqrt (* V l)))) (/ c0 (* (sqrt (/ V A)) (sqrt l)))))
assert(V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (l <= -1e-309) {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
} else {
tmp = c0 / (sqrt((V / A)) * sqrt(l));
}
return tmp;
}
NOTE: V and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if (l <= (-1d-309)) then
tmp = c0 * (sqrt(a) / sqrt((v * l)))
else
tmp = c0 / (sqrt((v / a)) * sqrt(l))
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if (l <= -1e-309) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = c0 / (Math.sqrt((V / A)) * Math.sqrt(l));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): tmp = 0 if l <= -1e-309: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = c0 / (math.sqrt((V / A)) * math.sqrt(l)) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) tmp = 0.0 if (l <= -1e-309) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = Float64(c0 / Float64(sqrt(Float64(V / A)) * sqrt(l))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if (l <= -1e-309)
tmp = c0 * (sqrt(A) / sqrt((V * l)));
else
tmp = c0 / (sqrt((V / A)) * sqrt(l));
end
tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[l, -1e-309], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 / N[(N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1 \cdot 10^{-309}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V}{A}} \cdot \sqrt{\ell}}\\
\end{array}
\end{array}
if l < -1.000000000000002e-309Initial program 80.2%
pow1/280.2%
clear-num80.2%
inv-pow80.2%
pow-pow80.7%
associate-/l*77.9%
metadata-eval77.9%
Applied egg-rr77.9%
associate-/l*80.7%
Simplified80.7%
add-sqr-sqrt80.5%
sqrt-unprod80.2%
pow-prod-up80.2%
metadata-eval80.2%
inv-pow80.2%
clear-num80.2%
sqrt-div35.6%
*-un-lft-identity35.6%
add-sqr-sqrt35.4%
times-frac35.5%
pow1/235.5%
metadata-eval35.5%
sqrt-pow135.5%
metadata-eval35.5%
metadata-eval35.5%
pow1/235.5%
metadata-eval35.5%
sqrt-pow135.5%
metadata-eval35.5%
metadata-eval35.5%
Applied egg-rr35.5%
associate-*l/35.5%
*-lft-identity35.5%
associate-/l/35.5%
pow-sqr35.6%
metadata-eval35.6%
unpow1/235.6%
Simplified35.6%
if -1.000000000000002e-309 < l Initial program 81.9%
sqrt-div43.7%
associate-*r/40.3%
Applied egg-rr40.3%
associate-/l*43.8%
Simplified43.8%
clear-num43.8%
inv-pow43.8%
sqrt-div82.0%
associate-/r*76.1%
Applied egg-rr76.1%
unpow-176.1%
Simplified76.1%
sqrt-div84.5%
associate-/r/84.5%
metadata-eval84.5%
sqrt-div84.4%
clear-num85.1%
Applied egg-rr85.1%
Final simplification59.0%
NOTE: V and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (if (<= l -1e-309) (/ c0 (/ (sqrt (* V l)) (sqrt A))) (/ c0 (* (sqrt (/ V A)) (sqrt l)))))
assert(V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (l <= -1e-309) {
tmp = c0 / (sqrt((V * l)) / sqrt(A));
} else {
tmp = c0 / (sqrt((V / A)) * sqrt(l));
}
return tmp;
}
NOTE: V and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if (l <= (-1d-309)) then
tmp = c0 / (sqrt((v * l)) / sqrt(a))
else
tmp = c0 / (sqrt((v / a)) * sqrt(l))
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if (l <= -1e-309) {
tmp = c0 / (Math.sqrt((V * l)) / Math.sqrt(A));
} else {
tmp = c0 / (Math.sqrt((V / A)) * Math.sqrt(l));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): tmp = 0 if l <= -1e-309: tmp = c0 / (math.sqrt((V * l)) / math.sqrt(A)) else: tmp = c0 / (math.sqrt((V / A)) * math.sqrt(l)) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) tmp = 0.0 if (l <= -1e-309) tmp = Float64(c0 / Float64(sqrt(Float64(V * l)) / sqrt(A))); else tmp = Float64(c0 / Float64(sqrt(Float64(V / A)) * sqrt(l))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if (l <= -1e-309)
tmp = c0 / (sqrt((V * l)) / sqrt(A));
else
tmp = c0 / (sqrt((V / A)) * sqrt(l));
end
tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[l, -1e-309], N[(c0 / N[(N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 / N[(N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1 \cdot 10^{-309}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{V \cdot \ell}}{\sqrt{A}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V}{A}} \cdot \sqrt{\ell}}\\
\end{array}
\end{array}
if l < -1.000000000000002e-309Initial program 80.2%
sqrt-div35.6%
associate-*r/34.9%
Applied egg-rr34.9%
associate-/l*35.6%
Simplified35.6%
if -1.000000000000002e-309 < l Initial program 81.9%
sqrt-div43.7%
associate-*r/40.3%
Applied egg-rr40.3%
associate-/l*43.8%
Simplified43.8%
clear-num43.8%
inv-pow43.8%
sqrt-div82.0%
associate-/r*76.1%
Applied egg-rr76.1%
unpow-176.1%
Simplified76.1%
sqrt-div84.5%
associate-/r/84.5%
metadata-eval84.5%
sqrt-div84.4%
clear-num85.1%
Applied egg-rr85.1%
Final simplification59.0%
NOTE: V and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (/ A (* V l))))
(if (<= t_0 0.0)
(sqrt (* c0 (/ (* c0 (/ A V)) l)))
(if (<= t_0 2e+300) (* c0 (sqrt t_0)) (/ c0 (sqrt (* l (/ V A))))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 0.0) {
tmp = sqrt((c0 * ((c0 * (A / V)) / l)));
} else if (t_0 <= 2e+300) {
tmp = c0 * sqrt(t_0);
} else {
tmp = c0 / sqrt((l * (V / A)));
}
return tmp;
}
NOTE: V and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = a / (v * l)
if (t_0 <= 0.0d0) then
tmp = sqrt((c0 * ((c0 * (a / v)) / l)))
else if (t_0 <= 2d+300) then
tmp = c0 * sqrt(t_0)
else
tmp = c0 / sqrt((l * (v / a)))
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 0.0) {
tmp = Math.sqrt((c0 * ((c0 * (A / V)) / l)));
} else if (t_0 <= 2e+300) {
tmp = c0 * Math.sqrt(t_0);
} else {
tmp = c0 / Math.sqrt((l * (V / A)));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): t_0 = A / (V * l) tmp = 0 if t_0 <= 0.0: tmp = math.sqrt((c0 * ((c0 * (A / V)) / l))) elif t_0 <= 2e+300: tmp = c0 * math.sqrt(t_0) else: tmp = c0 / math.sqrt((l * (V / A))) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if (t_0 <= 0.0) tmp = sqrt(Float64(c0 * Float64(Float64(c0 * Float64(A / V)) / l))); elseif (t_0 <= 2e+300) tmp = Float64(c0 * sqrt(t_0)); else tmp = Float64(c0 / sqrt(Float64(l * Float64(V / A)))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = A / (V * l);
tmp = 0.0;
if (t_0 <= 0.0)
tmp = sqrt((c0 * ((c0 * (A / V)) / l)));
elseif (t_0 <= 2e+300)
tmp = c0 * sqrt(t_0);
else
tmp = c0 / sqrt((l * (V / A)));
end
tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[Sqrt[N[(c0 * N[(N[(c0 * N[(A / V), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$0, 2e+300], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(c0 / N[Sqrt[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t_0 \leq 0:\\
\;\;\;\;\sqrt{c0 \cdot \frac{c0 \cdot \frac{A}{V}}{\ell}}\\
\mathbf{elif}\;t_0 \leq 2 \cdot 10^{+300}:\\
\;\;\;\;c0 \cdot \sqrt{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0Initial program 47.8%
pow1/247.8%
clear-num47.8%
inv-pow47.8%
pow-pow47.8%
associate-/l*52.0%
metadata-eval52.0%
Applied egg-rr52.0%
associate-/l*47.8%
Simplified47.8%
associate-/l*52.0%
associate-/r/52.0%
Applied egg-rr52.0%
add-sqr-sqrt52.0%
sqrt-unprod49.9%
*-commutative49.9%
*-commutative49.9%
swap-sqr49.2%
pow-prod-up49.2%
*-commutative49.2%
clear-num49.2%
div-inv49.2%
metadata-eval49.2%
inv-pow49.2%
clear-num49.2%
associate-/l/47.1%
*-commutative47.1%
Applied egg-rr47.1%
associate-*r*47.8%
*-commutative47.8%
associate-/r*49.9%
associate-*l/54.1%
Simplified54.1%
if 0.0 < (/.f64 A (*.f64 V l)) < 2.0000000000000001e300Initial program 99.2%
if 2.0000000000000001e300 < (/.f64 A (*.f64 V l)) Initial program 50.5%
pow1/250.5%
clear-num50.5%
inv-pow50.5%
pow-pow55.5%
associate-/l*63.6%
metadata-eval63.6%
Applied egg-rr63.6%
associate-/l*55.5%
Simplified55.5%
associate-/l*63.6%
associate-/r/63.8%
Applied egg-rr63.8%
/-rgt-identity63.8%
add-sqr-sqrt63.8%
sqrt-unprod60.2%
pow-prod-up60.2%
*-commutative60.2%
clear-num60.2%
div-inv60.2%
metadata-eval60.2%
inv-pow60.2%
clear-num60.3%
associate-/r/60.3%
sqrt-div46.0%
associate-/r/45.9%
metadata-eval45.9%
sqrt-div45.9%
clear-num46.0%
sqrt-prod63.9%
*-commutative63.9%
associate-*r/55.5%
associate-*l/63.6%
sqrt-unprod48.0%
*-commutative48.0%
sqrt-unprod63.6%
Applied egg-rr63.6%
associate-*r/55.5%
associate-*l/63.9%
Simplified63.9%
Final simplification84.7%
NOTE: V and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (let* ((t_0 (/ A (* V l)))) (if (<= t_0 2e+300) (* c0 (sqrt t_0)) (* c0 (sqrt (/ (/ A V) l))))))
assert(V < l);
double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 2e+300) {
tmp = c0 * sqrt(t_0);
} else {
tmp = c0 * sqrt(((A / V) / l));
}
return tmp;
}
NOTE: V and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = a / (v * l)
if (t_0 <= 2d+300) then
tmp = c0 * sqrt(t_0)
else
tmp = c0 * sqrt(((a / v) / l))
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 2e+300) {
tmp = c0 * Math.sqrt(t_0);
} else {
tmp = c0 * Math.sqrt(((A / V) / l));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): t_0 = A / (V * l) tmp = 0 if t_0 <= 2e+300: tmp = c0 * math.sqrt(t_0) else: tmp = c0 * math.sqrt(((A / V) / l)) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if (t_0 <= 2e+300) tmp = Float64(c0 * sqrt(t_0)); else tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = A / (V * l);
tmp = 0.0;
if (t_0 <= 2e+300)
tmp = c0 * sqrt(t_0);
else
tmp = c0 * sqrt(((A / V) / l));
end
tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 2e+300], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t_0 \leq 2 \cdot 10^{+300}:\\
\;\;\;\;c0 \cdot \sqrt{t_0}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 2.0000000000000001e300Initial program 88.1%
if 2.0000000000000001e300 < (/.f64 A (*.f64 V l)) Initial program 50.5%
sqrt-div25.4%
associate-*r/25.4%
Applied egg-rr25.4%
associate-/l*25.5%
Simplified25.5%
clear-num25.4%
associate-/r/25.4%
clear-num25.4%
sqrt-div50.5%
associate-/r*60.3%
Applied egg-rr60.3%
Final simplification82.9%
NOTE: V and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (let* ((t_0 (/ A (* V l)))) (if (<= t_0 2e+300) (* c0 (sqrt t_0)) (/ c0 (sqrt (* V (/ l A)))))))
assert(V < l);
double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 2e+300) {
tmp = c0 * sqrt(t_0);
} else {
tmp = c0 / sqrt((V * (l / A)));
}
return tmp;
}
NOTE: V and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = a / (v * l)
if (t_0 <= 2d+300) then
tmp = c0 * sqrt(t_0)
else
tmp = c0 / sqrt((v * (l / a)))
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 2e+300) {
tmp = c0 * Math.sqrt(t_0);
} else {
tmp = c0 / Math.sqrt((V * (l / A)));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): t_0 = A / (V * l) tmp = 0 if t_0 <= 2e+300: tmp = c0 * math.sqrt(t_0) else: tmp = c0 / math.sqrt((V * (l / A))) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if (t_0 <= 2e+300) tmp = Float64(c0 * sqrt(t_0)); else tmp = Float64(c0 / sqrt(Float64(V * Float64(l / A)))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = A / (V * l);
tmp = 0.0;
if (t_0 <= 2e+300)
tmp = c0 * sqrt(t_0);
else
tmp = c0 / sqrt((V * (l / A)));
end
tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 2e+300], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(c0 / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t_0 \leq 2 \cdot 10^{+300}:\\
\;\;\;\;c0 \cdot \sqrt{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 2.0000000000000001e300Initial program 88.1%
if 2.0000000000000001e300 < (/.f64 A (*.f64 V l)) Initial program 50.5%
pow1/250.5%
clear-num50.5%
inv-pow50.5%
pow-pow55.5%
associate-/l*63.6%
metadata-eval63.6%
Applied egg-rr63.6%
associate-/l*55.5%
Simplified55.5%
add-sqr-sqrt55.5%
sqrt-unprod50.5%
pow-prod-up50.5%
metadata-eval50.5%
inv-pow50.5%
clear-num50.5%
sqrt-div25.4%
clear-num25.4%
div-inv25.5%
sqrt-undiv55.5%
associate-*r/63.6%
Applied egg-rr63.6%
Final simplification83.5%
NOTE: V and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (let* ((t_0 (/ A (* V l)))) (if (<= t_0 2e+300) (* c0 (sqrt t_0)) (/ c0 (sqrt (* l (/ V A)))))))
assert(V < l);
double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 2e+300) {
tmp = c0 * sqrt(t_0);
} else {
tmp = c0 / sqrt((l * (V / A)));
}
return tmp;
}
NOTE: V and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = a / (v * l)
if (t_0 <= 2d+300) then
tmp = c0 * sqrt(t_0)
else
tmp = c0 / sqrt((l * (v / a)))
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 2e+300) {
tmp = c0 * Math.sqrt(t_0);
} else {
tmp = c0 / Math.sqrt((l * (V / A)));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): t_0 = A / (V * l) tmp = 0 if t_0 <= 2e+300: tmp = c0 * math.sqrt(t_0) else: tmp = c0 / math.sqrt((l * (V / A))) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if (t_0 <= 2e+300) tmp = Float64(c0 * sqrt(t_0)); else tmp = Float64(c0 / sqrt(Float64(l * Float64(V / A)))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = A / (V * l);
tmp = 0.0;
if (t_0 <= 2e+300)
tmp = c0 * sqrt(t_0);
else
tmp = c0 / sqrt((l * (V / A)));
end
tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 2e+300], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(c0 / N[Sqrt[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t_0 \leq 2 \cdot 10^{+300}:\\
\;\;\;\;c0 \cdot \sqrt{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 2.0000000000000001e300Initial program 88.1%
if 2.0000000000000001e300 < (/.f64 A (*.f64 V l)) Initial program 50.5%
pow1/250.5%
clear-num50.5%
inv-pow50.5%
pow-pow55.5%
associate-/l*63.6%
metadata-eval63.6%
Applied egg-rr63.6%
associate-/l*55.5%
Simplified55.5%
associate-/l*63.6%
associate-/r/63.8%
Applied egg-rr63.8%
/-rgt-identity63.8%
add-sqr-sqrt63.8%
sqrt-unprod60.2%
pow-prod-up60.2%
*-commutative60.2%
clear-num60.2%
div-inv60.2%
metadata-eval60.2%
inv-pow60.2%
clear-num60.3%
associate-/r/60.3%
sqrt-div46.0%
associate-/r/45.9%
metadata-eval45.9%
sqrt-div45.9%
clear-num46.0%
sqrt-prod63.9%
*-commutative63.9%
associate-*r/55.5%
associate-*l/63.6%
sqrt-unprod48.0%
*-commutative48.0%
sqrt-unprod63.6%
Applied egg-rr63.6%
associate-*r/55.5%
associate-*l/63.9%
Simplified63.9%
Final simplification83.5%
NOTE: V and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (* c0 (sqrt (/ A (* V l)))))
assert(V < l);
double code(double c0, double A, double V, double l) {
return c0 * sqrt((A / (V * l)));
}
NOTE: V and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
code = c0 * sqrt((a / (v * l)))
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
return c0 * Math.sqrt((A / (V * l)));
}
[V, l] = sort([V, l]) def code(c0, A, V, l): return c0 * math.sqrt((A / (V * l)))
V, l = sort([V, l]) function code(c0, A, V, l) return Float64(c0 * sqrt(Float64(A / Float64(V * l)))) end
V, l = num2cell(sort([V, l])){:}
function tmp = code(c0, A, V, l)
tmp = c0 * sqrt((A / (V * l)));
end
NOTE: V and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\end{array}
Initial program 81.0%
Final simplification81.0%
herbie shell --seed 2023255
(FPCore (c0 A V l)
:name "Henrywood and Agarwal, Equation (3)"
:precision binary64
(* c0 (sqrt (/ A (* V l)))))