| Alternative 1 | |
|---|---|
| Error | 9.7 |
| 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 (* t (sqrt 2.0)))
(t_2
(/ t_1 (sqrt (* 2.0 (+ (* l (/ l x)) (+ (* t t) (/ (* t t) x))))))))
(if (<= t -1.25e+82)
(- (sqrt (/ (- 1.0 x) (- -1.0 x))))
(if (<= t -1.15e-149)
t_2
(if (<= t 1.25e-170)
(/ t_1 (* (sqrt 2.0) (hypot (hypot t (/ t (sqrt x))) (/ l (sqrt x)))))
(if (<= t 3.4e+70) t_2 (+ 1.0 (+ (/ 0.5 (* x x)) (/ -1.0 x)))))))))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 = t * sqrt(2.0);
double t_2 = t_1 / sqrt((2.0 * ((l * (l / x)) + ((t * t) + ((t * t) / x)))));
double tmp;
if (t <= -1.25e+82) {
tmp = -sqrt(((1.0 - x) / (-1.0 - x)));
} else if (t <= -1.15e-149) {
tmp = t_2;
} else if (t <= 1.25e-170) {
tmp = t_1 / (sqrt(2.0) * hypot(hypot(t, (t / sqrt(x))), (l / sqrt(x))));
} else if (t <= 3.4e+70) {
tmp = t_2;
} else {
tmp = 1.0 + ((0.5 / (x * x)) + (-1.0 / x));
}
return tmp;
}
public static double code(double x, double l, double t) {
return (Math.sqrt(2.0) * t) / Math.sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l)));
}
public static double code(double x, double l, double t) {
double t_1 = t * Math.sqrt(2.0);
double t_2 = t_1 / Math.sqrt((2.0 * ((l * (l / x)) + ((t * t) + ((t * t) / x)))));
double tmp;
if (t <= -1.25e+82) {
tmp = -Math.sqrt(((1.0 - x) / (-1.0 - x)));
} else if (t <= -1.15e-149) {
tmp = t_2;
} else if (t <= 1.25e-170) {
tmp = t_1 / (Math.sqrt(2.0) * Math.hypot(Math.hypot(t, (t / Math.sqrt(x))), (l / Math.sqrt(x))));
} else if (t <= 3.4e+70) {
tmp = t_2;
} else {
tmp = 1.0 + ((0.5 / (x * x)) + (-1.0 / x));
}
return tmp;
}
def code(x, l, t): return (math.sqrt(2.0) * t) / math.sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l)))
def code(x, l, t): t_1 = t * math.sqrt(2.0) t_2 = t_1 / math.sqrt((2.0 * ((l * (l / x)) + ((t * t) + ((t * t) / x))))) tmp = 0 if t <= -1.25e+82: tmp = -math.sqrt(((1.0 - x) / (-1.0 - x))) elif t <= -1.15e-149: tmp = t_2 elif t <= 1.25e-170: tmp = t_1 / (math.sqrt(2.0) * math.hypot(math.hypot(t, (t / math.sqrt(x))), (l / math.sqrt(x)))) elif t <= 3.4e+70: tmp = t_2 else: tmp = 1.0 + ((0.5 / (x * x)) + (-1.0 / x)) 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(t * sqrt(2.0)) t_2 = Float64(t_1 / sqrt(Float64(2.0 * Float64(Float64(l * Float64(l / x)) + Float64(Float64(t * t) + Float64(Float64(t * t) / x)))))) tmp = 0.0 if (t <= -1.25e+82) tmp = Float64(-sqrt(Float64(Float64(1.0 - x) / Float64(-1.0 - x)))); elseif (t <= -1.15e-149) tmp = t_2; elseif (t <= 1.25e-170) tmp = Float64(t_1 / Float64(sqrt(2.0) * hypot(hypot(t, Float64(t / sqrt(x))), Float64(l / sqrt(x))))); elseif (t <= 3.4e+70) tmp = t_2; else tmp = Float64(1.0 + Float64(Float64(0.5 / Float64(x * x)) + Float64(-1.0 / x))); end return tmp end
function tmp = code(x, l, t) tmp = (sqrt(2.0) * t) / sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l))); end
function tmp_2 = code(x, l, t) t_1 = t * sqrt(2.0); t_2 = t_1 / sqrt((2.0 * ((l * (l / x)) + ((t * t) + ((t * t) / x))))); tmp = 0.0; if (t <= -1.25e+82) tmp = -sqrt(((1.0 - x) / (-1.0 - x))); elseif (t <= -1.15e-149) tmp = t_2; elseif (t <= 1.25e-170) tmp = t_1 / (sqrt(2.0) * hypot(hypot(t, (t / sqrt(x))), (l / sqrt(x)))); elseif (t <= 3.4e+70) tmp = t_2; else tmp = 1.0 + ((0.5 / (x * x)) + (-1.0 / x)); end tmp_2 = 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[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 / N[Sqrt[N[(2.0 * N[(N[(l * N[(l / x), $MachinePrecision]), $MachinePrecision] + N[(N[(t * t), $MachinePrecision] + N[(N[(t * t), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.25e+82], (-N[Sqrt[N[(N[(1.0 - x), $MachinePrecision] / N[(-1.0 - x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), If[LessEqual[t, -1.15e-149], t$95$2, If[LessEqual[t, 1.25e-170], N[(t$95$1 / N[(N[Sqrt[2.0], $MachinePrecision] * N[Sqrt[N[Sqrt[t ^ 2 + N[(t / N[Sqrt[x], $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision] ^ 2 + N[(l / N[Sqrt[x], $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.4e+70], t$95$2, N[(1.0 + N[(N[(0.5 / N[(x * x), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\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 := t \cdot \sqrt{2}\\
t_2 := \frac{t_1}{\sqrt{2 \cdot \left(\ell \cdot \frac{\ell}{x} + \left(t \cdot t + \frac{t \cdot t}{x}\right)\right)}}\\
\mathbf{if}\;t \leq -1.25 \cdot 10^{+82}:\\
\;\;\;\;-\sqrt{\frac{1 - x}{-1 - x}}\\
\mathbf{elif}\;t \leq -1.15 \cdot 10^{-149}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 1.25 \cdot 10^{-170}:\\
\;\;\;\;\frac{t_1}{\sqrt{2} \cdot \mathsf{hypot}\left(\mathsf{hypot}\left(t, \frac{t}{\sqrt{x}}\right), \frac{\ell}{\sqrt{x}}\right)}\\
\mathbf{elif}\;t \leq 3.4 \cdot 10^{+70}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;1 + \left(\frac{0.5}{x \cdot x} + \frac{-1}{x}\right)\\
\end{array}
Results
if t < -1.25000000000000004e82Initial program 48.7
Simplified48.7
[Start]48.7 | \[ \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-*r/ [<=]48.7 | \[ \color{blue}{\sqrt{2} \cdot \frac{t}{\sqrt{\frac{x + 1}{x - 1} \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}}}
\] |
fma-neg [=>]48.7 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{\color{blue}{\mathsf{fma}\left(\frac{x + 1}{x - 1}, \ell \cdot \ell + 2 \cdot \left(t \cdot t\right), -\ell \cdot \ell\right)}}}
\] |
+-commutative [=>]48.7 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{\mathsf{fma}\left(\frac{x + 1}{x - 1}, \color{blue}{2 \cdot \left(t \cdot t\right) + \ell \cdot \ell}, -\ell \cdot \ell\right)}}
\] |
fma-def [=>]48.7 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{\mathsf{fma}\left(\frac{x + 1}{x - 1}, \color{blue}{\mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right)}, -\ell \cdot \ell\right)}}
\] |
distribute-rgt-neg-in [=>]48.7 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{\mathsf{fma}\left(\frac{x + 1}{x - 1}, \mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right), \color{blue}{\ell \cdot \left(-\ell\right)}\right)}}
\] |
Taylor expanded in t around -inf 4.0
Simplified4.0
[Start]4.0 | \[ \sqrt{2} \cdot \left(-1 \cdot \left(\sqrt{0.5} \cdot \sqrt{\frac{x - 1}{1 + x}}\right)\right)
\] |
|---|---|
mul-1-neg [=>]4.0 | \[ \sqrt{2} \cdot \color{blue}{\left(-\sqrt{0.5} \cdot \sqrt{\frac{x - 1}{1 + x}}\right)}
\] |
*-commutative [=>]4.0 | \[ \sqrt{2} \cdot \left(-\color{blue}{\sqrt{\frac{x - 1}{1 + x}} \cdot \sqrt{0.5}}\right)
\] |
sub-neg [=>]4.0 | \[ \sqrt{2} \cdot \left(-\sqrt{\frac{\color{blue}{x + \left(-1\right)}}{1 + x}} \cdot \sqrt{0.5}\right)
\] |
metadata-eval [=>]4.0 | \[ \sqrt{2} \cdot \left(-\sqrt{\frac{x + \color{blue}{-1}}{1 + x}} \cdot \sqrt{0.5}\right)
\] |
+-commutative [=>]4.0 | \[ \sqrt{2} \cdot \left(-\sqrt{\frac{\color{blue}{-1 + x}}{1 + x}} \cdot \sqrt{0.5}\right)
\] |
+-commutative [=>]4.0 | \[ \sqrt{2} \cdot \left(-\sqrt{\frac{-1 + x}{\color{blue}{x + 1}}} \cdot \sqrt{0.5}\right)
\] |
Applied egg-rr3.1
Simplified3.1
[Start]3.1 | \[ \left(0 - e^{\mathsf{log1p}\left(\sqrt{2 \cdot \left(\frac{1 - x}{-1 - x} \cdot 0.5\right)}\right)}\right) + 1
\] |
|---|---|
associate-+l- [=>]3.1 | \[ \color{blue}{0 - \left(e^{\mathsf{log1p}\left(\sqrt{2 \cdot \left(\frac{1 - x}{-1 - x} \cdot 0.5\right)}\right)} - 1\right)}
\] |
expm1-def [=>]3.1 | \[ 0 - \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{2 \cdot \left(\frac{1 - x}{-1 - x} \cdot 0.5\right)}\right)\right)}
\] |
expm1-log1p [=>]3.1 | \[ 0 - \color{blue}{\sqrt{2 \cdot \left(\frac{1 - x}{-1 - x} \cdot 0.5\right)}}
\] |
sub0-neg [=>]3.1 | \[ \color{blue}{-\sqrt{2 \cdot \left(\frac{1 - x}{-1 - x} \cdot 0.5\right)}}
\] |
*-commutative [=>]3.1 | \[ -\sqrt{2 \cdot \color{blue}{\left(0.5 \cdot \frac{1 - x}{-1 - x}\right)}}
\] |
associate-*r* [=>]3.1 | \[ -\sqrt{\color{blue}{\left(2 \cdot 0.5\right) \cdot \frac{1 - x}{-1 - x}}}
\] |
metadata-eval [=>]3.1 | \[ -\sqrt{\color{blue}{1} \cdot \frac{1 - x}{-1 - x}}
\] |
associate-*r/ [=>]3.1 | \[ -\sqrt{\color{blue}{\frac{1 \cdot \left(1 - x\right)}{-1 - x}}}
\] |
if -1.25000000000000004e82 < t < -1.15e-149 or 1.25000000000000003e-170 < t < 3.4000000000000001e70Initial program 28.1
Taylor expanded in x around inf 10.8
Simplified10.8
[Start]10.8 | \[ \frac{\sqrt{2} \cdot t}{\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}}}
\] |
|---|---|
associate--l+ [=>]10.8 | \[ \frac{\sqrt{2} \cdot t}{\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)}}}
\] |
unpow2 [=>]10.8 | \[ \frac{\sqrt{2} \cdot t}{\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)}}
\] |
associate-/l* [=>]10.8 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\color{blue}{\frac{\ell}{\frac{x}{\ell}}} + \left(\left(2 \cdot \frac{{t}^{2}}{x} + 2 \cdot {t}^{2}\right) - -1 \cdot \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x}\right)}}
\] |
distribute-lft-out [=>]10.8 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\frac{\ell}{\frac{x}{\ell}} + \left(\color{blue}{2 \cdot \left(\frac{{t}^{2}}{x} + {t}^{2}\right)} - -1 \cdot \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x}\right)}}
\] |
+-commutative [=>]10.8 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\frac{\ell}{\frac{x}{\ell}} + \left(2 \cdot \color{blue}{\left({t}^{2} + \frac{{t}^{2}}{x}\right)} - -1 \cdot \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x}\right)}}
\] |
unpow2 [=>]10.8 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\frac{\ell}{\frac{x}{\ell}} + \left(2 \cdot \left(\color{blue}{t \cdot t} + \frac{{t}^{2}}{x}\right) - -1 \cdot \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x}\right)}}
\] |
unpow2 [=>]10.8 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\frac{\ell}{\frac{x}{\ell}} + \left(2 \cdot \left(t \cdot t + \frac{\color{blue}{t \cdot t}}{x}\right) - -1 \cdot \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x}\right)}}
\] |
associate-/l* [=>]10.8 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\frac{\ell}{\frac{x}{\ell}} + \left(2 \cdot \left(t \cdot t + \color{blue}{\frac{t}{\frac{x}{t}}}\right) - -1 \cdot \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x}\right)}}
\] |
associate-*r/ [=>]10.8 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\frac{\ell}{\frac{x}{\ell}} + \left(2 \cdot \left(t \cdot t + \frac{t}{\frac{x}{t}}\right) - \color{blue}{\frac{-1 \cdot \left({\ell}^{2} + 2 \cdot {t}^{2}\right)}{x}}\right)}}
\] |
mul-1-neg [=>]10.8 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\frac{\ell}{\frac{x}{\ell}} + \left(2 \cdot \left(t \cdot t + \frac{t}{\frac{x}{t}}\right) - \frac{\color{blue}{-\left({\ell}^{2} + 2 \cdot {t}^{2}\right)}}{x}\right)}}
\] |
+-commutative [=>]10.8 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\frac{\ell}{\frac{x}{\ell}} + \left(2 \cdot \left(t \cdot t + \frac{t}{\frac{x}{t}}\right) - \frac{-\color{blue}{\left(2 \cdot {t}^{2} + {\ell}^{2}\right)}}{x}\right)}}
\] |
unpow2 [=>]10.8 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\frac{\ell}{\frac{x}{\ell}} + \left(2 \cdot \left(t \cdot t + \frac{t}{\frac{x}{t}}\right) - \frac{-\left(2 \cdot {t}^{2} + \color{blue}{\ell \cdot \ell}\right)}{x}\right)}}
\] |
fma-udef [<=]10.8 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\frac{\ell}{\frac{x}{\ell}} + \left(2 \cdot \left(t \cdot t + \frac{t}{\frac{x}{t}}\right) - \frac{-\color{blue}{\mathsf{fma}\left(2, {t}^{2}, \ell \cdot \ell\right)}}{x}\right)}}
\] |
unpow2 [=>]10.8 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\frac{\ell}{\frac{x}{\ell}} + \left(2 \cdot \left(t \cdot t + \frac{t}{\frac{x}{t}}\right) - \frac{-\mathsf{fma}\left(2, \color{blue}{t \cdot t}, \ell \cdot \ell\right)}{x}\right)}}
\] |
Taylor expanded in t around 0 11.1
Simplified11.1
[Start]11.1 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\frac{\ell}{\frac{x}{\ell}} + \left(2 \cdot \left(t \cdot t + \frac{t}{\frac{x}{t}}\right) - -1 \cdot \frac{{\ell}^{2}}{x}\right)}}
\] |
|---|---|
mul-1-neg [=>]11.1 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\frac{\ell}{\frac{x}{\ell}} + \left(2 \cdot \left(t \cdot t + \frac{t}{\frac{x}{t}}\right) - \color{blue}{\left(-\frac{{\ell}^{2}}{x}\right)}\right)}}
\] |
distribute-frac-neg [<=]11.1 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\frac{\ell}{\frac{x}{\ell}} + \left(2 \cdot \left(t \cdot t + \frac{t}{\frac{x}{t}}\right) - \color{blue}{\frac{-{\ell}^{2}}{x}}\right)}}
\] |
unpow2 [=>]11.1 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\frac{\ell}{\frac{x}{\ell}} + \left(2 \cdot \left(t \cdot t + \frac{t}{\frac{x}{t}}\right) - \frac{-\color{blue}{\ell \cdot \ell}}{x}\right)}}
\] |
Taylor expanded in l around 0 11.1
Simplified6.2
[Start]11.1 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{2 \cdot \frac{{\ell}^{2}}{x} + 2 \cdot \left(\frac{{t}^{2}}{x} + {t}^{2}\right)}}
\] |
|---|---|
distribute-lft-out [=>]11.1 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\color{blue}{2 \cdot \left(\frac{{\ell}^{2}}{x} + \left(\frac{{t}^{2}}{x} + {t}^{2}\right)\right)}}}
\] |
unpow2 [=>]11.1 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{2 \cdot \left(\frac{\color{blue}{\ell \cdot \ell}}{x} + \left(\frac{{t}^{2}}{x} + {t}^{2}\right)\right)}}
\] |
associate-*r/ [<=]6.2 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{2 \cdot \left(\color{blue}{\ell \cdot \frac{\ell}{x}} + \left(\frac{{t}^{2}}{x} + {t}^{2}\right)\right)}}
\] |
+-commutative [=>]6.2 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{2 \cdot \left(\ell \cdot \frac{\ell}{x} + \color{blue}{\left({t}^{2} + \frac{{t}^{2}}{x}\right)}\right)}}
\] |
unpow2 [=>]6.2 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{2 \cdot \left(\ell \cdot \frac{\ell}{x} + \left(\color{blue}{t \cdot t} + \frac{{t}^{2}}{x}\right)\right)}}
\] |
unpow2 [=>]6.2 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{2 \cdot \left(\ell \cdot \frac{\ell}{x} + \left(t \cdot t + \frac{\color{blue}{t \cdot t}}{x}\right)\right)}}
\] |
if -1.15e-149 < t < 1.25000000000000003e-170Initial program 62.1
Taylor expanded in x around inf 34.0
Simplified34.0
[Start]34.0 | \[ \frac{\sqrt{2} \cdot t}{\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}}}
\] |
|---|---|
associate--l+ [=>]34.0 | \[ \frac{\sqrt{2} \cdot t}{\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)}}}
\] |
unpow2 [=>]34.0 | \[ \frac{\sqrt{2} \cdot t}{\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)}}
\] |
associate-/l* [=>]34.0 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\color{blue}{\frac{\ell}{\frac{x}{\ell}}} + \left(\left(2 \cdot \frac{{t}^{2}}{x} + 2 \cdot {t}^{2}\right) - -1 \cdot \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x}\right)}}
\] |
distribute-lft-out [=>]34.0 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\frac{\ell}{\frac{x}{\ell}} + \left(\color{blue}{2 \cdot \left(\frac{{t}^{2}}{x} + {t}^{2}\right)} - -1 \cdot \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x}\right)}}
\] |
+-commutative [=>]34.0 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\frac{\ell}{\frac{x}{\ell}} + \left(2 \cdot \color{blue}{\left({t}^{2} + \frac{{t}^{2}}{x}\right)} - -1 \cdot \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x}\right)}}
\] |
unpow2 [=>]34.0 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\frac{\ell}{\frac{x}{\ell}} + \left(2 \cdot \left(\color{blue}{t \cdot t} + \frac{{t}^{2}}{x}\right) - -1 \cdot \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x}\right)}}
\] |
unpow2 [=>]34.0 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\frac{\ell}{\frac{x}{\ell}} + \left(2 \cdot \left(t \cdot t + \frac{\color{blue}{t \cdot t}}{x}\right) - -1 \cdot \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x}\right)}}
\] |
associate-/l* [=>]34.0 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\frac{\ell}{\frac{x}{\ell}} + \left(2 \cdot \left(t \cdot t + \color{blue}{\frac{t}{\frac{x}{t}}}\right) - -1 \cdot \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x}\right)}}
\] |
associate-*r/ [=>]34.0 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\frac{\ell}{\frac{x}{\ell}} + \left(2 \cdot \left(t \cdot t + \frac{t}{\frac{x}{t}}\right) - \color{blue}{\frac{-1 \cdot \left({\ell}^{2} + 2 \cdot {t}^{2}\right)}{x}}\right)}}
\] |
mul-1-neg [=>]34.0 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\frac{\ell}{\frac{x}{\ell}} + \left(2 \cdot \left(t \cdot t + \frac{t}{\frac{x}{t}}\right) - \frac{\color{blue}{-\left({\ell}^{2} + 2 \cdot {t}^{2}\right)}}{x}\right)}}
\] |
+-commutative [=>]34.0 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\frac{\ell}{\frac{x}{\ell}} + \left(2 \cdot \left(t \cdot t + \frac{t}{\frac{x}{t}}\right) - \frac{-\color{blue}{\left(2 \cdot {t}^{2} + {\ell}^{2}\right)}}{x}\right)}}
\] |
unpow2 [=>]34.0 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\frac{\ell}{\frac{x}{\ell}} + \left(2 \cdot \left(t \cdot t + \frac{t}{\frac{x}{t}}\right) - \frac{-\left(2 \cdot {t}^{2} + \color{blue}{\ell \cdot \ell}\right)}{x}\right)}}
\] |
fma-udef [<=]34.0 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\frac{\ell}{\frac{x}{\ell}} + \left(2 \cdot \left(t \cdot t + \frac{t}{\frac{x}{t}}\right) - \frac{-\color{blue}{\mathsf{fma}\left(2, {t}^{2}, \ell \cdot \ell\right)}}{x}\right)}}
\] |
unpow2 [=>]34.0 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\frac{\ell}{\frac{x}{\ell}} + \left(2 \cdot \left(t \cdot t + \frac{t}{\frac{x}{t}}\right) - \frac{-\mathsf{fma}\left(2, \color{blue}{t \cdot t}, \ell \cdot \ell\right)}{x}\right)}}
\] |
Taylor expanded in t around 0 34.0
Simplified34.0
[Start]34.0 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\frac{\ell}{\frac{x}{\ell}} + \left(2 \cdot \left(t \cdot t + \frac{t}{\frac{x}{t}}\right) - -1 \cdot \frac{{\ell}^{2}}{x}\right)}}
\] |
|---|---|
mul-1-neg [=>]34.0 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\frac{\ell}{\frac{x}{\ell}} + \left(2 \cdot \left(t \cdot t + \frac{t}{\frac{x}{t}}\right) - \color{blue}{\left(-\frac{{\ell}^{2}}{x}\right)}\right)}}
\] |
distribute-frac-neg [<=]34.0 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\frac{\ell}{\frac{x}{\ell}} + \left(2 \cdot \left(t \cdot t + \frac{t}{\frac{x}{t}}\right) - \color{blue}{\frac{-{\ell}^{2}}{x}}\right)}}
\] |
unpow2 [=>]34.0 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\frac{\ell}{\frac{x}{\ell}} + \left(2 \cdot \left(t \cdot t + \frac{t}{\frac{x}{t}}\right) - \frac{-\color{blue}{\ell \cdot \ell}}{x}\right)}}
\] |
Taylor expanded in l around 0 34.0
Simplified31.8
[Start]34.0 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{2 \cdot \frac{{\ell}^{2}}{x} + 2 \cdot \left(\frac{{t}^{2}}{x} + {t}^{2}\right)}}
\] |
|---|---|
distribute-lft-out [=>]34.0 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\color{blue}{2 \cdot \left(\frac{{\ell}^{2}}{x} + \left(\frac{{t}^{2}}{x} + {t}^{2}\right)\right)}}}
\] |
unpow2 [=>]34.0 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{2 \cdot \left(\frac{\color{blue}{\ell \cdot \ell}}{x} + \left(\frac{{t}^{2}}{x} + {t}^{2}\right)\right)}}
\] |
associate-*r/ [<=]31.8 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{2 \cdot \left(\color{blue}{\ell \cdot \frac{\ell}{x}} + \left(\frac{{t}^{2}}{x} + {t}^{2}\right)\right)}}
\] |
+-commutative [=>]31.8 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{2 \cdot \left(\ell \cdot \frac{\ell}{x} + \color{blue}{\left({t}^{2} + \frac{{t}^{2}}{x}\right)}\right)}}
\] |
unpow2 [=>]31.8 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{2 \cdot \left(\ell \cdot \frac{\ell}{x} + \left(\color{blue}{t \cdot t} + \frac{{t}^{2}}{x}\right)\right)}}
\] |
unpow2 [=>]31.8 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{2 \cdot \left(\ell \cdot \frac{\ell}{x} + \left(t \cdot t + \frac{\color{blue}{t \cdot t}}{x}\right)\right)}}
\] |
Applied egg-rr14.8
if 3.4000000000000001e70 < t Initial program 47.0
Simplified47.0
[Start]47.0 | \[ \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-*r/ [<=]47.0 | \[ \color{blue}{\sqrt{2} \cdot \frac{t}{\sqrt{\frac{x + 1}{x - 1} \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}}}
\] |
fma-neg [=>]47.0 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{\color{blue}{\mathsf{fma}\left(\frac{x + 1}{x - 1}, \ell \cdot \ell + 2 \cdot \left(t \cdot t\right), -\ell \cdot \ell\right)}}}
\] |
+-commutative [=>]47.0 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{\mathsf{fma}\left(\frac{x + 1}{x - 1}, \color{blue}{2 \cdot \left(t \cdot t\right) + \ell \cdot \ell}, -\ell \cdot \ell\right)}}
\] |
fma-def [=>]47.0 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{\mathsf{fma}\left(\frac{x + 1}{x - 1}, \color{blue}{\mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right)}, -\ell \cdot \ell\right)}}
\] |
distribute-rgt-neg-in [=>]47.0 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{\mathsf{fma}\left(\frac{x + 1}{x - 1}, \mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right), \color{blue}{\ell \cdot \left(-\ell\right)}\right)}}
\] |
Taylor expanded in t around -inf 63.0
Simplified63.0
[Start]63.0 | \[ \sqrt{2} \cdot \left(-1 \cdot \left(\sqrt{0.5} \cdot \sqrt{\frac{x - 1}{1 + x}}\right)\right)
\] |
|---|---|
mul-1-neg [=>]63.0 | \[ \sqrt{2} \cdot \color{blue}{\left(-\sqrt{0.5} \cdot \sqrt{\frac{x - 1}{1 + x}}\right)}
\] |
*-commutative [=>]63.0 | \[ \sqrt{2} \cdot \left(-\color{blue}{\sqrt{\frac{x - 1}{1 + x}} \cdot \sqrt{0.5}}\right)
\] |
sub-neg [=>]63.0 | \[ \sqrt{2} \cdot \left(-\sqrt{\frac{\color{blue}{x + \left(-1\right)}}{1 + x}} \cdot \sqrt{0.5}\right)
\] |
metadata-eval [=>]63.0 | \[ \sqrt{2} \cdot \left(-\sqrt{\frac{x + \color{blue}{-1}}{1 + x}} \cdot \sqrt{0.5}\right)
\] |
+-commutative [=>]63.0 | \[ \sqrt{2} \cdot \left(-\sqrt{\frac{\color{blue}{-1 + x}}{1 + x}} \cdot \sqrt{0.5}\right)
\] |
+-commutative [=>]63.0 | \[ \sqrt{2} \cdot \left(-\sqrt{\frac{-1 + x}{\color{blue}{x + 1}}} \cdot \sqrt{0.5}\right)
\] |
Applied egg-rr3.3
Simplified3.3
[Start]3.3 | \[ 0 + \sqrt{2 \cdot \left(\frac{1 - x}{-1 - x} \cdot 0.5\right)}
\] |
|---|---|
+-lft-identity [=>]3.3 | \[ \color{blue}{\sqrt{2 \cdot \left(\frac{1 - x}{-1 - x} \cdot 0.5\right)}}
\] |
*-commutative [=>]3.3 | \[ \sqrt{2 \cdot \color{blue}{\left(0.5 \cdot \frac{1 - x}{-1 - x}\right)}}
\] |
associate-*r* [=>]3.3 | \[ \sqrt{\color{blue}{\left(2 \cdot 0.5\right) \cdot \frac{1 - x}{-1 - x}}}
\] |
metadata-eval [=>]3.3 | \[ \sqrt{\color{blue}{1} \cdot \frac{1 - x}{-1 - x}}
\] |
associate-*r/ [=>]3.3 | \[ \sqrt{\color{blue}{\frac{1 \cdot \left(1 - x\right)}{-1 - x}}}
\] |
Taylor expanded in x around -inf 3.6
Simplified3.6
[Start]3.6 | \[ \left(1 + 0.5 \cdot \frac{1}{{x}^{2}}\right) - \frac{1}{x}
\] |
|---|---|
sub-neg [=>]3.6 | \[ \color{blue}{\left(1 + 0.5 \cdot \frac{1}{{x}^{2}}\right) + \left(-\frac{1}{x}\right)}
\] |
associate-+l+ [=>]3.6 | \[ \color{blue}{1 + \left(0.5 \cdot \frac{1}{{x}^{2}} + \left(-\frac{1}{x}\right)\right)}
\] |
sub-neg [<=]3.6 | \[ 1 + \color{blue}{\left(0.5 \cdot \frac{1}{{x}^{2}} - \frac{1}{x}\right)}
\] |
associate-*r/ [=>]3.6 | \[ 1 + \left(\color{blue}{\frac{0.5 \cdot 1}{{x}^{2}}} - \frac{1}{x}\right)
\] |
metadata-eval [=>]3.6 | \[ 1 + \left(\frac{\color{blue}{0.5}}{{x}^{2}} - \frac{1}{x}\right)
\] |
unpow2 [=>]3.6 | \[ 1 + \left(\frac{0.5}{\color{blue}{x \cdot x}} - \frac{1}{x}\right)
\] |
Final simplification6.6
| Alternative 1 | |
|---|---|
| Error | 9.7 |
| Cost | 14672 |
| Alternative 2 | |
|---|---|
| Error | 9.7 |
| Cost | 14288 |
| Alternative 3 | |
|---|---|
| Error | 14.3 |
| Cost | 14032 |
| Alternative 4 | |
|---|---|
| Error | 14.3 |
| Cost | 14032 |
| Alternative 5 | |
|---|---|
| Error | 14.3 |
| Cost | 13640 |
| Alternative 6 | |
|---|---|
| Error | 15.0 |
| Cost | 7044 |
| Alternative 7 | |
|---|---|
| Error | 15.2 |
| Cost | 6980 |
| Alternative 8 | |
|---|---|
| Error | 15.4 |
| Cost | 836 |
| Alternative 9 | |
|---|---|
| Error | 15.3 |
| Cost | 836 |
| Alternative 10 | |
|---|---|
| Error | 15.7 |
| Cost | 452 |
| Alternative 11 | |
|---|---|
| Error | 15.5 |
| Cost | 452 |
| Alternative 12 | |
|---|---|
| Error | 15.9 |
| Cost | 196 |
| Alternative 13 | |
|---|---|
| Error | 39.6 |
| Cost | 64 |
herbie shell --seed 2023057
(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)))))