
(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 10 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
(let* ((t_0 (/ c0 (/ (sqrt (- V)) (sqrt (/ (- A) l))))))
(if (<= (* V l) -5e+248)
t_0
(if (<= (* V l) -2e-282)
(* c0 (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (<= (* V l) 0.0)
t_0
(if (<= (* V l) 2e+296)
(/ (* c0 (sqrt A)) (sqrt (* V l)))
(/ c0 (sqrt (* V (/ l A))))))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double t_0 = c0 / (sqrt(-V) / sqrt((-A / l)));
double tmp;
if ((V * l) <= -5e+248) {
tmp = t_0;
} else if ((V * l) <= -2e-282) {
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = t_0;
} else if ((V * l) <= 2e+296) {
tmp = (c0 * sqrt(A)) / sqrt((V * l));
} 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 = c0 / (sqrt(-v) / sqrt((-a / l)))
if ((v * l) <= (-5d+248)) then
tmp = t_0
else if ((v * l) <= (-2d-282)) then
tmp = c0 * (sqrt(-a) / sqrt((v * -l)))
else if ((v * l) <= 0.0d0) then
tmp = t_0
else if ((v * l) <= 2d+296) then
tmp = (c0 * sqrt(a)) / sqrt((v * l))
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 = c0 / (Math.sqrt(-V) / Math.sqrt((-A / l)));
double tmp;
if ((V * l) <= -5e+248) {
tmp = t_0;
} else if ((V * l) <= -2e-282) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = t_0;
} else if ((V * l) <= 2e+296) {
tmp = (c0 * Math.sqrt(A)) / Math.sqrt((V * l));
} else {
tmp = c0 / Math.sqrt((V * (l / A)));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): t_0 = c0 / (math.sqrt(-V) / math.sqrt((-A / l))) tmp = 0 if (V * l) <= -5e+248: tmp = t_0 elif (V * l) <= -2e-282: tmp = c0 * (math.sqrt(-A) / math.sqrt((V * -l))) elif (V * l) <= 0.0: tmp = t_0 elif (V * l) <= 2e+296: tmp = (c0 * math.sqrt(A)) / math.sqrt((V * l)) else: tmp = c0 / math.sqrt((V * (l / A))) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) t_0 = Float64(c0 / Float64(sqrt(Float64(-V)) / sqrt(Float64(Float64(-A) / l)))) tmp = 0.0 if (Float64(V * l) <= -5e+248) tmp = t_0; elseif (Float64(V * l) <= -2e-282) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif (Float64(V * l) <= 0.0) tmp = t_0; elseif (Float64(V * l) <= 2e+296) tmp = Float64(Float64(c0 * sqrt(A)) / sqrt(Float64(V * l))); 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 = c0 / (sqrt(-V) / sqrt((-A / l)));
tmp = 0.0;
if ((V * l) <= -5e+248)
tmp = t_0;
elseif ((V * l) <= -2e-282)
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
elseif ((V * l) <= 0.0)
tmp = t_0;
elseif ((V * l) <= 2e+296)
tmp = (c0 * sqrt(A)) / sqrt((V * l));
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[(c0 / N[(N[Sqrt[(-V)], $MachinePrecision] / N[Sqrt[N[((-A) / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], -5e+248], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], -2e-282], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], 2e+296], N[(N[(c0 * N[Sqrt[A], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $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{c0}{\frac{\sqrt{-V}}{\sqrt{\frac{-A}{\ell}}}}\\
\mathbf{if}\;V \cdot \ell \leq -5 \cdot 10^{+248}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;V \cdot \ell \leq -2 \cdot 10^{-282}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;t_0\\
\mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{+296}:\\
\;\;\;\;\frac{c0 \cdot \sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\end{array}
\end{array}
if (*.f64 V l) < -4.9999999999999996e248 or -2e-282 < (*.f64 V l) < -0.0Initial program 53.6%
pow1/253.6%
clear-num53.6%
inv-pow53.6%
pow-pow53.6%
associate-/l*74.0%
metadata-eval74.0%
Applied egg-rr74.0%
div-inv73.9%
clear-num73.9%
metadata-eval73.9%
sqrt-pow274.0%
inv-pow74.0%
un-div-inv74.0%
Applied egg-rr74.0%
clear-num74.0%
div-inv74.0%
frac-2neg74.0%
sqrt-div46.8%
Applied egg-rr46.8%
distribute-neg-frac46.8%
Simplified46.8%
if -4.9999999999999996e248 < (*.f64 V l) < -2e-282Initial program 88.4%
frac-2neg88.4%
sqrt-div99.6%
*-commutative99.6%
distribute-rgt-neg-in99.6%
Applied egg-rr99.6%
if -0.0 < (*.f64 V l) < 1.99999999999999996e296Initial program 80.4%
*-commutative80.4%
sqrt-div99.1%
associate-*l/97.0%
Applied egg-rr97.0%
if 1.99999999999999996e296 < (*.f64 V l) Initial program 47.0%
pow1/247.0%
clear-num47.0%
inv-pow47.0%
pow-pow47.0%
associate-/l*83.8%
metadata-eval83.8%
Applied egg-rr83.8%
div-inv83.7%
clear-num83.8%
metadata-eval83.8%
sqrt-pow283.7%
inv-pow83.7%
un-div-inv83.8%
Applied egg-rr83.8%
Final simplification84.8%
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+123)
(/ c0 (* (sqrt (/ V A)) (sqrt l)))
(if (<= (* V l) -1e-146)
(* c0 (pow (/ (* V l) A) -0.5))
(if (<= (* V l) 2e-312)
(/ c0 (sqrt (* l (/ V A))))
(if (<= (* V l) 2e+296)
(/ (* c0 (sqrt A)) (sqrt (* V l)))
(/ c0 (sqrt (* V (/ l A)))))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -5e+123) {
tmp = c0 / (sqrt((V / A)) * sqrt(l));
} else if ((V * l) <= -1e-146) {
tmp = c0 * pow(((V * l) / A), -0.5);
} else if ((V * l) <= 2e-312) {
tmp = c0 / sqrt((l * (V / A)));
} else if ((V * l) <= 2e+296) {
tmp = (c0 * sqrt(A)) / sqrt((V * l));
} 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) :: tmp
if ((v * l) <= (-5d+123)) then
tmp = c0 / (sqrt((v / a)) * sqrt(l))
else if ((v * l) <= (-1d-146)) then
tmp = c0 * (((v * l) / a) ** (-0.5d0))
else if ((v * l) <= 2d-312) then
tmp = c0 / sqrt((l * (v / a)))
else if ((v * l) <= 2d+296) then
tmp = (c0 * sqrt(a)) / sqrt((v * l))
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 tmp;
if ((V * l) <= -5e+123) {
tmp = c0 / (Math.sqrt((V / A)) * Math.sqrt(l));
} else if ((V * l) <= -1e-146) {
tmp = c0 * Math.pow(((V * l) / A), -0.5);
} else if ((V * l) <= 2e-312) {
tmp = c0 / Math.sqrt((l * (V / A)));
} else if ((V * l) <= 2e+296) {
tmp = (c0 * Math.sqrt(A)) / Math.sqrt((V * l));
} else {
tmp = c0 / Math.sqrt((V * (l / A)));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= -5e+123: tmp = c0 / (math.sqrt((V / A)) * math.sqrt(l)) elif (V * l) <= -1e-146: tmp = c0 * math.pow(((V * l) / A), -0.5) elif (V * l) <= 2e-312: tmp = c0 / math.sqrt((l * (V / A))) elif (V * l) <= 2e+296: tmp = (c0 * math.sqrt(A)) / math.sqrt((V * l)) else: tmp = c0 / math.sqrt((V * (l / A))) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= -5e+123) tmp = Float64(c0 / Float64(sqrt(Float64(V / A)) * sqrt(l))); elseif (Float64(V * l) <= -1e-146) tmp = Float64(c0 * (Float64(Float64(V * l) / A) ^ -0.5)); elseif (Float64(V * l) <= 2e-312) tmp = Float64(c0 / sqrt(Float64(l * Float64(V / A)))); elseif (Float64(V * l) <= 2e+296) tmp = Float64(Float64(c0 * sqrt(A)) / sqrt(Float64(V * l))); 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)
tmp = 0.0;
if ((V * l) <= -5e+123)
tmp = c0 / (sqrt((V / A)) * sqrt(l));
elseif ((V * l) <= -1e-146)
tmp = c0 * (((V * l) / A) ^ -0.5);
elseif ((V * l) <= 2e-312)
tmp = c0 / sqrt((l * (V / A)));
elseif ((V * l) <= 2e+296)
tmp = (c0 * sqrt(A)) / sqrt((V * l));
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_] := If[LessEqual[N[(V * l), $MachinePrecision], -5e+123], N[(c0 / N[(N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -1e-146], N[(c0 * N[Power[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 2e-312], N[(c0 / N[Sqrt[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 2e+296], N[(N[(c0 * N[Sqrt[A], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $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}
\mathbf{if}\;V \cdot \ell \leq -5 \cdot 10^{+123}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V}{A}} \cdot \sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-146}:\\
\;\;\;\;c0 \cdot {\left(\frac{V \cdot \ell}{A}\right)}^{-0.5}\\
\mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{-312}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{+296}:\\
\;\;\;\;\frac{c0 \cdot \sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\end{array}
\end{array}
if (*.f64 V l) < -4.99999999999999974e123Initial program 61.8%
pow1/261.8%
clear-num61.0%
inv-pow61.0%
pow-pow61.0%
associate-/l*73.6%
metadata-eval73.6%
Applied egg-rr73.6%
div-inv73.6%
clear-num73.6%
metadata-eval73.6%
sqrt-pow273.6%
inv-pow73.6%
un-div-inv73.6%
Applied egg-rr73.6%
clear-num73.6%
div-inv73.6%
associate-/r/73.6%
sqrt-prod35.4%
Applied egg-rr35.4%
if -4.99999999999999974e123 < (*.f64 V l) < -1.00000000000000003e-146Initial program 93.5%
pow1/293.5%
clear-num93.5%
inv-pow93.5%
pow-pow95.3%
associate-/l*80.7%
metadata-eval80.7%
Applied egg-rr80.7%
associate-/l*95.3%
Simplified95.3%
if -1.00000000000000003e-146 < (*.f64 V l) < 2.0000000000019e-312Initial program 61.2%
pow1/261.2%
clear-num61.2%
inv-pow61.2%
pow-pow61.3%
associate-/l*76.2%
metadata-eval76.2%
Applied egg-rr76.2%
div-inv76.3%
clear-num76.3%
metadata-eval76.3%
sqrt-pow276.3%
inv-pow76.3%
un-div-inv76.4%
Applied egg-rr76.4%
*-commutative76.4%
associate-*l/61.4%
associate-*r/76.4%
Simplified76.4%
if 2.0000000000019e-312 < (*.f64 V l) < 1.99999999999999996e296Initial program 80.3%
*-commutative80.3%
sqrt-div99.2%
associate-*l/97.2%
Applied egg-rr97.2%
if 1.99999999999999996e296 < (*.f64 V l) Initial program 47.0%
pow1/247.0%
clear-num47.0%
inv-pow47.0%
pow-pow47.0%
associate-/l*83.8%
metadata-eval83.8%
Applied egg-rr83.8%
div-inv83.7%
clear-num83.8%
metadata-eval83.8%
sqrt-pow283.7%
inv-pow83.7%
un-div-inv83.8%
Applied egg-rr83.8%
Final simplification81.9%
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+123)
(* c0 (/ 1.0 (* (sqrt (/ V A)) (sqrt l))))
(if (<= (* V l) -1e-146)
(* c0 (pow (/ (* V l) A) -0.5))
(if (<= (* V l) 2e-312)
(/ c0 (sqrt (* l (/ V A))))
(if (<= (* V l) 2e+296)
(/ (* c0 (sqrt A)) (sqrt (* V l)))
(/ c0 (sqrt (* V (/ l A)))))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -5e+123) {
tmp = c0 * (1.0 / (sqrt((V / A)) * sqrt(l)));
} else if ((V * l) <= -1e-146) {
tmp = c0 * pow(((V * l) / A), -0.5);
} else if ((V * l) <= 2e-312) {
tmp = c0 / sqrt((l * (V / A)));
} else if ((V * l) <= 2e+296) {
tmp = (c0 * sqrt(A)) / sqrt((V * l));
} 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) :: tmp
if ((v * l) <= (-5d+123)) then
tmp = c0 * (1.0d0 / (sqrt((v / a)) * sqrt(l)))
else if ((v * l) <= (-1d-146)) then
tmp = c0 * (((v * l) / a) ** (-0.5d0))
else if ((v * l) <= 2d-312) then
tmp = c0 / sqrt((l * (v / a)))
else if ((v * l) <= 2d+296) then
tmp = (c0 * sqrt(a)) / sqrt((v * l))
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 tmp;
if ((V * l) <= -5e+123) {
tmp = c0 * (1.0 / (Math.sqrt((V / A)) * Math.sqrt(l)));
} else if ((V * l) <= -1e-146) {
tmp = c0 * Math.pow(((V * l) / A), -0.5);
} else if ((V * l) <= 2e-312) {
tmp = c0 / Math.sqrt((l * (V / A)));
} else if ((V * l) <= 2e+296) {
tmp = (c0 * Math.sqrt(A)) / Math.sqrt((V * l));
} else {
tmp = c0 / Math.sqrt((V * (l / A)));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= -5e+123: tmp = c0 * (1.0 / (math.sqrt((V / A)) * math.sqrt(l))) elif (V * l) <= -1e-146: tmp = c0 * math.pow(((V * l) / A), -0.5) elif (V * l) <= 2e-312: tmp = c0 / math.sqrt((l * (V / A))) elif (V * l) <= 2e+296: tmp = (c0 * math.sqrt(A)) / math.sqrt((V * l)) else: tmp = c0 / math.sqrt((V * (l / A))) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= -5e+123) tmp = Float64(c0 * Float64(1.0 / Float64(sqrt(Float64(V / A)) * sqrt(l)))); elseif (Float64(V * l) <= -1e-146) tmp = Float64(c0 * (Float64(Float64(V * l) / A) ^ -0.5)); elseif (Float64(V * l) <= 2e-312) tmp = Float64(c0 / sqrt(Float64(l * Float64(V / A)))); elseif (Float64(V * l) <= 2e+296) tmp = Float64(Float64(c0 * sqrt(A)) / sqrt(Float64(V * l))); 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)
tmp = 0.0;
if ((V * l) <= -5e+123)
tmp = c0 * (1.0 / (sqrt((V / A)) * sqrt(l)));
elseif ((V * l) <= -1e-146)
tmp = c0 * (((V * l) / A) ^ -0.5);
elseif ((V * l) <= 2e-312)
tmp = c0 / sqrt((l * (V / A)));
elseif ((V * l) <= 2e+296)
tmp = (c0 * sqrt(A)) / sqrt((V * l));
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_] := If[LessEqual[N[(V * l), $MachinePrecision], -5e+123], N[(c0 * N[(1.0 / N[(N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -1e-146], N[(c0 * N[Power[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 2e-312], N[(c0 / N[Sqrt[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 2e+296], N[(N[(c0 * N[Sqrt[A], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $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}
\mathbf{if}\;V \cdot \ell \leq -5 \cdot 10^{+123}:\\
\;\;\;\;c0 \cdot \frac{1}{\sqrt{\frac{V}{A}} \cdot \sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-146}:\\
\;\;\;\;c0 \cdot {\left(\frac{V \cdot \ell}{A}\right)}^{-0.5}\\
\mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{-312}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{+296}:\\
\;\;\;\;\frac{c0 \cdot \sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\end{array}
\end{array}
if (*.f64 V l) < -4.99999999999999974e123Initial program 61.8%
clear-num61.0%
sqrt-div61.0%
metadata-eval61.0%
associate-/l*73.6%
Applied egg-rr73.6%
associate-/l*61.0%
*-lft-identity61.0%
times-frac73.6%
/-rgt-identity73.6%
Simplified73.6%
clear-num73.6%
div-inv73.6%
associate-/r/73.6%
sqrt-prod35.4%
Applied egg-rr35.4%
if -4.99999999999999974e123 < (*.f64 V l) < -1.00000000000000003e-146Initial program 93.5%
pow1/293.5%
clear-num93.5%
inv-pow93.5%
pow-pow95.3%
associate-/l*80.7%
metadata-eval80.7%
Applied egg-rr80.7%
associate-/l*95.3%
Simplified95.3%
if -1.00000000000000003e-146 < (*.f64 V l) < 2.0000000000019e-312Initial program 61.2%
pow1/261.2%
clear-num61.2%
inv-pow61.2%
pow-pow61.3%
associate-/l*76.2%
metadata-eval76.2%
Applied egg-rr76.2%
div-inv76.3%
clear-num76.3%
metadata-eval76.3%
sqrt-pow276.3%
inv-pow76.3%
un-div-inv76.4%
Applied egg-rr76.4%
*-commutative76.4%
associate-*l/61.4%
associate-*r/76.4%
Simplified76.4%
if 2.0000000000019e-312 < (*.f64 V l) < 1.99999999999999996e296Initial program 80.3%
*-commutative80.3%
sqrt-div99.2%
associate-*l/97.2%
Applied egg-rr97.2%
if 1.99999999999999996e296 < (*.f64 V l) Initial program 47.0%
pow1/247.0%
clear-num47.0%
inv-pow47.0%
pow-pow47.0%
associate-/l*83.8%
metadata-eval83.8%
Applied egg-rr83.8%
div-inv83.7%
clear-num83.8%
metadata-eval83.8%
sqrt-pow283.7%
inv-pow83.7%
un-div-inv83.8%
Applied egg-rr83.8%
Final simplification81.9%
NOTE: V and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* V l) -2e+294)
(* c0 (/ 1.0 (* (sqrt (/ V A)) (sqrt l))))
(if (<= (* V l) -2e-282)
(* c0 (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (<= (* V l) 2e-312)
(/ c0 (sqrt (* l (/ V A))))
(if (<= (* V l) 2e+296)
(/ (* c0 (sqrt A)) (sqrt (* V l)))
(/ c0 (sqrt (* V (/ l A)))))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -2e+294) {
tmp = c0 * (1.0 / (sqrt((V / A)) * sqrt(l)));
} else if ((V * l) <= -2e-282) {
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
} else if ((V * l) <= 2e-312) {
tmp = c0 / sqrt((l * (V / A)));
} else if ((V * l) <= 2e+296) {
tmp = (c0 * sqrt(A)) / sqrt((V * l));
} 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) :: tmp
if ((v * l) <= (-2d+294)) then
tmp = c0 * (1.0d0 / (sqrt((v / a)) * sqrt(l)))
else if ((v * l) <= (-2d-282)) then
tmp = c0 * (sqrt(-a) / sqrt((v * -l)))
else if ((v * l) <= 2d-312) then
tmp = c0 / sqrt((l * (v / a)))
else if ((v * l) <= 2d+296) then
tmp = (c0 * sqrt(a)) / sqrt((v * l))
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 tmp;
if ((V * l) <= -2e+294) {
tmp = c0 * (1.0 / (Math.sqrt((V / A)) * Math.sqrt(l)));
} else if ((V * l) <= -2e-282) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if ((V * l) <= 2e-312) {
tmp = c0 / Math.sqrt((l * (V / A)));
} else if ((V * l) <= 2e+296) {
tmp = (c0 * Math.sqrt(A)) / Math.sqrt((V * l));
} else {
tmp = c0 / Math.sqrt((V * (l / A)));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= -2e+294: tmp = c0 * (1.0 / (math.sqrt((V / A)) * math.sqrt(l))) elif (V * l) <= -2e-282: tmp = c0 * (math.sqrt(-A) / math.sqrt((V * -l))) elif (V * l) <= 2e-312: tmp = c0 / math.sqrt((l * (V / A))) elif (V * l) <= 2e+296: tmp = (c0 * math.sqrt(A)) / math.sqrt((V * l)) else: tmp = c0 / math.sqrt((V * (l / A))) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= -2e+294) tmp = Float64(c0 * Float64(1.0 / Float64(sqrt(Float64(V / A)) * sqrt(l)))); elseif (Float64(V * l) <= -2e-282) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif (Float64(V * l) <= 2e-312) tmp = Float64(c0 / sqrt(Float64(l * Float64(V / A)))); elseif (Float64(V * l) <= 2e+296) tmp = Float64(Float64(c0 * sqrt(A)) / sqrt(Float64(V * l))); 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)
tmp = 0.0;
if ((V * l) <= -2e+294)
tmp = c0 * (1.0 / (sqrt((V / A)) * sqrt(l)));
elseif ((V * l) <= -2e-282)
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
elseif ((V * l) <= 2e-312)
tmp = c0 / sqrt((l * (V / A)));
elseif ((V * l) <= 2e+296)
tmp = (c0 * sqrt(A)) / sqrt((V * l));
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_] := If[LessEqual[N[(V * l), $MachinePrecision], -2e+294], N[(c0 * N[(1.0 / N[(N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -2e-282], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 2e-312], N[(c0 / N[Sqrt[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 2e+296], N[(N[(c0 * N[Sqrt[A], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $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}
\mathbf{if}\;V \cdot \ell \leq -2 \cdot 10^{+294}:\\
\;\;\;\;c0 \cdot \frac{1}{\sqrt{\frac{V}{A}} \cdot \sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -2 \cdot 10^{-282}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{-312}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{+296}:\\
\;\;\;\;\frac{c0 \cdot \sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\end{array}
\end{array}
if (*.f64 V l) < -2.00000000000000013e294Initial program 48.7%
clear-num48.7%
sqrt-div48.7%
metadata-eval48.7%
associate-/l*72.7%
Applied egg-rr72.7%
associate-/l*48.7%
*-lft-identity48.7%
times-frac72.7%
/-rgt-identity72.7%
Simplified72.7%
clear-num72.6%
div-inv72.6%
associate-/r/72.6%
sqrt-prod29.2%
Applied egg-rr29.2%
if -2.00000000000000013e294 < (*.f64 V l) < -2e-282Initial program 87.0%
frac-2neg87.0%
sqrt-div99.6%
*-commutative99.6%
distribute-rgt-neg-in99.6%
Applied egg-rr99.6%
if -2e-282 < (*.f64 V l) < 2.0000000000019e-312Initial program 56.1%
pow1/256.1%
clear-num56.1%
inv-pow56.1%
pow-pow56.1%
associate-/l*77.1%
metadata-eval77.1%
Applied egg-rr77.1%
div-inv77.1%
clear-num77.1%
metadata-eval77.1%
sqrt-pow277.2%
inv-pow77.2%
un-div-inv77.2%
Applied egg-rr77.2%
*-commutative77.2%
associate-*l/56.1%
associate-*r/77.2%
Simplified77.2%
if 2.0000000000019e-312 < (*.f64 V l) < 1.99999999999999996e296Initial program 80.3%
*-commutative80.3%
sqrt-div99.2%
associate-*l/97.2%
Applied egg-rr97.2%
if 1.99999999999999996e296 < (*.f64 V l) Initial program 47.0%
pow1/247.0%
clear-num47.0%
inv-pow47.0%
pow-pow47.0%
associate-/l*83.8%
metadata-eval83.8%
Applied egg-rr83.8%
div-inv83.7%
clear-num83.8%
metadata-eval83.8%
sqrt-pow283.7%
inv-pow83.7%
un-div-inv83.8%
Applied egg-rr83.8%
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 (<= l 6e-252) (/ c0 (sqrt (* V (/ l A)))) (* c0 (/ (sqrt (/ A V)) (sqrt l)))))
assert(V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (l <= 6e-252) {
tmp = c0 / sqrt((V * (l / A)));
} 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) :: tmp
if (l <= 6d-252) then
tmp = c0 / sqrt((v * (l / a)))
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 tmp;
if (l <= 6e-252) {
tmp = c0 / Math.sqrt((V * (l / A)));
} else {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): tmp = 0 if l <= 6e-252: tmp = c0 / math.sqrt((V * (l / A))) else: tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) tmp = 0.0 if (l <= 6e-252) tmp = Float64(c0 / sqrt(Float64(V * Float64(l / A)))); 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)
tmp = 0.0;
if (l <= 6e-252)
tmp = c0 / sqrt((V * (l / A)));
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_] := If[LessEqual[l, 6e-252], N[(c0 / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $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}
\mathbf{if}\;\ell \leq 6 \cdot 10^{-252}:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if l < 5.9999999999999999e-252Initial program 77.8%
pow1/277.8%
clear-num77.0%
inv-pow77.0%
pow-pow77.6%
associate-/l*78.8%
metadata-eval78.8%
Applied egg-rr78.8%
div-inv77.8%
clear-num78.3%
metadata-eval78.3%
sqrt-pow278.3%
inv-pow78.3%
un-div-inv78.3%
Applied egg-rr78.3%
if 5.9999999999999999e-252 < l Initial program 69.7%
associate-/r*75.1%
sqrt-div82.9%
Applied egg-rr82.9%
Final simplification80.2%
NOTE: V and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (if (<= l 4.4e-252) (/ c0 (sqrt (* V (/ l A)))) (/ c0 (* (sqrt (/ V A)) (sqrt l)))))
assert(V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (l <= 4.4e-252) {
tmp = c0 / sqrt((V * (l / 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 <= 4.4d-252) then
tmp = c0 / sqrt((v * (l / 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 <= 4.4e-252) {
tmp = c0 / Math.sqrt((V * (l / 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 <= 4.4e-252: tmp = c0 / math.sqrt((V * (l / 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 <= 4.4e-252) tmp = Float64(c0 / sqrt(Float64(V * Float64(l / 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 <= 4.4e-252)
tmp = c0 / sqrt((V * (l / 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, 4.4e-252], N[(c0 / N[Sqrt[N[(V * N[(l / A), $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 4.4 \cdot 10^{-252}:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V}{A}} \cdot \sqrt{\ell}}\\
\end{array}
\end{array}
if l < 4.3999999999999998e-252Initial program 77.8%
pow1/277.8%
clear-num77.0%
inv-pow77.0%
pow-pow77.6%
associate-/l*78.8%
metadata-eval78.8%
Applied egg-rr78.8%
div-inv77.8%
clear-num78.3%
metadata-eval78.3%
sqrt-pow278.3%
inv-pow78.3%
un-div-inv78.3%
Applied egg-rr78.3%
if 4.3999999999999998e-252 < l Initial program 69.7%
pow1/269.7%
clear-num69.7%
inv-pow69.7%
pow-pow70.5%
associate-/l*69.0%
metadata-eval69.0%
Applied egg-rr69.0%
div-inv69.0%
clear-num69.9%
metadata-eval69.9%
sqrt-pow269.8%
inv-pow69.8%
un-div-inv69.9%
Applied egg-rr69.9%
clear-num69.0%
div-inv69.0%
associate-/r/74.7%
sqrt-prod82.5%
Applied egg-rr82.5%
Final simplification80.1%
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 4e+206)
(* c0 (sqrt t_0))
(/ 1.0 (/ (sqrt (* V (/ l A))) c0))))))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 <= 4e+206) {
tmp = c0 * sqrt(t_0);
} else {
tmp = 1.0 / (sqrt((V * (l / A))) / c0);
}
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 <= 4d+206) then
tmp = c0 * sqrt(t_0)
else
tmp = 1.0d0 / (sqrt((v * (l / a))) / c0)
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 <= 4e+206) {
tmp = c0 * Math.sqrt(t_0);
} else {
tmp = 1.0 / (Math.sqrt((V * (l / A))) / c0);
}
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 <= 4e+206: tmp = c0 * math.sqrt(t_0) else: tmp = 1.0 / (math.sqrt((V * (l / A))) / c0) 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 <= 4e+206) tmp = Float64(c0 * sqrt(t_0)); else tmp = Float64(1.0 / Float64(sqrt(Float64(V * Float64(l / A))) / c0)); 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 <= 4e+206)
tmp = c0 * sqrt(t_0);
else
tmp = 1.0 / (sqrt((V * (l / A))) / c0);
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, 4e+206], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / c0), $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 4 \cdot 10^{+206}:\\
\;\;\;\;c0 \cdot \sqrt{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{\sqrt{V \cdot \frac{\ell}{A}}}{c0}}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0Initial program 45.6%
add-sqr-sqrt45.6%
sqrt-unprod45.6%
pow1/245.6%
*-commutative45.6%
*-commutative45.6%
swap-sqr45.0%
add-sqr-sqrt45.0%
Applied egg-rr45.0%
unpow1/245.0%
Simplified45.0%
sqrt-prod45.0%
sqrt-prod20.8%
add-sqr-sqrt45.6%
associate-/r*66.9%
Applied egg-rr66.9%
if 0.0 < (/.f64 A (*.f64 V l)) < 4.0000000000000002e206Initial program 98.2%
if 4.0000000000000002e206 < (/.f64 A (*.f64 V l)) Initial program 53.5%
pow1/253.5%
clear-num53.5%
inv-pow53.5%
pow-pow55.8%
associate-/l*63.3%
metadata-eval63.3%
Applied egg-rr63.3%
div-inv63.3%
clear-num63.3%
metadata-eval63.3%
sqrt-pow263.4%
inv-pow63.4%
un-div-inv63.4%
clear-num63.4%
Applied egg-rr63.4%
Final simplification81.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+296)))
(* 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+296)) {
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+296))) 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+296)) {
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+296): 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+296)) 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+296)))
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+296]], $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^{+296}\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 9.99999999999999981e295 < (/.f64 A (*.f64 V l)) Initial program 44.1%
add-sqr-sqrt32.8%
sqrt-unprod32.9%
pow1/232.9%
*-commutative32.9%
*-commutative32.9%
swap-sqr32.4%
add-sqr-sqrt32.4%
Applied egg-rr32.4%
unpow1/232.4%
Simplified32.4%
sqrt-prod32.4%
sqrt-prod20.7%
add-sqr-sqrt44.1%
associate-/r*61.2%
Applied egg-rr61.2%
if 0.0 < (/.f64 A (*.f64 V l)) < 9.99999999999999981e295Initial program 98.2%
Final simplification81.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 0.0)
(* c0 (sqrt (/ (/ A V) l)))
(if (<= t_0 2e+179) (* 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 <= 0.0) {
tmp = c0 * sqrt(((A / V) / l));
} else if (t_0 <= 2e+179) {
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 <= 0.0d0) then
tmp = c0 * sqrt(((a / v) / l))
else if (t_0 <= 2d+179) 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 <= 0.0) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else if (t_0 <= 2e+179) {
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 <= 0.0: tmp = c0 * math.sqrt(((A / V) / l)) elif t_0 <= 2e+179: 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 <= 0.0) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); elseif (t_0 <= 2e+179) 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 <= 0.0)
tmp = c0 * sqrt(((A / V) / l));
elseif (t_0 <= 2e+179)
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, 0.0], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+179], 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 0:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{elif}\;t_0 \leq 2 \cdot 10^{+179}:\\
\;\;\;\;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)) < 0.0Initial program 45.6%
add-sqr-sqrt45.6%
sqrt-unprod45.6%
pow1/245.6%
*-commutative45.6%
*-commutative45.6%
swap-sqr45.0%
add-sqr-sqrt45.0%
Applied egg-rr45.0%
unpow1/245.0%
Simplified45.0%
sqrt-prod45.0%
sqrt-prod20.8%
add-sqr-sqrt45.6%
associate-/r*66.9%
Applied egg-rr66.9%
if 0.0 < (/.f64 A (*.f64 V l)) < 1.99999999999999996e179Initial program 98.1%
if 1.99999999999999996e179 < (/.f64 A (*.f64 V l)) Initial program 57.6%
pow1/257.6%
clear-num57.6%
inv-pow57.6%
pow-pow59.7%
associate-/l*66.5%
metadata-eval66.5%
Applied egg-rr66.5%
div-inv66.5%
clear-num66.6%
metadata-eval66.6%
sqrt-pow266.6%
inv-pow66.6%
un-div-inv66.6%
Applied egg-rr66.6%
Final simplification81.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 74.4%
Final simplification74.4%
herbie shell --seed 2023285
(FPCore (c0 A V l)
:name "Henrywood and Agarwal, Equation (3)"
:precision binary64
(* c0 (sqrt (/ A (* V l)))))