
(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 15 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) 0.0) (/ 2.0 (* (* k k) (/ (* t (/ (* (tan k) (sin k)) l)) l))) (/ (/ (* l 2.0) k) (* (/ (* t (sin k)) l) (* k (tan k))))))
double code(double t, double l, double k) {
double tmp;
if ((l * l) <= 0.0) {
tmp = 2.0 / ((k * k) * ((t * ((tan(k) * sin(k)) / l)) / l));
} else {
tmp = ((l * 2.0) / k) / (((t * sin(k)) / l) * (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) <= 0.0d0) then
tmp = 2.0d0 / ((k * k) * ((t * ((tan(k) * sin(k)) / l)) / l))
else
tmp = ((l * 2.0d0) / k) / (((t * sin(k)) / l) * (k * tan(k)))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double tmp;
if ((l * l) <= 0.0) {
tmp = 2.0 / ((k * k) * ((t * ((Math.tan(k) * Math.sin(k)) / l)) / l));
} else {
tmp = ((l * 2.0) / k) / (((t * Math.sin(k)) / l) * (k * Math.tan(k)));
}
return tmp;
}
def code(t, l, k): tmp = 0 if (l * l) <= 0.0: tmp = 2.0 / ((k * k) * ((t * ((math.tan(k) * math.sin(k)) / l)) / l)) else: tmp = ((l * 2.0) / k) / (((t * math.sin(k)) / l) * (k * math.tan(k))) return tmp
function code(t, l, k) tmp = 0.0 if (Float64(l * l) <= 0.0) tmp = Float64(2.0 / Float64(Float64(k * k) * Float64(Float64(t * Float64(Float64(tan(k) * sin(k)) / l)) / l))); else tmp = Float64(Float64(Float64(l * 2.0) / k) / Float64(Float64(Float64(t * sin(k)) / l) * Float64(k * tan(k)))); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if ((l * l) <= 0.0) tmp = 2.0 / ((k * k) * ((t * ((tan(k) * sin(k)) / l)) / l)); else tmp = ((l * 2.0) / k) / (((t * sin(k)) / l) * (k * tan(k))); end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[N[(l * l), $MachinePrecision], 0.0], N[(2.0 / N[(N[(k * k), $MachinePrecision] * N[(N[(t * N[(N[(N[Tan[k], $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(l * 2.0), $MachinePrecision] / k), $MachinePrecision] / N[(N[(N[(t * N[Sin[k], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(k * N[Tan[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \cdot \ell \leq 0:\\
\;\;\;\;\frac{2}{\left(k \cdot k\right) \cdot \frac{t \cdot \frac{\tan k \cdot \sin k}{\ell}}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\ell \cdot 2}{k}}{\frac{t \cdot \sin k}{\ell} \cdot \left(k \cdot \tan k\right)}\\
\end{array}
\end{array}
if (*.f64 l l) < 0.0Initial program 5.6%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-*l*N/A
lift-/.f64N/A
lift-pow.f64N/A
unpow3N/A
associate-/l*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
Applied rewrites15.1%
Applied rewrites86.5%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
associate-*l/N/A
lift-*.f64N/A
associate-*r*N/A
lift-sin.f64N/A
lift-tan.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lift-sin.f64N/A
lift-tan.f64N/A
*-commutativeN/A
lower-*.f6494.5
Applied rewrites94.5%
if 0.0 < (*.f64 l l) Initial program 41.5%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-*l*N/A
lift-/.f64N/A
lift-pow.f64N/A
unpow3N/A
associate-/l*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
Applied rewrites39.9%
Applied rewrites87.1%
lift-*.f64N/A
lift-*.f64N/A
*-rgt-identityN/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6491.1
Applied rewrites91.1%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6497.0
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6496.5
Applied rewrites96.5%
Final simplification96.1%
(FPCore (t l k)
:precision binary64
(let* ((t_1 (* t (sin k))))
(if (<= (* l l) 0.0)
(/ 2.0 (* k (* k (* (/ t l) (/ (* k k) l)))))
(if (<= (* l l) 1e+267)
(/ 2.0 (* k (* k (/ (* (tan k) t_1) (* l l)))))
(* (/ l (tan k)) (* l (/ 2.0 (* k (* k t_1)))))))))
double code(double t, double l, double k) {
double t_1 = t * sin(k);
double tmp;
if ((l * l) <= 0.0) {
tmp = 2.0 / (k * (k * ((t / l) * ((k * k) / l))));
} else if ((l * l) <= 1e+267) {
tmp = 2.0 / (k * (k * ((tan(k) * t_1) / (l * l))));
} else {
tmp = (l / tan(k)) * (l * (2.0 / (k * (k * t_1))));
}
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) :: tmp
t_1 = t * sin(k)
if ((l * l) <= 0.0d0) then
tmp = 2.0d0 / (k * (k * ((t / l) * ((k * k) / l))))
else if ((l * l) <= 1d+267) then
tmp = 2.0d0 / (k * (k * ((tan(k) * t_1) / (l * l))))
else
tmp = (l / tan(k)) * (l * (2.0d0 / (k * (k * t_1))))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double t_1 = t * Math.sin(k);
double tmp;
if ((l * l) <= 0.0) {
tmp = 2.0 / (k * (k * ((t / l) * ((k * k) / l))));
} else if ((l * l) <= 1e+267) {
tmp = 2.0 / (k * (k * ((Math.tan(k) * t_1) / (l * l))));
} else {
tmp = (l / Math.tan(k)) * (l * (2.0 / (k * (k * t_1))));
}
return tmp;
}
def code(t, l, k): t_1 = t * math.sin(k) tmp = 0 if (l * l) <= 0.0: tmp = 2.0 / (k * (k * ((t / l) * ((k * k) / l)))) elif (l * l) <= 1e+267: tmp = 2.0 / (k * (k * ((math.tan(k) * t_1) / (l * l)))) else: tmp = (l / math.tan(k)) * (l * (2.0 / (k * (k * t_1)))) return tmp
function code(t, l, k) t_1 = Float64(t * sin(k)) tmp = 0.0 if (Float64(l * l) <= 0.0) tmp = Float64(2.0 / Float64(k * Float64(k * Float64(Float64(t / l) * Float64(Float64(k * k) / l))))); elseif (Float64(l * l) <= 1e+267) tmp = Float64(2.0 / Float64(k * Float64(k * Float64(Float64(tan(k) * t_1) / Float64(l * l))))); else tmp = Float64(Float64(l / tan(k)) * Float64(l * Float64(2.0 / Float64(k * Float64(k * t_1))))); end return tmp end
function tmp_2 = code(t, l, k) t_1 = t * sin(k); tmp = 0.0; if ((l * l) <= 0.0) tmp = 2.0 / (k * (k * ((t / l) * ((k * k) / l)))); elseif ((l * l) <= 1e+267) tmp = 2.0 / (k * (k * ((tan(k) * t_1) / (l * l)))); else tmp = (l / tan(k)) * (l * (2.0 / (k * (k * t_1)))); end tmp_2 = tmp; end
code[t_, l_, k_] := Block[{t$95$1 = N[(t * N[Sin[k], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(l * l), $MachinePrecision], 0.0], N[(2.0 / N[(k * N[(k * N[(N[(t / l), $MachinePrecision] * N[(N[(k * k), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l * l), $MachinePrecision], 1e+267], N[(2.0 / N[(k * N[(k * N[(N[(N[Tan[k], $MachinePrecision] * t$95$1), $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(l / N[Tan[k], $MachinePrecision]), $MachinePrecision] * N[(l * N[(2.0 / N[(k * N[(k * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \sin k\\
\mathbf{if}\;\ell \cdot \ell \leq 0:\\
\;\;\;\;\frac{2}{k \cdot \left(k \cdot \left(\frac{t}{\ell} \cdot \frac{k \cdot k}{\ell}\right)\right)}\\
\mathbf{elif}\;\ell \cdot \ell \leq 10^{+267}:\\
\;\;\;\;\frac{2}{k \cdot \left(k \cdot \frac{\tan k \cdot t\_1}{\ell \cdot \ell}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\ell}{\tan k} \cdot \left(\ell \cdot \frac{2}{k \cdot \left(k \cdot t\_1\right)}\right)\\
\end{array}
\end{array}
if (*.f64 l l) < 0.0Initial program 5.6%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
associate-*l/N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites35.4%
Taylor expanded in k around 0
associate-/l*N/A
lower-*.f64N/A
metadata-evalN/A
pow-sqrN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6441.1
Applied rewrites41.1%
Applied rewrites41.3%
Applied rewrites87.3%
if 0.0 < (*.f64 l l) < 9.9999999999999997e266Initial program 42.2%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-*l*N/A
lift-/.f64N/A
lift-pow.f64N/A
unpow3N/A
associate-/l*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
Applied rewrites41.5%
Applied rewrites90.4%
lift-*.f64N/A
lift-*.f64N/A
*-rgt-identityN/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites97.4%
if 9.9999999999999997e266 < (*.f64 l l) Initial program 40.5%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-*l*N/A
lift-/.f64N/A
lift-pow.f64N/A
unpow3N/A
associate-/l*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
Applied rewrites37.5%
Applied rewrites82.2%
lift-*.f64N/A
lift-*.f64N/A
*-rgt-identityN/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6486.2
Applied rewrites86.2%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
Applied rewrites76.6%
Final simplification88.6%
(FPCore (t l k)
:precision binary64
(let* ((t_1 (* t (sin k))))
(if (<= k 1.2e-44)
(/ 2.0 (* k (* (* k (/ k l)) (/ (* k t) l))))
(if (<= k 1.4e+154)
(/ (* l 2.0) (* (tan k) (* (* k k) (/ t_1 l))))
(/ 2.0 (* k (* k (/ (* (tan k) t_1) (* l l)))))))))
double code(double t, double l, double k) {
double t_1 = t * sin(k);
double tmp;
if (k <= 1.2e-44) {
tmp = 2.0 / (k * ((k * (k / l)) * ((k * t) / l)));
} else if (k <= 1.4e+154) {
tmp = (l * 2.0) / (tan(k) * ((k * k) * (t_1 / l)));
} else {
tmp = 2.0 / (k * (k * ((tan(k) * t_1) / (l * l))));
}
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) :: tmp
t_1 = t * sin(k)
if (k <= 1.2d-44) then
tmp = 2.0d0 / (k * ((k * (k / l)) * ((k * t) / l)))
else if (k <= 1.4d+154) then
tmp = (l * 2.0d0) / (tan(k) * ((k * k) * (t_1 / l)))
else
tmp = 2.0d0 / (k * (k * ((tan(k) * t_1) / (l * l))))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double t_1 = t * Math.sin(k);
double tmp;
if (k <= 1.2e-44) {
tmp = 2.0 / (k * ((k * (k / l)) * ((k * t) / l)));
} else if (k <= 1.4e+154) {
tmp = (l * 2.0) / (Math.tan(k) * ((k * k) * (t_1 / l)));
} else {
tmp = 2.0 / (k * (k * ((Math.tan(k) * t_1) / (l * l))));
}
return tmp;
}
def code(t, l, k): t_1 = t * math.sin(k) tmp = 0 if k <= 1.2e-44: tmp = 2.0 / (k * ((k * (k / l)) * ((k * t) / l))) elif k <= 1.4e+154: tmp = (l * 2.0) / (math.tan(k) * ((k * k) * (t_1 / l))) else: tmp = 2.0 / (k * (k * ((math.tan(k) * t_1) / (l * l)))) return tmp
function code(t, l, k) t_1 = Float64(t * sin(k)) tmp = 0.0 if (k <= 1.2e-44) tmp = Float64(2.0 / Float64(k * Float64(Float64(k * Float64(k / l)) * Float64(Float64(k * t) / l)))); elseif (k <= 1.4e+154) tmp = Float64(Float64(l * 2.0) / Float64(tan(k) * Float64(Float64(k * k) * Float64(t_1 / l)))); else tmp = Float64(2.0 / Float64(k * Float64(k * Float64(Float64(tan(k) * t_1) / Float64(l * l))))); end return tmp end
function tmp_2 = code(t, l, k) t_1 = t * sin(k); tmp = 0.0; if (k <= 1.2e-44) tmp = 2.0 / (k * ((k * (k / l)) * ((k * t) / l))); elseif (k <= 1.4e+154) tmp = (l * 2.0) / (tan(k) * ((k * k) * (t_1 / l))); else tmp = 2.0 / (k * (k * ((tan(k) * t_1) / (l * l)))); end tmp_2 = tmp; end
code[t_, l_, k_] := Block[{t$95$1 = N[(t * N[Sin[k], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[k, 1.2e-44], N[(2.0 / N[(k * N[(N[(k * N[(k / l), $MachinePrecision]), $MachinePrecision] * N[(N[(k * t), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 1.4e+154], N[(N[(l * 2.0), $MachinePrecision] / N[(N[Tan[k], $MachinePrecision] * N[(N[(k * k), $MachinePrecision] * N[(t$95$1 / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(k * N[(k * N[(N[(N[Tan[k], $MachinePrecision] * t$95$1), $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \sin k\\
\mathbf{if}\;k \leq 1.2 \cdot 10^{-44}:\\
\;\;\;\;\frac{2}{k \cdot \left(\left(k \cdot \frac{k}{\ell}\right) \cdot \frac{k \cdot t}{\ell}\right)}\\
\mathbf{elif}\;k \leq 1.4 \cdot 10^{+154}:\\
\;\;\;\;\frac{\ell \cdot 2}{\tan k \cdot \left(\left(k \cdot k\right) \cdot \frac{t\_1}{\ell}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{k \cdot \left(k \cdot \frac{\tan k \cdot t\_1}{\ell \cdot \ell}\right)}\\
\end{array}
\end{array}
if k < 1.20000000000000004e-44Initial program 38.8%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
associate-*l/N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites47.5%
Taylor expanded in k around 0
associate-/l*N/A
lower-*.f64N/A
metadata-evalN/A
pow-sqrN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6465.8
Applied rewrites65.8%
Applied rewrites70.3%
Applied rewrites83.9%
if 1.20000000000000004e-44 < k < 1.4e154Initial program 20.0%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-*l*N/A
lift-/.f64N/A
lift-pow.f64N/A
unpow3N/A
associate-/l*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
Applied rewrites27.8%
Applied rewrites97.6%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
*-rgt-identityN/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6497.7
Applied rewrites97.7%
if 1.4e154 < k Initial program 26.6%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-*l*N/A
lift-/.f64N/A
lift-pow.f64N/A
unpow3N/A
associate-/l*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
Applied rewrites18.5%
Applied rewrites41.3%
lift-*.f64N/A
lift-*.f64N/A
*-rgt-identityN/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites57.8%
Final simplification84.3%
(FPCore (t l k)
:precision binary64
(if (<= k 5e-44)
(/ 2.0 (* k (* (* k (/ k l)) (/ (* k t) l))))
(if (<= k 1.4e+154)
(/ (* l 2.0) (* (* (tan k) (sin k)) (* (* k k) (/ t l))))
(/ 2.0 (* k (* k (/ (* (tan k) (* t (sin k))) (* l l))))))))
double code(double t, double l, double k) {
double tmp;
if (k <= 5e-44) {
tmp = 2.0 / (k * ((k * (k / l)) * ((k * t) / l)));
} else if (k <= 1.4e+154) {
tmp = (l * 2.0) / ((tan(k) * sin(k)) * ((k * k) * (t / l)));
} else {
tmp = 2.0 / (k * (k * ((tan(k) * (t * sin(k))) / (l * l))));
}
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 <= 5d-44) then
tmp = 2.0d0 / (k * ((k * (k / l)) * ((k * t) / l)))
else if (k <= 1.4d+154) then
tmp = (l * 2.0d0) / ((tan(k) * sin(k)) * ((k * k) * (t / l)))
else
tmp = 2.0d0 / (k * (k * ((tan(k) * (t * sin(k))) / (l * l))))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double tmp;
if (k <= 5e-44) {
tmp = 2.0 / (k * ((k * (k / l)) * ((k * t) / l)));
} else if (k <= 1.4e+154) {
tmp = (l * 2.0) / ((Math.tan(k) * Math.sin(k)) * ((k * k) * (t / l)));
} else {
tmp = 2.0 / (k * (k * ((Math.tan(k) * (t * Math.sin(k))) / (l * l))));
}
return tmp;
}
def code(t, l, k): tmp = 0 if k <= 5e-44: tmp = 2.0 / (k * ((k * (k / l)) * ((k * t) / l))) elif k <= 1.4e+154: tmp = (l * 2.0) / ((math.tan(k) * math.sin(k)) * ((k * k) * (t / l))) else: tmp = 2.0 / (k * (k * ((math.tan(k) * (t * math.sin(k))) / (l * l)))) return tmp
function code(t, l, k) tmp = 0.0 if (k <= 5e-44) tmp = Float64(2.0 / Float64(k * Float64(Float64(k * Float64(k / l)) * Float64(Float64(k * t) / l)))); elseif (k <= 1.4e+154) tmp = Float64(Float64(l * 2.0) / Float64(Float64(tan(k) * sin(k)) * Float64(Float64(k * k) * Float64(t / l)))); else tmp = Float64(2.0 / Float64(k * Float64(k * Float64(Float64(tan(k) * Float64(t * sin(k))) / Float64(l * l))))); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if (k <= 5e-44) tmp = 2.0 / (k * ((k * (k / l)) * ((k * t) / l))); elseif (k <= 1.4e+154) tmp = (l * 2.0) / ((tan(k) * sin(k)) * ((k * k) * (t / l))); else tmp = 2.0 / (k * (k * ((tan(k) * (t * sin(k))) / (l * l)))); end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[k, 5e-44], N[(2.0 / N[(k * N[(N[(k * N[(k / l), $MachinePrecision]), $MachinePrecision] * N[(N[(k * t), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 1.4e+154], N[(N[(l * 2.0), $MachinePrecision] / N[(N[(N[Tan[k], $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[(N[(k * k), $MachinePrecision] * N[(t / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(k * N[(k * N[(N[(N[Tan[k], $MachinePrecision] * N[(t * N[Sin[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 5 \cdot 10^{-44}:\\
\;\;\;\;\frac{2}{k \cdot \left(\left(k \cdot \frac{k}{\ell}\right) \cdot \frac{k \cdot t}{\ell}\right)}\\
\mathbf{elif}\;k \leq 1.4 \cdot 10^{+154}:\\
\;\;\;\;\frac{\ell \cdot 2}{\left(\tan k \cdot \sin k\right) \cdot \left(\left(k \cdot k\right) \cdot \frac{t}{\ell}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{k \cdot \left(k \cdot \frac{\tan k \cdot \left(t \cdot \sin k\right)}{\ell \cdot \ell}\right)}\\
\end{array}
\end{array}
if k < 5.00000000000000039e-44Initial program 38.5%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
associate-*l/N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites47.2%
Taylor expanded in k around 0
associate-/l*N/A
lower-*.f64N/A
metadata-evalN/A
pow-sqrN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6465.5
Applied rewrites65.5%
Applied rewrites70.0%
Applied rewrites83.5%
if 5.00000000000000039e-44 < k < 1.4e154Initial program 20.4%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-*l*N/A
lift-/.f64N/A
lift-pow.f64N/A
unpow3N/A
associate-/l*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
Applied rewrites28.3%
Applied rewrites97.5%
lift-*.f64N/A
lift-*.f64N/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
pow-plusN/A
metadata-evalN/A
inv-powN/A
associate-*l*N/A
div-invN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-*l/N/A
Applied rewrites97.5%
if 1.4e154 < k Initial program 26.6%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-*l*N/A
lift-/.f64N/A
lift-pow.f64N/A
unpow3N/A
associate-/l*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
Applied rewrites18.5%
Applied rewrites41.3%
lift-*.f64N/A
lift-*.f64N/A
*-rgt-identityN/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites57.8%
Final simplification83.9%
(FPCore (t l k) :precision binary64 (if (<= k 1.75e-105) (/ 2.0 (* k (* k (/ (* (/ k l) (* k t)) l)))) (/ (* l 2.0) (* k (* k (* (tan k) (* t (/ (sin k) l))))))))
double code(double t, double l, double k) {
double tmp;
if (k <= 1.75e-105) {
tmp = 2.0 / (k * (k * (((k / l) * (k * t)) / l)));
} else {
tmp = (l * 2.0) / (k * (k * (tan(k) * (t * (sin(k) / l)))));
}
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.75d-105) then
tmp = 2.0d0 / (k * (k * (((k / l) * (k * t)) / l)))
else
tmp = (l * 2.0d0) / (k * (k * (tan(k) * (t * (sin(k) / l)))))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double tmp;
if (k <= 1.75e-105) {
tmp = 2.0 / (k * (k * (((k / l) * (k * t)) / l)));
} else {
tmp = (l * 2.0) / (k * (k * (Math.tan(k) * (t * (Math.sin(k) / l)))));
}
return tmp;
}
def code(t, l, k): tmp = 0 if k <= 1.75e-105: tmp = 2.0 / (k * (k * (((k / l) * (k * t)) / l))) else: tmp = (l * 2.0) / (k * (k * (math.tan(k) * (t * (math.sin(k) / l))))) return tmp
function code(t, l, k) tmp = 0.0 if (k <= 1.75e-105) tmp = Float64(2.0 / Float64(k * Float64(k * Float64(Float64(Float64(k / l) * Float64(k * t)) / l)))); else tmp = Float64(Float64(l * 2.0) / Float64(k * Float64(k * Float64(tan(k) * Float64(t * Float64(sin(k) / l)))))); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if (k <= 1.75e-105) tmp = 2.0 / (k * (k * (((k / l) * (k * t)) / l))); else tmp = (l * 2.0) / (k * (k * (tan(k) * (t * (sin(k) / l))))); end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[k, 1.75e-105], N[(2.0 / N[(k * N[(k * N[(N[(N[(k / l), $MachinePrecision] * N[(k * t), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(l * 2.0), $MachinePrecision] / N[(k * N[(k * N[(N[Tan[k], $MachinePrecision] * N[(t * N[(N[Sin[k], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 1.75 \cdot 10^{-105}:\\
\;\;\;\;\frac{2}{k \cdot \left(k \cdot \frac{\frac{k}{\ell} \cdot \left(k \cdot t\right)}{\ell}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\ell \cdot 2}{k \cdot \left(k \cdot \left(\tan k \cdot \left(t \cdot \frac{\sin k}{\ell}\right)\right)\right)}\\
\end{array}
\end{array}
if k < 1.75e-105Initial program 38.8%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
associate-*l/N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites47.0%
Taylor expanded in k around 0
associate-/l*N/A
lower-*.f64N/A
metadata-evalN/A
pow-sqrN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6466.1
Applied rewrites66.1%
Applied rewrites70.3%
Applied rewrites84.3%
if 1.75e-105 < k Initial program 24.5%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-*l*N/A
lift-/.f64N/A
lift-pow.f64N/A
unpow3N/A
associate-/l*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
Applied rewrites27.0%
Applied rewrites80.0%
lift-*.f64N/A
lift-*.f64N/A
*-rgt-identityN/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6487.9
Applied rewrites87.9%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6488.1
Applied rewrites88.1%
Final simplification85.6%
(FPCore (t l k) :precision binary64 (if (<= k 3.5e-104) (/ 2.0 (* k (* k (/ (* (/ k l) (* k t)) l)))) (* (/ l (tan k)) (* l (/ 2.0 (* k (* k (* t (sin k)))))))))
double code(double t, double l, double k) {
double tmp;
if (k <= 3.5e-104) {
tmp = 2.0 / (k * (k * (((k / l) * (k * t)) / l)));
} else {
tmp = (l / tan(k)) * (l * (2.0 / (k * (k * (t * 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 (k <= 3.5d-104) then
tmp = 2.0d0 / (k * (k * (((k / l) * (k * t)) / l)))
else
tmp = (l / tan(k)) * (l * (2.0d0 / (k * (k * (t * sin(k))))))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double tmp;
if (k <= 3.5e-104) {
tmp = 2.0 / (k * (k * (((k / l) * (k * t)) / l)));
} else {
tmp = (l / Math.tan(k)) * (l * (2.0 / (k * (k * (t * Math.sin(k))))));
}
return tmp;
}
def code(t, l, k): tmp = 0 if k <= 3.5e-104: tmp = 2.0 / (k * (k * (((k / l) * (k * t)) / l))) else: tmp = (l / math.tan(k)) * (l * (2.0 / (k * (k * (t * math.sin(k)))))) return tmp
function code(t, l, k) tmp = 0.0 if (k <= 3.5e-104) tmp = Float64(2.0 / Float64(k * Float64(k * Float64(Float64(Float64(k / l) * Float64(k * t)) / l)))); else tmp = Float64(Float64(l / tan(k)) * Float64(l * Float64(2.0 / Float64(k * Float64(k * Float64(t * sin(k))))))); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if (k <= 3.5e-104) tmp = 2.0 / (k * (k * (((k / l) * (k * t)) / l))); else tmp = (l / tan(k)) * (l * (2.0 / (k * (k * (t * sin(k)))))); end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[k, 3.5e-104], N[(2.0 / N[(k * N[(k * N[(N[(N[(k / l), $MachinePrecision] * N[(k * t), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(l / N[Tan[k], $MachinePrecision]), $MachinePrecision] * N[(l * N[(2.0 / N[(k * N[(k * N[(t * N[Sin[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 3.5 \cdot 10^{-104}:\\
\;\;\;\;\frac{2}{k \cdot \left(k \cdot \frac{\frac{k}{\ell} \cdot \left(k \cdot t\right)}{\ell}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\ell}{\tan k} \cdot \left(\ell \cdot \frac{2}{k \cdot \left(k \cdot \left(t \cdot \sin k\right)\right)}\right)\\
\end{array}
\end{array}
if k < 3.50000000000000029e-104Initial program 38.8%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
associate-*l/N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites47.0%
Taylor expanded in k around 0
associate-/l*N/A
lower-*.f64N/A
metadata-evalN/A
pow-sqrN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6466.1
Applied rewrites66.1%
Applied rewrites70.3%
Applied rewrites84.3%
if 3.50000000000000029e-104 < k Initial program 24.5%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-*l*N/A
lift-/.f64N/A
lift-pow.f64N/A
unpow3N/A
associate-/l*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
Applied rewrites27.0%
Applied rewrites80.0%
lift-*.f64N/A
lift-*.f64N/A
*-rgt-identityN/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6487.9
Applied rewrites87.9%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
Applied rewrites77.9%
Final simplification82.1%
(FPCore (t l k) :precision binary64 (/ (/ (* l 2.0) k) (* (/ (* t (sin k)) l) (* k (tan k)))))
double code(double t, double l, double k) {
return ((l * 2.0) / k) / (((t * sin(k)) / l) * (k * 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 * sin(k)) / l) * (k * tan(k)))
end function
public static double code(double t, double l, double k) {
return ((l * 2.0) / k) / (((t * Math.sin(k)) / l) * (k * Math.tan(k)));
}
def code(t, l, k): return ((l * 2.0) / k) / (((t * math.sin(k)) / l) * (k * math.tan(k)))
function code(t, l, k) return Float64(Float64(Float64(l * 2.0) / k) / Float64(Float64(Float64(t * sin(k)) / l) * Float64(k * tan(k)))) end
function tmp = code(t, l, k) tmp = ((l * 2.0) / k) / (((t * sin(k)) / l) * (k * tan(k))); end
code[t_, l_, k_] := N[(N[(N[(l * 2.0), $MachinePrecision] / k), $MachinePrecision] / N[(N[(N[(t * N[Sin[k], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(k * N[Tan[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{\ell \cdot 2}{k}}{\frac{t \cdot \sin k}{\ell} \cdot \left(k \cdot \tan k\right)}
\end{array}
Initial program 33.9%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-*l*N/A
lift-/.f64N/A
lift-pow.f64N/A
unpow3N/A
associate-/l*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
Applied rewrites34.6%
Applied rewrites85.9%
lift-*.f64N/A
lift-*.f64N/A
*-rgt-identityN/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6489.0
Applied rewrites89.0%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6495.2
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6494.5
Applied rewrites94.5%
Final simplification94.5%
(FPCore (t l k) :precision binary64 (* (/ l (* (/ (* t (sin k)) l) (* k (tan k)))) (/ 2.0 k)))
double code(double t, double l, double k) {
return (l / (((t * sin(k)) / l) * (k * tan(k)))) * (2.0 / 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 / (((t * sin(k)) / l) * (k * tan(k)))) * (2.0d0 / k)
end function
public static double code(double t, double l, double k) {
return (l / (((t * Math.sin(k)) / l) * (k * Math.tan(k)))) * (2.0 / k);
}
def code(t, l, k): return (l / (((t * math.sin(k)) / l) * (k * math.tan(k)))) * (2.0 / k)
function code(t, l, k) return Float64(Float64(l / Float64(Float64(Float64(t * sin(k)) / l) * Float64(k * tan(k)))) * Float64(2.0 / k)) end
function tmp = code(t, l, k) tmp = (l / (((t * sin(k)) / l) * (k * tan(k)))) * (2.0 / k); end
code[t_, l_, k_] := N[(N[(l / N[(N[(N[(t * N[Sin[k], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(k * N[Tan[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(2.0 / k), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\ell}{\frac{t \cdot \sin k}{\ell} \cdot \left(k \cdot \tan k\right)} \cdot \frac{2}{k}
\end{array}
Initial program 33.9%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-*l*N/A
lift-/.f64N/A
lift-pow.f64N/A
unpow3N/A
associate-/l*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
Applied rewrites34.6%
Applied rewrites85.9%
lift-*.f64N/A
lift-*.f64N/A
*-rgt-identityN/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6489.0
Applied rewrites89.0%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6493.0
Applied rewrites93.0%
Final simplification93.0%
(FPCore (t l k) :precision binary64 (if (<= t 2.1) (/ 2.0 (* k (* k (* (/ t l) (/ (* k k) l))))) (/ (* l 2.0) (* (tan k) (* k (/ (* k (* k t)) l))))))
double code(double t, double l, double k) {
double tmp;
if (t <= 2.1) {
tmp = 2.0 / (k * (k * ((t / l) * ((k * k) / l))));
} else {
tmp = (l * 2.0) / (tan(k) * (k * ((k * (k * t)) / l)));
}
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 (t <= 2.1d0) then
tmp = 2.0d0 / (k * (k * ((t / l) * ((k * k) / l))))
else
tmp = (l * 2.0d0) / (tan(k) * (k * ((k * (k * t)) / l)))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double tmp;
if (t <= 2.1) {
tmp = 2.0 / (k * (k * ((t / l) * ((k * k) / l))));
} else {
tmp = (l * 2.0) / (Math.tan(k) * (k * ((k * (k * t)) / l)));
}
return tmp;
}
def code(t, l, k): tmp = 0 if t <= 2.1: tmp = 2.0 / (k * (k * ((t / l) * ((k * k) / l)))) else: tmp = (l * 2.0) / (math.tan(k) * (k * ((k * (k * t)) / l))) return tmp
function code(t, l, k) tmp = 0.0 if (t <= 2.1) tmp = Float64(2.0 / Float64(k * Float64(k * Float64(Float64(t / l) * Float64(Float64(k * k) / l))))); else tmp = Float64(Float64(l * 2.0) / Float64(tan(k) * Float64(k * Float64(Float64(k * Float64(k * t)) / l)))); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if (t <= 2.1) tmp = 2.0 / (k * (k * ((t / l) * ((k * k) / l)))); else tmp = (l * 2.0) / (tan(k) * (k * ((k * (k * t)) / l))); end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[t, 2.1], N[(2.0 / N[(k * N[(k * N[(N[(t / l), $MachinePrecision] * N[(N[(k * k), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(l * 2.0), $MachinePrecision] / N[(N[Tan[k], $MachinePrecision] * N[(k * N[(N[(k * N[(k * t), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 2.1:\\
\;\;\;\;\frac{2}{k \cdot \left(k \cdot \left(\frac{t}{\ell} \cdot \frac{k \cdot k}{\ell}\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\ell \cdot 2}{\tan k \cdot \left(k \cdot \frac{k \cdot \left(k \cdot t\right)}{\ell}\right)}\\
\end{array}
\end{array}
if t < 2.10000000000000009Initial program 34.1%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
associate-*l/N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites39.4%
Taylor expanded in k around 0
associate-/l*N/A
lower-*.f64N/A
metadata-evalN/A
pow-sqrN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6459.2
Applied rewrites59.2%
Applied rewrites62.4%
Applied rewrites76.3%
if 2.10000000000000009 < t Initial program 33.5%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-*l*N/A
lift-/.f64N/A
lift-pow.f64N/A
unpow3N/A
associate-/l*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
Applied rewrites36.6%
Applied rewrites84.9%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
*-rgt-identityN/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6484.9
Applied rewrites84.9%
Taylor expanded in k around 0
cube-multN/A
unpow2N/A
associate-*l*N/A
associate-*r/N/A
lower-*.f64N/A
lower-/.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6476.7
Applied rewrites76.7%
Final simplification76.4%
(FPCore (t l k) :precision binary64 (if (<= t 2.15e-100) (/ 2.0 (* k (* k (* (/ t l) (/ (* k k) l))))) (* (/ (* l 2.0) k) (/ l (* k (* k (* k t)))))))
double code(double t, double l, double k) {
double tmp;
if (t <= 2.15e-100) {
tmp = 2.0 / (k * (k * ((t / l) * ((k * k) / l))));
} else {
tmp = ((l * 2.0) / k) * (l / (k * (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) :: tmp
if (t <= 2.15d-100) then
tmp = 2.0d0 / (k * (k * ((t / l) * ((k * k) / l))))
else
tmp = ((l * 2.0d0) / k) * (l / (k * (k * (k * t))))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double tmp;
if (t <= 2.15e-100) {
tmp = 2.0 / (k * (k * ((t / l) * ((k * k) / l))));
} else {
tmp = ((l * 2.0) / k) * (l / (k * (k * (k * t))));
}
return tmp;
}
def code(t, l, k): tmp = 0 if t <= 2.15e-100: tmp = 2.0 / (k * (k * ((t / l) * ((k * k) / l)))) else: tmp = ((l * 2.0) / k) * (l / (k * (k * (k * t)))) return tmp
function code(t, l, k) tmp = 0.0 if (t <= 2.15e-100) tmp = Float64(2.0 / Float64(k * Float64(k * Float64(Float64(t / l) * Float64(Float64(k * k) / l))))); else tmp = Float64(Float64(Float64(l * 2.0) / k) * Float64(l / Float64(k * Float64(k * Float64(k * t))))); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if (t <= 2.15e-100) tmp = 2.0 / (k * (k * ((t / l) * ((k * k) / l)))); else tmp = ((l * 2.0) / k) * (l / (k * (k * (k * t)))); end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[t, 2.15e-100], N[(2.0 / N[(k * N[(k * N[(N[(t / l), $MachinePrecision] * N[(N[(k * k), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(l * 2.0), $MachinePrecision] / k), $MachinePrecision] * N[(l / N[(k * N[(k * N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 2.15 \cdot 10^{-100}:\\
\;\;\;\;\frac{2}{k \cdot \left(k \cdot \left(\frac{t}{\ell} \cdot \frac{k \cdot k}{\ell}\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\ell \cdot 2}{k} \cdot \frac{\ell}{k \cdot \left(k \cdot \left(k \cdot t\right)\right)}\\
\end{array}
\end{array}
if t < 2.14999999999999999e-100Initial program 30.9%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
associate-*l/N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites34.1%
Taylor expanded in k around 0
associate-/l*N/A
lower-*.f64N/A
metadata-evalN/A
pow-sqrN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6459.6
Applied rewrites59.6%
Applied rewrites63.3%
Applied rewrites78.0%
if 2.14999999999999999e-100 < t Initial program 39.2%
Taylor expanded in k around 0
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
metadata-evalN/A
pow-sqrN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6464.5
Applied rewrites64.5%
Applied rewrites70.4%
Applied rewrites71.5%
Applied rewrites74.5%
Final simplification76.7%
(FPCore (t l k) :precision binary64 (if (<= t 1.7e-100) (* (* l 2.0) (/ (/ (/ l t) (* k k)) (* k k))) (* (/ (* l 2.0) k) (/ l (* k (* k (* k t)))))))
double code(double t, double l, double k) {
double tmp;
if (t <= 1.7e-100) {
tmp = (l * 2.0) * (((l / t) / (k * k)) / (k * k));
} else {
tmp = ((l * 2.0) / k) * (l / (k * (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) :: tmp
if (t <= 1.7d-100) then
tmp = (l * 2.0d0) * (((l / t) / (k * k)) / (k * k))
else
tmp = ((l * 2.0d0) / k) * (l / (k * (k * (k * t))))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double tmp;
if (t <= 1.7e-100) {
tmp = (l * 2.0) * (((l / t) / (k * k)) / (k * k));
} else {
tmp = ((l * 2.0) / k) * (l / (k * (k * (k * t))));
}
return tmp;
}
def code(t, l, k): tmp = 0 if t <= 1.7e-100: tmp = (l * 2.0) * (((l / t) / (k * k)) / (k * k)) else: tmp = ((l * 2.0) / k) * (l / (k * (k * (k * t)))) return tmp
function code(t, l, k) tmp = 0.0 if (t <= 1.7e-100) tmp = Float64(Float64(l * 2.0) * Float64(Float64(Float64(l / t) / Float64(k * k)) / Float64(k * k))); else tmp = Float64(Float64(Float64(l * 2.0) / k) * Float64(l / Float64(k * Float64(k * Float64(k * t))))); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if (t <= 1.7e-100) tmp = (l * 2.0) * (((l / t) / (k * k)) / (k * k)); else tmp = ((l * 2.0) / k) * (l / (k * (k * (k * t)))); end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[t, 1.7e-100], N[(N[(l * 2.0), $MachinePrecision] * N[(N[(N[(l / t), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(l * 2.0), $MachinePrecision] / k), $MachinePrecision] * N[(l / N[(k * N[(k * N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 1.7 \cdot 10^{-100}:\\
\;\;\;\;\left(\ell \cdot 2\right) \cdot \frac{\frac{\frac{\ell}{t}}{k \cdot k}}{k \cdot k}\\
\mathbf{else}:\\
\;\;\;\;\frac{\ell \cdot 2}{k} \cdot \frac{\ell}{k \cdot \left(k \cdot \left(k \cdot t\right)\right)}\\
\end{array}
\end{array}
if t < 1.69999999999999988e-100Initial program 30.9%
Taylor expanded in k around 0
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
metadata-evalN/A
pow-sqrN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6460.8
Applied rewrites60.8%
Applied rewrites70.5%
Applied rewrites72.9%
if 1.69999999999999988e-100 < t Initial program 39.2%
Taylor expanded in k around 0
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
metadata-evalN/A
pow-sqrN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6464.5
Applied rewrites64.5%
Applied rewrites70.4%
Applied rewrites71.5%
Applied rewrites74.5%
Final simplification73.5%
(FPCore (t l k) :precision binary64 (* (/ (* l 2.0) k) (/ l (* k (* k (* k t))))))
double code(double t, double l, double k) {
return ((l * 2.0) / 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 = ((l * 2.0d0) / k) * (l / (k * (k * (k * t))))
end function
public static double code(double t, double l, double k) {
return ((l * 2.0) / k) * (l / (k * (k * (k * t))));
}
def code(t, l, k): return ((l * 2.0) / k) * (l / (k * (k * (k * t))))
function code(t, l, k) return Float64(Float64(Float64(l * 2.0) / k) * Float64(l / Float64(k * Float64(k * Float64(k * t))))) end
function tmp = code(t, l, k) tmp = ((l * 2.0) / k) * (l / (k * (k * (k * t)))); end
code[t_, l_, k_] := N[(N[(N[(l * 2.0), $MachinePrecision] / k), $MachinePrecision] * N[(l / N[(k * N[(k * N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\ell \cdot 2}{k} \cdot \frac{\ell}{k \cdot \left(k \cdot \left(k \cdot t\right)\right)}
\end{array}
Initial program 33.9%
Taylor expanded in k around 0
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
metadata-evalN/A
pow-sqrN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6462.1
Applied rewrites62.1%
Applied rewrites70.5%
Applied rewrites71.0%
Applied rewrites72.7%
Final simplification72.7%
(FPCore (t l k) :precision binary64 (* (* l 2.0) (/ l (* (* k k) (* k (* k t))))))
double code(double t, double l, double k) {
return (l * 2.0) * (l / ((k * 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 * 2.0d0) * (l / ((k * k) * (k * (k * t))))
end function
public static double code(double t, double l, double k) {
return (l * 2.0) * (l / ((k * k) * (k * (k * t))));
}
def code(t, l, k): return (l * 2.0) * (l / ((k * k) * (k * (k * t))))
function code(t, l, k) return Float64(Float64(l * 2.0) * Float64(l / Float64(Float64(k * k) * Float64(k * Float64(k * t))))) end
function tmp = code(t, l, k) tmp = (l * 2.0) * (l / ((k * k) * (k * (k * t)))); end
code[t_, l_, k_] := N[(N[(l * 2.0), $MachinePrecision] * N[(l / N[(N[(k * k), $MachinePrecision] * N[(k * N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\ell \cdot 2\right) \cdot \frac{\ell}{\left(k \cdot k\right) \cdot \left(k \cdot \left(k \cdot t\right)\right)}
\end{array}
Initial program 33.9%
Taylor expanded in k around 0
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
metadata-evalN/A
pow-sqrN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6462.1
Applied rewrites62.1%
Applied rewrites70.5%
Applied rewrites71.6%
Final simplification71.6%
(FPCore (t l k) :precision binary64 (* (* l 2.0) (/ l (* (* k t) (* k (* k k))))))
double code(double t, double l, double k) {
return (l * 2.0) * (l / ((k * t) * (k * (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 * 2.0d0) * (l / ((k * t) * (k * (k * k))))
end function
public static double code(double t, double l, double k) {
return (l * 2.0) * (l / ((k * t) * (k * (k * k))));
}
def code(t, l, k): return (l * 2.0) * (l / ((k * t) * (k * (k * k))))
function code(t, l, k) return Float64(Float64(l * 2.0) * Float64(l / Float64(Float64(k * t) * Float64(k * Float64(k * k))))) end
function tmp = code(t, l, k) tmp = (l * 2.0) * (l / ((k * t) * (k * (k * k)))); end
code[t_, l_, k_] := N[(N[(l * 2.0), $MachinePrecision] * N[(l / N[(N[(k * t), $MachinePrecision] * N[(k * N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\ell \cdot 2\right) \cdot \frac{\ell}{\left(k \cdot t\right) \cdot \left(k \cdot \left(k \cdot k\right)\right)}
\end{array}
Initial program 33.9%
Taylor expanded in k around 0
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
metadata-evalN/A
pow-sqrN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6462.1
Applied rewrites62.1%
Applied rewrites70.5%
Applied rewrites71.0%
Final simplification71.0%
(FPCore (t l k) :precision binary64 (* (* l 2.0) (/ l (* t (* (* k k) (* k k))))))
double code(double t, double l, double k) {
return (l * 2.0) * (l / (t * ((k * k) * (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 * 2.0d0) * (l / (t * ((k * k) * (k * k))))
end function
public static double code(double t, double l, double k) {
return (l * 2.0) * (l / (t * ((k * k) * (k * k))));
}
def code(t, l, k): return (l * 2.0) * (l / (t * ((k * k) * (k * k))))
function code(t, l, k) return Float64(Float64(l * 2.0) * Float64(l / Float64(t * Float64(Float64(k * k) * Float64(k * k))))) end
function tmp = code(t, l, k) tmp = (l * 2.0) * (l / (t * ((k * k) * (k * k)))); end
code[t_, l_, k_] := N[(N[(l * 2.0), $MachinePrecision] * N[(l / N[(t * N[(N[(k * k), $MachinePrecision] * N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\ell \cdot 2\right) \cdot \frac{\ell}{t \cdot \left(\left(k \cdot k\right) \cdot \left(k \cdot k\right)\right)}
\end{array}
Initial program 33.9%
Taylor expanded in k around 0
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
metadata-evalN/A
pow-sqrN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6462.1
Applied rewrites62.1%
Applied rewrites70.5%
Final simplification70.5%
herbie shell --seed 2024232
(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))))