| Alternative 1 | |
|---|---|
| Accuracy | 81.4% |
| Cost | 27908 |
(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 (+ 2.0 (+ (/ 2.0 x) (/ 2.0 x)))) (t_2 (* t (sqrt 2.0))))
(if (<= t -5.8e-218)
(*
t
(/
(sqrt 2.0)
(- (fma t (sqrt t_1) (* (sqrt (/ 1.0 t_1)) (* (/ l x) (/ l t)))))))
(if (<= t 8.5e-233)
(/ t_2 (sqrt (* l (* l (+ (/ 2.0 x) (/ 2.0 (* x x)))))))
(if (<= t 1.2e-186)
(*
(sqrt 2.0)
(/
t
(fma
0.5
(/ (fma 2.0 (* l l) (* (* t t) 4.0)) (* (sqrt 2.0) (* t x)))
t_2)))
(if (<= t 1.6e-42)
(/
t_2
(sqrt
(+
(fma
-1.0
(/ -2.0 (/ (* x x) (* l l)))
(* 2.0 (+ (* t t) (/ t (/ x t)))))
(+ (/ l (/ x l)) (/ (fma 2.0 (* t t) (* l l)) x)))))
(sqrt (/ t (* t (/ (+ x 1.0) (+ x -1.0)))))))))))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 = 2.0 + ((2.0 / x) + (2.0 / x));
double t_2 = t * sqrt(2.0);
double tmp;
if (t <= -5.8e-218) {
tmp = t * (sqrt(2.0) / -fma(t, sqrt(t_1), (sqrt((1.0 / t_1)) * ((l / x) * (l / t)))));
} else if (t <= 8.5e-233) {
tmp = t_2 / sqrt((l * (l * ((2.0 / x) + (2.0 / (x * x))))));
} else if (t <= 1.2e-186) {
tmp = sqrt(2.0) * (t / fma(0.5, (fma(2.0, (l * l), ((t * t) * 4.0)) / (sqrt(2.0) * (t * x))), t_2));
} else if (t <= 1.6e-42) {
tmp = t_2 / sqrt((fma(-1.0, (-2.0 / ((x * x) / (l * l))), (2.0 * ((t * t) + (t / (x / t))))) + ((l / (x / l)) + (fma(2.0, (t * t), (l * l)) / x))));
} else {
tmp = sqrt((t / (t * ((x + 1.0) / (x + -1.0)))));
}
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(2.0 + Float64(Float64(2.0 / x) + Float64(2.0 / x))) t_2 = Float64(t * sqrt(2.0)) tmp = 0.0 if (t <= -5.8e-218) tmp = Float64(t * Float64(sqrt(2.0) / Float64(-fma(t, sqrt(t_1), Float64(sqrt(Float64(1.0 / t_1)) * Float64(Float64(l / x) * Float64(l / t))))))); elseif (t <= 8.5e-233) tmp = Float64(t_2 / sqrt(Float64(l * Float64(l * Float64(Float64(2.0 / x) + Float64(2.0 / Float64(x * x))))))); elseif (t <= 1.2e-186) tmp = Float64(sqrt(2.0) * Float64(t / fma(0.5, Float64(fma(2.0, Float64(l * l), Float64(Float64(t * t) * 4.0)) / Float64(sqrt(2.0) * Float64(t * x))), t_2))); elseif (t <= 1.6e-42) tmp = Float64(t_2 / sqrt(Float64(fma(-1.0, Float64(-2.0 / Float64(Float64(x * x) / Float64(l * l))), Float64(2.0 * Float64(Float64(t * t) + Float64(t / Float64(x / t))))) + Float64(Float64(l / Float64(x / l)) + Float64(fma(2.0, Float64(t * t), Float64(l * l)) / x))))); else tmp = sqrt(Float64(t / Float64(t * Float64(Float64(x + 1.0) / Float64(x + -1.0))))); 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[(N[(2.0 / x), $MachinePrecision] + N[(2.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -5.8e-218], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / (-N[(t * N[Sqrt[t$95$1], $MachinePrecision] + N[(N[Sqrt[N[(1.0 / t$95$1), $MachinePrecision]], $MachinePrecision] * N[(N[(l / x), $MachinePrecision] * N[(l / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision])), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 8.5e-233], N[(t$95$2 / N[Sqrt[N[(l * N[(l * N[(N[(2.0 / x), $MachinePrecision] + N[(2.0 / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.2e-186], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t / N[(0.5 * N[(N[(2.0 * N[(l * l), $MachinePrecision] + N[(N[(t * t), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision] / N[(N[Sqrt[2.0], $MachinePrecision] * N[(t * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.6e-42], N[(t$95$2 / N[Sqrt[N[(N[(-1.0 * N[(-2.0 / N[(N[(x * x), $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[(N[(t * t), $MachinePrecision] + N[(t / N[(x / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(l / N[(x / l), $MachinePrecision]), $MachinePrecision] + N[(N[(2.0 * N[(t * t), $MachinePrecision] + N[(l * l), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(t / N[(t * N[(N[(x + 1.0), $MachinePrecision] / N[(x + -1.0), $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 := 2 + \left(\frac{2}{x} + \frac{2}{x}\right)\\
t_2 := t \cdot \sqrt{2}\\
\mathbf{if}\;t \leq -5.8 \cdot 10^{-218}:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{-\mathsf{fma}\left(t, \sqrt{t_1}, \sqrt{\frac{1}{t_1}} \cdot \left(\frac{\ell}{x} \cdot \frac{\ell}{t}\right)\right)}\\
\mathbf{elif}\;t \leq 8.5 \cdot 10^{-233}:\\
\;\;\;\;\frac{t_2}{\sqrt{\ell \cdot \left(\ell \cdot \left(\frac{2}{x} + \frac{2}{x \cdot x}\right)\right)}}\\
\mathbf{elif}\;t \leq 1.2 \cdot 10^{-186}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t}{\mathsf{fma}\left(0.5, \frac{\mathsf{fma}\left(2, \ell \cdot \ell, \left(t \cdot t\right) \cdot 4\right)}{\sqrt{2} \cdot \left(t \cdot x\right)}, t_2\right)}\\
\mathbf{elif}\;t \leq 1.6 \cdot 10^{-42}:\\
\;\;\;\;\frac{t_2}{\sqrt{\mathsf{fma}\left(-1, \frac{-2}{\frac{x \cdot x}{\ell \cdot \ell}}, 2 \cdot \left(t \cdot t + \frac{t}{\frac{x}{t}}\right)\right) + \left(\frac{\ell}{\frac{x}{\ell}} + \frac{\mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right)}{x}\right)}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{t}{t \cdot \frac{x + 1}{x + -1}}}\\
\end{array}
if t < -5.8000000000000004e-218Initial program 36.0%
Simplified36.0%
[Start]36.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-*l/ [<=]36.0 | \[ \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 [=>]36.0 | \[ \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 [=>]36.0 | \[ \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 51.4%
Simplified51.4%
[Start]51.4 | \[ \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+ [=>]51.4 | \[ \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 [=>]51.4 | \[ \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 [=>]51.4 | \[ \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 [=>]51.4 | \[ \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 [=>]51.4 | \[ \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 [=>]51.4 | \[ \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 [=>]51.4 | \[ \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 [=>]51.4 | \[ \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 [<=]51.4 | \[ \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 [=>]51.4 | \[ \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 74.2%
Simplified83.5%
[Start]74.2 | \[ \frac{\sqrt{2}}{-1 \cdot \left(\frac{{\ell}^{2}}{t \cdot x} \cdot \sqrt{\frac{1}{2 \cdot \left(1 + \frac{1}{x}\right) + 2 \cdot \frac{1}{x}}}\right) + -1 \cdot \left(t \cdot \sqrt{2 \cdot \left(1 + \frac{1}{x}\right) + 2 \cdot \frac{1}{x}}\right)} \cdot t
\] |
|---|---|
*-commutative [=>]74.2 | \[ \frac{\sqrt{2}}{-1 \cdot \color{blue}{\left(\sqrt{\frac{1}{2 \cdot \left(1 + \frac{1}{x}\right) + 2 \cdot \frac{1}{x}}} \cdot \frac{{\ell}^{2}}{t \cdot x}\right)} + -1 \cdot \left(t \cdot \sqrt{2 \cdot \left(1 + \frac{1}{x}\right) + 2 \cdot \frac{1}{x}}\right)} \cdot t
\] |
*-commutative [=>]74.2 | \[ \frac{\sqrt{2}}{-1 \cdot \left(\sqrt{\frac{1}{2 \cdot \left(1 + \frac{1}{x}\right) + 2 \cdot \frac{1}{x}}} \cdot \frac{{\ell}^{2}}{t \cdot x}\right) + -1 \cdot \color{blue}{\left(\sqrt{2 \cdot \left(1 + \frac{1}{x}\right) + 2 \cdot \frac{1}{x}} \cdot t\right)}} \cdot t
\] |
distribute-lft-out [=>]74.2 | \[ \frac{\sqrt{2}}{\color{blue}{-1 \cdot \left(\sqrt{\frac{1}{2 \cdot \left(1 + \frac{1}{x}\right) + 2 \cdot \frac{1}{x}}} \cdot \frac{{\ell}^{2}}{t \cdot x} + \sqrt{2 \cdot \left(1 + \frac{1}{x}\right) + 2 \cdot \frac{1}{x}} \cdot t\right)}} \cdot t
\] |
+-commutative [<=]74.2 | \[ \frac{\sqrt{2}}{-1 \cdot \color{blue}{\left(\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}\right)}} \cdot t
\] |
mul-1-neg [=>]74.2 | \[ \frac{\sqrt{2}}{\color{blue}{-\left(\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}\right)}} \cdot t
\] |
if -5.8000000000000004e-218 < t < 8.5000000000000005e-233Initial program 2.7%
Taylor expanded in x around -inf 44.2%
Simplified44.2%
[Start]44.2 | \[ \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}}}
\] |
|---|---|
+-commutative [=>]44.2 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\color{blue}{\left(\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) + \frac{{\ell}^{2}}{x}\right)} - -1 \cdot \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x}}}
\] |
associate--l+ [=>]44.2 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\color{blue}{\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) + \left(\frac{{\ell}^{2}}{x} - -1 \cdot \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x}\right)}}}
\] |
Taylor expanded in l around inf 53.7%
Simplified54.6%
[Start]53.7 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\left(2 \cdot \frac{1}{{x}^{2}} + 2 \cdot \frac{1}{x}\right) \cdot {\ell}^{2}}}
\] |
|---|---|
*-commutative [=>]53.7 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\color{blue}{{\ell}^{2} \cdot \left(2 \cdot \frac{1}{{x}^{2}} + 2 \cdot \frac{1}{x}\right)}}}
\] |
unpow2 [=>]53.7 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\color{blue}{\left(\ell \cdot \ell\right)} \cdot \left(2 \cdot \frac{1}{{x}^{2}} + 2 \cdot \frac{1}{x}\right)}}
\] |
associate-*l* [=>]54.6 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\color{blue}{\ell \cdot \left(\ell \cdot \left(2 \cdot \frac{1}{{x}^{2}} + 2 \cdot \frac{1}{x}\right)\right)}}}
\] |
+-commutative [=>]54.6 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\ell \cdot \left(\ell \cdot \color{blue}{\left(2 \cdot \frac{1}{x} + 2 \cdot \frac{1}{{x}^{2}}\right)}\right)}}
\] |
associate-*r/ [=>]54.6 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\ell \cdot \left(\ell \cdot \left(\color{blue}{\frac{2 \cdot 1}{x}} + 2 \cdot \frac{1}{{x}^{2}}\right)\right)}}
\] |
metadata-eval [=>]54.6 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\ell \cdot \left(\ell \cdot \left(\frac{\color{blue}{2}}{x} + 2 \cdot \frac{1}{{x}^{2}}\right)\right)}}
\] |
associate-*r/ [=>]54.6 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\ell \cdot \left(\ell \cdot \left(\frac{2}{x} + \color{blue}{\frac{2 \cdot 1}{{x}^{2}}}\right)\right)}}
\] |
metadata-eval [=>]54.6 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\ell \cdot \left(\ell \cdot \left(\frac{2}{x} + \frac{\color{blue}{2}}{{x}^{2}}\right)\right)}}
\] |
unpow2 [=>]54.6 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\ell \cdot \left(\ell \cdot \left(\frac{2}{x} + \frac{2}{\color{blue}{x \cdot x}}\right)\right)}}
\] |
if 8.5000000000000005e-233 < t < 1.20000000000000002e-186Initial program 0.0%
Simplified1.4%
[Start]0.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/ [<=]0.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/ [=>]0.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/ [<=]0.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 [<=]0.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* [<=]0.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 [<=]0.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* [=>]0.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 [<=]0.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 [=>]1.4 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{\color{blue}{\mathsf{fma}\left(x + 1, 1 \cdot \frac{\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)}{x - 1}, -\ell \cdot \ell\right)}}}
\] |
Taylor expanded in x around inf 57.2%
Simplified57.2%
[Start]57.2 | \[ \sqrt{2} \cdot \frac{t}{0.5 \cdot \frac{2 \cdot {\ell}^{2} + 4 \cdot {t}^{2}}{\sqrt{2} \cdot \left(t \cdot x\right)} + \sqrt{2} \cdot t}
\] |
|---|---|
fma-def [=>]57.2 | \[ \sqrt{2} \cdot \frac{t}{\color{blue}{\mathsf{fma}\left(0.5, \frac{2 \cdot {\ell}^{2} + 4 \cdot {t}^{2}}{\sqrt{2} \cdot \left(t \cdot x\right)}, \sqrt{2} \cdot t\right)}}
\] |
unpow2 [=>]57.2 | \[ \sqrt{2} \cdot \frac{t}{\mathsf{fma}\left(0.5, \frac{2 \cdot \color{blue}{\left(\ell \cdot \ell\right)} + 4 \cdot {t}^{2}}{\sqrt{2} \cdot \left(t \cdot x\right)}, \sqrt{2} \cdot t\right)}
\] |
fma-def [=>]57.2 | \[ \sqrt{2} \cdot \frac{t}{\mathsf{fma}\left(0.5, \frac{\color{blue}{\mathsf{fma}\left(2, \ell \cdot \ell, 4 \cdot {t}^{2}\right)}}{\sqrt{2} \cdot \left(t \cdot x\right)}, \sqrt{2} \cdot t\right)}
\] |
*-commutative [=>]57.2 | \[ \sqrt{2} \cdot \frac{t}{\mathsf{fma}\left(0.5, \frac{\mathsf{fma}\left(2, \ell \cdot \ell, \color{blue}{{t}^{2} \cdot 4}\right)}{\sqrt{2} \cdot \left(t \cdot x\right)}, \sqrt{2} \cdot t\right)}
\] |
unpow2 [=>]57.2 | \[ \sqrt{2} \cdot \frac{t}{\mathsf{fma}\left(0.5, \frac{\mathsf{fma}\left(2, \ell \cdot \ell, \color{blue}{\left(t \cdot t\right)} \cdot 4\right)}{\sqrt{2} \cdot \left(t \cdot x\right)}, \sqrt{2} \cdot t\right)}
\] |
*-commutative [=>]57.2 | \[ \sqrt{2} \cdot \frac{t}{\mathsf{fma}\left(0.5, \frac{\mathsf{fma}\left(2, \ell \cdot \ell, \left(t \cdot t\right) \cdot 4\right)}{\sqrt{2} \cdot \left(t \cdot x\right)}, \color{blue}{t \cdot \sqrt{2}}\right)}
\] |
if 1.20000000000000002e-186 < t < 1.60000000000000012e-42Initial program 39.6%
Taylor expanded in x around -inf 76.9%
Simplified76.8%
[Start]76.9 | \[ \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}}}
\] |
|---|---|
+-commutative [=>]76.9 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\color{blue}{\left(\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) + \frac{{\ell}^{2}}{x}\right)} - -1 \cdot \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x}}}
\] |
associate--l+ [=>]76.9 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\color{blue}{\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) + \left(\frac{{\ell}^{2}}{x} - -1 \cdot \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x}\right)}}}
\] |
Taylor expanded in t around 0 76.8%
Simplified76.8%
[Start]76.8 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\mathsf{fma}\left(-1, -2 \cdot \frac{{\ell}^{2}}{{x}^{2}}, 2 \cdot \left(t \cdot t + \frac{t}{\frac{x}{t}}\right)\right) + \left(\frac{\ell}{\frac{x}{\ell}} - \frac{-\mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right)}{x}\right)}}
\] |
|---|---|
associate-*r/ [=>]76.7 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\mathsf{fma}\left(-1, \color{blue}{\frac{-2 \cdot {\ell}^{2}}{{x}^{2}}}, 2 \cdot \left(t \cdot t + \frac{t}{\frac{x}{t}}\right)\right) + \left(\frac{\ell}{\frac{x}{\ell}} - \frac{-\mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right)}{x}\right)}}
\] |
associate-/l* [=>]76.8 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\mathsf{fma}\left(-1, \color{blue}{\frac{-2}{\frac{{x}^{2}}{{\ell}^{2}}}}, 2 \cdot \left(t \cdot t + \frac{t}{\frac{x}{t}}\right)\right) + \left(\frac{\ell}{\frac{x}{\ell}} - \frac{-\mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right)}{x}\right)}}
\] |
unpow2 [=>]76.8 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\mathsf{fma}\left(-1, \frac{-2}{\frac{\color{blue}{x \cdot x}}{{\ell}^{2}}}, 2 \cdot \left(t \cdot t + \frac{t}{\frac{x}{t}}\right)\right) + \left(\frac{\ell}{\frac{x}{\ell}} - \frac{-\mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right)}{x}\right)}}
\] |
unpow2 [=>]76.8 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\mathsf{fma}\left(-1, \frac{-2}{\frac{x \cdot x}{\color{blue}{\ell \cdot \ell}}}, 2 \cdot \left(t \cdot t + \frac{t}{\frac{x}{t}}\right)\right) + \left(\frac{\ell}{\frac{x}{\ell}} - \frac{-\mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right)}{x}\right)}}
\] |
if 1.60000000000000012e-42 < t Initial program 37.7%
Taylor expanded in t around -inf 1.6%
Simplified1.6%
[Start]1.6 | \[ \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 [=>]1.6 | \[ \frac{\sqrt{2} \cdot t}{\color{blue}{-\left(\sqrt{2} \cdot t\right) \cdot \sqrt{\frac{1 + x}{x - 1}}}}
\] |
associate-*l* [=>]1.6 | \[ \frac{\sqrt{2} \cdot t}{-\color{blue}{\sqrt{2} \cdot \left(t \cdot \sqrt{\frac{1 + x}{x - 1}}\right)}}
\] |
sub-neg [=>]1.6 | \[ \frac{\sqrt{2} \cdot t}{-\sqrt{2} \cdot \left(t \cdot \sqrt{\frac{1 + x}{\color{blue}{x + \left(-1\right)}}}\right)}
\] |
metadata-eval [=>]1.6 | \[ \frac{\sqrt{2} \cdot t}{-\sqrt{2} \cdot \left(t \cdot \sqrt{\frac{1 + x}{x + \color{blue}{-1}}}\right)}
\] |
+-commutative [=>]1.6 | \[ \frac{\sqrt{2} \cdot t}{-\sqrt{2} \cdot \left(t \cdot \sqrt{\frac{\color{blue}{x + 1}}{x + -1}}\right)}
\] |
+-commutative [=>]1.6 | \[ \frac{\sqrt{2} \cdot t}{-\sqrt{2} \cdot \left(t \cdot \sqrt{\frac{x + 1}{\color{blue}{-1 + x}}}\right)}
\] |
Applied egg-rr44.0%
[Start]1.6 | \[ \frac{\sqrt{2} \cdot t}{-\sqrt{2} \cdot \left(t \cdot \sqrt{\frac{x + 1}{-1 + x}}\right)}
\] |
|---|---|
add-sqr-sqrt [=>]0.0 | \[ \color{blue}{\sqrt{\frac{\sqrt{2} \cdot t}{-\sqrt{2} \cdot \left(t \cdot \sqrt{\frac{x + 1}{-1 + x}}\right)}} \cdot \sqrt{\frac{\sqrt{2} \cdot t}{-\sqrt{2} \cdot \left(t \cdot \sqrt{\frac{x + 1}{-1 + x}}\right)}}}
\] |
sqrt-unprod [=>]90.3 | \[ \color{blue}{\sqrt{\frac{\sqrt{2} \cdot t}{-\sqrt{2} \cdot \left(t \cdot \sqrt{\frac{x + 1}{-1 + x}}\right)} \cdot \frac{\sqrt{2} \cdot t}{-\sqrt{2} \cdot \left(t \cdot \sqrt{\frac{x + 1}{-1 + x}}\right)}}}
\] |
frac-times [=>]44.0 | \[ \sqrt{\color{blue}{\frac{\left(\sqrt{2} \cdot t\right) \cdot \left(\sqrt{2} \cdot t\right)}{\left(-\sqrt{2} \cdot \left(t \cdot \sqrt{\frac{x + 1}{-1 + x}}\right)\right) \cdot \left(-\sqrt{2} \cdot \left(t \cdot \sqrt{\frac{x + 1}{-1 + x}}\right)\right)}}}
\] |
swap-sqr [=>]43.9 | \[ \sqrt{\frac{\color{blue}{\left(\sqrt{2} \cdot \sqrt{2}\right) \cdot \left(t \cdot t\right)}}{\left(-\sqrt{2} \cdot \left(t \cdot \sqrt{\frac{x + 1}{-1 + x}}\right)\right) \cdot \left(-\sqrt{2} \cdot \left(t \cdot \sqrt{\frac{x + 1}{-1 + x}}\right)\right)}}
\] |
add-sqr-sqrt [<=]43.5 | \[ \sqrt{\frac{\color{blue}{2} \cdot \left(t \cdot t\right)}{\left(-\sqrt{2} \cdot \left(t \cdot \sqrt{\frac{x + 1}{-1 + x}}\right)\right) \cdot \left(-\sqrt{2} \cdot \left(t \cdot \sqrt{\frac{x + 1}{-1 + x}}\right)\right)}}
\] |
sqr-neg [=>]43.5 | \[ \sqrt{\frac{2 \cdot \left(t \cdot t\right)}{\color{blue}{\left(\sqrt{2} \cdot \left(t \cdot \sqrt{\frac{x + 1}{-1 + x}}\right)\right) \cdot \left(\sqrt{2} \cdot \left(t \cdot \sqrt{\frac{x + 1}{-1 + x}}\right)\right)}}}
\] |
swap-sqr [=>]43.3 | \[ \sqrt{\frac{2 \cdot \left(t \cdot t\right)}{\color{blue}{\left(\sqrt{2} \cdot \sqrt{2}\right) \cdot \left(\left(t \cdot \sqrt{\frac{x + 1}{-1 + x}}\right) \cdot \left(t \cdot \sqrt{\frac{x + 1}{-1 + x}}\right)\right)}}}
\] |
add-sqr-sqrt [<=]44.0 | \[ \sqrt{\frac{2 \cdot \left(t \cdot t\right)}{\color{blue}{2} \cdot \left(\left(t \cdot \sqrt{\frac{x + 1}{-1 + x}}\right) \cdot \left(t \cdot \sqrt{\frac{x + 1}{-1 + x}}\right)\right)}}
\] |
Simplified90.3%
[Start]44.0 | \[ \sqrt{\frac{2 \cdot \left(t \cdot t\right)}{2 \cdot \left(\frac{x + 1}{x + -1} \cdot \left(t \cdot t\right)\right)}}
\] |
|---|---|
times-frac [=>]44.0 | \[ \sqrt{\color{blue}{\frac{2}{2} \cdot \frac{t \cdot t}{\frac{x + 1}{x + -1} \cdot \left(t \cdot t\right)}}}
\] |
metadata-eval [=>]44.0 | \[ \sqrt{\color{blue}{1} \cdot \frac{t \cdot t}{\frac{x + 1}{x + -1} \cdot \left(t \cdot t\right)}}
\] |
*-lft-identity [=>]44.0 | \[ \sqrt{\color{blue}{\frac{t \cdot t}{\frac{x + 1}{x + -1} \cdot \left(t \cdot t\right)}}}
\] |
associate-*r* [=>]44.0 | \[ \sqrt{\frac{t \cdot t}{\color{blue}{\left(\frac{x + 1}{x + -1} \cdot t\right) \cdot t}}}
\] |
times-frac [=>]90.3 | \[ \sqrt{\color{blue}{\frac{t}{\frac{x + 1}{x + -1} \cdot t} \cdot \frac{t}{t}}}
\] |
*-commutative [=>]90.3 | \[ \sqrt{\frac{t}{\color{blue}{t \cdot \frac{x + 1}{x + -1}}} \cdot \frac{t}{t}}
\] |
+-commutative [=>]90.3 | \[ \sqrt{\frac{t}{t \cdot \frac{\color{blue}{1 + x}}{x + -1}} \cdot \frac{t}{t}}
\] |
*-inverses [=>]90.3 | \[ \sqrt{\frac{t}{t \cdot \frac{1 + x}{x + -1}} \cdot \color{blue}{1}}
\] |
Final simplification81.5%
| Alternative 1 | |
|---|---|
| Accuracy | 81.4% |
| Cost | 27908 |
| Alternative 2 | |
|---|---|
| Accuracy | 80.3% |
| Cost | 21448 |
| Alternative 3 | |
|---|---|
| Accuracy | 80.3% |
| Cost | 20680 |
| Alternative 4 | |
|---|---|
| Accuracy | 80.7% |
| Cost | 14792 |
| Alternative 5 | |
|---|---|
| Accuracy | 79.0% |
| Cost | 14152 |
| Alternative 6 | |
|---|---|
| Accuracy | 78.9% |
| Cost | 7368 |
| Alternative 7 | |
|---|---|
| Accuracy | 78.8% |
| Cost | 7240 |
| Alternative 8 | |
|---|---|
| Accuracy | 78.3% |
| Cost | 7112 |
| Alternative 9 | |
|---|---|
| Accuracy | 77.4% |
| Cost | 7048 |
| Alternative 10 | |
|---|---|
| Accuracy | 77.7% |
| Cost | 6984 |
| Alternative 11 | |
|---|---|
| Accuracy | 78.1% |
| Cost | 6984 |
| Alternative 12 | |
|---|---|
| Accuracy | 76.0% |
| Cost | 836 |
| Alternative 13 | |
|---|---|
| Accuracy | 75.9% |
| Cost | 452 |
| Alternative 14 | |
|---|---|
| Accuracy | 75.6% |
| Cost | 196 |
| Alternative 15 | |
|---|---|
| Accuracy | 38.5% |
| Cost | 64 |
herbie shell --seed 2023138
(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)))))