
(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 11 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}
NOTE: F should be positive before calling this function (FPCore (F l) :precision binary64 (if (or (<= (* PI l) -2e+31) (not (<= (* PI l) 1000000000000.0))) (* PI l) (- (* PI l) (/ (/ (/ (tan (* PI l)) F) (sqrt F)) (sqrt F)))))
F = abs(F);
double code(double F, double l) {
double tmp;
if (((((double) M_PI) * l) <= -2e+31) || !((((double) M_PI) * l) <= 1000000000000.0)) {
tmp = ((double) M_PI) * l;
} else {
tmp = (((double) M_PI) * l) - (((tan((((double) M_PI) * l)) / F) / sqrt(F)) / sqrt(F));
}
return tmp;
}
F = Math.abs(F);
public static double code(double F, double l) {
double tmp;
if (((Math.PI * l) <= -2e+31) || !((Math.PI * l) <= 1000000000000.0)) {
tmp = Math.PI * l;
} else {
tmp = (Math.PI * l) - (((Math.tan((Math.PI * l)) / F) / Math.sqrt(F)) / Math.sqrt(F));
}
return tmp;
}
F = abs(F) def code(F, l): tmp = 0 if ((math.pi * l) <= -2e+31) or not ((math.pi * l) <= 1000000000000.0): tmp = math.pi * l else: tmp = (math.pi * l) - (((math.tan((math.pi * l)) / F) / math.sqrt(F)) / math.sqrt(F)) return tmp
F = abs(F) function code(F, l) tmp = 0.0 if ((Float64(pi * l) <= -2e+31) || !(Float64(pi * l) <= 1000000000000.0)) tmp = Float64(pi * l); else tmp = Float64(Float64(pi * l) - Float64(Float64(Float64(tan(Float64(pi * l)) / F) / sqrt(F)) / sqrt(F))); end return tmp end
F = abs(F) function tmp_2 = code(F, l) tmp = 0.0; if (((pi * l) <= -2e+31) || ~(((pi * l) <= 1000000000000.0))) tmp = pi * l; else tmp = (pi * l) - (((tan((pi * l)) / F) / sqrt(F)) / sqrt(F)); end tmp_2 = tmp; end
NOTE: F should be positive before calling this function code[F_, l_] := If[Or[LessEqual[N[(Pi * l), $MachinePrecision], -2e+31], N[Not[LessEqual[N[(Pi * l), $MachinePrecision], 1000000000000.0]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[(N[(Pi * l), $MachinePrecision] - N[(N[(N[(N[Tan[N[(Pi * l), $MachinePrecision]], $MachinePrecision] / F), $MachinePrecision] / N[Sqrt[F], $MachinePrecision]), $MachinePrecision] / N[Sqrt[F], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
F = |F|\\
\\
\begin{array}{l}
\mathbf{if}\;\pi \cdot \ell \leq -2 \cdot 10^{+31} \lor \neg \left(\pi \cdot \ell \leq 1000000000000\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\pi \cdot \ell - \frac{\frac{\frac{\tan \left(\pi \cdot \ell\right)}{F}}{\sqrt{F}}}{\sqrt{F}}\\
\end{array}
\end{array}
if (*.f64 (PI.f64) l) < -1.9999999999999999e31 or 1e12 < (*.f64 (PI.f64) l) Initial program 61.7%
associate-*l/61.7%
*-lft-identity61.7%
Simplified61.7%
Taylor expanded in l around 0 45.7%
unpow245.7%
Simplified45.7%
Taylor expanded in F around inf 99.7%
if -1.9999999999999999e31 < (*.f64 (PI.f64) l) < 1e12Initial program 87.9%
associate-*l/89.5%
*-un-lft-identity89.5%
associate-/r*98.7%
add-sqr-sqrt52.7%
associate-/r*52.7%
Applied egg-rr52.7%
Final simplification74.4%
NOTE: F should be positive before calling this function (FPCore (F l) :precision binary64 (if (or (<= (* PI l) -2e+31) (not (<= (* PI l) 1000000000000.0))) (* PI l) (- (* PI l) (/ (/ (tan (* PI l)) F) F))))
F = abs(F);
double code(double F, double l) {
double tmp;
if (((((double) M_PI) * l) <= -2e+31) || !((((double) M_PI) * l) <= 1000000000000.0)) {
tmp = ((double) M_PI) * l;
} else {
tmp = (((double) M_PI) * l) - ((tan((((double) M_PI) * l)) / F) / F);
}
return tmp;
}
F = Math.abs(F);
public static double code(double F, double l) {
double tmp;
if (((Math.PI * l) <= -2e+31) || !((Math.PI * l) <= 1000000000000.0)) {
tmp = Math.PI * l;
} else {
tmp = (Math.PI * l) - ((Math.tan((Math.PI * l)) / F) / F);
}
return tmp;
}
F = abs(F) def code(F, l): tmp = 0 if ((math.pi * l) <= -2e+31) or not ((math.pi * l) <= 1000000000000.0): tmp = math.pi * l else: tmp = (math.pi * l) - ((math.tan((math.pi * l)) / F) / F) return tmp
F = abs(F) function code(F, l) tmp = 0.0 if ((Float64(pi * l) <= -2e+31) || !(Float64(pi * l) <= 1000000000000.0)) tmp = Float64(pi * l); else tmp = Float64(Float64(pi * l) - Float64(Float64(tan(Float64(pi * l)) / F) / F)); end return tmp end
F = abs(F) function tmp_2 = code(F, l) tmp = 0.0; if (((pi * l) <= -2e+31) || ~(((pi * l) <= 1000000000000.0))) tmp = pi * l; else tmp = (pi * l) - ((tan((pi * l)) / F) / F); end tmp_2 = tmp; end
NOTE: F should be positive before calling this function code[F_, l_] := If[Or[LessEqual[N[(Pi * l), $MachinePrecision], -2e+31], N[Not[LessEqual[N[(Pi * l), $MachinePrecision], 1000000000000.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}
F = |F|\\
\\
\begin{array}{l}
\mathbf{if}\;\pi \cdot \ell \leq -2 \cdot 10^{+31} \lor \neg \left(\pi \cdot \ell \leq 1000000000000\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) < -1.9999999999999999e31 or 1e12 < (*.f64 (PI.f64) l) Initial program 61.7%
associate-*l/61.7%
*-lft-identity61.7%
Simplified61.7%
Taylor expanded in l around 0 45.7%
unpow245.7%
Simplified45.7%
Taylor expanded in F around inf 99.7%
if -1.9999999999999999e31 < (*.f64 (PI.f64) l) < 1e12Initial program 87.9%
associate-*l/89.5%
*-un-lft-identity89.5%
associate-/r*98.7%
Applied egg-rr98.7%
Final simplification99.1%
NOTE: F should be positive before calling this function (FPCore (F l) :precision binary64 (if (or (<= (* PI l) -100000000.0) (not (<= (* PI l) 1000000000000.0))) (* PI l) (- (* PI l) (/ (* l (/ PI F)) F))))
F = abs(F);
double code(double F, double l) {
double tmp;
if (((((double) M_PI) * l) <= -100000000.0) || !((((double) M_PI) * l) <= 1000000000000.0)) {
tmp = ((double) M_PI) * l;
} else {
tmp = (((double) M_PI) * l) - ((l * (((double) M_PI) / F)) / F);
}
return tmp;
}
F = Math.abs(F);
public static double code(double F, double l) {
double tmp;
if (((Math.PI * l) <= -100000000.0) || !((Math.PI * l) <= 1000000000000.0)) {
tmp = Math.PI * l;
} else {
tmp = (Math.PI * l) - ((l * (Math.PI / F)) / F);
}
return tmp;
}
F = abs(F) def code(F, l): tmp = 0 if ((math.pi * l) <= -100000000.0) or not ((math.pi * l) <= 1000000000000.0): tmp = math.pi * l else: tmp = (math.pi * l) - ((l * (math.pi / F)) / F) return tmp
F = abs(F) function code(F, l) tmp = 0.0 if ((Float64(pi * l) <= -100000000.0) || !(Float64(pi * l) <= 1000000000000.0)) tmp = Float64(pi * l); else tmp = Float64(Float64(pi * l) - Float64(Float64(l * Float64(pi / F)) / F)); end return tmp end
F = abs(F) function tmp_2 = code(F, l) tmp = 0.0; if (((pi * l) <= -100000000.0) || ~(((pi * l) <= 1000000000000.0))) tmp = pi * l; else tmp = (pi * l) - ((l * (pi / F)) / F); end tmp_2 = tmp; end
NOTE: F should be positive before calling this function code[F_, l_] := If[Or[LessEqual[N[(Pi * l), $MachinePrecision], -100000000.0], N[Not[LessEqual[N[(Pi * l), $MachinePrecision], 1000000000000.0]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[(N[(Pi * l), $MachinePrecision] - N[(N[(l * N[(Pi / F), $MachinePrecision]), $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
F = |F|\\
\\
\begin{array}{l}
\mathbf{if}\;\pi \cdot \ell \leq -100000000 \lor \neg \left(\pi \cdot \ell \leq 1000000000000\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\pi \cdot \ell - \frac{\ell \cdot \frac{\pi}{F}}{F}\\
\end{array}
\end{array}
if (*.f64 (PI.f64) l) < -1e8 or 1e12 < (*.f64 (PI.f64) l) Initial program 62.1%
associate-*l/62.1%
*-lft-identity62.1%
Simplified62.1%
Taylor expanded in l around 0 45.8%
unpow245.8%
Simplified45.8%
Taylor expanded in F around inf 98.9%
if -1e8 < (*.f64 (PI.f64) l) < 1e12Initial program 88.0%
associate-*l/89.7%
*-un-lft-identity89.7%
associate-/r*98.9%
Applied egg-rr98.9%
Taylor expanded in l around 0 97.2%
associate-/l*97.1%
Simplified97.1%
clear-num97.1%
associate-/r/97.1%
clear-num97.2%
Applied egg-rr97.2%
Final simplification98.0%
NOTE: F should be positive before calling this function (FPCore (F l) :precision binary64 (if (or (<= l -44000000.0) (not (<= l 45000000000000.0))) (* PI l) (- (* PI l) (* PI (/ l (* F F))))))
F = abs(F);
double code(double F, double l) {
double tmp;
if ((l <= -44000000.0) || !(l <= 45000000000000.0)) {
tmp = ((double) M_PI) * l;
} else {
tmp = (((double) M_PI) * l) - (((double) M_PI) * (l / (F * F)));
}
return tmp;
}
F = Math.abs(F);
public static double code(double F, double l) {
double tmp;
if ((l <= -44000000.0) || !(l <= 45000000000000.0)) {
tmp = Math.PI * l;
} else {
tmp = (Math.PI * l) - (Math.PI * (l / (F * F)));
}
return tmp;
}
F = abs(F) def code(F, l): tmp = 0 if (l <= -44000000.0) or not (l <= 45000000000000.0): tmp = math.pi * l else: tmp = (math.pi * l) - (math.pi * (l / (F * F))) return tmp
F = abs(F) function code(F, l) tmp = 0.0 if ((l <= -44000000.0) || !(l <= 45000000000000.0)) tmp = Float64(pi * l); else tmp = Float64(Float64(pi * l) - Float64(pi * Float64(l / Float64(F * F)))); end return tmp end
F = abs(F) function tmp_2 = code(F, l) tmp = 0.0; if ((l <= -44000000.0) || ~((l <= 45000000000000.0))) tmp = pi * l; else tmp = (pi * l) - (pi * (l / (F * F))); end tmp_2 = tmp; end
NOTE: F should be positive before calling this function code[F_, l_] := If[Or[LessEqual[l, -44000000.0], N[Not[LessEqual[l, 45000000000000.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}
F = |F|\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -44000000 \lor \neg \left(\ell \leq 45000000000000\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\pi \cdot \ell - \pi \cdot \frac{\ell}{F \cdot F}\\
\end{array}
\end{array}
if l < -4.4e7 or 4.5e13 < l Initial program 62.1%
associate-*l/62.1%
*-lft-identity62.1%
Simplified62.1%
Taylor expanded in l around 0 45.8%
unpow245.8%
Simplified45.8%
Taylor expanded in F around inf 98.9%
if -4.4e7 < l < 4.5e13Initial program 88.0%
Taylor expanded in l around 0 87.9%
associate-/l*87.8%
associate-/r/87.9%
unpow287.9%
Simplified87.9%
Final simplification93.0%
NOTE: F should be positive before calling this function (FPCore (F l) :precision binary64 (if (or (<= l -44000000.0) (not (<= l 45000000000000.0))) (* PI l) (- (* PI l) (/ (* PI l) (* F F)))))
F = abs(F);
double code(double F, double l) {
double tmp;
if ((l <= -44000000.0) || !(l <= 45000000000000.0)) {
tmp = ((double) M_PI) * l;
} else {
tmp = (((double) M_PI) * l) - ((((double) M_PI) * l) / (F * F));
}
return tmp;
}
F = Math.abs(F);
public static double code(double F, double l) {
double tmp;
if ((l <= -44000000.0) || !(l <= 45000000000000.0)) {
tmp = Math.PI * l;
} else {
tmp = (Math.PI * l) - ((Math.PI * l) / (F * F));
}
return tmp;
}
F = abs(F) def code(F, l): tmp = 0 if (l <= -44000000.0) or not (l <= 45000000000000.0): tmp = math.pi * l else: tmp = (math.pi * l) - ((math.pi * l) / (F * F)) return tmp
F = abs(F) function code(F, l) tmp = 0.0 if ((l <= -44000000.0) || !(l <= 45000000000000.0)) tmp = Float64(pi * l); else tmp = Float64(Float64(pi * l) - Float64(Float64(pi * l) / Float64(F * F))); end return tmp end
F = abs(F) function tmp_2 = code(F, l) tmp = 0.0; if ((l <= -44000000.0) || ~((l <= 45000000000000.0))) tmp = pi * l; else tmp = (pi * l) - ((pi * l) / (F * F)); end tmp_2 = tmp; end
NOTE: F should be positive before calling this function code[F_, l_] := If[Or[LessEqual[l, -44000000.0], N[Not[LessEqual[l, 45000000000000.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}
F = |F|\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -44000000 \lor \neg \left(\ell \leq 45000000000000\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\pi \cdot \ell - \frac{\pi \cdot \ell}{F \cdot F}\\
\end{array}
\end{array}
if l < -4.4e7 or 4.5e13 < l Initial program 62.1%
associate-*l/62.1%
*-lft-identity62.1%
Simplified62.1%
Taylor expanded in l around 0 45.8%
unpow245.8%
Simplified45.8%
Taylor expanded in F around inf 98.9%
if -4.4e7 < l < 4.5e13Initial program 88.0%
associate-*l/89.7%
*-lft-identity89.7%
Simplified89.7%
Taylor expanded in l around 0 87.9%
Final simplification93.1%
NOTE: F should be positive before calling this function (FPCore (F l) :precision binary64 (if (or (<= l -44000000.0) (not (<= l 45000000000000.0))) (* PI l) (- (* PI l) (/ (* PI (/ l F)) F))))
F = abs(F);
double code(double F, double l) {
double tmp;
if ((l <= -44000000.0) || !(l <= 45000000000000.0)) {
tmp = ((double) M_PI) * l;
} else {
tmp = (((double) M_PI) * l) - ((((double) M_PI) * (l / F)) / F);
}
return tmp;
}
F = Math.abs(F);
public static double code(double F, double l) {
double tmp;
if ((l <= -44000000.0) || !(l <= 45000000000000.0)) {
tmp = Math.PI * l;
} else {
tmp = (Math.PI * l) - ((Math.PI * (l / F)) / F);
}
return tmp;
}
F = abs(F) def code(F, l): tmp = 0 if (l <= -44000000.0) or not (l <= 45000000000000.0): tmp = math.pi * l else: tmp = (math.pi * l) - ((math.pi * (l / F)) / F) return tmp
F = abs(F) function code(F, l) tmp = 0.0 if ((l <= -44000000.0) || !(l <= 45000000000000.0)) tmp = Float64(pi * l); else tmp = Float64(Float64(pi * l) - Float64(Float64(pi * Float64(l / F)) / F)); end return tmp end
F = abs(F) function tmp_2 = code(F, l) tmp = 0.0; if ((l <= -44000000.0) || ~((l <= 45000000000000.0))) tmp = pi * l; else tmp = (pi * l) - ((pi * (l / F)) / F); end tmp_2 = tmp; end
NOTE: F should be positive before calling this function code[F_, l_] := If[Or[LessEqual[l, -44000000.0], N[Not[LessEqual[l, 45000000000000.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}
F = |F|\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -44000000 \lor \neg \left(\ell \leq 45000000000000\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\pi \cdot \ell - \frac{\pi \cdot \frac{\ell}{F}}{F}\\
\end{array}
\end{array}
if l < -4.4e7 or 4.5e13 < l Initial program 62.1%
associate-*l/62.1%
*-lft-identity62.1%
Simplified62.1%
Taylor expanded in l around 0 45.8%
unpow245.8%
Simplified45.8%
Taylor expanded in F around inf 98.9%
if -4.4e7 < l < 4.5e13Initial program 88.0%
associate-*l/89.7%
*-un-lft-identity89.7%
associate-/r*98.9%
Applied egg-rr98.9%
Taylor expanded in l around 0 97.2%
associate-/l*97.1%
associate-/r/97.1%
Simplified97.1%
Final simplification98.0%
NOTE: F should be positive before calling this function (FPCore (F l) :precision binary64 (if (or (<= l -44000000.0) (not (<= l 45000000000000.0))) (* PI l) (* l (* PI (- 1.0 (pow F -2.0))))))
F = abs(F);
double code(double F, double l) {
double tmp;
if ((l <= -44000000.0) || !(l <= 45000000000000.0)) {
tmp = ((double) M_PI) * l;
} else {
tmp = l * (((double) M_PI) * (1.0 - pow(F, -2.0)));
}
return tmp;
}
F = Math.abs(F);
public static double code(double F, double l) {
double tmp;
if ((l <= -44000000.0) || !(l <= 45000000000000.0)) {
tmp = Math.PI * l;
} else {
tmp = l * (Math.PI * (1.0 - Math.pow(F, -2.0)));
}
return tmp;
}
F = abs(F) def code(F, l): tmp = 0 if (l <= -44000000.0) or not (l <= 45000000000000.0): tmp = math.pi * l else: tmp = l * (math.pi * (1.0 - math.pow(F, -2.0))) return tmp
F = abs(F) function code(F, l) tmp = 0.0 if ((l <= -44000000.0) || !(l <= 45000000000000.0)) tmp = Float64(pi * l); else tmp = Float64(l * Float64(pi * Float64(1.0 - (F ^ -2.0)))); end return tmp end
F = abs(F) function tmp_2 = code(F, l) tmp = 0.0; if ((l <= -44000000.0) || ~((l <= 45000000000000.0))) tmp = pi * l; else tmp = l * (pi * (1.0 - (F ^ -2.0))); end tmp_2 = tmp; end
NOTE: F should be positive before calling this function code[F_, l_] := If[Or[LessEqual[l, -44000000.0], N[Not[LessEqual[l, 45000000000000.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}
F = |F|\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -44000000 \lor \neg \left(\ell \leq 45000000000000\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\ell \cdot \left(\pi \cdot \left(1 - {F}^{-2}\right)\right)\\
\end{array}
\end{array}
if l < -4.4e7 or 4.5e13 < l Initial program 62.1%
associate-*l/62.1%
*-lft-identity62.1%
Simplified62.1%
Taylor expanded in l around 0 45.8%
unpow245.8%
Simplified45.8%
Taylor expanded in F around inf 98.9%
if -4.4e7 < l < 4.5e13Initial program 88.0%
associate-*l/89.7%
*-lft-identity89.7%
Simplified89.7%
Taylor expanded in l around 0 86.3%
unpow286.3%
Simplified86.3%
sub-neg86.3%
distribute-lft-in86.3%
*-commutative86.3%
div-inv86.3%
pow286.3%
pow-flip86.3%
metadata-eval86.3%
distribute-rgt-neg-in86.3%
Applied egg-rr86.3%
*-commutative86.3%
distribute-lft-in86.3%
distribute-rgt-neg-out86.3%
sub-neg86.3%
*-rgt-identity86.3%
distribute-lft-out--86.3%
Simplified86.3%
Final simplification92.2%
NOTE: F should be positive before calling this function
(FPCore (F l)
:precision binary64
(if (<= (* F F) 2.5e-299)
(* (/ PI F) (/ (- l) F))
(if (or (<= (* F F) 1e-257) (not (<= (* F F) 1e-205)))
(* PI l)
(* (/ l (* F F)) (- PI)))))F = abs(F);
double code(double F, double l) {
double tmp;
if ((F * F) <= 2.5e-299) {
tmp = (((double) M_PI) / F) * (-l / F);
} else if (((F * F) <= 1e-257) || !((F * F) <= 1e-205)) {
tmp = ((double) M_PI) * l;
} else {
tmp = (l / (F * F)) * -((double) M_PI);
}
return tmp;
}
F = Math.abs(F);
public static double code(double F, double l) {
double tmp;
if ((F * F) <= 2.5e-299) {
tmp = (Math.PI / F) * (-l / F);
} else if (((F * F) <= 1e-257) || !((F * F) <= 1e-205)) {
tmp = Math.PI * l;
} else {
tmp = (l / (F * F)) * -Math.PI;
}
return tmp;
}
F = abs(F) def code(F, l): tmp = 0 if (F * F) <= 2.5e-299: tmp = (math.pi / F) * (-l / F) elif ((F * F) <= 1e-257) or not ((F * F) <= 1e-205): tmp = math.pi * l else: tmp = (l / (F * F)) * -math.pi return tmp
F = abs(F) function code(F, l) tmp = 0.0 if (Float64(F * F) <= 2.5e-299) tmp = Float64(Float64(pi / F) * Float64(Float64(-l) / F)); elseif ((Float64(F * F) <= 1e-257) || !(Float64(F * F) <= 1e-205)) tmp = Float64(pi * l); else tmp = Float64(Float64(l / Float64(F * F)) * Float64(-pi)); end return tmp end
F = abs(F) function tmp_2 = code(F, l) tmp = 0.0; if ((F * F) <= 2.5e-299) tmp = (pi / F) * (-l / F); elseif (((F * F) <= 1e-257) || ~(((F * F) <= 1e-205))) tmp = pi * l; else tmp = (l / (F * F)) * -pi; end tmp_2 = tmp; end
NOTE: F should be positive before calling this function code[F_, l_] := If[LessEqual[N[(F * F), $MachinePrecision], 2.5e-299], N[(N[(Pi / F), $MachinePrecision] * N[((-l) / F), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[N[(F * F), $MachinePrecision], 1e-257], N[Not[LessEqual[N[(F * F), $MachinePrecision], 1e-205]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[(N[(l / N[(F * F), $MachinePrecision]), $MachinePrecision] * (-Pi)), $MachinePrecision]]]
\begin{array}{l}
F = |F|\\
\\
\begin{array}{l}
\mathbf{if}\;F \cdot F \leq 2.5 \cdot 10^{-299}:\\
\;\;\;\;\frac{\pi}{F} \cdot \frac{-\ell}{F}\\
\mathbf{elif}\;F \cdot F \leq 10^{-257} \lor \neg \left(F \cdot F \leq 10^{-205}\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\frac{\ell}{F \cdot F} \cdot \left(-\pi\right)\\
\end{array}
\end{array}
if (*.f64 F F) < 2.49999999999999978e-299Initial program 40.0%
associate-*l/43.0%
*-lft-identity43.0%
Simplified43.0%
Taylor expanded in l around 0 37.7%
unpow237.7%
Simplified37.7%
Taylor expanded in F around 0 40.7%
mul-1-neg40.7%
associate-/l*40.5%
unpow240.5%
Simplified40.5%
associate-/l*40.5%
associate-/r/58.2%
Applied egg-rr58.2%
if 2.49999999999999978e-299 < (*.f64 F F) < 9.9999999999999998e-258 or 1e-205 < (*.f64 F F) Initial program 90.9%
associate-*l/90.9%
*-lft-identity90.9%
Simplified90.9%
Taylor expanded in l around 0 79.4%
unpow279.4%
Simplified79.4%
Taylor expanded in F around inf 86.9%
if 9.9999999999999998e-258 < (*.f64 F F) < 1e-205Initial program 72.8%
associate-*l/72.8%
*-lft-identity72.8%
Simplified72.8%
Taylor expanded in l around 0 70.6%
unpow270.6%
Simplified70.6%
Taylor expanded in F around 0 70.6%
mul-1-neg70.6%
associate-/l*70.9%
unpow270.9%
Simplified70.9%
associate-/r/70.7%
Applied egg-rr70.7%
Final simplification78.2%
NOTE: F should be positive before calling this function
(FPCore (F l)
:precision binary64
(if (<= (* F F) 2.5e-299)
(* (/ PI F) (/ (- l) F))
(if (or (<= (* F F) 1e-257) (not (<= (* F F) 1e-205)))
(* PI l)
(/ (- l) (/ (* F F) PI)))))F = abs(F);
double code(double F, double l) {
double tmp;
if ((F * F) <= 2.5e-299) {
tmp = (((double) M_PI) / F) * (-l / F);
} else if (((F * F) <= 1e-257) || !((F * F) <= 1e-205)) {
tmp = ((double) M_PI) * l;
} else {
tmp = -l / ((F * F) / ((double) M_PI));
}
return tmp;
}
F = Math.abs(F);
public static double code(double F, double l) {
double tmp;
if ((F * F) <= 2.5e-299) {
tmp = (Math.PI / F) * (-l / F);
} else if (((F * F) <= 1e-257) || !((F * F) <= 1e-205)) {
tmp = Math.PI * l;
} else {
tmp = -l / ((F * F) / Math.PI);
}
return tmp;
}
F = abs(F) def code(F, l): tmp = 0 if (F * F) <= 2.5e-299: tmp = (math.pi / F) * (-l / F) elif ((F * F) <= 1e-257) or not ((F * F) <= 1e-205): tmp = math.pi * l else: tmp = -l / ((F * F) / math.pi) return tmp
F = abs(F) function code(F, l) tmp = 0.0 if (Float64(F * F) <= 2.5e-299) tmp = Float64(Float64(pi / F) * Float64(Float64(-l) / F)); elseif ((Float64(F * F) <= 1e-257) || !(Float64(F * F) <= 1e-205)) tmp = Float64(pi * l); else tmp = Float64(Float64(-l) / Float64(Float64(F * F) / pi)); end return tmp end
F = abs(F) function tmp_2 = code(F, l) tmp = 0.0; if ((F * F) <= 2.5e-299) tmp = (pi / F) * (-l / F); elseif (((F * F) <= 1e-257) || ~(((F * F) <= 1e-205))) tmp = pi * l; else tmp = -l / ((F * F) / pi); end tmp_2 = tmp; end
NOTE: F should be positive before calling this function code[F_, l_] := If[LessEqual[N[(F * F), $MachinePrecision], 2.5e-299], N[(N[(Pi / F), $MachinePrecision] * N[((-l) / F), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[N[(F * F), $MachinePrecision], 1e-257], N[Not[LessEqual[N[(F * F), $MachinePrecision], 1e-205]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[((-l) / N[(N[(F * F), $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
F = |F|\\
\\
\begin{array}{l}
\mathbf{if}\;F \cdot F \leq 2.5 \cdot 10^{-299}:\\
\;\;\;\;\frac{\pi}{F} \cdot \frac{-\ell}{F}\\
\mathbf{elif}\;F \cdot F \leq 10^{-257} \lor \neg \left(F \cdot F \leq 10^{-205}\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\frac{-\ell}{\frac{F \cdot F}{\pi}}\\
\end{array}
\end{array}
if (*.f64 F F) < 2.49999999999999978e-299Initial program 40.0%
associate-*l/43.0%
*-lft-identity43.0%
Simplified43.0%
Taylor expanded in l around 0 37.7%
unpow237.7%
Simplified37.7%
Taylor expanded in F around 0 40.7%
mul-1-neg40.7%
associate-/l*40.5%
unpow240.5%
Simplified40.5%
associate-/l*40.5%
associate-/r/58.2%
Applied egg-rr58.2%
if 2.49999999999999978e-299 < (*.f64 F F) < 9.9999999999999998e-258 or 1e-205 < (*.f64 F F) Initial program 90.9%
associate-*l/90.9%
*-lft-identity90.9%
Simplified90.9%
Taylor expanded in l around 0 79.4%
unpow279.4%
Simplified79.4%
Taylor expanded in F around inf 86.9%
if 9.9999999999999998e-258 < (*.f64 F F) < 1e-205Initial program 72.8%
associate-*l/72.8%
*-lft-identity72.8%
Simplified72.8%
Taylor expanded in l around 0 70.6%
unpow270.6%
Simplified70.6%
Taylor expanded in F around 0 70.6%
mul-1-neg70.6%
associate-/l*70.9%
unpow270.9%
Simplified70.9%
Final simplification78.2%
NOTE: F should be positive before calling this function
(FPCore (F l)
:precision binary64
(if (or (<= F 2.7e-232)
(and (not (<= F 1.05e-161))
(or (<= F 4.8e-150)
(and (not (<= F 9.2e-128)) (<= F 1.25e-102)))))
(* (/ PI F) (/ (- l) F))
(* PI l)))F = abs(F);
double code(double F, double l) {
double tmp;
if ((F <= 2.7e-232) || (!(F <= 1.05e-161) && ((F <= 4.8e-150) || (!(F <= 9.2e-128) && (F <= 1.25e-102))))) {
tmp = (((double) M_PI) / F) * (-l / F);
} else {
tmp = ((double) M_PI) * l;
}
return tmp;
}
F = Math.abs(F);
public static double code(double F, double l) {
double tmp;
if ((F <= 2.7e-232) || (!(F <= 1.05e-161) && ((F <= 4.8e-150) || (!(F <= 9.2e-128) && (F <= 1.25e-102))))) {
tmp = (Math.PI / F) * (-l / F);
} else {
tmp = Math.PI * l;
}
return tmp;
}
F = abs(F) def code(F, l): tmp = 0 if (F <= 2.7e-232) or (not (F <= 1.05e-161) and ((F <= 4.8e-150) or (not (F <= 9.2e-128) and (F <= 1.25e-102)))): tmp = (math.pi / F) * (-l / F) else: tmp = math.pi * l return tmp
F = abs(F) function code(F, l) tmp = 0.0 if ((F <= 2.7e-232) || (!(F <= 1.05e-161) && ((F <= 4.8e-150) || (!(F <= 9.2e-128) && (F <= 1.25e-102))))) tmp = Float64(Float64(pi / F) * Float64(Float64(-l) / F)); else tmp = Float64(pi * l); end return tmp end
F = abs(F) function tmp_2 = code(F, l) tmp = 0.0; if ((F <= 2.7e-232) || (~((F <= 1.05e-161)) && ((F <= 4.8e-150) || (~((F <= 9.2e-128)) && (F <= 1.25e-102))))) tmp = (pi / F) * (-l / F); else tmp = pi * l; end tmp_2 = tmp; end
NOTE: F should be positive before calling this function code[F_, l_] := If[Or[LessEqual[F, 2.7e-232], And[N[Not[LessEqual[F, 1.05e-161]], $MachinePrecision], Or[LessEqual[F, 4.8e-150], And[N[Not[LessEqual[F, 9.2e-128]], $MachinePrecision], LessEqual[F, 1.25e-102]]]]], N[(N[(Pi / F), $MachinePrecision] * N[((-l) / F), $MachinePrecision]), $MachinePrecision], N[(Pi * l), $MachinePrecision]]
\begin{array}{l}
F = |F|\\
\\
\begin{array}{l}
\mathbf{if}\;F \leq 2.7 \cdot 10^{-232} \lor \neg \left(F \leq 1.05 \cdot 10^{-161}\right) \land \left(F \leq 4.8 \cdot 10^{-150} \lor \neg \left(F \leq 9.2 \cdot 10^{-128}\right) \land F \leq 1.25 \cdot 10^{-102}\right):\\
\;\;\;\;\frac{\pi}{F} \cdot \frac{-\ell}{F}\\
\mathbf{else}:\\
\;\;\;\;\pi \cdot \ell\\
\end{array}
\end{array}
if F < 2.6999999999999999e-232 or 1.05e-161 < F < 4.8e-150 or 9.2000000000000003e-128 < F < 1.25000000000000006e-102Initial program 71.6%
associate-*l/73.0%
*-lft-identity73.0%
Simplified73.0%
Taylor expanded in l around 0 62.5%
unpow262.5%
Simplified62.5%
Taylor expanded in F around 0 28.0%
mul-1-neg28.0%
associate-/l*27.9%
unpow227.9%
Simplified27.9%
associate-/l*27.9%
associate-/r/35.1%
Applied egg-rr35.1%
if 2.6999999999999999e-232 < F < 1.05e-161 or 4.8e-150 < F < 9.2000000000000003e-128 or 1.25000000000000006e-102 < F Initial program 82.1%
associate-*l/82.1%
*-lft-identity82.1%
Simplified82.1%
Taylor expanded in l around 0 74.3%
unpow274.3%
Simplified74.3%
Taylor expanded in F around inf 83.9%
Final simplification55.1%
NOTE: F should be positive before calling this function (FPCore (F l) :precision binary64 (* PI l))
F = abs(F);
double code(double F, double l) {
return ((double) M_PI) * l;
}
F = Math.abs(F);
public static double code(double F, double l) {
return Math.PI * l;
}
F = abs(F) def code(F, l): return math.pi * l
F = abs(F) function code(F, l) return Float64(pi * l) end
F = abs(F) function tmp = code(F, l) tmp = pi * l; end
NOTE: F should be positive before calling this function code[F_, l_] := N[(Pi * l), $MachinePrecision]
\begin{array}{l}
F = |F|\\
\\
\pi \cdot \ell
\end{array}
Initial program 75.9%
associate-*l/76.7%
*-lft-identity76.7%
Simplified76.7%
Taylor expanded in l around 0 67.3%
unpow267.3%
Simplified67.3%
Taylor expanded in F around inf 71.4%
Final simplification71.4%
herbie shell --seed 2023257
(FPCore (F l)
:name "VandenBroeck and Keller, Equation (6)"
:precision binary64
(- (* PI l) (* (/ 1.0 (* F F)) (tan (* PI l)))))