| Alternative 1 | |
|---|---|
| Error | 8.6 |
| Cost | 21448 |
(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))
(sqrt
(+
(/ l (/ x l))
(+ (/ (* l l) x) (* 2.0 (+ (* t t) (/ t (/ x t))))))))))
(if (<= t -6.8e+44)
-1.0
(if (<= t -1.8e-159)
t_1
(if (<= t 8.2e-117)
(/ t (hypot t (/ l (sqrt x))))
(if (<= t 0.38)
t_1
(if (<= t 2.5e+48) (/ t (hypot t (* l (sqrt (/ 1.0 x))))) 1.0)))))))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)) / sqrt(((l / (x / l)) + (((l * l) / x) + (2.0 * ((t * t) + (t / (x / t)))))));
double tmp;
if (t <= -6.8e+44) {
tmp = -1.0;
} else if (t <= -1.8e-159) {
tmp = t_1;
} else if (t <= 8.2e-117) {
tmp = t / hypot(t, (l / sqrt(x)));
} else if (t <= 0.38) {
tmp = t_1;
} else if (t <= 2.5e+48) {
tmp = t / hypot(t, (l * sqrt((1.0 / x))));
} else {
tmp = 1.0;
}
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)) / Math.sqrt(((l / (x / l)) + (((l * l) / x) + (2.0 * ((t * t) + (t / (x / t)))))));
double tmp;
if (t <= -6.8e+44) {
tmp = -1.0;
} else if (t <= -1.8e-159) {
tmp = t_1;
} else if (t <= 8.2e-117) {
tmp = t / Math.hypot(t, (l / Math.sqrt(x)));
} else if (t <= 0.38) {
tmp = t_1;
} else if (t <= 2.5e+48) {
tmp = t / Math.hypot(t, (l * Math.sqrt((1.0 / x))));
} else {
tmp = 1.0;
}
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)) / math.sqrt(((l / (x / l)) + (((l * l) / x) + (2.0 * ((t * t) + (t / (x / t))))))) tmp = 0 if t <= -6.8e+44: tmp = -1.0 elif t <= -1.8e-159: tmp = t_1 elif t <= 8.2e-117: tmp = t / math.hypot(t, (l / math.sqrt(x))) elif t <= 0.38: tmp = t_1 elif t <= 2.5e+48: tmp = t / math.hypot(t, (l * math.sqrt((1.0 / x)))) else: tmp = 1.0 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(Float64(t * sqrt(2.0)) / sqrt(Float64(Float64(l / Float64(x / l)) + Float64(Float64(Float64(l * l) / x) + Float64(2.0 * Float64(Float64(t * t) + Float64(t / Float64(x / t)))))))) tmp = 0.0 if (t <= -6.8e+44) tmp = -1.0; elseif (t <= -1.8e-159) tmp = t_1; elseif (t <= 8.2e-117) tmp = Float64(t / hypot(t, Float64(l / sqrt(x)))); elseif (t <= 0.38) tmp = t_1; elseif (t <= 2.5e+48) tmp = Float64(t / hypot(t, Float64(l * sqrt(Float64(1.0 / x))))); else tmp = 1.0; 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)) / sqrt(((l / (x / l)) + (((l * l) / x) + (2.0 * ((t * t) + (t / (x / t))))))); tmp = 0.0; if (t <= -6.8e+44) tmp = -1.0; elseif (t <= -1.8e-159) tmp = t_1; elseif (t <= 8.2e-117) tmp = t / hypot(t, (l / sqrt(x))); elseif (t <= 0.38) tmp = t_1; elseif (t <= 2.5e+48) tmp = t / hypot(t, (l * sqrt((1.0 / x)))); else tmp = 1.0; 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[(N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(N[(l / N[(x / l), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(l * l), $MachinePrecision] / x), $MachinePrecision] + N[(2.0 * N[(N[(t * t), $MachinePrecision] + N[(t / N[(x / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -6.8e+44], -1.0, If[LessEqual[t, -1.8e-159], t$95$1, If[LessEqual[t, 8.2e-117], N[(t / N[Sqrt[t ^ 2 + N[(l / N[Sqrt[x], $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 0.38], t$95$1, If[LessEqual[t, 2.5e+48], N[(t / N[Sqrt[t ^ 2 + N[(l * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision], 1.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}}
\begin{array}{l}
t_1 := \frac{t \cdot \sqrt{2}}{\sqrt{\frac{\ell}{\frac{x}{\ell}} + \left(\frac{\ell \cdot \ell}{x} + 2 \cdot \left(t \cdot t + \frac{t}{\frac{x}{t}}\right)\right)}}\\
\mathbf{if}\;t \leq -6.8 \cdot 10^{+44}:\\
\;\;\;\;-1\\
\mathbf{elif}\;t \leq -1.8 \cdot 10^{-159}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 8.2 \cdot 10^{-117}:\\
\;\;\;\;\frac{t}{\mathsf{hypot}\left(t, \frac{\ell}{\sqrt{x}}\right)}\\
\mathbf{elif}\;t \leq 0.38:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 2.5 \cdot 10^{+48}:\\
\;\;\;\;\frac{t}{\mathsf{hypot}\left(t, \ell \cdot \sqrt{\frac{1}{x}}\right)}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
Results
if t < -6.8e44Initial program 44.0
Simplified44.0
[Start]44.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-*l/ [<=]44.0 | \[ \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.0 | \[ \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.0 | \[ \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 3.8
Simplified3.8
[Start]3.8 | \[ \frac{\sqrt{2}}{-1 \cdot \left(\left(\sqrt{2} \cdot t\right) \cdot \sqrt{\frac{1 + x}{x - 1}}\right)} \cdot t
\] |
|---|---|
associate-*r* [=>]3.8 | \[ \frac{\sqrt{2}}{\color{blue}{\left(-1 \cdot \left(\sqrt{2} \cdot t\right)\right) \cdot \sqrt{\frac{1 + x}{x - 1}}}} \cdot t
\] |
neg-mul-1 [<=]3.8 | \[ \frac{\sqrt{2}}{\color{blue}{\left(-\sqrt{2} \cdot t\right)} \cdot \sqrt{\frac{1 + x}{x - 1}}} \cdot t
\] |
*-commutative [<=]3.8 | \[ \frac{\sqrt{2}}{\left(-\color{blue}{t \cdot \sqrt{2}}\right) \cdot \sqrt{\frac{1 + x}{x - 1}}} \cdot t
\] |
distribute-rgt-neg-in [=>]3.8 | \[ \frac{\sqrt{2}}{\color{blue}{\left(t \cdot \left(-\sqrt{2}\right)\right)} \cdot \sqrt{\frac{1 + x}{x - 1}}} \cdot t
\] |
sub-neg [=>]3.8 | \[ \frac{\sqrt{2}}{\left(t \cdot \left(-\sqrt{2}\right)\right) \cdot \sqrt{\frac{1 + x}{\color{blue}{x + \left(-1\right)}}}} \cdot t
\] |
metadata-eval [=>]3.8 | \[ \frac{\sqrt{2}}{\left(t \cdot \left(-\sqrt{2}\right)\right) \cdot \sqrt{\frac{1 + x}{x + \color{blue}{-1}}}} \cdot t
\] |
+-commutative [=>]3.8 | \[ \frac{\sqrt{2}}{\left(t \cdot \left(-\sqrt{2}\right)\right) \cdot \sqrt{\frac{\color{blue}{x + 1}}{x + -1}}} \cdot t
\] |
+-commutative [=>]3.8 | \[ \frac{\sqrt{2}}{\left(t \cdot \left(-\sqrt{2}\right)\right) \cdot \sqrt{\frac{x + 1}{\color{blue}{-1 + x}}}} \cdot t
\] |
Taylor expanded in x around inf 4.6
if -6.8e44 < t < -1.80000000000000011e-159 or 8.20000000000000063e-117 < t < 0.38Initial program 30.5
Taylor expanded in x around inf 11.0
Simplified11.0
[Start]11.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+ [=>]11.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 [=>]11.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* [=>]11.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 [=>]11.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 [=>]11.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 [=>]11.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 [=>]11.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* [=>]11.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/ [=>]11.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 [=>]11.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 [=>]11.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 [=>]11.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 [<=]11.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 [=>]11.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 11.3
Simplified11.3
[Start]11.3 | \[ \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.3 | \[ \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.3 | \[ \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.3 | \[ \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)}}
\] |
if -1.80000000000000011e-159 < t < 8.20000000000000063e-117Initial program 59.7
Simplified61.7
[Start]59.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/ [<=]59.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}}}
\] |
associate-*l/ [=>]58.7 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{\color{blue}{\frac{\left(x + 1\right) \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right)}{x - 1}} - \ell \cdot \ell}}
\] |
associate-*r/ [<=]62.7 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{\color{blue}{\left(x + 1\right) \cdot \frac{\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)}{x - 1}} - \ell \cdot \ell}}
\] |
*-lft-identity [<=]62.7 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{\color{blue}{\left(1 \cdot \left(x + 1\right)\right)} \cdot \frac{\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)}{x - 1} - \ell \cdot \ell}}
\] |
associate-*r* [<=]62.7 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{\color{blue}{1 \cdot \left(\left(x + 1\right) \cdot \frac{\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)}{x - 1}\right)} - \ell \cdot \ell}}
\] |
*-commutative [<=]62.7 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{1 \cdot \color{blue}{\left(\frac{\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)}{x - 1} \cdot \left(x + 1\right)\right)} - \ell \cdot \ell}}
\] |
associate-*r* [=>]62.7 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{\color{blue}{\left(1 \cdot \frac{\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)}{x - 1}\right) \cdot \left(x + 1\right)} - \ell \cdot \ell}}
\] |
*-commutative [<=]62.7 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{\color{blue}{\left(x + 1\right) \cdot \left(1 \cdot \frac{\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)}{x - 1}\right)} - \ell \cdot \ell}}
\] |
fma-neg [=>]61.7 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{\color{blue}{\mathsf{fma}\left(x + 1, 1 \cdot \frac{\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)}{x - 1}, -\ell \cdot \ell\right)}}}
\] |
Taylor expanded in x around -inf 31.2
Simplified31.2
[Start]31.2 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{2 \cdot \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x} + 2 \cdot {t}^{2}}}
\] |
|---|---|
distribute-lft-out [=>]31.2 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{\color{blue}{2 \cdot \left(\frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x} + {t}^{2}\right)}}}
\] |
+-commutative [=>]31.2 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{2 \cdot \left(\frac{\color{blue}{2 \cdot {t}^{2} + {\ell}^{2}}}{x} + {t}^{2}\right)}}
\] |
unpow2 [=>]31.2 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{2 \cdot \left(\frac{2 \cdot {t}^{2} + \color{blue}{\ell \cdot \ell}}{x} + {t}^{2}\right)}}
\] |
fma-udef [<=]31.2 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{2 \cdot \left(\frac{\color{blue}{\mathsf{fma}\left(2, {t}^{2}, \ell \cdot \ell\right)}}{x} + {t}^{2}\right)}}
\] |
unpow2 [=>]31.2 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{2 \cdot \left(\frac{\mathsf{fma}\left(2, \color{blue}{t \cdot t}, \ell \cdot \ell\right)}{x} + {t}^{2}\right)}}
\] |
unpow2 [=>]31.2 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{2 \cdot \left(\frac{\mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right)}{x} + \color{blue}{t \cdot t}\right)}}
\] |
Taylor expanded in t around 0 31.2
Simplified31.2
[Start]31.2 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{2 \cdot \left(\frac{{\ell}^{2}}{x} + t \cdot t\right)}}
\] |
|---|---|
unpow2 [=>]31.2 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{2 \cdot \left(\frac{\color{blue}{\ell \cdot \ell}}{x} + t \cdot t\right)}}
\] |
Applied egg-rr38.6
Simplified15.5
[Start]38.6 | \[ e^{\mathsf{log1p}\left(\frac{\frac{t \cdot \sqrt{2}}{\sqrt{2}}}{\mathsf{hypot}\left(t, \frac{\ell}{\sqrt{x}}\right)}\right)} - 1
\] |
|---|---|
expm1-def [=>]15.8 | \[ \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{\frac{t \cdot \sqrt{2}}{\sqrt{2}}}{\mathsf{hypot}\left(t, \frac{\ell}{\sqrt{x}}\right)}\right)\right)}
\] |
expm1-log1p [=>]15.6 | \[ \color{blue}{\frac{\frac{t \cdot \sqrt{2}}{\sqrt{2}}}{\mathsf{hypot}\left(t, \frac{\ell}{\sqrt{x}}\right)}}
\] |
associate-/l* [=>]15.5 | \[ \frac{\color{blue}{\frac{t}{\frac{\sqrt{2}}{\sqrt{2}}}}}{\mathsf{hypot}\left(t, \frac{\ell}{\sqrt{x}}\right)}
\] |
associate-/l/ [=>]15.5 | \[ \color{blue}{\frac{t}{\mathsf{hypot}\left(t, \frac{\ell}{\sqrt{x}}\right) \cdot \frac{\sqrt{2}}{\sqrt{2}}}}
\] |
*-inverses [=>]15.5 | \[ \frac{t}{\mathsf{hypot}\left(t, \frac{\ell}{\sqrt{x}}\right) \cdot \color{blue}{1}}
\] |
*-rgt-identity [=>]15.5 | \[ \frac{t}{\color{blue}{\mathsf{hypot}\left(t, \frac{\ell}{\sqrt{x}}\right)}}
\] |
if 0.38 < t < 2.49999999999999987e48Initial program 24.6
Simplified24.1
[Start]24.6 | \[ \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/ [<=]24.6 | \[ \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}}}
\] |
associate-*l/ [=>]31.1 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{\color{blue}{\frac{\left(x + 1\right) \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right)}{x - 1}} - \ell \cdot \ell}}
\] |
associate-*r/ [<=]24.6 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{\color{blue}{\left(x + 1\right) \cdot \frac{\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)}{x - 1}} - \ell \cdot \ell}}
\] |
*-lft-identity [<=]24.6 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{\color{blue}{\left(1 \cdot \left(x + 1\right)\right)} \cdot \frac{\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)}{x - 1} - \ell \cdot \ell}}
\] |
associate-*r* [<=]24.6 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{\color{blue}{1 \cdot \left(\left(x + 1\right) \cdot \frac{\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)}{x - 1}\right)} - \ell \cdot \ell}}
\] |
*-commutative [<=]24.6 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{1 \cdot \color{blue}{\left(\frac{\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)}{x - 1} \cdot \left(x + 1\right)\right)} - \ell \cdot \ell}}
\] |
associate-*r* [=>]24.6 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{\color{blue}{\left(1 \cdot \frac{\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)}{x - 1}\right) \cdot \left(x + 1\right)} - \ell \cdot \ell}}
\] |
*-commutative [<=]24.6 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{\color{blue}{\left(x + 1\right) \cdot \left(1 \cdot \frac{\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)}{x - 1}\right)} - \ell \cdot \ell}}
\] |
fma-neg [=>]24.1 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{\color{blue}{\mathsf{fma}\left(x + 1, 1 \cdot \frac{\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)}{x - 1}, -\ell \cdot \ell\right)}}}
\] |
Taylor expanded in x around -inf 11.5
Simplified11.5
[Start]11.5 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{2 \cdot \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x} + 2 \cdot {t}^{2}}}
\] |
|---|---|
distribute-lft-out [=>]11.5 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{\color{blue}{2 \cdot \left(\frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x} + {t}^{2}\right)}}}
\] |
+-commutative [=>]11.5 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{2 \cdot \left(\frac{\color{blue}{2 \cdot {t}^{2} + {\ell}^{2}}}{x} + {t}^{2}\right)}}
\] |
unpow2 [=>]11.5 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{2 \cdot \left(\frac{2 \cdot {t}^{2} + \color{blue}{\ell \cdot \ell}}{x} + {t}^{2}\right)}}
\] |
fma-udef [<=]11.5 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{2 \cdot \left(\frac{\color{blue}{\mathsf{fma}\left(2, {t}^{2}, \ell \cdot \ell\right)}}{x} + {t}^{2}\right)}}
\] |
unpow2 [=>]11.5 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{2 \cdot \left(\frac{\mathsf{fma}\left(2, \color{blue}{t \cdot t}, \ell \cdot \ell\right)}{x} + {t}^{2}\right)}}
\] |
unpow2 [=>]11.5 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{2 \cdot \left(\frac{\mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right)}{x} + \color{blue}{t \cdot t}\right)}}
\] |
Applied egg-rr34.7
Simplified34.7
[Start]34.7 | \[ \frac{\frac{t}{\frac{\sqrt{2}}{\sqrt{2}}}}{\mathsf{hypot}\left(t, \sqrt{\frac{\mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right)}{x}}\right)}
\] |
|---|---|
associate-/l/ [=>]34.7 | \[ \color{blue}{\frac{t}{\mathsf{hypot}\left(t, \sqrt{\frac{\mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right)}{x}}\right) \cdot \frac{\sqrt{2}}{\sqrt{2}}}}
\] |
*-inverses [=>]34.7 | \[ \frac{t}{\mathsf{hypot}\left(t, \sqrt{\frac{\mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right)}{x}}\right) \cdot \color{blue}{1}}
\] |
Taylor expanded in t around 0 24.7
if 2.49999999999999987e48 < t Initial program 44.8
Simplified44.8
[Start]44.8 | \[ \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/ [<=]44.8 | \[ \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}}}
\] |
associate-*l/ [=>]56.9 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{\color{blue}{\frac{\left(x + 1\right) \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right)}{x - 1}} - \ell \cdot \ell}}
\] |
associate-*r/ [<=]44.8 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{\color{blue}{\left(x + 1\right) \cdot \frac{\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)}{x - 1}} - \ell \cdot \ell}}
\] |
*-lft-identity [<=]44.8 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{\color{blue}{\left(1 \cdot \left(x + 1\right)\right)} \cdot \frac{\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)}{x - 1} - \ell \cdot \ell}}
\] |
associate-*r* [<=]44.8 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{\color{blue}{1 \cdot \left(\left(x + 1\right) \cdot \frac{\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)}{x - 1}\right)} - \ell \cdot \ell}}
\] |
*-commutative [<=]44.8 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{1 \cdot \color{blue}{\left(\frac{\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)}{x - 1} \cdot \left(x + 1\right)\right)} - \ell \cdot \ell}}
\] |
associate-*r* [=>]44.8 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{\color{blue}{\left(1 \cdot \frac{\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)}{x - 1}\right) \cdot \left(x + 1\right)} - \ell \cdot \ell}}
\] |
*-commutative [<=]44.8 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{\color{blue}{\left(x + 1\right) \cdot \left(1 \cdot \frac{\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)}{x - 1}\right)} - \ell \cdot \ell}}
\] |
fma-neg [=>]44.8 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{\color{blue}{\mathsf{fma}\left(x + 1, 1 \cdot \frac{\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)}{x - 1}, -\ell \cdot \ell\right)}}}
\] |
Taylor expanded in x around inf 6.2
Applied egg-rr5.3
Final simplification9.5
| Alternative 1 | |
|---|---|
| Error | 8.6 |
| Cost | 21448 |
| Alternative 2 | |
|---|---|
| Error | 8.7 |
| Cost | 20680 |
| Alternative 3 | |
|---|---|
| Error | 8.7 |
| Cost | 20364 |
| Alternative 4 | |
|---|---|
| Error | 9.5 |
| Cost | 14288 |
| Alternative 5 | |
|---|---|
| Error | 13.6 |
| Cost | 13712 |
| Alternative 6 | |
|---|---|
| Error | 14.9 |
| Cost | 7112 |
| Alternative 7 | |
|---|---|
| Error | 15.1 |
| Cost | 6984 |
| Alternative 8 | |
|---|---|
| Error | 14.9 |
| Cost | 6984 |
| Alternative 9 | |
|---|---|
| Error | 15.5 |
| Cost | 452 |
| Alternative 10 | |
|---|---|
| Error | 15.8 |
| Cost | 196 |
| Alternative 11 | |
|---|---|
| Error | 39.4 |
| Cost | 64 |
herbie shell --seed 2023045
(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)))))