
(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 7 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) -1e+34) (not (<= (* PI l) 2e+15))) (* PI l) (- (* PI l) (/ (/ (tan (* PI l)) F) F))))
double code(double F, double l) {
double tmp;
if (((((double) M_PI) * l) <= -1e+34) || !((((double) M_PI) * l) <= 2e+15)) {
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) <= -1e+34) || !((Math.PI * l) <= 2e+15)) {
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) <= -1e+34) or not ((math.pi * l) <= 2e+15): 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) <= -1e+34) || !(Float64(pi * l) <= 2e+15)) 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) <= -1e+34) || ~(((pi * l) <= 2e+15))) 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], -1e+34], N[Not[LessEqual[N[(Pi * l), $MachinePrecision], 2e+15]], $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 -1 \cdot 10^{+34} \lor \neg \left(\pi \cdot \ell \leq 2 \cdot 10^{+15}\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) < -9.99999999999999946e33 or 2e15 < (*.f64 (PI.f64) l) Initial program 62.6%
sqr-neg62.6%
associate-*l/62.6%
*-lft-identity62.6%
sqr-neg62.6%
Simplified62.6%
Taylor expanded in l around 0 47.1%
unpow247.1%
Simplified47.1%
Taylor expanded in F around inf 99.5%
if -9.99999999999999946e33 < (*.f64 (PI.f64) l) < 2e15Initial program 90.0%
associate-*l/90.7%
*-un-lft-identity90.7%
associate-/r*98.8%
Applied egg-rr98.8%
Final simplification99.2%
(FPCore (F l) :precision binary64 (if (or (<= (* PI l) -40000.0) (not (<= (* PI l) 2e+15))) (* PI l) (- (* PI l) (* (/ PI F) (/ l F)))))
double code(double F, double l) {
double tmp;
if (((((double) M_PI) * l) <= -40000.0) || !((((double) M_PI) * l) <= 2e+15)) {
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) <= -40000.0) || !((Math.PI * l) <= 2e+15)) {
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) <= -40000.0) or not ((math.pi * l) <= 2e+15): 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) <= -40000.0) || !(Float64(pi * l) <= 2e+15)) 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) <= -40000.0) || ~(((pi * l) <= 2e+15))) 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], -40000.0], N[Not[LessEqual[N[(Pi * l), $MachinePrecision], 2e+15]], $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 -40000 \lor \neg \left(\pi \cdot \ell \leq 2 \cdot 10^{+15}\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) < -4e4 or 2e15 < (*.f64 (PI.f64) l) Initial program 63.2%
sqr-neg63.2%
associate-*l/63.2%
*-lft-identity63.2%
sqr-neg63.2%
Simplified63.2%
Taylor expanded in l around 0 47.5%
unpow247.5%
Simplified47.5%
Taylor expanded in F around inf 98.8%
if -4e4 < (*.f64 (PI.f64) l) < 2e15Initial program 90.0%
associate-*l/90.7%
*-un-lft-identity90.7%
associate-/r*99.0%
Applied egg-rr99.0%
Taylor expanded in l around 0 90.6%
*-commutative90.6%
unpow290.6%
times-frac98.8%
Simplified98.8%
Final simplification98.8%
(FPCore (F l) :precision binary64 (if (or (<= (* PI l) -40000.0) (not (<= (* PI l) 2e+15))) (* PI l) (- (* PI l) (/ (/ (* PI l) F) F))))
double code(double F, double l) {
double tmp;
if (((((double) M_PI) * l) <= -40000.0) || !((((double) M_PI) * l) <= 2e+15)) {
tmp = ((double) M_PI) * l;
} else {
tmp = (((double) M_PI) * l) - (((((double) M_PI) * l) / F) / F);
}
return tmp;
}
public static double code(double F, double l) {
double tmp;
if (((Math.PI * l) <= -40000.0) || !((Math.PI * l) <= 2e+15)) {
tmp = Math.PI * l;
} else {
tmp = (Math.PI * l) - (((Math.PI * l) / F) / F);
}
return tmp;
}
def code(F, l): tmp = 0 if ((math.pi * l) <= -40000.0) or not ((math.pi * l) <= 2e+15): tmp = math.pi * l else: tmp = (math.pi * l) - (((math.pi * l) / F) / F) return tmp
function code(F, l) tmp = 0.0 if ((Float64(pi * l) <= -40000.0) || !(Float64(pi * l) <= 2e+15)) tmp = Float64(pi * l); else tmp = Float64(Float64(pi * l) - Float64(Float64(Float64(pi * l) / F) / F)); end return tmp end
function tmp_2 = code(F, l) tmp = 0.0; if (((pi * l) <= -40000.0) || ~(((pi * l) <= 2e+15))) tmp = pi * l; else tmp = (pi * l) - (((pi * l) / F) / F); end tmp_2 = tmp; end
code[F_, l_] := If[Or[LessEqual[N[(Pi * l), $MachinePrecision], -40000.0], N[Not[LessEqual[N[(Pi * l), $MachinePrecision], 2e+15]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[(N[(Pi * l), $MachinePrecision] - N[(N[(N[(Pi * l), $MachinePrecision] / F), $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\pi \cdot \ell \leq -40000 \lor \neg \left(\pi \cdot \ell \leq 2 \cdot 10^{+15}\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\pi \cdot \ell - \frac{\frac{\pi \cdot \ell}{F}}{F}\\
\end{array}
\end{array}
if (*.f64 (PI.f64) l) < -4e4 or 2e15 < (*.f64 (PI.f64) l) Initial program 63.2%
sqr-neg63.2%
associate-*l/63.2%
*-lft-identity63.2%
sqr-neg63.2%
Simplified63.2%
Taylor expanded in l around 0 47.5%
unpow247.5%
Simplified47.5%
Taylor expanded in F around inf 98.8%
if -4e4 < (*.f64 (PI.f64) l) < 2e15Initial program 90.0%
associate-*l/90.7%
*-un-lft-identity90.7%
associate-/r*99.0%
Applied egg-rr99.0%
Taylor expanded in l around 0 98.8%
Final simplification98.8%
(FPCore (F l) :precision binary64 (if (or (<= (* PI l) -40000.0) (not (<= (* PI l) 2e+15))) (* PI l) (* PI (- l (/ l (* F F))))))
double code(double F, double l) {
double tmp;
if (((((double) M_PI) * l) <= -40000.0) || !((((double) M_PI) * l) <= 2e+15)) {
tmp = ((double) M_PI) * l;
} else {
tmp = ((double) M_PI) * (l - (l / (F * F)));
}
return tmp;
}
public static double code(double F, double l) {
double tmp;
if (((Math.PI * l) <= -40000.0) || !((Math.PI * l) <= 2e+15)) {
tmp = Math.PI * l;
} else {
tmp = Math.PI * (l - (l / (F * F)));
}
return tmp;
}
def code(F, l): tmp = 0 if ((math.pi * l) <= -40000.0) or not ((math.pi * l) <= 2e+15): tmp = math.pi * l else: tmp = math.pi * (l - (l / (F * F))) return tmp
function code(F, l) tmp = 0.0 if ((Float64(pi * l) <= -40000.0) || !(Float64(pi * l) <= 2e+15)) tmp = Float64(pi * l); else tmp = Float64(pi * Float64(l - Float64(l / Float64(F * F)))); end return tmp end
function tmp_2 = code(F, l) tmp = 0.0; if (((pi * l) <= -40000.0) || ~(((pi * l) <= 2e+15))) tmp = pi * l; else tmp = pi * (l - (l / (F * F))); end tmp_2 = tmp; end
code[F_, l_] := If[Or[LessEqual[N[(Pi * l), $MachinePrecision], -40000.0], N[Not[LessEqual[N[(Pi * l), $MachinePrecision], 2e+15]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[(Pi * N[(l - N[(l / N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\pi \cdot \ell \leq -40000 \lor \neg \left(\pi \cdot \ell \leq 2 \cdot 10^{+15}\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\pi \cdot \left(\ell - \frac{\ell}{F \cdot F}\right)\\
\end{array}
\end{array}
if (*.f64 (PI.f64) l) < -4e4 or 2e15 < (*.f64 (PI.f64) l) Initial program 63.2%
sqr-neg63.2%
associate-*l/63.2%
*-lft-identity63.2%
sqr-neg63.2%
Simplified63.2%
Taylor expanded in l around 0 47.5%
unpow247.5%
Simplified47.5%
Taylor expanded in F around inf 98.8%
if -4e4 < (*.f64 (PI.f64) l) < 2e15Initial program 90.0%
associate-*l/90.7%
*-un-lft-identity90.7%
associate-/r*99.0%
Applied egg-rr99.0%
Taylor expanded in l around 0 90.6%
*-commutative90.6%
unpow290.6%
times-frac98.8%
Simplified98.8%
Taylor expanded in l around 0 89.8%
distribute-rgt-out--89.8%
*-commutative89.8%
unpow289.8%
associate-/r/90.5%
associate-/l*98.8%
associate-/l*98.8%
*-commutative98.8%
associate-*l/98.8%
associate-/r*90.6%
distribute-rgt-out--90.6%
Simplified90.6%
Final simplification95.1%
(FPCore (F l)
:precision binary64
(let* ((t_0 (+ (* PI l) -1.0)) (t_1 (* (/ (/ l F) F) (- PI))))
(if (<= F 2.1e-107)
t_0
(if (<= F 2e-83)
t_1
(if (<= F 8.5e-38) t_0 (if (<= F 2e-17) t_1 (* PI l)))))))
double code(double F, double l) {
double t_0 = (((double) M_PI) * l) + -1.0;
double t_1 = ((l / F) / F) * -((double) M_PI);
double tmp;
if (F <= 2.1e-107) {
tmp = t_0;
} else if (F <= 2e-83) {
tmp = t_1;
} else if (F <= 8.5e-38) {
tmp = t_0;
} else if (F <= 2e-17) {
tmp = t_1;
} else {
tmp = ((double) M_PI) * l;
}
return tmp;
}
public static double code(double F, double l) {
double t_0 = (Math.PI * l) + -1.0;
double t_1 = ((l / F) / F) * -Math.PI;
double tmp;
if (F <= 2.1e-107) {
tmp = t_0;
} else if (F <= 2e-83) {
tmp = t_1;
} else if (F <= 8.5e-38) {
tmp = t_0;
} else if (F <= 2e-17) {
tmp = t_1;
} else {
tmp = Math.PI * l;
}
return tmp;
}
def code(F, l): t_0 = (math.pi * l) + -1.0 t_1 = ((l / F) / F) * -math.pi tmp = 0 if F <= 2.1e-107: tmp = t_0 elif F <= 2e-83: tmp = t_1 elif F <= 8.5e-38: tmp = t_0 elif F <= 2e-17: tmp = t_1 else: tmp = math.pi * l return tmp
function code(F, l) t_0 = Float64(Float64(pi * l) + -1.0) t_1 = Float64(Float64(Float64(l / F) / F) * Float64(-pi)) tmp = 0.0 if (F <= 2.1e-107) tmp = t_0; elseif (F <= 2e-83) tmp = t_1; elseif (F <= 8.5e-38) tmp = t_0; elseif (F <= 2e-17) tmp = t_1; else tmp = Float64(pi * l); end return tmp end
function tmp_2 = code(F, l) t_0 = (pi * l) + -1.0; t_1 = ((l / F) / F) * -pi; tmp = 0.0; if (F <= 2.1e-107) tmp = t_0; elseif (F <= 2e-83) tmp = t_1; elseif (F <= 8.5e-38) tmp = t_0; elseif (F <= 2e-17) tmp = t_1; else tmp = pi * l; end tmp_2 = tmp; end
code[F_, l_] := Block[{t$95$0 = N[(N[(Pi * l), $MachinePrecision] + -1.0), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(l / F), $MachinePrecision] / F), $MachinePrecision] * (-Pi)), $MachinePrecision]}, If[LessEqual[F, 2.1e-107], t$95$0, If[LessEqual[F, 2e-83], t$95$1, If[LessEqual[F, 8.5e-38], t$95$0, If[LessEqual[F, 2e-17], t$95$1, N[(Pi * l), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \pi \cdot \ell + -1\\
t_1 := \frac{\frac{\ell}{F}}{F} \cdot \left(-\pi\right)\\
\mathbf{if}\;F \leq 2.1 \cdot 10^{-107}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;F \leq 2 \cdot 10^{-83}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;F \leq 8.5 \cdot 10^{-38}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;F \leq 2 \cdot 10^{-17}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\pi \cdot \ell\\
\end{array}
\end{array}
if F < 2.0999999999999999e-107 or 2.0000000000000001e-83 < F < 8.50000000000000046e-38Initial program 64.1%
associate-/r/64.6%
inv-pow64.6%
pow-to-exp30.5%
associate-/l*33.5%
Applied egg-rr33.5%
exp-to-pow70.1%
inv-pow70.1%
add-sqr-sqrt34.0%
associate-/r*34.0%
metadata-eval34.0%
sqrt-div33.9%
clear-num33.9%
associate-/r*30.6%
sqrt-div30.6%
sqrt-prod10.2%
add-sqr-sqrt27.1%
add-exp-log26.9%
add-sqr-sqrt15.5%
Applied egg-rr31.5%
*-inverses57.7%
Simplified57.7%
if 2.0999999999999999e-107 < F < 2.0000000000000001e-83 or 8.50000000000000046e-38 < F < 2.00000000000000014e-17Initial program 99.4%
associate-*l/99.4%
*-un-lft-identity99.4%
associate-/r*99.4%
Applied egg-rr99.4%
Taylor expanded in l around 0 79.6%
*-commutative79.6%
unpow279.6%
times-frac79.7%
Simplified79.7%
Taylor expanded in F around 0 79.6%
mul-1-neg79.6%
unpow279.6%
associate-*l/80.0%
associate-/r*80.0%
Simplified80.0%
if 2.00000000000000014e-17 < F Initial program 99.6%
sqr-neg99.6%
associate-*l/99.6%
*-lft-identity99.6%
sqr-neg99.6%
Simplified99.6%
Taylor expanded in l around 0 97.9%
unpow297.9%
Simplified97.9%
Taylor expanded in F around inf 99.0%
Final simplification70.0%
(FPCore (F l)
:precision binary64
(let* ((t_0 (+ (* PI l) -1.0)))
(if (<= F 6.2e-109)
t_0
(if (<= F 2.05e-82)
(/ (- l) (/ (* F F) PI))
(if (<= F 9.8e-38)
t_0
(if (<= F 2.2e-17) (* (/ (/ l F) F) (- PI)) (* PI l)))))))
double code(double F, double l) {
double t_0 = (((double) M_PI) * l) + -1.0;
double tmp;
if (F <= 6.2e-109) {
tmp = t_0;
} else if (F <= 2.05e-82) {
tmp = -l / ((F * F) / ((double) M_PI));
} else if (F <= 9.8e-38) {
tmp = t_0;
} else if (F <= 2.2e-17) {
tmp = ((l / F) / F) * -((double) M_PI);
} else {
tmp = ((double) M_PI) * l;
}
return tmp;
}
public static double code(double F, double l) {
double t_0 = (Math.PI * l) + -1.0;
double tmp;
if (F <= 6.2e-109) {
tmp = t_0;
} else if (F <= 2.05e-82) {
tmp = -l / ((F * F) / Math.PI);
} else if (F <= 9.8e-38) {
tmp = t_0;
} else if (F <= 2.2e-17) {
tmp = ((l / F) / F) * -Math.PI;
} else {
tmp = Math.PI * l;
}
return tmp;
}
def code(F, l): t_0 = (math.pi * l) + -1.0 tmp = 0 if F <= 6.2e-109: tmp = t_0 elif F <= 2.05e-82: tmp = -l / ((F * F) / math.pi) elif F <= 9.8e-38: tmp = t_0 elif F <= 2.2e-17: tmp = ((l / F) / F) * -math.pi else: tmp = math.pi * l return tmp
function code(F, l) t_0 = Float64(Float64(pi * l) + -1.0) tmp = 0.0 if (F <= 6.2e-109) tmp = t_0; elseif (F <= 2.05e-82) tmp = Float64(Float64(-l) / Float64(Float64(F * F) / pi)); elseif (F <= 9.8e-38) tmp = t_0; elseif (F <= 2.2e-17) tmp = Float64(Float64(Float64(l / F) / F) * Float64(-pi)); else tmp = Float64(pi * l); end return tmp end
function tmp_2 = code(F, l) t_0 = (pi * l) + -1.0; tmp = 0.0; if (F <= 6.2e-109) tmp = t_0; elseif (F <= 2.05e-82) tmp = -l / ((F * F) / pi); elseif (F <= 9.8e-38) tmp = t_0; elseif (F <= 2.2e-17) tmp = ((l / F) / F) * -pi; else tmp = pi * l; end tmp_2 = tmp; end
code[F_, l_] := Block[{t$95$0 = N[(N[(Pi * l), $MachinePrecision] + -1.0), $MachinePrecision]}, If[LessEqual[F, 6.2e-109], t$95$0, If[LessEqual[F, 2.05e-82], N[((-l) / N[(N[(F * F), $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 9.8e-38], t$95$0, If[LessEqual[F, 2.2e-17], N[(N[(N[(l / F), $MachinePrecision] / F), $MachinePrecision] * (-Pi)), $MachinePrecision], N[(Pi * l), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \pi \cdot \ell + -1\\
\mathbf{if}\;F \leq 6.2 \cdot 10^{-109}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;F \leq 2.05 \cdot 10^{-82}:\\
\;\;\;\;\frac{-\ell}{\frac{F \cdot F}{\pi}}\\
\mathbf{elif}\;F \leq 9.8 \cdot 10^{-38}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;F \leq 2.2 \cdot 10^{-17}:\\
\;\;\;\;\frac{\frac{\ell}{F}}{F} \cdot \left(-\pi\right)\\
\mathbf{else}:\\
\;\;\;\;\pi \cdot \ell\\
\end{array}
\end{array}
if F < 6.1999999999999999e-109 or 2.04999999999999998e-82 < F < 9.80000000000000078e-38Initial program 64.1%
associate-/r/64.6%
inv-pow64.6%
pow-to-exp30.5%
associate-/l*33.5%
Applied egg-rr33.5%
exp-to-pow70.1%
inv-pow70.1%
add-sqr-sqrt34.0%
associate-/r*34.0%
metadata-eval34.0%
sqrt-div33.9%
clear-num33.9%
associate-/r*30.6%
sqrt-div30.6%
sqrt-prod10.2%
add-sqr-sqrt27.1%
add-exp-log26.9%
add-sqr-sqrt15.5%
Applied egg-rr31.5%
*-inverses57.7%
Simplified57.7%
if 6.1999999999999999e-109 < F < 2.04999999999999998e-82Initial program 99.4%
sqr-neg99.4%
associate-*l/99.4%
*-lft-identity99.4%
sqr-neg99.4%
Simplified99.4%
Taylor expanded in l around 0 79.7%
unpow279.7%
Simplified79.7%
add-cbrt-cube79.1%
pow379.1%
Applied egg-rr79.1%
Taylor expanded in F around 0 79.4%
mul-1-neg79.4%
associate-/l*80.0%
unpow280.0%
Simplified80.0%
if 9.80000000000000078e-38 < F < 2.2e-17Initial program 99.4%
associate-*l/99.4%
*-un-lft-identity99.4%
associate-/r*99.4%
Applied egg-rr99.4%
Taylor expanded in l around 0 79.7%
*-commutative79.7%
unpow279.7%
times-frac79.4%
Simplified79.4%
Taylor expanded in F around 0 79.7%
mul-1-neg79.7%
unpow279.7%
associate-*l/80.0%
associate-/r*80.0%
Simplified80.0%
if 2.2e-17 < F Initial program 99.6%
sqr-neg99.6%
associate-*l/99.6%
*-lft-identity99.6%
sqr-neg99.6%
Simplified99.6%
Taylor expanded in l around 0 97.9%
unpow297.9%
Simplified97.9%
Taylor expanded in F around inf 99.0%
Final simplification70.0%
(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 75.3%
sqr-neg75.3%
associate-*l/75.7%
*-lft-identity75.7%
sqr-neg75.7%
Simplified75.7%
Taylor expanded in l around 0 66.7%
unpow266.7%
Simplified66.7%
Taylor expanded in F around inf 76.5%
Final simplification76.5%
herbie shell --seed 2023279
(FPCore (F l)
:name "VandenBroeck and Keller, Equation (6)"
:precision binary64
(- (* PI l) (* (/ 1.0 (* F F)) (tan (* PI l)))))