
(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 11 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) 2e+152) (/ (* l (/ 2.0 (* k (* k t)))) (* (/ (sin k) l) (tan k))) (/ (/ (* (pow (/ l k) 2.0) (/ 2.0 t)) (sin k)) (tan k))))
double code(double t, double l, double k) {
double tmp;
if ((l * l) <= 2e+152) {
tmp = (l * (2.0 / (k * (k * t)))) / ((sin(k) / l) * tan(k));
} else {
tmp = ((pow((l / k), 2.0) * (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) <= 2d+152) then
tmp = (l * (2.0d0 / (k * (k * t)))) / ((sin(k) / l) * tan(k))
else
tmp = ((((l / k) ** 2.0d0) * (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) <= 2e+152) {
tmp = (l * (2.0 / (k * (k * t)))) / ((Math.sin(k) / l) * Math.tan(k));
} else {
tmp = ((Math.pow((l / k), 2.0) * (2.0 / t)) / Math.sin(k)) / Math.tan(k);
}
return tmp;
}
def code(t, l, k): tmp = 0 if (l * l) <= 2e+152: tmp = (l * (2.0 / (k * (k * t)))) / ((math.sin(k) / l) * math.tan(k)) else: tmp = ((math.pow((l / k), 2.0) * (2.0 / t)) / math.sin(k)) / math.tan(k) return tmp
function code(t, l, k) tmp = 0.0 if (Float64(l * l) <= 2e+152) tmp = Float64(Float64(l * Float64(2.0 / Float64(k * Float64(k * t)))) / Float64(Float64(sin(k) / l) * tan(k))); else tmp = Float64(Float64(Float64((Float64(l / k) ^ 2.0) * Float64(2.0 / t)) / sin(k)) / tan(k)); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if ((l * l) <= 2e+152) tmp = (l * (2.0 / (k * (k * t)))) / ((sin(k) / l) * tan(k)); else tmp = ((((l / k) ^ 2.0) * (2.0 / t)) / sin(k)) / tan(k); end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[N[(l * l), $MachinePrecision], 2e+152], N[(N[(l * N[(2.0 / N[(k * N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(N[Sin[k], $MachinePrecision] / l), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[Power[N[(l / k), $MachinePrecision], 2.0], $MachinePrecision] * N[(2.0 / t), $MachinePrecision]), $MachinePrecision] / N[Sin[k], $MachinePrecision]), $MachinePrecision] / N[Tan[k], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \cdot \ell \leq 2 \cdot 10^{+152}:\\
\;\;\;\;\frac{\ell \cdot \frac{2}{k \cdot \left(k \cdot t\right)}}{\frac{\sin k}{\ell} \cdot \tan k}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{{\left(\frac{\ell}{k}\right)}^{2} \cdot \frac{2}{t}}{\sin k}}{\tan k}\\
\end{array}
\end{array}
if (*.f64 l l) < 2.0000000000000001e152Initial program 31.4%
associate-*l*31.4%
associate-*l*31.4%
associate-/r*31.4%
associate-/r/31.4%
*-commutative31.4%
times-frac32.0%
+-commutative32.0%
associate--l+46.4%
metadata-eval46.4%
+-rgt-identity46.4%
times-frac56.0%
Simplified56.0%
Taylor expanded in t around 0 85.7%
unpow285.7%
Simplified85.7%
associate-*l/85.7%
associate-*l*93.3%
Applied egg-rr93.3%
associate-*l/93.3%
*-commutative93.3%
associate-/r/93.4%
Simplified93.4%
associate-*l/95.8%
associate-/r/95.8%
Applied egg-rr95.8%
if 2.0000000000000001e152 < (*.f64 l l) Initial program 33.0%
associate-*l*33.0%
associate-*l*33.0%
associate-/r*33.0%
associate-/r/33.0%
*-commutative33.0%
times-frac33.1%
+-commutative33.1%
associate--l+34.9%
metadata-eval34.9%
+-rgt-identity34.9%
times-frac34.9%
Simplified34.9%
Taylor expanded in t around 0 64.3%
unpow264.3%
Simplified64.3%
associate-*r/64.3%
Applied egg-rr64.3%
associate-*r/64.3%
associate-*r*66.3%
*-commutative66.3%
Applied egg-rr66.3%
Taylor expanded in k around inf 64.3%
associate-*r/64.3%
*-commutative64.3%
associate-*l*64.3%
*-commutative64.3%
associate-/l/64.3%
*-commutative64.3%
times-frac68.0%
unpow268.0%
unpow268.0%
times-frac94.9%
unpow294.9%
Simplified94.9%
Final simplification95.4%
(FPCore (t l k)
:precision binary64
(if (<= k 6.2e-9)
(* (/ 2.0 (* k (* k t))) (/ l (/ k (/ l k))))
(if (<= k 3.2e+150)
(* (/ 2.0 (* t (* k k))) (* (/ l (tan k)) (/ l (sin k))))
(* 2.0 (* (pow (/ l k) 2.0) (/ -0.16666666666666666 t))))))
double code(double t, double l, double k) {
double tmp;
if (k <= 6.2e-9) {
tmp = (2.0 / (k * (k * t))) * (l / (k / (l / k)));
} else if (k <= 3.2e+150) {
tmp = (2.0 / (t * (k * k))) * ((l / tan(k)) * (l / sin(k)));
} else {
tmp = 2.0 * (pow((l / k), 2.0) * (-0.16666666666666666 / 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) :: tmp
if (k <= 6.2d-9) then
tmp = (2.0d0 / (k * (k * t))) * (l / (k / (l / k)))
else if (k <= 3.2d+150) then
tmp = (2.0d0 / (t * (k * k))) * ((l / tan(k)) * (l / sin(k)))
else
tmp = 2.0d0 * (((l / k) ** 2.0d0) * ((-0.16666666666666666d0) / t))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double tmp;
if (k <= 6.2e-9) {
tmp = (2.0 / (k * (k * t))) * (l / (k / (l / k)));
} else if (k <= 3.2e+150) {
tmp = (2.0 / (t * (k * k))) * ((l / Math.tan(k)) * (l / Math.sin(k)));
} else {
tmp = 2.0 * (Math.pow((l / k), 2.0) * (-0.16666666666666666 / t));
}
return tmp;
}
def code(t, l, k): tmp = 0 if k <= 6.2e-9: tmp = (2.0 / (k * (k * t))) * (l / (k / (l / k))) elif k <= 3.2e+150: tmp = (2.0 / (t * (k * k))) * ((l / math.tan(k)) * (l / math.sin(k))) else: tmp = 2.0 * (math.pow((l / k), 2.0) * (-0.16666666666666666 / t)) return tmp
function code(t, l, k) tmp = 0.0 if (k <= 6.2e-9) tmp = Float64(Float64(2.0 / Float64(k * Float64(k * t))) * Float64(l / Float64(k / Float64(l / k)))); elseif (k <= 3.2e+150) tmp = Float64(Float64(2.0 / Float64(t * Float64(k * k))) * Float64(Float64(l / tan(k)) * Float64(l / sin(k)))); else tmp = Float64(2.0 * Float64((Float64(l / k) ^ 2.0) * Float64(-0.16666666666666666 / t))); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if (k <= 6.2e-9) tmp = (2.0 / (k * (k * t))) * (l / (k / (l / k))); elseif (k <= 3.2e+150) tmp = (2.0 / (t * (k * k))) * ((l / tan(k)) * (l / sin(k))); else tmp = 2.0 * (((l / k) ^ 2.0) * (-0.16666666666666666 / t)); end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[k, 6.2e-9], N[(N[(2.0 / N[(k * N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(l / N[(k / N[(l / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 3.2e+150], N[(N[(2.0 / N[(t * N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(l / N[Tan[k], $MachinePrecision]), $MachinePrecision] * N[(l / N[Sin[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[Power[N[(l / k), $MachinePrecision], 2.0], $MachinePrecision] * N[(-0.16666666666666666 / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 6.2 \cdot 10^{-9}:\\
\;\;\;\;\frac{2}{k \cdot \left(k \cdot t\right)} \cdot \frac{\ell}{\frac{k}{\frac{\ell}{k}}}\\
\mathbf{elif}\;k \leq 3.2 \cdot 10^{+150}:\\
\;\;\;\;\frac{2}{t \cdot \left(k \cdot k\right)} \cdot \left(\frac{\ell}{\tan k} \cdot \frac{\ell}{\sin k}\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left({\left(\frac{\ell}{k}\right)}^{2} \cdot \frac{-0.16666666666666666}{t}\right)\\
\end{array}
\end{array}
if k < 6.2000000000000001e-9Initial program 34.7%
associate-*l*34.7%
associate-*l*34.7%
associate-/r*34.7%
associate-/r/34.7%
*-commutative34.7%
times-frac35.2%
+-commutative35.2%
associate--l+43.4%
metadata-eval43.4%
+-rgt-identity43.4%
times-frac51.0%
Simplified51.0%
Taylor expanded in t around 0 81.7%
unpow281.7%
Simplified81.7%
associate-*l/81.7%
associate-*l*87.8%
Applied egg-rr87.8%
associate-*l/87.8%
*-commutative87.8%
associate-/r/87.8%
Simplified87.8%
Taylor expanded in k around 0 74.3%
unpow274.3%
associate-/l*77.8%
Simplified77.8%
if 6.2000000000000001e-9 < k < 3.20000000000000016e150Initial program 24.6%
associate-*l*24.4%
associate-*l*24.4%
associate-/r*24.5%
associate-/r/24.4%
*-commutative24.4%
times-frac27.3%
+-commutative27.3%
associate--l+39.4%
metadata-eval39.4%
+-rgt-identity39.4%
times-frac39.4%
Simplified39.4%
Taylor expanded in t around 0 79.1%
unpow279.1%
Simplified79.1%
if 3.20000000000000016e150 < k Initial program 25.9%
+-rgt-identity25.7%
associate-*l*25.7%
mul0-rgt10.6%
distribute-lft-in25.9%
+-rgt-identity25.9%
sub-neg25.9%
+-commutative25.9%
associate-+l+36.4%
metadata-eval36.4%
metadata-eval36.4%
+-rgt-identity36.4%
Simplified36.4%
Taylor expanded in t around 0 49.7%
unpow249.7%
times-frac52.0%
unpow252.0%
*-commutative52.0%
Simplified52.0%
Taylor expanded in k around 0 49.7%
distribute-lft-out49.7%
distribute-rgt-out--49.7%
metadata-eval49.7%
unpow249.7%
times-frac49.9%
unpow249.9%
associate-/l*49.9%
unpow249.9%
*-commutative49.9%
times-frac51.1%
Simplified51.1%
Taylor expanded in k around inf 49.7%
associate-*r/49.7%
*-commutative49.7%
times-frac49.9%
unpow249.9%
unpow249.9%
times-frac56.9%
unpow256.9%
Simplified56.9%
Final simplification74.9%
(FPCore (t l k)
:precision binary64
(if (<= k 1.95e-14)
(* (/ 2.0 (* k (* k t))) (/ l (/ k (/ l k))))
(if (<= k 3e+150)
(* (/ 2.0 (* t (* k k))) (/ (* l (/ l (tan k))) (sin k)))
(* 2.0 (* (pow (/ l k) 2.0) (/ -0.16666666666666666 t))))))
double code(double t, double l, double k) {
double tmp;
if (k <= 1.95e-14) {
tmp = (2.0 / (k * (k * t))) * (l / (k / (l / k)));
} else if (k <= 3e+150) {
tmp = (2.0 / (t * (k * k))) * ((l * (l / tan(k))) / sin(k));
} else {
tmp = 2.0 * (pow((l / k), 2.0) * (-0.16666666666666666 / 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) :: tmp
if (k <= 1.95d-14) then
tmp = (2.0d0 / (k * (k * t))) * (l / (k / (l / k)))
else if (k <= 3d+150) then
tmp = (2.0d0 / (t * (k * k))) * ((l * (l / tan(k))) / sin(k))
else
tmp = 2.0d0 * (((l / k) ** 2.0d0) * ((-0.16666666666666666d0) / t))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double tmp;
if (k <= 1.95e-14) {
tmp = (2.0 / (k * (k * t))) * (l / (k / (l / k)));
} else if (k <= 3e+150) {
tmp = (2.0 / (t * (k * k))) * ((l * (l / Math.tan(k))) / Math.sin(k));
} else {
tmp = 2.0 * (Math.pow((l / k), 2.0) * (-0.16666666666666666 / t));
}
return tmp;
}
def code(t, l, k): tmp = 0 if k <= 1.95e-14: tmp = (2.0 / (k * (k * t))) * (l / (k / (l / k))) elif k <= 3e+150: tmp = (2.0 / (t * (k * k))) * ((l * (l / math.tan(k))) / math.sin(k)) else: tmp = 2.0 * (math.pow((l / k), 2.0) * (-0.16666666666666666 / t)) return tmp
function code(t, l, k) tmp = 0.0 if (k <= 1.95e-14) tmp = Float64(Float64(2.0 / Float64(k * Float64(k * t))) * Float64(l / Float64(k / Float64(l / k)))); elseif (k <= 3e+150) tmp = Float64(Float64(2.0 / Float64(t * Float64(k * k))) * Float64(Float64(l * Float64(l / tan(k))) / sin(k))); else tmp = Float64(2.0 * Float64((Float64(l / k) ^ 2.0) * Float64(-0.16666666666666666 / t))); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if (k <= 1.95e-14) tmp = (2.0 / (k * (k * t))) * (l / (k / (l / k))); elseif (k <= 3e+150) tmp = (2.0 / (t * (k * k))) * ((l * (l / tan(k))) / sin(k)); else tmp = 2.0 * (((l / k) ^ 2.0) * (-0.16666666666666666 / t)); end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[k, 1.95e-14], N[(N[(2.0 / N[(k * N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(l / N[(k / N[(l / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 3e+150], N[(N[(2.0 / N[(t * N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(l * N[(l / N[Tan[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sin[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[Power[N[(l / k), $MachinePrecision], 2.0], $MachinePrecision] * N[(-0.16666666666666666 / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 1.95 \cdot 10^{-14}:\\
\;\;\;\;\frac{2}{k \cdot \left(k \cdot t\right)} \cdot \frac{\ell}{\frac{k}{\frac{\ell}{k}}}\\
\mathbf{elif}\;k \leq 3 \cdot 10^{+150}:\\
\;\;\;\;\frac{2}{t \cdot \left(k \cdot k\right)} \cdot \frac{\ell \cdot \frac{\ell}{\tan k}}{\sin k}\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left({\left(\frac{\ell}{k}\right)}^{2} \cdot \frac{-0.16666666666666666}{t}\right)\\
\end{array}
\end{array}
if k < 1.9499999999999999e-14Initial program 35.3%
associate-*l*35.3%
associate-*l*35.3%
associate-/r*35.3%
associate-/r/35.3%
*-commutative35.3%
times-frac35.8%
+-commutative35.8%
associate--l+44.1%
metadata-eval44.1%
+-rgt-identity44.1%
times-frac51.9%
Simplified51.9%
Taylor expanded in t around 0 81.9%
unpow281.9%
Simplified81.9%
associate-*l/81.9%
associate-*l*88.1%
Applied egg-rr88.1%
associate-*l/88.1%
*-commutative88.1%
associate-/r/88.1%
Simplified88.1%
Taylor expanded in k around 0 74.3%
unpow274.3%
associate-/l*78.0%
Simplified78.0%
if 1.9499999999999999e-14 < k < 3.00000000000000012e150Initial program 22.5%
associate-*l*22.4%
associate-*l*22.4%
associate-/r*22.4%
associate-/r/22.4%
*-commutative22.4%
times-frac25.0%
+-commutative25.0%
associate--l+36.1%
metadata-eval36.1%
+-rgt-identity36.1%
times-frac36.1%
Simplified36.1%
Taylor expanded in t around 0 78.1%
unpow278.1%
Simplified78.1%
associate-*l/78.1%
Applied egg-rr78.1%
if 3.00000000000000012e150 < k Initial program 25.9%
+-rgt-identity25.7%
associate-*l*25.7%
mul0-rgt10.6%
distribute-lft-in25.9%
+-rgt-identity25.9%
sub-neg25.9%
+-commutative25.9%
associate-+l+36.4%
metadata-eval36.4%
metadata-eval36.4%
+-rgt-identity36.4%
Simplified36.4%
Taylor expanded in t around 0 49.7%
unpow249.7%
times-frac52.0%
unpow252.0%
*-commutative52.0%
Simplified52.0%
Taylor expanded in k around 0 49.7%
distribute-lft-out49.7%
distribute-rgt-out--49.7%
metadata-eval49.7%
unpow249.7%
times-frac49.9%
unpow249.9%
associate-/l*49.9%
unpow249.9%
*-commutative49.9%
times-frac51.1%
Simplified51.1%
Taylor expanded in k around inf 49.7%
associate-*r/49.7%
*-commutative49.7%
times-frac49.9%
unpow249.9%
unpow249.9%
times-frac56.9%
unpow256.9%
Simplified56.9%
Final simplification74.9%
(FPCore (t l k) :precision binary64 (if (<= k 1.95e-14) (* (/ 2.0 (* k (* k t))) (/ l (/ k (/ l k)))) (* (/ l (/ (sin k) l)) (/ (/ (/ (/ 2.0 k) t) k) (tan k)))))
double code(double t, double l, double k) {
double tmp;
if (k <= 1.95e-14) {
tmp = (2.0 / (k * (k * t))) * (l / (k / (l / k)));
} else {
tmp = (l / (sin(k) / l)) * ((((2.0 / k) / t) / 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 (k <= 1.95d-14) then
tmp = (2.0d0 / (k * (k * t))) * (l / (k / (l / k)))
else
tmp = (l / (sin(k) / l)) * ((((2.0d0 / k) / t) / k) / tan(k))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double tmp;
if (k <= 1.95e-14) {
tmp = (2.0 / (k * (k * t))) * (l / (k / (l / k)));
} else {
tmp = (l / (Math.sin(k) / l)) * ((((2.0 / k) / t) / k) / Math.tan(k));
}
return tmp;
}
def code(t, l, k): tmp = 0 if k <= 1.95e-14: tmp = (2.0 / (k * (k * t))) * (l / (k / (l / k))) else: tmp = (l / (math.sin(k) / l)) * ((((2.0 / k) / t) / k) / math.tan(k)) return tmp
function code(t, l, k) tmp = 0.0 if (k <= 1.95e-14) tmp = Float64(Float64(2.0 / Float64(k * Float64(k * t))) * Float64(l / Float64(k / Float64(l / k)))); else tmp = Float64(Float64(l / Float64(sin(k) / l)) * Float64(Float64(Float64(Float64(2.0 / k) / t) / k) / tan(k))); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if (k <= 1.95e-14) tmp = (2.0 / (k * (k * t))) * (l / (k / (l / k))); else tmp = (l / (sin(k) / l)) * ((((2.0 / k) / t) / k) / tan(k)); end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[k, 1.95e-14], N[(N[(2.0 / N[(k * N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(l / N[(k / N[(l / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(l / N[(N[Sin[k], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(N[(2.0 / k), $MachinePrecision] / t), $MachinePrecision] / k), $MachinePrecision] / N[Tan[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 1.95 \cdot 10^{-14}:\\
\;\;\;\;\frac{2}{k \cdot \left(k \cdot t\right)} \cdot \frac{\ell}{\frac{k}{\frac{\ell}{k}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\ell}{\frac{\sin k}{\ell}} \cdot \frac{\frac{\frac{\frac{2}{k}}{t}}{k}}{\tan k}\\
\end{array}
\end{array}
if k < 1.9499999999999999e-14Initial program 35.3%
associate-*l*35.3%
associate-*l*35.3%
associate-/r*35.3%
associate-/r/35.3%
*-commutative35.3%
times-frac35.8%
+-commutative35.8%
associate--l+44.1%
metadata-eval44.1%
+-rgt-identity44.1%
times-frac51.9%
Simplified51.9%
Taylor expanded in t around 0 81.9%
unpow281.9%
Simplified81.9%
associate-*l/81.9%
associate-*l*88.1%
Applied egg-rr88.1%
associate-*l/88.1%
*-commutative88.1%
associate-/r/88.1%
Simplified88.1%
Taylor expanded in k around 0 74.3%
unpow274.3%
associate-/l*78.0%
Simplified78.0%
if 1.9499999999999999e-14 < k Initial program 24.3%
associate-*l*24.2%
associate-*l*24.2%
associate-/r*24.2%
associate-/r/24.2%
*-commutative24.2%
times-frac24.3%
+-commutative24.3%
associate--l+35.2%
metadata-eval35.2%
+-rgt-identity35.2%
times-frac35.2%
Simplified35.2%
Taylor expanded in t around 0 63.5%
unpow263.5%
Simplified63.5%
associate-*l/63.5%
associate-*l*66.4%
Applied egg-rr66.4%
associate-*l/66.4%
*-commutative66.4%
associate-/r/66.4%
Simplified66.4%
expm1-log1p-u56.4%
expm1-udef48.5%
frac-times50.8%
associate-/r/50.8%
Applied egg-rr50.8%
expm1-def58.7%
expm1-log1p74.0%
times-frac66.4%
associate-*l/73.9%
times-frac66.4%
associate-/r*66.7%
*-commutative66.7%
associate-/r*66.8%
Simplified66.8%
Final simplification74.8%
(FPCore (t l k) :precision binary64 (* (/ 2.0 (* k (* k t))) (/ l (/ (sin k) (/ l (tan k))))))
double code(double t, double l, double k) {
return (2.0 / (k * (k * t))) * (l / (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 = (2.0d0 / (k * (k * t))) * (l / (sin(k) / (l / tan(k))))
end function
public static double code(double t, double l, double k) {
return (2.0 / (k * (k * t))) * (l / (Math.sin(k) / (l / Math.tan(k))));
}
def code(t, l, k): return (2.0 / (k * (k * t))) * (l / (math.sin(k) / (l / math.tan(k))))
function code(t, l, k) return Float64(Float64(2.0 / Float64(k * Float64(k * t))) * Float64(l / Float64(sin(k) / Float64(l / tan(k))))) end
function tmp = code(t, l, k) tmp = (2.0 / (k * (k * t))) * (l / (sin(k) / (l / tan(k)))); end
code[t_, l_, k_] := N[(N[(2.0 / N[(k * N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(l / N[(N[Sin[k], $MachinePrecision] / N[(l / N[Tan[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{k \cdot \left(k \cdot t\right)} \cdot \frac{\ell}{\frac{\sin k}{\frac{\ell}{\tan k}}}
\end{array}
Initial program 32.1%
associate-*l*32.1%
associate-*l*32.1%
associate-/r*32.1%
associate-/r/32.1%
*-commutative32.1%
times-frac32.5%
+-commutative32.5%
associate--l+41.5%
metadata-eval41.5%
+-rgt-identity41.5%
times-frac47.0%
Simplified47.0%
Taylor expanded in t around 0 76.6%
unpow276.6%
Simplified76.6%
associate-*l/76.6%
associate-*l*81.8%
Applied egg-rr81.8%
associate-*l/81.8%
*-commutative81.8%
associate-/r/81.8%
Simplified81.8%
Final simplification81.8%
(FPCore (t l k) :precision binary64 (* (/ l (/ (sin k) (/ l (tan k)))) (/ (/ (/ 2.0 k) t) k)))
double code(double t, double l, double k) {
return (l / (sin(k) / (l / tan(k)))) * (((2.0 / k) / t) / 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 / (sin(k) / (l / tan(k)))) * (((2.0d0 / k) / t) / k)
end function
public static double code(double t, double l, double k) {
return (l / (Math.sin(k) / (l / Math.tan(k)))) * (((2.0 / k) / t) / k);
}
def code(t, l, k): return (l / (math.sin(k) / (l / math.tan(k)))) * (((2.0 / k) / t) / k)
function code(t, l, k) return Float64(Float64(l / Float64(sin(k) / Float64(l / tan(k)))) * Float64(Float64(Float64(2.0 / k) / t) / k)) end
function tmp = code(t, l, k) tmp = (l / (sin(k) / (l / tan(k)))) * (((2.0 / k) / t) / k); end
code[t_, l_, k_] := N[(N[(l / N[(N[Sin[k], $MachinePrecision] / N[(l / N[Tan[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(2.0 / k), $MachinePrecision] / t), $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\ell}{\frac{\sin k}{\frac{\ell}{\tan k}}} \cdot \frac{\frac{\frac{2}{k}}{t}}{k}
\end{array}
Initial program 32.1%
associate-*l*32.1%
associate-*l*32.1%
associate-/r*32.1%
associate-/r/32.1%
*-commutative32.1%
times-frac32.5%
+-commutative32.5%
associate--l+41.5%
metadata-eval41.5%
+-rgt-identity41.5%
times-frac47.0%
Simplified47.0%
Taylor expanded in t around 0 76.6%
unpow276.6%
Simplified76.6%
associate-*l/76.6%
associate-*l*81.8%
Applied egg-rr81.8%
associate-*l/81.8%
*-commutative81.8%
associate-/r/81.8%
Simplified81.8%
Taylor expanded in k around 0 76.6%
unpow276.6%
associate-*r*81.8%
associate-/r*82.0%
*-commutative82.0%
associate-/r*82.0%
Simplified82.0%
Final simplification82.0%
(FPCore (t l k) :precision binary64 (/ l (/ (* (/ (sin k) l) (* (* k (* k t)) (tan k))) 2.0)))
double code(double t, double l, double k) {
return l / (((sin(k) / l) * ((k * (k * t)) * tan(k))) / 2.0);
}
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = l / (((sin(k) / l) * ((k * (k * t)) * tan(k))) / 2.0d0)
end function
public static double code(double t, double l, double k) {
return l / (((Math.sin(k) / l) * ((k * (k * t)) * Math.tan(k))) / 2.0);
}
def code(t, l, k): return l / (((math.sin(k) / l) * ((k * (k * t)) * math.tan(k))) / 2.0)
function code(t, l, k) return Float64(l / Float64(Float64(Float64(sin(k) / l) * Float64(Float64(k * Float64(k * t)) * tan(k))) / 2.0)) end
function tmp = code(t, l, k) tmp = l / (((sin(k) / l) * ((k * (k * t)) * tan(k))) / 2.0); end
code[t_, l_, k_] := N[(l / N[(N[(N[(N[Sin[k], $MachinePrecision] / l), $MachinePrecision] * N[(N[(k * N[(k * t), $MachinePrecision]), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\ell}{\frac{\frac{\sin k}{\ell} \cdot \left(\left(k \cdot \left(k \cdot t\right)\right) \cdot \tan k\right)}{2}}
\end{array}
Initial program 32.1%
associate-*l*32.1%
associate-*l*32.1%
associate-/r*32.1%
associate-/r/32.1%
*-commutative32.1%
times-frac32.5%
+-commutative32.5%
associate--l+41.5%
metadata-eval41.5%
+-rgt-identity41.5%
times-frac47.0%
Simplified47.0%
Taylor expanded in t around 0 76.6%
unpow276.6%
Simplified76.6%
associate-*l/76.6%
associate-*l*81.8%
Applied egg-rr81.8%
associate-*l/81.8%
*-commutative81.8%
associate-/r/81.8%
Simplified81.8%
expm1-log1p-u52.6%
expm1-udef43.3%
frac-times44.1%
associate-/r/44.1%
Applied egg-rr44.1%
expm1-def54.9%
expm1-log1p85.2%
associate-/l*85.2%
associate-*l*84.5%
Simplified84.5%
Final simplification84.5%
(FPCore (t l k) :precision binary64 (/ (* l (/ 2.0 (* k (* k t)))) (* (/ (sin k) l) (tan k))))
double code(double t, double l, double k) {
return (l * (2.0 / (k * (k * t)))) / ((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 * (k * t)))) / ((sin(k) / l) * tan(k))
end function
public static double code(double t, double l, double k) {
return (l * (2.0 / (k * (k * t)))) / ((Math.sin(k) / l) * Math.tan(k));
}
def code(t, l, k): return (l * (2.0 / (k * (k * t)))) / ((math.sin(k) / l) * math.tan(k))
function code(t, l, k) return Float64(Float64(l * Float64(2.0 / Float64(k * Float64(k * t)))) / Float64(Float64(sin(k) / l) * tan(k))) end
function tmp = code(t, l, k) tmp = (l * (2.0 / (k * (k * t)))) / ((sin(k) / l) * tan(k)); end
code[t_, l_, k_] := N[(N[(l * N[(2.0 / N[(k * N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(N[Sin[k], $MachinePrecision] / l), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\ell \cdot \frac{2}{k \cdot \left(k \cdot t\right)}}{\frac{\sin k}{\ell} \cdot \tan k}
\end{array}
Initial program 32.1%
associate-*l*32.1%
associate-*l*32.1%
associate-/r*32.1%
associate-/r/32.1%
*-commutative32.1%
times-frac32.5%
+-commutative32.5%
associate--l+41.5%
metadata-eval41.5%
+-rgt-identity41.5%
times-frac47.0%
Simplified47.0%
Taylor expanded in t around 0 76.6%
unpow276.6%
Simplified76.6%
associate-*l/76.6%
associate-*l*81.8%
Applied egg-rr81.8%
associate-*l/81.8%
*-commutative81.8%
associate-/r/81.8%
Simplified81.8%
associate-*l/86.3%
associate-/r/86.3%
Applied egg-rr86.3%
Final simplification86.3%
(FPCore (t l k) :precision binary64 (* (/ 2.0 (* t (* k k))) (* (/ l k) (/ l k))))
double code(double t, double l, double k) {
return (2.0 / (t * (k * k))) * ((l / 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 = (2.0d0 / (t * (k * k))) * ((l / k) * (l / k))
end function
public static double code(double t, double l, double k) {
return (2.0 / (t * (k * k))) * ((l / k) * (l / k));
}
def code(t, l, k): return (2.0 / (t * (k * k))) * ((l / k) * (l / k))
function code(t, l, k) return Float64(Float64(2.0 / Float64(t * Float64(k * k))) * Float64(Float64(l / k) * Float64(l / k))) end
function tmp = code(t, l, k) tmp = (2.0 / (t * (k * k))) * ((l / k) * (l / k)); end
code[t_, l_, k_] := N[(N[(2.0 / N[(t * N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(l / k), $MachinePrecision] * N[(l / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{t \cdot \left(k \cdot k\right)} \cdot \left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right)
\end{array}
Initial program 32.1%
associate-*l*32.1%
associate-*l*32.1%
associate-/r*32.1%
associate-/r/32.1%
*-commutative32.1%
times-frac32.5%
+-commutative32.5%
associate--l+41.5%
metadata-eval41.5%
+-rgt-identity41.5%
times-frac47.0%
Simplified47.0%
Taylor expanded in t around 0 76.6%
unpow276.6%
Simplified76.6%
Taylor expanded in k around 0 61.2%
unpow261.2%
unpow261.2%
times-frac67.1%
Simplified67.1%
Final simplification67.1%
(FPCore (t l k) :precision binary64 (* (/ 2.0 (* k (* k t))) (/ l (/ k (/ l k)))))
double code(double t, double l, double k) {
return (2.0 / (k * (k * t))) * (l / (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 = (2.0d0 / (k * (k * t))) * (l / (k / (l / k)))
end function
public static double code(double t, double l, double k) {
return (2.0 / (k * (k * t))) * (l / (k / (l / k)));
}
def code(t, l, k): return (2.0 / (k * (k * t))) * (l / (k / (l / k)))
function code(t, l, k) return Float64(Float64(2.0 / Float64(k * Float64(k * t))) * Float64(l / Float64(k / Float64(l / k)))) end
function tmp = code(t, l, k) tmp = (2.0 / (k * (k * t))) * (l / (k / (l / k))); end
code[t_, l_, k_] := N[(N[(2.0 / N[(k * N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(l / N[(k / N[(l / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{k \cdot \left(k \cdot t\right)} \cdot \frac{\ell}{\frac{k}{\frac{\ell}{k}}}
\end{array}
Initial program 32.1%
associate-*l*32.1%
associate-*l*32.1%
associate-/r*32.1%
associate-/r/32.1%
*-commutative32.1%
times-frac32.5%
+-commutative32.5%
associate--l+41.5%
metadata-eval41.5%
+-rgt-identity41.5%
times-frac47.0%
Simplified47.0%
Taylor expanded in t around 0 76.6%
unpow276.6%
Simplified76.6%
associate-*l/76.6%
associate-*l*81.8%
Applied egg-rr81.8%
associate-*l/81.8%
*-commutative81.8%
associate-/r/81.8%
Simplified81.8%
Taylor expanded in k around 0 67.1%
unpow267.1%
associate-/l*69.7%
Simplified69.7%
Final simplification69.7%
(FPCore (t l k) :precision binary64 (* 2.0 (/ (* (* l l) -0.16666666666666666) (* k (* k t)))))
double code(double t, double l, double k) {
return 2.0 * (((l * l) * -0.16666666666666666) / (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 * l) * (-0.16666666666666666d0)) / (k * (k * t)))
end function
public static double code(double t, double l, double k) {
return 2.0 * (((l * l) * -0.16666666666666666) / (k * (k * t)));
}
def code(t, l, k): return 2.0 * (((l * l) * -0.16666666666666666) / (k * (k * t)))
function code(t, l, k) return Float64(2.0 * Float64(Float64(Float64(l * l) * -0.16666666666666666) / Float64(k * Float64(k * t)))) end
function tmp = code(t, l, k) tmp = 2.0 * (((l * l) * -0.16666666666666666) / (k * (k * t))); end
code[t_, l_, k_] := N[(2.0 * N[(N[(N[(l * l), $MachinePrecision] * -0.16666666666666666), $MachinePrecision] / N[(k * N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \frac{\left(\ell \cdot \ell\right) \cdot -0.16666666666666666}{k \cdot \left(k \cdot t\right)}
\end{array}
Initial program 32.1%
+-rgt-identity19.1%
associate-*l*19.1%
mul0-rgt18.1%
distribute-lft-in27.8%
+-rgt-identity32.1%
sub-neg32.1%
+-commutative32.1%
associate-+l+41.1%
metadata-eval41.1%
metadata-eval41.1%
+-rgt-identity41.1%
Simplified41.1%
Taylor expanded in t around 0 70.4%
unpow270.4%
times-frac71.3%
unpow271.3%
*-commutative71.3%
Simplified71.3%
Taylor expanded in k around 0 33.0%
distribute-lft-out33.0%
distribute-rgt-out--33.0%
metadata-eval33.0%
unpow233.0%
times-frac35.0%
unpow235.0%
associate-/l*35.1%
unpow235.1%
*-commutative35.1%
times-frac40.4%
Simplified40.4%
Taylor expanded in k around inf 27.1%
associate-*r/27.1%
unpow227.1%
unpow227.1%
associate-*r*27.7%
Simplified27.7%
Final simplification27.7%
herbie shell --seed 2023230
(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))))