
(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 9 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) -5e+25) (not (<= (* PI l) 10000000000000.0))) (* PI l) (- (* PI l) (/ (/ (tan (* PI l)) F) F))))
double code(double F, double l) {
double tmp;
if (((((double) M_PI) * l) <= -5e+25) || !((((double) M_PI) * l) <= 10000000000000.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) <= -5e+25) || !((Math.PI * l) <= 10000000000000.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) <= -5e+25) or not ((math.pi * l) <= 10000000000000.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) <= -5e+25) || !(Float64(pi * l) <= 10000000000000.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) <= -5e+25) || ~(((pi * l) <= 10000000000000.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], -5e+25], N[Not[LessEqual[N[(Pi * l), $MachinePrecision], 10000000000000.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 -5 \cdot 10^{+25} \lor \neg \left(\pi \cdot \ell \leq 10000000000000\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) < -5.00000000000000024e25 or 1e13 < (*.f64 (PI.f64) l) Initial program 65.4%
Taylor expanded in l around 0 50.4%
unpow250.4%
times-frac50.4%
Simplified50.4%
Taylor expanded in F around inf 99.7%
if -5.00000000000000024e25 < (*.f64 (PI.f64) l) < 1e13Initial program 85.6%
associate-*l/87.0%
*-un-lft-identity87.0%
associate-/r*99.6%
Applied egg-rr99.6%
Final simplification99.6%
(FPCore (F l) :precision binary64 (if (or (<= (* PI l) -5e+25) (not (<= (* PI l) 10000000000000.0))) (* PI l) (- (* PI l) (* (/ l F) (/ PI F)))))
double code(double F, double l) {
double tmp;
if (((((double) M_PI) * l) <= -5e+25) || !((((double) M_PI) * l) <= 10000000000000.0)) {
tmp = ((double) M_PI) * l;
} else {
tmp = (((double) M_PI) * l) - ((l / F) * (((double) M_PI) / F));
}
return tmp;
}
public static double code(double F, double l) {
double tmp;
if (((Math.PI * l) <= -5e+25) || !((Math.PI * l) <= 10000000000000.0)) {
tmp = Math.PI * l;
} else {
tmp = (Math.PI * l) - ((l / F) * (Math.PI / F));
}
return tmp;
}
def code(F, l): tmp = 0 if ((math.pi * l) <= -5e+25) or not ((math.pi * l) <= 10000000000000.0): tmp = math.pi * l else: tmp = (math.pi * l) - ((l / F) * (math.pi / F)) return tmp
function code(F, l) tmp = 0.0 if ((Float64(pi * l) <= -5e+25) || !(Float64(pi * l) <= 10000000000000.0)) tmp = Float64(pi * l); else tmp = Float64(Float64(pi * l) - Float64(Float64(l / F) * Float64(pi / F))); end return tmp end
function tmp_2 = code(F, l) tmp = 0.0; if (((pi * l) <= -5e+25) || ~(((pi * l) <= 10000000000000.0))) tmp = pi * l; else tmp = (pi * l) - ((l / F) * (pi / F)); end tmp_2 = tmp; end
code[F_, l_] := If[Or[LessEqual[N[(Pi * l), $MachinePrecision], -5e+25], N[Not[LessEqual[N[(Pi * l), $MachinePrecision], 10000000000000.0]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[(N[(Pi * l), $MachinePrecision] - N[(N[(l / F), $MachinePrecision] * N[(Pi / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\pi \cdot \ell \leq -5 \cdot 10^{+25} \lor \neg \left(\pi \cdot \ell \leq 10000000000000\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\pi \cdot \ell - \frac{\ell}{F} \cdot \frac{\pi}{F}\\
\end{array}
\end{array}
if (*.f64 (PI.f64) l) < -5.00000000000000024e25 or 1e13 < (*.f64 (PI.f64) l) Initial program 65.4%
Taylor expanded in l around 0 50.4%
unpow250.4%
times-frac50.4%
Simplified50.4%
Taylor expanded in F around inf 99.7%
if -5.00000000000000024e25 < (*.f64 (PI.f64) l) < 1e13Initial program 85.6%
Taylor expanded in l around 0 86.4%
unpow286.4%
times-frac99.1%
Simplified99.1%
Final simplification99.3%
(FPCore (F l) :precision binary64 (if (or (<= (* PI l) -5e+25) (not (<= (* PI l) 10000000000000.0))) (* PI l) (- (* PI l) (/ (/ l (/ F PI)) F))))
double code(double F, double l) {
double tmp;
if (((((double) M_PI) * l) <= -5e+25) || !((((double) M_PI) * l) <= 10000000000000.0)) {
tmp = ((double) M_PI) * l;
} else {
tmp = (((double) M_PI) * l) - ((l / (F / ((double) M_PI))) / F);
}
return tmp;
}
public static double code(double F, double l) {
double tmp;
if (((Math.PI * l) <= -5e+25) || !((Math.PI * l) <= 10000000000000.0)) {
tmp = Math.PI * l;
} else {
tmp = (Math.PI * l) - ((l / (F / Math.PI)) / F);
}
return tmp;
}
def code(F, l): tmp = 0 if ((math.pi * l) <= -5e+25) or not ((math.pi * l) <= 10000000000000.0): tmp = math.pi * l else: tmp = (math.pi * l) - ((l / (F / math.pi)) / F) return tmp
function code(F, l) tmp = 0.0 if ((Float64(pi * l) <= -5e+25) || !(Float64(pi * l) <= 10000000000000.0)) tmp = Float64(pi * l); else tmp = Float64(Float64(pi * l) - Float64(Float64(l / Float64(F / pi)) / F)); end return tmp end
function tmp_2 = code(F, l) tmp = 0.0; if (((pi * l) <= -5e+25) || ~(((pi * l) <= 10000000000000.0))) tmp = pi * l; else tmp = (pi * l) - ((l / (F / pi)) / F); end tmp_2 = tmp; end
code[F_, l_] := If[Or[LessEqual[N[(Pi * l), $MachinePrecision], -5e+25], N[Not[LessEqual[N[(Pi * l), $MachinePrecision], 10000000000000.0]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[(N[(Pi * l), $MachinePrecision] - N[(N[(l / N[(F / Pi), $MachinePrecision]), $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\pi \cdot \ell \leq -5 \cdot 10^{+25} \lor \neg \left(\pi \cdot \ell \leq 10000000000000\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\pi \cdot \ell - \frac{\frac{\ell}{\frac{F}{\pi}}}{F}\\
\end{array}
\end{array}
if (*.f64 (PI.f64) l) < -5.00000000000000024e25 or 1e13 < (*.f64 (PI.f64) l) Initial program 65.4%
Taylor expanded in l around 0 50.4%
unpow250.4%
times-frac50.4%
Simplified50.4%
Taylor expanded in F around inf 99.7%
if -5.00000000000000024e25 < (*.f64 (PI.f64) l) < 1e13Initial program 85.6%
associate-*l/87.0%
*-un-lft-identity87.0%
associate-/r*99.6%
Applied egg-rr99.6%
Taylor expanded in l around 0 99.1%
associate-/l*99.1%
Simplified99.1%
Final simplification99.3%
(FPCore (F l) :precision binary64 (if (or (<= (* PI l) -5e+25) (not (<= (* PI l) 10000000000000.0))) (* PI l) (* l (- PI (/ PI (* F F))))))
double code(double F, double l) {
double tmp;
if (((((double) M_PI) * l) <= -5e+25) || !((((double) M_PI) * l) <= 10000000000000.0)) {
tmp = ((double) M_PI) * l;
} else {
tmp = l * (((double) M_PI) - (((double) M_PI) / (F * F)));
}
return tmp;
}
public static double code(double F, double l) {
double tmp;
if (((Math.PI * l) <= -5e+25) || !((Math.PI * l) <= 10000000000000.0)) {
tmp = Math.PI * l;
} else {
tmp = l * (Math.PI - (Math.PI / (F * F)));
}
return tmp;
}
def code(F, l): tmp = 0 if ((math.pi * l) <= -5e+25) or not ((math.pi * l) <= 10000000000000.0): tmp = math.pi * l else: tmp = l * (math.pi - (math.pi / (F * F))) return tmp
function code(F, l) tmp = 0.0 if ((Float64(pi * l) <= -5e+25) || !(Float64(pi * l) <= 10000000000000.0)) tmp = Float64(pi * l); else tmp = Float64(l * Float64(pi - Float64(pi / Float64(F * F)))); end return tmp end
function tmp_2 = code(F, l) tmp = 0.0; if (((pi * l) <= -5e+25) || ~(((pi * l) <= 10000000000000.0))) tmp = pi * l; else tmp = l * (pi - (pi / (F * F))); end tmp_2 = tmp; end
code[F_, l_] := If[Or[LessEqual[N[(Pi * l), $MachinePrecision], -5e+25], N[Not[LessEqual[N[(Pi * l), $MachinePrecision], 10000000000000.0]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[(l * N[(Pi - N[(Pi / N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\pi \cdot \ell \leq -5 \cdot 10^{+25} \lor \neg \left(\pi \cdot \ell \leq 10000000000000\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\ell \cdot \left(\pi - \frac{\pi}{F \cdot F}\right)\\
\end{array}
\end{array}
if (*.f64 (PI.f64) l) < -5.00000000000000024e25 or 1e13 < (*.f64 (PI.f64) l) Initial program 65.4%
Taylor expanded in l around 0 50.4%
unpow250.4%
times-frac50.4%
Simplified50.4%
Taylor expanded in F around inf 99.7%
if -5.00000000000000024e25 < (*.f64 (PI.f64) l) < 1e13Initial program 85.6%
Taylor expanded in l around 0 86.4%
unpow286.4%
times-frac99.1%
Simplified99.1%
Taylor expanded in l around 0 85.1%
unpow285.1%
Simplified85.1%
Final simplification91.8%
(FPCore (F l)
:precision binary64
(if (<= F 2.3e-164)
(/ (* PI (/ (- l) F)) F)
(if (or (<= F 2.3e-87) (not (<= F 1.05e-37)))
(* PI l)
(* l (/ (- PI) (* F F))))))
double code(double F, double l) {
double tmp;
if (F <= 2.3e-164) {
tmp = (((double) M_PI) * (-l / F)) / F;
} else if ((F <= 2.3e-87) || !(F <= 1.05e-37)) {
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 <= 2.3e-164) {
tmp = (Math.PI * (-l / F)) / F;
} else if ((F <= 2.3e-87) || !(F <= 1.05e-37)) {
tmp = Math.PI * l;
} else {
tmp = l * (-Math.PI / (F * F));
}
return tmp;
}
def code(F, l): tmp = 0 if F <= 2.3e-164: tmp = (math.pi * (-l / F)) / F elif (F <= 2.3e-87) or not (F <= 1.05e-37): tmp = math.pi * l else: tmp = l * (-math.pi / (F * F)) return tmp
function code(F, l) tmp = 0.0 if (F <= 2.3e-164) tmp = Float64(Float64(pi * Float64(Float64(-l) / F)) / F); elseif ((F <= 2.3e-87) || !(F <= 1.05e-37)) tmp = Float64(pi * l); else tmp = Float64(l * Float64(Float64(-pi) / Float64(F * F))); end return tmp end
function tmp_2 = code(F, l) tmp = 0.0; if (F <= 2.3e-164) tmp = (pi * (-l / F)) / F; elseif ((F <= 2.3e-87) || ~((F <= 1.05e-37))) tmp = pi * l; else tmp = l * (-pi / (F * F)); end tmp_2 = tmp; end
code[F_, l_] := If[LessEqual[F, 2.3e-164], N[(N[(Pi * N[((-l) / F), $MachinePrecision]), $MachinePrecision] / F), $MachinePrecision], If[Or[LessEqual[F, 2.3e-87], N[Not[LessEqual[F, 1.05e-37]], $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 2.3 \cdot 10^{-164}:\\
\;\;\;\;\frac{\pi \cdot \frac{-\ell}{F}}{F}\\
\mathbf{elif}\;F \leq 2.3 \cdot 10^{-87} \lor \neg \left(F \leq 1.05 \cdot 10^{-37}\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\ell \cdot \frac{-\pi}{F \cdot F}\\
\end{array}
\end{array}
if F < 2.29999999999999985e-164Initial program 66.7%
associate-*l/67.8%
*-un-lft-identity67.8%
associate-/r*79.0%
Applied egg-rr79.0%
Taylor expanded in l around 0 74.0%
Taylor expanded in F around 0 26.0%
mul-1-neg26.0%
unpow226.0%
associate-*l/26.0%
*-commutative26.0%
Simplified26.0%
associate-/r*37.3%
frac-2neg37.3%
un-div-inv37.2%
clear-num37.2%
div-inv37.3%
associate-/l*37.2%
un-div-inv37.3%
frac-2neg37.3%
Applied egg-rr37.3%
if 2.29999999999999985e-164 < F < 2.3000000000000001e-87 or 1.05e-37 < F Initial program 89.2%
Taylor expanded in l around 0 81.5%
unpow281.5%
times-frac82.1%
Simplified82.1%
Taylor expanded in F around inf 88.5%
if 2.3000000000000001e-87 < F < 1.05e-37Initial program 99.7%
associate-*l/99.7%
*-un-lft-identity99.7%
associate-/r*99.4%
Applied egg-rr99.4%
Taylor expanded in l around 0 69.6%
Taylor expanded in F around 0 69.9%
mul-1-neg69.9%
unpow269.9%
associate-*l/69.8%
*-commutative69.8%
Simplified69.8%
Taylor expanded in l around 0 69.9%
unpow269.9%
associate-*r/69.8%
Simplified69.8%
Final simplification57.6%
(FPCore (F l)
:precision binary64
(if (<= F 1.05e-164)
(* (/ l F) (/ PI (- F)))
(if (or (<= F 1.1e-85) (not (<= F 7e-38)))
(* PI l)
(* l (/ (- PI) (* F F))))))
double code(double F, double l) {
double tmp;
if (F <= 1.05e-164) {
tmp = (l / F) * (((double) M_PI) / -F);
} else if ((F <= 1.1e-85) || !(F <= 7e-38)) {
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 <= 1.05e-164) {
tmp = (l / F) * (Math.PI / -F);
} else if ((F <= 1.1e-85) || !(F <= 7e-38)) {
tmp = Math.PI * l;
} else {
tmp = l * (-Math.PI / (F * F));
}
return tmp;
}
def code(F, l): tmp = 0 if F <= 1.05e-164: tmp = (l / F) * (math.pi / -F) elif (F <= 1.1e-85) or not (F <= 7e-38): tmp = math.pi * l else: tmp = l * (-math.pi / (F * F)) return tmp
function code(F, l) tmp = 0.0 if (F <= 1.05e-164) tmp = Float64(Float64(l / F) * Float64(pi / Float64(-F))); elseif ((F <= 1.1e-85) || !(F <= 7e-38)) tmp = Float64(pi * l); else tmp = Float64(l * Float64(Float64(-pi) / Float64(F * F))); end return tmp end
function tmp_2 = code(F, l) tmp = 0.0; if (F <= 1.05e-164) tmp = (l / F) * (pi / -F); elseif ((F <= 1.1e-85) || ~((F <= 7e-38))) tmp = pi * l; else tmp = l * (-pi / (F * F)); end tmp_2 = tmp; end
code[F_, l_] := If[LessEqual[F, 1.05e-164], N[(N[(l / F), $MachinePrecision] * N[(Pi / (-F)), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[F, 1.1e-85], N[Not[LessEqual[F, 7e-38]], $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 1.05 \cdot 10^{-164}:\\
\;\;\;\;\frac{\ell}{F} \cdot \frac{\pi}{-F}\\
\mathbf{elif}\;F \leq 1.1 \cdot 10^{-85} \lor \neg \left(F \leq 7 \cdot 10^{-38}\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\ell \cdot \frac{-\pi}{F \cdot F}\\
\end{array}
\end{array}
if F < 1.04999999999999995e-164Initial program 66.7%
Taylor expanded in l around 0 62.7%
unpow262.7%
times-frac74.0%
Simplified74.0%
Taylor expanded in F around 0 26.0%
mul-1-neg26.0%
*-commutative26.0%
unpow226.0%
times-frac37.3%
distribute-lft-neg-out37.3%
neg-mul-137.3%
metadata-eval37.3%
times-frac37.3%
*-lft-identity37.3%
neg-mul-137.3%
Simplified37.3%
if 1.04999999999999995e-164 < F < 1.1e-85 or 7.0000000000000003e-38 < F Initial program 89.2%
Taylor expanded in l around 0 81.5%
unpow281.5%
times-frac82.1%
Simplified82.1%
Taylor expanded in F around inf 88.5%
if 1.1e-85 < F < 7.0000000000000003e-38Initial program 99.7%
associate-*l/99.7%
*-un-lft-identity99.7%
associate-/r*99.4%
Applied egg-rr99.4%
Taylor expanded in l around 0 69.6%
Taylor expanded in F around 0 69.9%
mul-1-neg69.9%
unpow269.9%
associate-*l/69.8%
*-commutative69.8%
Simplified69.8%
Taylor expanded in l around 0 69.9%
unpow269.9%
associate-*r/69.8%
Simplified69.8%
Final simplification57.6%
(FPCore (F l)
:precision binary64
(if (<= F 1.2e-164)
(* (/ l F) (/ PI (- F)))
(if (or (<= F 9.5e-84) (not (<= F 9.5e-38)))
(* PI l)
(/ (/ l (/ F PI)) (- F)))))
double code(double F, double l) {
double tmp;
if (F <= 1.2e-164) {
tmp = (l / F) * (((double) M_PI) / -F);
} else if ((F <= 9.5e-84) || !(F <= 9.5e-38)) {
tmp = ((double) M_PI) * l;
} else {
tmp = (l / (F / ((double) M_PI))) / -F;
}
return tmp;
}
public static double code(double F, double l) {
double tmp;
if (F <= 1.2e-164) {
tmp = (l / F) * (Math.PI / -F);
} else if ((F <= 9.5e-84) || !(F <= 9.5e-38)) {
tmp = Math.PI * l;
} else {
tmp = (l / (F / Math.PI)) / -F;
}
return tmp;
}
def code(F, l): tmp = 0 if F <= 1.2e-164: tmp = (l / F) * (math.pi / -F) elif (F <= 9.5e-84) or not (F <= 9.5e-38): tmp = math.pi * l else: tmp = (l / (F / math.pi)) / -F return tmp
function code(F, l) tmp = 0.0 if (F <= 1.2e-164) tmp = Float64(Float64(l / F) * Float64(pi / Float64(-F))); elseif ((F <= 9.5e-84) || !(F <= 9.5e-38)) tmp = Float64(pi * l); else tmp = Float64(Float64(l / Float64(F / pi)) / Float64(-F)); end return tmp end
function tmp_2 = code(F, l) tmp = 0.0; if (F <= 1.2e-164) tmp = (l / F) * (pi / -F); elseif ((F <= 9.5e-84) || ~((F <= 9.5e-38))) tmp = pi * l; else tmp = (l / (F / pi)) / -F; end tmp_2 = tmp; end
code[F_, l_] := If[LessEqual[F, 1.2e-164], N[(N[(l / F), $MachinePrecision] * N[(Pi / (-F)), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[F, 9.5e-84], N[Not[LessEqual[F, 9.5e-38]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[(N[(l / N[(F / Pi), $MachinePrecision]), $MachinePrecision] / (-F)), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq 1.2 \cdot 10^{-164}:\\
\;\;\;\;\frac{\ell}{F} \cdot \frac{\pi}{-F}\\
\mathbf{elif}\;F \leq 9.5 \cdot 10^{-84} \lor \neg \left(F \leq 9.5 \cdot 10^{-38}\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\ell}{\frac{F}{\pi}}}{-F}\\
\end{array}
\end{array}
if F < 1.19999999999999992e-164Initial program 66.7%
Taylor expanded in l around 0 62.7%
unpow262.7%
times-frac74.0%
Simplified74.0%
Taylor expanded in F around 0 26.0%
mul-1-neg26.0%
*-commutative26.0%
unpow226.0%
times-frac37.3%
distribute-lft-neg-out37.3%
neg-mul-137.3%
metadata-eval37.3%
times-frac37.3%
*-lft-identity37.3%
neg-mul-137.3%
Simplified37.3%
if 1.19999999999999992e-164 < F < 9.49999999999999941e-84 or 9.5000000000000009e-38 < F Initial program 89.2%
Taylor expanded in l around 0 81.5%
unpow281.5%
times-frac82.1%
Simplified82.1%
Taylor expanded in F around inf 88.5%
if 9.49999999999999941e-84 < F < 9.5000000000000009e-38Initial program 99.7%
Taylor expanded in l around 0 69.9%
unpow269.9%
times-frac69.8%
Simplified69.8%
Taylor expanded in F around 0 69.9%
unpow269.9%
associate-/l/69.6%
frac-2neg69.6%
distribute-frac-neg69.6%
associate-*l/69.8%
*-commutative69.8%
Applied egg-rr69.8%
frac-2neg69.8%
un-div-inv69.8%
*-commutative69.8%
un-div-inv69.8%
frac-2neg69.8%
associate-/r/69.6%
Applied egg-rr69.6%
Final simplification57.6%
(FPCore (F l) :precision binary64 (if (or (<= F 3.3e-82) (not (<= F 5e-38))) (* PI l) (* l (/ (- PI) (* F F)))))
double code(double F, double l) {
double tmp;
if ((F <= 3.3e-82) || !(F <= 5e-38)) {
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.3e-82) || !(F <= 5e-38)) {
tmp = Math.PI * l;
} else {
tmp = l * (-Math.PI / (F * F));
}
return tmp;
}
def code(F, l): tmp = 0 if (F <= 3.3e-82) or not (F <= 5e-38): tmp = math.pi * l else: tmp = l * (-math.pi / (F * F)) return tmp
function code(F, l) tmp = 0.0 if ((F <= 3.3e-82) || !(F <= 5e-38)) tmp = Float64(pi * l); else tmp = Float64(l * Float64(Float64(-pi) / Float64(F * F))); end return tmp end
function tmp_2 = code(F, l) tmp = 0.0; if ((F <= 3.3e-82) || ~((F <= 5e-38))) tmp = pi * l; else tmp = l * (-pi / (F * F)); end tmp_2 = tmp; end
code[F_, l_] := If[Or[LessEqual[F, 3.3e-82], N[Not[LessEqual[F, 5e-38]], $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.3 \cdot 10^{-82} \lor \neg \left(F \leq 5 \cdot 10^{-38}\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\ell \cdot \frac{-\pi}{F \cdot F}\\
\end{array}
\end{array}
if F < 3.30000000000000022e-82 or 5.00000000000000033e-38 < F Initial program 75.4%
Taylor expanded in l around 0 70.0%
unpow270.0%
times-frac77.1%
Simplified77.1%
Taylor expanded in F around inf 73.4%
if 3.30000000000000022e-82 < F < 5.00000000000000033e-38Initial program 99.7%
associate-*l/99.7%
*-un-lft-identity99.7%
associate-/r*99.4%
Applied egg-rr99.4%
Taylor expanded in l around 0 69.6%
Taylor expanded in F around 0 69.9%
mul-1-neg69.9%
unpow269.9%
associate-*l/69.8%
*-commutative69.8%
Simplified69.8%
Taylor expanded in l around 0 69.9%
unpow269.9%
associate-*r/69.8%
Simplified69.8%
Final simplification73.3%
(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 76.3%
Taylor expanded in l around 0 70.0%
unpow270.0%
times-frac76.8%
Simplified76.8%
Taylor expanded in F around inf 71.8%
Final simplification71.8%
herbie shell --seed 2023258
(FPCore (F l)
:name "VandenBroeck and Keller, Equation (6)"
:precision binary64
(- (* PI l) (* (/ 1.0 (* F F)) (tan (* PI l)))))