?

Average Error: 47.1 → 1.8
Time: 30.5s
Precision: binary64
Cost: 13888

?

\[\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)} \]
\[\frac{2}{\tan k \cdot \left(\left(\frac{k}{\ell} \cdot \left(\sin k \cdot \left(-t\right)\right)\right) \cdot \frac{k}{-\ell}\right)} \]
(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))))
(FPCore (t l k)
 :precision binary64
 (/ 2.0 (* (tan k) (* (* (/ k l) (* (sin k) (- t))) (/ k (- l))))))
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));
}
double code(double t, double l, double k) {
	return 2.0 / (tan(k) * (((k / l) * (sin(k) * -t)) * (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 ** 3.0d0) / (l * l)) * sin(k)) * tan(k)) * ((1.0d0 + ((k / t) ** 2.0d0)) - 1.0d0))
end function
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 / (tan(k) * (((k / l) * (sin(k) * -t)) * (k / -l)))
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));
}
public static double code(double t, double l, double k) {
	return 2.0 / (Math.tan(k) * (((k / l) * (Math.sin(k) * -t)) * (k / -l)));
}
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))
def code(t, l, k):
	return 2.0 / (math.tan(k) * (((k / l) * (math.sin(k) * -t)) * (k / -l)))
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 code(t, l, k)
	return Float64(2.0 / Float64(tan(k) * Float64(Float64(Float64(k / l) * Float64(sin(k) * Float64(-t))) * Float64(k / Float64(-l)))))
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
function tmp = code(t, l, k)
	tmp = 2.0 / (tan(k) * (((k / l) * (sin(k) * -t)) * (k / -l)));
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]
code[t_, l_, k_] := N[(2.0 / N[(N[Tan[k], $MachinePrecision] * N[(N[(N[(k / l), $MachinePrecision] * N[(N[Sin[k], $MachinePrecision] * (-t)), $MachinePrecision]), $MachinePrecision] * N[(k / (-l)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\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)}
\frac{2}{\tan k \cdot \left(\left(\frac{k}{\ell} \cdot \left(\sin k \cdot \left(-t\right)\right)\right) \cdot \frac{k}{-\ell}\right)}

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation?

  1. Initial program 47.1

    \[\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)} \]
  2. Simplified39.9

    \[\leadsto \color{blue}{\frac{2}{\tan k \cdot \left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \left({\left(\frac{k}{t}\right)}^{2} + 0\right)\right)}} \]
    Proof

    [Start]47.1

    \[ \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)} \]

    *-commutative [=>]47.1

    \[ \frac{2}{\color{blue}{\left(\tan k \cdot \left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right)\right)} \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]

    associate-*l* [=>]47.1

    \[ \frac{2}{\color{blue}{\tan k \cdot \left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)\right)}} \]

    +-commutative [=>]47.1

    \[ \frac{2}{\tan k \cdot \left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \left(\color{blue}{\left({\left(\frac{k}{t}\right)}^{2} + 1\right)} - 1\right)\right)} \]

    associate--l+ [=>]39.9

    \[ \frac{2}{\tan k \cdot \left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \color{blue}{\left({\left(\frac{k}{t}\right)}^{2} + \left(1 - 1\right)\right)}\right)} \]

    metadata-eval [=>]39.9

    \[ \frac{2}{\tan k \cdot \left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \left({\left(\frac{k}{t}\right)}^{2} + \color{blue}{0}\right)\right)} \]
  3. Applied egg-rr47.8

    \[\leadsto \frac{2}{\tan k \cdot \left(\left(\color{blue}{{\left(\frac{{t}^{1.5}}{\ell}\right)}^{2}} \cdot \sin k\right) \cdot \left({\left(\frac{k}{t}\right)}^{2} + 0\right)\right)} \]
  4. Taylor expanded in t around -inf 64.0

    \[\leadsto \frac{2}{\tan k \cdot \color{blue}{\left(-1 \cdot \frac{{k}^{2} \cdot \left({\left(\sqrt{-1}\right)}^{2} \cdot \left(\sin k \cdot t\right)\right)}{{\ell}^{2}}\right)}} \]
  5. Simplified18.1

    \[\leadsto \frac{2}{\tan k \cdot \color{blue}{\frac{-k \cdot k}{\frac{\ell}{\sin k \cdot t} \cdot \frac{\ell}{-1}}}} \]
    Proof

    [Start]64.0

    \[ \frac{2}{\tan k \cdot \left(-1 \cdot \frac{{k}^{2} \cdot \left({\left(\sqrt{-1}\right)}^{2} \cdot \left(\sin k \cdot t\right)\right)}{{\ell}^{2}}\right)} \]

    mul-1-neg [=>]64.0

    \[ \frac{2}{\tan k \cdot \color{blue}{\left(-\frac{{k}^{2} \cdot \left({\left(\sqrt{-1}\right)}^{2} \cdot \left(\sin k \cdot t\right)\right)}{{\ell}^{2}}\right)}} \]

    associate-/l* [=>]64.0

    \[ \frac{2}{\tan k \cdot \left(-\color{blue}{\frac{{k}^{2}}{\frac{{\ell}^{2}}{{\left(\sqrt{-1}\right)}^{2} \cdot \left(\sin k \cdot t\right)}}}\right)} \]

    distribute-neg-frac [=>]64.0

    \[ \frac{2}{\tan k \cdot \color{blue}{\frac{-{k}^{2}}{\frac{{\ell}^{2}}{{\left(\sqrt{-1}\right)}^{2} \cdot \left(\sin k \cdot t\right)}}}} \]

    unpow2 [=>]64.0

    \[ \frac{2}{\tan k \cdot \frac{-\color{blue}{k \cdot k}}{\frac{{\ell}^{2}}{{\left(\sqrt{-1}\right)}^{2} \cdot \left(\sin k \cdot t\right)}}} \]

    unpow2 [=>]64.0

    \[ \frac{2}{\tan k \cdot \frac{-k \cdot k}{\frac{\color{blue}{\ell \cdot \ell}}{{\left(\sqrt{-1}\right)}^{2} \cdot \left(\sin k \cdot t\right)}}} \]

    *-commutative [=>]64.0

    \[ \frac{2}{\tan k \cdot \frac{-k \cdot k}{\frac{\ell \cdot \ell}{\color{blue}{\left(\sin k \cdot t\right) \cdot {\left(\sqrt{-1}\right)}^{2}}}}} \]

    times-frac [=>]64.0

    \[ \frac{2}{\tan k \cdot \frac{-k \cdot k}{\color{blue}{\frac{\ell}{\sin k \cdot t} \cdot \frac{\ell}{{\left(\sqrt{-1}\right)}^{2}}}}} \]

    unpow2 [=>]64.0

    \[ \frac{2}{\tan k \cdot \frac{-k \cdot k}{\frac{\ell}{\sin k \cdot t} \cdot \frac{\ell}{\color{blue}{\sqrt{-1} \cdot \sqrt{-1}}}}} \]

    rem-square-sqrt [=>]18.1

    \[ \frac{2}{\tan k \cdot \frac{-k \cdot k}{\frac{\ell}{\sin k \cdot t} \cdot \frac{\ell}{\color{blue}{-1}}}} \]
  6. Applied egg-rr5.4

    \[\leadsto \frac{2}{\tan k \cdot \color{blue}{\left(\frac{-k}{\frac{\ell}{\sin k \cdot t}} \cdot \frac{k}{-\ell}\right)}} \]
  7. Applied egg-rr1.8

    \[\leadsto \frac{2}{\tan k \cdot \left(\color{blue}{\left(\frac{k}{\ell} \cdot \left(\sin k \cdot \left(-t\right)\right)\right)} \cdot \frac{k}{-\ell}\right)} \]
  8. Final simplification1.8

    \[\leadsto \frac{2}{\tan k \cdot \left(\left(\frac{k}{\ell} \cdot \left(\sin k \cdot \left(-t\right)\right)\right) \cdot \frac{k}{-\ell}\right)} \]

