
(FPCore (F l) :precision binary64 (- (* PI l) (* (/ 1.0 (* F F)) (tan (* PI l)))))
double code(double F, double l) {
return (((double) M_PI) * l) - ((1.0 / (F * F)) * tan((((double) M_PI) * l)));
}
public static double code(double F, double l) {
return (Math.PI * l) - ((1.0 / (F * F)) * Math.tan((Math.PI * l)));
}
def code(F, l): return (math.pi * l) - ((1.0 / (F * F)) * math.tan((math.pi * l)))
function code(F, l) return Float64(Float64(pi * l) - Float64(Float64(1.0 / Float64(F * F)) * tan(Float64(pi * l)))) end
function tmp = code(F, l) tmp = (pi * l) - ((1.0 / (F * F)) * tan((pi * l))); end
code[F_, l_] := N[(N[(Pi * l), $MachinePrecision] - N[(N[(1.0 / N[(F * F), $MachinePrecision]), $MachinePrecision] * N[Tan[N[(Pi * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\pi \cdot \ell - \frac{1}{F \cdot F} \cdot \tan \left(\pi \cdot \ell\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 10 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (F l) :precision binary64 (- (* PI l) (* (/ 1.0 (* F F)) (tan (* PI l)))))
double code(double F, double l) {
return (((double) M_PI) * l) - ((1.0 / (F * F)) * tan((((double) M_PI) * l)));
}
public static double code(double F, double l) {
return (Math.PI * l) - ((1.0 / (F * F)) * Math.tan((Math.PI * l)));
}
def code(F, l): return (math.pi * l) - ((1.0 / (F * F)) * math.tan((math.pi * l)))
function code(F, l) return Float64(Float64(pi * l) - Float64(Float64(1.0 / Float64(F * F)) * tan(Float64(pi * l)))) end
function tmp = code(F, l) tmp = (pi * l) - ((1.0 / (F * F)) * tan((pi * l))); end
code[F_, l_] := N[(N[(Pi * l), $MachinePrecision] - N[(N[(1.0 / N[(F * F), $MachinePrecision]), $MachinePrecision] * N[Tan[N[(Pi * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\pi \cdot \ell - \frac{1}{F \cdot F} \cdot \tan \left(\pi \cdot \ell\right)
\end{array}
(FPCore (F l) :precision binary64 (if (or (<= (* PI l) -4e+19) (not (<= (* PI l) 10000000000.0))) (* PI l) (- (* PI l) (/ (/ (tan (* PI l)) F) F))))
double code(double F, double l) {
double tmp;
if (((((double) M_PI) * l) <= -4e+19) || !((((double) M_PI) * l) <= 10000000000.0)) {
tmp = ((double) M_PI) * l;
} else {
tmp = (((double) M_PI) * l) - ((tan((((double) M_PI) * l)) / F) / F);
}
return tmp;
}
public static double code(double F, double l) {
double tmp;
if (((Math.PI * l) <= -4e+19) || !((Math.PI * l) <= 10000000000.0)) {
tmp = Math.PI * l;
} else {
tmp = (Math.PI * l) - ((Math.tan((Math.PI * l)) / F) / F);
}
return tmp;
}
def code(F, l): tmp = 0 if ((math.pi * l) <= -4e+19) or not ((math.pi * l) <= 10000000000.0): tmp = math.pi * l else: tmp = (math.pi * l) - ((math.tan((math.pi * l)) / F) / F) return tmp
function code(F, l) tmp = 0.0 if ((Float64(pi * l) <= -4e+19) || !(Float64(pi * l) <= 10000000000.0)) tmp = Float64(pi * l); else tmp = Float64(Float64(pi * l) - Float64(Float64(tan(Float64(pi * l)) / F) / F)); end return tmp end
function tmp_2 = code(F, l) tmp = 0.0; if (((pi * l) <= -4e+19) || ~(((pi * l) <= 10000000000.0))) tmp = pi * l; else tmp = (pi * l) - ((tan((pi * l)) / F) / F); end tmp_2 = tmp; end
code[F_, l_] := If[Or[LessEqual[N[(Pi * l), $MachinePrecision], -4e+19], N[Not[LessEqual[N[(Pi * l), $MachinePrecision], 10000000000.0]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[(N[(Pi * l), $MachinePrecision] - N[(N[(N[Tan[N[(Pi * l), $MachinePrecision]], $MachinePrecision] / F), $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\pi \cdot \ell \leq -4 \cdot 10^{+19} \lor \neg \left(\pi \cdot \ell \leq 10000000000\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\pi \cdot \ell - \frac{\frac{\tan \left(\pi \cdot \ell\right)}{F}}{F}\\
\end{array}
\end{array}
if (*.f64 (PI.f64) l) < -4e19 or 1e10 < (*.f64 (PI.f64) l) Initial program 63.7%
associate-*l/63.7%
*-lft-identity63.7%
Simplified63.7%
Taylor expanded in l around 0 44.4%
unpow244.4%
Simplified44.4%
Taylor expanded in F around inf 99.5%
if -4e19 < (*.f64 (PI.f64) l) < 1e10Initial program 94.2%
associate-*l/94.7%
*-un-lft-identity94.7%
associate-/r*99.3%
Applied egg-rr99.3%
Final simplification99.4%
(FPCore (F l) :precision binary64 (if (or (<= (* PI l) -4e+19) (not (<= (* PI l) 10000000000.0))) (* PI l) (- (* PI l) (/ (* PI (/ l F)) F))))
double code(double F, double l) {
double tmp;
if (((((double) M_PI) * l) <= -4e+19) || !((((double) M_PI) * l) <= 10000000000.0)) {
tmp = ((double) M_PI) * l;
} else {
tmp = (((double) M_PI) * l) - ((((double) M_PI) * (l / F)) / F);
}
return tmp;
}
public static double code(double F, double l) {
double tmp;
if (((Math.PI * l) <= -4e+19) || !((Math.PI * l) <= 10000000000.0)) {
tmp = Math.PI * l;
} else {
tmp = (Math.PI * l) - ((Math.PI * (l / F)) / F);
}
return tmp;
}
def code(F, l): tmp = 0 if ((math.pi * l) <= -4e+19) or not ((math.pi * l) <= 10000000000.0): tmp = math.pi * l else: tmp = (math.pi * l) - ((math.pi * (l / F)) / F) return tmp
function code(F, l) tmp = 0.0 if ((Float64(pi * l) <= -4e+19) || !(Float64(pi * l) <= 10000000000.0)) tmp = Float64(pi * l); else tmp = Float64(Float64(pi * l) - Float64(Float64(pi * Float64(l / F)) / F)); end return tmp end
function tmp_2 = code(F, l) tmp = 0.0; if (((pi * l) <= -4e+19) || ~(((pi * l) <= 10000000000.0))) tmp = pi * l; else tmp = (pi * l) - ((pi * (l / F)) / F); end tmp_2 = tmp; end
code[F_, l_] := If[Or[LessEqual[N[(Pi * l), $MachinePrecision], -4e+19], N[Not[LessEqual[N[(Pi * l), $MachinePrecision], 10000000000.0]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[(N[(Pi * l), $MachinePrecision] - N[(N[(Pi * N[(l / F), $MachinePrecision]), $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\pi \cdot \ell \leq -4 \cdot 10^{+19} \lor \neg \left(\pi \cdot \ell \leq 10000000000\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\pi \cdot \ell - \frac{\pi \cdot \frac{\ell}{F}}{F}\\
\end{array}
\end{array}
if (*.f64 (PI.f64) l) < -4e19 or 1e10 < (*.f64 (PI.f64) l) Initial program 63.7%
associate-*l/63.7%
*-lft-identity63.7%
Simplified63.7%
Taylor expanded in l around 0 44.4%
unpow244.4%
Simplified44.4%
Taylor expanded in F around inf 99.5%
if -4e19 < (*.f64 (PI.f64) l) < 1e10Initial program 94.2%
associate-*l/94.7%
*-un-lft-identity94.7%
add-sqr-sqrt60.7%
pow260.7%
sqrt-div42.3%
sqrt-prod22.7%
add-sqr-sqrt44.2%
Applied egg-rr44.2%
Taylor expanded in l around 0 42.2%
unpow242.2%
associate-*l/42.1%
div-inv42.1%
associate-*l*42.1%
add-sqr-sqrt98.8%
div-inv98.8%
associate-/l*98.8%
associate-/r/98.8%
Applied egg-rr98.8%
Final simplification99.2%
(FPCore (F l) :precision binary64 (if (or (<= l -3.85e+18) (not (<= l 32000000000.0))) (* PI l) (- (* PI l) (* PI (/ l (* F F))))))
double code(double F, double l) {
double tmp;
if ((l <= -3.85e+18) || !(l <= 32000000000.0)) {
tmp = ((double) M_PI) * l;
} else {
tmp = (((double) M_PI) * l) - (((double) M_PI) * (l / (F * F)));
}
return tmp;
}
public static double code(double F, double l) {
double tmp;
if ((l <= -3.85e+18) || !(l <= 32000000000.0)) {
tmp = Math.PI * l;
} else {
tmp = (Math.PI * l) - (Math.PI * (l / (F * F)));
}
return tmp;
}
def code(F, l): tmp = 0 if (l <= -3.85e+18) or not (l <= 32000000000.0): tmp = math.pi * l else: tmp = (math.pi * l) - (math.pi * (l / (F * F))) return tmp
function code(F, l) tmp = 0.0 if ((l <= -3.85e+18) || !(l <= 32000000000.0)) tmp = Float64(pi * l); else tmp = Float64(Float64(pi * l) - Float64(pi * Float64(l / Float64(F * F)))); end return tmp end
function tmp_2 = code(F, l) tmp = 0.0; if ((l <= -3.85e+18) || ~((l <= 32000000000.0))) tmp = pi * l; else tmp = (pi * l) - (pi * (l / (F * F))); end tmp_2 = tmp; end
code[F_, l_] := If[Or[LessEqual[l, -3.85e+18], N[Not[LessEqual[l, 32000000000.0]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[(N[(Pi * l), $MachinePrecision] - N[(Pi * N[(l / N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -3.85 \cdot 10^{+18} \lor \neg \left(\ell \leq 32000000000\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\pi \cdot \ell - \pi \cdot \frac{\ell}{F \cdot F}\\
\end{array}
\end{array}
if l < -3.85e18 or 3.2e10 < l Initial program 63.7%
associate-*l/63.7%
*-lft-identity63.7%
Simplified63.7%
Taylor expanded in l around 0 44.4%
unpow244.4%
Simplified44.4%
Taylor expanded in F around inf 99.5%
if -3.85e18 < l < 3.2e10Initial program 94.2%
Taylor expanded in l around 0 94.2%
associate-/l*94.2%
associate-/r/94.2%
unpow294.2%
Simplified94.2%
Final simplification96.8%
(FPCore (F l) :precision binary64 (if (or (<= l -3.85e+18) (not (<= l 32000000000.0))) (* PI l) (- (* PI l) (/ (* PI l) (* F F)))))
double code(double F, double l) {
double tmp;
if ((l <= -3.85e+18) || !(l <= 32000000000.0)) {
tmp = ((double) M_PI) * l;
} else {
tmp = (((double) M_PI) * l) - ((((double) M_PI) * l) / (F * F));
}
return tmp;
}
public static double code(double F, double l) {
double tmp;
if ((l <= -3.85e+18) || !(l <= 32000000000.0)) {
tmp = Math.PI * l;
} else {
tmp = (Math.PI * l) - ((Math.PI * l) / (F * F));
}
return tmp;
}
def code(F, l): tmp = 0 if (l <= -3.85e+18) or not (l <= 32000000000.0): tmp = math.pi * l else: tmp = (math.pi * l) - ((math.pi * l) / (F * F)) return tmp
function code(F, l) tmp = 0.0 if ((l <= -3.85e+18) || !(l <= 32000000000.0)) tmp = Float64(pi * l); else tmp = Float64(Float64(pi * l) - Float64(Float64(pi * l) / Float64(F * F))); end return tmp end
function tmp_2 = code(F, l) tmp = 0.0; if ((l <= -3.85e+18) || ~((l <= 32000000000.0))) tmp = pi * l; else tmp = (pi * l) - ((pi * l) / (F * F)); end tmp_2 = tmp; end
code[F_, l_] := If[Or[LessEqual[l, -3.85e+18], N[Not[LessEqual[l, 32000000000.0]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[(N[(Pi * l), $MachinePrecision] - N[(N[(Pi * l), $MachinePrecision] / N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -3.85 \cdot 10^{+18} \lor \neg \left(\ell \leq 32000000000\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\pi \cdot \ell - \frac{\pi \cdot \ell}{F \cdot F}\\
\end{array}
\end{array}
if l < -3.85e18 or 3.2e10 < l Initial program 63.7%
associate-*l/63.7%
*-lft-identity63.7%
Simplified63.7%
Taylor expanded in l around 0 44.4%
unpow244.4%
Simplified44.4%
Taylor expanded in F around inf 99.5%
if -3.85e18 < l < 3.2e10Initial program 94.2%
associate-*l/94.7%
*-lft-identity94.7%
Simplified94.7%
Taylor expanded in l around 0 94.2%
Final simplification96.8%
(FPCore (F l) :precision binary64 (if (or (<= l -3.85e+18) (not (<= l 32000000000.0))) (* PI l) (* l (* PI (- 1.0 (pow F -2.0))))))
double code(double F, double l) {
double tmp;
if ((l <= -3.85e+18) || !(l <= 32000000000.0)) {
tmp = ((double) M_PI) * l;
} else {
tmp = l * (((double) M_PI) * (1.0 - pow(F, -2.0)));
}
return tmp;
}
public static double code(double F, double l) {
double tmp;
if ((l <= -3.85e+18) || !(l <= 32000000000.0)) {
tmp = Math.PI * l;
} else {
tmp = l * (Math.PI * (1.0 - Math.pow(F, -2.0)));
}
return tmp;
}
def code(F, l): tmp = 0 if (l <= -3.85e+18) or not (l <= 32000000000.0): tmp = math.pi * l else: tmp = l * (math.pi * (1.0 - math.pow(F, -2.0))) return tmp
function code(F, l) tmp = 0.0 if ((l <= -3.85e+18) || !(l <= 32000000000.0)) tmp = Float64(pi * l); else tmp = Float64(l * Float64(pi * Float64(1.0 - (F ^ -2.0)))); end return tmp end
function tmp_2 = code(F, l) tmp = 0.0; if ((l <= -3.85e+18) || ~((l <= 32000000000.0))) tmp = pi * l; else tmp = l * (pi * (1.0 - (F ^ -2.0))); end tmp_2 = tmp; end
code[F_, l_] := If[Or[LessEqual[l, -3.85e+18], N[Not[LessEqual[l, 32000000000.0]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[(l * N[(Pi * N[(1.0 - N[Power[F, -2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -3.85 \cdot 10^{+18} \lor \neg \left(\ell \leq 32000000000\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\ell \cdot \left(\pi \cdot \left(1 - {F}^{-2}\right)\right)\\
\end{array}
\end{array}
if l < -3.85e18 or 3.2e10 < l Initial program 63.7%
associate-*l/63.7%
*-lft-identity63.7%
Simplified63.7%
Taylor expanded in l around 0 44.4%
unpow244.4%
Simplified44.4%
Taylor expanded in F around inf 99.5%
if -3.85e18 < l < 3.2e10Initial program 94.2%
associate-*l/94.7%
*-lft-identity94.7%
Simplified94.7%
Taylor expanded in l around 0 93.8%
unpow293.8%
Simplified93.8%
Taylor expanded in l around 0 93.8%
*-rgt-identity93.8%
unpow293.8%
times-frac93.8%
*-rgt-identity93.8%
associate-*r/93.7%
associate-*r*93.7%
unpow-193.7%
unpow-193.7%
pow-sqr93.8%
metadata-eval93.8%
*-rgt-identity93.8%
distribute-lft-out--93.8%
Simplified93.8%
Final simplification96.6%
(FPCore (F l)
:precision binary64
(if (<= F 4.6e-195)
(* PI (/ (/ l F) (- F)))
(if (or (<= F 4e-95) (not (<= F 3e-70)))
(* PI l)
(/ (- l) (/ 1.0 (/ (/ PI F) F))))))
double code(double F, double l) {
double tmp;
if (F <= 4.6e-195) {
tmp = ((double) M_PI) * ((l / F) / -F);
} else if ((F <= 4e-95) || !(F <= 3e-70)) {
tmp = ((double) M_PI) * l;
} else {
tmp = -l / (1.0 / ((((double) M_PI) / F) / F));
}
return tmp;
}
public static double code(double F, double l) {
double tmp;
if (F <= 4.6e-195) {
tmp = Math.PI * ((l / F) / -F);
} else if ((F <= 4e-95) || !(F <= 3e-70)) {
tmp = Math.PI * l;
} else {
tmp = -l / (1.0 / ((Math.PI / F) / F));
}
return tmp;
}
def code(F, l): tmp = 0 if F <= 4.6e-195: tmp = math.pi * ((l / F) / -F) elif (F <= 4e-95) or not (F <= 3e-70): tmp = math.pi * l else: tmp = -l / (1.0 / ((math.pi / F) / F)) return tmp
function code(F, l) tmp = 0.0 if (F <= 4.6e-195) tmp = Float64(pi * Float64(Float64(l / F) / Float64(-F))); elseif ((F <= 4e-95) || !(F <= 3e-70)) tmp = Float64(pi * l); else tmp = Float64(Float64(-l) / Float64(1.0 / Float64(Float64(pi / F) / F))); end return tmp end
function tmp_2 = code(F, l) tmp = 0.0; if (F <= 4.6e-195) tmp = pi * ((l / F) / -F); elseif ((F <= 4e-95) || ~((F <= 3e-70))) tmp = pi * l; else tmp = -l / (1.0 / ((pi / F) / F)); end tmp_2 = tmp; end
code[F_, l_] := If[LessEqual[F, 4.6e-195], N[(Pi * N[(N[(l / F), $MachinePrecision] / (-F)), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[F, 4e-95], N[Not[LessEqual[F, 3e-70]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[((-l) / N[(1.0 / N[(N[(Pi / F), $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq 4.6 \cdot 10^{-195}:\\
\;\;\;\;\pi \cdot \frac{\frac{\ell}{F}}{-F}\\
\mathbf{elif}\;F \leq 4 \cdot 10^{-95} \lor \neg \left(F \leq 3 \cdot 10^{-70}\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\frac{-\ell}{\frac{1}{\frac{\frac{\pi}{F}}{F}}}\\
\end{array}
\end{array}
if F < 4.6000000000000004e-195Initial program 72.8%
associate-*l/72.9%
*-lft-identity72.9%
Simplified72.9%
Taylor expanded in l around 0 64.0%
unpow264.0%
Simplified64.0%
Taylor expanded in F around 0 24.9%
mul-1-neg24.9%
associate-/l*24.9%
unpow224.9%
associate-*r/24.9%
distribute-neg-frac24.9%
associate-*r/24.9%
Simplified24.9%
add-sqr-sqrt13.7%
sqrt-unprod12.5%
sqr-neg12.5%
sqrt-unprod1.7%
add-sqr-sqrt3.9%
associate-/l*3.9%
associate-/r/3.9%
associate-/l/4.0%
associate-/l*4.0%
frac-2neg4.0%
div-inv4.0%
*-commutative4.0%
distribute-rgt-neg-in4.0%
frac-2neg4.0%
add-sqr-sqrt2.2%
sqrt-unprod8.9%
sqr-neg8.9%
sqrt-unprod12.4%
add-sqr-sqrt27.8%
distribute-frac-neg27.8%
frac-2neg27.8%
Applied egg-rr27.8%
associate-*l*27.7%
associate-*r/27.8%
*-rgt-identity27.8%
Simplified27.8%
if 4.6000000000000004e-195 < F < 3.99999999999999996e-95 or 3.0000000000000001e-70 < F Initial program 89.0%
associate-*l/89.6%
*-lft-identity89.6%
Simplified89.6%
Taylor expanded in l around 0 78.9%
unpow278.9%
Simplified78.9%
Taylor expanded in F around inf 89.6%
if 3.99999999999999996e-95 < F < 3.0000000000000001e-70Initial program 95.1%
associate-*l/95.1%
*-lft-identity95.1%
Simplified95.1%
Taylor expanded in l around 0 72.3%
unpow272.3%
Simplified72.3%
Taylor expanded in F around 0 72.2%
mul-1-neg72.2%
associate-/l*72.7%
unpow272.7%
associate-*r/72.9%
distribute-neg-frac72.9%
associate-*r/72.7%
Simplified72.7%
clear-num72.7%
inv-pow72.7%
Applied egg-rr72.7%
unpow-172.7%
associate-/r*73.1%
Simplified73.1%
Final simplification51.0%
(FPCore (F l)
:precision binary64
(if (<= F 4.8e-196)
(* PI (/ (/ l F) (- F)))
(if (or (<= F 2.3e-95) (not (<= F 1.9e-70)))
(* PI l)
(* (- l) (/ PI (* F F))))))
double code(double F, double l) {
double tmp;
if (F <= 4.8e-196) {
tmp = ((double) M_PI) * ((l / F) / -F);
} else if ((F <= 2.3e-95) || !(F <= 1.9e-70)) {
tmp = ((double) M_PI) * l;
} else {
tmp = -l * (((double) M_PI) / (F * F));
}
return tmp;
}
public static double code(double F, double l) {
double tmp;
if (F <= 4.8e-196) {
tmp = Math.PI * ((l / F) / -F);
} else if ((F <= 2.3e-95) || !(F <= 1.9e-70)) {
tmp = Math.PI * l;
} else {
tmp = -l * (Math.PI / (F * F));
}
return tmp;
}
def code(F, l): tmp = 0 if F <= 4.8e-196: tmp = math.pi * ((l / F) / -F) elif (F <= 2.3e-95) or not (F <= 1.9e-70): tmp = math.pi * l else: tmp = -l * (math.pi / (F * F)) return tmp
function code(F, l) tmp = 0.0 if (F <= 4.8e-196) tmp = Float64(pi * Float64(Float64(l / F) / Float64(-F))); elseif ((F <= 2.3e-95) || !(F <= 1.9e-70)) tmp = Float64(pi * l); else tmp = Float64(Float64(-l) * Float64(pi / Float64(F * F))); end return tmp end
function tmp_2 = code(F, l) tmp = 0.0; if (F <= 4.8e-196) tmp = pi * ((l / F) / -F); elseif ((F <= 2.3e-95) || ~((F <= 1.9e-70))) tmp = pi * l; else tmp = -l * (pi / (F * F)); end tmp_2 = tmp; end
code[F_, l_] := If[LessEqual[F, 4.8e-196], N[(Pi * N[(N[(l / F), $MachinePrecision] / (-F)), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[F, 2.3e-95], N[Not[LessEqual[F, 1.9e-70]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[((-l) * N[(Pi / N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq 4.8 \cdot 10^{-196}:\\
\;\;\;\;\pi \cdot \frac{\frac{\ell}{F}}{-F}\\
\mathbf{elif}\;F \leq 2.3 \cdot 10^{-95} \lor \neg \left(F \leq 1.9 \cdot 10^{-70}\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\left(-\ell\right) \cdot \frac{\pi}{F \cdot F}\\
\end{array}
\end{array}
if F < 4.80000000000000041e-196Initial program 72.8%
associate-*l/72.9%
*-lft-identity72.9%
Simplified72.9%
Taylor expanded in l around 0 64.0%
unpow264.0%
Simplified64.0%
Taylor expanded in F around 0 24.9%
mul-1-neg24.9%
associate-/l*24.9%
unpow224.9%
associate-*r/24.9%
distribute-neg-frac24.9%
associate-*r/24.9%
Simplified24.9%
add-sqr-sqrt13.7%
sqrt-unprod12.5%
sqr-neg12.5%
sqrt-unprod1.7%
add-sqr-sqrt3.9%
associate-/l*3.9%
associate-/r/3.9%
associate-/l/4.0%
associate-/l*4.0%
frac-2neg4.0%
div-inv4.0%
*-commutative4.0%
distribute-rgt-neg-in4.0%
frac-2neg4.0%
add-sqr-sqrt2.2%
sqrt-unprod8.9%
sqr-neg8.9%
sqrt-unprod12.4%
add-sqr-sqrt27.8%
distribute-frac-neg27.8%
frac-2neg27.8%
Applied egg-rr27.8%
associate-*l*27.7%
associate-*r/27.8%
*-rgt-identity27.8%
Simplified27.8%
if 4.80000000000000041e-196 < F < 2.29999999999999999e-95 or 1.8999999999999999e-70 < F Initial program 89.0%
associate-*l/89.6%
*-lft-identity89.6%
Simplified89.6%
Taylor expanded in l around 0 78.9%
unpow278.9%
Simplified78.9%
Taylor expanded in F around inf 89.6%
if 2.29999999999999999e-95 < F < 1.8999999999999999e-70Initial program 95.1%
associate-*l/95.1%
*-lft-identity95.1%
Simplified95.1%
Taylor expanded in l around 0 72.3%
unpow272.3%
Simplified72.3%
Taylor expanded in F around 0 72.2%
mul-1-neg72.2%
associate-/l*72.7%
unpow272.7%
associate-*r/72.9%
distribute-neg-frac72.9%
associate-*r/72.7%
Simplified72.7%
Taylor expanded in l around 0 72.2%
mul-1-neg72.2%
unpow272.2%
associate-*r/72.3%
distribute-rgt-neg-in72.3%
Simplified72.3%
Final simplification51.0%
(FPCore (F l)
:precision binary64
(if (<= F 3.35e-195)
(* PI (/ (/ l F) (- F)))
(if (or (<= F 4.6e-89) (not (<= F 2.2e-69)))
(* PI l)
(/ (- l) (/ (* F F) PI)))))
double code(double F, double l) {
double tmp;
if (F <= 3.35e-195) {
tmp = ((double) M_PI) * ((l / F) / -F);
} else if ((F <= 4.6e-89) || !(F <= 2.2e-69)) {
tmp = ((double) M_PI) * l;
} else {
tmp = -l / ((F * F) / ((double) M_PI));
}
return tmp;
}
public static double code(double F, double l) {
double tmp;
if (F <= 3.35e-195) {
tmp = Math.PI * ((l / F) / -F);
} else if ((F <= 4.6e-89) || !(F <= 2.2e-69)) {
tmp = Math.PI * l;
} else {
tmp = -l / ((F * F) / Math.PI);
}
return tmp;
}
def code(F, l): tmp = 0 if F <= 3.35e-195: tmp = math.pi * ((l / F) / -F) elif (F <= 4.6e-89) or not (F <= 2.2e-69): tmp = math.pi * l else: tmp = -l / ((F * F) / math.pi) return tmp
function code(F, l) tmp = 0.0 if (F <= 3.35e-195) tmp = Float64(pi * Float64(Float64(l / F) / Float64(-F))); elseif ((F <= 4.6e-89) || !(F <= 2.2e-69)) tmp = Float64(pi * l); else tmp = Float64(Float64(-l) / Float64(Float64(F * F) / pi)); end return tmp end
function tmp_2 = code(F, l) tmp = 0.0; if (F <= 3.35e-195) tmp = pi * ((l / F) / -F); elseif ((F <= 4.6e-89) || ~((F <= 2.2e-69))) tmp = pi * l; else tmp = -l / ((F * F) / pi); end tmp_2 = tmp; end
code[F_, l_] := If[LessEqual[F, 3.35e-195], N[(Pi * N[(N[(l / F), $MachinePrecision] / (-F)), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[F, 4.6e-89], N[Not[LessEqual[F, 2.2e-69]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[((-l) / N[(N[(F * F), $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq 3.35 \cdot 10^{-195}:\\
\;\;\;\;\pi \cdot \frac{\frac{\ell}{F}}{-F}\\
\mathbf{elif}\;F \leq 4.6 \cdot 10^{-89} \lor \neg \left(F \leq 2.2 \cdot 10^{-69}\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\frac{-\ell}{\frac{F \cdot F}{\pi}}\\
\end{array}
\end{array}
if F < 3.3500000000000001e-195Initial program 72.8%
associate-*l/72.9%
*-lft-identity72.9%
Simplified72.9%
Taylor expanded in l around 0 64.0%
unpow264.0%
Simplified64.0%
Taylor expanded in F around 0 24.9%
mul-1-neg24.9%
associate-/l*24.9%
unpow224.9%
associate-*r/24.9%
distribute-neg-frac24.9%
associate-*r/24.9%
Simplified24.9%
add-sqr-sqrt13.7%
sqrt-unprod12.5%
sqr-neg12.5%
sqrt-unprod1.7%
add-sqr-sqrt3.9%
associate-/l*3.9%
associate-/r/3.9%
associate-/l/4.0%
associate-/l*4.0%
frac-2neg4.0%
div-inv4.0%
*-commutative4.0%
distribute-rgt-neg-in4.0%
frac-2neg4.0%
add-sqr-sqrt2.2%
sqrt-unprod8.9%
sqr-neg8.9%
sqrt-unprod12.4%
add-sqr-sqrt27.8%
distribute-frac-neg27.8%
frac-2neg27.8%
Applied egg-rr27.8%
associate-*l*27.7%
associate-*r/27.8%
*-rgt-identity27.8%
Simplified27.8%
if 3.3500000000000001e-195 < F < 4.6e-89 or 2.2e-69 < F Initial program 89.0%
associate-*l/89.6%
*-lft-identity89.6%
Simplified89.6%
Taylor expanded in l around 0 78.9%
unpow278.9%
Simplified78.9%
Taylor expanded in F around inf 89.6%
if 4.6e-89 < F < 2.2e-69Initial program 95.1%
associate-*l/95.1%
*-lft-identity95.1%
Simplified95.1%
Taylor expanded in l around 0 72.3%
unpow272.3%
Simplified72.3%
Taylor expanded in F around 0 72.2%
mul-1-neg72.2%
associate-/l*72.7%
unpow272.7%
associate-*r/72.9%
distribute-neg-frac72.9%
associate-*r/72.7%
Simplified72.7%
Final simplification51.0%
(FPCore (F l) :precision binary64 (if (or (<= F 3.5e-90) (not (<= F 5.2e-70))) (* PI l) (* (- l) (/ PI (* F F)))))
double code(double F, double l) {
double tmp;
if ((F <= 3.5e-90) || !(F <= 5.2e-70)) {
tmp = ((double) M_PI) * l;
} else {
tmp = -l * (((double) M_PI) / (F * F));
}
return tmp;
}
public static double code(double F, double l) {
double tmp;
if ((F <= 3.5e-90) || !(F <= 5.2e-70)) {
tmp = Math.PI * l;
} else {
tmp = -l * (Math.PI / (F * F));
}
return tmp;
}
def code(F, l): tmp = 0 if (F <= 3.5e-90) or not (F <= 5.2e-70): tmp = math.pi * l else: tmp = -l * (math.pi / (F * F)) return tmp
function code(F, l) tmp = 0.0 if ((F <= 3.5e-90) || !(F <= 5.2e-70)) tmp = Float64(pi * l); else tmp = Float64(Float64(-l) * Float64(pi / Float64(F * F))); end return tmp end
function tmp_2 = code(F, l) tmp = 0.0; if ((F <= 3.5e-90) || ~((F <= 5.2e-70))) tmp = pi * l; else tmp = -l * (pi / (F * F)); end tmp_2 = tmp; end
code[F_, l_] := If[Or[LessEqual[F, 3.5e-90], N[Not[LessEqual[F, 5.2e-70]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[((-l) * N[(Pi / N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq 3.5 \cdot 10^{-90} \lor \neg \left(F \leq 5.2 \cdot 10^{-70}\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\left(-\ell\right) \cdot \frac{\pi}{F \cdot F}\\
\end{array}
\end{array}
if F < 3.4999999999999999e-90 or 5.20000000000000004e-70 < F Initial program 78.7%
associate-*l/79.0%
*-lft-identity79.0%
Simplified79.0%
Taylor expanded in l around 0 69.4%
unpow269.4%
Simplified69.4%
Taylor expanded in F around inf 78.9%
if 3.4999999999999999e-90 < F < 5.20000000000000004e-70Initial program 95.1%
associate-*l/95.1%
*-lft-identity95.1%
Simplified95.1%
Taylor expanded in l around 0 72.3%
unpow272.3%
Simplified72.3%
Taylor expanded in F around 0 72.2%
mul-1-neg72.2%
associate-/l*72.7%
unpow272.7%
associate-*r/72.9%
distribute-neg-frac72.9%
associate-*r/72.7%
Simplified72.7%
Taylor expanded in l around 0 72.2%
mul-1-neg72.2%
unpow272.2%
associate-*r/72.3%
distribute-rgt-neg-in72.3%
Simplified72.3%
Final simplification78.7%
(FPCore (F l) :precision binary64 (* PI l))
double code(double F, double l) {
return ((double) M_PI) * l;
}
public static double code(double F, double l) {
return Math.PI * l;
}
def code(F, l): return math.pi * l
function code(F, l) return Float64(pi * l) end
function tmp = code(F, l) tmp = pi * l; end
code[F_, l_] := N[(Pi * l), $MachinePrecision]
\begin{array}{l}
\\
\pi \cdot \ell
\end{array}
Initial program 79.2%
associate-*l/79.4%
*-lft-identity79.4%
Simplified79.4%
Taylor expanded in l around 0 69.5%
unpow269.5%
Simplified69.5%
Taylor expanded in F around inf 77.2%
Final simplification77.2%
herbie shell --seed 2023214
(FPCore (F l)
:name "VandenBroeck and Keller, Equation (6)"
:precision binary64
(- (* PI l) (* (/ 1.0 (* F F)) (tan (* PI l)))))