| Alternative 1 | |
|---|---|
| Error | 12.0 |
| 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)))
(t_2 (/ (* l l) x))
(t_3 (fma 2.0 (* t t) (* l l))))
(if (<= t -7.5e+39)
(/ t_1 (* t_1 (- (sqrt (/ (+ x 1.0) (+ x -1.0))))))
(if (<= t -9e-293)
(*
t
(/
(sqrt 2.0)
(sqrt (+ t_2 (+ t_2 (* 2.0 (+ (* t t) (/ (* t t) x))))))))
(if (<= t 5.6e-176)
(/ t_1 (fma 0.5 (/ (* 2.0 t_3) (* (sqrt 2.0) (* t x))) t_1))
(if (<= t 2.7e-70)
(/
t_1
(sqrt
(+
(/ l (/ x l))
(+ (* 2.0 (+ (* t t) (/ t (/ x t)))) (/ t_3 x)))))
(*
t
(/ (sqrt 2.0) (* t (sqrt (+ (/ 2.0 x) (+ 2.0 (/ 2.0 x)))))))))))))double code(double x, double l, double t) {
return (sqrt(2.0) * t) / sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l)));
}
double code(double x, double l, double t) {
double t_1 = t * sqrt(2.0);
double t_2 = (l * l) / x;
double t_3 = fma(2.0, (t * t), (l * l));
double tmp;
if (t <= -7.5e+39) {
tmp = t_1 / (t_1 * -sqrt(((x + 1.0) / (x + -1.0))));
} else if (t <= -9e-293) {
tmp = t * (sqrt(2.0) / sqrt((t_2 + (t_2 + (2.0 * ((t * t) + ((t * t) / x)))))));
} else if (t <= 5.6e-176) {
tmp = t_1 / fma(0.5, ((2.0 * t_3) / (sqrt(2.0) * (t * x))), t_1);
} else if (t <= 2.7e-70) {
tmp = t_1 / sqrt(((l / (x / l)) + ((2.0 * ((t * t) + (t / (x / t)))) + (t_3 / x))));
} else {
tmp = t * (sqrt(2.0) / (t * sqrt(((2.0 / x) + (2.0 + (2.0 / x))))));
}
return tmp;
}
function code(x, l, t) return Float64(Float64(sqrt(2.0) * t) / sqrt(Float64(Float64(Float64(Float64(x + 1.0) / Float64(x - 1.0)) * Float64(Float64(l * l) + Float64(2.0 * Float64(t * t)))) - Float64(l * l)))) end
function code(x, l, t) t_1 = Float64(t * sqrt(2.0)) t_2 = Float64(Float64(l * l) / x) t_3 = fma(2.0, Float64(t * t), Float64(l * l)) tmp = 0.0 if (t <= -7.5e+39) tmp = Float64(t_1 / Float64(t_1 * Float64(-sqrt(Float64(Float64(x + 1.0) / Float64(x + -1.0)))))); elseif (t <= -9e-293) tmp = Float64(t * Float64(sqrt(2.0) / sqrt(Float64(t_2 + Float64(t_2 + Float64(2.0 * Float64(Float64(t * t) + Float64(Float64(t * t) / x)))))))); elseif (t <= 5.6e-176) tmp = Float64(t_1 / fma(0.5, Float64(Float64(2.0 * t_3) / Float64(sqrt(2.0) * Float64(t * x))), t_1)); elseif (t <= 2.7e-70) tmp = Float64(t_1 / sqrt(Float64(Float64(l / Float64(x / l)) + Float64(Float64(2.0 * Float64(Float64(t * t) + Float64(t / Float64(x / t)))) + Float64(t_3 / x))))); else tmp = Float64(t * Float64(sqrt(2.0) / Float64(t * sqrt(Float64(Float64(2.0 / x) + Float64(2.0 + Float64(2.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[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(l * l), $MachinePrecision] / x), $MachinePrecision]}, Block[{t$95$3 = N[(2.0 * N[(t * t), $MachinePrecision] + N[(l * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -7.5e+39], N[(t$95$1 / N[(t$95$1 * (-N[Sqrt[N[(N[(x + 1.0), $MachinePrecision] / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -9e-293], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[Sqrt[N[(t$95$2 + N[(t$95$2 + N[(2.0 * N[(N[(t * t), $MachinePrecision] + N[(N[(t * t), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5.6e-176], N[(t$95$1 / N[(0.5 * N[(N[(2.0 * t$95$3), $MachinePrecision] / N[(N[Sqrt[2.0], $MachinePrecision] * N[(t * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.7e-70], N[(t$95$1 / N[Sqrt[N[(N[(l / N[(x / l), $MachinePrecision]), $MachinePrecision] + N[(N[(2.0 * N[(N[(t * t), $MachinePrecision] + N[(t / N[(x / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$3 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[(t * N[Sqrt[N[(N[(2.0 / x), $MachinePrecision] + N[(2.0 + N[(2.0 / x), $MachinePrecision]), $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 := t \cdot \sqrt{2}\\
t_2 := \frac{\ell \cdot \ell}{x}\\
t_3 := \mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right)\\
\mathbf{if}\;t \leq -7.5 \cdot 10^{+39}:\\
\;\;\;\;\frac{t_1}{t_1 \cdot \left(-\sqrt{\frac{x + 1}{x + -1}}\right)}\\
\mathbf{elif}\;t \leq -9 \cdot 10^{-293}:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{\sqrt{t_2 + \left(t_2 + 2 \cdot \left(t \cdot t + \frac{t \cdot t}{x}\right)\right)}}\\
\mathbf{elif}\;t \leq 5.6 \cdot 10^{-176}:\\
\;\;\;\;\frac{t_1}{\mathsf{fma}\left(0.5, \frac{2 \cdot t_3}{\sqrt{2} \cdot \left(t \cdot x\right)}, t_1\right)}\\
\mathbf{elif}\;t \leq 2.7 \cdot 10^{-70}:\\
\;\;\;\;\frac{t_1}{\sqrt{\frac{\ell}{\frac{x}{\ell}} + \left(2 \cdot \left(t \cdot t + \frac{t}{\frac{x}{t}}\right) + \frac{t_3}{x}\right)}}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{t \cdot \sqrt{\frac{2}{x} + \left(2 + \frac{2}{x}\right)}}\\
\end{array}
if t < -7.5000000000000005e39Initial program 43.3
Taylor expanded in t around -inf 3.8
Simplified3.8
[Start]3.8 | \[ \frac{\sqrt{2} \cdot t}{-1 \cdot \left(\left(\sqrt{2} \cdot t\right) \cdot \sqrt{\frac{1 + x}{x - 1}}\right)}
\] |
|---|---|
mul-1-neg [=>]3.8 | \[ \frac{\sqrt{2} \cdot t}{\color{blue}{-\left(\sqrt{2} \cdot t\right) \cdot \sqrt{\frac{1 + x}{x - 1}}}}
\] |
distribute-rgt-neg-in [=>]3.8 | \[ \frac{\sqrt{2} \cdot t}{\color{blue}{\left(\sqrt{2} \cdot t\right) \cdot \left(-\sqrt{\frac{1 + x}{x - 1}}\right)}}
\] |
*-commutative [<=]3.8 | \[ \frac{\sqrt{2} \cdot t}{\color{blue}{\left(t \cdot \sqrt{2}\right)} \cdot \left(-\sqrt{\frac{1 + x}{x - 1}}\right)}
\] |
+-commutative [=>]3.8 | \[ \frac{\sqrt{2} \cdot t}{\left(t \cdot \sqrt{2}\right) \cdot \left(-\sqrt{\frac{\color{blue}{x + 1}}{x - 1}}\right)}
\] |
sub-neg [=>]3.8 | \[ \frac{\sqrt{2} \cdot t}{\left(t \cdot \sqrt{2}\right) \cdot \left(-\sqrt{\frac{x + 1}{\color{blue}{x + \left(-1\right)}}}\right)}
\] |
metadata-eval [=>]3.8 | \[ \frac{\sqrt{2} \cdot t}{\left(t \cdot \sqrt{2}\right) \cdot \left(-\sqrt{\frac{x + 1}{x + \color{blue}{-1}}}\right)}
\] |
+-commutative [=>]3.8 | \[ \frac{\sqrt{2} \cdot t}{\left(t \cdot \sqrt{2}\right) \cdot \left(-\sqrt{\frac{x + 1}{\color{blue}{-1 + x}}}\right)}
\] |
if -7.5000000000000005e39 < t < -9.0000000000000005e-293Initial program 42.7
Simplified42.7
[Start]42.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-*l/ [<=]42.7 | \[ \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 [=>]42.7 | \[ \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 [=>]42.7 | \[ \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 x around inf 18.9
Simplified18.9
[Start]18.9 | \[ \frac{\sqrt{2}}{\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}}} \cdot t
\] |
|---|---|
associate--l+ [=>]18.9 | \[ \frac{\sqrt{2}}{\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)}}} \cdot t
\] |
unpow2 [=>]18.9 | \[ \frac{\sqrt{2}}{\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)}} \cdot t
\] |
distribute-lft-out [=>]18.9 | \[ \frac{\sqrt{2}}{\sqrt{\frac{\ell \cdot \ell}{x} + \left(\color{blue}{2 \cdot \left(\frac{{t}^{2}}{x} + {t}^{2}\right)} - -1 \cdot \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x}\right)}} \cdot t
\] |
unpow2 [=>]18.9 | \[ \frac{\sqrt{2}}{\sqrt{\frac{\ell \cdot \ell}{x} + \left(2 \cdot \left(\frac{\color{blue}{t \cdot t}}{x} + {t}^{2}\right) - -1 \cdot \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x}\right)}} \cdot t
\] |
unpow2 [=>]18.9 | \[ \frac{\sqrt{2}}{\sqrt{\frac{\ell \cdot \ell}{x} + \left(2 \cdot \left(\frac{t \cdot t}{x} + \color{blue}{t \cdot t}\right) - -1 \cdot \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x}\right)}} \cdot t
\] |
mul-1-neg [=>]18.9 | \[ \frac{\sqrt{2}}{\sqrt{\frac{\ell \cdot \ell}{x} + \left(2 \cdot \left(\frac{t \cdot t}{x} + t \cdot t\right) - \color{blue}{\left(-\frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x}\right)}\right)}} \cdot t
\] |
+-commutative [=>]18.9 | \[ \frac{\sqrt{2}}{\sqrt{\frac{\ell \cdot \ell}{x} + \left(2 \cdot \left(\frac{t \cdot t}{x} + t \cdot t\right) - \left(-\frac{\color{blue}{2 \cdot {t}^{2} + {\ell}^{2}}}{x}\right)\right)}} \cdot t
\] |
unpow2 [=>]18.9 | \[ \frac{\sqrt{2}}{\sqrt{\frac{\ell \cdot \ell}{x} + \left(2 \cdot \left(\frac{t \cdot t}{x} + t \cdot t\right) - \left(-\frac{2 \cdot {t}^{2} + \color{blue}{\ell \cdot \ell}}{x}\right)\right)}} \cdot t
\] |
fma-udef [<=]18.9 | \[ \frac{\sqrt{2}}{\sqrt{\frac{\ell \cdot \ell}{x} + \left(2 \cdot \left(\frac{t \cdot t}{x} + t \cdot t\right) - \left(-\frac{\color{blue}{\mathsf{fma}\left(2, {t}^{2}, \ell \cdot \ell\right)}}{x}\right)\right)}} \cdot t
\] |
unpow2 [=>]18.9 | \[ \frac{\sqrt{2}}{\sqrt{\frac{\ell \cdot \ell}{x} + \left(2 \cdot \left(\frac{t \cdot t}{x} + t \cdot t\right) - \left(-\frac{\mathsf{fma}\left(2, \color{blue}{t \cdot t}, \ell \cdot \ell\right)}{x}\right)\right)}} \cdot t
\] |
Taylor expanded in t around 0 19.1
Simplified19.1
[Start]19.1 | \[ \frac{\sqrt{2}}{\sqrt{\frac{\ell \cdot \ell}{x} + \left(2 \cdot \left(\frac{t \cdot t}{x} + t \cdot t\right) - \left(-\frac{{\ell}^{2}}{x}\right)\right)}} \cdot t
\] |
|---|---|
unpow2 [=>]19.1 | \[ \frac{\sqrt{2}}{\sqrt{\frac{\ell \cdot \ell}{x} + \left(2 \cdot \left(\frac{t \cdot t}{x} + t \cdot t\right) - \left(-\frac{\color{blue}{\ell \cdot \ell}}{x}\right)\right)}} \cdot t
\] |
if -9.0000000000000005e-293 < t < 5.6000000000000003e-176Initial program 62.8
Taylor expanded in x around inf 27.1
Simplified27.1
[Start]27.1 | \[ \frac{\sqrt{2} \cdot t}{0.5 \cdot \frac{\left({\ell}^{2} + 2 \cdot {t}^{2}\right) - -1 \cdot \left({\ell}^{2} + 2 \cdot {t}^{2}\right)}{\sqrt{2} \cdot \left(t \cdot x\right)} + \sqrt{2} \cdot t}
\] |
|---|---|
fma-def [=>]27.1 | \[ \frac{\sqrt{2} \cdot t}{\color{blue}{\mathsf{fma}\left(0.5, \frac{\left({\ell}^{2} + 2 \cdot {t}^{2}\right) - -1 \cdot \left({\ell}^{2} + 2 \cdot {t}^{2}\right)}{\sqrt{2} \cdot \left(t \cdot x\right)}, \sqrt{2} \cdot t\right)}}
\] |
cancel-sign-sub-inv [=>]27.1 | \[ \frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(0.5, \frac{\color{blue}{\left({\ell}^{2} + 2 \cdot {t}^{2}\right) + \left(--1\right) \cdot \left({\ell}^{2} + 2 \cdot {t}^{2}\right)}}{\sqrt{2} \cdot \left(t \cdot x\right)}, \sqrt{2} \cdot t\right)}
\] |
metadata-eval [=>]27.1 | \[ \frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(0.5, \frac{\left({\ell}^{2} + 2 \cdot {t}^{2}\right) + \color{blue}{1} \cdot \left({\ell}^{2} + 2 \cdot {t}^{2}\right)}{\sqrt{2} \cdot \left(t \cdot x\right)}, \sqrt{2} \cdot t\right)}
\] |
distribute-rgt1-in [=>]27.1 | \[ \frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(0.5, \frac{\color{blue}{\left(1 + 1\right) \cdot \left({\ell}^{2} + 2 \cdot {t}^{2}\right)}}{\sqrt{2} \cdot \left(t \cdot x\right)}, \sqrt{2} \cdot t\right)}
\] |
metadata-eval [=>]27.1 | \[ \frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(0.5, \frac{\color{blue}{2} \cdot \left({\ell}^{2} + 2 \cdot {t}^{2}\right)}{\sqrt{2} \cdot \left(t \cdot x\right)}, \sqrt{2} \cdot t\right)}
\] |
+-commutative [=>]27.1 | \[ \frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(0.5, \frac{2 \cdot \color{blue}{\left(2 \cdot {t}^{2} + {\ell}^{2}\right)}}{\sqrt{2} \cdot \left(t \cdot x\right)}, \sqrt{2} \cdot t\right)}
\] |
unpow2 [=>]27.1 | \[ \frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(0.5, \frac{2 \cdot \left(2 \cdot {t}^{2} + \color{blue}{\ell \cdot \ell}\right)}{\sqrt{2} \cdot \left(t \cdot x\right)}, \sqrt{2} \cdot t\right)}
\] |
fma-udef [<=]27.1 | \[ \frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(0.5, \frac{2 \cdot \color{blue}{\mathsf{fma}\left(2, {t}^{2}, \ell \cdot \ell\right)}}{\sqrt{2} \cdot \left(t \cdot x\right)}, \sqrt{2} \cdot t\right)}
\] |
unpow2 [=>]27.1 | \[ \frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(0.5, \frac{2 \cdot \mathsf{fma}\left(2, \color{blue}{t \cdot t}, \ell \cdot \ell\right)}{\sqrt{2} \cdot \left(t \cdot x\right)}, \sqrt{2} \cdot t\right)}
\] |
*-commutative [<=]27.1 | \[ \frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(0.5, \frac{2 \cdot \mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right)}{\sqrt{2} \cdot \left(t \cdot x\right)}, \color{blue}{t \cdot \sqrt{2}}\right)}
\] |
if 5.6000000000000003e-176 < t < 2.7000000000000001e-70Initial program 38.3
Taylor expanded in x around inf 13.5
Simplified13.5
[Start]13.5 | \[ \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}}}
\] |
|---|---|
cancel-sign-sub-inv [=>]13.5 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\color{blue}{\left(\frac{{\ell}^{2}}{x} + \left(2 \cdot \frac{{t}^{2}}{x} + 2 \cdot {t}^{2}\right)\right) + \left(--1\right) \cdot \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x}}}}
\] |
associate-+l+ [=>]13.5 | \[ \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) + \left(--1\right) \cdot \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x}\right)}}}
\] |
unpow2 [=>]13.5 | \[ \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) + \left(--1\right) \cdot \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x}\right)}}
\] |
associate-/l* [=>]13.5 | \[ \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) + \left(--1\right) \cdot \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x}\right)}}
\] |
distribute-lft-out [=>]13.5 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\frac{\ell}{\frac{x}{\ell}} + \left(\color{blue}{2 \cdot \left(\frac{{t}^{2}}{x} + {t}^{2}\right)} + \left(--1\right) \cdot \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x}\right)}}
\] |
+-commutative [=>]13.5 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\frac{\ell}{\frac{x}{\ell}} + \left(2 \cdot \color{blue}{\left({t}^{2} + \frac{{t}^{2}}{x}\right)} + \left(--1\right) \cdot \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x}\right)}}
\] |
unpow2 [=>]13.5 | \[ \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) + \left(--1\right) \cdot \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x}\right)}}
\] |
unpow2 [=>]13.5 | \[ \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) + \left(--1\right) \cdot \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x}\right)}}
\] |
associate-/l* [=>]13.5 | \[ \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) + \left(--1\right) \cdot \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x}\right)}}
\] |
distribute-lft-neg-in [<=]13.5 | \[ \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(--1 \cdot \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x}\right)}\right)}}
\] |
mul-1-neg [=>]13.5 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\frac{\ell}{\frac{x}{\ell}} + \left(2 \cdot \left(t \cdot t + \frac{t}{\frac{x}{t}}\right) + \left(-\color{blue}{\left(-\frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x}\right)}\right)\right)}}
\] |
remove-double-neg [=>]13.5 | \[ \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} + 2 \cdot {t}^{2}}{x}}\right)}}
\] |
if 2.7000000000000001e-70 < t Initial program 38.7
Simplified38.6
[Start]38.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-*l/ [<=]38.6 | \[ \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 [=>]38.6 | \[ \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 [=>]38.6 | \[ \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 x around inf 34.1
Simplified34.1
[Start]34.1 | \[ \frac{\sqrt{2}}{\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}}} \cdot t
\] |
|---|---|
associate--l+ [=>]34.1 | \[ \frac{\sqrt{2}}{\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)}}} \cdot t
\] |
unpow2 [=>]34.1 | \[ \frac{\sqrt{2}}{\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)}} \cdot t
\] |
distribute-lft-out [=>]34.1 | \[ \frac{\sqrt{2}}{\sqrt{\frac{\ell \cdot \ell}{x} + \left(\color{blue}{2 \cdot \left(\frac{{t}^{2}}{x} + {t}^{2}\right)} - -1 \cdot \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x}\right)}} \cdot t
\] |
unpow2 [=>]34.1 | \[ \frac{\sqrt{2}}{\sqrt{\frac{\ell \cdot \ell}{x} + \left(2 \cdot \left(\frac{\color{blue}{t \cdot t}}{x} + {t}^{2}\right) - -1 \cdot \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x}\right)}} \cdot t
\] |
unpow2 [=>]34.1 | \[ \frac{\sqrt{2}}{\sqrt{\frac{\ell \cdot \ell}{x} + \left(2 \cdot \left(\frac{t \cdot t}{x} + \color{blue}{t \cdot t}\right) - -1 \cdot \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x}\right)}} \cdot t
\] |
mul-1-neg [=>]34.1 | \[ \frac{\sqrt{2}}{\sqrt{\frac{\ell \cdot \ell}{x} + \left(2 \cdot \left(\frac{t \cdot t}{x} + t \cdot t\right) - \color{blue}{\left(-\frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x}\right)}\right)}} \cdot t
\] |
+-commutative [=>]34.1 | \[ \frac{\sqrt{2}}{\sqrt{\frac{\ell \cdot \ell}{x} + \left(2 \cdot \left(\frac{t \cdot t}{x} + t \cdot t\right) - \left(-\frac{\color{blue}{2 \cdot {t}^{2} + {\ell}^{2}}}{x}\right)\right)}} \cdot t
\] |
unpow2 [=>]34.1 | \[ \frac{\sqrt{2}}{\sqrt{\frac{\ell \cdot \ell}{x} + \left(2 \cdot \left(\frac{t \cdot t}{x} + t \cdot t\right) - \left(-\frac{2 \cdot {t}^{2} + \color{blue}{\ell \cdot \ell}}{x}\right)\right)}} \cdot t
\] |
fma-udef [<=]34.1 | \[ \frac{\sqrt{2}}{\sqrt{\frac{\ell \cdot \ell}{x} + \left(2 \cdot \left(\frac{t \cdot t}{x} + t \cdot t\right) - \left(-\frac{\color{blue}{\mathsf{fma}\left(2, {t}^{2}, \ell \cdot \ell\right)}}{x}\right)\right)}} \cdot t
\] |
unpow2 [=>]34.1 | \[ \frac{\sqrt{2}}{\sqrt{\frac{\ell \cdot \ell}{x} + \left(2 \cdot \left(\frac{t \cdot t}{x} + t \cdot t\right) - \left(-\frac{\mathsf{fma}\left(2, \color{blue}{t \cdot t}, \ell \cdot \ell\right)}{x}\right)\right)}} \cdot t
\] |
Taylor expanded in t around inf 7.5
Simplified7.5
[Start]7.5 | \[ \frac{\sqrt{2}}{\sqrt{2 \cdot \left(1 + \frac{1}{x}\right) + 2 \cdot \frac{1}{x}} \cdot t} \cdot t
\] |
|---|---|
*-commutative [<=]7.5 | \[ \frac{\sqrt{2}}{\color{blue}{t \cdot \sqrt{2 \cdot \left(1 + \frac{1}{x}\right) + 2 \cdot \frac{1}{x}}}} \cdot t
\] |
distribute-lft-in [=>]7.5 | \[ \frac{\sqrt{2}}{t \cdot \sqrt{\color{blue}{\left(2 \cdot 1 + 2 \cdot \frac{1}{x}\right)} + 2 \cdot \frac{1}{x}}} \cdot t
\] |
metadata-eval [=>]7.5 | \[ \frac{\sqrt{2}}{t \cdot \sqrt{\left(\color{blue}{2} + 2 \cdot \frac{1}{x}\right) + 2 \cdot \frac{1}{x}}} \cdot t
\] |
associate-*r/ [=>]7.5 | \[ \frac{\sqrt{2}}{t \cdot \sqrt{\left(2 + \color{blue}{\frac{2 \cdot 1}{x}}\right) + 2 \cdot \frac{1}{x}}} \cdot t
\] |
metadata-eval [=>]7.5 | \[ \frac{\sqrt{2}}{t \cdot \sqrt{\left(2 + \frac{\color{blue}{2}}{x}\right) + 2 \cdot \frac{1}{x}}} \cdot t
\] |
associate-*r/ [=>]7.5 | \[ \frac{\sqrt{2}}{t \cdot \sqrt{\left(2 + \frac{2}{x}\right) + \color{blue}{\frac{2 \cdot 1}{x}}}} \cdot t
\] |
metadata-eval [=>]7.5 | \[ \frac{\sqrt{2}}{t \cdot \sqrt{\left(2 + \frac{2}{x}\right) + \frac{\color{blue}{2}}{x}}} \cdot t
\] |
Final simplification11.6
| Alternative 1 | |
|---|---|
| Error | 12.0 |
| Cost | 21448 |
| Alternative 2 | |
|---|---|
| Error | 11.9 |
| Cost | 21448 |
| Alternative 3 | |
|---|---|
| Error | 12.0 |
| Cost | 20680 |
| Alternative 4 | |
|---|---|
| Error | 12.1 |
| Cost | 20356 |
| Alternative 5 | |
|---|---|
| Error | 12.0 |
| Cost | 20356 |
| Alternative 6 | |
|---|---|
| Error | 12.4 |
| Cost | 20100 |
| Alternative 7 | |
|---|---|
| Error | 12.1 |
| Cost | 14792 |
| Alternative 8 | |
|---|---|
| Error | 14.9 |
| Cost | 14340 |
| Alternative 9 | |
|---|---|
| Error | 15.1 |
| Cost | 14024 |
| Alternative 10 | |
|---|---|
| Error | 15.1 |
| Cost | 14024 |
| Alternative 11 | |
|---|---|
| Error | 14.9 |
| Cost | 14024 |
| Alternative 12 | |
|---|---|
| Error | 15.7 |
| Cost | 13896 |
| Alternative 13 | |
|---|---|
| Error | 15.8 |
| Cost | 13768 |
| Alternative 14 | |
|---|---|
| Error | 15.8 |
| Cost | 456 |
| Alternative 15 | |
|---|---|
| Error | 15.9 |
| Cost | 196 |
| Alternative 16 | |
|---|---|
| Error | 39.6 |
| Cost | 64 |
herbie shell --seed 2023010
(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)))))