| Alternative 1 | |
|---|---|
| Error | 9.9 |
| Cost | 14672 |
(FPCore (x l t) :precision binary64 (/ (* (sqrt 2.0) t) (sqrt (- (* (/ (+ x 1.0) (- x 1.0)) (+ (* l l) (* 2.0 (* t t)))) (* l l)))))
(FPCore (x l t)
:precision binary64
(let* ((t_1 (+ 2.0 (+ (/ 2.0 x) (/ 2.0 x))))
(t_2 (+ t (/ t x)))
(t_3 (sqrt (/ (+ -1.0 x) (+ x 1.0)))))
(if (<= t -3.95e+34)
(- t_3)
(if (<= t -5.6e-182)
(* t (sqrt (/ 1.0 (fma t t_2 (/ l (/ x l))))))
(if (<= t 1e-288)
(*
t
(/
(sqrt 2.0)
(- (fma t (sqrt t_1) (* (sqrt (/ 1.0 t_1)) (* (/ l x) (/ l t)))))))
(if (<= t 2e+116)
(*
t
(/ (sqrt 2.0) (sqrt (+ (* 2.0 (* t t_2)) (* 2.0 (* l (/ l x)))))))
t_3))))))double code(double x, double l, double t) {
return (sqrt(2.0) * t) / sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l)));
}
double code(double x, double l, double t) {
double t_1 = 2.0 + ((2.0 / x) + (2.0 / x));
double t_2 = t + (t / x);
double t_3 = sqrt(((-1.0 + x) / (x + 1.0)));
double tmp;
if (t <= -3.95e+34) {
tmp = -t_3;
} else if (t <= -5.6e-182) {
tmp = t * sqrt((1.0 / fma(t, t_2, (l / (x / l)))));
} else if (t <= 1e-288) {
tmp = t * (sqrt(2.0) / -fma(t, sqrt(t_1), (sqrt((1.0 / t_1)) * ((l / x) * (l / t)))));
} else if (t <= 2e+116) {
tmp = t * (sqrt(2.0) / sqrt(((2.0 * (t * t_2)) + (2.0 * (l * (l / x))))));
} else {
tmp = t_3;
}
return tmp;
}
function code(x, l, t) return Float64(Float64(sqrt(2.0) * t) / sqrt(Float64(Float64(Float64(Float64(x + 1.0) / Float64(x - 1.0)) * Float64(Float64(l * l) + Float64(2.0 * Float64(t * t)))) - Float64(l * l)))) end
function code(x, l, t) t_1 = Float64(2.0 + Float64(Float64(2.0 / x) + Float64(2.0 / x))) t_2 = Float64(t + Float64(t / x)) t_3 = sqrt(Float64(Float64(-1.0 + x) / Float64(x + 1.0))) tmp = 0.0 if (t <= -3.95e+34) tmp = Float64(-t_3); elseif (t <= -5.6e-182) tmp = Float64(t * sqrt(Float64(1.0 / fma(t, t_2, Float64(l / Float64(x / l)))))); elseif (t <= 1e-288) tmp = Float64(t * Float64(sqrt(2.0) / Float64(-fma(t, sqrt(t_1), Float64(sqrt(Float64(1.0 / t_1)) * Float64(Float64(l / x) * Float64(l / t))))))); elseif (t <= 2e+116) tmp = Float64(t * Float64(sqrt(2.0) / sqrt(Float64(Float64(2.0 * Float64(t * t_2)) + Float64(2.0 * Float64(l * Float64(l / x))))))); else tmp = t_3; end return tmp end
code[x_, l_, t_] := N[(N[(N[Sqrt[2.0], $MachinePrecision] * t), $MachinePrecision] / N[Sqrt[N[(N[(N[(N[(x + 1.0), $MachinePrecision] / N[(x - 1.0), $MachinePrecision]), $MachinePrecision] * N[(N[(l * l), $MachinePrecision] + N[(2.0 * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(l * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
code[x_, l_, t_] := Block[{t$95$1 = N[(2.0 + N[(N[(2.0 / x), $MachinePrecision] + N[(2.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t + N[(t / x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(N[(-1.0 + x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, -3.95e+34], (-t$95$3), If[LessEqual[t, -5.6e-182], N[(t * N[Sqrt[N[(1.0 / N[(t * t$95$2 + N[(l / N[(x / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1e-288], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / (-N[(t * N[Sqrt[t$95$1], $MachinePrecision] + N[(N[Sqrt[N[(1.0 / t$95$1), $MachinePrecision]], $MachinePrecision] * N[(N[(l / x), $MachinePrecision] * N[(l / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision])), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2e+116], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[Sqrt[N[(N[(2.0 * N[(t * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[(l * N[(l / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$3]]]]]]]
\frac{\sqrt{2} \cdot t}{\sqrt{\frac{x + 1}{x - 1} \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}}
\begin{array}{l}
t_1 := 2 + \left(\frac{2}{x} + \frac{2}{x}\right)\\
t_2 := t + \frac{t}{x}\\
t_3 := \sqrt{\frac{-1 + x}{x + 1}}\\
\mathbf{if}\;t \leq -3.95 \cdot 10^{+34}:\\
\;\;\;\;-t_3\\
\mathbf{elif}\;t \leq -5.6 \cdot 10^{-182}:\\
\;\;\;\;t \cdot \sqrt{\frac{1}{\mathsf{fma}\left(t, t_2, \frac{\ell}{\frac{x}{\ell}}\right)}}\\
\mathbf{elif}\;t \leq 10^{-288}:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{-\mathsf{fma}\left(t, \sqrt{t_1}, \sqrt{\frac{1}{t_1}} \cdot \left(\frac{\ell}{x} \cdot \frac{\ell}{t}\right)\right)}\\
\mathbf{elif}\;t \leq 2 \cdot 10^{+116}:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{\sqrt{2 \cdot \left(t \cdot t_2\right) + 2 \cdot \left(\ell \cdot \frac{\ell}{x}\right)}}\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
if t < -3.94999999999999999e34Initial program 44.5
Simplified44.5
[Start]44.5 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\frac{x + 1}{x - 1} \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}}
\] |
|---|---|
associate-*l/ [<=]44.5 | \[ \color{blue}{\frac{\sqrt{2}}{\sqrt{\frac{x + 1}{x - 1} \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}} \cdot t}
\] |
+-commutative [=>]44.5 | \[ \frac{\sqrt{2}}{\sqrt{\frac{x + 1}{x - 1} \cdot \color{blue}{\left(2 \cdot \left(t \cdot t\right) + \ell \cdot \ell\right)} - \ell \cdot \ell}} \cdot t
\] |
fma-def [=>]44.5 | \[ \frac{\sqrt{2}}{\sqrt{\frac{x + 1}{x - 1} \cdot \color{blue}{\mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right)} - \ell \cdot \ell}} \cdot t
\] |
Taylor expanded in t around -inf 5.2
Simplified5.2
[Start]5.2 | \[ -1 \cdot \left(\left(\sqrt{2} \cdot \sqrt{0.5}\right) \cdot \sqrt{\frac{x - 1}{1 + x}}\right)
\] |
|---|---|
mul-1-neg [=>]5.2 | \[ \color{blue}{-\left(\sqrt{2} \cdot \sqrt{0.5}\right) \cdot \sqrt{\frac{x - 1}{1 + x}}}
\] |
associate-*l* [=>]5.2 | \[ -\color{blue}{\sqrt{2} \cdot \left(\sqrt{0.5} \cdot \sqrt{\frac{x - 1}{1 + x}}\right)}
\] |
sub-neg [=>]5.2 | \[ -\sqrt{2} \cdot \left(\sqrt{0.5} \cdot \sqrt{\frac{\color{blue}{x + \left(-1\right)}}{1 + x}}\right)
\] |
metadata-eval [=>]5.2 | \[ -\sqrt{2} \cdot \left(\sqrt{0.5} \cdot \sqrt{\frac{x + \color{blue}{-1}}{1 + x}}\right)
\] |
+-commutative [=>]5.2 | \[ -\sqrt{2} \cdot \left(\sqrt{0.5} \cdot \sqrt{\frac{\color{blue}{-1 + x}}{1 + x}}\right)
\] |
+-commutative [=>]5.2 | \[ -\sqrt{2} \cdot \left(\sqrt{0.5} \cdot \sqrt{\frac{-1 + x}{\color{blue}{x + 1}}}\right)
\] |
Applied egg-rr4.3
Simplified4.3
[Start]4.3 | \[ -\left(e^{\mathsf{log1p}\left(\sqrt{\frac{-1 + x}{x + 1}}\right)} - 1\right)
\] |
|---|---|
expm1-def [=>]4.3 | \[ -\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{\frac{-1 + x}{x + 1}}\right)\right)}
\] |
expm1-log1p [=>]4.3 | \[ -\color{blue}{\sqrt{\frac{-1 + x}{x + 1}}}
\] |
if -3.94999999999999999e34 < t < -5.59999999999999986e-182Initial program 32.3
Simplified32.2
[Start]32.3 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\frac{x + 1}{x - 1} \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}}
\] |
|---|---|
associate-*l/ [<=]32.2 | \[ \color{blue}{\frac{\sqrt{2}}{\sqrt{\frac{x + 1}{x - 1} \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}} \cdot t}
\] |
+-commutative [=>]32.2 | \[ \frac{\sqrt{2}}{\sqrt{\frac{x + 1}{x - 1} \cdot \color{blue}{\left(2 \cdot \left(t \cdot t\right) + \ell \cdot \ell\right)} - \ell \cdot \ell}} \cdot t
\] |
fma-def [=>]32.2 | \[ \frac{\sqrt{2}}{\sqrt{\frac{x + 1}{x - 1} \cdot \color{blue}{\mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right)} - \ell \cdot \ell}} \cdot t
\] |
Taylor expanded in x around inf 11.9
Simplified11.9
[Start]11.9 | \[ \frac{\sqrt{2}}{\sqrt{\left(\frac{{\ell}^{2}}{x} + \left(2 \cdot \frac{{t}^{2}}{x} + 2 \cdot {t}^{2}\right)\right) - -1 \cdot \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x}}} \cdot t
\] |
|---|---|
associate--l+ [=>]11.9 | \[ \frac{\sqrt{2}}{\sqrt{\color{blue}{\frac{{\ell}^{2}}{x} + \left(\left(2 \cdot \frac{{t}^{2}}{x} + 2 \cdot {t}^{2}\right) - -1 \cdot \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x}\right)}}} \cdot t
\] |
unpow2 [=>]11.9 | \[ \frac{\sqrt{2}}{\sqrt{\frac{\color{blue}{\ell \cdot \ell}}{x} + \left(\left(2 \cdot \frac{{t}^{2}}{x} + 2 \cdot {t}^{2}\right) - -1 \cdot \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x}\right)}} \cdot t
\] |
distribute-lft-out [=>]11.9 | \[ \frac{\sqrt{2}}{\sqrt{\frac{\ell \cdot \ell}{x} + \left(\color{blue}{2 \cdot \left(\frac{{t}^{2}}{x} + {t}^{2}\right)} - -1 \cdot \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x}\right)}} \cdot t
\] |
unpow2 [=>]11.9 | \[ \frac{\sqrt{2}}{\sqrt{\frac{\ell \cdot \ell}{x} + \left(2 \cdot \left(\frac{\color{blue}{t \cdot t}}{x} + {t}^{2}\right) - -1 \cdot \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x}\right)}} \cdot t
\] |
unpow2 [=>]11.9 | \[ \frac{\sqrt{2}}{\sqrt{\frac{\ell \cdot \ell}{x} + \left(2 \cdot \left(\frac{t \cdot t}{x} + \color{blue}{t \cdot t}\right) - -1 \cdot \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x}\right)}} \cdot t
\] |
mul-1-neg [=>]11.9 | \[ \frac{\sqrt{2}}{\sqrt{\frac{\ell \cdot \ell}{x} + \left(2 \cdot \left(\frac{t \cdot t}{x} + t \cdot t\right) - \color{blue}{\left(-\frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x}\right)}\right)}} \cdot t
\] |
+-commutative [=>]11.9 | \[ \frac{\sqrt{2}}{\sqrt{\frac{\ell \cdot \ell}{x} + \left(2 \cdot \left(\frac{t \cdot t}{x} + t \cdot t\right) - \left(-\frac{\color{blue}{2 \cdot {t}^{2} + {\ell}^{2}}}{x}\right)\right)}} \cdot t
\] |
unpow2 [=>]11.9 | \[ \frac{\sqrt{2}}{\sqrt{\frac{\ell \cdot \ell}{x} + \left(2 \cdot \left(\frac{t \cdot t}{x} + t \cdot t\right) - \left(-\frac{2 \cdot {t}^{2} + \color{blue}{\ell \cdot \ell}}{x}\right)\right)}} \cdot t
\] |
fma-udef [<=]11.9 | \[ \frac{\sqrt{2}}{\sqrt{\frac{\ell \cdot \ell}{x} + \left(2 \cdot \left(\frac{t \cdot t}{x} + t \cdot t\right) - \left(-\frac{\color{blue}{\mathsf{fma}\left(2, {t}^{2}, \ell \cdot \ell\right)}}{x}\right)\right)}} \cdot t
\] |
unpow2 [=>]11.9 | \[ \frac{\sqrt{2}}{\sqrt{\frac{\ell \cdot \ell}{x} + \left(2 \cdot \left(\frac{t \cdot t}{x} + t \cdot t\right) - \left(-\frac{\mathsf{fma}\left(2, \color{blue}{t \cdot t}, \ell \cdot \ell\right)}{x}\right)\right)}} \cdot t
\] |
Taylor expanded in t around 0 12.1
Simplified12.1
[Start]12.1 | \[ \frac{\sqrt{2}}{\sqrt{\frac{\ell \cdot \ell}{x} + \left(2 \cdot \left(\frac{t \cdot t}{x} + t \cdot t\right) - \left(-\frac{{\ell}^{2}}{x}\right)\right)}} \cdot t
\] |
|---|---|
unpow2 [=>]12.1 | \[ \frac{\sqrt{2}}{\sqrt{\frac{\ell \cdot \ell}{x} + \left(2 \cdot \left(\frac{t \cdot t}{x} + t \cdot t\right) - \left(-\frac{\color{blue}{\ell \cdot \ell}}{x}\right)\right)}} \cdot t
\] |
Applied egg-rr7.6
Simplified7.5
[Start]7.6 | \[ \frac{\sqrt{2}}{{\left(\frac{\ell}{x} \cdot \ell + \mathsf{fma}\left(2, \mathsf{fma}\left(t, t, \frac{t}{x} \cdot t\right), \frac{\ell}{x} \cdot \ell\right)\right)}^{0.25} \cdot {\left(\frac{\ell}{x} \cdot \ell + \mathsf{fma}\left(2, \mathsf{fma}\left(t, t, \frac{t}{x} \cdot t\right), \frac{\ell}{x} \cdot \ell\right)\right)}^{0.25}} \cdot t
\] |
|---|---|
pow-sqr [=>]7.5 | \[ \frac{\sqrt{2}}{\color{blue}{{\left(\frac{\ell}{x} \cdot \ell + \mathsf{fma}\left(2, \mathsf{fma}\left(t, t, \frac{t}{x} \cdot t\right), \frac{\ell}{x} \cdot \ell\right)\right)}^{\left(2 \cdot 0.25\right)}}} \cdot t
\] |
metadata-eval [=>]7.5 | \[ \frac{\sqrt{2}}{{\left(\frac{\ell}{x} \cdot \ell + \mathsf{fma}\left(2, \mathsf{fma}\left(t, t, \frac{t}{x} \cdot t\right), \frac{\ell}{x} \cdot \ell\right)\right)}^{\color{blue}{0.5}}} \cdot t
\] |
unpow1/2 [=>]7.5 | \[ \frac{\sqrt{2}}{\color{blue}{\sqrt{\frac{\ell}{x} \cdot \ell + \mathsf{fma}\left(2, \mathsf{fma}\left(t, t, \frac{t}{x} \cdot t\right), \frac{\ell}{x} \cdot \ell\right)}}} \cdot t
\] |
+-commutative [=>]7.5 | \[ \frac{\sqrt{2}}{\sqrt{\color{blue}{\mathsf{fma}\left(2, \mathsf{fma}\left(t, t, \frac{t}{x} \cdot t\right), \frac{\ell}{x} \cdot \ell\right) + \frac{\ell}{x} \cdot \ell}}} \cdot t
\] |
fma-udef [=>]7.5 | \[ \frac{\sqrt{2}}{\sqrt{\color{blue}{\left(2 \cdot \mathsf{fma}\left(t, t, \frac{t}{x} \cdot t\right) + \frac{\ell}{x} \cdot \ell\right)} + \frac{\ell}{x} \cdot \ell}} \cdot t
\] |
associate-+l+ [=>]7.5 | \[ \frac{\sqrt{2}}{\sqrt{\color{blue}{2 \cdot \mathsf{fma}\left(t, t, \frac{t}{x} \cdot t\right) + \left(\frac{\ell}{x} \cdot \ell + \frac{\ell}{x} \cdot \ell\right)}}} \cdot t
\] |
fma-udef [=>]7.5 | \[ \frac{\sqrt{2}}{\sqrt{2 \cdot \color{blue}{\left(t \cdot t + \frac{t}{x} \cdot t\right)} + \left(\frac{\ell}{x} \cdot \ell + \frac{\ell}{x} \cdot \ell\right)}} \cdot t
\] |
distribute-rgt-out [=>]7.5 | \[ \frac{\sqrt{2}}{\sqrt{2 \cdot \color{blue}{\left(t \cdot \left(t + \frac{t}{x}\right)\right)} + \left(\frac{\ell}{x} \cdot \ell + \frac{\ell}{x} \cdot \ell\right)}} \cdot t
\] |
count-2 [=>]7.5 | \[ \frac{\sqrt{2}}{\sqrt{2 \cdot \left(t \cdot \left(t + \frac{t}{x}\right)\right) + \color{blue}{2 \cdot \left(\frac{\ell}{x} \cdot \ell\right)}}} \cdot t
\] |
*-commutative [=>]7.5 | \[ \frac{\sqrt{2}}{\sqrt{2 \cdot \left(t \cdot \left(t + \frac{t}{x}\right)\right) + 2 \cdot \color{blue}{\left(\ell \cdot \frac{\ell}{x}\right)}}} \cdot t
\] |
Applied egg-rr8.0
if -5.59999999999999986e-182 < t < 1.00000000000000006e-288Initial program 62.5
Simplified62.5
[Start]62.5 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\frac{x + 1}{x - 1} \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}}
\] |
|---|---|
associate-*l/ [<=]62.5 | \[ \color{blue}{\frac{\sqrt{2}}{\sqrt{\frac{x + 1}{x - 1} \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}} \cdot t}
\] |
+-commutative [=>]62.5 | \[ \frac{\sqrt{2}}{\sqrt{\frac{x + 1}{x - 1} \cdot \color{blue}{\left(2 \cdot \left(t \cdot t\right) + \ell \cdot \ell\right)} - \ell \cdot \ell}} \cdot t
\] |
fma-def [=>]62.5 | \[ \frac{\sqrt{2}}{\sqrt{\frac{x + 1}{x - 1} \cdot \color{blue}{\mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right)} - \ell \cdot \ell}} \cdot t
\] |
Taylor expanded in x around inf 32.3
Simplified32.3
[Start]32.3 | \[ \frac{\sqrt{2}}{\sqrt{\left(\frac{{\ell}^{2}}{x} + \left(2 \cdot \frac{{t}^{2}}{x} + 2 \cdot {t}^{2}\right)\right) - -1 \cdot \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x}}} \cdot t
\] |
|---|---|
associate--l+ [=>]32.3 | \[ \frac{\sqrt{2}}{\sqrt{\color{blue}{\frac{{\ell}^{2}}{x} + \left(\left(2 \cdot \frac{{t}^{2}}{x} + 2 \cdot {t}^{2}\right) - -1 \cdot \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x}\right)}}} \cdot t
\] |
unpow2 [=>]32.3 | \[ \frac{\sqrt{2}}{\sqrt{\frac{\color{blue}{\ell \cdot \ell}}{x} + \left(\left(2 \cdot \frac{{t}^{2}}{x} + 2 \cdot {t}^{2}\right) - -1 \cdot \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x}\right)}} \cdot t
\] |
distribute-lft-out [=>]32.3 | \[ \frac{\sqrt{2}}{\sqrt{\frac{\ell \cdot \ell}{x} + \left(\color{blue}{2 \cdot \left(\frac{{t}^{2}}{x} + {t}^{2}\right)} - -1 \cdot \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x}\right)}} \cdot t
\] |
unpow2 [=>]32.3 | \[ \frac{\sqrt{2}}{\sqrt{\frac{\ell \cdot \ell}{x} + \left(2 \cdot \left(\frac{\color{blue}{t \cdot t}}{x} + {t}^{2}\right) - -1 \cdot \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x}\right)}} \cdot t
\] |
unpow2 [=>]32.3 | \[ \frac{\sqrt{2}}{\sqrt{\frac{\ell \cdot \ell}{x} + \left(2 \cdot \left(\frac{t \cdot t}{x} + \color{blue}{t \cdot t}\right) - -1 \cdot \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x}\right)}} \cdot t
\] |
mul-1-neg [=>]32.3 | \[ \frac{\sqrt{2}}{\sqrt{\frac{\ell \cdot \ell}{x} + \left(2 \cdot \left(\frac{t \cdot t}{x} + t \cdot t\right) - \color{blue}{\left(-\frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x}\right)}\right)}} \cdot t
\] |
+-commutative [=>]32.3 | \[ \frac{\sqrt{2}}{\sqrt{\frac{\ell \cdot \ell}{x} + \left(2 \cdot \left(\frac{t \cdot t}{x} + t \cdot t\right) - \left(-\frac{\color{blue}{2 \cdot {t}^{2} + {\ell}^{2}}}{x}\right)\right)}} \cdot t
\] |
unpow2 [=>]32.3 | \[ \frac{\sqrt{2}}{\sqrt{\frac{\ell \cdot \ell}{x} + \left(2 \cdot \left(\frac{t \cdot t}{x} + t \cdot t\right) - \left(-\frac{2 \cdot {t}^{2} + \color{blue}{\ell \cdot \ell}}{x}\right)\right)}} \cdot t
\] |
fma-udef [<=]32.3 | \[ \frac{\sqrt{2}}{\sqrt{\frac{\ell \cdot \ell}{x} + \left(2 \cdot \left(\frac{t \cdot t}{x} + t \cdot t\right) - \left(-\frac{\color{blue}{\mathsf{fma}\left(2, {t}^{2}, \ell \cdot \ell\right)}}{x}\right)\right)}} \cdot t
\] |
unpow2 [=>]32.3 | \[ \frac{\sqrt{2}}{\sqrt{\frac{\ell \cdot \ell}{x} + \left(2 \cdot \left(\frac{t \cdot t}{x} + t \cdot t\right) - \left(-\frac{\mathsf{fma}\left(2, \color{blue}{t \cdot t}, \ell \cdot \ell\right)}{x}\right)\right)}} \cdot t
\] |
Taylor expanded in t around -inf 25.9
Simplified25.9
[Start]25.9 | \[ \frac{\sqrt{2}}{-1 \cdot \left(\frac{{\ell}^{2}}{t \cdot x} \cdot \sqrt{\frac{1}{2 \cdot \left(1 + \frac{1}{x}\right) + 2 \cdot \frac{1}{x}}}\right) + -1 \cdot \left(t \cdot \sqrt{2 \cdot \left(1 + \frac{1}{x}\right) + 2 \cdot \frac{1}{x}}\right)} \cdot t
\] |
|---|---|
*-commutative [=>]25.9 | \[ \frac{\sqrt{2}}{-1 \cdot \color{blue}{\left(\sqrt{\frac{1}{2 \cdot \left(1 + \frac{1}{x}\right) + 2 \cdot \frac{1}{x}}} \cdot \frac{{\ell}^{2}}{t \cdot x}\right)} + -1 \cdot \left(t \cdot \sqrt{2 \cdot \left(1 + \frac{1}{x}\right) + 2 \cdot \frac{1}{x}}\right)} \cdot t
\] |
*-commutative [=>]25.9 | \[ \frac{\sqrt{2}}{-1 \cdot \left(\sqrt{\frac{1}{2 \cdot \left(1 + \frac{1}{x}\right) + 2 \cdot \frac{1}{x}}} \cdot \frac{{\ell}^{2}}{t \cdot x}\right) + -1 \cdot \color{blue}{\left(\sqrt{2 \cdot \left(1 + \frac{1}{x}\right) + 2 \cdot \frac{1}{x}} \cdot t\right)}} \cdot t
\] |
distribute-lft-out [=>]25.9 | \[ \frac{\sqrt{2}}{\color{blue}{-1 \cdot \left(\sqrt{\frac{1}{2 \cdot \left(1 + \frac{1}{x}\right) + 2 \cdot \frac{1}{x}}} \cdot \frac{{\ell}^{2}}{t \cdot x} + \sqrt{2 \cdot \left(1 + \frac{1}{x}\right) + 2 \cdot \frac{1}{x}} \cdot t\right)}} \cdot t
\] |
+-commutative [<=]25.9 | \[ \frac{\sqrt{2}}{-1 \cdot \color{blue}{\left(\sqrt{2 \cdot \left(1 + \frac{1}{x}\right) + 2 \cdot \frac{1}{x}} \cdot t + \sqrt{\frac{1}{2 \cdot \left(1 + \frac{1}{x}\right) + 2 \cdot \frac{1}{x}}} \cdot \frac{{\ell}^{2}}{t \cdot x}\right)}} \cdot t
\] |
mul-1-neg [=>]25.9 | \[ \frac{\sqrt{2}}{\color{blue}{-\left(\sqrt{2 \cdot \left(1 + \frac{1}{x}\right) + 2 \cdot \frac{1}{x}} \cdot t + \sqrt{\frac{1}{2 \cdot \left(1 + \frac{1}{x}\right) + 2 \cdot \frac{1}{x}}} \cdot \frac{{\ell}^{2}}{t \cdot x}\right)}} \cdot t
\] |
if 1.00000000000000006e-288 < t < 2.00000000000000003e116Initial program 35.2
Simplified35.2
[Start]35.2 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\frac{x + 1}{x - 1} \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}}
\] |
|---|---|
associate-*l/ [<=]35.2 | \[ \color{blue}{\frac{\sqrt{2}}{\sqrt{\frac{x + 1}{x - 1} \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}} \cdot t}
\] |
+-commutative [=>]35.2 | \[ \frac{\sqrt{2}}{\sqrt{\frac{x + 1}{x - 1} \cdot \color{blue}{\left(2 \cdot \left(t \cdot t\right) + \ell \cdot \ell\right)} - \ell \cdot \ell}} \cdot t
\] |
fma-def [=>]35.2 | \[ \frac{\sqrt{2}}{\sqrt{\frac{x + 1}{x - 1} \cdot \color{blue}{\mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right)} - \ell \cdot \ell}} \cdot t
\] |
Taylor expanded in x around inf 15.9
Simplified15.9
[Start]15.9 | \[ \frac{\sqrt{2}}{\sqrt{\left(\frac{{\ell}^{2}}{x} + \left(2 \cdot \frac{{t}^{2}}{x} + 2 \cdot {t}^{2}\right)\right) - -1 \cdot \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x}}} \cdot t
\] |
|---|---|
associate--l+ [=>]15.9 | \[ \frac{\sqrt{2}}{\sqrt{\color{blue}{\frac{{\ell}^{2}}{x} + \left(\left(2 \cdot \frac{{t}^{2}}{x} + 2 \cdot {t}^{2}\right) - -1 \cdot \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x}\right)}}} \cdot t
\] |
unpow2 [=>]15.9 | \[ \frac{\sqrt{2}}{\sqrt{\frac{\color{blue}{\ell \cdot \ell}}{x} + \left(\left(2 \cdot \frac{{t}^{2}}{x} + 2 \cdot {t}^{2}\right) - -1 \cdot \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x}\right)}} \cdot t
\] |
distribute-lft-out [=>]15.9 | \[ \frac{\sqrt{2}}{\sqrt{\frac{\ell \cdot \ell}{x} + \left(\color{blue}{2 \cdot \left(\frac{{t}^{2}}{x} + {t}^{2}\right)} - -1 \cdot \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x}\right)}} \cdot t
\] |
unpow2 [=>]15.9 | \[ \frac{\sqrt{2}}{\sqrt{\frac{\ell \cdot \ell}{x} + \left(2 \cdot \left(\frac{\color{blue}{t \cdot t}}{x} + {t}^{2}\right) - -1 \cdot \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x}\right)}} \cdot t
\] |
unpow2 [=>]15.9 | \[ \frac{\sqrt{2}}{\sqrt{\frac{\ell \cdot \ell}{x} + \left(2 \cdot \left(\frac{t \cdot t}{x} + \color{blue}{t \cdot t}\right) - -1 \cdot \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x}\right)}} \cdot t
\] |
mul-1-neg [=>]15.9 | \[ \frac{\sqrt{2}}{\sqrt{\frac{\ell \cdot \ell}{x} + \left(2 \cdot \left(\frac{t \cdot t}{x} + t \cdot t\right) - \color{blue}{\left(-\frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x}\right)}\right)}} \cdot t
\] |
+-commutative [=>]15.9 | \[ \frac{\sqrt{2}}{\sqrt{\frac{\ell \cdot \ell}{x} + \left(2 \cdot \left(\frac{t \cdot t}{x} + t \cdot t\right) - \left(-\frac{\color{blue}{2 \cdot {t}^{2} + {\ell}^{2}}}{x}\right)\right)}} \cdot t
\] |
unpow2 [=>]15.9 | \[ \frac{\sqrt{2}}{\sqrt{\frac{\ell \cdot \ell}{x} + \left(2 \cdot \left(\frac{t \cdot t}{x} + t \cdot t\right) - \left(-\frac{2 \cdot {t}^{2} + \color{blue}{\ell \cdot \ell}}{x}\right)\right)}} \cdot t
\] |
fma-udef [<=]15.9 | \[ \frac{\sqrt{2}}{\sqrt{\frac{\ell \cdot \ell}{x} + \left(2 \cdot \left(\frac{t \cdot t}{x} + t \cdot t\right) - \left(-\frac{\color{blue}{\mathsf{fma}\left(2, {t}^{2}, \ell \cdot \ell\right)}}{x}\right)\right)}} \cdot t
\] |
unpow2 [=>]15.9 | \[ \frac{\sqrt{2}}{\sqrt{\frac{\ell \cdot \ell}{x} + \left(2 \cdot \left(\frac{t \cdot t}{x} + t \cdot t\right) - \left(-\frac{\mathsf{fma}\left(2, \color{blue}{t \cdot t}, \ell \cdot \ell\right)}{x}\right)\right)}} \cdot t
\] |
Taylor expanded in t around 0 16.2
Simplified16.2
[Start]16.2 | \[ \frac{\sqrt{2}}{\sqrt{\frac{\ell \cdot \ell}{x} + \left(2 \cdot \left(\frac{t \cdot t}{x} + t \cdot t\right) - \left(-\frac{{\ell}^{2}}{x}\right)\right)}} \cdot t
\] |
|---|---|
unpow2 [=>]16.2 | \[ \frac{\sqrt{2}}{\sqrt{\frac{\ell \cdot \ell}{x} + \left(2 \cdot \left(\frac{t \cdot t}{x} + t \cdot t\right) - \left(-\frac{\color{blue}{\ell \cdot \ell}}{x}\right)\right)}} \cdot t
\] |
Applied egg-rr12.5
Simplified12.4
[Start]12.5 | \[ \frac{\sqrt{2}}{{\left(\frac{\ell}{x} \cdot \ell + \mathsf{fma}\left(2, \mathsf{fma}\left(t, t, \frac{t}{x} \cdot t\right), \frac{\ell}{x} \cdot \ell\right)\right)}^{0.25} \cdot {\left(\frac{\ell}{x} \cdot \ell + \mathsf{fma}\left(2, \mathsf{fma}\left(t, t, \frac{t}{x} \cdot t\right), \frac{\ell}{x} \cdot \ell\right)\right)}^{0.25}} \cdot t
\] |
|---|---|
pow-sqr [=>]12.4 | \[ \frac{\sqrt{2}}{\color{blue}{{\left(\frac{\ell}{x} \cdot \ell + \mathsf{fma}\left(2, \mathsf{fma}\left(t, t, \frac{t}{x} \cdot t\right), \frac{\ell}{x} \cdot \ell\right)\right)}^{\left(2 \cdot 0.25\right)}}} \cdot t
\] |
metadata-eval [=>]12.4 | \[ \frac{\sqrt{2}}{{\left(\frac{\ell}{x} \cdot \ell + \mathsf{fma}\left(2, \mathsf{fma}\left(t, t, \frac{t}{x} \cdot t\right), \frac{\ell}{x} \cdot \ell\right)\right)}^{\color{blue}{0.5}}} \cdot t
\] |
unpow1/2 [=>]12.4 | \[ \frac{\sqrt{2}}{\color{blue}{\sqrt{\frac{\ell}{x} \cdot \ell + \mathsf{fma}\left(2, \mathsf{fma}\left(t, t, \frac{t}{x} \cdot t\right), \frac{\ell}{x} \cdot \ell\right)}}} \cdot t
\] |
+-commutative [=>]12.4 | \[ \frac{\sqrt{2}}{\sqrt{\color{blue}{\mathsf{fma}\left(2, \mathsf{fma}\left(t, t, \frac{t}{x} \cdot t\right), \frac{\ell}{x} \cdot \ell\right) + \frac{\ell}{x} \cdot \ell}}} \cdot t
\] |
fma-udef [=>]12.4 | \[ \frac{\sqrt{2}}{\sqrt{\color{blue}{\left(2 \cdot \mathsf{fma}\left(t, t, \frac{t}{x} \cdot t\right) + \frac{\ell}{x} \cdot \ell\right)} + \frac{\ell}{x} \cdot \ell}} \cdot t
\] |
associate-+l+ [=>]12.4 | \[ \frac{\sqrt{2}}{\sqrt{\color{blue}{2 \cdot \mathsf{fma}\left(t, t, \frac{t}{x} \cdot t\right) + \left(\frac{\ell}{x} \cdot \ell + \frac{\ell}{x} \cdot \ell\right)}}} \cdot t
\] |
fma-udef [=>]12.4 | \[ \frac{\sqrt{2}}{\sqrt{2 \cdot \color{blue}{\left(t \cdot t + \frac{t}{x} \cdot t\right)} + \left(\frac{\ell}{x} \cdot \ell + \frac{\ell}{x} \cdot \ell\right)}} \cdot t
\] |
distribute-rgt-out [=>]12.4 | \[ \frac{\sqrt{2}}{\sqrt{2 \cdot \color{blue}{\left(t \cdot \left(t + \frac{t}{x}\right)\right)} + \left(\frac{\ell}{x} \cdot \ell + \frac{\ell}{x} \cdot \ell\right)}} \cdot t
\] |
count-2 [=>]12.4 | \[ \frac{\sqrt{2}}{\sqrt{2 \cdot \left(t \cdot \left(t + \frac{t}{x}\right)\right) + \color{blue}{2 \cdot \left(\frac{\ell}{x} \cdot \ell\right)}}} \cdot t
\] |
*-commutative [=>]12.4 | \[ \frac{\sqrt{2}}{\sqrt{2 \cdot \left(t \cdot \left(t + \frac{t}{x}\right)\right) + 2 \cdot \color{blue}{\left(\ell \cdot \frac{\ell}{x}\right)}}} \cdot t
\] |
if 2.00000000000000003e116 < t Initial program 54.1
Simplified54.1
[Start]54.1 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\frac{x + 1}{x - 1} \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}}
\] |
|---|---|
associate-*l/ [<=]54.1 | \[ \color{blue}{\frac{\sqrt{2}}{\sqrt{\frac{x + 1}{x - 1} \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}} \cdot t}
\] |
+-commutative [=>]54.1 | \[ \frac{\sqrt{2}}{\sqrt{\frac{x + 1}{x - 1} \cdot \color{blue}{\left(2 \cdot \left(t \cdot t\right) + \ell \cdot \ell\right)} - \ell \cdot \ell}} \cdot t
\] |
fma-def [=>]54.1 | \[ \frac{\sqrt{2}}{\sqrt{\frac{x + 1}{x - 1} \cdot \color{blue}{\mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right)} - \ell \cdot \ell}} \cdot t
\] |
Taylor expanded in t around inf 2.8
Simplified2.8
[Start]2.8 | \[ \left(\sqrt{2} \cdot \sqrt{0.5}\right) \cdot \sqrt{\frac{x - 1}{1 + x}}
\] |
|---|---|
associate-*l* [=>]2.8 | \[ \color{blue}{\sqrt{2} \cdot \left(\sqrt{0.5} \cdot \sqrt{\frac{x - 1}{1 + x}}\right)}
\] |
sub-neg [=>]2.8 | \[ \sqrt{2} \cdot \left(\sqrt{0.5} \cdot \sqrt{\frac{\color{blue}{x + \left(-1\right)}}{1 + x}}\right)
\] |
metadata-eval [=>]2.8 | \[ \sqrt{2} \cdot \left(\sqrt{0.5} \cdot \sqrt{\frac{x + \color{blue}{-1}}{1 + x}}\right)
\] |
+-commutative [=>]2.8 | \[ \sqrt{2} \cdot \left(\sqrt{0.5} \cdot \sqrt{\frac{\color{blue}{-1 + x}}{1 + x}}\right)
\] |
+-commutative [=>]2.8 | \[ \sqrt{2} \cdot \left(\sqrt{0.5} \cdot \sqrt{\frac{-1 + x}{\color{blue}{x + 1}}}\right)
\] |
Applied egg-rr1.9
Simplified1.9
[Start]1.9 | \[ e^{\mathsf{log1p}\left(\sqrt{\frac{-1 + x}{x + 1}}\right)} - 1
\] |
|---|---|
expm1-def [=>]1.9 | \[ \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{\frac{-1 + x}{x + 1}}\right)\right)}
\] |
expm1-log1p [=>]1.9 | \[ \color{blue}{\sqrt{\frac{-1 + x}{x + 1}}}
\] |
Final simplification8.9
| Alternative 1 | |
|---|---|
| Error | 9.9 |
| Cost | 14672 |
| Alternative 2 | |
|---|---|
| Error | 10.0 |
| Cost | 14288 |
| Alternative 3 | |
|---|---|
| Error | 14.5 |
| Cost | 14032 |
| Alternative 4 | |
|---|---|
| Error | 14.4 |
| Cost | 14032 |
| Alternative 5 | |
|---|---|
| Error | 14.0 |
| Cost | 13768 |
| Alternative 6 | |
|---|---|
| Error | 14.6 |
| Cost | 7108 |
| Alternative 7 | |
|---|---|
| Error | 14.6 |
| Cost | 7044 |
| Alternative 8 | |
|---|---|
| Error | 14.7 |
| Cost | 6980 |
| Alternative 9 | |
|---|---|
| Error | 14.9 |
| Cost | 836 |
| Alternative 10 | |
|---|---|
| Error | 14.8 |
| Cost | 836 |
| Alternative 11 | |
|---|---|
| Error | 15.2 |
| Cost | 452 |
| Alternative 12 | |
|---|---|
| Error | 15.0 |
| Cost | 452 |
| Alternative 13 | |
|---|---|
| Error | 15.4 |
| Cost | 196 |
| Alternative 14 | |
|---|---|
| Error | 39.5 |
| Cost | 64 |
herbie shell --seed 2023047
(FPCore (x l t)
:name "Toniolo and Linder, Equation (7)"
:precision binary64
(/ (* (sqrt 2.0) t) (sqrt (- (* (/ (+ x 1.0) (- x 1.0)) (+ (* l l) (* 2.0 (* t t)))) (* l l)))))