Average Error: 42.9 → 9.1
Time: 25.9s
Precision: binary64
Cost: 28805
\[\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}
\mathbf{if}\;t \leq -1.2351728058409963 \cdot 10^{-41}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{-t \cdot \sqrt{\frac{2}{x - 1} + 2 \cdot \frac{x}{x - 1}}}\\
\mathbf{elif}\;t \leq -1.5844530436624705 \cdot 10^{-154}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{4 \cdot \frac{t \cdot t}{x} + 2 \cdot \left(t \cdot t + \frac{\ell}{\frac{x}{\ell}}\right)}}\\
\mathbf{elif}\;t \leq -4.222777320075483 \cdot 10^{-236}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{\left(-t \cdot \sqrt{2 + \frac{4}{x}}\right) - \sqrt{\frac{1}{2 + \frac{4}{x}}} \cdot \frac{\ell \cdot \ell}{t \cdot x}}\\
\mathbf{elif}\;t \leq 1.673826578300523 \cdot 10^{-305}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{\frac{1}{x}} \cdot \left(\sqrt{2} \cdot \ell\right)}\\
\mathbf{elif}\;t \leq 3.385594735519463 \cdot 10^{-144}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{t \cdot \sqrt{2} + \left(2 \cdot \frac{t}{\sqrt{2} \cdot x} + \frac{\ell \cdot \ell}{\left(t \cdot \sqrt{2}\right) \cdot x}\right)}\\
\mathbf{elif}\;t \leq 2.2674113060888642 \cdot 10^{+126}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{\left(4 \cdot \frac{t \cdot t}{x} + 2 \cdot \left(t \cdot t\right)\right) + 2 \cdot \left(\ell \cdot \frac{\ell}{x}\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{t \cdot \sqrt{\frac{2}{x - 1} + 2 \cdot \frac{x}{x - 1}}}\\
\end{array}\]
\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}
\mathbf{if}\;t \leq -1.2351728058409963 \cdot 10^{-41}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{-t \cdot \sqrt{\frac{2}{x - 1} + 2 \cdot \frac{x}{x - 1}}}\\
\mathbf{elif}\;t \leq -1.5844530436624705 \cdot 10^{-154}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{4 \cdot \frac{t \cdot t}{x} + 2 \cdot \left(t \cdot t + \frac{\ell}{\frac{x}{\ell}}\right)}}\\
\mathbf{elif}\;t \leq -4.222777320075483 \cdot 10^{-236}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{\left(-t \cdot \sqrt{2 + \frac{4}{x}}\right) - \sqrt{\frac{1}{2 + \frac{4}{x}}} \cdot \frac{\ell \cdot \ell}{t \cdot x}}\\
\mathbf{elif}\;t \leq 1.673826578300523 \cdot 10^{-305}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{\frac{1}{x}} \cdot \left(\sqrt{2} \cdot \ell\right)}\\
\mathbf{elif}\;t \leq 3.385594735519463 \cdot 10^{-144}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{t \cdot \sqrt{2} + \left(2 \cdot \frac{t}{\sqrt{2} \cdot x} + \frac{\ell \cdot \ell}{\left(t \cdot \sqrt{2}\right) \cdot x}\right)}\\
\mathbf{elif}\;t \leq 2.2674113060888642 \cdot 10^{+126}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{\left(4 \cdot \frac{t \cdot t}{x} + 2 \cdot \left(t \cdot t\right)\right) + 2 \cdot \left(\ell \cdot \frac{\ell}{x}\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{t \cdot \sqrt{\frac{2}{x - 1} + 2 \cdot \frac{x}{x - 1}}}\\
\end{array}(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
(if (<= t -1.2351728058409963e-41)
(/
(* t (sqrt 2.0))
(- (* t (sqrt (+ (/ 2.0 (- x 1.0)) (* 2.0 (/ x (- x 1.0))))))))
(if (<= t -1.5844530436624705e-154)
(/
(* t (sqrt 2.0))
(sqrt (+ (* 4.0 (/ (* t t) x)) (* 2.0 (+ (* t t) (/ l (/ x l)))))))
(if (<= t -4.222777320075483e-236)
(/
(* t (sqrt 2.0))
(-
(- (* t (sqrt (+ 2.0 (/ 4.0 x)))))
(* (sqrt (/ 1.0 (+ 2.0 (/ 4.0 x)))) (/ (* l l) (* t x)))))
(if (<= t 1.673826578300523e-305)
(/ (* t (sqrt 2.0)) (* (sqrt (/ 1.0 x)) (* (sqrt 2.0) l)))
(if (<= t 3.385594735519463e-144)
(/
(* t (sqrt 2.0))
(+
(* t (sqrt 2.0))
(+
(* 2.0 (/ t (* (sqrt 2.0) x)))
(/ (* l l) (* (* t (sqrt 2.0)) x)))))
(if (<= t 2.2674113060888642e+126)
(/
(* t (sqrt 2.0))
(sqrt
(+
(+ (* 4.0 (/ (* t t) x)) (* 2.0 (* t t)))
(* 2.0 (* l (/ l x))))))
(/
(* t (sqrt 2.0))
(*
t
(sqrt (+ (/ 2.0 (- x 1.0)) (* 2.0 (/ x (- 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 tmp;
if (t <= -1.2351728058409963e-41) {
tmp = (t * sqrt(2.0)) / -(t * sqrt((2.0 / (x - 1.0)) + (2.0 * (x / (x - 1.0)))));
} else if (t <= -1.5844530436624705e-154) {
tmp = (t * sqrt(2.0)) / sqrt((4.0 * ((t * t) / x)) + (2.0 * ((t * t) + (l / (x / l)))));
} else if (t <= -4.222777320075483e-236) {
tmp = (t * sqrt(2.0)) / (-(t * sqrt(2.0 + (4.0 / x))) - (sqrt(1.0 / (2.0 + (4.0 / x))) * ((l * l) / (t * x))));
} else if (t <= 1.673826578300523e-305) {
tmp = (t * sqrt(2.0)) / (sqrt(1.0 / x) * (sqrt(2.0) * l));
} else if (t <= 3.385594735519463e-144) {
tmp = (t * sqrt(2.0)) / ((t * sqrt(2.0)) + ((2.0 * (t / (sqrt(2.0) * x))) + ((l * l) / ((t * sqrt(2.0)) * x))));
} else if (t <= 2.2674113060888642e+126) {
tmp = (t * sqrt(2.0)) / sqrt(((4.0 * ((t * t) / x)) + (2.0 * (t * t))) + (2.0 * (l * (l / x))));
} else {
tmp = (t * sqrt(2.0)) / (t * sqrt((2.0 / (x - 1.0)) + (2.0 * (x / (x - 1.0)))));
}
return tmp;
}
Try it out
Enter valid numbers for all inputs
Alternatives
| Alternative 1 |
|---|
| Error | 10.2 |
|---|
| Cost | 21955 |
|---|
\[\begin{array}{l}
\mathbf{if}\;t \leq -1.2351728058409963 \cdot 10^{-41}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{-t \cdot \sqrt{\frac{2}{x - 1} + 2 \cdot \frac{x}{x - 1}}}\\
\mathbf{elif}\;t \leq -1.5844530436624705 \cdot 10^{-154}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{4 \cdot \frac{t \cdot t}{x} + 2 \cdot \left(t \cdot t + \frac{\ell}{\frac{x}{\ell}}\right)}}\\
\mathbf{elif}\;t \leq -4.222777320075483 \cdot 10^{-236}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{\left(-t \cdot \sqrt{2 + \frac{4}{x}}\right) - \sqrt{\frac{1}{2 + \frac{4}{x}}} \cdot \frac{\ell \cdot \ell}{t \cdot x}}\\
\mathbf{elif}\;t \leq 4.901623676390601 \cdot 10^{-185}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{\frac{1}{x}} \cdot \left(\sqrt{2} \cdot \ell\right)}\\
\mathbf{elif}\;t \leq 3.385594735519463 \cdot 10^{-144}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{t \cdot \sqrt{2 + \frac{4}{x}}}\\
\mathbf{elif}\;t \leq 9.671127833094812 \cdot 10^{+125}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{\left(4 \cdot \frac{t \cdot t}{x} + 2 \cdot \left(t \cdot t\right)\right) + 2 \cdot \left(\ell \cdot \frac{\ell}{x}\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{t \cdot \sqrt{\frac{2}{x - 1} + 2 \cdot \frac{x}{x - 1}}}\\
\end{array}\]
| Alternative 2 |
|---|
| Error | 10.6 |
|---|
| Cost | 21188 |
|---|
\[\begin{array}{l}
\mathbf{if}\;t \leq -1.2351728058409963 \cdot 10^{-41}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{-t \cdot \sqrt{\frac{2}{x - 1} + 2 \cdot \frac{x}{x - 1}}}\\
\mathbf{elif}\;t \leq -1.908450893682963 \cdot 10^{-175}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{4 \cdot \frac{t \cdot t}{x} + 2 \cdot \left(t \cdot t + \frac{\ell}{\frac{x}{\ell}}\right)}}\\
\mathbf{elif}\;t \leq -4.222777320075483 \cdot 10^{-236}:\\
\;\;\;\;-1\\
\mathbf{elif}\;t \leq 4.901623676390601 \cdot 10^{-185}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{\frac{1}{x}} \cdot \left(\sqrt{2} \cdot \ell\right)}\\
\mathbf{elif}\;t \leq 3.385594735519463 \cdot 10^{-144}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{t \cdot \sqrt{2 + \frac{4}{x}}}\\
\mathbf{elif}\;t \leq 2.2674113060888642 \cdot 10^{+126}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{\left(4 \cdot \frac{t \cdot t}{x} + 2 \cdot \left(t \cdot t\right)\right) + 2 \cdot \left(\ell \cdot \frac{\ell}{x}\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{t \cdot \sqrt{\frac{2}{x - 1} + 2 \cdot \frac{x}{x - 1}}}\\
\end{array}\]
| Alternative 3 |
|---|
| Error | 9.9 |
|---|
| Cost | 15684 |
|---|
\[\begin{array}{l}
\mathbf{if}\;t \leq -1.2351728058409963 \cdot 10^{-41}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{-t \cdot \sqrt{\frac{2}{x - 1} + 2 \cdot \frac{x}{x - 1}}}\\
\mathbf{elif}\;t \leq -1.908450893682963 \cdot 10^{-175}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{4 \cdot \frac{t \cdot t}{x} + 2 \cdot \left(t \cdot t + \frac{\ell}{\frac{x}{\ell}}\right)}}\\
\mathbf{elif}\;t \leq -4.222777320075483 \cdot 10^{-236}:\\
\;\;\;\;-1\\
\mathbf{elif}\;t \leq 3.2861889216797514 \cdot 10^{+126}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{\left(4 \cdot \frac{t \cdot t}{x} + 2 \cdot \left(t \cdot t\right)\right) + 2 \cdot \left(\ell \cdot \frac{\ell}{x}\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{t \cdot \sqrt{\frac{2}{x - 1} + 2 \cdot \frac{x}{x - 1}}}\\
\end{array}\]
| Alternative 4 |
|---|
| Error | 9.9 |
|---|
| Cost | 15556 |
|---|
\[\begin{array}{l}
\mathbf{if}\;t \leq -1.2351728058409963 \cdot 10^{-41}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{-t \cdot \sqrt{\frac{2}{x - 1} + 2 \cdot \frac{x}{x - 1}}}\\
\mathbf{elif}\;t \leq -1.908450893682963 \cdot 10^{-175}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{4 \cdot \frac{t \cdot t}{x} + 2 \cdot \left(t \cdot t + \frac{\ell}{\frac{x}{\ell}}\right)}}\\
\mathbf{elif}\;t \leq -4.222777320075483 \cdot 10^{-236}:\\
\;\;\;\;-1\\
\mathbf{elif}\;t \leq 2.221815944911774 \cdot 10^{+126}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{4 \cdot \frac{t \cdot t}{x} + 2 \cdot \left(t \cdot t + \frac{\ell}{\frac{x}{\ell}}\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{t \cdot \sqrt{\frac{2}{x - 1} + 2 \cdot \frac{x}{x - 1}}}\\
\end{array}\]
| Alternative 5 |
|---|
| Error | 11.8 |
|---|
| Cost | 15428 |
|---|
\[\begin{array}{l}
\mathbf{if}\;t \leq -1.2351728058409963 \cdot 10^{-41}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{-t \cdot \sqrt{\frac{2}{x - 1} + 2 \cdot \frac{x}{x - 1}}}\\
\mathbf{elif}\;t \leq -1.908450893682963 \cdot 10^{-175}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{2 \cdot \left(t \cdot t\right) + 2 \cdot \frac{\ell \cdot \ell}{x}}}\\
\mathbf{elif}\;t \leq -4.222777320075483 \cdot 10^{-236}:\\
\;\;\;\;-1\\
\mathbf{elif}\;t \leq 1148938624868404.5:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{2 \cdot \frac{\ell \cdot \ell}{x} + \left(t \cdot t\right) \cdot \left(2 + \frac{4}{x}\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{t \cdot \sqrt{\frac{2}{x - 1} + 2 \cdot \frac{x}{x - 1}}}\\
\end{array}\]
| Alternative 6 |
|---|
| Error | 12.1 |
|---|
| Cost | 15300 |
|---|
\[\begin{array}{l}
\mathbf{if}\;t \leq -1.2351728058409963 \cdot 10^{-41}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{-t \cdot \sqrt{\frac{2}{x - 1} + 2 \cdot \frac{x}{x - 1}}}\\
\mathbf{elif}\;t \leq -1.908450893682963 \cdot 10^{-175}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{2 \cdot \left(t \cdot t\right) + 2 \cdot \frac{\ell \cdot \ell}{x}}}\\
\mathbf{elif}\;t \leq -4.222777320075483 \cdot 10^{-236}:\\
\;\;\;\;-1\\
\mathbf{elif}\;t \leq 1.597425099800245 \cdot 10^{-73}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{2 \cdot \left(t \cdot t\right) + 2 \cdot \frac{\ell \cdot \ell}{x}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{t \cdot \sqrt{\frac{2}{x - 1} + 2 \cdot \frac{x}{x - 1}}}\\
\end{array}\]
| Alternative 7 |
|---|
| Error | 12.2 |
|---|
| Cost | 15300 |
|---|
\[\begin{array}{l}
\mathbf{if}\;t \leq -1.2440943124107288 \cdot 10^{+92}:\\
\;\;\;\;-\sqrt{2} \cdot \sqrt{\frac{0.5}{\frac{x}{x - 1} + \frac{1}{x - 1}}}\\
\mathbf{elif}\;t \leq -1.908450893682963 \cdot 10^{-175}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{2 \cdot \left(t \cdot t\right) + 2 \cdot \frac{\ell \cdot \ell}{x}}}\\
\mathbf{elif}\;t \leq -4.222777320075483 \cdot 10^{-236}:\\
\;\;\;\;-1\\
\mathbf{elif}\;t \leq 1.597425099800245 \cdot 10^{-73}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{2 \cdot \left(t \cdot t\right) + 2 \cdot \frac{\ell \cdot \ell}{x}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{t \cdot \sqrt{\frac{2}{x - 1} + 2 \cdot \frac{x}{x - 1}}}\\
\end{array}\]
| Alternative 8 |
|---|
| Error | 12.0 |
|---|
| Cost | 15172 |
|---|
\[\begin{array}{l}
\mathbf{if}\;t \leq -3.8006551229722496 \cdot 10^{+88}:\\
\;\;\;\;-\sqrt{2} \cdot \sqrt{\frac{0.5}{\frac{x}{x - 1} + \frac{1}{x - 1}}}\\
\mathbf{elif}\;t \leq -1.908450893682963 \cdot 10^{-175}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{2 \cdot \left(t \cdot t\right) + 2 \cdot \frac{\ell \cdot \ell}{x}}}\\
\mathbf{elif}\;t \leq -4.222777320075483 \cdot 10^{-236}:\\
\;\;\;\;-1\\
\mathbf{elif}\;t \leq 1523336689259179.5:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{2 \cdot \left(t \cdot t\right) + 2 \cdot \frac{\ell \cdot \ell}{x}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{t \cdot \sqrt{2 + \frac{4}{x}}}\\
\end{array}\]
| Alternative 9 |
|---|
| Error | 14.2 |
|---|
| Cost | 14146 |
|---|
\[\begin{array}{l}
\mathbf{if}\;t \leq -4.222777320075483 \cdot 10^{-236}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{-t \cdot \sqrt{2 + \frac{4}{x}}}\\
\mathbf{elif}\;t \leq 4.901623676390601 \cdot 10^{-185}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{2 \cdot \frac{\ell}{\frac{x}{\ell}}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{t \cdot \sqrt{2 + \frac{4}{x}}}\\
\end{array}\]
| Alternative 10 |
|---|
| Error | 14.4 |
|---|
| Cost | 14146 |
|---|
\[\begin{array}{l}
\mathbf{if}\;t \leq -4.222777320075483 \cdot 10^{-236}:\\
\;\;\;\;-1\\
\mathbf{elif}\;t \leq 4.901623676390601 \cdot 10^{-185}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{2 \cdot \frac{\ell}{\frac{x}{\ell}}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{t \cdot \sqrt{2 + \frac{4}{x}}}\\
\end{array}\]
| Alternative 11 |
|---|
| Error | 15.4 |
|---|
| Cost | 13825 |
|---|
\[\begin{array}{l}
\mathbf{if}\;t \leq -6.2486584787246 \cdot 10^{-311}:\\
\;\;\;\;-1\\
\mathbf{else}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{t \cdot \sqrt{2 + \frac{4}{x}}}\\
\end{array}\]
| Alternative 12 |
|---|
| Error | 15.6 |
|---|
| Cost | 385 |
|---|
\[\begin{array}{l}
\mathbf{if}\;t \leq -6.2486584787246 \cdot 10^{-311}:\\
\;\;\;\;-1\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}\]
| Alternative 13 |
|---|
| Error | 37.7 |
|---|
| Cost | 385 |
|---|
\[\begin{array}{l}
\mathbf{if}\;t \leq 1.7261542091313192 \cdot 10^{-302}:\\
\;\;\;\;0\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}\]
| Alternative 14 |
|---|
| Error | 39.7 |
|---|
| Cost | 64 |
|---|
\[1\]
Error

Derivation
- Split input into 7 regimes
if t < -1.2351728058409963e-41
Initial program 39.8
\[\frac{\sqrt{2} \cdot t}{\sqrt{\frac{x + 1}{x - 1} \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}}\]
Taylor expanded around -inf 6.3
\[\leadsto \frac{\sqrt{2} \cdot t}{\color{blue}{-1 \cdot \left(t \cdot \sqrt{2 \cdot \frac{1}{x - 1} + 2 \cdot \frac{x}{x - 1}}\right)}}\]
Simplified6.3
\[\leadsto \frac{\sqrt{2} \cdot t}{\color{blue}{-t \cdot \sqrt{\frac{2}{x - 1} + 2 \cdot \frac{x}{x - 1}}}}\]
Simplified6.3
\[\leadsto \color{blue}{\frac{\sqrt{2} \cdot t}{-t \cdot \sqrt{\frac{2}{x - 1} + 2 \cdot \frac{x}{x - 1}}}}\]
if -1.2351728058409963e-41 < t < -1.58445304366247051e-154
Initial program 32.6
\[\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}}\]
Taylor expanded around inf 10.0
\[\leadsto \frac{\sqrt{2} \cdot t}{\sqrt{\color{blue}{2 \cdot \frac{{\ell}^{2}}{x} + \left(4 \cdot \frac{{t}^{2}}{x} + 2 \cdot {t}^{2}\right)}}}\]
Simplified10.0
\[\leadsto \frac{\sqrt{2} \cdot t}{\sqrt{\color{blue}{2 \cdot \frac{\ell \cdot \ell}{x} + \left(2 \cdot \left(t \cdot t\right) + 4 \cdot \frac{t \cdot t}{x}\right)}}}\]
- Using strategy
rm Applied add-cube-cbrt_binary64_11310.0
\[\leadsto \frac{\sqrt{2} \cdot t}{\sqrt{2 \cdot \frac{\ell \cdot \ell}{\color{blue}{\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \sqrt[3]{x}}} + \left(2 \cdot \left(t \cdot t\right) + 4 \cdot \frac{t \cdot t}{x}\right)}}\]
Applied times-frac_binary64_844.4
\[\leadsto \frac{\sqrt{2} \cdot t}{\sqrt{2 \cdot \color{blue}{\left(\frac{\ell}{\sqrt[3]{x} \cdot \sqrt[3]{x}} \cdot \frac{\ell}{\sqrt[3]{x}}\right)} + \left(2 \cdot \left(t \cdot t\right) + 4 \cdot \frac{t \cdot t}{x}\right)}}\]
- Using strategy
rm Applied associate-+r+_binary64_104.4
\[\leadsto \frac{\sqrt{2} \cdot t}{\sqrt{\color{blue}{\left(2 \cdot \left(\frac{\ell}{\sqrt[3]{x} \cdot \sqrt[3]{x}} \cdot \frac{\ell}{\sqrt[3]{x}}\right) + 2 \cdot \left(t \cdot t\right)\right) + 4 \cdot \frac{t \cdot t}{x}}}}\]
Simplified4.3
\[\leadsto \frac{\sqrt{2} \cdot t}{\sqrt{\color{blue}{2 \cdot \left(\frac{\ell}{\frac{x}{\ell}} + t \cdot t\right)} + 4 \cdot \frac{t \cdot t}{x}}}\]
Simplified4.3
\[\leadsto \color{blue}{\frac{\sqrt{2} \cdot t}{\sqrt{4 \cdot \frac{t \cdot t}{x} + 2 \cdot \left(t \cdot t + \frac{\ell}{\frac{x}{\ell}}\right)}}}\]
if -1.58445304366247051e-154 < t < -4.2227773200754832e-236
Initial program 61.6
\[\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}}\]
Taylor expanded around inf 36.4
\[\leadsto \frac{\sqrt{2} \cdot t}{\sqrt{\color{blue}{2 \cdot \frac{{\ell}^{2}}{x} + \left(4 \cdot \frac{{t}^{2}}{x} + 2 \cdot {t}^{2}\right)}}}\]
Simplified36.4
\[\leadsto \frac{\sqrt{2} \cdot t}{\sqrt{\color{blue}{2 \cdot \frac{\ell \cdot \ell}{x} + \left(2 \cdot \left(t \cdot t\right) + 4 \cdot \frac{t \cdot t}{x}\right)}}}\]
Taylor expanded around -inf 24.2
\[\leadsto \frac{\sqrt{2} \cdot t}{\color{blue}{-\left(\sqrt{4 \cdot \frac{1}{x} + 2} \cdot t + \sqrt{\frac{1}{4 \cdot \frac{1}{x} + 2}} \cdot \frac{{\ell}^{2}}{x \cdot t}\right)}}\]
Simplified24.2
\[\leadsto \frac{\sqrt{2} \cdot t}{\color{blue}{\left(-t \cdot \sqrt{2 + \frac{4}{x}}\right) - \sqrt{\frac{1}{2 + \frac{4}{x}}} \cdot \frac{\ell \cdot \ell}{x \cdot t}}}\]
Simplified24.2
\[\leadsto \color{blue}{\frac{\sqrt{2} \cdot t}{\left(-t \cdot \sqrt{2 + \frac{4}{x}}\right) - \sqrt{\frac{1}{2 + \frac{4}{x}}} \cdot \frac{\ell \cdot \ell}{t \cdot x}}}\]
if -4.2227773200754832e-236 < t < 1.67382657830052298e-305
Initial program 62.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}}\]
Taylor expanded around inf 29.8
\[\leadsto \frac{\sqrt{2} \cdot t}{\sqrt{\color{blue}{2 \cdot \frac{{\ell}^{2}}{x} + \left(4 \cdot \frac{{t}^{2}}{x} + 2 \cdot {t}^{2}\right)}}}\]
Simplified29.8
\[\leadsto \frac{\sqrt{2} \cdot t}{\sqrt{\color{blue}{2 \cdot \frac{\ell \cdot \ell}{x} + \left(2 \cdot \left(t \cdot t\right) + 4 \cdot \frac{t \cdot t}{x}\right)}}}\]
Taylor expanded around inf 32.7
\[\leadsto \frac{\sqrt{2} \cdot t}{\color{blue}{\sqrt{\frac{1}{x}} \cdot \left(\ell \cdot \sqrt{2}\right)}}\]
Simplified32.7
\[\leadsto \color{blue}{\frac{\sqrt{2} \cdot t}{\sqrt{\frac{1}{x}} \cdot \left(\sqrt{2} \cdot \ell\right)}}\]
if 1.67382657830052298e-305 < t < 3.38559473551946292e-144
Initial program 60.4
\[\frac{\sqrt{2} \cdot t}{\sqrt{\frac{x + 1}{x - 1} \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}}\]
Taylor expanded around inf 24.1
\[\leadsto \frac{\sqrt{2} \cdot t}{\color{blue}{t \cdot \sqrt{2} + \left(2 \cdot \frac{t}{x \cdot \sqrt{2}} + \frac{{\ell}^{2}}{t \cdot \left(x \cdot \sqrt{2}\right)}\right)}}\]
Simplified24.1
\[\leadsto \frac{\sqrt{2} \cdot t}{\color{blue}{t \cdot \sqrt{2} + \left(2 \cdot \frac{t}{x \cdot \sqrt{2}} + \frac{\ell \cdot \ell}{x \cdot \left(t \cdot \sqrt{2}\right)}\right)}}\]
Simplified24.1
\[\leadsto \color{blue}{\frac{\sqrt{2} \cdot t}{\sqrt{2} \cdot t + \left(2 \cdot \frac{t}{\sqrt{2} \cdot x} + \frac{\ell \cdot \ell}{\left(\sqrt{2} \cdot t\right) \cdot x}\right)}}\]
if 3.38559473551946292e-144 < t < 2.26741130608886417e126
Initial program 24.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}}\]
Taylor expanded around inf 10.7
\[\leadsto \frac{\sqrt{2} \cdot t}{\sqrt{\color{blue}{2 \cdot \frac{{\ell}^{2}}{x} + \left(4 \cdot \frac{{t}^{2}}{x} + 2 \cdot {t}^{2}\right)}}}\]
Simplified10.7
\[\leadsto \frac{\sqrt{2} \cdot t}{\sqrt{\color{blue}{2 \cdot \frac{\ell \cdot \ell}{x} + \left(2 \cdot \left(t \cdot t\right) + 4 \cdot \frac{t \cdot t}{x}\right)}}}\]
- Using strategy
rm Applied *-un-lft-identity_binary64_7810.7
\[\leadsto \frac{\sqrt{2} \cdot t}{\sqrt{2 \cdot \frac{\ell \cdot \ell}{\color{blue}{1 \cdot x}} + \left(2 \cdot \left(t \cdot t\right) + 4 \cdot \frac{t \cdot t}{x}\right)}}\]
Applied times-frac_binary64_845.1
\[\leadsto \frac{\sqrt{2} \cdot t}{\sqrt{2 \cdot \color{blue}{\left(\frac{\ell}{1} \cdot \frac{\ell}{x}\right)} + \left(2 \cdot \left(t \cdot t\right) + 4 \cdot \frac{t \cdot t}{x}\right)}}\]
Simplified5.1
\[\leadsto \frac{\sqrt{2} \cdot t}{\sqrt{2 \cdot \left(\color{blue}{\ell} \cdot \frac{\ell}{x}\right) + \left(2 \cdot \left(t \cdot t\right) + 4 \cdot \frac{t \cdot t}{x}\right)}}\]
Simplified5.1
\[\leadsto \color{blue}{\frac{\sqrt{2} \cdot t}{\sqrt{\left(2 \cdot \left(t \cdot t\right) + 4 \cdot \frac{t \cdot t}{x}\right) + 2 \cdot \left(\ell \cdot \frac{\ell}{x}\right)}}}\]
if 2.26741130608886417e126 < t
Initial program 55.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}}\]
Taylor expanded around inf 2.2
\[\leadsto \frac{\sqrt{2} \cdot t}{\color{blue}{t \cdot \sqrt{2 \cdot \frac{1}{x - 1} + 2 \cdot \frac{x}{x - 1}}}}\]
Simplified2.2
\[\leadsto \frac{\sqrt{2} \cdot t}{\color{blue}{t \cdot \sqrt{\frac{2}{x - 1} + 2 \cdot \frac{x}{x - 1}}}}\]
Simplified2.2
\[\leadsto \color{blue}{\frac{\sqrt{2} \cdot t}{t \cdot \sqrt{\frac{2}{x - 1} + 2 \cdot \frac{x}{x - 1}}}}\]
- Recombined 7 regimes into one program.
Final simplification9.1
\[\leadsto \begin{array}{l}
\mathbf{if}\;t \leq -1.2351728058409963 \cdot 10^{-41}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{-t \cdot \sqrt{\frac{2}{x - 1} + 2 \cdot \frac{x}{x - 1}}}\\
\mathbf{elif}\;t \leq -1.5844530436624705 \cdot 10^{-154}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{4 \cdot \frac{t \cdot t}{x} + 2 \cdot \left(t \cdot t + \frac{\ell}{\frac{x}{\ell}}\right)}}\\
\mathbf{elif}\;t \leq -4.222777320075483 \cdot 10^{-236}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{\left(-t \cdot \sqrt{2 + \frac{4}{x}}\right) - \sqrt{\frac{1}{2 + \frac{4}{x}}} \cdot \frac{\ell \cdot \ell}{t \cdot x}}\\
\mathbf{elif}\;t \leq 1.673826578300523 \cdot 10^{-305}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{\frac{1}{x}} \cdot \left(\sqrt{2} \cdot \ell\right)}\\
\mathbf{elif}\;t \leq 3.385594735519463 \cdot 10^{-144}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{t \cdot \sqrt{2} + \left(2 \cdot \frac{t}{\sqrt{2} \cdot x} + \frac{\ell \cdot \ell}{\left(t \cdot \sqrt{2}\right) \cdot x}\right)}\\
\mathbf{elif}\;t \leq 2.2674113060888642 \cdot 10^{+126}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{\left(4 \cdot \frac{t \cdot t}{x} + 2 \cdot \left(t \cdot t\right)\right) + 2 \cdot \left(\ell \cdot \frac{\ell}{x}\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{t \cdot \sqrt{\frac{2}{x - 1} + 2 \cdot \frac{x}{x - 1}}}\\
\end{array}\]
Reproduce
herbie shell --seed 2021044
(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)))))