| Alternative 1 | |
|---|---|
| Accuracy | 82.6% |
| Cost | 15312 |
(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 (/ l (/ x l))) (t_2 (+ 2.0 (+ (/ 2.0 x) (/ 2.0 x)))))
(if (<= t -1.85e+53)
(+ (+ (/ 1.0 x) (/ -0.5 (* x x))) -1.0)
(if (<= t -3.35e-164)
(/ t (sqrt (/ (+ t_1 (+ (* 2.0 (* t t)) (/ (* l l) x))) 2.0)))
(if (<= t -6.6e-275)
(*
t
(/
(sqrt 2.0)
(- (fma t (sqrt t_2) (* (sqrt (/ 1.0 t_2)) (* (/ l x) (/ l t)))))))
(if (<= t 1.16e+81)
(/
t
(sqrt
(/
(+
t_1
(+
(* 2.0 (+ (* t t) (/ t (/ x t))))
(/ (fma 2.0 (* t t) (* l l)) x)))
2.0)))
(+ 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 = l / (x / l);
double t_2 = 2.0 + ((2.0 / x) + (2.0 / x));
double tmp;
if (t <= -1.85e+53) {
tmp = ((1.0 / x) + (-0.5 / (x * x))) + -1.0;
} else if (t <= -3.35e-164) {
tmp = t / sqrt(((t_1 + ((2.0 * (t * t)) + ((l * l) / x))) / 2.0));
} else if (t <= -6.6e-275) {
tmp = t * (sqrt(2.0) / -fma(t, sqrt(t_2), (sqrt((1.0 / t_2)) * ((l / x) * (l / t)))));
} else if (t <= 1.16e+81) {
tmp = t / sqrt(((t_1 + ((2.0 * ((t * t) + (t / (x / t)))) + (fma(2.0, (t * t), (l * l)) / x))) / 2.0));
} 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 = Float64(l / Float64(x / l)) t_2 = Float64(2.0 + Float64(Float64(2.0 / x) + Float64(2.0 / x))) tmp = 0.0 if (t <= -1.85e+53) tmp = Float64(Float64(Float64(1.0 / x) + Float64(-0.5 / Float64(x * x))) + -1.0); elseif (t <= -3.35e-164) tmp = Float64(t / sqrt(Float64(Float64(t_1 + Float64(Float64(2.0 * Float64(t * t)) + Float64(Float64(l * l) / x))) / 2.0))); elseif (t <= -6.6e-275) tmp = Float64(t * Float64(sqrt(2.0) / Float64(-fma(t, sqrt(t_2), Float64(sqrt(Float64(1.0 / t_2)) * Float64(Float64(l / x) * Float64(l / t))))))); elseif (t <= 1.16e+81) tmp = Float64(t / sqrt(Float64(Float64(t_1 + Float64(Float64(2.0 * Float64(Float64(t * t) + Float64(t / Float64(x / t)))) + Float64(fma(2.0, Float64(t * t), Float64(l * l)) / x))) / 2.0))); else tmp = Float64(1.0 + Float64(Float64(0.5 / Float64(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[(l / N[(x / l), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 + N[(N[(2.0 / x), $MachinePrecision] + N[(2.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.85e+53], N[(N[(N[(1.0 / x), $MachinePrecision] + N[(-0.5 / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision], If[LessEqual[t, -3.35e-164], N[(t / N[Sqrt[N[(N[(t$95$1 + N[(N[(2.0 * N[(t * t), $MachinePrecision]), $MachinePrecision] + N[(N[(l * l), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -6.6e-275], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / (-N[(t * N[Sqrt[t$95$2], $MachinePrecision] + N[(N[Sqrt[N[(1.0 / t$95$2), $MachinePrecision]], $MachinePrecision] * N[(N[(l / x), $MachinePrecision] * N[(l / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision])), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.16e+81], N[(t / N[Sqrt[N[(N[(t$95$1 + N[(N[(2.0 * N[(N[(t * t), $MachinePrecision] + N[(t / N[(x / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(2.0 * N[(t * t), $MachinePrecision] + N[(l * l), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(0.5 / N[(x * x), $MachinePrecision]), $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 := \frac{\ell}{\frac{x}{\ell}}\\
t_2 := 2 + \left(\frac{2}{x} + \frac{2}{x}\right)\\
\mathbf{if}\;t \leq -1.85 \cdot 10^{+53}:\\
\;\;\;\;\left(\frac{1}{x} + \frac{-0.5}{x \cdot x}\right) + -1\\
\mathbf{elif}\;t \leq -3.35 \cdot 10^{-164}:\\
\;\;\;\;\frac{t}{\sqrt{\frac{t_1 + \left(2 \cdot \left(t \cdot t\right) + \frac{\ell \cdot \ell}{x}\right)}{2}}}\\
\mathbf{elif}\;t \leq -6.6 \cdot 10^{-275}:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{-\mathsf{fma}\left(t, \sqrt{t_2}, \sqrt{\frac{1}{t_2}} \cdot \left(\frac{\ell}{x} \cdot \frac{\ell}{t}\right)\right)}\\
\mathbf{elif}\;t \leq 1.16 \cdot 10^{+81}:\\
\;\;\;\;\frac{t}{\sqrt{\frac{t_1 + \left(2 \cdot \left(t \cdot t + \frac{t}{\frac{x}{t}}\right) + \frac{\mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right)}{x}\right)}{2}}}\\
\mathbf{else}:\\
\;\;\;\;1 + \left(\frac{0.5}{x \cdot x} + \frac{-1}{x}\right)\\
\end{array}
if t < -1.85e53Initial program 30.5%
Taylor expanded in t around -inf 93.4%
Simplified93.4%
[Start]93.4 | \[ \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 [=>]93.4 | \[ \frac{\sqrt{2} \cdot t}{\color{blue}{-\left(\sqrt{2} \cdot t\right) \cdot \sqrt{\frac{1 + x}{x - 1}}}}
\] |
*-commutative [<=]93.4 | \[ \frac{\sqrt{2} \cdot t}{-\color{blue}{\left(t \cdot \sqrt{2}\right)} \cdot \sqrt{\frac{1 + x}{x - 1}}}
\] |
sub-neg [=>]93.4 | \[ \frac{\sqrt{2} \cdot t}{-\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{1 + x}{\color{blue}{x + \left(-1\right)}}}}
\] |
metadata-eval [=>]93.4 | \[ \frac{\sqrt{2} \cdot t}{-\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{1 + x}{x + \color{blue}{-1}}}}
\] |
+-commutative [=>]93.4 | \[ \frac{\sqrt{2} \cdot t}{-\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{\color{blue}{x + 1}}{x + -1}}}
\] |
+-commutative [=>]93.4 | \[ \frac{\sqrt{2} \cdot t}{-\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{x + 1}{\color{blue}{-1 + x}}}}
\] |
Taylor expanded in x around inf 92.9%
Simplified92.9%
[Start]92.9 | \[ \frac{1}{x} - \left(1 + 0.5 \cdot \frac{1}{{x}^{2}}\right)
\] |
|---|---|
+-commutative [=>]92.9 | \[ \frac{1}{x} - \color{blue}{\left(0.5 \cdot \frac{1}{{x}^{2}} + 1\right)}
\] |
associate--r+ [=>]92.9 | \[ \color{blue}{\left(\frac{1}{x} - 0.5 \cdot \frac{1}{{x}^{2}}\right) - 1}
\] |
associate-*r/ [=>]92.9 | \[ \left(\frac{1}{x} - \color{blue}{\frac{0.5 \cdot 1}{{x}^{2}}}\right) - 1
\] |
metadata-eval [=>]92.9 | \[ \left(\frac{1}{x} - \frac{\color{blue}{0.5}}{{x}^{2}}\right) - 1
\] |
unpow2 [=>]92.9 | \[ \left(\frac{1}{x} - \frac{0.5}{\color{blue}{x \cdot x}}\right) - 1
\] |
if -1.85e53 < t < -3.35e-164Initial program 54.0%
Simplified54.0%
[Start]54.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/ [<=]54.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 [=>]54.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 [=>]54.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
\] |
Applied egg-rr54.3%
Taylor expanded in x around inf 84.9%
Simplified84.9%
[Start]84.9 | \[ \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 [=>]84.9 | \[ \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+ [=>]84.9 | \[ \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 [=>]84.9 | \[ \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* [=>]84.9 | \[ \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 [=>]84.9 | \[ \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 [=>]84.9 | \[ \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 [=>]84.9 | \[ \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 [=>]84.9 | \[ \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* [=>]84.9 | \[ \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 [=>]84.9 | \[ \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 [=>]84.9 | \[ \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 [=>]84.9 | \[ \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 [=>]84.9 | \[ \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 [=>]84.9 | \[ \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}}}
\] |
Taylor expanded in t around 0 84.3%
Simplified84.3%
[Start]84.3 | \[ \frac{t}{\sqrt{\frac{\frac{\ell}{\frac{x}{\ell}} + \left(2 \cdot \left(t \cdot t + \frac{t}{\frac{x}{t}}\right) + \frac{{\ell}^{2}}{x}\right)}{2}}}
\] |
|---|---|
unpow2 [=>]84.3 | \[ \frac{t}{\sqrt{\frac{\frac{\ell}{\frac{x}{\ell}} + \left(2 \cdot \left(t \cdot t + \frac{t}{\frac{x}{t}}\right) + \frac{\color{blue}{\ell \cdot \ell}}{x}\right)}{2}}}
\] |
Taylor expanded in x around inf 84.2%
Simplified84.2%
[Start]84.2 | \[ \frac{t}{\sqrt{\frac{\frac{\ell}{\frac{x}{\ell}} + \left(2 \cdot {t}^{2} + \frac{\ell \cdot \ell}{x}\right)}{2}}}
\] |
|---|---|
unpow2 [=>]84.2 | \[ \frac{t}{\sqrt{\frac{\frac{\ell}{\frac{x}{\ell}} + \left(2 \cdot \color{blue}{\left(t \cdot t\right)} + \frac{\ell \cdot \ell}{x}\right)}{2}}}
\] |
if -3.35e-164 < t < -6.600000000000001e-275Initial program 2.1%
Simplified2.1%
[Start]2.1 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\frac{x + 1}{x - 1} \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}}
\] |
|---|---|
associate-*l/ [<=]2.1 | \[ \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 [=>]2.1 | \[ \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 [=>]2.1 | \[ \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 48.9%
Simplified48.9%
[Start]48.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+ [=>]48.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 [=>]48.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 [=>]48.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 [=>]48.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 [=>]48.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 [=>]48.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 [=>]48.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 [=>]48.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 [<=]48.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 [=>]48.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 -inf 58.9%
Simplified58.7%
[Start]58.9 | \[ \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 [=>]58.9 | \[ \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 [=>]58.9 | \[ \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 [=>]58.9 | \[ \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 [<=]58.9 | \[ \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 [=>]58.9 | \[ \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 -6.600000000000001e-275 < t < 1.15999999999999994e81Initial program 36.9%
Simplified37.0%
[Start]36.9 | \[ \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/ [<=]37.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 [=>]37.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 [=>]37.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
\] |
Applied egg-rr37.2%
Taylor expanded in x around inf 71.8%
Simplified71.8%
[Start]71.8 | \[ \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 [=>]71.8 | \[ \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+ [=>]71.8 | \[ \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 [=>]71.8 | \[ \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* [=>]71.8 | \[ \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 [=>]71.8 | \[ \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 [=>]71.8 | \[ \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 [=>]71.8 | \[ \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 [=>]71.8 | \[ \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* [=>]71.8 | \[ \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 [=>]71.8 | \[ \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 [=>]71.8 | \[ \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 [=>]71.8 | \[ \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 [=>]71.8 | \[ \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 [=>]71.8 | \[ \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 1.15999999999999994e81 < t Initial program 25.5%
Simplified25.6%
[Start]25.5 | \[ \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/ [<=]25.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 [=>]25.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 [=>]25.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 t around inf 9.2%
Simplified30.9%
[Start]9.2 | \[ \frac{\sqrt{2}}{\sqrt{2 \cdot \frac{\left(1 + x\right) \cdot {t}^{2}}{x - 1}}} \cdot t
\] |
|---|---|
associate-/l* [=>]30.9 | \[ \frac{\sqrt{2}}{\sqrt{2 \cdot \color{blue}{\frac{1 + x}{\frac{x - 1}{{t}^{2}}}}}} \cdot t
\] |
+-commutative [=>]30.9 | \[ \frac{\sqrt{2}}{\sqrt{2 \cdot \frac{\color{blue}{x + 1}}{\frac{x - 1}{{t}^{2}}}}} \cdot t
\] |
sub-neg [=>]30.9 | \[ \frac{\sqrt{2}}{\sqrt{2 \cdot \frac{x + 1}{\frac{\color{blue}{x + \left(-1\right)}}{{t}^{2}}}}} \cdot t
\] |
metadata-eval [=>]30.9 | \[ \frac{\sqrt{2}}{\sqrt{2 \cdot \frac{x + 1}{\frac{x + \color{blue}{-1}}{{t}^{2}}}}} \cdot t
\] |
+-commutative [=>]30.9 | \[ \frac{\sqrt{2}}{\sqrt{2 \cdot \frac{x + 1}{\frac{\color{blue}{-1 + x}}{{t}^{2}}}}} \cdot t
\] |
unpow2 [=>]30.9 | \[ \frac{\sqrt{2}}{\sqrt{2 \cdot \frac{x + 1}{\frac{-1 + x}{\color{blue}{t \cdot t}}}}} \cdot t
\] |
Applied egg-rr94.9%
Simplified95.3%
[Start]94.9 | \[ \left(\left(-\sqrt{2}\right) \cdot \frac{1}{\sqrt{2} \cdot \left(\left(-\sqrt{\frac{x + 1}{x + -1}}\right) \cdot t\right)}\right) \cdot t
\] |
|---|---|
associate-*r/ [=>]95.1 | \[ \color{blue}{\frac{\left(-\sqrt{2}\right) \cdot 1}{\sqrt{2} \cdot \left(\left(-\sqrt{\frac{x + 1}{x + -1}}\right) \cdot t\right)}} \cdot t
\] |
*-rgt-identity [=>]95.1 | \[ \frac{\color{blue}{-\sqrt{2}}}{\sqrt{2} \cdot \left(\left(-\sqrt{\frac{x + 1}{x + -1}}\right) \cdot t\right)} \cdot t
\] |
distribute-neg-frac [<=]95.1 | \[ \color{blue}{\left(-\frac{\sqrt{2}}{\sqrt{2} \cdot \left(\left(-\sqrt{\frac{x + 1}{x + -1}}\right) \cdot t\right)}\right)} \cdot t
\] |
associate-/r* [=>]95.3 | \[ \left(-\color{blue}{\frac{\frac{\sqrt{2}}{\sqrt{2}}}{\left(-\sqrt{\frac{x + 1}{x + -1}}\right) \cdot t}}\right) \cdot t
\] |
distribute-neg-frac [=>]95.3 | \[ \color{blue}{\frac{-\frac{\sqrt{2}}{\sqrt{2}}}{\left(-\sqrt{\frac{x + 1}{x + -1}}\right) \cdot t}} \cdot t
\] |
*-inverses [=>]95.3 | \[ \frac{-\color{blue}{1}}{\left(-\sqrt{\frac{x + 1}{x + -1}}\right) \cdot t} \cdot t
\] |
metadata-eval [=>]95.3 | \[ \frac{\color{blue}{-1}}{\left(-\sqrt{\frac{x + 1}{x + -1}}\right) \cdot t} \cdot t
\] |
distribute-lft-neg-out [=>]95.3 | \[ \frac{-1}{\color{blue}{-\sqrt{\frac{x + 1}{x + -1}} \cdot t}} \cdot t
\] |
distribute-rgt-neg-in [=>]95.3 | \[ \frac{-1}{\color{blue}{\sqrt{\frac{x + 1}{x + -1}} \cdot \left(-t\right)}} \cdot t
\] |
+-commutative [=>]95.3 | \[ \frac{-1}{\sqrt{\frac{x + 1}{\color{blue}{-1 + x}}} \cdot \left(-t\right)} \cdot t
\] |
Taylor expanded in x around inf 95.0%
Simplified95.0%
[Start]95.0 | \[ \left(1 + 0.5 \cdot \frac{1}{{x}^{2}}\right) - \frac{1}{x}
\] |
|---|---|
associate--l+ [=>]95.0 | \[ \color{blue}{1 + \left(0.5 \cdot \frac{1}{{x}^{2}} - \frac{1}{x}\right)}
\] |
associate-*r/ [=>]95.0 | \[ 1 + \left(\color{blue}{\frac{0.5 \cdot 1}{{x}^{2}}} - \frac{1}{x}\right)
\] |
metadata-eval [=>]95.0 | \[ 1 + \left(\frac{\color{blue}{0.5}}{{x}^{2}} - \frac{1}{x}\right)
\] |
unpow2 [=>]95.0 | \[ 1 + \left(\frac{0.5}{\color{blue}{x \cdot x}} - \frac{1}{x}\right)
\] |
Final simplification83.3%
| Alternative 1 | |
|---|---|
| Accuracy | 82.6% |
| Cost | 15312 |
| Alternative 2 | |
|---|---|
| Accuracy | 82.4% |
| Cost | 8656 |
| Alternative 3 | |
|---|---|
| Accuracy | 82.4% |
| Cost | 8272 |
| Alternative 4 | |
|---|---|
| Accuracy | 77.5% |
| Cost | 7176 |
| Alternative 5 | |
|---|---|
| Accuracy | 77.0% |
| Cost | 7048 |
| Alternative 6 | |
|---|---|
| Accuracy | 77.6% |
| Cost | 6984 |
| Alternative 7 | |
|---|---|
| Accuracy | 75.8% |
| Cost | 1224 |
| Alternative 8 | |
|---|---|
| Accuracy | 76.3% |
| Cost | 968 |
| Alternative 9 | |
|---|---|
| Accuracy | 76.5% |
| Cost | 968 |
| Alternative 10 | |
|---|---|
| Accuracy | 76.3% |
| Cost | 840 |
| Alternative 11 | |
|---|---|
| Accuracy | 75.3% |
| Cost | 452 |
| Alternative 12 | |
|---|---|
| Accuracy | 75.6% |
| Cost | 452 |
| Alternative 13 | |
|---|---|
| Accuracy | 74.9% |
| Cost | 196 |
| Alternative 14 | |
|---|---|
| Accuracy | 38.4% |
| Cost | 64 |
herbie shell --seed 2023122
(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)))))