
(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) -5e+17) (not (<= (* PI l) 1000000000000.0))) (* PI l) (- (* PI l) (/ (/ (tan (* PI l)) F) F))))
double code(double F, double l) {
double tmp;
if (((((double) M_PI) * l) <= -5e+17) || !((((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;
}
public static double code(double F, double l) {
double tmp;
if (((Math.PI * l) <= -5e+17) || !((Math.PI * l) <= 1000000000000.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+17) 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
function code(F, l) tmp = 0.0 if ((Float64(pi * l) <= -5e+17) || !(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
function tmp_2 = code(F, l) tmp = 0.0; if (((pi * l) <= -5e+17) || ~(((pi * l) <= 1000000000000.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+17], 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}
\\
\begin{array}{l}
\mathbf{if}\;\pi \cdot \ell \leq -5 \cdot 10^{+17} \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) < -5e17 or 1e12 < (*.f64 (PI.f64) l) Initial program 63.6%
associate-*l/63.6%
*-lft-identity63.6%
Simplified63.6%
Taylor expanded in l around 0 52.6%
unpow252.6%
Simplified52.6%
Taylor expanded in F around inf 99.6%
if -5e17 < (*.f64 (PI.f64) l) < 1e12Initial program 93.2%
associate-*l/93.1%
*-un-lft-identity93.1%
associate-/r*98.5%
Applied egg-rr98.5%
Final simplification99.0%
(FPCore (F l) :precision binary64 (if (or (<= (* PI l) -200.0) (not (<= (* PI l) 0.01))) (* PI l) (- (* PI l) (/ (/ l (/ F PI)) F))))
double code(double F, double l) {
double tmp;
if (((((double) M_PI) * l) <= -200.0) || !((((double) M_PI) * l) <= 0.01)) {
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) <= -200.0) || !((Math.PI * l) <= 0.01)) {
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) <= -200.0) or not ((math.pi * l) <= 0.01): 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) <= -200.0) || !(Float64(pi * l) <= 0.01)) 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) <= -200.0) || ~(((pi * l) <= 0.01))) 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], -200.0], N[Not[LessEqual[N[(Pi * l), $MachinePrecision], 0.01]], $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 -200 \lor \neg \left(\pi \cdot \ell \leq 0.01\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) < -200 or 0.0100000000000000002 < (*.f64 (PI.f64) l) Initial program 65.1%
associate-*l/65.1%
*-lft-identity65.1%
Simplified65.1%
Taylor expanded in l around 0 53.6%
unpow253.6%
Simplified53.6%
Taylor expanded in F around inf 97.3%
if -200 < (*.f64 (PI.f64) l) < 0.0100000000000000002Initial program 93.8%
associate-*l/93.8%
*-un-lft-identity93.8%
associate-/r*99.5%
Applied egg-rr99.5%
Taylor expanded in l around 0 99.5%
associate-/l*99.5%
Simplified99.5%
Final simplification98.5%
(FPCore (F l) :precision binary64 (if (or (<= l -2.5) (not (<= l 18.5))) (* PI l) (- (* PI l) (* (/ PI F) (/ l F)))))
double code(double F, double l) {
double tmp;
if ((l <= -2.5) || !(l <= 18.5)) {
tmp = ((double) M_PI) * l;
} else {
tmp = (((double) M_PI) * l) - ((((double) M_PI) / F) * (l / F));
}
return tmp;
}
public static double code(double F, double l) {
double tmp;
if ((l <= -2.5) || !(l <= 18.5)) {
tmp = Math.PI * l;
} else {
tmp = (Math.PI * l) - ((Math.PI / F) * (l / F));
}
return tmp;
}
def code(F, l): tmp = 0 if (l <= -2.5) or not (l <= 18.5): tmp = math.pi * l else: tmp = (math.pi * l) - ((math.pi / F) * (l / F)) return tmp
function code(F, l) tmp = 0.0 if ((l <= -2.5) || !(l <= 18.5)) tmp = Float64(pi * l); else tmp = Float64(Float64(pi * l) - Float64(Float64(pi / F) * Float64(l / F))); end return tmp end
function tmp_2 = code(F, l) tmp = 0.0; if ((l <= -2.5) || ~((l <= 18.5))) tmp = pi * l; else tmp = (pi * l) - ((pi / F) * (l / F)); end tmp_2 = tmp; end
code[F_, l_] := If[Or[LessEqual[l, -2.5], N[Not[LessEqual[l, 18.5]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[(N[(Pi * l), $MachinePrecision] - N[(N[(Pi / F), $MachinePrecision] * N[(l / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -2.5 \lor \neg \left(\ell \leq 18.5\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\pi \cdot \ell - \frac{\pi}{F} \cdot \frac{\ell}{F}\\
\end{array}
\end{array}
if l < -2.5 or 18.5 < l Initial program 65.1%
associate-*l/65.1%
*-lft-identity65.1%
Simplified65.1%
Taylor expanded in l around 0 53.6%
unpow253.6%
Simplified53.6%
Taylor expanded in F around inf 97.3%
if -2.5 < l < 18.5Initial program 93.8%
add-sqr-sqrt93.7%
sqrt-unprod83.6%
inv-pow83.6%
unpow-prod-down83.5%
pow-prod-up83.6%
inv-pow83.6%
unpow-prod-down83.6%
pow-prod-up83.6%
pow-prod-up83.6%
metadata-eval83.6%
metadata-eval83.6%
metadata-eval83.6%
Applied egg-rr83.6%
Taylor expanded in l around 0 93.8%
*-commutative93.8%
unpow293.8%
times-frac99.5%
Simplified99.5%
Final simplification98.4%
(FPCore (F l) :precision binary64 (if (or (<= l -2.5) (not (<= l 18.5))) (* PI l) (- (* PI l) (/ (* l (/ PI F)) F))))
double code(double F, double l) {
double tmp;
if ((l <= -2.5) || !(l <= 18.5)) {
tmp = ((double) M_PI) * l;
} else {
tmp = (((double) M_PI) * l) - ((l * (((double) M_PI) / F)) / F);
}
return tmp;
}
public static double code(double F, double l) {
double tmp;
if ((l <= -2.5) || !(l <= 18.5)) {
tmp = Math.PI * l;
} else {
tmp = (Math.PI * l) - ((l * (Math.PI / F)) / F);
}
return tmp;
}
def code(F, l): tmp = 0 if (l <= -2.5) or not (l <= 18.5): tmp = math.pi * l else: tmp = (math.pi * l) - ((l * (math.pi / F)) / F) return tmp
function code(F, l) tmp = 0.0 if ((l <= -2.5) || !(l <= 18.5)) tmp = Float64(pi * l); else tmp = Float64(Float64(pi * l) - Float64(Float64(l * Float64(pi / F)) / F)); end return tmp end
function tmp_2 = code(F, l) tmp = 0.0; if ((l <= -2.5) || ~((l <= 18.5))) tmp = pi * l; else tmp = (pi * l) - ((l * (pi / F)) / F); end tmp_2 = tmp; end
code[F_, l_] := If[Or[LessEqual[l, -2.5], N[Not[LessEqual[l, 18.5]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[(N[(Pi * l), $MachinePrecision] - N[(N[(l * N[(Pi / F), $MachinePrecision]), $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -2.5 \lor \neg \left(\ell \leq 18.5\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\pi \cdot \ell - \frac{\ell \cdot \frac{\pi}{F}}{F}\\
\end{array}
\end{array}
if l < -2.5 or 18.5 < l Initial program 65.1%
associate-*l/65.1%
*-lft-identity65.1%
Simplified65.1%
Taylor expanded in l around 0 53.6%
unpow253.6%
Simplified53.6%
Taylor expanded in F around inf 97.3%
if -2.5 < l < 18.5Initial program 93.8%
associate-*l/93.8%
*-un-lft-identity93.8%
associate-/r*99.5%
Applied egg-rr99.5%
clear-num99.5%
inv-pow99.5%
Applied egg-rr99.5%
unpow-199.5%
*-commutative99.5%
Simplified99.5%
Taylor expanded in l around 0 99.5%
associate-*r/99.5%
Simplified99.5%
Final simplification98.4%
(FPCore (F l) :precision binary64 (if (or (<= l -2.5) (not (<= l 18.5))) (* PI l) (* l (* PI (- 1.0 (pow F -2.0))))))
double code(double F, double l) {
double tmp;
if ((l <= -2.5) || !(l <= 18.5)) {
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 <= -2.5) || !(l <= 18.5)) {
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 <= -2.5) or not (l <= 18.5): 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 <= -2.5) || !(l <= 18.5)) 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 <= -2.5) || ~((l <= 18.5))) tmp = pi * l; else tmp = l * (pi * (1.0 - (F ^ -2.0))); end tmp_2 = tmp; end
code[F_, l_] := If[Or[LessEqual[l, -2.5], N[Not[LessEqual[l, 18.5]], $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 -2.5 \lor \neg \left(\ell \leq 18.5\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\ell \cdot \left(\pi \cdot \left(1 - {F}^{-2}\right)\right)\\
\end{array}
\end{array}
if l < -2.5 or 18.5 < l Initial program 65.1%
associate-*l/65.1%
*-lft-identity65.1%
Simplified65.1%
Taylor expanded in l around 0 53.6%
unpow253.6%
Simplified53.6%
Taylor expanded in F around inf 97.3%
if -2.5 < l < 18.5Initial program 93.8%
associate-*l/93.8%
*-lft-identity93.8%
Simplified93.8%
Taylor expanded in l around 0 93.8%
unpow293.8%
Simplified93.8%
sub-neg93.8%
distribute-lft-in93.8%
*-commutative93.8%
clear-num93.8%
associate-/r/93.8%
pow293.8%
pow-flip93.8%
metadata-eval93.8%
metadata-eval93.8%
sqrt-pow183.6%
*-commutative83.6%
distribute-lft-neg-in83.6%
sqrt-pow193.8%
metadata-eval93.8%
Applied egg-rr93.8%
*-commutative93.8%
distribute-rgt-out93.8%
cancel-sign-sub-inv93.8%
*-rgt-identity93.8%
distribute-lft-out--93.8%
Simplified93.8%
Final simplification95.5%
(FPCore (F l) :precision binary64 (if (or (<= l -2.5) (not (<= l 18.5))) (* PI l) (* l (- PI (/ PI (* F F))))))
double code(double F, double l) {
double tmp;
if ((l <= -2.5) || !(l <= 18.5)) {
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 ((l <= -2.5) || !(l <= 18.5)) {
tmp = Math.PI * l;
} else {
tmp = l * (Math.PI - (Math.PI / (F * F)));
}
return tmp;
}
def code(F, l): tmp = 0 if (l <= -2.5) or not (l <= 18.5): tmp = math.pi * l else: tmp = l * (math.pi - (math.pi / (F * F))) return tmp
function code(F, l) tmp = 0.0 if ((l <= -2.5) || !(l <= 18.5)) 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 ((l <= -2.5) || ~((l <= 18.5))) tmp = pi * l; else tmp = l * (pi - (pi / (F * F))); end tmp_2 = tmp; end
code[F_, l_] := If[Or[LessEqual[l, -2.5], N[Not[LessEqual[l, 18.5]], $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}\;\ell \leq -2.5 \lor \neg \left(\ell \leq 18.5\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\ell \cdot \left(\pi - \frac{\pi}{F \cdot F}\right)\\
\end{array}
\end{array}
if l < -2.5 or 18.5 < l Initial program 65.1%
associate-*l/65.1%
*-lft-identity65.1%
Simplified65.1%
Taylor expanded in l around 0 53.6%
unpow253.6%
Simplified53.6%
Taylor expanded in F around inf 97.3%
if -2.5 < l < 18.5Initial program 93.8%
associate-*l/93.8%
*-lft-identity93.8%
Simplified93.8%
Taylor expanded in l around 0 93.8%
unpow293.8%
Simplified93.8%
Final simplification95.5%
(FPCore (F l) :precision binary64 (if (or (<= F 4.4e-26) (not (<= F 0.88))) (* PI l) (/ (- l) (* F (/ F PI)))))
double code(double F, double l) {
double tmp;
if ((F <= 4.4e-26) || !(F <= 0.88)) {
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 <= 4.4e-26) || !(F <= 0.88)) {
tmp = Math.PI * l;
} else {
tmp = -l / (F * (F / Math.PI));
}
return tmp;
}
def code(F, l): tmp = 0 if (F <= 4.4e-26) or not (F <= 0.88): tmp = math.pi * l else: tmp = -l / (F * (F / math.pi)) return tmp
function code(F, l) tmp = 0.0 if ((F <= 4.4e-26) || !(F <= 0.88)) tmp = Float64(pi * l); else tmp = Float64(Float64(-l) / Float64(F * Float64(F / pi))); end return tmp end
function tmp_2 = code(F, l) tmp = 0.0; if ((F <= 4.4e-26) || ~((F <= 0.88))) tmp = pi * l; else tmp = -l / (F * (F / pi)); end tmp_2 = tmp; end
code[F_, l_] := If[Or[LessEqual[F, 4.4e-26], N[Not[LessEqual[F, 0.88]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[((-l) / N[(F * N[(F / Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq 4.4 \cdot 10^{-26} \lor \neg \left(F \leq 0.88\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\frac{-\ell}{F \cdot \frac{F}{\pi}}\\
\end{array}
\end{array}
if F < 4.4000000000000002e-26 or 0.880000000000000004 < F Initial program 79.3%
associate-*l/79.3%
*-lft-identity79.3%
Simplified79.3%
Taylor expanded in l around 0 73.6%
unpow273.6%
Simplified73.6%
Taylor expanded in F around inf 78.8%
if 4.4000000000000002e-26 < F < 0.880000000000000004Initial program 99.0%
associate-*l/99.2%
*-lft-identity99.2%
Simplified99.2%
Taylor expanded in l around 0 98.7%
unpow298.7%
Simplified98.7%
add-cbrt-cube42.5%
pow342.5%
sub-neg42.5%
sub-neg42.5%
div-inv42.5%
pow242.5%
pow-flip42.5%
metadata-eval42.5%
Applied egg-rr42.5%
Taylor expanded in F around 0 88.9%
mul-1-neg88.9%
associate-/l*88.4%
unpow288.4%
Simplified88.4%
Taylor expanded in F around 0 88.4%
unpow288.4%
associate-*r/88.4%
Simplified88.4%
Final simplification79.1%
(FPCore (F l) :precision binary64 (if (or (<= F 1.18e-26) (not (<= F 0.88))) (* PI l) (/ (- l) (/ (* F F) PI))))
double code(double F, double l) {
double tmp;
if ((F <= 1.18e-26) || !(F <= 0.88)) {
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 <= 1.18e-26) || !(F <= 0.88)) {
tmp = Math.PI * l;
} else {
tmp = -l / ((F * F) / Math.PI);
}
return tmp;
}
def code(F, l): tmp = 0 if (F <= 1.18e-26) or not (F <= 0.88): tmp = math.pi * l else: tmp = -l / ((F * F) / math.pi) return tmp
function code(F, l) tmp = 0.0 if ((F <= 1.18e-26) || !(F <= 0.88)) 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 <= 1.18e-26) || ~((F <= 0.88))) tmp = pi * l; else tmp = -l / ((F * F) / pi); end tmp_2 = tmp; end
code[F_, l_] := If[Or[LessEqual[F, 1.18e-26], N[Not[LessEqual[F, 0.88]], $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 1.18 \cdot 10^{-26} \lor \neg \left(F \leq 0.88\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\frac{-\ell}{\frac{F \cdot F}{\pi}}\\
\end{array}
\end{array}
if F < 1.17999999999999996e-26 or 0.880000000000000004 < F Initial program 79.3%
associate-*l/79.3%
*-lft-identity79.3%
Simplified79.3%
Taylor expanded in l around 0 73.6%
unpow273.6%
Simplified73.6%
Taylor expanded in F around inf 78.8%
if 1.17999999999999996e-26 < F < 0.880000000000000004Initial program 99.0%
associate-*l/99.2%
*-lft-identity99.2%
Simplified99.2%
Taylor expanded in l around 0 98.7%
unpow298.7%
Simplified98.7%
add-cbrt-cube42.5%
pow342.5%
sub-neg42.5%
sub-neg42.5%
div-inv42.5%
pow242.5%
pow-flip42.5%
metadata-eval42.5%
Applied egg-rr42.5%
Taylor expanded in F around 0 88.9%
mul-1-neg88.9%
associate-/l*88.4%
unpow288.4%
Simplified88.4%
Final simplification79.1%
(FPCore (F l) :precision binary64 (if (or (<= F 1.22e-25) (not (<= F 0.88))) (* PI l) (/ (* PI (- l)) (* F F))))
double code(double F, double l) {
double tmp;
if ((F <= 1.22e-25) || !(F <= 0.88)) {
tmp = ((double) M_PI) * l;
} else {
tmp = (((double) M_PI) * -l) / (F * F);
}
return tmp;
}
public static double code(double F, double l) {
double tmp;
if ((F <= 1.22e-25) || !(F <= 0.88)) {
tmp = Math.PI * l;
} else {
tmp = (Math.PI * -l) / (F * F);
}
return tmp;
}
def code(F, l): tmp = 0 if (F <= 1.22e-25) or not (F <= 0.88): tmp = math.pi * l else: tmp = (math.pi * -l) / (F * F) return tmp
function code(F, l) tmp = 0.0 if ((F <= 1.22e-25) || !(F <= 0.88)) tmp = Float64(pi * l); else tmp = Float64(Float64(pi * Float64(-l)) / Float64(F * F)); end return tmp end
function tmp_2 = code(F, l) tmp = 0.0; if ((F <= 1.22e-25) || ~((F <= 0.88))) tmp = pi * l; else tmp = (pi * -l) / (F * F); end tmp_2 = tmp; end
code[F_, l_] := If[Or[LessEqual[F, 1.22e-25], N[Not[LessEqual[F, 0.88]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[(N[(Pi * (-l)), $MachinePrecision] / N[(F * F), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq 1.22 \cdot 10^{-25} \lor \neg \left(F \leq 0.88\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\frac{\pi \cdot \left(-\ell\right)}{F \cdot F}\\
\end{array}
\end{array}
if F < 1.21999999999999999e-25 or 0.880000000000000004 < F Initial program 79.3%
associate-*l/79.3%
*-lft-identity79.3%
Simplified79.3%
Taylor expanded in l around 0 73.6%
unpow273.6%
Simplified73.6%
Taylor expanded in F around inf 78.8%
if 1.21999999999999999e-25 < F < 0.880000000000000004Initial program 99.0%
associate-*l/99.2%
*-lft-identity99.2%
Simplified99.2%
Taylor expanded in l around 0 98.7%
unpow298.7%
Simplified98.7%
Taylor expanded in F around 0 88.9%
associate-*r/88.9%
*-commutative88.9%
mul-1-neg88.9%
*-commutative88.9%
unpow288.9%
Simplified88.9%
Final simplification79.1%
(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.8%
associate-*l/79.8%
*-lft-identity79.8%
Simplified79.8%
Taylor expanded in l around 0 74.2%
unpow274.2%
Simplified74.2%
Taylor expanded in F around inf 77.1%
Final simplification77.1%
herbie shell --seed 2023256
(FPCore (F l)
:name "VandenBroeck and Keller, Equation (6)"
:precision binary64
(- (* PI l) (* (/ 1.0 (* F F)) (tan (* PI l)))))