| Alternative 1 | |
|---|---|
| Error | 8.8 |
| Cost | 20496 |
(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 (fma 2.0 (* t t) (* l l))) (t_2 (/ t_1 x)))
(if (<= t -80000000000000.0)
(- (sqrt (/ (+ x -1.0) (+ x 1.0))))
(if (<= t -5.9e-21)
(/ t (hypot t (/ l (sqrt x))))
(if (<= t -1.55e-133)
(/
(* t (sqrt 2.0))
(sqrt
(+
(+
(/ (* l l) x)
(fma
-1.0
(/ (- (+ t_1 t_1)) (* x x))
(* 2.0 (+ (* t t) (/ (* t t) x)))))
t_2)))
(if (<= t 1.45e-86)
(/ t (hypot t (sqrt 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 = fma(2.0, (t * t), (l * l));
double t_2 = t_1 / x;
double tmp;
if (t <= -80000000000000.0) {
tmp = -sqrt(((x + -1.0) / (x + 1.0)));
} else if (t <= -5.9e-21) {
tmp = t / hypot(t, (l / sqrt(x)));
} else if (t <= -1.55e-133) {
tmp = (t * sqrt(2.0)) / sqrt(((((l * l) / x) + fma(-1.0, (-(t_1 + t_1) / (x * x)), (2.0 * ((t * t) + ((t * t) / x))))) + t_2));
} else if (t <= 1.45e-86) {
tmp = t / hypot(t, sqrt(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 = fma(2.0, Float64(t * t), Float64(l * l)) t_2 = Float64(t_1 / x) tmp = 0.0 if (t <= -80000000000000.0) tmp = Float64(-sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0)))); elseif (t <= -5.9e-21) tmp = Float64(t / hypot(t, Float64(l / sqrt(x)))); elseif (t <= -1.55e-133) tmp = Float64(Float64(t * sqrt(2.0)) / sqrt(Float64(Float64(Float64(Float64(l * l) / x) + fma(-1.0, Float64(Float64(-Float64(t_1 + t_1)) / Float64(x * x)), Float64(2.0 * Float64(Float64(t * t) + Float64(Float64(t * t) / x))))) + t_2))); elseif (t <= 1.45e-86) tmp = Float64(t / hypot(t, sqrt(t_2))); else tmp = Float64(1.0 + Float64(Float64(Float64(0.5 / x) / x) + Float64(-1.0 / x))); 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[(t * t), $MachinePrecision] + N[(l * l), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 / x), $MachinePrecision]}, If[LessEqual[t, -80000000000000.0], (-N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), If[LessEqual[t, -5.9e-21], N[(t / N[Sqrt[t ^ 2 + N[(l / N[Sqrt[x], $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -1.55e-133], N[(N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(N[(N[(N[(l * l), $MachinePrecision] / x), $MachinePrecision] + N[(-1.0 * N[((-N[(t$95$1 + t$95$1), $MachinePrecision]) / N[(x * x), $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[(N[(t * t), $MachinePrecision] + N[(N[(t * t), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$2), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.45e-86], N[(t / N[Sqrt[t ^ 2 + N[Sqrt[t$95$2], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(N[(0.5 / x), $MachinePrecision] / x), $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 := \mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right)\\
t_2 := \frac{t_1}{x}\\
\mathbf{if}\;t \leq -80000000000000:\\
\;\;\;\;-\sqrt{\frac{x + -1}{x + 1}}\\
\mathbf{elif}\;t \leq -5.9 \cdot 10^{-21}:\\
\;\;\;\;\frac{t}{\mathsf{hypot}\left(t, \frac{\ell}{\sqrt{x}}\right)}\\
\mathbf{elif}\;t \leq -1.55 \cdot 10^{-133}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{\left(\frac{\ell \cdot \ell}{x} + \mathsf{fma}\left(-1, \frac{-\left(t_1 + t_1\right)}{x \cdot x}, 2 \cdot \left(t \cdot t + \frac{t \cdot t}{x}\right)\right)\right) + t_2}}\\
\mathbf{elif}\;t \leq 1.45 \cdot 10^{-86}:\\
\;\;\;\;\frac{t}{\mathsf{hypot}\left(t, \sqrt{t_2}\right)}\\
\mathbf{else}:\\
\;\;\;\;1 + \left(\frac{\frac{0.5}{x}}{x} + \frac{-1}{x}\right)\\
\end{array}
if t < -8e13Initial program 42.1
Simplified42.0
[Start]42.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/ [<=]42.2 | \[ \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/ [=>]53.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/ [<=]42.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 [<=]42.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* [<=]42.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 [<=]42.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* [=>]42.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 [<=]42.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 [=>]42.0 | \[ \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 52.3
Simplified52.3
[Start]52.3 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{2 \cdot \frac{\left(1 + x\right) \cdot {t}^{2}}{x - 1}}}
\] |
|---|---|
*-commutative [=>]52.3 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{2 \cdot \frac{\color{blue}{{t}^{2} \cdot \left(1 + x\right)}}{x - 1}}}
\] |
unpow2 [=>]52.3 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{2 \cdot \frac{\color{blue}{\left(t \cdot t\right)} \cdot \left(1 + x\right)}{x - 1}}}
\] |
+-commutative [=>]52.3 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{2 \cdot \frac{\left(t \cdot t\right) \cdot \color{blue}{\left(x + 1\right)}}{x - 1}}}
\] |
sub-neg [=>]52.3 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{2 \cdot \frac{\left(t \cdot t\right) \cdot \left(x + 1\right)}{\color{blue}{x + \left(-1\right)}}}}
\] |
metadata-eval [=>]52.3 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{2 \cdot \frac{\left(t \cdot t\right) \cdot \left(x + 1\right)}{x + \color{blue}{-1}}}}
\] |
+-commutative [=>]52.3 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{2 \cdot \frac{\left(t \cdot t\right) \cdot \left(x + 1\right)}{\color{blue}{-1 + x}}}}
\] |
Taylor expanded in t around -inf 4.6
Simplified4.6
[Start]4.6 | \[ -1 \cdot \sqrt{\frac{x - 1}{1 + x}}
\] |
|---|---|
mul-1-neg [=>]4.6 | \[ \color{blue}{-\sqrt{\frac{x - 1}{1 + x}}}
\] |
sub-neg [=>]4.6 | \[ -\sqrt{\frac{\color{blue}{x + \left(-1\right)}}{1 + x}}
\] |
metadata-eval [=>]4.6 | \[ -\sqrt{\frac{x + \color{blue}{-1}}{1 + x}}
\] |
if -8e13 < t < -5.9000000000000003e-21Initial program 23.6
Simplified24.3
[Start]23.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/ [<=]23.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/ [=>]23.8 | \[ \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.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 [<=]24.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* [<=]24.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 [<=]24.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* [=>]24.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 [<=]24.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 [=>]24.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 x around -inf 9.7
Simplified9.7
[Start]9.7 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{2 \cdot \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x} + 2 \cdot {t}^{2}}}
\] |
|---|---|
distribute-lft-out [=>]9.7 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{\color{blue}{2 \cdot \left(\frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x} + {t}^{2}\right)}}}
\] |
+-commutative [=>]9.7 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{2 \cdot \left(\frac{\color{blue}{2 \cdot {t}^{2} + {\ell}^{2}}}{x} + {t}^{2}\right)}}
\] |
unpow2 [=>]9.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 [<=]9.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 [=>]9.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 [=>]9.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 10.2
Simplified10.2
[Start]10.2 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{2 \cdot \left(\frac{{\ell}^{2}}{x} + t \cdot t\right)}}
\] |
|---|---|
unpow2 [=>]10.2 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{2 \cdot \left(\frac{\color{blue}{\ell \cdot \ell}}{x} + t \cdot t\right)}}
\] |
Applied egg-rr43.3
Simplified26.2
[Start]43.3 | \[ 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 [=>]29.0 | \[ \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 [=>]26.3 | \[ \color{blue}{\frac{\frac{t \cdot \sqrt{2}}{\sqrt{2}}}{\mathsf{hypot}\left(t, \frac{\ell}{\sqrt{x}}\right)}}
\] |
associate-/l* [=>]26.2 | \[ \frac{\color{blue}{\frac{t}{\frac{\sqrt{2}}{\sqrt{2}}}}}{\mathsf{hypot}\left(t, \frac{\ell}{\sqrt{x}}\right)}
\] |
associate-/l/ [=>]26.2 | \[ \color{blue}{\frac{t}{\mathsf{hypot}\left(t, \frac{\ell}{\sqrt{x}}\right) \cdot \frac{\sqrt{2}}{\sqrt{2}}}}
\] |
*-inverses [=>]26.2 | \[ \frac{t}{\mathsf{hypot}\left(t, \frac{\ell}{\sqrt{x}}\right) \cdot \color{blue}{1}}
\] |
*-rgt-identity [=>]26.2 | \[ \frac{t}{\color{blue}{\mathsf{hypot}\left(t, \frac{\ell}{\sqrt{x}}\right)}}
\] |
if -5.9000000000000003e-21 < t < -1.55000000000000008e-133Initial program 30.2
Taylor expanded in x around -inf 9.6
Simplified9.6
[Start]9.6 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\left(\frac{{\ell}^{2}}{x} + \left(-1 \cdot \frac{-1 \cdot \left({\ell}^{2} + 2 \cdot {t}^{2}\right) - \left({\ell}^{2} + 2 \cdot {t}^{2}\right)}{{x}^{2}} + \left(2 \cdot \frac{{t}^{2}}{x} + 2 \cdot {t}^{2}\right)\right)\right) - -1 \cdot \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x}}}
\] |
|---|
if -1.55000000000000008e-133 < t < 1.45e-86Initial program 55.8
Simplified60.5
[Start]55.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/ [<=]55.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/ [=>]54.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/ [<=]61.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 [<=]61.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* [<=]61.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 [<=]61.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* [=>]61.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 [<=]61.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 [=>]60.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 27.3
Simplified27.3
[Start]27.3 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{2 \cdot \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x} + 2 \cdot {t}^{2}}}
\] |
|---|---|
distribute-lft-out [=>]27.3 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{\color{blue}{2 \cdot \left(\frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x} + {t}^{2}\right)}}}
\] |
+-commutative [=>]27.3 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{2 \cdot \left(\frac{\color{blue}{2 \cdot {t}^{2} + {\ell}^{2}}}{x} + {t}^{2}\right)}}
\] |
unpow2 [=>]27.3 | \[ \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 [<=]27.3 | \[ \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 [=>]27.3 | \[ \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 [=>]27.3 | \[ \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-rr9.8
Simplified9.8
[Start]9.8 | \[ \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)}
\] |
|---|---|
*-inverses [=>]9.8 | \[ \frac{\frac{t}{\color{blue}{1}}}{\mathsf{hypot}\left(t, \sqrt{\frac{\mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right)}{x}}\right)}
\] |
if 1.45e-86 < t Initial program 38.0
Simplified39.1
[Start]38.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/ [<=]38.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}}}
\] |
associate-*l/ [=>]47.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/ [<=]39.3 | \[ \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 [<=]39.3 | \[ \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* [<=]39.3 | \[ \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 [<=]39.3 | \[ \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* [=>]39.3 | \[ \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 [<=]39.3 | \[ \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 [=>]39.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 t around inf 44.2
Simplified44.2
[Start]44.2 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{2 \cdot \frac{\left(1 + x\right) \cdot {t}^{2}}{x - 1}}}
\] |
|---|---|
*-commutative [=>]44.2 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{2 \cdot \frac{\color{blue}{{t}^{2} \cdot \left(1 + x\right)}}{x - 1}}}
\] |
unpow2 [=>]44.2 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{2 \cdot \frac{\color{blue}{\left(t \cdot t\right)} \cdot \left(1 + x\right)}{x - 1}}}
\] |
+-commutative [=>]44.2 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{2 \cdot \frac{\left(t \cdot t\right) \cdot \color{blue}{\left(x + 1\right)}}{x - 1}}}
\] |
sub-neg [=>]44.2 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{2 \cdot \frac{\left(t \cdot t\right) \cdot \left(x + 1\right)}{\color{blue}{x + \left(-1\right)}}}}
\] |
metadata-eval [=>]44.2 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{2 \cdot \frac{\left(t \cdot t\right) \cdot \left(x + 1\right)}{x + \color{blue}{-1}}}}
\] |
+-commutative [=>]44.2 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{2 \cdot \frac{\left(t \cdot t\right) \cdot \left(x + 1\right)}{\color{blue}{-1 + x}}}}
\] |
Taylor expanded in t around 0 7.7
Taylor expanded in x around inf 8.0
Simplified8.0
[Start]8.0 | \[ \left(1 + 0.5 \cdot \frac{1}{{x}^{2}}\right) - \frac{1}{x}
\] |
|---|---|
sub-neg [=>]8.0 | \[ \color{blue}{\left(1 + 0.5 \cdot \frac{1}{{x}^{2}}\right) + \left(-\frac{1}{x}\right)}
\] |
associate-+l+ [=>]8.0 | \[ \color{blue}{1 + \left(0.5 \cdot \frac{1}{{x}^{2}} + \left(-\frac{1}{x}\right)\right)}
\] |
sub-neg [<=]8.0 | \[ 1 + \color{blue}{\left(0.5 \cdot \frac{1}{{x}^{2}} - \frac{1}{x}\right)}
\] |
associate-*r/ [=>]8.0 | \[ 1 + \left(\color{blue}{\frac{0.5 \cdot 1}{{x}^{2}}} - \frac{1}{x}\right)
\] |
metadata-eval [=>]8.0 | \[ 1 + \left(\frac{\color{blue}{0.5}}{{x}^{2}} - \frac{1}{x}\right)
\] |
unpow2 [=>]8.0 | \[ 1 + \left(\frac{0.5}{\color{blue}{x \cdot x}} - \frac{1}{x}\right)
\] |
associate-/r* [=>]8.0 | \[ 1 + \left(\color{blue}{\frac{\frac{0.5}{x}}{x}} - \frac{1}{x}\right)
\] |
Final simplification8.2
| Alternative 1 | |
|---|---|
| Error | 8.8 |
| Cost | 20496 |
| Alternative 2 | |
|---|---|
| Error | 10.1 |
| Cost | 14924 |
| Alternative 3 | |
|---|---|
| Error | 10.0 |
| Cost | 14156 |
| Alternative 4 | |
|---|---|
| Error | 12.0 |
| Cost | 13712 |
| Alternative 5 | |
|---|---|
| Error | 14.0 |
| Cost | 7240 |
| Alternative 6 | |
|---|---|
| Error | 14.0 |
| Cost | 7240 |
| Alternative 7 | |
|---|---|
| Error | 14.2 |
| Cost | 7112 |
| Alternative 8 | |
|---|---|
| Error | 14.2 |
| Cost | 7112 |
| Alternative 9 | |
|---|---|
| Error | 14.5 |
| Cost | 6984 |
| Alternative 10 | |
|---|---|
| Error | 14.3 |
| Cost | 6984 |
| Alternative 11 | |
|---|---|
| Error | 14.9 |
| Cost | 1220 |
| Alternative 12 | |
|---|---|
| Error | 15.0 |
| Cost | 836 |
| Alternative 13 | |
|---|---|
| Error | 14.9 |
| Cost | 836 |
| Alternative 14 | |
|---|---|
| Error | 15.3 |
| Cost | 452 |
| Alternative 15 | |
|---|---|
| Error | 15.1 |
| Cost | 452 |
| Alternative 16 | |
|---|---|
| Error | 15.5 |
| Cost | 196 |
| Alternative 17 | |
|---|---|
| Error | 39.2 |
| Cost | 64 |
herbie shell --seed 2023059
(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)))))