| Alternative 1 | |
|---|---|
| Error | 6.4 |
| Cost | 14420 |
(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 (* (sqrt 2.0) (/ t (sqrt (* 2.0 (+ (* l (/ l x)) (* t t)))))))
(t_2 (- (sqrt (/ (+ -1.0 x) (+ x 1.0))))))
(if (<= t -1.75e+15)
t_2
(if (<= t -1.2e-180)
t_1
(if (<= t -1.28e-194)
t_2
(if (<= t 3.5e-159)
(/ t (hypot t (/ l (sqrt x))))
(if (<= t 1.35e+102)
t_1
(*
(sqrt 2.0)
(/
t
(* (* t (sqrt 2.0)) (sqrt (/ (+ x 1.0) (+ -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 = sqrt(2.0) * (t / sqrt((2.0 * ((l * (l / x)) + (t * t)))));
double t_2 = -sqrt(((-1.0 + x) / (x + 1.0)));
double tmp;
if (t <= -1.75e+15) {
tmp = t_2;
} else if (t <= -1.2e-180) {
tmp = t_1;
} else if (t <= -1.28e-194) {
tmp = t_2;
} else if (t <= 3.5e-159) {
tmp = t / hypot(t, (l / sqrt(x)));
} else if (t <= 1.35e+102) {
tmp = t_1;
} else {
tmp = sqrt(2.0) * (t / ((t * sqrt(2.0)) * sqrt(((x + 1.0) / (-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 = Math.sqrt(2.0) * (t / Math.sqrt((2.0 * ((l * (l / x)) + (t * t)))));
double t_2 = -Math.sqrt(((-1.0 + x) / (x + 1.0)));
double tmp;
if (t <= -1.75e+15) {
tmp = t_2;
} else if (t <= -1.2e-180) {
tmp = t_1;
} else if (t <= -1.28e-194) {
tmp = t_2;
} else if (t <= 3.5e-159) {
tmp = t / Math.hypot(t, (l / Math.sqrt(x)));
} else if (t <= 1.35e+102) {
tmp = t_1;
} else {
tmp = Math.sqrt(2.0) * (t / ((t * Math.sqrt(2.0)) * Math.sqrt(((x + 1.0) / (-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 = math.sqrt(2.0) * (t / math.sqrt((2.0 * ((l * (l / x)) + (t * t))))) t_2 = -math.sqrt(((-1.0 + x) / (x + 1.0))) tmp = 0 if t <= -1.75e+15: tmp = t_2 elif t <= -1.2e-180: tmp = t_1 elif t <= -1.28e-194: tmp = t_2 elif t <= 3.5e-159: tmp = t / math.hypot(t, (l / math.sqrt(x))) elif t <= 1.35e+102: tmp = t_1 else: tmp = math.sqrt(2.0) * (t / ((t * math.sqrt(2.0)) * math.sqrt(((x + 1.0) / (-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(sqrt(2.0) * Float64(t / sqrt(Float64(2.0 * Float64(Float64(l * Float64(l / x)) + Float64(t * t)))))) t_2 = Float64(-sqrt(Float64(Float64(-1.0 + x) / Float64(x + 1.0)))) tmp = 0.0 if (t <= -1.75e+15) tmp = t_2; elseif (t <= -1.2e-180) tmp = t_1; elseif (t <= -1.28e-194) tmp = t_2; elseif (t <= 3.5e-159) tmp = Float64(t / hypot(t, Float64(l / sqrt(x)))); elseif (t <= 1.35e+102) tmp = t_1; else tmp = Float64(sqrt(2.0) * Float64(t / Float64(Float64(t * sqrt(2.0)) * sqrt(Float64(Float64(x + 1.0) / 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 = sqrt(2.0) * (t / sqrt((2.0 * ((l * (l / x)) + (t * t))))); t_2 = -sqrt(((-1.0 + x) / (x + 1.0))); tmp = 0.0; if (t <= -1.75e+15) tmp = t_2; elseif (t <= -1.2e-180) tmp = t_1; elseif (t <= -1.28e-194) tmp = t_2; elseif (t <= 3.5e-159) tmp = t / hypot(t, (l / sqrt(x))); elseif (t <= 1.35e+102) tmp = t_1; else tmp = sqrt(2.0) * (t / ((t * sqrt(2.0)) * sqrt(((x + 1.0) / (-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[(N[Sqrt[2.0], $MachinePrecision] * N[(t / N[Sqrt[N[(2.0 * N[(N[(l * N[(l / x), $MachinePrecision]), $MachinePrecision] + N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = (-N[Sqrt[N[(N[(-1.0 + x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])}, If[LessEqual[t, -1.75e+15], t$95$2, If[LessEqual[t, -1.2e-180], t$95$1, If[LessEqual[t, -1.28e-194], t$95$2, If[LessEqual[t, 3.5e-159], N[(t / N[Sqrt[t ^ 2 + N[(l / N[Sqrt[x], $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.35e+102], t$95$1, N[(N[Sqrt[2.0], $MachinePrecision] * N[(t / N[(N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[(x + 1.0), $MachinePrecision] / N[(-1.0 + x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $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 := \sqrt{2} \cdot \frac{t}{\sqrt{2 \cdot \left(\ell \cdot \frac{\ell}{x} + t \cdot t\right)}}\\
t_2 := -\sqrt{\frac{-1 + x}{x + 1}}\\
\mathbf{if}\;t \leq -1.75 \cdot 10^{+15}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq -1.2 \cdot 10^{-180}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -1.28 \cdot 10^{-194}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 3.5 \cdot 10^{-159}:\\
\;\;\;\;\frac{t}{\mathsf{hypot}\left(t, \frac{\ell}{\sqrt{x}}\right)}\\
\mathbf{elif}\;t \leq 1.35 \cdot 10^{+102}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t}{\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{x + 1}{-1 + x}}}\\
\end{array}
Results
if t < -1.75e15 or -1.1999999999999999e-180 < t < -1.2800000000000001e-194Initial program 43.4
Simplified43.3
[Start]43.4 | \[ \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/ [<=]43.4 | \[ \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/ [=>]54.4 | \[ \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/ [<=]43.4 | \[ \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 [<=]43.4 | \[ \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* [<=]43.4 | \[ \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 [<=]43.4 | \[ \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* [=>]43.4 | \[ \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 [<=]43.4 | \[ \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 [=>]43.3 | \[ \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 t around -inf 6.2
Simplified6.2
[Start]6.2 | \[ -1 \cdot \left(\left(\sqrt{2} \cdot \sqrt{0.5}\right) \cdot \sqrt{\frac{x - 1}{1 + x}}\right)
\] |
|---|---|
mul-1-neg [=>]6.2 | \[ \color{blue}{-\left(\sqrt{2} \cdot \sqrt{0.5}\right) \cdot \sqrt{\frac{x - 1}{1 + x}}}
\] |
*-commutative [=>]6.2 | \[ -\color{blue}{\sqrt{\frac{x - 1}{1 + x}} \cdot \left(\sqrt{2} \cdot \sqrt{0.5}\right)}
\] |
sub-neg [=>]6.2 | \[ -\sqrt{\frac{\color{blue}{x + \left(-1\right)}}{1 + x}} \cdot \left(\sqrt{2} \cdot \sqrt{0.5}\right)
\] |
metadata-eval [=>]6.2 | \[ -\sqrt{\frac{x + \color{blue}{-1}}{1 + x}} \cdot \left(\sqrt{2} \cdot \sqrt{0.5}\right)
\] |
+-commutative [=>]6.2 | \[ -\sqrt{\frac{\color{blue}{-1 + x}}{1 + x}} \cdot \left(\sqrt{2} \cdot \sqrt{0.5}\right)
\] |
+-commutative [=>]6.2 | \[ -\sqrt{\frac{-1 + x}{\color{blue}{x + 1}}} \cdot \left(\sqrt{2} \cdot \sqrt{0.5}\right)
\] |
Applied egg-rr5.3
if -1.75e15 < t < -1.1999999999999999e-180 or 3.50000000000000002e-159 < t < 1.3500000000000001e102Initial program 28.9
Simplified37.4
[Start]28.9 | \[ \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/ [<=]28.9 | \[ \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/ [=>]32.5 | \[ \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/ [<=]37.9 | \[ \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 [<=]37.9 | \[ \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* [<=]37.9 | \[ \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 [<=]37.9 | \[ \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* [=>]37.9 | \[ \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 [<=]37.9 | \[ \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 [=>]37.4 | \[ \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 10.7
Simplified10.7
[Start]10.7 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{2 \cdot \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x} + 2 \cdot {t}^{2}}}
\] |
|---|---|
distribute-lft-out [=>]10.7 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{\color{blue}{2 \cdot \left(\frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x} + {t}^{2}\right)}}}
\] |
+-commutative [=>]10.7 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{2 \cdot \left(\frac{\color{blue}{2 \cdot {t}^{2} + {\ell}^{2}}}{x} + {t}^{2}\right)}}
\] |
unpow2 [=>]10.7 | \[ \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 [<=]10.7 | \[ \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 [=>]10.7 | \[ \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 [=>]10.7 | \[ \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 11.0
Simplified6.3
[Start]11.0 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{2 \cdot \left(\frac{{\ell}^{2}}{x} + t \cdot t\right)}}
\] |
|---|---|
unpow2 [=>]11.0 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{2 \cdot \left(\frac{\color{blue}{\ell \cdot \ell}}{x} + t \cdot t\right)}}
\] |
associate-*r/ [<=]6.3 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{2 \cdot \left(\color{blue}{\ell \cdot \frac{\ell}{x}} + t \cdot t\right)}}
\] |
if -1.2800000000000001e-194 < t < 3.50000000000000002e-159Initial program 63.1
Simplified61.5
[Start]63.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-*r/ [<=]63.1 | \[ \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/ [=>]61.6 | \[ \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/ [<=]63.1 | \[ \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 [<=]63.1 | \[ \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* [<=]63.1 | \[ \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 [<=]63.1 | \[ \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* [=>]63.1 | \[ \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 [<=]63.1 | \[ \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.5 | \[ \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.9
Simplified31.9
[Start]31.9 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{2 \cdot \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x} + 2 \cdot {t}^{2}}}
\] |
|---|---|
distribute-lft-out [=>]31.9 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{\color{blue}{2 \cdot \left(\frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x} + {t}^{2}\right)}}}
\] |
+-commutative [=>]31.9 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{2 \cdot \left(\frac{\color{blue}{2 \cdot {t}^{2} + {\ell}^{2}}}{x} + {t}^{2}\right)}}
\] |
unpow2 [=>]31.9 | \[ \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.9 | \[ \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.9 | \[ \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.9 | \[ \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.9
Simplified30.2
[Start]31.9 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{2 \cdot \left(\frac{{\ell}^{2}}{x} + t \cdot t\right)}}
\] |
|---|---|
unpow2 [=>]31.9 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{2 \cdot \left(\frac{\color{blue}{\ell \cdot \ell}}{x} + t \cdot t\right)}}
\] |
associate-*r/ [<=]30.2 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{2 \cdot \left(\color{blue}{\ell \cdot \frac{\ell}{x}} + t \cdot t\right)}}
\] |
Applied egg-rr36.2
Simplified12.6
[Start]36.2 | \[ e^{\mathsf{log1p}\left(\frac{\sqrt{2}}{\sqrt{2}} \cdot \frac{t}{\mathsf{hypot}\left(t, \frac{\ell}{\sqrt{x}}\right)}\right)} - 1
\] |
|---|---|
expm1-def [=>]12.6 | \[ \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{\sqrt{2}}{\sqrt{2}} \cdot \frac{t}{\mathsf{hypot}\left(t, \frac{\ell}{\sqrt{x}}\right)}\right)\right)}
\] |
expm1-log1p [=>]12.6 | \[ \color{blue}{\frac{\sqrt{2}}{\sqrt{2}} \cdot \frac{t}{\mathsf{hypot}\left(t, \frac{\ell}{\sqrt{x}}\right)}}
\] |
associate-*r/ [=>]12.6 | \[ \color{blue}{\frac{\frac{\sqrt{2}}{\sqrt{2}} \cdot t}{\mathsf{hypot}\left(t, \frac{\ell}{\sqrt{x}}\right)}}
\] |
*-inverses [=>]12.6 | \[ \frac{\color{blue}{1} \cdot t}{\mathsf{hypot}\left(t, \frac{\ell}{\sqrt{x}}\right)}
\] |
Applied egg-rr36.2
Simplified12.6
[Start]36.2 | \[ e^{\mathsf{log1p}\left(\frac{t}{\mathsf{hypot}\left(t, \frac{\ell}{\sqrt{x}}\right)}\right)} - 1
\] |
|---|---|
expm1-def [=>]12.6 | \[ \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{t}{\mathsf{hypot}\left(t, \frac{\ell}{\sqrt{x}}\right)}\right)\right)}
\] |
expm1-log1p [=>]12.6 | \[ \color{blue}{\frac{t}{\mathsf{hypot}\left(t, \frac{\ell}{\sqrt{x}}\right)}}
\] |
if 1.3500000000000001e102 < t Initial program 50.4
Simplified50.4
[Start]50.4 | \[ \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/ [<=]50.4 | \[ \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/ [=>]61.0 | \[ \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/ [<=]50.4 | \[ \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 [<=]50.4 | \[ \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* [<=]50.4 | \[ \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 [<=]50.4 | \[ \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* [=>]50.4 | \[ \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 [<=]50.4 | \[ \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 [=>]50.4 | \[ \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 t around inf 3.0
Final simplification6.4
| Alternative 1 | |
|---|---|
| Error | 6.4 |
| Cost | 14420 |
| Alternative 2 | |
|---|---|
| Error | 10.1 |
| Cost | 13448 |
| Alternative 3 | |
|---|---|
| Error | 15.1 |
| Cost | 7376 |
| Alternative 4 | |
|---|---|
| Error | 14.9 |
| Cost | 7376 |
| Alternative 5 | |
|---|---|
| Error | 15.3 |
| Cost | 6980 |
| Alternative 6 | |
|---|---|
| Error | 15.5 |
| Cost | 452 |
| Alternative 7 | |
|---|---|
| Error | 15.8 |
| Cost | 196 |
| Alternative 8 | |
|---|---|
| Error | 39.3 |
| Cost | 64 |
herbie shell --seed 2023054
(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)))))