
(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) -2e+16) (not (<= (* PI l) 20000.0))) (* PI l) (+ (* PI l) (/ (* (tan (* PI l)) (/ -1.0 F)) F))))
double code(double F, double l) {
double tmp;
if (((((double) M_PI) * l) <= -2e+16) || !((((double) M_PI) * l) <= 20000.0)) {
tmp = ((double) M_PI) * l;
} else {
tmp = (((double) M_PI) * l) + ((tan((((double) M_PI) * l)) * (-1.0 / F)) / F);
}
return tmp;
}
public static double code(double F, double l) {
double tmp;
if (((Math.PI * l) <= -2e+16) || !((Math.PI * l) <= 20000.0)) {
tmp = Math.PI * l;
} else {
tmp = (Math.PI * l) + ((Math.tan((Math.PI * l)) * (-1.0 / F)) / F);
}
return tmp;
}
def code(F, l): tmp = 0 if ((math.pi * l) <= -2e+16) or not ((math.pi * l) <= 20000.0): tmp = math.pi * l else: tmp = (math.pi * l) + ((math.tan((math.pi * l)) * (-1.0 / F)) / F) return tmp
function code(F, l) tmp = 0.0 if ((Float64(pi * l) <= -2e+16) || !(Float64(pi * l) <= 20000.0)) tmp = Float64(pi * l); else tmp = Float64(Float64(pi * l) + Float64(Float64(tan(Float64(pi * l)) * Float64(-1.0 / F)) / F)); end return tmp end
function tmp_2 = code(F, l) tmp = 0.0; if (((pi * l) <= -2e+16) || ~(((pi * l) <= 20000.0))) tmp = pi * l; else tmp = (pi * l) + ((tan((pi * l)) * (-1.0 / F)) / F); end tmp_2 = tmp; end
code[F_, l_] := If[Or[LessEqual[N[(Pi * l), $MachinePrecision], -2e+16], N[Not[LessEqual[N[(Pi * l), $MachinePrecision], 20000.0]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[(N[(Pi * l), $MachinePrecision] + N[(N[(N[Tan[N[(Pi * l), $MachinePrecision]], $MachinePrecision] * N[(-1.0 / F), $MachinePrecision]), $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\pi \cdot \ell \leq -2 \cdot 10^{+16} \lor \neg \left(\pi \cdot \ell \leq 20000\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\pi \cdot \ell + \frac{\tan \left(\pi \cdot \ell\right) \cdot \frac{-1}{F}}{F}\\
\end{array}
\end{array}
if (*.f64 (PI.f64) l) < -2e16 or 2e4 < (*.f64 (PI.f64) l) Initial program 56.7%
associate-*l/56.7%
*-lft-identity56.7%
Simplified56.7%
Taylor expanded in l around 0 42.4%
unpow242.4%
Simplified42.4%
Taylor expanded in F around inf 99.6%
if -2e16 < (*.f64 (PI.f64) l) < 2e4Initial program 91.1%
associate-/r*91.1%
metadata-eval91.1%
add-sqr-sqrt46.9%
sqrt-prod68.6%
sqrt-div68.6%
associate-*l/68.6%
sqrt-div68.8%
metadata-eval68.8%
sqrt-prod51.5%
add-sqr-sqrt98.9%
Applied egg-rr98.9%
Final simplification99.3%
(FPCore (F l) :precision binary64 (if (or (<= (* PI l) -2e+16) (not (<= (* PI l) 20000.0))) (* PI l) (- (* PI l) (/ (/ (tan (* PI l)) F) F))))
double code(double F, double l) {
double tmp;
if (((((double) M_PI) * l) <= -2e+16) || !((((double) M_PI) * l) <= 20000.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) <= -2e+16) || !((Math.PI * l) <= 20000.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) <= -2e+16) or not ((math.pi * l) <= 20000.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) <= -2e+16) || !(Float64(pi * l) <= 20000.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) <= -2e+16) || ~(((pi * l) <= 20000.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], -2e+16], N[Not[LessEqual[N[(Pi * l), $MachinePrecision], 20000.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 -2 \cdot 10^{+16} \lor \neg \left(\pi \cdot \ell \leq 20000\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) < -2e16 or 2e4 < (*.f64 (PI.f64) l) Initial program 56.7%
associate-*l/56.7%
*-lft-identity56.7%
Simplified56.7%
Taylor expanded in l around 0 42.4%
unpow242.4%
Simplified42.4%
Taylor expanded in F around inf 99.6%
if -2e16 < (*.f64 (PI.f64) l) < 2e4Initial program 91.1%
associate-*l/92.0%
*-un-lft-identity92.0%
associate-/r*98.9%
Applied egg-rr98.9%
Final simplification99.3%
(FPCore (F l) :precision binary64 (if (or (<= (* PI l) -200.0) (not (<= (* PI l) 20000.0))) (* PI l) (- (* PI l) (* (/ PI F) (/ l F)))))
double code(double F, double l) {
double tmp;
if (((((double) M_PI) * l) <= -200.0) || !((((double) M_PI) * l) <= 20000.0)) {
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 (((Math.PI * l) <= -200.0) || !((Math.PI * l) <= 20000.0)) {
tmp = Math.PI * l;
} else {
tmp = (Math.PI * l) - ((Math.PI / F) * (l / F));
}
return tmp;
}
def code(F, l): tmp = 0 if ((math.pi * l) <= -200.0) or not ((math.pi * l) <= 20000.0): tmp = math.pi * l else: tmp = (math.pi * l) - ((math.pi / F) * (l / F)) return tmp
function code(F, l) tmp = 0.0 if ((Float64(pi * l) <= -200.0) || !(Float64(pi * l) <= 20000.0)) 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 (((pi * l) <= -200.0) || ~(((pi * l) <= 20000.0))) tmp = pi * l; else tmp = (pi * l) - ((pi / F) * (l / 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], 20000.0]], $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}\;\pi \cdot \ell \leq -200 \lor \neg \left(\pi \cdot \ell \leq 20000\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\pi \cdot \ell - \frac{\pi}{F} \cdot \frac{\ell}{F}\\
\end{array}
\end{array}
if (*.f64 (PI.f64) l) < -200 or 2e4 < (*.f64 (PI.f64) l) Initial program 57.4%
associate-*l/57.4%
*-lft-identity57.4%
Simplified57.4%
Taylor expanded in l around 0 42.2%
unpow242.2%
Simplified42.2%
Taylor expanded in F around inf 98.3%
if -200 < (*.f64 (PI.f64) l) < 2e4Initial program 91.2%
associate-*l/92.1%
*-lft-identity92.1%
Simplified92.1%
Taylor expanded in l around 0 89.1%
unpow289.1%
Simplified89.1%
Taylor expanded in F around 0 90.1%
fma-def90.1%
mul-1-neg90.1%
fma-neg90.1%
*-commutative90.1%
unpow290.1%
times-frac97.2%
Simplified97.2%
Final simplification97.8%
(FPCore (F l) :precision binary64 (if (or (<= l -0.5) (not (<= l 180000.0))) (* PI l) (* l (* PI (- 1.0 (pow F -2.0))))))
double code(double F, double l) {
double tmp;
if ((l <= -0.5) || !(l <= 180000.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 <= -0.5) || !(l <= 180000.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 <= -0.5) or not (l <= 180000.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 <= -0.5) || !(l <= 180000.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 <= -0.5) || ~((l <= 180000.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, -0.5], N[Not[LessEqual[l, 180000.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 -0.5 \lor \neg \left(\ell \leq 180000\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\ell \cdot \left(\pi \cdot \left(1 - {F}^{-2}\right)\right)\\
\end{array}
\end{array}
if l < -0.5 or 1.8e5 < l Initial program 57.4%
associate-*l/57.4%
*-lft-identity57.4%
Simplified57.4%
Taylor expanded in l around 0 42.2%
unpow242.2%
Simplified42.2%
Taylor expanded in F around inf 98.3%
if -0.5 < l < 1.8e5Initial program 91.2%
associate-*l/92.1%
*-lft-identity92.1%
Simplified92.1%
Taylor expanded in l around 0 89.1%
unpow289.1%
Simplified89.1%
sub-neg89.1%
distribute-lft-in89.1%
*-commutative89.1%
div-inv89.1%
pow289.1%
pow-flip89.1%
metadata-eval89.1%
distribute-rgt-neg-in89.1%
Applied egg-rr89.1%
*-commutative89.1%
distribute-lft-in89.1%
*-commutative89.1%
cancel-sign-sub-inv89.1%
*-lft-identity89.1%
distribute-rgt-out--89.1%
Simplified89.1%
Final simplification94.1%
(FPCore (F l) :precision binary64 (if (or (<= l -0.5) (not (<= l 180000.0))) (* PI l) (* l (- PI (/ PI (* F F))))))
double code(double F, double l) {
double tmp;
if ((l <= -0.5) || !(l <= 180000.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 ((l <= -0.5) || !(l <= 180000.0)) {
tmp = Math.PI * l;
} else {
tmp = l * (Math.PI - (Math.PI / (F * F)));
}
return tmp;
}
def code(F, l): tmp = 0 if (l <= -0.5) or not (l <= 180000.0): tmp = math.pi * l else: tmp = l * (math.pi - (math.pi / (F * F))) return tmp
function code(F, l) tmp = 0.0 if ((l <= -0.5) || !(l <= 180000.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 ((l <= -0.5) || ~((l <= 180000.0))) tmp = pi * l; else tmp = l * (pi - (pi / (F * F))); end tmp_2 = tmp; end
code[F_, l_] := If[Or[LessEqual[l, -0.5], N[Not[LessEqual[l, 180000.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}\;\ell \leq -0.5 \lor \neg \left(\ell \leq 180000\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\ell \cdot \left(\pi - \frac{\pi}{F \cdot F}\right)\\
\end{array}
\end{array}
if l < -0.5 or 1.8e5 < l Initial program 57.4%
associate-*l/57.4%
*-lft-identity57.4%
Simplified57.4%
Taylor expanded in l around 0 42.2%
unpow242.2%
Simplified42.2%
Taylor expanded in F around inf 98.3%
if -0.5 < l < 1.8e5Initial program 91.2%
associate-*l/92.1%
*-lft-identity92.1%
Simplified92.1%
Taylor expanded in l around 0 89.1%
unpow289.1%
Simplified89.1%
Final simplification94.1%
(FPCore (F l) :precision binary64 (if (<= (* F F) 1e-290) (/ (* l F) (/ F PI)) (if (<= (* F F) 2e-277) (* l (/ (- PI) (* F F))) (* PI l))))
double code(double F, double l) {
double tmp;
if ((F * F) <= 1e-290) {
tmp = (l * F) / (F / ((double) M_PI));
} else if ((F * F) <= 2e-277) {
tmp = l * (-((double) M_PI) / (F * F));
} else {
tmp = ((double) M_PI) * l;
}
return tmp;
}
public static double code(double F, double l) {
double tmp;
if ((F * F) <= 1e-290) {
tmp = (l * F) / (F / Math.PI);
} else if ((F * F) <= 2e-277) {
tmp = l * (-Math.PI / (F * F));
} else {
tmp = Math.PI * l;
}
return tmp;
}
def code(F, l): tmp = 0 if (F * F) <= 1e-290: tmp = (l * F) / (F / math.pi) elif (F * F) <= 2e-277: tmp = l * (-math.pi / (F * F)) else: tmp = math.pi * l return tmp
function code(F, l) tmp = 0.0 if (Float64(F * F) <= 1e-290) tmp = Float64(Float64(l * F) / Float64(F / pi)); elseif (Float64(F * F) <= 2e-277) tmp = Float64(l * Float64(Float64(-pi) / Float64(F * F))); else tmp = Float64(pi * l); end return tmp end
function tmp_2 = code(F, l) tmp = 0.0; if ((F * F) <= 1e-290) tmp = (l * F) / (F / pi); elseif ((F * F) <= 2e-277) tmp = l * (-pi / (F * F)); else tmp = pi * l; end tmp_2 = tmp; end
code[F_, l_] := If[LessEqual[N[(F * F), $MachinePrecision], 1e-290], N[(N[(l * F), $MachinePrecision] / N[(F / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(F * F), $MachinePrecision], 2e-277], N[(l * N[((-Pi) / N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(Pi * l), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \cdot F \leq 10^{-290}:\\
\;\;\;\;\frac{\ell \cdot F}{\frac{F}{\pi}}\\
\mathbf{elif}\;F \cdot F \leq 2 \cdot 10^{-277}:\\
\;\;\;\;\ell \cdot \frac{-\pi}{F \cdot F}\\
\mathbf{else}:\\
\;\;\;\;\pi \cdot \ell\\
\end{array}
\end{array}
if (*.f64 F F) < 1.0000000000000001e-290Initial program 28.9%
associate-*l/30.4%
*-lft-identity30.4%
Simplified30.4%
Taylor expanded in l around 0 24.2%
unpow224.2%
Simplified24.2%
Taylor expanded in F around 0 24.2%
associate-*r/24.2%
neg-mul-124.2%
unpow224.2%
Simplified24.2%
clear-num24.2%
un-div-inv25.7%
add-sqr-sqrt0.0%
sqrt-unprod7.5%
sqr-neg7.5%
sqrt-unprod7.5%
add-sqr-sqrt7.5%
associate-/l*7.5%
associate-/l/7.6%
div-inv7.6%
associate-/l*7.6%
inv-pow7.6%
metadata-eval7.6%
sqrt-pow113.4%
exp-to-pow2.9%
associate-*l/2.9%
Applied egg-rr59.8%
if 1.0000000000000001e-290 < (*.f64 F F) < 1.99999999999999994e-277Initial program 88.0%
associate-*l/88.4%
*-lft-identity88.4%
Simplified88.4%
Taylor expanded in l around 0 87.1%
unpow287.1%
Simplified87.1%
Taylor expanded in F around 0 87.1%
associate-*r/87.1%
neg-mul-187.1%
unpow287.1%
Simplified87.1%
if 1.99999999999999994e-277 < (*.f64 F F) Initial program 88.9%
associate-*l/88.9%
*-lft-identity88.9%
Simplified88.9%
Taylor expanded in l around 0 77.6%
unpow277.6%
Simplified77.6%
Taylor expanded in F around inf 86.3%
Final simplification79.2%
(FPCore (F l) :precision binary64 (if (<= (* F F) 1e-290) (/ (* l F) (/ F PI)) (if (<= (* F F) 2e-277) (* (/ l F) (/ PI (- F))) (* PI l))))
double code(double F, double l) {
double tmp;
if ((F * F) <= 1e-290) {
tmp = (l * F) / (F / ((double) M_PI));
} else if ((F * F) <= 2e-277) {
tmp = (l / F) * (((double) M_PI) / -F);
} else {
tmp = ((double) M_PI) * l;
}
return tmp;
}
public static double code(double F, double l) {
double tmp;
if ((F * F) <= 1e-290) {
tmp = (l * F) / (F / Math.PI);
} else if ((F * F) <= 2e-277) {
tmp = (l / F) * (Math.PI / -F);
} else {
tmp = Math.PI * l;
}
return tmp;
}
def code(F, l): tmp = 0 if (F * F) <= 1e-290: tmp = (l * F) / (F / math.pi) elif (F * F) <= 2e-277: tmp = (l / F) * (math.pi / -F) else: tmp = math.pi * l return tmp
function code(F, l) tmp = 0.0 if (Float64(F * F) <= 1e-290) tmp = Float64(Float64(l * F) / Float64(F / pi)); elseif (Float64(F * F) <= 2e-277) tmp = Float64(Float64(l / F) * Float64(pi / Float64(-F))); else tmp = Float64(pi * l); end return tmp end
function tmp_2 = code(F, l) tmp = 0.0; if ((F * F) <= 1e-290) tmp = (l * F) / (F / pi); elseif ((F * F) <= 2e-277) tmp = (l / F) * (pi / -F); else tmp = pi * l; end tmp_2 = tmp; end
code[F_, l_] := If[LessEqual[N[(F * F), $MachinePrecision], 1e-290], N[(N[(l * F), $MachinePrecision] / N[(F / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(F * F), $MachinePrecision], 2e-277], N[(N[(l / F), $MachinePrecision] * N[(Pi / (-F)), $MachinePrecision]), $MachinePrecision], N[(Pi * l), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \cdot F \leq 10^{-290}:\\
\;\;\;\;\frac{\ell \cdot F}{\frac{F}{\pi}}\\
\mathbf{elif}\;F \cdot F \leq 2 \cdot 10^{-277}:\\
\;\;\;\;\frac{\ell}{F} \cdot \frac{\pi}{-F}\\
\mathbf{else}:\\
\;\;\;\;\pi \cdot \ell\\
\end{array}
\end{array}
if (*.f64 F F) < 1.0000000000000001e-290Initial program 28.9%
associate-*l/30.4%
*-lft-identity30.4%
Simplified30.4%
Taylor expanded in l around 0 24.2%
unpow224.2%
Simplified24.2%
Taylor expanded in F around 0 24.2%
associate-*r/24.2%
neg-mul-124.2%
unpow224.2%
Simplified24.2%
clear-num24.2%
un-div-inv25.7%
add-sqr-sqrt0.0%
sqrt-unprod7.5%
sqr-neg7.5%
sqrt-unprod7.5%
add-sqr-sqrt7.5%
associate-/l*7.5%
associate-/l/7.6%
div-inv7.6%
associate-/l*7.6%
inv-pow7.6%
metadata-eval7.6%
sqrt-pow113.4%
exp-to-pow2.9%
associate-*l/2.9%
Applied egg-rr59.8%
if 1.0000000000000001e-290 < (*.f64 F F) < 1.99999999999999994e-277Initial program 88.0%
associate-*l/88.4%
*-lft-identity88.4%
Simplified88.4%
Taylor expanded in l around 0 87.1%
unpow287.1%
Simplified87.1%
Taylor expanded in F around 0 87.1%
associate-*r/87.1%
neg-mul-187.1%
unpow287.1%
Simplified87.1%
frac-2neg87.1%
remove-double-neg87.1%
associate-*r/87.5%
distribute-rgt-neg-in87.5%
Applied egg-rr87.5%
times-frac87.3%
Simplified87.3%
if 1.99999999999999994e-277 < (*.f64 F F) Initial program 88.9%
associate-*l/88.9%
*-lft-identity88.9%
Simplified88.9%
Taylor expanded in l around 0 77.6%
unpow277.6%
Simplified77.6%
Taylor expanded in F around inf 86.3%
Final simplification79.2%
(FPCore (F l) :precision binary64 (if (<= F 1.2e-145) (/ (* l F) (/ F PI)) (if (<= F 6e-139) (/ (* PI l) (- (* F F))) (* PI l))))
double code(double F, double l) {
double tmp;
if (F <= 1.2e-145) {
tmp = (l * F) / (F / ((double) M_PI));
} else if (F <= 6e-139) {
tmp = (((double) M_PI) * l) / -(F * F);
} else {
tmp = ((double) M_PI) * l;
}
return tmp;
}
public static double code(double F, double l) {
double tmp;
if (F <= 1.2e-145) {
tmp = (l * F) / (F / Math.PI);
} else if (F <= 6e-139) {
tmp = (Math.PI * l) / -(F * F);
} else {
tmp = Math.PI * l;
}
return tmp;
}
def code(F, l): tmp = 0 if F <= 1.2e-145: tmp = (l * F) / (F / math.pi) elif F <= 6e-139: tmp = (math.pi * l) / -(F * F) else: tmp = math.pi * l return tmp
function code(F, l) tmp = 0.0 if (F <= 1.2e-145) tmp = Float64(Float64(l * F) / Float64(F / pi)); elseif (F <= 6e-139) tmp = Float64(Float64(pi * l) / Float64(-Float64(F * F))); else tmp = Float64(pi * l); end return tmp end
function tmp_2 = code(F, l) tmp = 0.0; if (F <= 1.2e-145) tmp = (l * F) / (F / pi); elseif (F <= 6e-139) tmp = (pi * l) / -(F * F); else tmp = pi * l; end tmp_2 = tmp; end
code[F_, l_] := If[LessEqual[F, 1.2e-145], N[(N[(l * F), $MachinePrecision] / N[(F / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 6e-139], N[(N[(Pi * l), $MachinePrecision] / (-N[(F * F), $MachinePrecision])), $MachinePrecision], N[(Pi * l), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq 1.2 \cdot 10^{-145}:\\
\;\;\;\;\frac{\ell \cdot F}{\frac{F}{\pi}}\\
\mathbf{elif}\;F \leq 6 \cdot 10^{-139}:\\
\;\;\;\;\frac{\pi \cdot \ell}{-F \cdot F}\\
\mathbf{else}:\\
\;\;\;\;\pi \cdot \ell\\
\end{array}
\end{array}
if F < 1.20000000000000008e-145Initial program 64.2%
associate-*l/64.8%
*-lft-identity64.8%
Simplified64.8%
Taylor expanded in l around 0 54.5%
unpow254.5%
Simplified54.5%
Taylor expanded in F around 0 19.7%
associate-*r/19.7%
neg-mul-119.7%
unpow219.7%
Simplified19.7%
clear-num19.7%
un-div-inv20.4%
add-sqr-sqrt0.0%
sqrt-unprod5.7%
sqr-neg5.7%
sqrt-unprod5.7%
add-sqr-sqrt5.7%
associate-/l*5.7%
associate-/l/5.8%
div-inv5.8%
associate-/l*5.8%
inv-pow5.8%
metadata-eval5.8%
sqrt-pow115.4%
exp-to-pow1.2%
associate-*l/1.2%
Applied egg-rr61.8%
if 1.20000000000000008e-145 < F < 5.9999999999999998e-139Initial program 81.1%
associate-*l/81.4%
*-lft-identity81.4%
Simplified81.4%
Taylor expanded in l around 0 79.7%
unpow279.7%
Simplified79.7%
Taylor expanded in F around 0 79.7%
associate-*r/79.7%
neg-mul-179.7%
unpow279.7%
Simplified79.7%
frac-2neg79.7%
remove-double-neg79.7%
associate-*r/80.0%
distribute-rgt-neg-in80.0%
Applied egg-rr80.0%
if 5.9999999999999998e-139 < F Initial program 90.6%
associate-*l/90.6%
*-lft-identity90.6%
Simplified90.6%
Taylor expanded in l around 0 82.1%
unpow282.1%
Simplified82.1%
Taylor expanded in F around inf 88.5%
Final simplification70.4%
(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 72.7%
associate-*l/73.1%
*-lft-identity73.1%
Simplified73.1%
Taylor expanded in l around 0 63.5%
unpow263.5%
Simplified63.5%
Taylor expanded in F around inf 76.9%
Final simplification76.9%
herbie shell --seed 2023213
(FPCore (F l)
:name "VandenBroeck and Keller, Equation (6)"
:precision binary64
(- (* PI l) (* (/ 1.0 (* F F)) (tan (* PI l)))))