Alternatives

Alternative 1
Error7.4
Cost15060
\[\begin{array}{l} t_1 := k \cdot \frac{k}{\ell}\\ t_2 := \frac{2}{\tan k \cdot t_1} \cdot \frac{\ell}{\sin k \cdot t}\\ t_3 := \frac{\ell}{\sin k}\\ t_4 := 2 \cdot \frac{\frac{t_3}{t \cdot t_1}}{\tan k}\\ \mathbf{if}\;\ell \cdot \ell \leq 10^{-258}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;\ell \cdot \ell \leq 6 \cdot 10^{+25}:\\ \;\;\;\;\frac{2}{\tan k \cdot \left(k \cdot \frac{k}{t_3 \cdot \frac{\ell}{t}}\right)}\\ \mathbf{elif}\;\ell \cdot \ell \leq 5 \cdot 10^{+180}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;\ell \cdot \ell \leq 2 \cdot 10^{+209}:\\ \;\;\;\;\ell \cdot \frac{\frac{2}{\tan k}}{k \cdot \left(k \cdot \frac{\sin k}{\frac{\ell}{t}}\right)}\\ \mathbf{elif}\;\ell \cdot \ell \leq 5 \cdot 10^{+235}:\\ \;\;\;\;t_4\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 2
Error7.3
Cost14288
\[\begin{array}{l} t_1 := k \cdot \frac{k}{\ell}\\ t_2 := \frac{2}{\tan k \cdot \left(k \cdot \frac{\left(k \cdot \sin k\right) \cdot \frac{t}{\ell}}{\ell}\right)}\\ t_3 := 2 \cdot \frac{\frac{\frac{\ell}{\sin k}}{t \cdot t_1}}{\tan k}\\ \mathbf{if}\;t \leq -2.1 \cdot 10^{-39}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;t \leq 1.66 \cdot 10^{-292}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t \leq 1.2 \cdot 10^{-91}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;t \leq 4.5 \cdot 10^{+93}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\tan k \cdot t_1} \cdot \frac{\ell}{\sin k \cdot t}\\ \end{array} \]
Alternative 3
Error6.7
Cost14288
\[\begin{array}{l} t_1 := k \cdot \frac{k}{\ell}\\ t_2 := \frac{\ell}{\sin k}\\ t_3 := \frac{2}{\tan k \cdot \left(\frac{k}{t_2} \cdot \frac{k}{\frac{\ell}{t}}\right)}\\ t_4 := 2 \cdot \frac{\frac{t_2}{t \cdot t_1}}{\tan k}\\ \mathbf{if}\;t \leq -9 \cdot 10^{-27}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;t \leq 4.3 \cdot 10^{-295}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;t \leq 4.4 \cdot 10^{-96}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;t \leq 5 \cdot 10^{+93}:\\ \;\;\;\;t_3\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\tan k \cdot t_1} \cdot \frac{\ell}{\sin k \cdot t}\\ \end{array} \]
Alternative 4
Error13.3
Cost14025
\[\begin{array}{l} t_1 := k \cdot \frac{k}{\ell}\\ \mathbf{if}\;k \leq -0.105 \lor \neg \left(k \leq 6.8 \cdot 10^{-25}\right):\\ \;\;\;\;2 \cdot \frac{\ell \cdot \frac{\ell}{\sin k \cdot t}}{k \cdot \left(k \cdot \tan k\right)}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \frac{1}{t_1 \cdot \left(t \cdot t_1\right)}\\ \end{array} \]
Alternative 5
Error11.4
Cost14025
\[\begin{array}{l} t_1 := k \cdot \frac{k}{\ell}\\ \mathbf{if}\;k \leq -0.105 \lor \neg \left(k \leq 2.2 \cdot 10^{-72}\right):\\ \;\;\;\;\ell \cdot \left(\frac{\frac{\ell}{t}}{\sin k} \cdot \frac{\frac{2}{k \cdot k}}{\tan k}\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \frac{1}{t_1 \cdot \left(t \cdot t_1\right)}\\ \end{array} \]
Alternative 6
Error7.2
Cost14025
\[\begin{array}{l} t_1 := k \cdot \frac{k}{\ell}\\ \mathbf{if}\;k \leq -5 \cdot 10^{-16} \lor \neg \left(k \leq 1.05 \cdot 10^{-10}\right):\\ \;\;\;\;\frac{2}{\tan k \cdot t_1} \cdot \frac{\ell}{\sin k \cdot t}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \frac{1}{t_1 \cdot \left(t \cdot t_1\right)}\\ \end{array} \]
Alternative 7
Error4.8
Cost14024
\[\begin{array}{l} t_1 := \frac{\ell}{\sin k}\\ \mathbf{if}\;k \leq -3.3 \cdot 10^{+198}:\\ \;\;\;\;\frac{2}{\frac{\tan k}{\frac{\ell}{k} \cdot \frac{\ell}{\sin k \cdot \left(k \cdot t\right)}}}\\ \mathbf{elif}\;k \leq 1450000000000:\\ \;\;\;\;2 \cdot \frac{\frac{t_1}{t \cdot \left(k \cdot \frac{k}{\ell}\right)}}{\tan k}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\tan k \cdot \left(\frac{k}{t_1} \cdot \frac{k}{\frac{\ell}{t}}\right)}\\ \end{array} \]
Alternative 8
Error6.9
Cost13892
\[\begin{array}{l} t_1 := k \cdot \frac{k}{\ell}\\ \mathbf{if}\;t \leq 2.4 \cdot 10^{+44}:\\ \;\;\;\;2 \cdot \frac{\frac{\frac{\ell}{\sin k}}{t \cdot t_1}}{\tan k}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\tan k \cdot t_1} \cdot \frac{\ell}{\sin k \cdot t}\\ \end{array} \]
Alternative 9
Error23.7
Cost1225
\[\begin{array}{l} t_1 := \frac{\ell}{k \cdot k}\\ \mathbf{if}\;t \leq -5 \cdot 10^{-64} \lor \neg \left(t \leq 10^{-5}\right):\\ \;\;\;\;2 \cdot \frac{\frac{\ell}{k} \cdot \frac{\ell}{k}}{k \cdot \left(k \cdot t\right)}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(t_1 \cdot \frac{t_1}{t}\right)\\ \end{array} \]
Alternative 10
Error22.6
Cost1088
\[\begin{array}{l} t_1 := k \cdot \frac{k}{\ell}\\ 2 \cdot \frac{1}{t_1 \cdot \left(t \cdot t_1\right)} \end{array} \]
Alternative 11
Error25.6
Cost960
\[2 \cdot \left(\frac{\ell}{k \cdot k} \cdot \frac{\ell}{k \cdot \left(k \cdot t\right)}\right) \]
Alternative 12
Error24.3
Cost960
\[\begin{array}{l} t_1 := \frac{\ell}{k \cdot k}\\ 2 \cdot \left(t_1 \cdot \frac{t_1}{t}\right) \end{array} \]
Alternative 13
Error23.3
Cost960
\[2 \cdot \frac{\frac{\ell}{k}}{\left(k \cdot t\right) \cdot \left(k \cdot \frac{k}{\ell}\right)} \]

Error

Reproduce?

herbie shell --seed 2023028 
(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))))