
(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 8 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 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 (<= l -0.5) (not (<= l 1.5e+15))) (* PI l) (- (* PI l) (* PI (/ l (* F F))))))
double code(double F, double l) {
double tmp;
if ((l <= -0.5) || !(l <= 1.5e+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 ((l <= -0.5) || !(l <= 1.5e+15)) {
tmp = Math.PI * l;
} else {
tmp = (Math.PI * l) - (Math.PI * (l / (F * F)));
}
return tmp;
}
def code(F, l): tmp = 0 if (l <= -0.5) or not (l <= 1.5e+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 ((l <= -0.5) || !(l <= 1.5e+15)) tmp = Float64(pi * l); else tmp = Float64(Float64(pi * l) - Float64(pi * Float64(l / Float64(F * F)))); end return tmp end
function tmp_2 = code(F, l) tmp = 0.0; if ((l <= -0.5) || ~((l <= 1.5e+15))) tmp = pi * l; else tmp = (pi * l) - (pi * (l / (F * F))); end tmp_2 = tmp; end
code[F_, l_] := If[Or[LessEqual[l, -0.5], N[Not[LessEqual[l, 1.5e+15]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[(N[(Pi * l), $MachinePrecision] - N[(Pi * N[(l / N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -0.5 \lor \neg \left(\ell \leq 1.5 \cdot 10^{+15}\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\pi \cdot \ell - \pi \cdot \frac{\ell}{F \cdot F}\\
\end{array}
\end{array}
if l < -0.5 or 1.5e15 < 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 -0.5 < l < 1.5e15Initial program 90.0%
Taylor expanded in l around 0 90.6%
associate-/l*90.5%
associate-/r/90.6%
unpow290.6%
Simplified90.6%
Final simplification95.1%
(FPCore (F l) :precision binary64 (if (or (<= l -0.5) (not (<= l 1.5e+15))) (* PI l) (- (* PI l) (/ (/ l (/ F PI)) F))))
double code(double F, double l) {
double tmp;
if ((l <= -0.5) || !(l <= 1.5e+15)) {
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 ((l <= -0.5) || !(l <= 1.5e+15)) {
tmp = Math.PI * l;
} else {
tmp = (Math.PI * l) - ((l / (F / Math.PI)) / F);
}
return tmp;
}
def code(F, l): tmp = 0 if (l <= -0.5) or not (l <= 1.5e+15): tmp = math.pi * l else: tmp = (math.pi * l) - ((l / (F / math.pi)) / F) return tmp
function code(F, l) tmp = 0.0 if ((l <= -0.5) || !(l <= 1.5e+15)) 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 ((l <= -0.5) || ~((l <= 1.5e+15))) tmp = pi * l; else tmp = (pi * l) - ((l / (F / pi)) / F); end tmp_2 = tmp; end
code[F_, l_] := If[Or[LessEqual[l, -0.5], N[Not[LessEqual[l, 1.5e+15]], $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}\;\ell \leq -0.5 \lor \neg \left(\ell \leq 1.5 \cdot 10^{+15}\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\pi \cdot \ell - \frac{\frac{\ell}{\frac{F}{\pi}}}{F}\\
\end{array}
\end{array}
if l < -0.5 or 1.5e15 < 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 -0.5 < l < 1.5e15Initial 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%
associate-/l*98.7%
Simplified98.7%
Final simplification98.8%
(FPCore (F l) :precision binary64 (if (or (<= l -0.5) (not (<= l 1.5e+15))) (* PI l) (* l (* PI (- 1.0 (pow F -2.0))))))
double code(double F, double l) {
double tmp;
if ((l <= -0.5) || !(l <= 1.5e+15)) {
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 <= 1.5e+15)) {
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 <= 1.5e+15): 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 <= 1.5e+15)) 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 <= 1.5e+15))) 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, 1.5e+15]], $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 1.5 \cdot 10^{+15}\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.5e15 < 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 -0.5 < l < 1.5e15Initial program 90.0%
sqr-neg90.0%
associate-*l/90.7%
*-lft-identity90.7%
sqr-neg90.7%
Simplified90.7%
Taylor expanded in l around 0 89.8%
unpow289.8%
Simplified89.8%
Taylor expanded in l around 0 89.8%
*-lft-identity89.8%
*-lft-identity89.8%
unpow289.8%
times-frac89.8%
*-lft-identity89.8%
associate-*l/89.7%
associate-*l*89.7%
unpow-189.7%
unpow-189.7%
pow-sqr89.9%
metadata-eval89.9%
distribute-rgt-out--89.9%
Simplified89.9%
Final simplification94.8%
(FPCore (F l)
:precision binary64
(if (or (<= F 1.65e-108)
(and (not (<= F 1.16e-82)) (or (<= F 4.7e-36) (not (<= F 3.6e-17)))))
(* PI l)
(* (/ PI F) (- (/ l F)))))
double code(double F, double l) {
double tmp;
if ((F <= 1.65e-108) || (!(F <= 1.16e-82) && ((F <= 4.7e-36) || !(F <= 3.6e-17)))) {
tmp = ((double) M_PI) * l;
} else {
tmp = (((double) M_PI) / F) * -(l / F);
}
return tmp;
}
public static double code(double F, double l) {
double tmp;
if ((F <= 1.65e-108) || (!(F <= 1.16e-82) && ((F <= 4.7e-36) || !(F <= 3.6e-17)))) {
tmp = Math.PI * l;
} else {
tmp = (Math.PI / F) * -(l / F);
}
return tmp;
}
def code(F, l): tmp = 0 if (F <= 1.65e-108) or (not (F <= 1.16e-82) and ((F <= 4.7e-36) or not (F <= 3.6e-17))): tmp = math.pi * l else: tmp = (math.pi / F) * -(l / F) return tmp
function code(F, l) tmp = 0.0 if ((F <= 1.65e-108) || (!(F <= 1.16e-82) && ((F <= 4.7e-36) || !(F <= 3.6e-17)))) tmp = Float64(pi * l); else tmp = Float64(Float64(pi / F) * Float64(-Float64(l / F))); end return tmp end
function tmp_2 = code(F, l) tmp = 0.0; if ((F <= 1.65e-108) || (~((F <= 1.16e-82)) && ((F <= 4.7e-36) || ~((F <= 3.6e-17))))) tmp = pi * l; else tmp = (pi / F) * -(l / F); end tmp_2 = tmp; end
code[F_, l_] := If[Or[LessEqual[F, 1.65e-108], And[N[Not[LessEqual[F, 1.16e-82]], $MachinePrecision], Or[LessEqual[F, 4.7e-36], N[Not[LessEqual[F, 3.6e-17]], $MachinePrecision]]]], N[(Pi * l), $MachinePrecision], N[(N[(Pi / F), $MachinePrecision] * (-N[(l / F), $MachinePrecision])), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq 1.65 \cdot 10^{-108} \lor \neg \left(F \leq 1.16 \cdot 10^{-82}\right) \land \left(F \leq 4.7 \cdot 10^{-36} \lor \neg \left(F \leq 3.6 \cdot 10^{-17}\right)\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\frac{\pi}{F} \cdot \left(-\frac{\ell}{F}\right)\\
\end{array}
\end{array}
if F < 1.6500000000000001e-108 or 1.16e-82 < F < 4.7000000000000003e-36 or 3.59999999999999995e-17 < F Initial program 74.4%
sqr-neg74.4%
associate-*l/74.7%
*-lft-identity74.7%
sqr-neg74.7%
Simplified74.7%
Taylor expanded in l around 0 66.2%
unpow266.2%
Simplified66.2%
Taylor expanded in F around inf 78.7%
if 1.6500000000000001e-108 < F < 1.16e-82 or 4.7000000000000003e-36 < F < 3.59999999999999995e-17Initial 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%
Taylor expanded in F around 0 79.6%
mul-1-neg79.6%
associate-/l*79.7%
unpow279.7%
associate-/l*79.7%
Simplified79.7%
Taylor expanded in l around 0 79.6%
unpow279.6%
times-frac79.7%
*-commutative79.7%
Simplified79.7%
Final simplification78.7%
(FPCore (F l)
:precision binary64
(if (<= F 6.8e-109)
(* PI l)
(if (<= F 9e-83)
(* (/ PI F) (- (/ l F)))
(if (or (<= F 2.4e-37) (not (<= F 5.5e-17)))
(* PI l)
(/ (* PI (- l)) (* F F))))))
double code(double F, double l) {
double tmp;
if (F <= 6.8e-109) {
tmp = ((double) M_PI) * l;
} else if (F <= 9e-83) {
tmp = (((double) M_PI) / F) * -(l / F);
} else if ((F <= 2.4e-37) || !(F <= 5.5e-17)) {
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 <= 6.8e-109) {
tmp = Math.PI * l;
} else if (F <= 9e-83) {
tmp = (Math.PI / F) * -(l / F);
} else if ((F <= 2.4e-37) || !(F <= 5.5e-17)) {
tmp = Math.PI * l;
} else {
tmp = (Math.PI * -l) / (F * F);
}
return tmp;
}
def code(F, l): tmp = 0 if F <= 6.8e-109: tmp = math.pi * l elif F <= 9e-83: tmp = (math.pi / F) * -(l / F) elif (F <= 2.4e-37) or not (F <= 5.5e-17): tmp = math.pi * l else: tmp = (math.pi * -l) / (F * F) return tmp
function code(F, l) tmp = 0.0 if (F <= 6.8e-109) tmp = Float64(pi * l); elseif (F <= 9e-83) tmp = Float64(Float64(pi / F) * Float64(-Float64(l / F))); elseif ((F <= 2.4e-37) || !(F <= 5.5e-17)) 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 <= 6.8e-109) tmp = pi * l; elseif (F <= 9e-83) tmp = (pi / F) * -(l / F); elseif ((F <= 2.4e-37) || ~((F <= 5.5e-17))) tmp = pi * l; else tmp = (pi * -l) / (F * F); end tmp_2 = tmp; end
code[F_, l_] := If[LessEqual[F, 6.8e-109], N[(Pi * l), $MachinePrecision], If[LessEqual[F, 9e-83], N[(N[(Pi / F), $MachinePrecision] * (-N[(l / F), $MachinePrecision])), $MachinePrecision], If[Or[LessEqual[F, 2.4e-37], N[Not[LessEqual[F, 5.5e-17]], $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 6.8 \cdot 10^{-109}:\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{elif}\;F \leq 9 \cdot 10^{-83}:\\
\;\;\;\;\frac{\pi}{F} \cdot \left(-\frac{\ell}{F}\right)\\
\mathbf{elif}\;F \leq 2.4 \cdot 10^{-37} \lor \neg \left(F \leq 5.5 \cdot 10^{-17}\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\frac{\pi \cdot \left(-\ell\right)}{F \cdot F}\\
\end{array}
\end{array}
if F < 6.80000000000000023e-109 or 8.99999999999999995e-83 < F < 2.39999999999999991e-37 or 5.50000000000000001e-17 < F Initial program 74.4%
sqr-neg74.4%
associate-*l/74.7%
*-lft-identity74.7%
sqr-neg74.7%
Simplified74.7%
Taylor expanded in l around 0 66.2%
unpow266.2%
Simplified66.2%
Taylor expanded in F around inf 78.7%
if 6.80000000000000023e-109 < F < 8.99999999999999995e-83Initial 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%
Taylor expanded in F around 0 79.4%
mul-1-neg79.4%
associate-/l*80.0%
unpow280.0%
associate-/l*80.0%
Simplified80.0%
Taylor expanded in l around 0 79.4%
unpow279.4%
times-frac80.0%
*-commutative80.0%
Simplified80.0%
if 2.39999999999999991e-37 < F < 5.50000000000000001e-17Initial 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%
Taylor expanded in F around 0 79.7%
associate-*r/79.7%
*-commutative79.7%
neg-mul-179.7%
*-commutative79.7%
distribute-rgt-neg-in79.7%
unpow279.7%
Simplified79.7%
Final simplification78.7%
(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)))))