| Alternative 1 | |
|---|---|
| Error | 17.38% |
| Cost | 69324 |
(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 (/ 4.0 x))))
(t_2 (/ (* l l) x))
(t_3
(/
t
(sqrt
(/
(+
(/ l (/ x l))
(+
(/ (fma 2.0 (* t t) (* l l)) x)
(* 2.0 (+ (* t t) (/ t (/ x t))))))
2.0)))))
(if (<= t -1.5e+79)
(+ -1.0 (+ (/ 1.0 x) (* (/ 1.0 (* x x)) (+ (/ 0.5 x) -0.5))))
(if (<= t -4.1e-160)
t_3
(if (<= t -1.4e-211)
-1.0
(if (<= t 1.55e-268)
(*
t
(/
(sqrt 2.0)
(sqrt (+ t_2 (+ t_2 (* 2.0 (+ (* t t) (/ (* t t) x))))))))
(if (<= t 2.6e-159)
(* t (/ (sqrt 2.0) (+ (* (/ l t) (/ (/ l x) t_1)) (* t t_1))))
(if (<= t 2.1e+23)
t_3
(+ 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 = sqrt((2.0 + (4.0 / x)));
double t_2 = (l * l) / x;
double t_3 = t / sqrt((((l / (x / l)) + ((fma(2.0, (t * t), (l * l)) / x) + (2.0 * ((t * t) + (t / (x / t)))))) / 2.0));
double tmp;
if (t <= -1.5e+79) {
tmp = -1.0 + ((1.0 / x) + ((1.0 / (x * x)) * ((0.5 / x) + -0.5)));
} else if (t <= -4.1e-160) {
tmp = t_3;
} else if (t <= -1.4e-211) {
tmp = -1.0;
} else if (t <= 1.55e-268) {
tmp = t * (sqrt(2.0) / sqrt((t_2 + (t_2 + (2.0 * ((t * t) + ((t * t) / x)))))));
} else if (t <= 2.6e-159) {
tmp = t * (sqrt(2.0) / (((l / t) * ((l / x) / t_1)) + (t * t_1)));
} else if (t <= 2.1e+23) {
tmp = t_3;
} 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 = sqrt(Float64(2.0 + Float64(4.0 / x))) t_2 = Float64(Float64(l * l) / x) t_3 = Float64(t / sqrt(Float64(Float64(Float64(l / Float64(x / l)) + Float64(Float64(fma(2.0, Float64(t * t), Float64(l * l)) / x) + Float64(2.0 * Float64(Float64(t * t) + Float64(t / Float64(x / t)))))) / 2.0))) tmp = 0.0 if (t <= -1.5e+79) tmp = Float64(-1.0 + Float64(Float64(1.0 / x) + Float64(Float64(1.0 / Float64(x * x)) * Float64(Float64(0.5 / x) + -0.5)))); elseif (t <= -4.1e-160) tmp = t_3; elseif (t <= -1.4e-211) tmp = -1.0; elseif (t <= 1.55e-268) 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 <= 2.6e-159) tmp = Float64(t * Float64(sqrt(2.0) / Float64(Float64(Float64(l / t) * Float64(Float64(l / x) / t_1)) + Float64(t * t_1)))); elseif (t <= 2.1e+23) tmp = t_3; 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[Sqrt[N[(2.0 + N[(4.0 / x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[(l * l), $MachinePrecision] / x), $MachinePrecision]}, Block[{t$95$3 = N[(t / N[Sqrt[N[(N[(N[(l / N[(x / l), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(2.0 * N[(t * t), $MachinePrecision] + N[(l * l), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] + N[(2.0 * N[(N[(t * t), $MachinePrecision] + N[(t / N[(x / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.5e+79], N[(-1.0 + N[(N[(1.0 / x), $MachinePrecision] + N[(N[(1.0 / N[(x * x), $MachinePrecision]), $MachinePrecision] * N[(N[(0.5 / x), $MachinePrecision] + -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -4.1e-160], t$95$3, If[LessEqual[t, -1.4e-211], -1.0, If[LessEqual[t, 1.55e-268], 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, 2.6e-159], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[(N[(N[(l / t), $MachinePrecision] * N[(N[(l / x), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] + N[(t * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.1e+23], t$95$3, 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 := \sqrt{2 + \frac{4}{x}}\\
t_2 := \frac{\ell \cdot \ell}{x}\\
t_3 := \frac{t}{\sqrt{\frac{\frac{\ell}{\frac{x}{\ell}} + \left(\frac{\mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right)}{x} + 2 \cdot \left(t \cdot t + \frac{t}{\frac{x}{t}}\right)\right)}{2}}}\\
\mathbf{if}\;t \leq -1.5 \cdot 10^{+79}:\\
\;\;\;\;-1 + \left(\frac{1}{x} + \frac{1}{x \cdot x} \cdot \left(\frac{0.5}{x} + -0.5\right)\right)\\
\mathbf{elif}\;t \leq -4.1 \cdot 10^{-160}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;t \leq -1.4 \cdot 10^{-211}:\\
\;\;\;\;-1\\
\mathbf{elif}\;t \leq 1.55 \cdot 10^{-268}:\\
\;\;\;\;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 2.6 \cdot 10^{-159}:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{\frac{\ell}{t} \cdot \frac{\frac{\ell}{x}}{t_1} + t \cdot t_1}\\
\mathbf{elif}\;t \leq 2.1 \cdot 10^{+23}:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;1 + \left(\frac{\frac{0.5}{x}}{x} + \frac{-1}{x}\right)\\
\end{array}
if t < -1.49999999999999987e79Initial program 74.06
Simplified74.01
[Start]74.06 | \[ \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/ [<=]74.01 | \[ \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 [=>]74.01 | \[ \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 [=>]74.01 | \[ \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
\] |
Applied egg-rr73.88
Taylor expanded in t around inf 98.42
Taylor expanded in x around -inf 100
Simplified5.09
[Start]100 | \[ 0.5 \cdot \frac{2 \cdot \frac{1}{{\left(\sqrt{-1}\right)}^{2}} + \left(2 + \frac{1}{{\left(\sqrt{-1}\right)}^{4}}\right)}{{x}^{3}} + \left(-0.5 \cdot \frac{2 + {\left(\frac{-1}{\sqrt{-1}}\right)}^{2}}{{x}^{2}} + \left({\left(\sqrt{-1}\right)}^{2} + \frac{1}{x}\right)\right)
\] |
|---|---|
associate-+r+ [=>]100 | \[ \color{blue}{\left(0.5 \cdot \frac{2 \cdot \frac{1}{{\left(\sqrt{-1}\right)}^{2}} + \left(2 + \frac{1}{{\left(\sqrt{-1}\right)}^{4}}\right)}{{x}^{3}} + -0.5 \cdot \frac{2 + {\left(\frac{-1}{\sqrt{-1}}\right)}^{2}}{{x}^{2}}\right) + \left({\left(\sqrt{-1}\right)}^{2} + \frac{1}{x}\right)}
\] |
+-commutative [=>]100 | \[ \color{blue}{\left({\left(\sqrt{-1}\right)}^{2} + \frac{1}{x}\right) + \left(0.5 \cdot \frac{2 \cdot \frac{1}{{\left(\sqrt{-1}\right)}^{2}} + \left(2 + \frac{1}{{\left(\sqrt{-1}\right)}^{4}}\right)}{{x}^{3}} + -0.5 \cdot \frac{2 + {\left(\frac{-1}{\sqrt{-1}}\right)}^{2}}{{x}^{2}}\right)}
\] |
unpow2 [=>]100 | \[ \left(\color{blue}{\sqrt{-1} \cdot \sqrt{-1}} + \frac{1}{x}\right) + \left(0.5 \cdot \frac{2 \cdot \frac{1}{{\left(\sqrt{-1}\right)}^{2}} + \left(2 + \frac{1}{{\left(\sqrt{-1}\right)}^{4}}\right)}{{x}^{3}} + -0.5 \cdot \frac{2 + {\left(\frac{-1}{\sqrt{-1}}\right)}^{2}}{{x}^{2}}\right)
\] |
rem-square-sqrt [=>]100 | \[ \left(\color{blue}{-1} + \frac{1}{x}\right) + \left(0.5 \cdot \frac{2 \cdot \frac{1}{{\left(\sqrt{-1}\right)}^{2}} + \left(2 + \frac{1}{{\left(\sqrt{-1}\right)}^{4}}\right)}{{x}^{3}} + -0.5 \cdot \frac{2 + {\left(\frac{-1}{\sqrt{-1}}\right)}^{2}}{{x}^{2}}\right)
\] |
associate-+l+ [=>]100 | \[ \color{blue}{-1 + \left(\frac{1}{x} + \left(0.5 \cdot \frac{2 \cdot \frac{1}{{\left(\sqrt{-1}\right)}^{2}} + \left(2 + \frac{1}{{\left(\sqrt{-1}\right)}^{4}}\right)}{{x}^{3}} + -0.5 \cdot \frac{2 + {\left(\frac{-1}{\sqrt{-1}}\right)}^{2}}{{x}^{2}}\right)\right)}
\] |
if -1.49999999999999987e79 < t < -4.10000000000000002e-160 or 2.5999999999999998e-159 < t < 2.1000000000000001e23Initial program 42.97
Simplified42.86
[Start]42.97 | \[ \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.86 | \[ \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.86 | \[ \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.86 | \[ \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
\] |
Applied egg-rr42.58
Taylor expanded in x around inf 13.88
Simplified13.89
[Start]13.88 | \[ \frac{t}{\sqrt{\frac{\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}}{2}}}
\] |
|---|---|
cancel-sign-sub-inv [=>]13.88 | \[ \frac{t}{\sqrt{\frac{\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}}}{2}}}
\] |
associate-+l+ [=>]13.88 | \[ \frac{t}{\sqrt{\frac{\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)}}{2}}}
\] |
unpow2 [=>]13.88 | \[ \frac{t}{\sqrt{\frac{\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)}{2}}}
\] |
associate-/l* [=>]13.89 | \[ \frac{t}{\sqrt{\frac{\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)}{2}}}
\] |
distribute-lft-out [=>]13.89 | \[ \frac{t}{\sqrt{\frac{\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)}{2}}}
\] |
+-commutative [=>]13.89 | \[ \frac{t}{\sqrt{\frac{\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)}{2}}}
\] |
unpow2 [=>]13.89 | \[ \frac{t}{\sqrt{\frac{\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)}{2}}}
\] |
unpow2 [=>]13.89 | \[ \frac{t}{\sqrt{\frac{\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)}{2}}}
\] |
associate-/l* [=>]13.89 | \[ \frac{t}{\sqrt{\frac{\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)}{2}}}
\] |
metadata-eval [=>]13.89 | \[ \frac{t}{\sqrt{\frac{\frac{\ell}{\frac{x}{\ell}} + \left(2 \cdot \left(t \cdot t + \frac{t}{\frac{x}{t}}\right) + \color{blue}{1} \cdot \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x}\right)}{2}}}
\] |
+-commutative [=>]13.89 | \[ \frac{t}{\sqrt{\frac{\frac{\ell}{\frac{x}{\ell}} + \left(2 \cdot \left(t \cdot t + \frac{t}{\frac{x}{t}}\right) + 1 \cdot \frac{\color{blue}{2 \cdot {t}^{2} + {\ell}^{2}}}{x}\right)}{2}}}
\] |
unpow2 [=>]13.89 | \[ \frac{t}{\sqrt{\frac{\frac{\ell}{\frac{x}{\ell}} + \left(2 \cdot \left(t \cdot t + \frac{t}{\frac{x}{t}}\right) + 1 \cdot \frac{2 \cdot {t}^{2} + \color{blue}{\ell \cdot \ell}}{x}\right)}{2}}}
\] |
fma-def [=>]13.89 | \[ \frac{t}{\sqrt{\frac{\frac{\ell}{\frac{x}{\ell}} + \left(2 \cdot \left(t \cdot t + \frac{t}{\frac{x}{t}}\right) + 1 \cdot \frac{\color{blue}{\mathsf{fma}\left(2, {t}^{2}, \ell \cdot \ell\right)}}{x}\right)}{2}}}
\] |
unpow2 [=>]13.89 | \[ \frac{t}{\sqrt{\frac{\frac{\ell}{\frac{x}{\ell}} + \left(2 \cdot \left(t \cdot t + \frac{t}{\frac{x}{t}}\right) + 1 \cdot \frac{\mathsf{fma}\left(2, \color{blue}{t \cdot t}, \ell \cdot \ell\right)}{x}\right)}{2}}}
\] |
if -4.10000000000000002e-160 < t < -1.3999999999999999e-211Initial program 98.18
Simplified98.18
[Start]98.18 | \[ \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/ [<=]98.18 | \[ \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 [=>]98.18 | \[ \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 [=>]98.18 | \[ \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
\] |
Applied egg-rr98.18
Taylor expanded in t around inf 97.98
Taylor expanded in x around -inf 100
Simplified49.49
[Start]100 | \[ {\left(\sqrt{-1}\right)}^{2}
\] |
|---|---|
unpow2 [=>]100 | \[ \color{blue}{\sqrt{-1} \cdot \sqrt{-1}}
\] |
rem-square-sqrt [=>]49.49 | \[ \color{blue}{-1}
\] |
if -1.3999999999999999e-211 < t < 1.5499999999999999e-268Initial program 97.93
Simplified97.93
[Start]97.93 | \[ \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/ [<=]97.93 | \[ \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 [=>]97.93 | \[ \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 [=>]97.93 | \[ \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 50.3
Simplified50.3
[Start]50.3 | \[ \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+ [=>]50.3 | \[ \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 [=>]50.3 | \[ \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 [=>]50.3 | \[ \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 [=>]50.3 | \[ \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 [=>]50.3 | \[ \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 [=>]50.3 | \[ \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 [=>]50.3 | \[ \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 [=>]50.3 | \[ \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 [<=]50.3 | \[ \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 [=>]50.3 | \[ \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 50.3
Simplified50.3
[Start]50.3 | \[ \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 [=>]50.3 | \[ \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 1.5499999999999999e-268 < t < 2.5999999999999998e-159Initial program 98.29
Simplified98.29
[Start]98.29 | \[ \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/ [<=]98.29 | \[ \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 [=>]98.29 | \[ \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 [=>]98.29 | \[ \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 52.99
Simplified52.99
[Start]52.99 | \[ \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+ [=>]52.99 | \[ \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 [=>]52.99 | \[ \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 [=>]52.99 | \[ \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 [=>]52.99 | \[ \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 [=>]52.99 | \[ \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 [=>]52.99 | \[ \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 [=>]52.99 | \[ \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 [=>]52.99 | \[ \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 [<=]52.99 | \[ \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 [=>]52.99 | \[ \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 38.01
Simplified37.8
[Start]38.01 | \[ \frac{\sqrt{2}}{\sqrt{2 \cdot \left(1 + \frac{1}{x}\right) + 2 \cdot \frac{1}{x}} \cdot t + \sqrt{\frac{1}{2 \cdot \left(1 + \frac{1}{x}\right) + 2 \cdot \frac{1}{x}}} \cdot \frac{{\ell}^{2}}{t \cdot x}} \cdot t
\] |
|---|---|
*-commutative [<=]38.01 | \[ \frac{\sqrt{2}}{\color{blue}{t \cdot \sqrt{2 \cdot \left(1 + \frac{1}{x}\right) + 2 \cdot \frac{1}{x}}} + \sqrt{\frac{1}{2 \cdot \left(1 + \frac{1}{x}\right) + 2 \cdot \frac{1}{x}}} \cdot \frac{{\ell}^{2}}{t \cdot x}} \cdot t
\] |
fma-def [=>]38 | \[ \frac{\sqrt{2}}{\color{blue}{\mathsf{fma}\left(t, \sqrt{2 \cdot \left(1 + \frac{1}{x}\right) + 2 \cdot \frac{1}{x}}, \sqrt{\frac{1}{2 \cdot \left(1 + \frac{1}{x}\right) + 2 \cdot \frac{1}{x}}} \cdot \frac{{\ell}^{2}}{t \cdot x}\right)}} \cdot t
\] |
distribute-lft-in [=>]38 | \[ \frac{\sqrt{2}}{\mathsf{fma}\left(t, \sqrt{\color{blue}{\left(2 \cdot 1 + 2 \cdot \frac{1}{x}\right)} + 2 \cdot \frac{1}{x}}, \sqrt{\frac{1}{2 \cdot \left(1 + \frac{1}{x}\right) + 2 \cdot \frac{1}{x}}} \cdot \frac{{\ell}^{2}}{t \cdot x}\right)} \cdot t
\] |
metadata-eval [=>]38 | \[ \frac{\sqrt{2}}{\mathsf{fma}\left(t, \sqrt{\left(\color{blue}{2} + 2 \cdot \frac{1}{x}\right) + 2 \cdot \frac{1}{x}}, \sqrt{\frac{1}{2 \cdot \left(1 + \frac{1}{x}\right) + 2 \cdot \frac{1}{x}}} \cdot \frac{{\ell}^{2}}{t \cdot x}\right)} \cdot t
\] |
associate-+l+ [=>]38 | \[ \frac{\sqrt{2}}{\mathsf{fma}\left(t, \sqrt{\color{blue}{2 + \left(2 \cdot \frac{1}{x} + 2 \cdot \frac{1}{x}\right)}}, \sqrt{\frac{1}{2 \cdot \left(1 + \frac{1}{x}\right) + 2 \cdot \frac{1}{x}}} \cdot \frac{{\ell}^{2}}{t \cdot x}\right)} \cdot t
\] |
associate-*r/ [=>]38 | \[ \frac{\sqrt{2}}{\mathsf{fma}\left(t, \sqrt{2 + \left(\color{blue}{\frac{2 \cdot 1}{x}} + 2 \cdot \frac{1}{x}\right)}, \sqrt{\frac{1}{2 \cdot \left(1 + \frac{1}{x}\right) + 2 \cdot \frac{1}{x}}} \cdot \frac{{\ell}^{2}}{t \cdot x}\right)} \cdot t
\] |
metadata-eval [=>]38 | \[ \frac{\sqrt{2}}{\mathsf{fma}\left(t, \sqrt{2 + \left(\frac{\color{blue}{2}}{x} + 2 \cdot \frac{1}{x}\right)}, \sqrt{\frac{1}{2 \cdot \left(1 + \frac{1}{x}\right) + 2 \cdot \frac{1}{x}}} \cdot \frac{{\ell}^{2}}{t \cdot x}\right)} \cdot t
\] |
associate-*r/ [=>]38 | \[ \frac{\sqrt{2}}{\mathsf{fma}\left(t, \sqrt{2 + \left(\frac{2}{x} + \color{blue}{\frac{2 \cdot 1}{x}}\right)}, \sqrt{\frac{1}{2 \cdot \left(1 + \frac{1}{x}\right) + 2 \cdot \frac{1}{x}}} \cdot \frac{{\ell}^{2}}{t \cdot x}\right)} \cdot t
\] |
metadata-eval [=>]38 | \[ \frac{\sqrt{2}}{\mathsf{fma}\left(t, \sqrt{2 + \left(\frac{2}{x} + \frac{\color{blue}{2}}{x}\right)}, \sqrt{\frac{1}{2 \cdot \left(1 + \frac{1}{x}\right) + 2 \cdot \frac{1}{x}}} \cdot \frac{{\ell}^{2}}{t \cdot x}\right)} \cdot t
\] |
Applied egg-rr37.81
if 2.1000000000000001e23 < t Initial program 64.77
Simplified64.72
[Start]64.77 | \[ \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/ [<=]64.72 | \[ \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 [=>]64.72 | \[ \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 [=>]64.72 | \[ \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
\] |
Applied egg-rr64.55
Taylor expanded in t around inf 7.18
Taylor expanded in x around inf 7.78
Simplified7.78
[Start]7.78 | \[ \left(1 + 0.5 \cdot \frac{1}{{x}^{2}}\right) - \frac{1}{x}
\] |
|---|---|
sub-neg [=>]7.78 | \[ \color{blue}{\left(1 + 0.5 \cdot \frac{1}{{x}^{2}}\right) + \left(-\frac{1}{x}\right)}
\] |
associate-+l+ [=>]7.78 | \[ \color{blue}{1 + \left(0.5 \cdot \frac{1}{{x}^{2}} + \left(-\frac{1}{x}\right)\right)}
\] |
sub-neg [<=]7.78 | \[ 1 + \color{blue}{\left(0.5 \cdot \frac{1}{{x}^{2}} - \frac{1}{x}\right)}
\] |
associate-*r/ [=>]7.78 | \[ 1 + \left(\color{blue}{\frac{0.5 \cdot 1}{{x}^{2}}} - \frac{1}{x}\right)
\] |
metadata-eval [=>]7.78 | \[ 1 + \left(\frac{\color{blue}{0.5}}{{x}^{2}} - \frac{1}{x}\right)
\] |
unpow2 [=>]7.78 | \[ 1 + \left(\frac{0.5}{\color{blue}{x \cdot x}} - \frac{1}{x}\right)
\] |
associate-/r* [=>]7.78 | \[ 1 + \left(\color{blue}{\frac{\frac{0.5}{x}}{x}} - \frac{1}{x}\right)
\] |
Final simplification16.41
| Alternative 1 | |
|---|---|
| Error | 17.38% |
| Cost | 69324 |
| Alternative 2 | |
|---|---|
| Error | 17.45% |
| Cost | 54540 |
| Alternative 3 | |
|---|---|
| Error | 17.4% |
| Cost | 34636 |
| Alternative 4 | |
|---|---|
| Error | 17.24% |
| Cost | 27908 |
| Alternative 5 | |
|---|---|
| Error | 17.64% |
| Cost | 15576 |
| Alternative 6 | |
|---|---|
| Error | 17.9% |
| Cost | 15320 |
| Alternative 7 | |
|---|---|
| Error | 22.45% |
| Cost | 13768 |
| Alternative 8 | |
|---|---|
| Error | 22.41% |
| Cost | 13572 |
| Alternative 9 | |
|---|---|
| Error | 22.49% |
| Cost | 13448 |
| Alternative 10 | |
|---|---|
| Error | 22.43% |
| Cost | 7112 |
| Alternative 11 | |
|---|---|
| Error | 21.79% |
| Cost | 7112 |
| Alternative 12 | |
|---|---|
| Error | 21.57% |
| Cost | 7112 |
| Alternative 13 | |
|---|---|
| Error | 22.61% |
| Cost | 6984 |
| Alternative 14 | |
|---|---|
| Error | 22.63% |
| Cost | 6984 |
| Alternative 15 | |
|---|---|
| Error | 23.37% |
| Cost | 1220 |
| Alternative 16 | |
|---|---|
| Error | 23.32% |
| Cost | 1220 |
| Alternative 17 | |
|---|---|
| Error | 23.64% |
| Cost | 836 |
| Alternative 18 | |
|---|---|
| Error | 23.53% |
| Cost | 836 |
| Alternative 19 | |
|---|---|
| Error | 24.09% |
| Cost | 452 |
| Alternative 20 | |
|---|---|
| Error | 23.75% |
| Cost | 452 |
| Alternative 21 | |
|---|---|
| Error | 24.44% |
| Cost | 196 |
| Alternative 22 | |
|---|---|
| Error | 61.49% |
| Cost | 64 |
herbie shell --seed 2023089
(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)))))