
(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 9 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) (- INFINITY))
(* c0 (/ (sqrt (/ A V)) (sqrt l)))
(if (<= (* V l) -2e-289)
(* c0 (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (<= (* V l) 5e-302)
(* c0 (/ (/ 1.0 (sqrt (/ V A))) (sqrt l)))
(if (<= (* V l) 5e+299)
(/ c0 (/ (sqrt (* V l)) (sqrt A)))
(* c0 (sqrt (/ (/ A V) l))))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -((double) INFINITY)) {
tmp = c0 * (sqrt((A / V)) / sqrt(l));
} else if ((V * l) <= -2e-289) {
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
} else if ((V * l) <= 5e-302) {
tmp = c0 * ((1.0 / sqrt((V / A))) / sqrt(l));
} else if ((V * l) <= 5e+299) {
tmp = c0 / (sqrt((V * l)) / sqrt(A));
} else {
tmp = c0 * sqrt(((A / V) / l));
}
return tmp;
}
assert V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -Double.POSITIVE_INFINITY) {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
} else if ((V * l) <= -2e-289) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if ((V * l) <= 5e-302) {
tmp = c0 * ((1.0 / Math.sqrt((V / A))) / Math.sqrt(l));
} else if ((V * l) <= 5e+299) {
tmp = c0 / (Math.sqrt((V * l)) / Math.sqrt(A));
} else {
tmp = c0 * Math.sqrt(((A / V) / l));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= -math.inf: tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) elif (V * l) <= -2e-289: tmp = c0 * (math.sqrt(-A) / math.sqrt((V * -l))) elif (V * l) <= 5e-302: tmp = c0 * ((1.0 / math.sqrt((V / A))) / math.sqrt(l)) elif (V * l) <= 5e+299: tmp = c0 / (math.sqrt((V * l)) / math.sqrt(A)) else: tmp = c0 * math.sqrt(((A / V) / l)) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= Float64(-Inf)) tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))); elseif (Float64(V * l) <= -2e-289) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif (Float64(V * l) <= 5e-302) tmp = Float64(c0 * Float64(Float64(1.0 / sqrt(Float64(V / A))) / sqrt(l))); elseif (Float64(V * l) <= 5e+299) tmp = Float64(c0 / Float64(sqrt(Float64(V * l)) / sqrt(A))); 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)
tmp = 0.0;
if ((V * l) <= -Inf)
tmp = c0 * (sqrt((A / V)) / sqrt(l));
elseif ((V * l) <= -2e-289)
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
elseif ((V * l) <= 5e-302)
tmp = c0 * ((1.0 / sqrt((V / A))) / sqrt(l));
elseif ((V * l) <= 5e+299)
tmp = c0 / (sqrt((V * l)) / sqrt(A));
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_] := If[LessEqual[N[(V * l), $MachinePrecision], (-Infinity)], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -2e-289], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e-302], N[(c0 * N[(N[(1.0 / N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e+299], N[(c0 / N[(N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[A], $MachinePrecision]), $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}
\mathbf{if}\;V \cdot \ell \leq -\infty:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -2 \cdot 10^{-289}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-302}:\\
\;\;\;\;c0 \cdot \frac{\frac{1}{\sqrt{\frac{V}{A}}}}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{+299}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{V \cdot \ell}}{\sqrt{A}}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -inf.0Initial program 34.6%
associate-/r*60.8%
sqrt-div32.6%
Applied egg-rr32.6%
if -inf.0 < (*.f64 V l) < -2e-289Initial program 89.1%
frac-2neg89.1%
sqrt-div99.4%
*-commutative99.4%
distribute-rgt-neg-in99.4%
Applied egg-rr99.4%
if -2e-289 < (*.f64 V l) < 5.00000000000000033e-302Initial program 34.0%
associate-/r*55.4%
sqrt-div39.8%
Applied egg-rr39.8%
clear-num39.8%
sqrt-div39.9%
metadata-eval39.9%
Applied egg-rr39.9%
if 5.00000000000000033e-302 < (*.f64 V l) < 5.0000000000000003e299Initial program 82.3%
sqrt-div99.5%
associate-*r/97.1%
Applied egg-rr97.1%
associate-/l*99.6%
Simplified99.6%
if 5.0000000000000003e299 < (*.f64 V l) Initial program 37.3%
associate-/r*73.9%
div-inv73.9%
Applied egg-rr73.9%
un-div-inv73.9%
Applied egg-rr73.9%
Final simplification85.4%
NOTE: V and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (if (<= A -5e-311) (* c0 (/ (/ (sqrt (- A)) (sqrt (- V))) (sqrt l))) (/ c0 (/ (sqrt (* V l)) (sqrt A)))))
assert(V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -5e-311) {
tmp = c0 * ((sqrt(-A) / sqrt(-V)) / 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 (a <= (-5d-311)) then
tmp = c0 * ((sqrt(-a) / sqrt(-v)) / 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 (A <= -5e-311) {
tmp = c0 * ((Math.sqrt(-A) / Math.sqrt(-V)) / 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 A <= -5e-311: tmp = c0 * ((math.sqrt(-A) / math.sqrt(-V)) / 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 (A <= -5e-311) tmp = Float64(c0 * Float64(Float64(sqrt(Float64(-A)) / sqrt(Float64(-V))) / 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 (A <= -5e-311)
tmp = c0 * ((sqrt(-A) / sqrt(-V)) / 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[A, -5e-311], N[(c0 * N[(N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[(-V)], $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}\;A \leq -5 \cdot 10^{-311}:\\
\;\;\;\;c0 \cdot \frac{\frac{\sqrt{-A}}{\sqrt{-V}}}{\sqrt{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{V \cdot \ell}}{\sqrt{A}}}\\
\end{array}
\end{array}
if A < -5.00000000000023e-311Initial program 73.0%
associate-/r*70.6%
sqrt-div36.3%
Applied egg-rr36.3%
frac-2neg36.3%
sqrt-div47.7%
Applied egg-rr47.7%
if -5.00000000000023e-311 < A Initial program 72.1%
sqrt-div84.7%
associate-*r/83.0%
Applied egg-rr83.0%
associate-/l*84.8%
Simplified84.8%
Final simplification63.4%
NOTE: V and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (* c0 (/ (sqrt (/ A V)) (sqrt l)))))
(if (<= (* V l) -5e+255)
t_0
(if (<= (* V l) -2e-229)
(* c0 (sqrt (/ A (* V l))))
(if (<= (* V l) 5e-302)
t_0
(if (<= (* V l) 5e+299)
(* (sqrt A) (/ c0 (sqrt (* V l))))
(* c0 (sqrt (/ (/ A V) l)))))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double t_0 = c0 * (sqrt((A / V)) / sqrt(l));
double tmp;
if ((V * l) <= -5e+255) {
tmp = t_0;
} else if ((V * l) <= -2e-229) {
tmp = c0 * sqrt((A / (V * l)));
} else if ((V * l) <= 5e-302) {
tmp = t_0;
} else if ((V * l) <= 5e+299) {
tmp = sqrt(A) * (c0 / sqrt((V * l)));
} 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 = c0 * (sqrt((a / v)) / sqrt(l))
if ((v * l) <= (-5d+255)) then
tmp = t_0
else if ((v * l) <= (-2d-229)) then
tmp = c0 * sqrt((a / (v * l)))
else if ((v * l) <= 5d-302) then
tmp = t_0
else if ((v * l) <= 5d+299) then
tmp = sqrt(a) * (c0 / sqrt((v * l)))
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 = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
double tmp;
if ((V * l) <= -5e+255) {
tmp = t_0;
} else if ((V * l) <= -2e-229) {
tmp = c0 * Math.sqrt((A / (V * l)));
} else if ((V * l) <= 5e-302) {
tmp = t_0;
} else if ((V * l) <= 5e+299) {
tmp = Math.sqrt(A) * (c0 / Math.sqrt((V * l)));
} else {
tmp = c0 * Math.sqrt(((A / V) / l));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): t_0 = c0 * (math.sqrt((A / V)) / math.sqrt(l)) tmp = 0 if (V * l) <= -5e+255: tmp = t_0 elif (V * l) <= -2e-229: tmp = c0 * math.sqrt((A / (V * l))) elif (V * l) <= 5e-302: tmp = t_0 elif (V * l) <= 5e+299: tmp = math.sqrt(A) * (c0 / math.sqrt((V * l))) else: tmp = c0 * math.sqrt(((A / V) / l)) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) t_0 = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))) tmp = 0.0 if (Float64(V * l) <= -5e+255) tmp = t_0; elseif (Float64(V * l) <= -2e-229) tmp = Float64(c0 * sqrt(Float64(A / Float64(V * l)))); elseif (Float64(V * l) <= 5e-302) tmp = t_0; elseif (Float64(V * l) <= 5e+299) tmp = Float64(sqrt(A) * Float64(c0 / sqrt(Float64(V * l)))); 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 = c0 * (sqrt((A / V)) / sqrt(l));
tmp = 0.0;
if ((V * l) <= -5e+255)
tmp = t_0;
elseif ((V * l) <= -2e-229)
tmp = c0 * sqrt((A / (V * l)));
elseif ((V * l) <= 5e-302)
tmp = t_0;
elseif ((V * l) <= 5e+299)
tmp = sqrt(A) * (c0 / sqrt((V * l)));
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[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], -5e+255], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], -2e-229], N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e-302], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], 5e+299], N[(N[Sqrt[A], $MachinePrecision] * N[(c0 / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $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 := c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{if}\;V \cdot \ell \leq -5 \cdot 10^{+255}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;V \cdot \ell \leq -2 \cdot 10^{-229}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-302}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{+299}:\\
\;\;\;\;\sqrt{A} \cdot \frac{c0}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -5.0000000000000002e255 or -2.00000000000000014e-229 < (*.f64 V l) < 5.00000000000000033e-302Initial program 48.5%
associate-/r*64.6%
sqrt-div44.4%
Applied egg-rr44.4%
if -5.0000000000000002e255 < (*.f64 V l) < -2.00000000000000014e-229Initial program 91.7%
if 5.00000000000000033e-302 < (*.f64 V l) < 5.0000000000000003e299Initial program 82.3%
sqrt-div99.5%
associate-*r/97.1%
Applied egg-rr97.1%
associate-*l/96.2%
Simplified96.2%
if 5.0000000000000003e299 < (*.f64 V l) Initial program 37.3%
associate-/r*73.9%
div-inv73.9%
Applied egg-rr73.9%
un-div-inv73.9%
Applied egg-rr73.9%
Final simplification78.4%
NOTE: V and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (* c0 (/ (sqrt (/ A V)) (sqrt l)))))
(if (<= (* V l) -5e+255)
t_0
(if (<= (* V l) -2e-229)
(* c0 (sqrt (/ A (* V l))))
(if (<= (* V l) 5e-302)
t_0
(if (<= (* V l) 5e+299)
(/ c0 (/ (sqrt (* V l)) (sqrt A)))
(* c0 (sqrt (/ (/ A V) l)))))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double t_0 = c0 * (sqrt((A / V)) / sqrt(l));
double tmp;
if ((V * l) <= -5e+255) {
tmp = t_0;
} else if ((V * l) <= -2e-229) {
tmp = c0 * sqrt((A / (V * l)));
} else if ((V * l) <= 5e-302) {
tmp = t_0;
} else if ((V * l) <= 5e+299) {
tmp = c0 / (sqrt((V * l)) / sqrt(A));
} 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 = c0 * (sqrt((a / v)) / sqrt(l))
if ((v * l) <= (-5d+255)) then
tmp = t_0
else if ((v * l) <= (-2d-229)) then
tmp = c0 * sqrt((a / (v * l)))
else if ((v * l) <= 5d-302) then
tmp = t_0
else if ((v * l) <= 5d+299) then
tmp = c0 / (sqrt((v * l)) / sqrt(a))
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 = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
double tmp;
if ((V * l) <= -5e+255) {
tmp = t_0;
} else if ((V * l) <= -2e-229) {
tmp = c0 * Math.sqrt((A / (V * l)));
} else if ((V * l) <= 5e-302) {
tmp = t_0;
} else if ((V * l) <= 5e+299) {
tmp = c0 / (Math.sqrt((V * l)) / Math.sqrt(A));
} else {
tmp = c0 * Math.sqrt(((A / V) / l));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): t_0 = c0 * (math.sqrt((A / V)) / math.sqrt(l)) tmp = 0 if (V * l) <= -5e+255: tmp = t_0 elif (V * l) <= -2e-229: tmp = c0 * math.sqrt((A / (V * l))) elif (V * l) <= 5e-302: tmp = t_0 elif (V * l) <= 5e+299: tmp = c0 / (math.sqrt((V * l)) / math.sqrt(A)) else: tmp = c0 * math.sqrt(((A / V) / l)) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) t_0 = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))) tmp = 0.0 if (Float64(V * l) <= -5e+255) tmp = t_0; elseif (Float64(V * l) <= -2e-229) tmp = Float64(c0 * sqrt(Float64(A / Float64(V * l)))); elseif (Float64(V * l) <= 5e-302) tmp = t_0; elseif (Float64(V * l) <= 5e+299) tmp = Float64(c0 / Float64(sqrt(Float64(V * l)) / sqrt(A))); 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 = c0 * (sqrt((A / V)) / sqrt(l));
tmp = 0.0;
if ((V * l) <= -5e+255)
tmp = t_0;
elseif ((V * l) <= -2e-229)
tmp = c0 * sqrt((A / (V * l)));
elseif ((V * l) <= 5e-302)
tmp = t_0;
elseif ((V * l) <= 5e+299)
tmp = c0 / (sqrt((V * l)) / sqrt(A));
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[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], -5e+255], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], -2e-229], N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e-302], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], 5e+299], N[(c0 / N[(N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[A], $MachinePrecision]), $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 := c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{if}\;V \cdot \ell \leq -5 \cdot 10^{+255}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;V \cdot \ell \leq -2 \cdot 10^{-229}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-302}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{+299}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{V \cdot \ell}}{\sqrt{A}}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -5.0000000000000002e255 or -2.00000000000000014e-229 < (*.f64 V l) < 5.00000000000000033e-302Initial program 48.5%
associate-/r*64.6%
sqrt-div44.4%
Applied egg-rr44.4%
if -5.0000000000000002e255 < (*.f64 V l) < -2.00000000000000014e-229Initial program 91.7%
if 5.00000000000000033e-302 < (*.f64 V l) < 5.0000000000000003e299Initial program 82.3%
sqrt-div99.5%
associate-*r/97.1%
Applied egg-rr97.1%
associate-/l*99.6%
Simplified99.6%
if 5.0000000000000003e299 < (*.f64 V l) Initial program 37.3%
associate-/r*73.9%
div-inv73.9%
Applied egg-rr73.9%
un-div-inv73.9%
Applied egg-rr73.9%
Final simplification79.4%
NOTE: V and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (* c0 (/ (sqrt (/ A V)) (sqrt l)))))
(if (<= (* V l) (- INFINITY))
t_0
(if (<= (* V l) -2e-289)
(* c0 (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (<= (* V l) 5e-302)
t_0
(if (<= (* V l) 5e+299)
(/ c0 (/ (sqrt (* V l)) (sqrt A)))
(* c0 (sqrt (/ (/ A V) l)))))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double t_0 = c0 * (sqrt((A / V)) / sqrt(l));
double tmp;
if ((V * l) <= -((double) INFINITY)) {
tmp = t_0;
} else if ((V * l) <= -2e-289) {
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
} else if ((V * l) <= 5e-302) {
tmp = t_0;
} else if ((V * l) <= 5e+299) {
tmp = c0 / (sqrt((V * l)) / sqrt(A));
} else {
tmp = c0 * sqrt(((A / V) / l));
}
return tmp;
}
assert V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
double tmp;
if ((V * l) <= -Double.POSITIVE_INFINITY) {
tmp = t_0;
} else if ((V * l) <= -2e-289) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if ((V * l) <= 5e-302) {
tmp = t_0;
} else if ((V * l) <= 5e+299) {
tmp = c0 / (Math.sqrt((V * l)) / Math.sqrt(A));
} else {
tmp = c0 * Math.sqrt(((A / V) / l));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): t_0 = c0 * (math.sqrt((A / V)) / math.sqrt(l)) tmp = 0 if (V * l) <= -math.inf: tmp = t_0 elif (V * l) <= -2e-289: tmp = c0 * (math.sqrt(-A) / math.sqrt((V * -l))) elif (V * l) <= 5e-302: tmp = t_0 elif (V * l) <= 5e+299: tmp = c0 / (math.sqrt((V * l)) / math.sqrt(A)) else: tmp = c0 * math.sqrt(((A / V) / l)) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) t_0 = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))) tmp = 0.0 if (Float64(V * l) <= Float64(-Inf)) tmp = t_0; elseif (Float64(V * l) <= -2e-289) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif (Float64(V * l) <= 5e-302) tmp = t_0; elseif (Float64(V * l) <= 5e+299) tmp = Float64(c0 / Float64(sqrt(Float64(V * l)) / sqrt(A))); 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 = c0 * (sqrt((A / V)) / sqrt(l));
tmp = 0.0;
if ((V * l) <= -Inf)
tmp = t_0;
elseif ((V * l) <= -2e-289)
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
elseif ((V * l) <= 5e-302)
tmp = t_0;
elseif ((V * l) <= 5e+299)
tmp = c0 / (sqrt((V * l)) / sqrt(A));
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[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], (-Infinity)], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], -2e-289], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e-302], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], 5e+299], N[(c0 / N[(N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[A], $MachinePrecision]), $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 := c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{if}\;V \cdot \ell \leq -\infty:\\
\;\;\;\;t_0\\
\mathbf{elif}\;V \cdot \ell \leq -2 \cdot 10^{-289}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-302}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{+299}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{V \cdot \ell}}{\sqrt{A}}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -inf.0 or -2e-289 < (*.f64 V l) < 5.00000000000000033e-302Initial program 34.2%
associate-/r*57.8%
sqrt-div36.7%
Applied egg-rr36.7%
if -inf.0 < (*.f64 V l) < -2e-289Initial program 89.1%
frac-2neg89.1%
sqrt-div99.4%
*-commutative99.4%
distribute-rgt-neg-in99.4%
Applied egg-rr99.4%
if 5.00000000000000033e-302 < (*.f64 V l) < 5.0000000000000003e299Initial program 82.3%
sqrt-div99.5%
associate-*r/97.1%
Applied egg-rr97.1%
associate-/l*99.6%
Simplified99.6%
if 5.0000000000000003e299 < (*.f64 V l) Initial program 37.3%
associate-/r*73.9%
div-inv73.9%
Applied egg-rr73.9%
un-div-inv73.9%
Applied egg-rr73.9%
Final simplification85.4%
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)
(* c0 (sqrt (/ (/ A V) l)))
(if (<= t_0 1e+306)
(* c0 (sqrt t_0))
(* c0 (/ (sqrt (/ A V)) (sqrt 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 <= 0.0) {
tmp = c0 * sqrt(((A / V) / l));
} else if (t_0 <= 1e+306) {
tmp = c0 * sqrt(t_0);
} else {
tmp = c0 * (sqrt((A / V)) / 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) :: t_0
real(8) :: tmp
t_0 = a / (v * l)
if (t_0 <= 0.0d0) then
tmp = c0 * sqrt(((a / v) / l))
else if (t_0 <= 1d+306) then
tmp = c0 * sqrt(t_0)
else
tmp = c0 * (sqrt((a / v)) / sqrt(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 <= 0.0) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else if (t_0 <= 1e+306) {
tmp = c0 * Math.sqrt(t_0);
} else {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
}
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 = c0 * math.sqrt(((A / V) / l)) elif t_0 <= 1e+306: tmp = c0 * math.sqrt(t_0) else: tmp = c0 * (math.sqrt((A / V)) / math.sqrt(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 <= 0.0) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); elseif (t_0 <= 1e+306) tmp = Float64(c0 * sqrt(t_0)); else tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(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 <= 0.0)
tmp = c0 * sqrt(((A / V) / l));
elseif (t_0 <= 1e+306)
tmp = c0 * sqrt(t_0);
else
tmp = c0 * (sqrt((A / V)) / 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_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e+306], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[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 0:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{elif}\;t_0 \leq 10^{+306}:\\
\;\;\;\;c0 \cdot \sqrt{t_0}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0Initial program 32.9%
associate-/r*54.2%
div-inv54.2%
Applied egg-rr54.2%
un-div-inv54.2%
Applied egg-rr54.2%
if 0.0 < (/.f64 A (*.f64 V l)) < 1.00000000000000002e306Initial program 99.0%
if 1.00000000000000002e306 < (/.f64 A (*.f64 V l)) Initial program 36.9%
associate-/r*49.1%
sqrt-div39.1%
Applied egg-rr39.1%
Final simplification77.8%
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)
(* c0 (sqrt (/ (/ A V) l)))
(if (<= t_0 1e+306) (* c0 (sqrt t_0)) (* c0 (pow (* l (/ V A)) -0.5))))))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 = c0 * sqrt(((A / V) / l));
} else if (t_0 <= 1e+306) {
tmp = c0 * sqrt(t_0);
} else {
tmp = c0 * pow((l * (V / A)), -0.5);
}
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 = c0 * sqrt(((a / v) / l))
else if (t_0 <= 1d+306) then
tmp = c0 * sqrt(t_0)
else
tmp = c0 * ((l * (v / a)) ** (-0.5d0))
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 = c0 * Math.sqrt(((A / V) / l));
} else if (t_0 <= 1e+306) {
tmp = c0 * Math.sqrt(t_0);
} else {
tmp = c0 * Math.pow((l * (V / A)), -0.5);
}
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 = c0 * math.sqrt(((A / V) / l)) elif t_0 <= 1e+306: tmp = c0 * math.sqrt(t_0) else: tmp = c0 * math.pow((l * (V / A)), -0.5) 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 = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); elseif (t_0 <= 1e+306) tmp = Float64(c0 * sqrt(t_0)); else tmp = Float64(c0 * (Float64(l * Float64(V / A)) ^ -0.5)); 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 = c0 * sqrt(((A / V) / l));
elseif (t_0 <= 1e+306)
tmp = c0 * sqrt(t_0);
else
tmp = c0 * ((l * (V / A)) ^ -0.5);
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[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e+306], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(c0 * N[Power[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision], -0.5], $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:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{elif}\;t_0 \leq 10^{+306}:\\
\;\;\;\;c0 \cdot \sqrt{t_0}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot {\left(\ell \cdot \frac{V}{A}\right)}^{-0.5}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0Initial program 32.9%
associate-/r*54.2%
div-inv54.2%
Applied egg-rr54.2%
un-div-inv54.2%
Applied egg-rr54.2%
if 0.0 < (/.f64 A (*.f64 V l)) < 1.00000000000000002e306Initial program 99.0%
if 1.00000000000000002e306 < (/.f64 A (*.f64 V l)) Initial program 36.9%
pow1/236.9%
clear-num36.9%
inv-pow36.9%
pow-pow36.9%
associate-/l*49.1%
metadata-eval49.1%
Applied egg-rr49.1%
associate-/l*36.9%
Simplified36.9%
associate-/l*49.1%
associate-/r/49.1%
Applied egg-rr49.1%
Final simplification79.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 (or (<= t_0 0.0) (not (<= t_0 1e+306)))
(* c0 (sqrt (/ (/ A V) l)))
(* c0 (sqrt t_0)))))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) || !(t_0 <= 1e+306)) {
tmp = c0 * sqrt(((A / V) / l));
} else {
tmp = c0 * sqrt(t_0);
}
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) .or. (.not. (t_0 <= 1d+306))) then
tmp = c0 * sqrt(((a / v) / l))
else
tmp = c0 * sqrt(t_0)
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) || !(t_0 <= 1e+306)) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else {
tmp = c0 * Math.sqrt(t_0);
}
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) or not (t_0 <= 1e+306): tmp = c0 * math.sqrt(((A / V) / l)) else: tmp = c0 * math.sqrt(t_0) 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) || !(t_0 <= 1e+306)) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); else tmp = Float64(c0 * sqrt(t_0)); 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) || ~((t_0 <= 1e+306)))
tmp = c0 * sqrt(((A / V) / l));
else
tmp = c0 * sqrt(t_0);
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[Or[LessEqual[t$95$0, 0.0], N[Not[LessEqual[t$95$0, 1e+306]], $MachinePrecision]], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[t$95$0], $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 \lor \neg \left(t_0 \leq 10^{+306}\right):\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{t_0}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0 or 1.00000000000000002e306 < (/.f64 A (*.f64 V l)) Initial program 34.7%
associate-/r*51.9%
div-inv51.9%
Applied egg-rr51.9%
un-div-inv51.9%
Applied egg-rr51.9%
if 0.0 < (/.f64 A (*.f64 V l)) < 1.00000000000000002e306Initial program 99.0%
Final simplification79.7%
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 72.6%
Final simplification72.6%
herbie shell --seed 2023264
(FPCore (c0 A V l)
:name "Henrywood and Agarwal, Equation (3)"
:precision binary64
(* c0 (sqrt (/ A (* V l)))))