| Alternative 1 | |
|---|---|
| Error | 5.3 |
| Cost | 14036 |
(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 (fma t t (* l (/ l x))))))
(t_2 (sqrt (/ (- 1.0 x) (- -1.0 x)))))
(if (<= t -5e+106)
(- t_2)
(if (<= t -1.3e-134)
t_1
(if (<= t 3.1e-304)
(/ t (hypot t (/ l (sqrt x))))
(if (<= t 1.9e-116)
(/ t (hypot t (sqrt (/ (fma 2.0 (* t t) (* l l)) x))))
(if (<= t 5e+103) t_1 t_2)))))))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(fma(t, t, (l * (l / x))));
double t_2 = sqrt(((1.0 - x) / (-1.0 - x)));
double tmp;
if (t <= -5e+106) {
tmp = -t_2;
} else if (t <= -1.3e-134) {
tmp = t_1;
} else if (t <= 3.1e-304) {
tmp = t / hypot(t, (l / sqrt(x)));
} else if (t <= 1.9e-116) {
tmp = t / hypot(t, sqrt((fma(2.0, (t * t), (l * l)) / x)));
} else if (t <= 5e+103) {
tmp = t_1;
} else {
tmp = t_2;
}
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(fma(t, t, Float64(l * Float64(l / x))))) t_2 = sqrt(Float64(Float64(1.0 - x) / Float64(-1.0 - x))) tmp = 0.0 if (t <= -5e+106) tmp = Float64(-t_2); elseif (t <= -1.3e-134) tmp = t_1; elseif (t <= 3.1e-304) tmp = Float64(t / hypot(t, Float64(l / sqrt(x)))); elseif (t <= 1.9e-116) tmp = Float64(t / hypot(t, sqrt(Float64(fma(2.0, Float64(t * t), Float64(l * l)) / x)))); elseif (t <= 5e+103) tmp = t_1; else tmp = t_2; 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[(t / N[Sqrt[N[(t * t + N[(l * N[(l / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(N[(1.0 - x), $MachinePrecision] / N[(-1.0 - x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, -5e+106], (-t$95$2), If[LessEqual[t, -1.3e-134], t$95$1, If[LessEqual[t, 3.1e-304], N[(t / N[Sqrt[t ^ 2 + N[(l / N[Sqrt[x], $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.9e-116], N[(t / N[Sqrt[t ^ 2 + N[Sqrt[N[(N[(2.0 * N[(t * t), $MachinePrecision] + N[(l * l), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5e+103], t$95$1, t$95$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}}
\begin{array}{l}
t_1 := \frac{t}{\sqrt{\mathsf{fma}\left(t, t, \ell \cdot \frac{\ell}{x}\right)}}\\
t_2 := \sqrt{\frac{1 - x}{-1 - x}}\\
\mathbf{if}\;t \leq -5 \cdot 10^{+106}:\\
\;\;\;\;-t_2\\
\mathbf{elif}\;t \leq -1.3 \cdot 10^{-134}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 3.1 \cdot 10^{-304}:\\
\;\;\;\;\frac{t}{\mathsf{hypot}\left(t, \frac{\ell}{\sqrt{x}}\right)}\\
\mathbf{elif}\;t \leq 1.9 \cdot 10^{-116}:\\
\;\;\;\;\frac{t}{\mathsf{hypot}\left(t, \sqrt{\frac{\mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right)}{x}}\right)}\\
\mathbf{elif}\;t \leq 5 \cdot 10^{+103}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
if t < -4.9999999999999998e106Initial program 52.0
Simplified52.1
[Start]52.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/ [<=]52.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}}}
\] |
fma-neg [=>]52.1 | \[ \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 [=>]52.1 | \[ \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 [=>]52.1 | \[ \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 [=>]52.1 | \[ \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 3.6
Simplified3.6
[Start]3.6 | \[ \sqrt{2} \cdot \left(-1 \cdot \left(\sqrt{0.5} \cdot \sqrt{\frac{x - 1}{1 + x}}\right)\right)
\] |
|---|---|
mul-1-neg [=>]3.6 | \[ \sqrt{2} \cdot \color{blue}{\left(-\sqrt{0.5} \cdot \sqrt{\frac{x - 1}{1 + x}}\right)}
\] |
*-commutative [=>]3.6 | \[ \sqrt{2} \cdot \left(-\color{blue}{\sqrt{\frac{x - 1}{1 + x}} \cdot \sqrt{0.5}}\right)
\] |
sub-neg [=>]3.6 | \[ \sqrt{2} \cdot \left(-\sqrt{\frac{\color{blue}{x + \left(-1\right)}}{1 + x}} \cdot \sqrt{0.5}\right)
\] |
metadata-eval [=>]3.6 | \[ \sqrt{2} \cdot \left(-\sqrt{\frac{x + \color{blue}{-1}}{1 + x}} \cdot \sqrt{0.5}\right)
\] |
+-commutative [=>]3.6 | \[ \sqrt{2} \cdot \left(-\sqrt{\frac{\color{blue}{-1 + x}}{1 + x}} \cdot \sqrt{0.5}\right)
\] |
+-commutative [=>]3.6 | \[ \sqrt{2} \cdot \left(-\sqrt{\frac{-1 + x}{\color{blue}{x + 1}}} \cdot \sqrt{0.5}\right)
\] |
Applied egg-rr2.7
Simplified2.6
[Start]2.7 | \[ \left(0 - e^{\mathsf{log1p}\left(\sqrt{2 \cdot \left(\frac{1 - x}{-1 - x} \cdot 0.5\right)}\right)}\right) + 1
\] |
|---|---|
*-commutative [=>]2.7 | \[ \left(0 - e^{\mathsf{log1p}\left(\sqrt{2 \cdot \color{blue}{\left(0.5 \cdot \frac{1 - x}{-1 - x}\right)}}\right)}\right) + 1
\] |
associate-*r* [=>]2.7 | \[ \left(0 - e^{\mathsf{log1p}\left(\sqrt{\color{blue}{\left(2 \cdot 0.5\right) \cdot \frac{1 - x}{-1 - x}}}\right)}\right) + 1
\] |
metadata-eval [=>]2.7 | \[ \left(0 - e^{\mathsf{log1p}\left(\sqrt{\color{blue}{1} \cdot \frac{1 - x}{-1 - x}}\right)}\right) + 1
\] |
*-lft-identity [=>]2.7 | \[ \left(0 - e^{\mathsf{log1p}\left(\sqrt{\color{blue}{\frac{1 - x}{-1 - x}}}\right)}\right) + 1
\] |
associate--r- [<=]2.7 | \[ \color{blue}{0 - \left(e^{\mathsf{log1p}\left(\sqrt{\frac{1 - x}{-1 - x}}\right)} - 1\right)}
\] |
expm1-def [=>]2.7 | \[ 0 - \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{\frac{1 - x}{-1 - x}}\right)\right)}
\] |
expm1-log1p [=>]2.6 | \[ 0 - \color{blue}{\sqrt{\frac{1 - x}{-1 - x}}}
\] |
neg-sub0 [<=]2.6 | \[ \color{blue}{-\sqrt{\frac{1 - x}{-1 - x}}}
\] |
if -4.9999999999999998e106 < t < -1.30000000000000011e-134 or 1.9000000000000001e-116 < t < 5e103Initial program 25.4
Simplified30.7
[Start]25.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/ [<=]25.5 | \[ \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.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/ [<=]31.2 | \[ \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 [<=]31.2 | \[ \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* [<=]31.2 | \[ \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 [<=]31.2 | \[ \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* [=>]31.2 | \[ \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 [<=]31.2 | \[ \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 [=>]30.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)}}}
\] |
associate-*r/ [=>]30.7 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{\mathsf{fma}\left(x + 1, \color{blue}{\frac{1 \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right)}{x - 1}}, -\ell \cdot \ell\right)}}
\] |
*-lft-identity [=>]30.7 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{\mathsf{fma}\left(x + 1, \frac{\color{blue}{\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)}}{x - 1}, -\ell \cdot \ell\right)}}
\] |
+-commutative [=>]30.7 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{\mathsf{fma}\left(x + 1, \frac{\color{blue}{2 \cdot \left(t \cdot t\right) + \ell \cdot \ell}}{x - 1}, -\ell \cdot \ell\right)}}
\] |
fma-def [=>]30.7 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{\mathsf{fma}\left(x + 1, \frac{\color{blue}{\mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right)}}{x - 1}, -\ell \cdot \ell\right)}}
\] |
sub-neg [=>]30.7 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{\mathsf{fma}\left(x + 1, \frac{\mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right)}{\color{blue}{x + \left(-1\right)}}, -\ell \cdot \ell\right)}}
\] |
metadata-eval [=>]30.7 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{\mathsf{fma}\left(x + 1, \frac{\mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right)}{x + \color{blue}{-1}}, -\ell \cdot \ell\right)}}
\] |
Taylor expanded in x around -inf 10.6
Simplified10.6
[Start]10.6 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{2 \cdot \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x} + 2 \cdot {t}^{2}}}
\] |
|---|---|
distribute-lft-out [=>]10.6 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{\color{blue}{2 \cdot \left(\frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x} + {t}^{2}\right)}}}
\] |
+-commutative [=>]10.6 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{2 \cdot \left(\frac{\color{blue}{2 \cdot {t}^{2} + {\ell}^{2}}}{x} + {t}^{2}\right)}}
\] |
unpow2 [=>]10.6 | \[ \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.6 | \[ \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.6 | \[ \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.6 | \[ \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.9
Simplified6.0
[Start]10.9 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{2 \cdot \left(\frac{{\ell}^{2}}{x} + t \cdot t\right)}}
\] |
|---|---|
unpow2 [=>]10.9 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{2 \cdot \left(\frac{\color{blue}{\ell \cdot \ell}}{x} + t \cdot t\right)}}
\] |
associate-/l* [=>]6.0 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{2 \cdot \left(\color{blue}{\frac{\ell}{\frac{x}{\ell}}} + t \cdot t\right)}}
\] |
Applied egg-rr14.7
Simplified14.5
[Start]14.7 | \[ \frac{\frac{t \cdot \sqrt{2}}{\sqrt{2}}}{\mathsf{hypot}\left(t, \sqrt{\ell \cdot \frac{\ell}{x}}\right)}
\] |
|---|---|
associate-/l* [=>]14.5 | \[ \frac{\color{blue}{\frac{t}{\frac{\sqrt{2}}{\sqrt{2}}}}}{\mathsf{hypot}\left(t, \sqrt{\ell \cdot \frac{\ell}{x}}\right)}
\] |
*-inverses [=>]14.5 | \[ \frac{\frac{t}{\color{blue}{1}}}{\mathsf{hypot}\left(t, \sqrt{\ell \cdot \frac{\ell}{x}}\right)}
\] |
Applied egg-rr5.5
Simplified5.5
[Start]5.5 | \[ \frac{\frac{t}{1}}{{\left(\mathsf{fma}\left(t, t, \ell \cdot \frac{\ell}{x}\right)\right)}^{0.5}}
\] |
|---|---|
unpow1/2 [=>]5.5 | \[ \frac{\frac{t}{1}}{\color{blue}{\sqrt{\mathsf{fma}\left(t, t, \ell \cdot \frac{\ell}{x}\right)}}}
\] |
if -1.30000000000000011e-134 < t < 3.09999999999999985e-304Initial program 59.2
Simplified61.6
[Start]59.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-*r/ [<=]59.3 | \[ \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/ [=>]57.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.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 [<=]62.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* [<=]62.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 [<=]62.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* [=>]62.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 [<=]62.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 [=>]61.6 | \[ \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)}}}
\] |
associate-*r/ [=>]61.6 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{\mathsf{fma}\left(x + 1, \color{blue}{\frac{1 \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right)}{x - 1}}, -\ell \cdot \ell\right)}}
\] |
*-lft-identity [=>]61.6 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{\mathsf{fma}\left(x + 1, \frac{\color{blue}{\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)}}{x - 1}, -\ell \cdot \ell\right)}}
\] |
+-commutative [=>]61.6 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{\mathsf{fma}\left(x + 1, \frac{\color{blue}{2 \cdot \left(t \cdot t\right) + \ell \cdot \ell}}{x - 1}, -\ell \cdot \ell\right)}}
\] |
fma-def [=>]61.6 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{\mathsf{fma}\left(x + 1, \frac{\color{blue}{\mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right)}}{x - 1}, -\ell \cdot \ell\right)}}
\] |
sub-neg [=>]61.6 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{\mathsf{fma}\left(x + 1, \frac{\mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right)}{\color{blue}{x + \left(-1\right)}}, -\ell \cdot \ell\right)}}
\] |
metadata-eval [=>]61.6 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{\mathsf{fma}\left(x + 1, \frac{\mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right)}{x + \color{blue}{-1}}, -\ell \cdot \ell\right)}}
\] |
Taylor expanded in x around -inf 29.8
Simplified29.8
[Start]29.8 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{2 \cdot \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x} + 2 \cdot {t}^{2}}}
\] |
|---|---|
distribute-lft-out [=>]29.8 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{\color{blue}{2 \cdot \left(\frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x} + {t}^{2}\right)}}}
\] |
+-commutative [=>]29.8 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{2 \cdot \left(\frac{\color{blue}{2 \cdot {t}^{2} + {\ell}^{2}}}{x} + {t}^{2}\right)}}
\] |
unpow2 [=>]29.8 | \[ \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 [<=]29.8 | \[ \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 [=>]29.8 | \[ \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 [=>]29.8 | \[ \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 29.8
Simplified27.6
[Start]29.8 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{2 \cdot \left(\frac{{\ell}^{2}}{x} + t \cdot t\right)}}
\] |
|---|---|
unpow2 [=>]29.8 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{2 \cdot \left(\frac{\color{blue}{\ell \cdot \ell}}{x} + t \cdot t\right)}}
\] |
associate-/l* [=>]27.6 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{2 \cdot \left(\color{blue}{\frac{\ell}{\frac{x}{\ell}}} + t \cdot t\right)}}
\] |
Applied egg-rr6.0
Simplified5.9
[Start]6.0 | \[ \frac{\frac{t \cdot \sqrt{2}}{\sqrt{2}}}{\mathsf{hypot}\left(t, \sqrt{\ell \cdot \frac{\ell}{x}}\right)}
\] |
|---|---|
associate-/l* [=>]5.9 | \[ \frac{\color{blue}{\frac{t}{\frac{\sqrt{2}}{\sqrt{2}}}}}{\mathsf{hypot}\left(t, \sqrt{\ell \cdot \frac{\ell}{x}}\right)}
\] |
*-inverses [=>]5.9 | \[ \frac{\frac{t}{\color{blue}{1}}}{\mathsf{hypot}\left(t, \sqrt{\ell \cdot \frac{\ell}{x}}\right)}
\] |
Applied egg-rr37.9
Simplified14.7
[Start]37.9 | \[ e^{\mathsf{log1p}\left(\frac{t}{\mathsf{hypot}\left(t, \frac{\ell}{\sqrt{x}}\right)}\right)} - 1
\] |
|---|---|
expm1-def [=>]14.7 | \[ \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{t}{\mathsf{hypot}\left(t, \frac{\ell}{\sqrt{x}}\right)}\right)\right)}
\] |
expm1-log1p [=>]14.7 | \[ \color{blue}{\frac{t}{\mathsf{hypot}\left(t, \frac{\ell}{\sqrt{x}}\right)}}
\] |
if 3.09999999999999985e-304 < t < 1.9000000000000001e-116Initial program 56.8
Simplified61.1
[Start]56.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/ [<=]56.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/ [=>]55.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/ [<=]62.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 [<=]62.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* [<=]62.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 [<=]62.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* [=>]62.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 [<=]62.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.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)}}}
\] |
associate-*r/ [=>]61.1 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{\mathsf{fma}\left(x + 1, \color{blue}{\frac{1 \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right)}{x - 1}}, -\ell \cdot \ell\right)}}
\] |
*-lft-identity [=>]61.1 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{\mathsf{fma}\left(x + 1, \frac{\color{blue}{\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)}}{x - 1}, -\ell \cdot \ell\right)}}
\] |
+-commutative [=>]61.1 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{\mathsf{fma}\left(x + 1, \frac{\color{blue}{2 \cdot \left(t \cdot t\right) + \ell \cdot \ell}}{x - 1}, -\ell \cdot \ell\right)}}
\] |
fma-def [=>]61.1 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{\mathsf{fma}\left(x + 1, \frac{\color{blue}{\mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right)}}{x - 1}, -\ell \cdot \ell\right)}}
\] |
sub-neg [=>]61.1 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{\mathsf{fma}\left(x + 1, \frac{\mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right)}{\color{blue}{x + \left(-1\right)}}, -\ell \cdot \ell\right)}}
\] |
metadata-eval [=>]61.1 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{\mathsf{fma}\left(x + 1, \frac{\mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right)}{x + \color{blue}{-1}}, -\ell \cdot \ell\right)}}
\] |
Taylor expanded in x around -inf 27.1
Simplified27.1
[Start]27.1 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{2 \cdot \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x} + 2 \cdot {t}^{2}}}
\] |
|---|---|
distribute-lft-out [=>]27.1 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{\color{blue}{2 \cdot \left(\frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x} + {t}^{2}\right)}}}
\] |
+-commutative [=>]27.1 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{2 \cdot \left(\frac{\color{blue}{2 \cdot {t}^{2} + {\ell}^{2}}}{x} + {t}^{2}\right)}}
\] |
unpow2 [=>]27.1 | \[ \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.1 | \[ \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.1 | \[ \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.1 | \[ \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.4
Simplified9.4
[Start]9.4 | \[ \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/ [=>]9.4 | \[ \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 [=>]9.4 | \[ \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}}
\] |
if 5e103 < t Initial program 51.0
Simplified51.0
[Start]51.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/ [<=]51.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 [=>]51.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 [=>]51.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 [=>]51.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 [=>]51.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-rr2.1
Simplified2.1
[Start]2.1 | \[ 0 + \sqrt{2 \cdot \left(\frac{1 - x}{-1 - x} \cdot 0.5\right)}
\] |
|---|---|
+-lft-identity [=>]2.1 | \[ \color{blue}{\sqrt{2 \cdot \left(\frac{1 - x}{-1 - x} \cdot 0.5\right)}}
\] |
*-commutative [=>]2.1 | \[ \sqrt{2 \cdot \color{blue}{\left(0.5 \cdot \frac{1 - x}{-1 - x}\right)}}
\] |
associate-*r* [=>]2.1 | \[ \sqrt{\color{blue}{\left(2 \cdot 0.5\right) \cdot \frac{1 - x}{-1 - x}}}
\] |
metadata-eval [=>]2.1 | \[ \sqrt{\color{blue}{1} \cdot \frac{1 - x}{-1 - x}}
\] |
*-lft-identity [=>]2.1 | \[ \sqrt{\color{blue}{\frac{1 - x}{-1 - x}}}
\] |
Final simplification5.8
| Alternative 1 | |
|---|---|
| Error | 5.3 |
| Cost | 14036 |
| Alternative 2 | |
|---|---|
| Error | 6.6 |
| Cost | 13576 |
| Alternative 3 | |
|---|---|
| Error | 10.5 |
| Cost | 13448 |
| Alternative 4 | |
|---|---|
| Error | 12.6 |
| Cost | 13384 |
| Alternative 5 | |
|---|---|
| Error | 13.6 |
| Cost | 7368 |
| Alternative 6 | |
|---|---|
| Error | 14.1 |
| Cost | 7112 |
| Alternative 7 | |
|---|---|
| Error | 13.7 |
| Cost | 7112 |
| Alternative 8 | |
|---|---|
| Error | 14.1 |
| Cost | 7112 |
| Alternative 9 | |
|---|---|
| Error | 13.9 |
| Cost | 7112 |
| Alternative 10 | |
|---|---|
| Error | 14.7 |
| Cost | 6984 |
| Alternative 11 | |
|---|---|
| Error | 14.6 |
| Cost | 6984 |
| Alternative 12 | |
|---|---|
| Error | 14.7 |
| Cost | 1096 |
| Alternative 13 | |
|---|---|
| Error | 13.1 |
| Cost | 1096 |
| Alternative 14 | |
|---|---|
| Error | 16.1 |
| Cost | 964 |
| Alternative 15 | |
|---|---|
| Error | 15.8 |
| Cost | 196 |
| Alternative 16 | |
|---|---|
| Error | 38.8 |
| Cost | 64 |
herbie shell --seed 2022354
(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)))))