
(FPCore (t l k) :precision binary64 (/ 2.0 (* (* (* (/ (pow t 3.0) (* l l)) (sin k)) (tan k)) (- (+ 1.0 (pow (/ k t) 2.0)) 1.0))))
double code(double t, double l, double k) {
return 2.0 / ((((pow(t, 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + pow((k / t), 2.0)) - 1.0));
}
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = 2.0d0 / (((((t ** 3.0d0) / (l * l)) * sin(k)) * tan(k)) * ((1.0d0 + ((k / t) ** 2.0d0)) - 1.0d0))
end function
public static double code(double t, double l, double k) {
return 2.0 / ((((Math.pow(t, 3.0) / (l * l)) * Math.sin(k)) * Math.tan(k)) * ((1.0 + Math.pow((k / t), 2.0)) - 1.0));
}
def code(t, l, k): return 2.0 / ((((math.pow(t, 3.0) / (l * l)) * math.sin(k)) * math.tan(k)) * ((1.0 + math.pow((k / t), 2.0)) - 1.0))
function code(t, l, k) return Float64(2.0 / Float64(Float64(Float64(Float64((t ^ 3.0) / Float64(l * l)) * sin(k)) * tan(k)) * Float64(Float64(1.0 + (Float64(k / t) ^ 2.0)) - 1.0))) end
function tmp = code(t, l, k) tmp = 2.0 / (((((t ^ 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + ((k / t) ^ 2.0)) - 1.0)); end
code[t_, l_, k_] := N[(2.0 / N[(N[(N[(N[(N[Power[t, 3.0], $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 + N[Power[N[(k / t), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (t l k) :precision binary64 (/ 2.0 (* (* (* (/ (pow t 3.0) (* l l)) (sin k)) (tan k)) (- (+ 1.0 (pow (/ k t) 2.0)) 1.0))))
double code(double t, double l, double k) {
return 2.0 / ((((pow(t, 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + pow((k / t), 2.0)) - 1.0));
}
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = 2.0d0 / (((((t ** 3.0d0) / (l * l)) * sin(k)) * tan(k)) * ((1.0d0 + ((k / t) ** 2.0d0)) - 1.0d0))
end function
public static double code(double t, double l, double k) {
return 2.0 / ((((Math.pow(t, 3.0) / (l * l)) * Math.sin(k)) * Math.tan(k)) * ((1.0 + Math.pow((k / t), 2.0)) - 1.0));
}
def code(t, l, k): return 2.0 / ((((math.pow(t, 3.0) / (l * l)) * math.sin(k)) * math.tan(k)) * ((1.0 + math.pow((k / t), 2.0)) - 1.0))
function code(t, l, k) return Float64(2.0 / Float64(Float64(Float64(Float64((t ^ 3.0) / Float64(l * l)) * sin(k)) * tan(k)) * Float64(Float64(1.0 + (Float64(k / t) ^ 2.0)) - 1.0))) end
function tmp = code(t, l, k) tmp = 2.0 / (((((t ^ 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + ((k / t) ^ 2.0)) - 1.0)); end
code[t_, l_, k_] := N[(2.0 / N[(N[(N[(N[(N[Power[t, 3.0], $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 + N[Power[N[(k / t), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)}
\end{array}
(FPCore (t l k) :precision binary64 (if (<= (* l l) 1e+254) (* (/ (/ (/ (* l 2.0) (* k t)) k) (sin k)) (/ l (tan k))) (/ (/ (* 2.0 (pow (/ l k) 2.0)) t) (* (sin k) (tan k)))))
double code(double t, double l, double k) {
double tmp;
if ((l * l) <= 1e+254) {
tmp = ((((l * 2.0) / (k * t)) / k) / sin(k)) * (l / tan(k));
} else {
tmp = ((2.0 * pow((l / k), 2.0)) / t) / (sin(k) * tan(k));
}
return tmp;
}
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: tmp
if ((l * l) <= 1d+254) then
tmp = ((((l * 2.0d0) / (k * t)) / k) / sin(k)) * (l / tan(k))
else
tmp = ((2.0d0 * ((l / k) ** 2.0d0)) / t) / (sin(k) * tan(k))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double tmp;
if ((l * l) <= 1e+254) {
tmp = ((((l * 2.0) / (k * t)) / k) / Math.sin(k)) * (l / Math.tan(k));
} else {
tmp = ((2.0 * Math.pow((l / k), 2.0)) / t) / (Math.sin(k) * Math.tan(k));
}
return tmp;
}
def code(t, l, k): tmp = 0 if (l * l) <= 1e+254: tmp = ((((l * 2.0) / (k * t)) / k) / math.sin(k)) * (l / math.tan(k)) else: tmp = ((2.0 * math.pow((l / k), 2.0)) / t) / (math.sin(k) * math.tan(k)) return tmp
function code(t, l, k) tmp = 0.0 if (Float64(l * l) <= 1e+254) tmp = Float64(Float64(Float64(Float64(Float64(l * 2.0) / Float64(k * t)) / k) / sin(k)) * Float64(l / tan(k))); else tmp = Float64(Float64(Float64(2.0 * (Float64(l / k) ^ 2.0)) / t) / Float64(sin(k) * tan(k))); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if ((l * l) <= 1e+254) tmp = ((((l * 2.0) / (k * t)) / k) / sin(k)) * (l / tan(k)); else tmp = ((2.0 * ((l / k) ^ 2.0)) / t) / (sin(k) * tan(k)); end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[N[(l * l), $MachinePrecision], 1e+254], N[(N[(N[(N[(N[(l * 2.0), $MachinePrecision] / N[(k * t), $MachinePrecision]), $MachinePrecision] / k), $MachinePrecision] / N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[(l / N[Tan[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(2.0 * N[Power[N[(l / k), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision] / N[(N[Sin[k], $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \cdot \ell \leq 10^{+254}:\\
\;\;\;\;\frac{\frac{\frac{\ell \cdot 2}{k \cdot t}}{k}}{\sin k} \cdot \frac{\ell}{\tan k}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{2 \cdot {\left(\frac{\ell}{k}\right)}^{2}}{t}}{\sin k \cdot \tan k}\\
\end{array}
\end{array}
if (*.f64 l l) < 9.9999999999999994e253Initial program 38.1%
associate-*l*38.1%
associate-*l*38.1%
associate-/r*38.1%
associate-/r/38.1%
*-commutative38.1%
times-frac39.3%
+-commutative39.3%
associate--l+49.2%
metadata-eval49.2%
+-rgt-identity49.2%
times-frac56.8%
Simplified56.8%
Taylor expanded in t around 0 85.6%
unpow285.6%
Simplified85.6%
associate-*l/85.6%
associate-*l*90.4%
Applied egg-rr90.4%
associate-*l/89.9%
associate-*r*92.7%
Simplified92.7%
Taylor expanded in k around inf 88.4%
*-commutative88.4%
associate-*r*88.4%
unpow288.4%
associate-*r*91.1%
associate-*r/91.1%
associate-/r*93.2%
*-commutative93.2%
associate-/r*97.6%
Simplified97.6%
if 9.9999999999999994e253 < (*.f64 l l) Initial program 29.0%
associate-*l*29.0%
associate-*l*29.0%
associate-/r*29.0%
associate-/r/29.0%
*-commutative29.0%
times-frac28.9%
+-commutative28.9%
associate--l+29.1%
metadata-eval29.1%
+-rgt-identity29.1%
times-frac29.1%
Simplified29.1%
Taylor expanded in t around 0 52.0%
unpow252.0%
Simplified52.0%
associate-*l/52.0%
associate-*l*57.0%
Applied egg-rr57.0%
associate-*l/57.0%
associate-*r*71.3%
Simplified71.3%
Taylor expanded in k around inf 63.1%
*-commutative63.1%
associate-*r*63.1%
unpow263.1%
associate-*r*71.2%
associate-*r/71.2%
associate-/r*71.3%
*-commutative71.3%
associate-/r*87.3%
Simplified87.3%
frac-times87.3%
associate-/l/71.3%
Applied egg-rr71.3%
associate-*l/57.0%
associate-*r*52.0%
unpow252.0%
associate-/r*54.4%
associate-*r*54.4%
unpow254.4%
associate-*r/54.4%
unpow254.4%
unpow254.4%
times-frac96.2%
unpow296.2%
Simplified96.2%
Final simplification97.1%
(FPCore (t l k)
:precision binary64
(let* ((t_1 (/ l (sin k))) (t_2 (/ l (tan k))))
(if (<= (* l l) 2e+281)
(* (/ 2.0 k) (/ (* t_2 t_1) (* k t)))
(* t_2 (* t_1 (/ 2.0 (* k (* k t))))))))
double code(double t, double l, double k) {
double t_1 = l / sin(k);
double t_2 = l / tan(k);
double tmp;
if ((l * l) <= 2e+281) {
tmp = (2.0 / k) * ((t_2 * t_1) / (k * t));
} else {
tmp = t_2 * (t_1 * (2.0 / (k * (k * t))));
}
return tmp;
}
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = l / sin(k)
t_2 = l / tan(k)
if ((l * l) <= 2d+281) then
tmp = (2.0d0 / k) * ((t_2 * t_1) / (k * t))
else
tmp = t_2 * (t_1 * (2.0d0 / (k * (k * t))))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double t_1 = l / Math.sin(k);
double t_2 = l / Math.tan(k);
double tmp;
if ((l * l) <= 2e+281) {
tmp = (2.0 / k) * ((t_2 * t_1) / (k * t));
} else {
tmp = t_2 * (t_1 * (2.0 / (k * (k * t))));
}
return tmp;
}
def code(t, l, k): t_1 = l / math.sin(k) t_2 = l / math.tan(k) tmp = 0 if (l * l) <= 2e+281: tmp = (2.0 / k) * ((t_2 * t_1) / (k * t)) else: tmp = t_2 * (t_1 * (2.0 / (k * (k * t)))) return tmp
function code(t, l, k) t_1 = Float64(l / sin(k)) t_2 = Float64(l / tan(k)) tmp = 0.0 if (Float64(l * l) <= 2e+281) tmp = Float64(Float64(2.0 / k) * Float64(Float64(t_2 * t_1) / Float64(k * t))); else tmp = Float64(t_2 * Float64(t_1 * Float64(2.0 / Float64(k * Float64(k * t))))); end return tmp end
function tmp_2 = code(t, l, k) t_1 = l / sin(k); t_2 = l / tan(k); tmp = 0.0; if ((l * l) <= 2e+281) tmp = (2.0 / k) * ((t_2 * t_1) / (k * t)); else tmp = t_2 * (t_1 * (2.0 / (k * (k * t)))); end tmp_2 = tmp; end
code[t_, l_, k_] := Block[{t$95$1 = N[(l / N[Sin[k], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(l / N[Tan[k], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(l * l), $MachinePrecision], 2e+281], N[(N[(2.0 / k), $MachinePrecision] * N[(N[(t$95$2 * t$95$1), $MachinePrecision] / N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$2 * N[(t$95$1 * N[(2.0 / N[(k * N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\ell}{\sin k}\\
t_2 := \frac{\ell}{\tan k}\\
\mathbf{if}\;\ell \cdot \ell \leq 2 \cdot 10^{+281}:\\
\;\;\;\;\frac{2}{k} \cdot \frac{t_2 \cdot t_1}{k \cdot t}\\
\mathbf{else}:\\
\;\;\;\;t_2 \cdot \left(t_1 \cdot \frac{2}{k \cdot \left(k \cdot t\right)}\right)\\
\end{array}
\end{array}
if (*.f64 l l) < 2.0000000000000001e281Initial program 37.2%
associate-*l*37.2%
associate-*l*37.2%
associate-/r*37.2%
associate-/r/37.2%
*-commutative37.2%
times-frac38.3%
+-commutative38.3%
associate--l+47.9%
metadata-eval47.9%
+-rgt-identity47.9%
times-frac55.2%
Simplified55.2%
Taylor expanded in t around 0 84.0%
unpow284.0%
Simplified84.0%
associate-*l/84.1%
associate-*l*88.6%
Applied egg-rr88.6%
times-frac93.4%
Applied egg-rr93.4%
if 2.0000000000000001e281 < (*.f64 l l) Initial program 30.2%
associate-*l*30.2%
associate-*l*30.2%
associate-/r*30.2%
associate-/r/30.2%
*-commutative30.2%
times-frac30.1%
+-commutative30.1%
associate--l+30.2%
metadata-eval30.2%
+-rgt-identity30.2%
times-frac30.2%
Simplified30.2%
Taylor expanded in t around 0 52.5%
unpow252.5%
Simplified52.5%
associate-*l/52.5%
associate-*l*58.0%
Applied egg-rr58.0%
associate-*l/58.0%
associate-*r*73.6%
Simplified73.6%
Final simplification87.4%
(FPCore (t l k) :precision binary64 (if (<= (* l l) 5e-69) (* (/ (/ (/ (* l 2.0) (* k t)) k) (sin k)) (/ l k)) (* (/ l (tan k)) (/ (/ (* (/ 2.0 k) (/ l t)) k) (sin k)))))
double code(double t, double l, double k) {
double tmp;
if ((l * l) <= 5e-69) {
tmp = ((((l * 2.0) / (k * t)) / k) / sin(k)) * (l / k);
} else {
tmp = (l / tan(k)) * ((((2.0 / k) * (l / t)) / k) / sin(k));
}
return tmp;
}
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: tmp
if ((l * l) <= 5d-69) then
tmp = ((((l * 2.0d0) / (k * t)) / k) / sin(k)) * (l / k)
else
tmp = (l / tan(k)) * ((((2.0d0 / k) * (l / t)) / k) / sin(k))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double tmp;
if ((l * l) <= 5e-69) {
tmp = ((((l * 2.0) / (k * t)) / k) / Math.sin(k)) * (l / k);
} else {
tmp = (l / Math.tan(k)) * ((((2.0 / k) * (l / t)) / k) / Math.sin(k));
}
return tmp;
}
def code(t, l, k): tmp = 0 if (l * l) <= 5e-69: tmp = ((((l * 2.0) / (k * t)) / k) / math.sin(k)) * (l / k) else: tmp = (l / math.tan(k)) * ((((2.0 / k) * (l / t)) / k) / math.sin(k)) return tmp
function code(t, l, k) tmp = 0.0 if (Float64(l * l) <= 5e-69) tmp = Float64(Float64(Float64(Float64(Float64(l * 2.0) / Float64(k * t)) / k) / sin(k)) * Float64(l / k)); else tmp = Float64(Float64(l / tan(k)) * Float64(Float64(Float64(Float64(2.0 / k) * Float64(l / t)) / k) / sin(k))); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if ((l * l) <= 5e-69) tmp = ((((l * 2.0) / (k * t)) / k) / sin(k)) * (l / k); else tmp = (l / tan(k)) * ((((2.0 / k) * (l / t)) / k) / sin(k)); end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[N[(l * l), $MachinePrecision], 5e-69], N[(N[(N[(N[(N[(l * 2.0), $MachinePrecision] / N[(k * t), $MachinePrecision]), $MachinePrecision] / k), $MachinePrecision] / N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[(l / k), $MachinePrecision]), $MachinePrecision], N[(N[(l / N[Tan[k], $MachinePrecision]), $MachinePrecision] * N[(N[(N[(N[(2.0 / k), $MachinePrecision] * N[(l / t), $MachinePrecision]), $MachinePrecision] / k), $MachinePrecision] / N[Sin[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \cdot \ell \leq 5 \cdot 10^{-69}:\\
\;\;\;\;\frac{\frac{\frac{\ell \cdot 2}{k \cdot t}}{k}}{\sin k} \cdot \frac{\ell}{k}\\
\mathbf{else}:\\
\;\;\;\;\frac{\ell}{\tan k} \cdot \frac{\frac{\frac{2}{k} \cdot \frac{\ell}{t}}{k}}{\sin k}\\
\end{array}
\end{array}
if (*.f64 l l) < 5.00000000000000033e-69Initial program 31.0%
associate-*l*31.0%
associate-*l*31.0%
associate-/r*31.0%
associate-/r/31.0%
*-commutative31.0%
times-frac33.0%
+-commutative33.0%
associate--l+47.1%
metadata-eval47.1%
+-rgt-identity47.1%
times-frac60.2%
Simplified60.2%
Taylor expanded in t around 0 84.8%
unpow284.8%
Simplified84.8%
associate-*l/84.8%
associate-*l*89.2%
Applied egg-rr89.2%
associate-*l/88.5%
associate-*r*92.3%
Simplified92.3%
Taylor expanded in k around inf 88.6%
*-commutative88.6%
associate-*r*88.6%
unpow288.6%
associate-*r*89.6%
associate-*r/89.6%
associate-/r*93.1%
*-commutative93.1%
associate-/r*97.0%
Simplified97.0%
Taylor expanded in k around 0 94.6%
if 5.00000000000000033e-69 < (*.f64 l l) Initial program 37.7%
associate-*l*37.7%
associate-*l*37.7%
associate-/r*37.7%
associate-/r/37.7%
*-commutative37.7%
times-frac37.7%
+-commutative37.7%
associate--l+39.7%
metadata-eval39.7%
+-rgt-identity39.7%
times-frac39.7%
Simplified39.7%
Taylor expanded in t around 0 68.0%
unpow268.0%
Simplified68.0%
associate-*l/68.0%
associate-*l*73.1%
Applied egg-rr73.1%
associate-*l/73.1%
associate-*r*81.4%
Simplified81.4%
Taylor expanded in k around inf 74.6%
*-commutative74.6%
associate-*r*74.6%
unpow274.6%
associate-*r*81.4%
associate-*r/81.4%
associate-/r*81.5%
*-commutative81.5%
associate-/r*92.4%
Simplified92.4%
times-frac89.4%
Applied egg-rr89.4%
Final simplification91.5%
(FPCore (t l k) :precision binary64 (* (/ l (tan k)) (* 2.0 (/ (/ l (* k k)) (* t (sin k))))))
double code(double t, double l, double k) {
return (l / tan(k)) * (2.0 * ((l / (k * k)) / (t * sin(k))));
}
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = (l / tan(k)) * (2.0d0 * ((l / (k * k)) / (t * sin(k))))
end function
public static double code(double t, double l, double k) {
return (l / Math.tan(k)) * (2.0 * ((l / (k * k)) / (t * Math.sin(k))));
}
def code(t, l, k): return (l / math.tan(k)) * (2.0 * ((l / (k * k)) / (t * math.sin(k))))
function code(t, l, k) return Float64(Float64(l / tan(k)) * Float64(2.0 * Float64(Float64(l / Float64(k * k)) / Float64(t * sin(k))))) end
function tmp = code(t, l, k) tmp = (l / tan(k)) * (2.0 * ((l / (k * k)) / (t * sin(k)))); end
code[t_, l_, k_] := N[(N[(l / N[Tan[k], $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[(N[(l / N[(k * k), $MachinePrecision]), $MachinePrecision] / N[(t * N[Sin[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\ell}{\tan k} \cdot \left(2 \cdot \frac{\frac{\ell}{k \cdot k}}{t \cdot \sin k}\right)
\end{array}
Initial program 35.1%
associate-*l*35.1%
associate-*l*35.1%
associate-/r*35.1%
associate-/r/35.1%
*-commutative35.1%
times-frac35.9%
+-commutative35.9%
associate--l+42.6%
metadata-eval42.6%
+-rgt-identity42.6%
times-frac47.7%
Simplified47.7%
Taylor expanded in t around 0 74.6%
unpow274.6%
Simplified74.6%
associate-*l/74.6%
associate-*l*79.4%
Applied egg-rr79.4%
associate-*l/79.1%
associate-*r*85.7%
Simplified85.7%
Taylor expanded in k around inf 80.1%
*-commutative80.1%
associate-*r*80.1%
unpow280.1%
associate-*r*84.6%
associate-*r/84.6%
associate-/r*86.0%
*-commutative86.0%
associate-/r*94.2%
Simplified94.2%
Taylor expanded in l around 0 80.1%
associate-/r*83.2%
unpow283.2%
*-commutative83.2%
Simplified83.2%
Final simplification83.2%
(FPCore (t l k) :precision binary64 (* (/ l (tan k)) (* (/ l (sin k)) (/ 2.0 (* k (* k t))))))
double code(double t, double l, double k) {
return (l / tan(k)) * ((l / sin(k)) * (2.0 / (k * (k * t))));
}
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = (l / tan(k)) * ((l / sin(k)) * (2.0d0 / (k * (k * t))))
end function
public static double code(double t, double l, double k) {
return (l / Math.tan(k)) * ((l / Math.sin(k)) * (2.0 / (k * (k * t))));
}
def code(t, l, k): return (l / math.tan(k)) * ((l / math.sin(k)) * (2.0 / (k * (k * t))))
function code(t, l, k) return Float64(Float64(l / tan(k)) * Float64(Float64(l / sin(k)) * Float64(2.0 / Float64(k * Float64(k * t))))) end
function tmp = code(t, l, k) tmp = (l / tan(k)) * ((l / sin(k)) * (2.0 / (k * (k * t)))); end
code[t_, l_, k_] := N[(N[(l / N[Tan[k], $MachinePrecision]), $MachinePrecision] * N[(N[(l / N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[(2.0 / N[(k * N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\ell}{\tan k} \cdot \left(\frac{\ell}{\sin k} \cdot \frac{2}{k \cdot \left(k \cdot t\right)}\right)
\end{array}
Initial program 35.1%
associate-*l*35.1%
associate-*l*35.1%
associate-/r*35.1%
associate-/r/35.1%
*-commutative35.1%
times-frac35.9%
+-commutative35.9%
associate--l+42.6%
metadata-eval42.6%
+-rgt-identity42.6%
times-frac47.7%
Simplified47.7%
Taylor expanded in t around 0 74.6%
unpow274.6%
Simplified74.6%
associate-*l/74.6%
associate-*l*79.4%
Applied egg-rr79.4%
associate-*l/79.1%
associate-*r*85.7%
Simplified85.7%
Final simplification85.7%
(FPCore (t l k) :precision binary64 (* (/ l (tan k)) (/ (* 2.0 (/ l (sin k))) (* k (* k t)))))
double code(double t, double l, double k) {
return (l / tan(k)) * ((2.0 * (l / sin(k))) / (k * (k * t)));
}
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = (l / tan(k)) * ((2.0d0 * (l / sin(k))) / (k * (k * t)))
end function
public static double code(double t, double l, double k) {
return (l / Math.tan(k)) * ((2.0 * (l / Math.sin(k))) / (k * (k * t)));
}
def code(t, l, k): return (l / math.tan(k)) * ((2.0 * (l / math.sin(k))) / (k * (k * t)))
function code(t, l, k) return Float64(Float64(l / tan(k)) * Float64(Float64(2.0 * Float64(l / sin(k))) / Float64(k * Float64(k * t)))) end
function tmp = code(t, l, k) tmp = (l / tan(k)) * ((2.0 * (l / sin(k))) / (k * (k * t))); end
code[t_, l_, k_] := N[(N[(l / N[Tan[k], $MachinePrecision]), $MachinePrecision] * N[(N[(2.0 * N[(l / N[Sin[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(k * N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\ell}{\tan k} \cdot \frac{2 \cdot \frac{\ell}{\sin k}}{k \cdot \left(k \cdot t\right)}
\end{array}
Initial program 35.1%
associate-*l*35.1%
associate-*l*35.1%
associate-/r*35.1%
associate-/r/35.1%
*-commutative35.1%
times-frac35.9%
+-commutative35.9%
associate--l+42.6%
metadata-eval42.6%
+-rgt-identity42.6%
times-frac47.7%
Simplified47.7%
Taylor expanded in t around 0 74.6%
unpow274.6%
Simplified74.6%
associate-*l/74.6%
associate-*l*79.4%
Applied egg-rr79.4%
associate-*l/79.1%
associate-*r*85.7%
Simplified85.7%
associate-*l/86.0%
Applied egg-rr86.0%
Final simplification86.0%
(FPCore (t l k) :precision binary64 (* (/ l (tan k)) (/ (* 2.0 (/ l (* k (* k t)))) (sin k))))
double code(double t, double l, double k) {
return (l / tan(k)) * ((2.0 * (l / (k * (k * t)))) / sin(k));
}
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = (l / tan(k)) * ((2.0d0 * (l / (k * (k * t)))) / sin(k))
end function
public static double code(double t, double l, double k) {
return (l / Math.tan(k)) * ((2.0 * (l / (k * (k * t)))) / Math.sin(k));
}
def code(t, l, k): return (l / math.tan(k)) * ((2.0 * (l / (k * (k * t)))) / math.sin(k))
function code(t, l, k) return Float64(Float64(l / tan(k)) * Float64(Float64(2.0 * Float64(l / Float64(k * Float64(k * t)))) / sin(k))) end
function tmp = code(t, l, k) tmp = (l / tan(k)) * ((2.0 * (l / (k * (k * t)))) / sin(k)); end
code[t_, l_, k_] := N[(N[(l / N[Tan[k], $MachinePrecision]), $MachinePrecision] * N[(N[(2.0 * N[(l / N[(k * N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sin[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\ell}{\tan k} \cdot \frac{2 \cdot \frac{\ell}{k \cdot \left(k \cdot t\right)}}{\sin k}
\end{array}
Initial program 35.1%
associate-*l*35.1%
associate-*l*35.1%
associate-/r*35.1%
associate-/r/35.1%
*-commutative35.1%
times-frac35.9%
+-commutative35.9%
associate--l+42.6%
metadata-eval42.6%
+-rgt-identity42.6%
times-frac47.7%
Simplified47.7%
Taylor expanded in t around 0 74.6%
unpow274.6%
Simplified74.6%
associate-*l/74.6%
associate-*l*79.4%
Applied egg-rr79.4%
associate-*l/79.1%
associate-*r*85.7%
Simplified85.7%
Taylor expanded in k around inf 80.1%
*-commutative80.1%
associate-*r*80.1%
unpow280.1%
associate-*r*84.6%
associate-*r/84.6%
associate-/r*86.0%
*-commutative86.0%
associate-/r*94.2%
Simplified94.2%
Taylor expanded in l around 0 80.1%
unpow280.1%
associate-*r*86.0%
Simplified86.0%
Final simplification86.0%
(FPCore (t l k) :precision binary64 (* (/ (/ (/ (* l 2.0) (* k t)) k) (sin k)) (/ l (tan k))))
double code(double t, double l, double k) {
return ((((l * 2.0) / (k * t)) / k) / sin(k)) * (l / tan(k));
}
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = ((((l * 2.0d0) / (k * t)) / k) / sin(k)) * (l / tan(k))
end function
public static double code(double t, double l, double k) {
return ((((l * 2.0) / (k * t)) / k) / Math.sin(k)) * (l / Math.tan(k));
}
def code(t, l, k): return ((((l * 2.0) / (k * t)) / k) / math.sin(k)) * (l / math.tan(k))
function code(t, l, k) return Float64(Float64(Float64(Float64(Float64(l * 2.0) / Float64(k * t)) / k) / sin(k)) * Float64(l / tan(k))) end
function tmp = code(t, l, k) tmp = ((((l * 2.0) / (k * t)) / k) / sin(k)) * (l / tan(k)); end
code[t_, l_, k_] := N[(N[(N[(N[(N[(l * 2.0), $MachinePrecision] / N[(k * t), $MachinePrecision]), $MachinePrecision] / k), $MachinePrecision] / N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[(l / N[Tan[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{\frac{\ell \cdot 2}{k \cdot t}}{k}}{\sin k} \cdot \frac{\ell}{\tan k}
\end{array}
Initial program 35.1%
associate-*l*35.1%
associate-*l*35.1%
associate-/r*35.1%
associate-/r/35.1%
*-commutative35.1%
times-frac35.9%
+-commutative35.9%
associate--l+42.6%
metadata-eval42.6%
+-rgt-identity42.6%
times-frac47.7%
Simplified47.7%
Taylor expanded in t around 0 74.6%
unpow274.6%
Simplified74.6%
associate-*l/74.6%
associate-*l*79.4%
Applied egg-rr79.4%
associate-*l/79.1%
associate-*r*85.7%
Simplified85.7%
Taylor expanded in k around inf 80.1%
*-commutative80.1%
associate-*r*80.1%
unpow280.1%
associate-*r*84.6%
associate-*r/84.6%
associate-/r*86.0%
*-commutative86.0%
associate-/r*94.2%
Simplified94.2%
Final simplification94.2%
(FPCore (t l k) :precision binary64 (* (/ l k) (* (/ l (sin k)) (/ 2.0 (* k (* k t))))))
double code(double t, double l, double k) {
return (l / k) * ((l / sin(k)) * (2.0 / (k * (k * t))));
}
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = (l / k) * ((l / sin(k)) * (2.0d0 / (k * (k * t))))
end function
public static double code(double t, double l, double k) {
return (l / k) * ((l / Math.sin(k)) * (2.0 / (k * (k * t))));
}
def code(t, l, k): return (l / k) * ((l / math.sin(k)) * (2.0 / (k * (k * t))))
function code(t, l, k) return Float64(Float64(l / k) * Float64(Float64(l / sin(k)) * Float64(2.0 / Float64(k * Float64(k * t))))) end
function tmp = code(t, l, k) tmp = (l / k) * ((l / sin(k)) * (2.0 / (k * (k * t)))); end
code[t_, l_, k_] := N[(N[(l / k), $MachinePrecision] * N[(N[(l / N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[(2.0 / N[(k * N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\ell}{k} \cdot \left(\frac{\ell}{\sin k} \cdot \frac{2}{k \cdot \left(k \cdot t\right)}\right)
\end{array}
Initial program 35.1%
associate-*l*35.1%
associate-*l*35.1%
associate-/r*35.1%
associate-/r/35.1%
*-commutative35.1%
times-frac35.9%
+-commutative35.9%
associate--l+42.6%
metadata-eval42.6%
+-rgt-identity42.6%
times-frac47.7%
Simplified47.7%
Taylor expanded in t around 0 74.6%
unpow274.6%
Simplified74.6%
associate-*l/74.6%
associate-*l*79.4%
Applied egg-rr79.4%
associate-*l/79.1%
associate-*r*85.7%
Simplified85.7%
Taylor expanded in k around 0 73.5%
Final simplification73.5%
(FPCore (t l k) :precision binary64 (* (/ (/ (/ (* l 2.0) (* k t)) k) (sin k)) (/ l k)))
double code(double t, double l, double k) {
return ((((l * 2.0) / (k * t)) / k) / sin(k)) * (l / k);
}
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = ((((l * 2.0d0) / (k * t)) / k) / sin(k)) * (l / k)
end function
public static double code(double t, double l, double k) {
return ((((l * 2.0) / (k * t)) / k) / Math.sin(k)) * (l / k);
}
def code(t, l, k): return ((((l * 2.0) / (k * t)) / k) / math.sin(k)) * (l / k)
function code(t, l, k) return Float64(Float64(Float64(Float64(Float64(l * 2.0) / Float64(k * t)) / k) / sin(k)) * Float64(l / k)) end
function tmp = code(t, l, k) tmp = ((((l * 2.0) / (k * t)) / k) / sin(k)) * (l / k); end
code[t_, l_, k_] := N[(N[(N[(N[(N[(l * 2.0), $MachinePrecision] / N[(k * t), $MachinePrecision]), $MachinePrecision] / k), $MachinePrecision] / N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[(l / k), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{\frac{\ell \cdot 2}{k \cdot t}}{k}}{\sin k} \cdot \frac{\ell}{k}
\end{array}
Initial program 35.1%
associate-*l*35.1%
associate-*l*35.1%
associate-/r*35.1%
associate-/r/35.1%
*-commutative35.1%
times-frac35.9%
+-commutative35.9%
associate--l+42.6%
metadata-eval42.6%
+-rgt-identity42.6%
times-frac47.7%
Simplified47.7%
Taylor expanded in t around 0 74.6%
unpow274.6%
Simplified74.6%
associate-*l/74.6%
associate-*l*79.4%
Applied egg-rr79.4%
associate-*l/79.1%
associate-*r*85.7%
Simplified85.7%
Taylor expanded in k around inf 80.1%
*-commutative80.1%
associate-*r*80.1%
unpow280.1%
associate-*r*84.6%
associate-*r/84.6%
associate-/r*86.0%
*-commutative86.0%
associate-/r*94.2%
Simplified94.2%
Taylor expanded in k around 0 75.7%
Final simplification75.7%
(FPCore (t l k) :precision binary64 (* (* (/ l k) (/ l k)) (/ 2.0 (* t (* k k)))))
double code(double t, double l, double k) {
return ((l / k) * (l / k)) * (2.0 / (t * (k * k)));
}
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = ((l / k) * (l / k)) * (2.0d0 / (t * (k * k)))
end function
public static double code(double t, double l, double k) {
return ((l / k) * (l / k)) * (2.0 / (t * (k * k)));
}
def code(t, l, k): return ((l / k) * (l / k)) * (2.0 / (t * (k * k)))
function code(t, l, k) return Float64(Float64(Float64(l / k) * Float64(l / k)) * Float64(2.0 / Float64(t * Float64(k * k)))) end
function tmp = code(t, l, k) tmp = ((l / k) * (l / k)) * (2.0 / (t * (k * k))); end
code[t_, l_, k_] := N[(N[(N[(l / k), $MachinePrecision] * N[(l / k), $MachinePrecision]), $MachinePrecision] * N[(2.0 / N[(t * N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right) \cdot \frac{2}{t \cdot \left(k \cdot k\right)}
\end{array}
Initial program 35.1%
associate-*l*35.1%
associate-*l*35.1%
associate-/r*35.1%
associate-/r/35.1%
*-commutative35.1%
times-frac35.9%
+-commutative35.9%
associate--l+42.6%
metadata-eval42.6%
+-rgt-identity42.6%
times-frac47.7%
Simplified47.7%
Taylor expanded in t around 0 74.6%
unpow274.6%
Simplified74.6%
Taylor expanded in k around 0 64.1%
unpow264.1%
unpow264.1%
Simplified64.1%
times-frac70.5%
Applied egg-rr70.5%
Final simplification70.5%
(FPCore (t l k) :precision binary64 (* (/ 2.0 (* t (* k k))) (/ l (/ (* k k) l))))
double code(double t, double l, double k) {
return (2.0 / (t * (k * k))) * (l / ((k * k) / l));
}
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = (2.0d0 / (t * (k * k))) * (l / ((k * k) / l))
end function
public static double code(double t, double l, double k) {
return (2.0 / (t * (k * k))) * (l / ((k * k) / l));
}
def code(t, l, k): return (2.0 / (t * (k * k))) * (l / ((k * k) / l))
function code(t, l, k) return Float64(Float64(2.0 / Float64(t * Float64(k * k))) * Float64(l / Float64(Float64(k * k) / l))) end
function tmp = code(t, l, k) tmp = (2.0 / (t * (k * k))) * (l / ((k * k) / l)); end
code[t_, l_, k_] := N[(N[(2.0 / N[(t * N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(l / N[(N[(k * k), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{t \cdot \left(k \cdot k\right)} \cdot \frac{\ell}{\frac{k \cdot k}{\ell}}
\end{array}
Initial program 35.1%
associate-*l*35.1%
associate-*l*35.1%
associate-/r*35.1%
associate-/r/35.1%
*-commutative35.1%
times-frac35.9%
+-commutative35.9%
associate--l+42.6%
metadata-eval42.6%
+-rgt-identity42.6%
times-frac47.7%
Simplified47.7%
Taylor expanded in t around 0 74.6%
unpow274.6%
Simplified74.6%
Taylor expanded in k around 0 64.1%
unpow264.1%
unpow264.1%
Simplified64.1%
Taylor expanded in l around 0 64.1%
unpow264.1%
associate-/l*70.5%
unpow270.5%
Simplified70.5%
Final simplification70.5%
(FPCore (t l k) :precision binary64 (* (* (/ l k) (/ l k)) (/ (/ (/ 2.0 k) k) t)))
double code(double t, double l, double k) {
return ((l / k) * (l / k)) * (((2.0 / k) / k) / t);
}
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = ((l / k) * (l / k)) * (((2.0d0 / k) / k) / t)
end function
public static double code(double t, double l, double k) {
return ((l / k) * (l / k)) * (((2.0 / k) / k) / t);
}
def code(t, l, k): return ((l / k) * (l / k)) * (((2.0 / k) / k) / t)
function code(t, l, k) return Float64(Float64(Float64(l / k) * Float64(l / k)) * Float64(Float64(Float64(2.0 / k) / k) / t)) end
function tmp = code(t, l, k) tmp = ((l / k) * (l / k)) * (((2.0 / k) / k) / t); end
code[t_, l_, k_] := N[(N[(N[(l / k), $MachinePrecision] * N[(l / k), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(2.0 / k), $MachinePrecision] / k), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right) \cdot \frac{\frac{\frac{2}{k}}{k}}{t}
\end{array}
Initial program 35.1%
associate-*l*35.1%
associate-*l*35.1%
associate-/r*35.1%
associate-/r/35.1%
*-commutative35.1%
times-frac35.9%
+-commutative35.9%
associate--l+42.6%
metadata-eval42.6%
+-rgt-identity42.6%
times-frac47.7%
Simplified47.7%
Taylor expanded in t around 0 74.6%
unpow274.6%
Simplified74.6%
Taylor expanded in k around 0 64.1%
unpow264.1%
unpow264.1%
Simplified64.1%
times-frac70.5%
Applied egg-rr70.5%
Taylor expanded in k around 0 70.5%
associate-/r*70.5%
unpow270.5%
associate-/r*70.6%
Simplified70.6%
Final simplification70.6%
(FPCore (t l k) :precision binary64 (/ (* 2.0 (* (/ l k) (/ l k))) (* k (* k t))))
double code(double t, double l, double k) {
return (2.0 * ((l / k) * (l / k))) / (k * (k * t));
}
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = (2.0d0 * ((l / k) * (l / k))) / (k * (k * t))
end function
public static double code(double t, double l, double k) {
return (2.0 * ((l / k) * (l / k))) / (k * (k * t));
}
def code(t, l, k): return (2.0 * ((l / k) * (l / k))) / (k * (k * t))
function code(t, l, k) return Float64(Float64(2.0 * Float64(Float64(l / k) * Float64(l / k))) / Float64(k * Float64(k * t))) end
function tmp = code(t, l, k) tmp = (2.0 * ((l / k) * (l / k))) / (k * (k * t)); end
code[t_, l_, k_] := N[(N[(2.0 * N[(N[(l / k), $MachinePrecision] * N[(l / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(k * N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2 \cdot \left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right)}{k \cdot \left(k \cdot t\right)}
\end{array}
Initial program 35.1%
associate-*l*35.1%
associate-*l*35.1%
associate-/r*35.1%
associate-/r/35.1%
*-commutative35.1%
times-frac35.9%
+-commutative35.9%
associate--l+42.6%
metadata-eval42.6%
+-rgt-identity42.6%
times-frac47.7%
Simplified47.7%
Taylor expanded in t around 0 74.6%
unpow274.6%
Simplified74.6%
Taylor expanded in k around 0 64.1%
unpow264.1%
unpow264.1%
Simplified64.1%
associate-*r*64.1%
associate-*l/64.1%
times-frac72.3%
Applied egg-rr72.3%
Final simplification72.3%
herbie shell --seed 2023189
(FPCore (t l k)
:name "Toniolo and Linder, Equation (10-)"
:precision binary64
(/ 2.0 (* (* (* (/ (pow t 3.0) (* l l)) (sin k)) (tan k)) (- (+ 1.0 (pow (/ k t) 2.0)) 1.0))))