
(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 12 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}
(FPCore (c0 A V l) :precision binary64 (* c0 (pow (* (cbrt A) (/ (cbrt (/ 1.0 V)) (cbrt l))) 1.5)))
double code(double c0, double A, double V, double l) {
return c0 * pow((cbrt(A) * (cbrt((1.0 / V)) / cbrt(l))), 1.5);
}
public static double code(double c0, double A, double V, double l) {
return c0 * Math.pow((Math.cbrt(A) * (Math.cbrt((1.0 / V)) / Math.cbrt(l))), 1.5);
}
function code(c0, A, V, l) return Float64(c0 * (Float64(cbrt(A) * Float64(cbrt(Float64(1.0 / V)) / cbrt(l))) ^ 1.5)) end
code[c0_, A_, V_, l_] := N[(c0 * N[Power[N[(N[Power[A, 1/3], $MachinePrecision] * N[(N[Power[N[(1.0 / V), $MachinePrecision], 1/3], $MachinePrecision] / N[Power[l, 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.5], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
c0 \cdot {\left(\sqrt[3]{A} \cdot \frac{\sqrt[3]{\frac{1}{V}}}{\sqrt[3]{\ell}}\right)}^{1.5}
\end{array}
Initial program 75.5%
pow1/275.5%
add-cube-cbrt75.1%
pow375.1%
pow-pow75.1%
metadata-eval75.1%
Applied egg-rr75.1%
div-inv74.4%
cbrt-prod85.7%
Applied egg-rr85.7%
associate-/r*86.9%
cbrt-div96.5%
inv-pow96.5%
Applied egg-rr96.5%
unpow-196.5%
Simplified96.5%
Final simplification96.5%
(FPCore (c0 A V l)
:precision binary64
(if (<= (* V l) -1e+244)
(* c0 (/ (sqrt (/ A V)) (sqrt l)))
(if (<= (* V l) -1e-202)
(* c0 (pow (/ (* V l) A) -0.5))
(if (<= (* V l) 1e-182)
(/ c0 (sqrt (* V (/ l A))))
(if (<= (* V l) 5e+295)
(* (sqrt A) (/ c0 (sqrt (* V l))))
(* c0 (sqrt (* (/ A V) (/ 1.0 l)))))))))
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -1e+244) {
tmp = c0 * (sqrt((A / V)) / sqrt(l));
} else if ((V * l) <= -1e-202) {
tmp = c0 * pow(((V * l) / A), -0.5);
} else if ((V * l) <= 1e-182) {
tmp = c0 / sqrt((V * (l / A)));
} else if ((V * l) <= 5e+295) {
tmp = sqrt(A) * (c0 / sqrt((V * l)));
} else {
tmp = c0 * sqrt(((A / V) * (1.0 / l)));
}
return tmp;
}
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+244)) then
tmp = c0 * (sqrt((a / v)) / sqrt(l))
else if ((v * l) <= (-1d-202)) then
tmp = c0 * (((v * l) / a) ** (-0.5d0))
else if ((v * l) <= 1d-182) then
tmp = c0 / sqrt((v * (l / a)))
else if ((v * l) <= 5d+295) then
tmp = sqrt(a) * (c0 / sqrt((v * l)))
else
tmp = c0 * sqrt(((a / v) * (1.0d0 / l)))
end if
code = tmp
end function
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -1e+244) {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
} else if ((V * l) <= -1e-202) {
tmp = c0 * Math.pow(((V * l) / A), -0.5);
} else if ((V * l) <= 1e-182) {
tmp = c0 / Math.sqrt((V * (l / A)));
} else if ((V * l) <= 5e+295) {
tmp = Math.sqrt(A) * (c0 / Math.sqrt((V * l)));
} else {
tmp = c0 * Math.sqrt(((A / V) * (1.0 / l)));
}
return tmp;
}
def code(c0, A, V, l): tmp = 0 if (V * l) <= -1e+244: tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) elif (V * l) <= -1e-202: tmp = c0 * math.pow(((V * l) / A), -0.5) elif (V * l) <= 1e-182: tmp = c0 / math.sqrt((V * (l / A))) elif (V * l) <= 5e+295: tmp = math.sqrt(A) * (c0 / math.sqrt((V * l))) else: tmp = c0 * math.sqrt(((A / V) * (1.0 / l))) return tmp
function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= -1e+244) tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))); elseif (Float64(V * l) <= -1e-202) tmp = Float64(c0 * (Float64(Float64(V * l) / A) ^ -0.5)); elseif (Float64(V * l) <= 1e-182) tmp = Float64(c0 / sqrt(Float64(V * Float64(l / A)))); elseif (Float64(V * l) <= 5e+295) tmp = Float64(sqrt(A) * Float64(c0 / sqrt(Float64(V * l)))); else tmp = Float64(c0 * sqrt(Float64(Float64(A / V) * Float64(1.0 / l)))); end return tmp end
function tmp_2 = code(c0, A, V, l) tmp = 0.0; if ((V * l) <= -1e+244) tmp = c0 * (sqrt((A / V)) / sqrt(l)); elseif ((V * l) <= -1e-202) tmp = c0 * (((V * l) / A) ^ -0.5); elseif ((V * l) <= 1e-182) tmp = c0 / sqrt((V * (l / A))); elseif ((V * l) <= 5e+295) tmp = sqrt(A) * (c0 / sqrt((V * l))); else tmp = c0 * sqrt(((A / V) * (1.0 / l))); end tmp_2 = tmp; end
code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], -1e+244], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -1e-202], N[(c0 * N[Power[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e-182], N[(c0 / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e+295], 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] * N[(1.0 / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -1 \cdot 10^{+244}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-202}:\\
\;\;\;\;c0 \cdot {\left(\frac{V \cdot \ell}{A}\right)}^{-0.5}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{-182}:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{+295}:\\
\;\;\;\;\sqrt{A} \cdot \frac{c0}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A}{V} \cdot \frac{1}{\ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -1.00000000000000007e244Initial program 38.8%
associate-/r*56.4%
sqrt-div54.7%
Applied egg-rr54.7%
if -1.00000000000000007e244 < (*.f64 V l) < -1e-202Initial program 86.2%
pow1/286.2%
clear-num86.1%
inv-pow86.1%
pow-pow86.9%
associate-/l*75.3%
metadata-eval75.3%
Applied egg-rr75.3%
associate-/l*86.9%
Simplified86.9%
if -1e-202 < (*.f64 V l) < 1e-182Initial program 60.9%
sqrt-div38.3%
associate-*r/38.4%
Applied egg-rr38.4%
associate-*l/34.2%
Simplified34.2%
expm1-log1p-u11.8%
expm1-udef3.2%
associate-*l/3.2%
associate-/l*3.2%
sqrt-div6.3%
associate-*r/8.8%
Applied egg-rr8.8%
expm1-def35.6%
expm1-log1p77.9%
Simplified77.9%
if 1e-182 < (*.f64 V l) < 4.99999999999999991e295Initial program 85.3%
sqrt-div99.4%
associate-*r/97.6%
Applied egg-rr97.6%
associate-*l/98.5%
Simplified98.5%
if 4.99999999999999991e295 < (*.f64 V l) Initial program 57.8%
associate-/r*88.0%
div-inv88.0%
Applied egg-rr88.0%
Final simplification87.3%
(FPCore (c0 A V l)
:precision binary64
(if (<= (* V l) -1e+244)
(* c0 (/ (sqrt (/ A V)) (sqrt l)))
(if (<= (* V l) -1e-202)
(* c0 (pow (/ (* V l) A) -0.5))
(if (<= (* V l) 1e-182)
(/ c0 (sqrt (* V (/ l A))))
(if (<= (* V l) 5e+295)
(/ c0 (/ (sqrt (* V l)) (sqrt A)))
(* c0 (sqrt (* (/ A V) (/ 1.0 l)))))))))
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -1e+244) {
tmp = c0 * (sqrt((A / V)) / sqrt(l));
} else if ((V * l) <= -1e-202) {
tmp = c0 * pow(((V * l) / A), -0.5);
} else if ((V * l) <= 1e-182) {
tmp = c0 / sqrt((V * (l / A)));
} else if ((V * l) <= 5e+295) {
tmp = c0 / (sqrt((V * l)) / sqrt(A));
} else {
tmp = c0 * sqrt(((A / V) * (1.0 / l)));
}
return tmp;
}
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+244)) then
tmp = c0 * (sqrt((a / v)) / sqrt(l))
else if ((v * l) <= (-1d-202)) then
tmp = c0 * (((v * l) / a) ** (-0.5d0))
else if ((v * l) <= 1d-182) then
tmp = c0 / sqrt((v * (l / a)))
else if ((v * l) <= 5d+295) then
tmp = c0 / (sqrt((v * l)) / sqrt(a))
else
tmp = c0 * sqrt(((a / v) * (1.0d0 / l)))
end if
code = tmp
end function
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -1e+244) {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
} else if ((V * l) <= -1e-202) {
tmp = c0 * Math.pow(((V * l) / A), -0.5);
} else if ((V * l) <= 1e-182) {
tmp = c0 / Math.sqrt((V * (l / A)));
} else if ((V * l) <= 5e+295) {
tmp = c0 / (Math.sqrt((V * l)) / Math.sqrt(A));
} else {
tmp = c0 * Math.sqrt(((A / V) * (1.0 / l)));
}
return tmp;
}
def code(c0, A, V, l): tmp = 0 if (V * l) <= -1e+244: tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) elif (V * l) <= -1e-202: tmp = c0 * math.pow(((V * l) / A), -0.5) elif (V * l) <= 1e-182: tmp = c0 / math.sqrt((V * (l / A))) elif (V * l) <= 5e+295: tmp = c0 / (math.sqrt((V * l)) / math.sqrt(A)) else: tmp = c0 * math.sqrt(((A / V) * (1.0 / l))) return tmp
function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= -1e+244) tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))); elseif (Float64(V * l) <= -1e-202) tmp = Float64(c0 * (Float64(Float64(V * l) / A) ^ -0.5)); elseif (Float64(V * l) <= 1e-182) tmp = Float64(c0 / sqrt(Float64(V * Float64(l / A)))); elseif (Float64(V * l) <= 5e+295) tmp = Float64(c0 / Float64(sqrt(Float64(V * l)) / sqrt(A))); else tmp = Float64(c0 * sqrt(Float64(Float64(A / V) * Float64(1.0 / l)))); end return tmp end
function tmp_2 = code(c0, A, V, l) tmp = 0.0; if ((V * l) <= -1e+244) tmp = c0 * (sqrt((A / V)) / sqrt(l)); elseif ((V * l) <= -1e-202) tmp = c0 * (((V * l) / A) ^ -0.5); elseif ((V * l) <= 1e-182) tmp = c0 / sqrt((V * (l / A))); elseif ((V * l) <= 5e+295) tmp = c0 / (sqrt((V * l)) / sqrt(A)); else tmp = c0 * sqrt(((A / V) * (1.0 / l))); end tmp_2 = tmp; end
code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], -1e+244], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -1e-202], N[(c0 * N[Power[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e-182], N[(c0 / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e+295], 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] * N[(1.0 / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -1 \cdot 10^{+244}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-202}:\\
\;\;\;\;c0 \cdot {\left(\frac{V \cdot \ell}{A}\right)}^{-0.5}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{-182}:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{+295}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{V \cdot \ell}}{\sqrt{A}}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A}{V} \cdot \frac{1}{\ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -1.00000000000000007e244Initial program 38.8%
associate-/r*56.4%
sqrt-div54.7%
Applied egg-rr54.7%
if -1.00000000000000007e244 < (*.f64 V l) < -1e-202Initial program 86.2%
pow1/286.2%
clear-num86.1%
inv-pow86.1%
pow-pow86.9%
associate-/l*75.3%
metadata-eval75.3%
Applied egg-rr75.3%
associate-/l*86.9%
Simplified86.9%
if -1e-202 < (*.f64 V l) < 1e-182Initial program 60.9%
sqrt-div38.3%
associate-*r/38.4%
Applied egg-rr38.4%
associate-*l/34.2%
Simplified34.2%
expm1-log1p-u11.8%
expm1-udef3.2%
associate-*l/3.2%
associate-/l*3.2%
sqrt-div6.3%
associate-*r/8.8%
Applied egg-rr8.8%
expm1-def35.6%
expm1-log1p77.9%
Simplified77.9%
if 1e-182 < (*.f64 V l) < 4.99999999999999991e295Initial program 85.3%
sqrt-div99.4%
associate-*r/97.6%
Applied egg-rr97.6%
associate-/l*99.4%
Simplified99.4%
if 4.99999999999999991e295 < (*.f64 V l) Initial program 57.8%
associate-/r*88.0%
div-inv88.0%
Applied egg-rr88.0%
Final simplification87.6%
(FPCore (c0 A V l)
:precision binary64
(if (<= (* V l) -5e+279)
(* c0 (/ (sqrt (/ A V)) (sqrt l)))
(if (<= (* V l) -1e-279)
(* c0 (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (<= (* V l) 1e-182)
(/ c0 (sqrt (* V (/ l A))))
(if (<= (* V l) 5e+295)
(/ c0 (/ (sqrt (* V l)) (sqrt A)))
(* c0 (sqrt (* (/ A V) (/ 1.0 l)))))))))
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -5e+279) {
tmp = c0 * (sqrt((A / V)) / sqrt(l));
} else if ((V * l) <= -1e-279) {
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
} else if ((V * l) <= 1e-182) {
tmp = c0 / sqrt((V * (l / A)));
} else if ((V * l) <= 5e+295) {
tmp = c0 / (sqrt((V * l)) / sqrt(A));
} else {
tmp = c0 * sqrt(((A / V) * (1.0 / l)));
}
return tmp;
}
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+279)) then
tmp = c0 * (sqrt((a / v)) / sqrt(l))
else if ((v * l) <= (-1d-279)) then
tmp = c0 * (sqrt(-a) / sqrt((v * -l)))
else if ((v * l) <= 1d-182) then
tmp = c0 / sqrt((v * (l / a)))
else if ((v * l) <= 5d+295) then
tmp = c0 / (sqrt((v * l)) / sqrt(a))
else
tmp = c0 * sqrt(((a / v) * (1.0d0 / l)))
end if
code = tmp
end function
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -5e+279) {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
} else if ((V * l) <= -1e-279) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if ((V * l) <= 1e-182) {
tmp = c0 / Math.sqrt((V * (l / A)));
} else if ((V * l) <= 5e+295) {
tmp = c0 / (Math.sqrt((V * l)) / Math.sqrt(A));
} else {
tmp = c0 * Math.sqrt(((A / V) * (1.0 / l)));
}
return tmp;
}
def code(c0, A, V, l): tmp = 0 if (V * l) <= -5e+279: tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) elif (V * l) <= -1e-279: tmp = c0 * (math.sqrt(-A) / math.sqrt((V * -l))) elif (V * l) <= 1e-182: tmp = c0 / math.sqrt((V * (l / A))) elif (V * l) <= 5e+295: tmp = c0 / (math.sqrt((V * l)) / math.sqrt(A)) else: tmp = c0 * math.sqrt(((A / V) * (1.0 / l))) return tmp
function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= -5e+279) tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))); elseif (Float64(V * l) <= -1e-279) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif (Float64(V * l) <= 1e-182) tmp = Float64(c0 / sqrt(Float64(V * Float64(l / A)))); elseif (Float64(V * l) <= 5e+295) tmp = Float64(c0 / Float64(sqrt(Float64(V * l)) / sqrt(A))); else tmp = Float64(c0 * sqrt(Float64(Float64(A / V) * Float64(1.0 / l)))); end return tmp end
function tmp_2 = code(c0, A, V, l) tmp = 0.0; if ((V * l) <= -5e+279) tmp = c0 * (sqrt((A / V)) / sqrt(l)); elseif ((V * l) <= -1e-279) tmp = c0 * (sqrt(-A) / sqrt((V * -l))); elseif ((V * l) <= 1e-182) tmp = c0 / sqrt((V * (l / A))); elseif ((V * l) <= 5e+295) tmp = c0 / (sqrt((V * l)) / sqrt(A)); else tmp = c0 * sqrt(((A / V) * (1.0 / l))); end tmp_2 = tmp; end
code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], -5e+279], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -1e-279], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e-182], N[(c0 / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e+295], 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] * N[(1.0 / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -5 \cdot 10^{+279}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-279}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{-182}:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{+295}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{V \cdot \ell}}{\sqrt{A}}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A}{V} \cdot \frac{1}{\ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -5.0000000000000002e279Initial program 39.3%
associate-/r*59.6%
sqrt-div56.2%
Applied egg-rr56.2%
if -5.0000000000000002e279 < (*.f64 V l) < -1.00000000000000006e-279Initial program 82.0%
frac-2neg82.0%
sqrt-div99.4%
*-commutative99.4%
distribute-rgt-neg-in99.4%
Applied egg-rr99.4%
if -1.00000000000000006e-279 < (*.f64 V l) < 1e-182Initial program 61.1%
sqrt-div45.3%
associate-*r/45.4%
Applied egg-rr45.4%
associate-*l/40.6%
Simplified40.6%
expm1-log1p-u13.9%
expm1-udef3.8%
associate-*l/3.8%
associate-/l*3.8%
sqrt-div6.8%
associate-*r/9.8%
Applied egg-rr9.8%
expm1-def31.5%
expm1-log1p79.1%
Simplified79.1%
if 1e-182 < (*.f64 V l) < 4.99999999999999991e295Initial program 85.3%
sqrt-div99.4%
associate-*r/97.6%
Applied egg-rr97.6%
associate-/l*99.4%
Simplified99.4%
if 4.99999999999999991e295 < (*.f64 V l) Initial program 57.8%
associate-/r*88.0%
div-inv88.0%
Applied egg-rr88.0%
Final simplification92.5%
(FPCore (c0 A V l) :precision binary64 (if (<= l 8e-308) (* c0 (pow (* V (/ l A)) -0.5)) (* c0 (/ (sqrt (/ A V)) (sqrt l)))))
double code(double c0, double A, double V, double l) {
double tmp;
if (l <= 8e-308) {
tmp = c0 * pow((V * (l / A)), -0.5);
} else {
tmp = c0 * (sqrt((A / V)) / sqrt(l));
}
return tmp;
}
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 <= 8d-308) then
tmp = c0 * ((v * (l / a)) ** (-0.5d0))
else
tmp = c0 * (sqrt((a / v)) / sqrt(l))
end if
code = tmp
end function
public static double code(double c0, double A, double V, double l) {
double tmp;
if (l <= 8e-308) {
tmp = c0 * Math.pow((V * (l / A)), -0.5);
} else {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
}
return tmp;
}
def code(c0, A, V, l): tmp = 0 if l <= 8e-308: tmp = c0 * math.pow((V * (l / A)), -0.5) else: tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) return tmp
function code(c0, A, V, l) tmp = 0.0 if (l <= 8e-308) tmp = Float64(c0 * (Float64(V * Float64(l / A)) ^ -0.5)); else tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))); end return tmp end
function tmp_2 = code(c0, A, V, l) tmp = 0.0; if (l <= 8e-308) tmp = c0 * ((V * (l / A)) ^ -0.5); else tmp = c0 * (sqrt((A / V)) / sqrt(l)); end tmp_2 = tmp; end
code[c0_, A_, V_, l_] := If[LessEqual[l, 8e-308], N[(c0 * N[Power[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 8 \cdot 10^{-308}:\\
\;\;\;\;c0 \cdot {\left(V \cdot \frac{\ell}{A}\right)}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if l < 8.00000000000000026e-308Initial program 75.9%
pow1/275.9%
clear-num75.9%
inv-pow75.9%
pow-pow76.0%
associate-/l*74.1%
metadata-eval74.1%
Applied egg-rr74.1%
associate-/l*76.0%
*-lft-identity76.0%
times-frac74.1%
/-rgt-identity74.1%
Simplified74.1%
if 8.00000000000000026e-308 < l Initial program 75.2%
associate-/r*73.4%
sqrt-div81.2%
Applied egg-rr81.2%
Final simplification78.1%
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (/ A (* V l))))
(if (<= t_0 0.0)
(* c0 (pow (* V (/ l A)) -0.5))
(if (<= t_0 1e+276) (* c0 (sqrt t_0)) (* c0 (pow (* l (/ V A)) -0.5))))))
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 * pow((V * (l / A)), -0.5);
} else if (t_0 <= 1e+276) {
tmp = c0 * sqrt(t_0);
} else {
tmp = c0 * pow((l * (V / A)), -0.5);
}
return tmp;
}
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 * ((v * (l / a)) ** (-0.5d0))
else if (t_0 <= 1d+276) then
tmp = c0 * sqrt(t_0)
else
tmp = c0 * ((l * (v / a)) ** (-0.5d0))
end if
code = tmp
end function
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.pow((V * (l / A)), -0.5);
} else if (t_0 <= 1e+276) {
tmp = c0 * Math.sqrt(t_0);
} else {
tmp = c0 * Math.pow((l * (V / A)), -0.5);
}
return tmp;
}
def code(c0, A, V, l): t_0 = A / (V * l) tmp = 0 if t_0 <= 0.0: tmp = c0 * math.pow((V * (l / A)), -0.5) elif t_0 <= 1e+276: tmp = c0 * math.sqrt(t_0) else: tmp = c0 * math.pow((l * (V / A)), -0.5) return tmp
function code(c0, A, V, l) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if (t_0 <= 0.0) tmp = Float64(c0 * (Float64(V * Float64(l / A)) ^ -0.5)); elseif (t_0 <= 1e+276) tmp = Float64(c0 * sqrt(t_0)); else tmp = Float64(c0 * (Float64(l * Float64(V / A)) ^ -0.5)); end return tmp end
function tmp_2 = code(c0, A, V, l) t_0 = A / (V * l); tmp = 0.0; if (t_0 <= 0.0) tmp = c0 * ((V * (l / A)) ^ -0.5); elseif (t_0 <= 1e+276) tmp = c0 * sqrt(t_0); else tmp = c0 * ((l * (V / A)) ^ -0.5); end tmp_2 = tmp; end
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[Power[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e+276], 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}
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t_0 \leq 0:\\
\;\;\;\;c0 \cdot {\left(V \cdot \frac{\ell}{A}\right)}^{-0.5}\\
\mathbf{elif}\;t_0 \leq 10^{+276}:\\
\;\;\;\;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 38.3%
pow1/238.3%
clear-num38.3%
inv-pow38.3%
pow-pow38.3%
associate-/l*53.0%
metadata-eval53.0%
Applied egg-rr53.0%
associate-/l*38.3%
*-lft-identity38.3%
times-frac53.0%
/-rgt-identity53.0%
Simplified53.0%
if 0.0 < (/.f64 A (*.f64 V l)) < 1.0000000000000001e276Initial program 98.4%
if 1.0000000000000001e276 < (/.f64 A (*.f64 V l)) Initial program 35.7%
pow1/235.7%
clear-num35.7%
inv-pow35.7%
pow-pow39.8%
associate-/l*53.0%
metadata-eval53.0%
Applied egg-rr53.0%
associate-/l*39.8%
Simplified39.8%
associate-/l*53.0%
associate-/r/51.6%
Applied egg-rr51.6%
Final simplification81.2%
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (/ A (* V l))))
(if (<= t_0 0.0)
(sqrt (* A (* (/ c0 l) (/ c0 V))))
(if (<= t_0 1e+276) (* c0 (sqrt t_0)) (* c0 (pow (* l (/ V A)) -0.5))))))
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((A * ((c0 / l) * (c0 / V))));
} else if (t_0 <= 1e+276) {
tmp = c0 * sqrt(t_0);
} else {
tmp = c0 * pow((l * (V / A)), -0.5);
}
return tmp;
}
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((a * ((c0 / l) * (c0 / v))))
else if (t_0 <= 1d+276) then
tmp = c0 * sqrt(t_0)
else
tmp = c0 * ((l * (v / a)) ** (-0.5d0))
end if
code = tmp
end function
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((A * ((c0 / l) * (c0 / V))));
} else if (t_0 <= 1e+276) {
tmp = c0 * Math.sqrt(t_0);
} else {
tmp = c0 * Math.pow((l * (V / A)), -0.5);
}
return tmp;
}
def code(c0, A, V, l): t_0 = A / (V * l) tmp = 0 if t_0 <= 0.0: tmp = math.sqrt((A * ((c0 / l) * (c0 / V)))) elif t_0 <= 1e+276: tmp = c0 * math.sqrt(t_0) else: tmp = c0 * math.pow((l * (V / A)), -0.5) return tmp
function code(c0, A, V, l) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if (t_0 <= 0.0) tmp = sqrt(Float64(A * Float64(Float64(c0 / l) * Float64(c0 / V)))); elseif (t_0 <= 1e+276) tmp = Float64(c0 * sqrt(t_0)); else tmp = Float64(c0 * (Float64(l * Float64(V / A)) ^ -0.5)); end return tmp end
function tmp_2 = code(c0, A, V, l) t_0 = A / (V * l); tmp = 0.0; if (t_0 <= 0.0) tmp = sqrt((A * ((c0 / l) * (c0 / V)))); elseif (t_0 <= 1e+276) tmp = c0 * sqrt(t_0); else tmp = c0 * ((l * (V / A)) ^ -0.5); end tmp_2 = tmp; end
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[(A * N[(N[(c0 / l), $MachinePrecision] * N[(c0 / V), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$0, 1e+276], 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}
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t_0 \leq 0:\\
\;\;\;\;\sqrt{A \cdot \left(\frac{c0}{\ell} \cdot \frac{c0}{V}\right)}\\
\mathbf{elif}\;t_0 \leq 10^{+276}:\\
\;\;\;\;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 38.3%
pow1/238.3%
clear-num38.3%
inv-pow38.3%
pow-pow38.3%
associate-/l*53.0%
metadata-eval53.0%
Applied egg-rr53.0%
associate-/l*38.3%
Simplified38.3%
add-sqr-sqrt38.3%
sqrt-unprod38.3%
*-commutative38.3%
*-commutative38.3%
swap-sqr37.3%
pow-prod-up37.3%
metadata-eval37.3%
inv-pow37.3%
clear-num37.3%
Applied egg-rr37.3%
associate-*l/41.0%
associate-*r/41.1%
Simplified41.1%
*-commutative41.1%
times-frac54.9%
Applied egg-rr54.9%
if 0.0 < (/.f64 A (*.f64 V l)) < 1.0000000000000001e276Initial program 98.4%
if 1.0000000000000001e276 < (/.f64 A (*.f64 V l)) Initial program 35.7%
pow1/235.7%
clear-num35.7%
inv-pow35.7%
pow-pow39.8%
associate-/l*53.0%
metadata-eval53.0%
Applied egg-rr53.0%
associate-/l*39.8%
Simplified39.8%
associate-/l*53.0%
associate-/r/51.6%
Applied egg-rr51.6%
Final simplification81.6%
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (/ A (* V l))))
(if (<= t_0 0.0)
(sqrt (/ (* c0 A) (* V (/ l c0))))
(if (<= t_0 1e+276) (* c0 (sqrt t_0)) (* c0 (pow (* l (/ V A)) -0.5))))))
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 * A) / (V * (l / c0))));
} else if (t_0 <= 1e+276) {
tmp = c0 * sqrt(t_0);
} else {
tmp = c0 * pow((l * (V / A)), -0.5);
}
return tmp;
}
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 * a) / (v * (l / c0))))
else if (t_0 <= 1d+276) then
tmp = c0 * sqrt(t_0)
else
tmp = c0 * ((l * (v / a)) ** (-0.5d0))
end if
code = tmp
end function
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 * A) / (V * (l / c0))));
} else if (t_0 <= 1e+276) {
tmp = c0 * Math.sqrt(t_0);
} else {
tmp = c0 * Math.pow((l * (V / A)), -0.5);
}
return tmp;
}
def code(c0, A, V, l): t_0 = A / (V * l) tmp = 0 if t_0 <= 0.0: tmp = math.sqrt(((c0 * A) / (V * (l / c0)))) elif t_0 <= 1e+276: tmp = c0 * math.sqrt(t_0) else: tmp = c0 * math.pow((l * (V / A)), -0.5) return tmp
function code(c0, A, V, l) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if (t_0 <= 0.0) tmp = sqrt(Float64(Float64(c0 * A) / Float64(V * Float64(l / c0)))); elseif (t_0 <= 1e+276) tmp = Float64(c0 * sqrt(t_0)); else tmp = Float64(c0 * (Float64(l * Float64(V / A)) ^ -0.5)); end return tmp end
function tmp_2 = code(c0, A, V, l) t_0 = A / (V * l); tmp = 0.0; if (t_0 <= 0.0) tmp = sqrt(((c0 * A) / (V * (l / c0)))); elseif (t_0 <= 1e+276) tmp = c0 * sqrt(t_0); else tmp = c0 * ((l * (V / A)) ^ -0.5); end tmp_2 = tmp; end
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[(N[(c0 * A), $MachinePrecision] / N[(V * N[(l / c0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$0, 1e+276], 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}
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t_0 \leq 0:\\
\;\;\;\;\sqrt{\frac{c0 \cdot A}{V \cdot \frac{\ell}{c0}}}\\
\mathbf{elif}\;t_0 \leq 10^{+276}:\\
\;\;\;\;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 38.3%
pow1/238.3%
clear-num38.3%
inv-pow38.3%
pow-pow38.3%
associate-/l*53.0%
metadata-eval53.0%
Applied egg-rr53.0%
associate-/l*38.3%
Simplified38.3%
add-sqr-sqrt38.3%
sqrt-unprod38.3%
*-commutative38.3%
*-commutative38.3%
swap-sqr37.3%
pow-prod-up37.3%
metadata-eval37.3%
inv-pow37.3%
clear-num37.3%
Applied egg-rr37.3%
associate-*l/41.0%
associate-*r/41.1%
Simplified41.1%
Taylor expanded in A around 0 41.0%
unpow241.0%
times-frac39.5%
associate-/l*47.8%
Simplified47.8%
frac-times57.9%
Applied egg-rr57.9%
if 0.0 < (/.f64 A (*.f64 V l)) < 1.0000000000000001e276Initial program 98.4%
if 1.0000000000000001e276 < (/.f64 A (*.f64 V l)) Initial program 35.7%
pow1/235.7%
clear-num35.7%
inv-pow35.7%
pow-pow39.8%
associate-/l*53.0%
metadata-eval53.0%
Applied egg-rr53.0%
associate-/l*39.8%
Simplified39.8%
associate-/l*53.0%
associate-/r/51.6%
Applied egg-rr51.6%
Final simplification82.3%
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (/ A (* V l))))
(if (or (<= t_0 2e-320) (not (<= t_0 1e+276)))
(* c0 (sqrt (/ (/ A V) l)))
(* c0 (sqrt t_0)))))
double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if ((t_0 <= 2e-320) || !(t_0 <= 1e+276)) {
tmp = c0 * sqrt(((A / V) / l));
} else {
tmp = c0 * sqrt(t_0);
}
return tmp;
}
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-320) .or. (.not. (t_0 <= 1d+276))) then
tmp = c0 * sqrt(((a / v) / l))
else
tmp = c0 * sqrt(t_0)
end if
code = tmp
end function
public static double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if ((t_0 <= 2e-320) || !(t_0 <= 1e+276)) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else {
tmp = c0 * Math.sqrt(t_0);
}
return tmp;
}
def code(c0, A, V, l): t_0 = A / (V * l) tmp = 0 if (t_0 <= 2e-320) or not (t_0 <= 1e+276): tmp = c0 * math.sqrt(((A / V) / l)) else: tmp = c0 * math.sqrt(t_0) return tmp
function code(c0, A, V, l) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if ((t_0 <= 2e-320) || !(t_0 <= 1e+276)) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); else tmp = Float64(c0 * sqrt(t_0)); end return tmp end
function tmp_2 = code(c0, A, V, l) t_0 = A / (V * l); tmp = 0.0; if ((t_0 <= 2e-320) || ~((t_0 <= 1e+276))) tmp = c0 * sqrt(((A / V) / l)); else tmp = c0 * sqrt(t_0); end tmp_2 = tmp; end
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$0, 2e-320], N[Not[LessEqual[t$95$0, 1e+276]], $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}
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t_0 \leq 2 \cdot 10^{-320} \lor \neg \left(t_0 \leq 10^{+276}\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)) < 1.99998e-320 or 1.0000000000000001e276 < (/.f64 A (*.f64 V l)) Initial program 37.7%
associate-/r*50.3%
div-inv50.3%
Applied egg-rr50.3%
un-div-inv50.3%
Applied egg-rr50.3%
if 1.99998e-320 < (/.f64 A (*.f64 V l)) < 1.0000000000000001e276Initial program 98.6%
Final simplification80.3%
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (/ A (* V l))))
(if (<= t_0 2e-320)
(* c0 (sqrt (/ (/ A V) l)))
(if (<= t_0 2e+283) (* c0 (sqrt t_0)) (/ c0 (sqrt (* V (/ l A))))))))
double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 2e-320) {
tmp = c0 * sqrt(((A / V) / l));
} else if (t_0 <= 2e+283) {
tmp = c0 * sqrt(t_0);
} else {
tmp = c0 / sqrt((V * (l / A)));
}
return tmp;
}
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-320) then
tmp = c0 * sqrt(((a / v) / l))
else if (t_0 <= 2d+283) then
tmp = c0 * sqrt(t_0)
else
tmp = c0 / sqrt((v * (l / a)))
end if
code = tmp
end function
public static double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 2e-320) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else if (t_0 <= 2e+283) {
tmp = c0 * Math.sqrt(t_0);
} else {
tmp = c0 / Math.sqrt((V * (l / A)));
}
return tmp;
}
def code(c0, A, V, l): t_0 = A / (V * l) tmp = 0 if t_0 <= 2e-320: tmp = c0 * math.sqrt(((A / V) / l)) elif t_0 <= 2e+283: tmp = c0 * math.sqrt(t_0) else: tmp = c0 / math.sqrt((V * (l / A))) return tmp
function code(c0, A, V, l) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if (t_0 <= 2e-320) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); elseif (t_0 <= 2e+283) tmp = Float64(c0 * sqrt(t_0)); else tmp = Float64(c0 / sqrt(Float64(V * Float64(l / A)))); end return tmp end
function tmp_2 = code(c0, A, V, l) t_0 = A / (V * l); tmp = 0.0; if (t_0 <= 2e-320) tmp = c0 * sqrt(((A / V) / l)); elseif (t_0 <= 2e+283) tmp = c0 * sqrt(t_0); else tmp = c0 / sqrt((V * (l / A))); end tmp_2 = tmp; end
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 2e-320], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+283], 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}
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t_0 \leq 2 \cdot 10^{-320}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{elif}\;t_0 \leq 2 \cdot 10^{+283}:\\
\;\;\;\;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)) < 1.99998e-320Initial program 38.8%
associate-/r*52.9%
div-inv53.0%
Applied egg-rr53.0%
un-div-inv52.9%
Applied egg-rr52.9%
if 1.99998e-320 < (/.f64 A (*.f64 V l)) < 1.99999999999999991e283Initial program 98.6%
if 1.99999999999999991e283 < (/.f64 A (*.f64 V l)) Initial program 32.1%
sqrt-div32.5%
associate-*r/32.5%
Applied egg-rr32.5%
associate-*l/32.4%
Simplified32.4%
expm1-log1p-u8.5%
expm1-udef5.8%
associate-*l/5.8%
associate-/l*5.8%
sqrt-div8.4%
associate-*r/10.0%
Applied egg-rr10.0%
expm1-def15.0%
expm1-log1p50.5%
Simplified50.5%
Final simplification81.3%
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (/ A (* V l))) (t_1 (* V (/ l A))))
(if (<= t_0 0.0)
(* c0 (pow t_1 -0.5))
(if (<= t_0 2e+283) (* c0 (sqrt t_0)) (/ c0 (sqrt t_1))))))
double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double t_1 = V * (l / A);
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * pow(t_1, -0.5);
} else if (t_0 <= 2e+283) {
tmp = c0 * sqrt(t_0);
} else {
tmp = c0 / sqrt(t_1);
}
return tmp;
}
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) :: t_1
real(8) :: tmp
t_0 = a / (v * l)
t_1 = v * (l / a)
if (t_0 <= 0.0d0) then
tmp = c0 * (t_1 ** (-0.5d0))
else if (t_0 <= 2d+283) then
tmp = c0 * sqrt(t_0)
else
tmp = c0 / sqrt(t_1)
end if
code = tmp
end function
public static double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double t_1 = V * (l / A);
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * Math.pow(t_1, -0.5);
} else if (t_0 <= 2e+283) {
tmp = c0 * Math.sqrt(t_0);
} else {
tmp = c0 / Math.sqrt(t_1);
}
return tmp;
}
def code(c0, A, V, l): t_0 = A / (V * l) t_1 = V * (l / A) tmp = 0 if t_0 <= 0.0: tmp = c0 * math.pow(t_1, -0.5) elif t_0 <= 2e+283: tmp = c0 * math.sqrt(t_0) else: tmp = c0 / math.sqrt(t_1) return tmp
function code(c0, A, V, l) t_0 = Float64(A / Float64(V * l)) t_1 = Float64(V * Float64(l / A)) tmp = 0.0 if (t_0 <= 0.0) tmp = Float64(c0 * (t_1 ^ -0.5)); elseif (t_0 <= 2e+283) tmp = Float64(c0 * sqrt(t_0)); else tmp = Float64(c0 / sqrt(t_1)); end return tmp end
function tmp_2 = code(c0, A, V, l) t_0 = A / (V * l); t_1 = V * (l / A); tmp = 0.0; if (t_0 <= 0.0) tmp = c0 * (t_1 ^ -0.5); elseif (t_0 <= 2e+283) tmp = c0 * sqrt(t_0); else tmp = c0 / sqrt(t_1); end tmp_2 = tmp; end
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[(c0 * N[Power[t$95$1, -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+283], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(c0 / N[Sqrt[t$95$1], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
t_1 := V \cdot \frac{\ell}{A}\\
\mathbf{if}\;t_0 \leq 0:\\
\;\;\;\;c0 \cdot {t_1}^{-0.5}\\
\mathbf{elif}\;t_0 \leq 2 \cdot 10^{+283}:\\
\;\;\;\;c0 \cdot \sqrt{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{t_1}}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0Initial program 38.3%
pow1/238.3%
clear-num38.3%
inv-pow38.3%
pow-pow38.3%
associate-/l*53.0%
metadata-eval53.0%
Applied egg-rr53.0%
associate-/l*38.3%
*-lft-identity38.3%
times-frac53.0%
/-rgt-identity53.0%
Simplified53.0%
if 0.0 < (/.f64 A (*.f64 V l)) < 1.99999999999999991e283Initial program 98.4%
if 1.99999999999999991e283 < (/.f64 A (*.f64 V l)) Initial program 32.1%
sqrt-div32.5%
associate-*r/32.5%
Applied egg-rr32.5%
associate-*l/32.4%
Simplified32.4%
expm1-log1p-u8.5%
expm1-udef5.8%
associate-*l/5.8%
associate-/l*5.8%
sqrt-div8.4%
associate-*r/10.0%
Applied egg-rr10.0%
expm1-def15.0%
expm1-log1p50.5%
Simplified50.5%
Final simplification81.4%
(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}
Initial program 75.5%
Final simplification75.5%
herbie shell --seed 2023192
(FPCore (c0 A V l)
:name "Henrywood and Agarwal, Equation (3)"
:precision binary64
(* c0 (sqrt (/ A (* V l)))))