Toniolo and Linder, Equation (7)

Percentage Accurate: 32.9% → 84.0%
Time: 28.7s
Alternatives: 12
Speedup: 225.0×

Specification

?
\[\begin{array}{l} \\ \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}} \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)))))
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)));
}
real(8) function code(x, l, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: l
    real(8), intent (in) :: t
    code = (sqrt(2.0d0) * t) / sqrt(((((x + 1.0d0) / (x - 1.0d0)) * ((l * l) + (2.0d0 * (t * t)))) - (l * l)))
end function
public static double code(double x, double l, double t) {
	return (Math.sqrt(2.0) * t) / Math.sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l)));
}
def code(x, l, t):
	return (math.sqrt(2.0) * t) / math.sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l)))
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 tmp = code(x, l, t)
	tmp = (sqrt(2.0) * t) / sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l)));
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]
\begin{array}{l}

\\
\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}}
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 12 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 32.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \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}} \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)))))
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)));
}
real(8) function code(x, l, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: l
    real(8), intent (in) :: t
    code = (sqrt(2.0d0) * t) / sqrt(((((x + 1.0d0) / (x - 1.0d0)) * ((l * l) + (2.0d0 * (t * t)))) - (l * l)))
end function
public static double code(double x, double l, double t) {
	return (Math.sqrt(2.0) * t) / Math.sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l)));
}
def code(x, l, t):
	return (math.sqrt(2.0) * t) / math.sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l)))
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 tmp = code(x, l, t)
	tmp = (sqrt(2.0) * t) / sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l)));
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]
\begin{array}{l}

\\
\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}}
\end{array}

Alternative 1: 84.0% accurate, 0.3× speedup?

\[\begin{array}{l} l_m = \left|\ell\right| \\ t_m = \left|t\right| \\ t_s = \mathsf{copysign}\left(1, t\right) \\ \begin{array}{l} t_2 := 2 \cdot {t\_m}^{2}\\ t\_s \cdot \begin{array}{l} \mathbf{if}\;t\_m \leq 2.3 \cdot 10^{-178}:\\ \;\;\;\;\frac{t\_m \cdot {\left(\frac{1}{x} + \frac{1}{x + -1}\right)}^{-0.5}}{\frac{l\_m}{\sqrt{2}}}\\ \mathbf{elif}\;t\_m \leq 1.75 \cdot 10^{+104}:\\ \;\;\;\;t\_m \cdot \frac{\sqrt{2}}{\sqrt{\left(2 \cdot \frac{{t\_m}^{2}}{x} + \left(t\_2 + \frac{{l\_m}^{2}}{x}\right)\right) + \frac{t\_2 + {l\_m}^{2}}{x}}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{x + -1}{1 + x}}\\ \end{array} \end{array} \end{array} \]
l_m = (fabs.f64 l)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s x l_m t_m)
 :precision binary64
 (let* ((t_2 (* 2.0 (pow t_m 2.0))))
   (*
    t_s
    (if (<= t_m 2.3e-178)
      (/
       (* t_m (pow (+ (/ 1.0 x) (/ 1.0 (+ x -1.0))) -0.5))
       (/ l_m (sqrt 2.0)))
      (if (<= t_m 1.75e+104)
        (*
         t_m
         (/
          (sqrt 2.0)
          (sqrt
           (+
            (+ (* 2.0 (/ (pow t_m 2.0) x)) (+ t_2 (/ (pow l_m 2.0) x)))
            (/ (+ t_2 (pow l_m 2.0)) x)))))
        (sqrt (/ (+ x -1.0) (+ 1.0 x))))))))
l_m = fabs(l);
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double x, double l_m, double t_m) {
	double t_2 = 2.0 * pow(t_m, 2.0);
	double tmp;
	if (t_m <= 2.3e-178) {
		tmp = (t_m * pow(((1.0 / x) + (1.0 / (x + -1.0))), -0.5)) / (l_m / sqrt(2.0));
	} else if (t_m <= 1.75e+104) {
		tmp = t_m * (sqrt(2.0) / sqrt((((2.0 * (pow(t_m, 2.0) / x)) + (t_2 + (pow(l_m, 2.0) / x))) + ((t_2 + pow(l_m, 2.0)) / x))));
	} else {
		tmp = sqrt(((x + -1.0) / (1.0 + x)));
	}
	return t_s * tmp;
}
l_m = abs(l)
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, x, l_m, t_m)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: x
    real(8), intent (in) :: l_m
    real(8), intent (in) :: t_m
    real(8) :: t_2
    real(8) :: tmp
    t_2 = 2.0d0 * (t_m ** 2.0d0)
    if (t_m <= 2.3d-178) then
        tmp = (t_m * (((1.0d0 / x) + (1.0d0 / (x + (-1.0d0)))) ** (-0.5d0))) / (l_m / sqrt(2.0d0))
    else if (t_m <= 1.75d+104) then
        tmp = t_m * (sqrt(2.0d0) / sqrt((((2.0d0 * ((t_m ** 2.0d0) / x)) + (t_2 + ((l_m ** 2.0d0) / x))) + ((t_2 + (l_m ** 2.0d0)) / x))))
    else
        tmp = sqrt(((x + (-1.0d0)) / (1.0d0 + x)))
    end if
    code = t_s * tmp
end function
l_m = Math.abs(l);
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double l_m, double t_m) {
	double t_2 = 2.0 * Math.pow(t_m, 2.0);
	double tmp;
	if (t_m <= 2.3e-178) {
		tmp = (t_m * Math.pow(((1.0 / x) + (1.0 / (x + -1.0))), -0.5)) / (l_m / Math.sqrt(2.0));
	} else if (t_m <= 1.75e+104) {
		tmp = t_m * (Math.sqrt(2.0) / Math.sqrt((((2.0 * (Math.pow(t_m, 2.0) / x)) + (t_2 + (Math.pow(l_m, 2.0) / x))) + ((t_2 + Math.pow(l_m, 2.0)) / x))));
	} else {
		tmp = Math.sqrt(((x + -1.0) / (1.0 + x)));
	}
	return t_s * tmp;
}
l_m = math.fabs(l)
t_m = math.fabs(t)
t_s = math.copysign(1.0, t)
def code(t_s, x, l_m, t_m):
	t_2 = 2.0 * math.pow(t_m, 2.0)
	tmp = 0
	if t_m <= 2.3e-178:
		tmp = (t_m * math.pow(((1.0 / x) + (1.0 / (x + -1.0))), -0.5)) / (l_m / math.sqrt(2.0))
	elif t_m <= 1.75e+104:
		tmp = t_m * (math.sqrt(2.0) / math.sqrt((((2.0 * (math.pow(t_m, 2.0) / x)) + (t_2 + (math.pow(l_m, 2.0) / x))) + ((t_2 + math.pow(l_m, 2.0)) / x))))
	else:
		tmp = math.sqrt(((x + -1.0) / (1.0 + x)))
	return t_s * tmp
l_m = abs(l)
t_m = abs(t)
t_s = copysign(1.0, t)
function code(t_s, x, l_m, t_m)
	t_2 = Float64(2.0 * (t_m ^ 2.0))
	tmp = 0.0
	if (t_m <= 2.3e-178)
		tmp = Float64(Float64(t_m * (Float64(Float64(1.0 / x) + Float64(1.0 / Float64(x + -1.0))) ^ -0.5)) / Float64(l_m / sqrt(2.0)));
	elseif (t_m <= 1.75e+104)
		tmp = Float64(t_m * Float64(sqrt(2.0) / sqrt(Float64(Float64(Float64(2.0 * Float64((t_m ^ 2.0) / x)) + Float64(t_2 + Float64((l_m ^ 2.0) / x))) + Float64(Float64(t_2 + (l_m ^ 2.0)) / x)))));
	else
		tmp = sqrt(Float64(Float64(x + -1.0) / Float64(1.0 + x)));
	end
	return Float64(t_s * tmp)
end
l_m = abs(l);
t_m = abs(t);
t_s = sign(t) * abs(1.0);
function tmp_2 = code(t_s, x, l_m, t_m)
	t_2 = 2.0 * (t_m ^ 2.0);
	tmp = 0.0;
	if (t_m <= 2.3e-178)
		tmp = (t_m * (((1.0 / x) + (1.0 / (x + -1.0))) ^ -0.5)) / (l_m / sqrt(2.0));
	elseif (t_m <= 1.75e+104)
		tmp = t_m * (sqrt(2.0) / sqrt((((2.0 * ((t_m ^ 2.0) / x)) + (t_2 + ((l_m ^ 2.0) / x))) + ((t_2 + (l_m ^ 2.0)) / x))));
	else
		tmp = sqrt(((x + -1.0) / (1.0 + x)));
	end
	tmp_2 = t_s * tmp;
end
l_m = N[Abs[l], $MachinePrecision]
t_m = N[Abs[t], $MachinePrecision]
t_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, l$95$m_, t$95$m_] := Block[{t$95$2 = N[(2.0 * N[Power[t$95$m, 2.0], $MachinePrecision]), $MachinePrecision]}, N[(t$95$s * If[LessEqual[t$95$m, 2.3e-178], N[(N[(t$95$m * N[Power[N[(N[(1.0 / x), $MachinePrecision] + N[(1.0 / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] / N[(l$95$m / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 1.75e+104], N[(t$95$m * N[(N[Sqrt[2.0], $MachinePrecision] / N[Sqrt[N[(N[(N[(2.0 * N[(N[Power[t$95$m, 2.0], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + N[(t$95$2 + N[(N[Power[l$95$m, 2.0], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$2 + N[Power[l$95$m, 2.0], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(1.0 + x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)

\\
\begin{array}{l}
t_2 := 2 \cdot {t\_m}^{2}\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 2.3 \cdot 10^{-178}:\\
\;\;\;\;\frac{t\_m \cdot {\left(\frac{1}{x} + \frac{1}{x + -1}\right)}^{-0.5}}{\frac{l\_m}{\sqrt{2}}}\\

\mathbf{elif}\;t\_m \leq 1.75 \cdot 10^{+104}:\\
\;\;\;\;t\_m \cdot \frac{\sqrt{2}}{\sqrt{\left(2 \cdot \frac{{t\_m}^{2}}{x} + \left(t\_2 + \frac{{l\_m}^{2}}{x}\right)\right) + \frac{t\_2 + {l\_m}^{2}}{x}}}\\

\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{x + -1}{1 + x}}\\


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < 2.29999999999999994e-178

    1. Initial program 28.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}} \]
    2. Simplified28.4%

      \[\leadsto \color{blue}{\sqrt{2} \cdot \frac{t}{\sqrt{\mathsf{fma}\left(\frac{x + 1}{x + -1}, \mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right), \ell \cdot \left(-\ell\right)\right)}}} \]
    3. Add Preprocessing
    4. Taylor expanded in l around inf 2.8%

      \[\leadsto \color{blue}{\frac{t \cdot \sqrt{2}}{\ell} \cdot \sqrt{\frac{1}{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}}} \]
    5. Step-by-step derivation
      1. *-commutative2.8%

        \[\leadsto \color{blue}{\sqrt{\frac{1}{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}} \cdot \frac{t \cdot \sqrt{2}}{\ell}} \]
      2. associate--l+10.6%

        \[\leadsto \sqrt{\frac{1}{\color{blue}{\frac{1}{x - 1} + \left(\frac{x}{x - 1} - 1\right)}}} \cdot \frac{t \cdot \sqrt{2}}{\ell} \]
      3. sub-neg10.6%

        \[\leadsto \sqrt{\frac{1}{\frac{1}{\color{blue}{x + \left(-1\right)}} + \left(\frac{x}{x - 1} - 1\right)}} \cdot \frac{t \cdot \sqrt{2}}{\ell} \]
      4. metadata-eval10.6%

        \[\leadsto \sqrt{\frac{1}{\frac{1}{x + \color{blue}{-1}} + \left(\frac{x}{x - 1} - 1\right)}} \cdot \frac{t \cdot \sqrt{2}}{\ell} \]
      5. +-commutative10.6%

        \[\leadsto \sqrt{\frac{1}{\frac{1}{\color{blue}{-1 + x}} + \left(\frac{x}{x - 1} - 1\right)}} \cdot \frac{t \cdot \sqrt{2}}{\ell} \]
      6. sub-neg10.6%

        \[\leadsto \sqrt{\frac{1}{\frac{1}{-1 + x} + \left(\frac{x}{\color{blue}{x + \left(-1\right)}} - 1\right)}} \cdot \frac{t \cdot \sqrt{2}}{\ell} \]
      7. metadata-eval10.6%

        \[\leadsto \sqrt{\frac{1}{\frac{1}{-1 + x} + \left(\frac{x}{x + \color{blue}{-1}} - 1\right)}} \cdot \frac{t \cdot \sqrt{2}}{\ell} \]
      8. +-commutative10.6%

        \[\leadsto \sqrt{\frac{1}{\frac{1}{-1 + x} + \left(\frac{x}{\color{blue}{-1 + x}} - 1\right)}} \cdot \frac{t \cdot \sqrt{2}}{\ell} \]
      9. associate-/l*10.6%

        \[\leadsto \sqrt{\frac{1}{\frac{1}{-1 + x} + \left(\frac{x}{-1 + x} - 1\right)}} \cdot \color{blue}{\frac{t}{\frac{\ell}{\sqrt{2}}}} \]
    6. Simplified10.6%

      \[\leadsto \color{blue}{\sqrt{\frac{1}{\frac{1}{-1 + x} + \left(\frac{x}{-1 + x} - 1\right)}} \cdot \frac{t}{\frac{\ell}{\sqrt{2}}}} \]
    7. Taylor expanded in x around inf 18.2%

      \[\leadsto \sqrt{\frac{1}{\frac{1}{-1 + x} + \color{blue}{\frac{1}{x}}}} \cdot \frac{t}{\frac{\ell}{\sqrt{2}}} \]
    8. Step-by-step derivation
      1. associate-/r/18.2%

        \[\leadsto \sqrt{\frac{1}{\frac{1}{-1 + x} + \frac{1}{x}}} \cdot \color{blue}{\left(\frac{t}{\ell} \cdot \sqrt{2}\right)} \]
    9. Applied egg-rr18.2%

      \[\leadsto \sqrt{\frac{1}{\frac{1}{-1 + x} + \frac{1}{x}}} \cdot \color{blue}{\left(\frac{t}{\ell} \cdot \sqrt{2}\right)} \]
    10. Step-by-step derivation
      1. associate-/r/18.2%

        \[\leadsto \sqrt{\frac{1}{\frac{1}{-1 + x} + \frac{1}{x}}} \cdot \color{blue}{\frac{t}{\frac{\ell}{\sqrt{2}}}} \]
      2. add-cube-cbrt18.1%

        \[\leadsto \sqrt{\color{blue}{\left(\sqrt[3]{\frac{1}{\frac{1}{-1 + x} + \frac{1}{x}}} \cdot \sqrt[3]{\frac{1}{\frac{1}{-1 + x} + \frac{1}{x}}}\right) \cdot \sqrt[3]{\frac{1}{\frac{1}{-1 + x} + \frac{1}{x}}}}} \cdot \frac{t}{\frac{\ell}{\sqrt{2}}} \]
      3. pow318.1%

        \[\leadsto \sqrt{\color{blue}{{\left(\sqrt[3]{\frac{1}{\frac{1}{-1 + x} + \frac{1}{x}}}\right)}^{3}}} \cdot \frac{t}{\frac{\ell}{\sqrt{2}}} \]
      4. sqrt-pow118.1%

        \[\leadsto \color{blue}{{\left(\sqrt[3]{\frac{1}{\frac{1}{-1 + x} + \frac{1}{x}}}\right)}^{\left(\frac{3}{2}\right)}} \cdot \frac{t}{\frac{\ell}{\sqrt{2}}} \]
      5. cbrt-div18.1%

        \[\leadsto {\color{blue}{\left(\frac{\sqrt[3]{1}}{\sqrt[3]{\frac{1}{-1 + x} + \frac{1}{x}}}\right)}}^{\left(\frac{3}{2}\right)} \cdot \frac{t}{\frac{\ell}{\sqrt{2}}} \]
      6. metadata-eval18.1%

        \[\leadsto {\left(\frac{\color{blue}{1}}{\sqrt[3]{\frac{1}{-1 + x} + \frac{1}{x}}}\right)}^{\left(\frac{3}{2}\right)} \cdot \frac{t}{\frac{\ell}{\sqrt{2}}} \]
      7. +-commutative18.1%

        \[\leadsto {\left(\frac{1}{\sqrt[3]{\frac{1}{\color{blue}{x + -1}} + \frac{1}{x}}}\right)}^{\left(\frac{3}{2}\right)} \cdot \frac{t}{\frac{\ell}{\sqrt{2}}} \]
      8. +-commutative18.1%

        \[\leadsto {\left(\frac{1}{\sqrt[3]{\color{blue}{\frac{1}{x} + \frac{1}{x + -1}}}}\right)}^{\left(\frac{3}{2}\right)} \cdot \frac{t}{\frac{\ell}{\sqrt{2}}} \]
      9. sqrt-pow118.1%

        \[\leadsto \color{blue}{\sqrt{{\left(\frac{1}{\sqrt[3]{\frac{1}{x} + \frac{1}{x + -1}}}\right)}^{3}}} \cdot \frac{t}{\frac{\ell}{\sqrt{2}}} \]
    11. Applied egg-rr20.1%

      \[\leadsto \color{blue}{\frac{{\left(\frac{1}{x + -1} + \frac{1}{x}\right)}^{-0.5} \cdot t}{\frac{\ell}{\sqrt{2}}}} \]

    if 2.29999999999999994e-178 < t < 1.7500000000000001e104

    1. Initial program 55.7%

      \[\frac{\sqrt{2} \cdot t}{\sqrt{\frac{x + 1}{x - 1} \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}} \]
    2. Simplified55.9%

      \[\leadsto \color{blue}{\frac{\sqrt{2}}{\sqrt{\frac{x + 1}{x + -1} \cdot \mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right) - \ell \cdot \ell}} \cdot t} \]
    3. Add Preprocessing
    4. Taylor expanded in x around inf 84.3%

      \[\leadsto \frac{\sqrt{2}}{\sqrt{\color{blue}{\left(2 \cdot \frac{{t}^{2}}{x} + \left(2 \cdot {t}^{2} + \frac{{\ell}^{2}}{x}\right)\right) - -1 \cdot \frac{2 \cdot {t}^{2} + {\ell}^{2}}{x}}}} \cdot t \]

    if 1.7500000000000001e104 < t

    1. Initial program 13.3%

      \[\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}} \]
    2. Simplified13.3%

      \[\leadsto \color{blue}{\sqrt{2} \cdot \frac{t}{\sqrt{\mathsf{fma}\left(\frac{x + 1}{x + -1}, \mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right), \ell \cdot \left(-\ell\right)\right)}}} \]
    3. Add Preprocessing
    4. Taylor expanded in t around inf 96.8%

      \[\leadsto \sqrt{2} \cdot \frac{t}{\color{blue}{\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{1 + x}{x - 1}}}} \]
    5. Step-by-step derivation
      1. +-commutative96.8%

        \[\leadsto \sqrt{2} \cdot \frac{t}{\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{\color{blue}{x + 1}}{x - 1}}} \]
      2. sub-neg96.8%

        \[\leadsto \sqrt{2} \cdot \frac{t}{\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{x + 1}{\color{blue}{x + \left(-1\right)}}}} \]
      3. metadata-eval96.8%

        \[\leadsto \sqrt{2} \cdot \frac{t}{\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{x + 1}{x + \color{blue}{-1}}}} \]
      4. +-commutative96.8%

        \[\leadsto \sqrt{2} \cdot \frac{t}{\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{x + 1}{\color{blue}{-1 + x}}}} \]
    6. Simplified96.8%

      \[\leadsto \sqrt{2} \cdot \frac{t}{\color{blue}{\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{x + 1}{-1 + x}}}} \]
    7. Taylor expanded in t around 0 97.1%

      \[\leadsto \color{blue}{\sqrt{\frac{x - 1}{1 + x}}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification47.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 2.3 \cdot 10^{-178}:\\ \;\;\;\;\frac{t \cdot {\left(\frac{1}{x} + \frac{1}{x + -1}\right)}^{-0.5}}{\frac{\ell}{\sqrt{2}}}\\ \mathbf{elif}\;t \leq 1.75 \cdot 10^{+104}:\\ \;\;\;\;t \cdot \frac{\sqrt{2}}{\sqrt{\left(2 \cdot \frac{{t}^{2}}{x} + \left(2 \cdot {t}^{2} + \frac{{\ell}^{2}}{x}\right)\right) + \frac{2 \cdot {t}^{2} + {\ell}^{2}}{x}}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{x + -1}{1 + x}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 84.2% accurate, 0.4× speedup?

\[\begin{array}{l} l_m = \left|\ell\right| \\ t_m = \left|t\right| \\ t_s = \mathsf{copysign}\left(1, t\right) \\ \begin{array}{l} t_2 := \frac{x + -1}{1 + x}\\ t\_s \cdot \begin{array}{l} \mathbf{if}\;t\_m \leq 1.05 \cdot 10^{-178}:\\ \;\;\;\;\frac{t\_m \cdot {\left(\frac{1}{x} + \frac{1}{x + -1}\right)}^{-0.5}}{\frac{l\_m}{\sqrt{2}}}\\ \mathbf{elif}\;t\_m \leq 1.8 \cdot 10^{+104}:\\ \;\;\;\;\sqrt{2} \cdot \frac{t\_m}{\sqrt{\mathsf{fma}\left(2, \frac{{t\_m}^{2}}{t\_2}, \frac{2 \cdot {l\_m}^{2}}{x}\right)}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{t\_2}\\ \end{array} \end{array} \end{array} \]
l_m = (fabs.f64 l)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s x l_m t_m)
 :precision binary64
 (let* ((t_2 (/ (+ x -1.0) (+ 1.0 x))))
   (*
    t_s
    (if (<= t_m 1.05e-178)
      (/
       (* t_m (pow (+ (/ 1.0 x) (/ 1.0 (+ x -1.0))) -0.5))
       (/ l_m (sqrt 2.0)))
      (if (<= t_m 1.8e+104)
        (*
         (sqrt 2.0)
         (/
          t_m
          (sqrt (fma 2.0 (/ (pow t_m 2.0) t_2) (/ (* 2.0 (pow l_m 2.0)) x)))))
        (sqrt t_2))))))
l_m = fabs(l);
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double x, double l_m, double t_m) {
	double t_2 = (x + -1.0) / (1.0 + x);
	double tmp;
	if (t_m <= 1.05e-178) {
		tmp = (t_m * pow(((1.0 / x) + (1.0 / (x + -1.0))), -0.5)) / (l_m / sqrt(2.0));
	} else if (t_m <= 1.8e+104) {
		tmp = sqrt(2.0) * (t_m / sqrt(fma(2.0, (pow(t_m, 2.0) / t_2), ((2.0 * pow(l_m, 2.0)) / x))));
	} else {
		tmp = sqrt(t_2);
	}
	return t_s * tmp;
}
l_m = abs(l)
t_m = abs(t)
t_s = copysign(1.0, t)
function code(t_s, x, l_m, t_m)
	t_2 = Float64(Float64(x + -1.0) / Float64(1.0 + x))
	tmp = 0.0
	if (t_m <= 1.05e-178)
		tmp = Float64(Float64(t_m * (Float64(Float64(1.0 / x) + Float64(1.0 / Float64(x + -1.0))) ^ -0.5)) / Float64(l_m / sqrt(2.0)));
	elseif (t_m <= 1.8e+104)
		tmp = Float64(sqrt(2.0) * Float64(t_m / sqrt(fma(2.0, Float64((t_m ^ 2.0) / t_2), Float64(Float64(2.0 * (l_m ^ 2.0)) / x)))));
	else
		tmp = sqrt(t_2);
	end
	return Float64(t_s * tmp)
end
l_m = N[Abs[l], $MachinePrecision]
t_m = N[Abs[t], $MachinePrecision]
t_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, l$95$m_, t$95$m_] := Block[{t$95$2 = N[(N[(x + -1.0), $MachinePrecision] / N[(1.0 + x), $MachinePrecision]), $MachinePrecision]}, N[(t$95$s * If[LessEqual[t$95$m, 1.05e-178], N[(N[(t$95$m * N[Power[N[(N[(1.0 / x), $MachinePrecision] + N[(1.0 / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] / N[(l$95$m / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 1.8e+104], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t$95$m / N[Sqrt[N[(2.0 * N[(N[Power[t$95$m, 2.0], $MachinePrecision] / t$95$2), $MachinePrecision] + N[(N[(2.0 * N[Power[l$95$m, 2.0], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sqrt[t$95$2], $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)

\\
\begin{array}{l}
t_2 := \frac{x + -1}{1 + x}\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 1.05 \cdot 10^{-178}:\\
\;\;\;\;\frac{t\_m \cdot {\left(\frac{1}{x} + \frac{1}{x + -1}\right)}^{-0.5}}{\frac{l\_m}{\sqrt{2}}}\\

\mathbf{elif}\;t\_m \leq 1.8 \cdot 10^{+104}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t\_m}{\sqrt{\mathsf{fma}\left(2, \frac{{t\_m}^{2}}{t\_2}, \frac{2 \cdot {l\_m}^{2}}{x}\right)}}\\

\mathbf{else}:\\
\;\;\;\;\sqrt{t\_2}\\


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < 1.05e-178

    1. Initial program 28.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}} \]
    2. Simplified28.4%

      \[\leadsto \color{blue}{\sqrt{2} \cdot \frac{t}{\sqrt{\mathsf{fma}\left(\frac{x + 1}{x + -1}, \mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right), \ell \cdot \left(-\ell\right)\right)}}} \]
    3. Add Preprocessing
    4. Taylor expanded in l around inf 2.8%

      \[\leadsto \color{blue}{\frac{t \cdot \sqrt{2}}{\ell} \cdot \sqrt{\frac{1}{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}}} \]
    5. Step-by-step derivation
      1. *-commutative2.8%

        \[\leadsto \color{blue}{\sqrt{\frac{1}{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}} \cdot \frac{t \cdot \sqrt{2}}{\ell}} \]
      2. associate--l+10.6%

        \[\leadsto \sqrt{\frac{1}{\color{blue}{\frac{1}{x - 1} + \left(\frac{x}{x - 1} - 1\right)}}} \cdot \frac{t \cdot \sqrt{2}}{\ell} \]
      3. sub-neg10.6%

        \[\leadsto \sqrt{\frac{1}{\frac{1}{\color{blue}{x + \left(-1\right)}} + \left(\frac{x}{x - 1} - 1\right)}} \cdot \frac{t \cdot \sqrt{2}}{\ell} \]
      4. metadata-eval10.6%

        \[\leadsto \sqrt{\frac{1}{\frac{1}{x + \color{blue}{-1}} + \left(\frac{x}{x - 1} - 1\right)}} \cdot \frac{t \cdot \sqrt{2}}{\ell} \]
      5. +-commutative10.6%

        \[\leadsto \sqrt{\frac{1}{\frac{1}{\color{blue}{-1 + x}} + \left(\frac{x}{x - 1} - 1\right)}} \cdot \frac{t \cdot \sqrt{2}}{\ell} \]
      6. sub-neg10.6%

        \[\leadsto \sqrt{\frac{1}{\frac{1}{-1 + x} + \left(\frac{x}{\color{blue}{x + \left(-1\right)}} - 1\right)}} \cdot \frac{t \cdot \sqrt{2}}{\ell} \]
      7. metadata-eval10.6%

        \[\leadsto \sqrt{\frac{1}{\frac{1}{-1 + x} + \left(\frac{x}{x + \color{blue}{-1}} - 1\right)}} \cdot \frac{t \cdot \sqrt{2}}{\ell} \]
      8. +-commutative10.6%

        \[\leadsto \sqrt{\frac{1}{\frac{1}{-1 + x} + \left(\frac{x}{\color{blue}{-1 + x}} - 1\right)}} \cdot \frac{t \cdot \sqrt{2}}{\ell} \]
      9. associate-/l*10.6%

        \[\leadsto \sqrt{\frac{1}{\frac{1}{-1 + x} + \left(\frac{x}{-1 + x} - 1\right)}} \cdot \color{blue}{\frac{t}{\frac{\ell}{\sqrt{2}}}} \]
    6. Simplified10.6%

      \[\leadsto \color{blue}{\sqrt{\frac{1}{\frac{1}{-1 + x} + \left(\frac{x}{-1 + x} - 1\right)}} \cdot \frac{t}{\frac{\ell}{\sqrt{2}}}} \]
    7. Taylor expanded in x around inf 18.2%

      \[\leadsto \sqrt{\frac{1}{\frac{1}{-1 + x} + \color{blue}{\frac{1}{x}}}} \cdot \frac{t}{\frac{\ell}{\sqrt{2}}} \]
    8. Step-by-step derivation
      1. associate-/r/18.2%

        \[\leadsto \sqrt{\frac{1}{\frac{1}{-1 + x} + \frac{1}{x}}} \cdot \color{blue}{\left(\frac{t}{\ell} \cdot \sqrt{2}\right)} \]
    9. Applied egg-rr18.2%

      \[\leadsto \sqrt{\frac{1}{\frac{1}{-1 + x} + \frac{1}{x}}} \cdot \color{blue}{\left(\frac{t}{\ell} \cdot \sqrt{2}\right)} \]
    10. Step-by-step derivation
      1. associate-/r/18.2%

        \[\leadsto \sqrt{\frac{1}{\frac{1}{-1 + x} + \frac{1}{x}}} \cdot \color{blue}{\frac{t}{\frac{\ell}{\sqrt{2}}}} \]
      2. add-cube-cbrt18.1%

        \[\leadsto \sqrt{\color{blue}{\left(\sqrt[3]{\frac{1}{\frac{1}{-1 + x} + \frac{1}{x}}} \cdot \sqrt[3]{\frac{1}{\frac{1}{-1 + x} + \frac{1}{x}}}\right) \cdot \sqrt[3]{\frac{1}{\frac{1}{-1 + x} + \frac{1}{x}}}}} \cdot \frac{t}{\frac{\ell}{\sqrt{2}}} \]
      3. pow318.1%

        \[\leadsto \sqrt{\color{blue}{{\left(\sqrt[3]{\frac{1}{\frac{1}{-1 + x} + \frac{1}{x}}}\right)}^{3}}} \cdot \frac{t}{\frac{\ell}{\sqrt{2}}} \]
      4. sqrt-pow118.1%

        \[\leadsto \color{blue}{{\left(\sqrt[3]{\frac{1}{\frac{1}{-1 + x} + \frac{1}{x}}}\right)}^{\left(\frac{3}{2}\right)}} \cdot \frac{t}{\frac{\ell}{\sqrt{2}}} \]
      5. cbrt-div18.1%

        \[\leadsto {\color{blue}{\left(\frac{\sqrt[3]{1}}{\sqrt[3]{\frac{1}{-1 + x} + \frac{1}{x}}}\right)}}^{\left(\frac{3}{2}\right)} \cdot \frac{t}{\frac{\ell}{\sqrt{2}}} \]
      6. metadata-eval18.1%

        \[\leadsto {\left(\frac{\color{blue}{1}}{\sqrt[3]{\frac{1}{-1 + x} + \frac{1}{x}}}\right)}^{\left(\frac{3}{2}\right)} \cdot \frac{t}{\frac{\ell}{\sqrt{2}}} \]
      7. +-commutative18.1%

        \[\leadsto {\left(\frac{1}{\sqrt[3]{\frac{1}{\color{blue}{x + -1}} + \frac{1}{x}}}\right)}^{\left(\frac{3}{2}\right)} \cdot \frac{t}{\frac{\ell}{\sqrt{2}}} \]
      8. +-commutative18.1%

        \[\leadsto {\left(\frac{1}{\sqrt[3]{\color{blue}{\frac{1}{x} + \frac{1}{x + -1}}}}\right)}^{\left(\frac{3}{2}\right)} \cdot \frac{t}{\frac{\ell}{\sqrt{2}}} \]
      9. sqrt-pow118.1%

        \[\leadsto \color{blue}{\sqrt{{\left(\frac{1}{\sqrt[3]{\frac{1}{x} + \frac{1}{x + -1}}}\right)}^{3}}} \cdot \frac{t}{\frac{\ell}{\sqrt{2}}} \]
    11. Applied egg-rr20.1%

      \[\leadsto \color{blue}{\frac{{\left(\frac{1}{x + -1} + \frac{1}{x}\right)}^{-0.5} \cdot t}{\frac{\ell}{\sqrt{2}}}} \]

    if 1.05e-178 < t < 1.8e104

    1. Initial program 55.7%

      \[\frac{\sqrt{2} \cdot t}{\sqrt{\frac{x + 1}{x - 1} \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}} \]
    2. Simplified55.7%

      \[\leadsto \color{blue}{\sqrt{2} \cdot \frac{t}{\sqrt{\mathsf{fma}\left(\frac{x + 1}{x + -1}, \mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right), \ell \cdot \left(-\ell\right)\right)}}} \]
    3. Add Preprocessing
    4. Taylor expanded in l around 0 54.4%

      \[\leadsto \sqrt{2} \cdot \frac{t}{\sqrt{\color{blue}{2 \cdot \frac{{t}^{2} \cdot \left(1 + x\right)}{x - 1} + {\ell}^{2} \cdot \left(\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1\right)}}} \]
    5. Step-by-step derivation
      1. fma-define54.4%

        \[\leadsto \sqrt{2} \cdot \frac{t}{\sqrt{\color{blue}{\mathsf{fma}\left(2, \frac{{t}^{2} \cdot \left(1 + x\right)}{x - 1}, {\ell}^{2} \cdot \left(\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1\right)\right)}}} \]
      2. associate-/l*69.3%

        \[\leadsto \sqrt{2} \cdot \frac{t}{\sqrt{\mathsf{fma}\left(2, \color{blue}{\frac{{t}^{2}}{\frac{x - 1}{1 + x}}}, {\ell}^{2} \cdot \left(\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1\right)\right)}} \]
      3. sub-neg69.3%

        \[\leadsto \sqrt{2} \cdot \frac{t}{\sqrt{\mathsf{fma}\left(2, \frac{{t}^{2}}{\frac{\color{blue}{x + \left(-1\right)}}{1 + x}}, {\ell}^{2} \cdot \left(\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1\right)\right)}} \]
      4. metadata-eval69.3%

        \[\leadsto \sqrt{2} \cdot \frac{t}{\sqrt{\mathsf{fma}\left(2, \frac{{t}^{2}}{\frac{x + \color{blue}{-1}}{1 + x}}, {\ell}^{2} \cdot \left(\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1\right)\right)}} \]
      5. +-commutative69.3%

        \[\leadsto \sqrt{2} \cdot \frac{t}{\sqrt{\mathsf{fma}\left(2, \frac{{t}^{2}}{\frac{\color{blue}{-1 + x}}{1 + x}}, {\ell}^{2} \cdot \left(\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1\right)\right)}} \]
      6. +-commutative69.3%

        \[\leadsto \sqrt{2} \cdot \frac{t}{\sqrt{\mathsf{fma}\left(2, \frac{{t}^{2}}{\frac{-1 + x}{\color{blue}{x + 1}}}, {\ell}^{2} \cdot \left(\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1\right)\right)}} \]
      7. associate--l+72.2%

        \[\leadsto \sqrt{2} \cdot \frac{t}{\sqrt{\mathsf{fma}\left(2, \frac{{t}^{2}}{\frac{-1 + x}{x + 1}}, {\ell}^{2} \cdot \color{blue}{\left(\frac{1}{x - 1} + \left(\frac{x}{x - 1} - 1\right)\right)}\right)}} \]
      8. sub-neg72.2%

        \[\leadsto \sqrt{2} \cdot \frac{t}{\sqrt{\mathsf{fma}\left(2, \frac{{t}^{2}}{\frac{-1 + x}{x + 1}}, {\ell}^{2} \cdot \left(\frac{1}{\color{blue}{x + \left(-1\right)}} + \left(\frac{x}{x - 1} - 1\right)\right)\right)}} \]
      9. metadata-eval72.2%

        \[\leadsto \sqrt{2} \cdot \frac{t}{\sqrt{\mathsf{fma}\left(2, \frac{{t}^{2}}{\frac{-1 + x}{x + 1}}, {\ell}^{2} \cdot \left(\frac{1}{x + \color{blue}{-1}} + \left(\frac{x}{x - 1} - 1\right)\right)\right)}} \]
      10. +-commutative72.2%

        \[\leadsto \sqrt{2} \cdot \frac{t}{\sqrt{\mathsf{fma}\left(2, \frac{{t}^{2}}{\frac{-1 + x}{x + 1}}, {\ell}^{2} \cdot \left(\frac{1}{\color{blue}{-1 + x}} + \left(\frac{x}{x - 1} - 1\right)\right)\right)}} \]
      11. sub-neg72.2%

        \[\leadsto \sqrt{2} \cdot \frac{t}{\sqrt{\mathsf{fma}\left(2, \frac{{t}^{2}}{\frac{-1 + x}{x + 1}}, {\ell}^{2} \cdot \left(\frac{1}{-1 + x} + \left(\frac{x}{\color{blue}{x + \left(-1\right)}} - 1\right)\right)\right)}} \]
      12. metadata-eval72.2%

        \[\leadsto \sqrt{2} \cdot \frac{t}{\sqrt{\mathsf{fma}\left(2, \frac{{t}^{2}}{\frac{-1 + x}{x + 1}}, {\ell}^{2} \cdot \left(\frac{1}{-1 + x} + \left(\frac{x}{x + \color{blue}{-1}} - 1\right)\right)\right)}} \]
      13. +-commutative72.2%

        \[\leadsto \sqrt{2} \cdot \frac{t}{\sqrt{\mathsf{fma}\left(2, \frac{{t}^{2}}{\frac{-1 + x}{x + 1}}, {\ell}^{2} \cdot \left(\frac{1}{-1 + x} + \left(\frac{x}{\color{blue}{-1 + x}} - 1\right)\right)\right)}} \]
    6. Simplified72.2%

      \[\leadsto \sqrt{2} \cdot \frac{t}{\sqrt{\color{blue}{\mathsf{fma}\left(2, \frac{{t}^{2}}{\frac{-1 + x}{x + 1}}, {\ell}^{2} \cdot \left(\frac{1}{-1 + x} + \left(\frac{x}{-1 + x} - 1\right)\right)\right)}}} \]
    7. Taylor expanded in x around inf 84.0%

      \[\leadsto \sqrt{2} \cdot \frac{t}{\sqrt{\mathsf{fma}\left(2, \frac{{t}^{2}}{\frac{-1 + x}{x + 1}}, \color{blue}{2 \cdot \frac{{\ell}^{2}}{x}}\right)}} \]
    8. Step-by-step derivation
      1. associate-*r/84.0%

        \[\leadsto \sqrt{2} \cdot \frac{t}{\sqrt{\mathsf{fma}\left(2, \frac{{t}^{2}}{\frac{-1 + x}{x + 1}}, \color{blue}{\frac{2 \cdot {\ell}^{2}}{x}}\right)}} \]
    9. Simplified84.0%

      \[\leadsto \sqrt{2} \cdot \frac{t}{\sqrt{\mathsf{fma}\left(2, \frac{{t}^{2}}{\frac{-1 + x}{x + 1}}, \color{blue}{\frac{2 \cdot {\ell}^{2}}{x}}\right)}} \]

    if 1.8e104 < t

    1. Initial program 13.3%

      \[\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}} \]
    2. Simplified13.3%

      \[\leadsto \color{blue}{\sqrt{2} \cdot \frac{t}{\sqrt{\mathsf{fma}\left(\frac{x + 1}{x + -1}, \mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right), \ell \cdot \left(-\ell\right)\right)}}} \]
    3. Add Preprocessing
    4. Taylor expanded in t around inf 96.8%

      \[\leadsto \sqrt{2} \cdot \frac{t}{\color{blue}{\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{1 + x}{x - 1}}}} \]
    5. Step-by-step derivation
      1. +-commutative96.8%

        \[\leadsto \sqrt{2} \cdot \frac{t}{\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{\color{blue}{x + 1}}{x - 1}}} \]
      2. sub-neg96.8%

        \[\leadsto \sqrt{2} \cdot \frac{t}{\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{x + 1}{\color{blue}{x + \left(-1\right)}}}} \]
      3. metadata-eval96.8%

        \[\leadsto \sqrt{2} \cdot \frac{t}{\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{x + 1}{x + \color{blue}{-1}}}} \]
      4. +-commutative96.8%

        \[\leadsto \sqrt{2} \cdot \frac{t}{\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{x + 1}{\color{blue}{-1 + x}}}} \]
    6. Simplified96.8%

      \[\leadsto \sqrt{2} \cdot \frac{t}{\color{blue}{\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{x + 1}{-1 + x}}}} \]
    7. Taylor expanded in t around 0 97.1%

      \[\leadsto \color{blue}{\sqrt{\frac{x - 1}{1 + x}}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification47.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 1.05 \cdot 10^{-178}:\\ \;\;\;\;\frac{t \cdot {\left(\frac{1}{x} + \frac{1}{x + -1}\right)}^{-0.5}}{\frac{\ell}{\sqrt{2}}}\\ \mathbf{elif}\;t \leq 1.8 \cdot 10^{+104}:\\ \;\;\;\;\sqrt{2} \cdot \frac{t}{\sqrt{\mathsf{fma}\left(2, \frac{{t}^{2}}{\frac{x + -1}{1 + x}}, \frac{2 \cdot {\ell}^{2}}{x}\right)}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{x + -1}{1 + x}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 80.5% accurate, 0.5× speedup?

\[\begin{array}{l} l_m = \left|\ell\right| \\ t_m = \left|t\right| \\ t_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \begin{array}{l} \mathbf{if}\;\frac{t\_m \cdot \sqrt{2}}{\sqrt{\frac{1 + x}{x + -1} \cdot \left(l\_m \cdot l\_m + 2 \cdot \left(t\_m \cdot t\_m\right)\right) - l\_m \cdot l\_m}} \leq \infty:\\ \;\;\;\;\sqrt{\frac{x + -1}{1 + x}}\\ \mathbf{else}:\\ \;\;\;\;t\_m \cdot \left(\sqrt{\frac{1}{\frac{1}{x} + \frac{1}{x + -1}}} \cdot \frac{\sqrt{2}}{l\_m}\right)\\ \end{array} \end{array} \]
l_m = (fabs.f64 l)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s x l_m t_m)
 :precision binary64
 (*
  t_s
  (if (<=
       (/
        (* t_m (sqrt 2.0))
        (sqrt
         (-
          (* (/ (+ 1.0 x) (+ x -1.0)) (+ (* l_m l_m) (* 2.0 (* t_m t_m))))
          (* l_m l_m))))
       INFINITY)
    (sqrt (/ (+ x -1.0) (+ 1.0 x)))
    (*
     t_m
     (* (sqrt (/ 1.0 (+ (/ 1.0 x) (/ 1.0 (+ x -1.0))))) (/ (sqrt 2.0) l_m))))))
l_m = fabs(l);
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double x, double l_m, double t_m) {
	double tmp;
	if (((t_m * sqrt(2.0)) / sqrt(((((1.0 + x) / (x + -1.0)) * ((l_m * l_m) + (2.0 * (t_m * t_m)))) - (l_m * l_m)))) <= ((double) INFINITY)) {
		tmp = sqrt(((x + -1.0) / (1.0 + x)));
	} else {
		tmp = t_m * (sqrt((1.0 / ((1.0 / x) + (1.0 / (x + -1.0))))) * (sqrt(2.0) / l_m));
	}
	return t_s * tmp;
}
l_m = Math.abs(l);
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double l_m, double t_m) {
	double tmp;
	if (((t_m * Math.sqrt(2.0)) / Math.sqrt(((((1.0 + x) / (x + -1.0)) * ((l_m * l_m) + (2.0 * (t_m * t_m)))) - (l_m * l_m)))) <= Double.POSITIVE_INFINITY) {
		tmp = Math.sqrt(((x + -1.0) / (1.0 + x)));
	} else {
		tmp = t_m * (Math.sqrt((1.0 / ((1.0 / x) + (1.0 / (x + -1.0))))) * (Math.sqrt(2.0) / l_m));
	}
	return t_s * tmp;
}
l_m = math.fabs(l)
t_m = math.fabs(t)
t_s = math.copysign(1.0, t)
def code(t_s, x, l_m, t_m):
	tmp = 0
	if ((t_m * math.sqrt(2.0)) / math.sqrt(((((1.0 + x) / (x + -1.0)) * ((l_m * l_m) + (2.0 * (t_m * t_m)))) - (l_m * l_m)))) <= math.inf:
		tmp = math.sqrt(((x + -1.0) / (1.0 + x)))
	else:
		tmp = t_m * (math.sqrt((1.0 / ((1.0 / x) + (1.0 / (x + -1.0))))) * (math.sqrt(2.0) / l_m))
	return t_s * tmp
l_m = abs(l)
t_m = abs(t)
t_s = copysign(1.0, t)
function code(t_s, x, l_m, t_m)
	tmp = 0.0
	if (Float64(Float64(t_m * sqrt(2.0)) / sqrt(Float64(Float64(Float64(Float64(1.0 + x) / Float64(x + -1.0)) * Float64(Float64(l_m * l_m) + Float64(2.0 * Float64(t_m * t_m)))) - Float64(l_m * l_m)))) <= Inf)
		tmp = sqrt(Float64(Float64(x + -1.0) / Float64(1.0 + x)));
	else
		tmp = Float64(t_m * Float64(sqrt(Float64(1.0 / Float64(Float64(1.0 / x) + Float64(1.0 / Float64(x + -1.0))))) * Float64(sqrt(2.0) / l_m)));
	end
	return Float64(t_s * tmp)
end
l_m = abs(l);
t_m = abs(t);
t_s = sign(t) * abs(1.0);
function tmp_2 = code(t_s, x, l_m, t_m)
	tmp = 0.0;
	if (((t_m * sqrt(2.0)) / sqrt(((((1.0 + x) / (x + -1.0)) * ((l_m * l_m) + (2.0 * (t_m * t_m)))) - (l_m * l_m)))) <= Inf)
		tmp = sqrt(((x + -1.0) / (1.0 + x)));
	else
		tmp = t_m * (sqrt((1.0 / ((1.0 / x) + (1.0 / (x + -1.0))))) * (sqrt(2.0) / l_m));
	end
	tmp_2 = t_s * tmp;
end
l_m = N[Abs[l], $MachinePrecision]
t_m = N[Abs[t], $MachinePrecision]
t_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, l$95$m_, t$95$m_] := N[(t$95$s * If[LessEqual[N[(N[(t$95$m * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(N[(N[(N[(1.0 + x), $MachinePrecision] / N[(x + -1.0), $MachinePrecision]), $MachinePrecision] * N[(N[(l$95$m * l$95$m), $MachinePrecision] + N[(2.0 * N[(t$95$m * t$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(l$95$m * l$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], Infinity], N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(1.0 + x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(t$95$m * N[(N[Sqrt[N[(1.0 / N[(N[(1.0 / x), $MachinePrecision] + N[(1.0 / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[2.0], $MachinePrecision] / l$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)

\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{t\_m \cdot \sqrt{2}}{\sqrt{\frac{1 + x}{x + -1} \cdot \left(l\_m \cdot l\_m + 2 \cdot \left(t\_m \cdot t\_m\right)\right) - l\_m \cdot l\_m}} \leq \infty:\\
\;\;\;\;\sqrt{\frac{x + -1}{1 + x}}\\

\mathbf{else}:\\
\;\;\;\;t\_m \cdot \left(\sqrt{\frac{1}{\frac{1}{x} + \frac{1}{x + -1}}} \cdot \frac{\sqrt{2}}{l\_m}\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 (*.f64 (sqrt.f64 2) t) (sqrt.f64 (-.f64 (*.f64 (/.f64 (+.f64 x 1) (-.f64 x 1)) (+.f64 (*.f64 l l) (*.f64 2 (*.f64 t t)))) (*.f64 l l)))) < +inf.0

    1. Initial program 37.2%

      \[\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}} \]
    2. Simplified37.1%

      \[\leadsto \color{blue}{\sqrt{2} \cdot \frac{t}{\sqrt{\mathsf{fma}\left(\frac{x + 1}{x + -1}, \mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right), \ell \cdot \left(-\ell\right)\right)}}} \]
    3. Add Preprocessing
    4. Taylor expanded in t around inf 40.6%

      \[\leadsto \sqrt{2} \cdot \frac{t}{\color{blue}{\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{1 + x}{x - 1}}}} \]
    5. Step-by-step derivation
      1. +-commutative40.6%

        \[\leadsto \sqrt{2} \cdot \frac{t}{\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{\color{blue}{x + 1}}{x - 1}}} \]
      2. sub-neg40.6%

        \[\leadsto \sqrt{2} \cdot \frac{t}{\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{x + 1}{\color{blue}{x + \left(-1\right)}}}} \]
      3. metadata-eval40.6%

        \[\leadsto \sqrt{2} \cdot \frac{t}{\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{x + 1}{x + \color{blue}{-1}}}} \]
      4. +-commutative40.6%

        \[\leadsto \sqrt{2} \cdot \frac{t}{\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{x + 1}{\color{blue}{-1 + x}}}} \]
    6. Simplified40.6%

      \[\leadsto \sqrt{2} \cdot \frac{t}{\color{blue}{\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{x + 1}{-1 + x}}}} \]
    7. Taylor expanded in t around 0 40.7%

      \[\leadsto \color{blue}{\sqrt{\frac{x - 1}{1 + x}}} \]

    if +inf.0 < (/.f64 (*.f64 (sqrt.f64 2) t) (sqrt.f64 (-.f64 (*.f64 (/.f64 (+.f64 x 1) (-.f64 x 1)) (+.f64 (*.f64 l l) (*.f64 2 (*.f64 t t)))) (*.f64 l l))))

    1. Initial program 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}} \]
    2. Simplified0.0%

      \[\leadsto \color{blue}{\frac{\sqrt{2}}{\sqrt{\frac{x + 1}{x + -1} \cdot \mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right) - \ell \cdot \ell}} \cdot t} \]
    3. Add Preprocessing
    4. Taylor expanded in l around inf 8.0%

      \[\leadsto \color{blue}{\left(\frac{\sqrt{2}}{\ell} \cdot \sqrt{\frac{1}{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}}\right)} \cdot t \]
    5. Step-by-step derivation
      1. *-commutative8.0%

        \[\leadsto \color{blue}{\left(\sqrt{\frac{1}{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}} \cdot \frac{\sqrt{2}}{\ell}\right)} \cdot t \]
      2. associate--l+29.3%

        \[\leadsto \left(\sqrt{\frac{1}{\color{blue}{\frac{1}{x - 1} + \left(\frac{x}{x - 1} - 1\right)}}} \cdot \frac{\sqrt{2}}{\ell}\right) \cdot t \]
      3. sub-neg29.3%

        \[\leadsto \left(\sqrt{\frac{1}{\frac{1}{\color{blue}{x + \left(-1\right)}} + \left(\frac{x}{x - 1} - 1\right)}} \cdot \frac{\sqrt{2}}{\ell}\right) \cdot t \]
      4. metadata-eval29.3%

        \[\leadsto \left(\sqrt{\frac{1}{\frac{1}{x + \color{blue}{-1}} + \left(\frac{x}{x - 1} - 1\right)}} \cdot \frac{\sqrt{2}}{\ell}\right) \cdot t \]
      5. +-commutative29.3%

        \[\leadsto \left(\sqrt{\frac{1}{\frac{1}{\color{blue}{-1 + x}} + \left(\frac{x}{x - 1} - 1\right)}} \cdot \frac{\sqrt{2}}{\ell}\right) \cdot t \]
      6. sub-neg29.3%

        \[\leadsto \left(\sqrt{\frac{1}{\frac{1}{-1 + x} + \left(\frac{x}{\color{blue}{x + \left(-1\right)}} - 1\right)}} \cdot \frac{\sqrt{2}}{\ell}\right) \cdot t \]
      7. metadata-eval29.3%

        \[\leadsto \left(\sqrt{\frac{1}{\frac{1}{-1 + x} + \left(\frac{x}{x + \color{blue}{-1}} - 1\right)}} \cdot \frac{\sqrt{2}}{\ell}\right) \cdot t \]
      8. +-commutative29.3%

        \[\leadsto \left(\sqrt{\frac{1}{\frac{1}{-1 + x} + \left(\frac{x}{\color{blue}{-1 + x}} - 1\right)}} \cdot \frac{\sqrt{2}}{\ell}\right) \cdot t \]
    6. Simplified29.3%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{1}{\frac{1}{-1 + x} + \left(\frac{x}{-1 + x} - 1\right)}} \cdot \frac{\sqrt{2}}{\ell}\right)} \cdot t \]
    7. Taylor expanded in x around inf 50.6%

      \[\leadsto \left(\sqrt{\frac{1}{\frac{1}{-1 + x} + \color{blue}{\frac{1}{x}}}} \cdot \frac{\sqrt{2}}{\ell}\right) \cdot t \]
  3. Recombined 2 regimes into one program.
  4. Final simplification42.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{t \cdot \sqrt{2}}{\sqrt{\frac{1 + x}{x + -1} \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}} \leq \infty:\\ \;\;\;\;\sqrt{\frac{x + -1}{1 + x}}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(\sqrt{\frac{1}{\frac{1}{x} + \frac{1}{x + -1}}} \cdot \frac{\sqrt{2}}{\ell}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 79.8% accurate, 1.0× speedup?

\[\begin{array}{l} l_m = \left|\ell\right| \\ t_m = \left|t\right| \\ t_s = \mathsf{copysign}\left(1, t\right) \\ \begin{array}{l} t_2 := t\_m \cdot \left({\left(\frac{1}{x} + \frac{1}{x + -1}\right)}^{-0.5} \cdot \frac{\sqrt{2}}{l\_m}\right)\\ t\_s \cdot \begin{array}{l} \mathbf{if}\;t\_m \leq 1.5 \cdot 10^{-165}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_m \leq 1.5 \cdot 10^{-95}:\\ \;\;\;\;1 - \frac{1}{x}\\ \mathbf{elif}\;t\_m \leq 5.5 \cdot 10^{-86}:\\ \;\;\;\;t\_2\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{x + -1}{1 + x}}\\ \end{array} \end{array} \end{array} \]
l_m = (fabs.f64 l)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s x l_m t_m)
 :precision binary64
 (let* ((t_2
         (*
          t_m
          (* (pow (+ (/ 1.0 x) (/ 1.0 (+ x -1.0))) -0.5) (/ (sqrt 2.0) l_m)))))
   (*
    t_s
    (if (<= t_m 1.5e-165)
      t_2
      (if (<= t_m 1.5e-95)
        (- 1.0 (/ 1.0 x))
        (if (<= t_m 5.5e-86) t_2 (sqrt (/ (+ x -1.0) (+ 1.0 x)))))))))
l_m = fabs(l);
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double x, double l_m, double t_m) {
	double t_2 = t_m * (pow(((1.0 / x) + (1.0 / (x + -1.0))), -0.5) * (sqrt(2.0) / l_m));
	double tmp;
	if (t_m <= 1.5e-165) {
		tmp = t_2;
	} else if (t_m <= 1.5e-95) {
		tmp = 1.0 - (1.0 / x);
	} else if (t_m <= 5.5e-86) {
		tmp = t_2;
	} else {
		tmp = sqrt(((x + -1.0) / (1.0 + x)));
	}
	return t_s * tmp;
}
l_m = abs(l)
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, x, l_m, t_m)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: x
    real(8), intent (in) :: l_m
    real(8), intent (in) :: t_m
    real(8) :: t_2
    real(8) :: tmp
    t_2 = t_m * ((((1.0d0 / x) + (1.0d0 / (x + (-1.0d0)))) ** (-0.5d0)) * (sqrt(2.0d0) / l_m))
    if (t_m <= 1.5d-165) then
        tmp = t_2
    else if (t_m <= 1.5d-95) then
        tmp = 1.0d0 - (1.0d0 / x)
    else if (t_m <= 5.5d-86) then
        tmp = t_2
    else
        tmp = sqrt(((x + (-1.0d0)) / (1.0d0 + x)))
    end if
    code = t_s * tmp
end function
l_m = Math.abs(l);
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double l_m, double t_m) {
	double t_2 = t_m * (Math.pow(((1.0 / x) + (1.0 / (x + -1.0))), -0.5) * (Math.sqrt(2.0) / l_m));
	double tmp;
	if (t_m <= 1.5e-165) {
		tmp = t_2;
	} else if (t_m <= 1.5e-95) {
		tmp = 1.0 - (1.0 / x);
	} else if (t_m <= 5.5e-86) {
		tmp = t_2;
	} else {
		tmp = Math.sqrt(((x + -1.0) / (1.0 + x)));
	}
	return t_s * tmp;
}
l_m = math.fabs(l)
t_m = math.fabs(t)
t_s = math.copysign(1.0, t)
def code(t_s, x, l_m, t_m):
	t_2 = t_m * (math.pow(((1.0 / x) + (1.0 / (x + -1.0))), -0.5) * (math.sqrt(2.0) / l_m))
	tmp = 0
	if t_m <= 1.5e-165:
		tmp = t_2
	elif t_m <= 1.5e-95:
		tmp = 1.0 - (1.0 / x)
	elif t_m <= 5.5e-86:
		tmp = t_2
	else:
		tmp = math.sqrt(((x + -1.0) / (1.0 + x)))
	return t_s * tmp
l_m = abs(l)
t_m = abs(t)
t_s = copysign(1.0, t)
function code(t_s, x, l_m, t_m)
	t_2 = Float64(t_m * Float64((Float64(Float64(1.0 / x) + Float64(1.0 / Float64(x + -1.0))) ^ -0.5) * Float64(sqrt(2.0) / l_m)))
	tmp = 0.0
	if (t_m <= 1.5e-165)
		tmp = t_2;
	elseif (t_m <= 1.5e-95)
		tmp = Float64(1.0 - Float64(1.0 / x));
	elseif (t_m <= 5.5e-86)
		tmp = t_2;
	else
		tmp = sqrt(Float64(Float64(x + -1.0) / Float64(1.0 + x)));
	end
	return Float64(t_s * tmp)
end
l_m = abs(l);
t_m = abs(t);
t_s = sign(t) * abs(1.0);
function tmp_2 = code(t_s, x, l_m, t_m)
	t_2 = t_m * ((((1.0 / x) + (1.0 / (x + -1.0))) ^ -0.5) * (sqrt(2.0) / l_m));
	tmp = 0.0;
	if (t_m <= 1.5e-165)
		tmp = t_2;
	elseif (t_m <= 1.5e-95)
		tmp = 1.0 - (1.0 / x);
	elseif (t_m <= 5.5e-86)
		tmp = t_2;
	else
		tmp = sqrt(((x + -1.0) / (1.0 + x)));
	end
	tmp_2 = t_s * tmp;
end
l_m = N[Abs[l], $MachinePrecision]
t_m = N[Abs[t], $MachinePrecision]
t_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, l$95$m_, t$95$m_] := Block[{t$95$2 = N[(t$95$m * N[(N[Power[N[(N[(1.0 / x), $MachinePrecision] + N[(1.0 / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(N[Sqrt[2.0], $MachinePrecision] / l$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(t$95$s * If[LessEqual[t$95$m, 1.5e-165], t$95$2, If[LessEqual[t$95$m, 1.5e-95], N[(1.0 - N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 5.5e-86], t$95$2, N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(1.0 + x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]), $MachinePrecision]]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)

\\
\begin{array}{l}
t_2 := t\_m \cdot \left({\left(\frac{1}{x} + \frac{1}{x + -1}\right)}^{-0.5} \cdot \frac{\sqrt{2}}{l\_m}\right)\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 1.5 \cdot 10^{-165}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;t\_m \leq 1.5 \cdot 10^{-95}:\\
\;\;\;\;1 - \frac{1}{x}\\

\mathbf{elif}\;t\_m \leq 5.5 \cdot 10^{-86}:\\
\;\;\;\;t\_2\\

\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{x + -1}{1 + x}}\\


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < 1.49999999999999989e-165 or 1.5e-95 < t < 5.5e-86

    1. Initial program 28.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}} \]
    2. Simplified27.9%

      \[\leadsto \color{blue}{\sqrt{2} \cdot \frac{t}{\sqrt{\mathsf{fma}\left(\frac{x + 1}{x + -1}, \mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right), \ell \cdot \left(-\ell\right)\right)}}} \]
    3. Add Preprocessing
    4. Taylor expanded in l around inf 2.8%

      \[\leadsto \color{blue}{\frac{t \cdot \sqrt{2}}{\ell} \cdot \sqrt{\frac{1}{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}}} \]
    5. Step-by-step derivation
      1. *-commutative2.8%

        \[\leadsto \color{blue}{\sqrt{\frac{1}{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}} \cdot \frac{t \cdot \sqrt{2}}{\ell}} \]
      2. associate--l+10.7%

        \[\leadsto \sqrt{\frac{1}{\color{blue}{\frac{1}{x - 1} + \left(\frac{x}{x - 1} - 1\right)}}} \cdot \frac{t \cdot \sqrt{2}}{\ell} \]
      3. sub-neg10.7%

        \[\leadsto \sqrt{\frac{1}{\frac{1}{\color{blue}{x + \left(-1\right)}} + \left(\frac{x}{x - 1} - 1\right)}} \cdot \frac{t \cdot \sqrt{2}}{\ell} \]
      4. metadata-eval10.7%

        \[\leadsto \sqrt{\frac{1}{\frac{1}{x + \color{blue}{-1}} + \left(\frac{x}{x - 1} - 1\right)}} \cdot \frac{t \cdot \sqrt{2}}{\ell} \]
      5. +-commutative10.7%

        \[\leadsto \sqrt{\frac{1}{\frac{1}{\color{blue}{-1 + x}} + \left(\frac{x}{x - 1} - 1\right)}} \cdot \frac{t \cdot \sqrt{2}}{\ell} \]
      6. sub-neg10.7%

        \[\leadsto \sqrt{\frac{1}{\frac{1}{-1 + x} + \left(\frac{x}{\color{blue}{x + \left(-1\right)}} - 1\right)}} \cdot \frac{t \cdot \sqrt{2}}{\ell} \]
      7. metadata-eval10.7%

        \[\leadsto \sqrt{\frac{1}{\frac{1}{-1 + x} + \left(\frac{x}{x + \color{blue}{-1}} - 1\right)}} \cdot \frac{t \cdot \sqrt{2}}{\ell} \]
      8. +-commutative10.7%

        \[\leadsto \sqrt{\frac{1}{\frac{1}{-1 + x} + \left(\frac{x}{\color{blue}{-1 + x}} - 1\right)}} \cdot \frac{t \cdot \sqrt{2}}{\ell} \]
      9. associate-/l*10.7%

        \[\leadsto \sqrt{\frac{1}{\frac{1}{-1 + x} + \left(\frac{x}{-1 + x} - 1\right)}} \cdot \color{blue}{\frac{t}{\frac{\ell}{\sqrt{2}}}} \]
    6. Simplified10.7%

      \[\leadsto \color{blue}{\sqrt{\frac{1}{\frac{1}{-1 + x} + \left(\frac{x}{-1 + x} - 1\right)}} \cdot \frac{t}{\frac{\ell}{\sqrt{2}}}} \]
    7. Taylor expanded in x around inf 19.1%

      \[\leadsto \sqrt{\frac{1}{\frac{1}{-1 + x} + \color{blue}{\frac{1}{x}}}} \cdot \frac{t}{\frac{\ell}{\sqrt{2}}} \]
    8. Step-by-step derivation
      1. associate-/r/19.1%

        \[\leadsto \sqrt{\frac{1}{\frac{1}{-1 + x} + \frac{1}{x}}} \cdot \color{blue}{\left(\frac{t}{\ell} \cdot \sqrt{2}\right)} \]
    9. Applied egg-rr19.1%

      \[\leadsto \sqrt{\frac{1}{\frac{1}{-1 + x} + \frac{1}{x}}} \cdot \color{blue}{\left(\frac{t}{\ell} \cdot \sqrt{2}\right)} \]
    10. Step-by-step derivation
      1. associate-/r/19.1%

        \[\leadsto \sqrt{\frac{1}{\frac{1}{-1 + x} + \frac{1}{x}}} \cdot \color{blue}{\frac{t}{\frac{\ell}{\sqrt{2}}}} \]
      2. add-cube-cbrt19.0%

        \[\leadsto \sqrt{\color{blue}{\left(\sqrt[3]{\frac{1}{\frac{1}{-1 + x} + \frac{1}{x}}} \cdot \sqrt[3]{\frac{1}{\frac{1}{-1 + x} + \frac{1}{x}}}\right) \cdot \sqrt[3]{\frac{1}{\frac{1}{-1 + x} + \frac{1}{x}}}}} \cdot \frac{t}{\frac{\ell}{\sqrt{2}}} \]
      3. pow319.0%

        \[\leadsto \sqrt{\color{blue}{{\left(\sqrt[3]{\frac{1}{\frac{1}{-1 + x} + \frac{1}{x}}}\right)}^{3}}} \cdot \frac{t}{\frac{\ell}{\sqrt{2}}} \]
      4. sqrt-pow119.0%

        \[\leadsto \color{blue}{{\left(\sqrt[3]{\frac{1}{\frac{1}{-1 + x} + \frac{1}{x}}}\right)}^{\left(\frac{3}{2}\right)}} \cdot \frac{t}{\frac{\ell}{\sqrt{2}}} \]
      5. cbrt-div19.0%

        \[\leadsto {\color{blue}{\left(\frac{\sqrt[3]{1}}{\sqrt[3]{\frac{1}{-1 + x} + \frac{1}{x}}}\right)}}^{\left(\frac{3}{2}\right)} \cdot \frac{t}{\frac{\ell}{\sqrt{2}}} \]
      6. metadata-eval19.0%

        \[\leadsto {\left(\frac{\color{blue}{1}}{\sqrt[3]{\frac{1}{-1 + x} + \frac{1}{x}}}\right)}^{\left(\frac{3}{2}\right)} \cdot \frac{t}{\frac{\ell}{\sqrt{2}}} \]
      7. +-commutative19.0%

        \[\leadsto {\left(\frac{1}{\sqrt[3]{\frac{1}{\color{blue}{x + -1}} + \frac{1}{x}}}\right)}^{\left(\frac{3}{2}\right)} \cdot \frac{t}{\frac{\ell}{\sqrt{2}}} \]
      8. +-commutative19.0%

        \[\leadsto {\left(\frac{1}{\sqrt[3]{\color{blue}{\frac{1}{x} + \frac{1}{x + -1}}}}\right)}^{\left(\frac{3}{2}\right)} \cdot \frac{t}{\frac{\ell}{\sqrt{2}}} \]
      9. sqrt-pow119.0%

        \[\leadsto \color{blue}{\sqrt{{\left(\frac{1}{\sqrt[3]{\frac{1}{x} + \frac{1}{x + -1}}}\right)}^{3}}} \cdot \frac{t}{\frac{\ell}{\sqrt{2}}} \]
    11. Applied egg-rr20.9%

      \[\leadsto \color{blue}{\frac{{\left(\frac{1}{x + -1} + \frac{1}{x}\right)}^{-0.5} \cdot t}{\frac{\ell}{\sqrt{2}}}} \]
    12. Step-by-step derivation
      1. associate-/r/20.9%

        \[\leadsto \color{blue}{\frac{{\left(\frac{1}{x + -1} + \frac{1}{x}\right)}^{-0.5} \cdot t}{\ell} \cdot \sqrt{2}} \]
      2. associate-*l/21.0%

        \[\leadsto \color{blue}{\frac{\left({\left(\frac{1}{x + -1} + \frac{1}{x}\right)}^{-0.5} \cdot t\right) \cdot \sqrt{2}}{\ell}} \]
      3. associate-*r/21.0%

        \[\leadsto \color{blue}{\left({\left(\frac{1}{x + -1} + \frac{1}{x}\right)}^{-0.5} \cdot t\right) \cdot \frac{\sqrt{2}}{\ell}} \]
      4. *-commutative21.0%

        \[\leadsto \color{blue}{\left(t \cdot {\left(\frac{1}{x + -1} + \frac{1}{x}\right)}^{-0.5}\right)} \cdot \frac{\sqrt{2}}{\ell} \]
      5. associate-*l*20.9%

        \[\leadsto \color{blue}{t \cdot \left({\left(\frac{1}{x + -1} + \frac{1}{x}\right)}^{-0.5} \cdot \frac{\sqrt{2}}{\ell}\right)} \]
      6. metadata-eval20.9%

        \[\leadsto t \cdot \left({\left(\frac{1}{x + \color{blue}{\left(-1\right)}} + \frac{1}{x}\right)}^{-0.5} \cdot \frac{\sqrt{2}}{\ell}\right) \]
      7. sub-neg20.9%

        \[\leadsto t \cdot \left({\left(\frac{1}{\color{blue}{x - 1}} + \frac{1}{x}\right)}^{-0.5} \cdot \frac{\sqrt{2}}{\ell}\right) \]
      8. +-commutative20.9%

        \[\leadsto t \cdot \left({\color{blue}{\left(\frac{1}{x} + \frac{1}{x - 1}\right)}}^{-0.5} \cdot \frac{\sqrt{2}}{\ell}\right) \]
      9. sub-neg20.9%

        \[\leadsto t \cdot \left({\left(\frac{1}{x} + \frac{1}{\color{blue}{x + \left(-1\right)}}\right)}^{-0.5} \cdot \frac{\sqrt{2}}{\ell}\right) \]
      10. metadata-eval20.9%

        \[\leadsto t \cdot \left({\left(\frac{1}{x} + \frac{1}{x + \color{blue}{-1}}\right)}^{-0.5} \cdot \frac{\sqrt{2}}{\ell}\right) \]
      11. +-commutative20.9%

        \[\leadsto t \cdot \left({\left(\frac{1}{x} + \frac{1}{\color{blue}{-1 + x}}\right)}^{-0.5} \cdot \frac{\sqrt{2}}{\ell}\right) \]
    13. Simplified20.9%

      \[\leadsto \color{blue}{t \cdot \left({\left(\frac{1}{x} + \frac{1}{-1 + x}\right)}^{-0.5} \cdot \frac{\sqrt{2}}{\ell}\right)} \]

    if 1.49999999999999989e-165 < t < 1.5e-95

    1. Initial program 43.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}} \]
    2. Simplified43.4%

      \[\leadsto \color{blue}{\sqrt{2} \cdot \frac{t}{\sqrt{\mathsf{fma}\left(\frac{x + 1}{x + -1}, \mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right), \ell \cdot \left(-\ell\right)\right)}}} \]
    3. Add Preprocessing
    4. Taylor expanded in t around inf 45.7%

      \[\leadsto \sqrt{2} \cdot \frac{t}{\color{blue}{\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{1 + x}{x - 1}}}} \]
    5. Step-by-step derivation
      1. +-commutative45.7%

        \[\leadsto \sqrt{2} \cdot \frac{t}{\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{\color{blue}{x + 1}}{x - 1}}} \]
      2. sub-neg45.7%

        \[\leadsto \sqrt{2} \cdot \frac{t}{\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{x + 1}{\color{blue}{x + \left(-1\right)}}}} \]
      3. metadata-eval45.7%

        \[\leadsto \sqrt{2} \cdot \frac{t}{\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{x + 1}{x + \color{blue}{-1}}}} \]
      4. +-commutative45.7%

        \[\leadsto \sqrt{2} \cdot \frac{t}{\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{x + 1}{\color{blue}{-1 + x}}}} \]
    6. Simplified45.7%

      \[\leadsto \sqrt{2} \cdot \frac{t}{\color{blue}{\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{x + 1}{-1 + x}}}} \]
    7. Taylor expanded in x around inf 45.7%

      \[\leadsto \color{blue}{1 - \frac{1}{x}} \]

    if 5.5e-86 < t

    1. Initial program 32.7%

      \[\frac{\sqrt{2} \cdot t}{\sqrt{\frac{x + 1}{x - 1} \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}} \]
    2. Simplified32.7%

      \[\leadsto \color{blue}{\sqrt{2} \cdot \frac{t}{\sqrt{\mathsf{fma}\left(\frac{x + 1}{x + -1}, \mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right), \ell \cdot \left(-\ell\right)\right)}}} \]
    3. Add Preprocessing
    4. Taylor expanded in t around inf 90.0%

      \[\leadsto \sqrt{2} \cdot \frac{t}{\color{blue}{\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{1 + x}{x - 1}}}} \]
    5. Step-by-step derivation
      1. +-commutative90.0%

        \[\leadsto \sqrt{2} \cdot \frac{t}{\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{\color{blue}{x + 1}}{x - 1}}} \]
      2. sub-neg90.0%

        \[\leadsto \sqrt{2} \cdot \frac{t}{\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{x + 1}{\color{blue}{x + \left(-1\right)}}}} \]
      3. metadata-eval90.0%

        \[\leadsto \sqrt{2} \cdot \frac{t}{\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{x + 1}{x + \color{blue}{-1}}}} \]
      4. +-commutative90.0%

        \[\leadsto \sqrt{2} \cdot \frac{t}{\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{x + 1}{\color{blue}{-1 + x}}}} \]
    6. Simplified90.0%

      \[\leadsto \sqrt{2} \cdot \frac{t}{\color{blue}{\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{x + 1}{-1 + x}}}} \]
    7. Taylor expanded in t around 0 90.1%

      \[\leadsto \color{blue}{\sqrt{\frac{x - 1}{1 + x}}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification45.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 1.5 \cdot 10^{-165}:\\ \;\;\;\;t \cdot \left({\left(\frac{1}{x} + \frac{1}{x + -1}\right)}^{-0.5} \cdot \frac{\sqrt{2}}{\ell}\right)\\ \mathbf{elif}\;t \leq 1.5 \cdot 10^{-95}:\\ \;\;\;\;1 - \frac{1}{x}\\ \mathbf{elif}\;t \leq 5.5 \cdot 10^{-86}:\\ \;\;\;\;t \cdot \left({\left(\frac{1}{x} + \frac{1}{x + -1}\right)}^{-0.5} \cdot \frac{\sqrt{2}}{\ell}\right)\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{x + -1}{1 + x}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 79.9% accurate, 1.0× speedup?

\[\begin{array}{l} l_m = \left|\ell\right| \\ t_m = \left|t\right| \\ t_s = \mathsf{copysign}\left(1, t\right) \\ \begin{array}{l} t_2 := {\left(\frac{1}{x} + \frac{1}{x + -1}\right)}^{-0.5}\\ t\_s \cdot \begin{array}{l} \mathbf{if}\;t\_m \leq 1.8 \cdot 10^{-166}:\\ \;\;\;\;\frac{t\_m \cdot t\_2}{\frac{l\_m}{\sqrt{2}}}\\ \mathbf{elif}\;t\_m \leq 1.5 \cdot 10^{-95}:\\ \;\;\;\;1 - \frac{1}{x}\\ \mathbf{elif}\;t\_m \leq 3.3 \cdot 10^{-86}:\\ \;\;\;\;t\_m \cdot \left(t\_2 \cdot \frac{\sqrt{2}}{l\_m}\right)\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{x + -1}{1 + x}}\\ \end{array} \end{array} \end{array} \]
l_m = (fabs.f64 l)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s x l_m t_m)
 :precision binary64
 (let* ((t_2 (pow (+ (/ 1.0 x) (/ 1.0 (+ x -1.0))) -0.5)))
   (*
    t_s
    (if (<= t_m 1.8e-166)
      (/ (* t_m t_2) (/ l_m (sqrt 2.0)))
      (if (<= t_m 1.5e-95)
        (- 1.0 (/ 1.0 x))
        (if (<= t_m 3.3e-86)
          (* t_m (* t_2 (/ (sqrt 2.0) l_m)))
          (sqrt (/ (+ x -1.0) (+ 1.0 x)))))))))
l_m = fabs(l);
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double x, double l_m, double t_m) {
	double t_2 = pow(((1.0 / x) + (1.0 / (x + -1.0))), -0.5);
	double tmp;
	if (t_m <= 1.8e-166) {
		tmp = (t_m * t_2) / (l_m / sqrt(2.0));
	} else if (t_m <= 1.5e-95) {
		tmp = 1.0 - (1.0 / x);
	} else if (t_m <= 3.3e-86) {
		tmp = t_m * (t_2 * (sqrt(2.0) / l_m));
	} else {
		tmp = sqrt(((x + -1.0) / (1.0 + x)));
	}
	return t_s * tmp;
}
l_m = abs(l)
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, x, l_m, t_m)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: x
    real(8), intent (in) :: l_m
    real(8), intent (in) :: t_m
    real(8) :: t_2
    real(8) :: tmp
    t_2 = ((1.0d0 / x) + (1.0d0 / (x + (-1.0d0)))) ** (-0.5d0)
    if (t_m <= 1.8d-166) then
        tmp = (t_m * t_2) / (l_m / sqrt(2.0d0))
    else if (t_m <= 1.5d-95) then
        tmp = 1.0d0 - (1.0d0 / x)
    else if (t_m <= 3.3d-86) then
        tmp = t_m * (t_2 * (sqrt(2.0d0) / l_m))
    else
        tmp = sqrt(((x + (-1.0d0)) / (1.0d0 + x)))
    end if
    code = t_s * tmp
end function
l_m = Math.abs(l);
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double l_m, double t_m) {
	double t_2 = Math.pow(((1.0 / x) + (1.0 / (x + -1.0))), -0.5);
	double tmp;
	if (t_m <= 1.8e-166) {
		tmp = (t_m * t_2) / (l_m / Math.sqrt(2.0));
	} else if (t_m <= 1.5e-95) {
		tmp = 1.0 - (1.0 / x);
	} else if (t_m <= 3.3e-86) {
		tmp = t_m * (t_2 * (Math.sqrt(2.0) / l_m));
	} else {
		tmp = Math.sqrt(((x + -1.0) / (1.0 + x)));
	}
	return t_s * tmp;
}
l_m = math.fabs(l)
t_m = math.fabs(t)
t_s = math.copysign(1.0, t)
def code(t_s, x, l_m, t_m):
	t_2 = math.pow(((1.0 / x) + (1.0 / (x + -1.0))), -0.5)
	tmp = 0
	if t_m <= 1.8e-166:
		tmp = (t_m * t_2) / (l_m / math.sqrt(2.0))
	elif t_m <= 1.5e-95:
		tmp = 1.0 - (1.0 / x)
	elif t_m <= 3.3e-86:
		tmp = t_m * (t_2 * (math.sqrt(2.0) / l_m))
	else:
		tmp = math.sqrt(((x + -1.0) / (1.0 + x)))
	return t_s * tmp
l_m = abs(l)
t_m = abs(t)
t_s = copysign(1.0, t)
function code(t_s, x, l_m, t_m)
	t_2 = Float64(Float64(1.0 / x) + Float64(1.0 / Float64(x + -1.0))) ^ -0.5
	tmp = 0.0
	if (t_m <= 1.8e-166)
		tmp = Float64(Float64(t_m * t_2) / Float64(l_m / sqrt(2.0)));
	elseif (t_m <= 1.5e-95)
		tmp = Float64(1.0 - Float64(1.0 / x));
	elseif (t_m <= 3.3e-86)
		tmp = Float64(t_m * Float64(t_2 * Float64(sqrt(2.0) / l_m)));
	else
		tmp = sqrt(Float64(Float64(x + -1.0) / Float64(1.0 + x)));
	end
	return Float64(t_s * tmp)
end
l_m = abs(l);
t_m = abs(t);
t_s = sign(t) * abs(1.0);
function tmp_2 = code(t_s, x, l_m, t_m)
	t_2 = ((1.0 / x) + (1.0 / (x + -1.0))) ^ -0.5;
	tmp = 0.0;
	if (t_m <= 1.8e-166)
		tmp = (t_m * t_2) / (l_m / sqrt(2.0));
	elseif (t_m <= 1.5e-95)
		tmp = 1.0 - (1.0 / x);
	elseif (t_m <= 3.3e-86)
		tmp = t_m * (t_2 * (sqrt(2.0) / l_m));
	else
		tmp = sqrt(((x + -1.0) / (1.0 + x)));
	end
	tmp_2 = t_s * tmp;
end
l_m = N[Abs[l], $MachinePrecision]
t_m = N[Abs[t], $MachinePrecision]
t_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, l$95$m_, t$95$m_] := Block[{t$95$2 = N[Power[N[(N[(1.0 / x), $MachinePrecision] + N[(1.0 / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]}, N[(t$95$s * If[LessEqual[t$95$m, 1.8e-166], N[(N[(t$95$m * t$95$2), $MachinePrecision] / N[(l$95$m / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 1.5e-95], N[(1.0 - N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 3.3e-86], N[(t$95$m * N[(t$95$2 * N[(N[Sqrt[2.0], $MachinePrecision] / l$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(1.0 + x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]), $MachinePrecision]]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)

\\
\begin{array}{l}
t_2 := {\left(\frac{1}{x} + \frac{1}{x + -1}\right)}^{-0.5}\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 1.8 \cdot 10^{-166}:\\
\;\;\;\;\frac{t\_m \cdot t\_2}{\frac{l\_m}{\sqrt{2}}}\\

\mathbf{elif}\;t\_m \leq 1.5 \cdot 10^{-95}:\\
\;\;\;\;1 - \frac{1}{x}\\

\mathbf{elif}\;t\_m \leq 3.3 \cdot 10^{-86}:\\
\;\;\;\;t\_m \cdot \left(t\_2 \cdot \frac{\sqrt{2}}{l\_m}\right)\\

\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{x + -1}{1 + x}}\\


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < 1.8e-166

    1. Initial program 28.2%

      \[\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}} \]
    2. Simplified28.1%

      \[\leadsto \color{blue}{\sqrt{2} \cdot \frac{t}{\sqrt{\mathsf{fma}\left(\frac{x + 1}{x + -1}, \mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right), \ell \cdot \left(-\ell\right)\right)}}} \]
    3. Add Preprocessing
    4. Taylor expanded in l around inf 2.8%

      \[\leadsto \color{blue}{\frac{t \cdot \sqrt{2}}{\ell} \cdot \sqrt{\frac{1}{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}}} \]
    5. Step-by-step derivation
      1. *-commutative2.8%

        \[\leadsto \color{blue}{\sqrt{\frac{1}{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}} \cdot \frac{t \cdot \sqrt{2}}{\ell}} \]
      2. associate--l+10.8%

        \[\leadsto \sqrt{\frac{1}{\color{blue}{\frac{1}{x - 1} + \left(\frac{x}{x - 1} - 1\right)}}} \cdot \frac{t \cdot \sqrt{2}}{\ell} \]
      3. sub-neg10.8%

        \[\leadsto \sqrt{\frac{1}{\frac{1}{\color{blue}{x + \left(-1\right)}} + \left(\frac{x}{x - 1} - 1\right)}} \cdot \frac{t \cdot \sqrt{2}}{\ell} \]
      4. metadata-eval10.8%

        \[\leadsto \sqrt{\frac{1}{\frac{1}{x + \color{blue}{-1}} + \left(\frac{x}{x - 1} - 1\right)}} \cdot \frac{t \cdot \sqrt{2}}{\ell} \]
      5. +-commutative10.8%

        \[\leadsto \sqrt{\frac{1}{\frac{1}{\color{blue}{-1 + x}} + \left(\frac{x}{x - 1} - 1\right)}} \cdot \frac{t \cdot \sqrt{2}}{\ell} \]
      6. sub-neg10.8%

        \[\leadsto \sqrt{\frac{1}{\frac{1}{-1 + x} + \left(\frac{x}{\color{blue}{x + \left(-1\right)}} - 1\right)}} \cdot \frac{t \cdot \sqrt{2}}{\ell} \]
      7. metadata-eval10.8%

        \[\leadsto \sqrt{\frac{1}{\frac{1}{-1 + x} + \left(\frac{x}{x + \color{blue}{-1}} - 1\right)}} \cdot \frac{t \cdot \sqrt{2}}{\ell} \]
      8. +-commutative10.8%

        \[\leadsto \sqrt{\frac{1}{\frac{1}{-1 + x} + \left(\frac{x}{\color{blue}{-1 + x}} - 1\right)}} \cdot \frac{t \cdot \sqrt{2}}{\ell} \]
      9. associate-/l*10.8%

        \[\leadsto \sqrt{\frac{1}{\frac{1}{-1 + x} + \left(\frac{x}{-1 + x} - 1\right)}} \cdot \color{blue}{\frac{t}{\frac{\ell}{\sqrt{2}}}} \]
    6. Simplified10.8%

      \[\leadsto \color{blue}{\sqrt{\frac{1}{\frac{1}{-1 + x} + \left(\frac{x}{-1 + x} - 1\right)}} \cdot \frac{t}{\frac{\ell}{\sqrt{2}}}} \]
    7. Taylor expanded in x around inf 19.2%

      \[\leadsto \sqrt{\frac{1}{\frac{1}{-1 + x} + \color{blue}{\frac{1}{x}}}} \cdot \frac{t}{\frac{\ell}{\sqrt{2}}} \]
    8. Step-by-step derivation
      1. associate-/r/19.2%

        \[\leadsto \sqrt{\frac{1}{\frac{1}{-1 + x} + \frac{1}{x}}} \cdot \color{blue}{\left(\frac{t}{\ell} \cdot \sqrt{2}\right)} \]
    9. Applied egg-rr19.2%

      \[\leadsto \sqrt{\frac{1}{\frac{1}{-1 + x} + \frac{1}{x}}} \cdot \color{blue}{\left(\frac{t}{\ell} \cdot \sqrt{2}\right)} \]
    10. Step-by-step derivation
      1. associate-/r/19.2%

        \[\leadsto \sqrt{\frac{1}{\frac{1}{-1 + x} + \frac{1}{x}}} \cdot \color{blue}{\frac{t}{\frac{\ell}{\sqrt{2}}}} \]
      2. add-cube-cbrt19.1%

        \[\leadsto \sqrt{\color{blue}{\left(\sqrt[3]{\frac{1}{\frac{1}{-1 + x} + \frac{1}{x}}} \cdot \sqrt[3]{\frac{1}{\frac{1}{-1 + x} + \frac{1}{x}}}\right) \cdot \sqrt[3]{\frac{1}{\frac{1}{-1 + x} + \frac{1}{x}}}}} \cdot \frac{t}{\frac{\ell}{\sqrt{2}}} \]
      3. pow319.1%

        \[\leadsto \sqrt{\color{blue}{{\left(\sqrt[3]{\frac{1}{\frac{1}{-1 + x} + \frac{1}{x}}}\right)}^{3}}} \cdot \frac{t}{\frac{\ell}{\sqrt{2}}} \]
      4. sqrt-pow119.1%

        \[\leadsto \color{blue}{{\left(\sqrt[3]{\frac{1}{\frac{1}{-1 + x} + \frac{1}{x}}}\right)}^{\left(\frac{3}{2}\right)}} \cdot \frac{t}{\frac{\ell}{\sqrt{2}}} \]
      5. cbrt-div19.1%

        \[\leadsto {\color{blue}{\left(\frac{\sqrt[3]{1}}{\sqrt[3]{\frac{1}{-1 + x} + \frac{1}{x}}}\right)}}^{\left(\frac{3}{2}\right)} \cdot \frac{t}{\frac{\ell}{\sqrt{2}}} \]
      6. metadata-eval19.1%

        \[\leadsto {\left(\frac{\color{blue}{1}}{\sqrt[3]{\frac{1}{-1 + x} + \frac{1}{x}}}\right)}^{\left(\frac{3}{2}\right)} \cdot \frac{t}{\frac{\ell}{\sqrt{2}}} \]
      7. +-commutative19.1%

        \[\leadsto {\left(\frac{1}{\sqrt[3]{\frac{1}{\color{blue}{x + -1}} + \frac{1}{x}}}\right)}^{\left(\frac{3}{2}\right)} \cdot \frac{t}{\frac{\ell}{\sqrt{2}}} \]
      8. +-commutative19.1%

        \[\leadsto {\left(\frac{1}{\sqrt[3]{\color{blue}{\frac{1}{x} + \frac{1}{x + -1}}}}\right)}^{\left(\frac{3}{2}\right)} \cdot \frac{t}{\frac{\ell}{\sqrt{2}}} \]
      9. sqrt-pow119.1%

        \[\leadsto \color{blue}{\sqrt{{\left(\frac{1}{\sqrt[3]{\frac{1}{x} + \frac{1}{x + -1}}}\right)}^{3}}} \cdot \frac{t}{\frac{\ell}{\sqrt{2}}} \]
    11. Applied egg-rr21.0%

      \[\leadsto \color{blue}{\frac{{\left(\frac{1}{x + -1} + \frac{1}{x}\right)}^{-0.5} \cdot t}{\frac{\ell}{\sqrt{2}}}} \]

    if 1.8e-166 < t < 1.5e-95

    1. Initial program 43.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}} \]
    2. Simplified43.4%

      \[\leadsto \color{blue}{\sqrt{2} \cdot \frac{t}{\sqrt{\mathsf{fma}\left(\frac{x + 1}{x + -1}, \mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right), \ell \cdot \left(-\ell\right)\right)}}} \]
    3. Add Preprocessing
    4. Taylor expanded in t around inf 45.7%

      \[\leadsto \sqrt{2} \cdot \frac{t}{\color{blue}{\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{1 + x}{x - 1}}}} \]
    5. Step-by-step derivation
      1. +-commutative45.7%

        \[\leadsto \sqrt{2} \cdot \frac{t}{\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{\color{blue}{x + 1}}{x - 1}}} \]
      2. sub-neg45.7%

        \[\leadsto \sqrt{2} \cdot \frac{t}{\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{x + 1}{\color{blue}{x + \left(-1\right)}}}} \]
      3. metadata-eval45.7%

        \[\leadsto \sqrt{2} \cdot \frac{t}{\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{x + 1}{x + \color{blue}{-1}}}} \]
      4. +-commutative45.7%

        \[\leadsto \sqrt{2} \cdot \frac{t}{\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{x + 1}{\color{blue}{-1 + x}}}} \]
    6. Simplified45.7%

      \[\leadsto \sqrt{2} \cdot \frac{t}{\color{blue}{\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{x + 1}{-1 + x}}}} \]
    7. Taylor expanded in x around inf 45.7%

      \[\leadsto \color{blue}{1 - \frac{1}{x}} \]

    if 1.5e-95 < t < 3.29999999999999987e-86

    1. Initial program 2.2%

      \[\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}} \]
    2. Simplified2.2%

      \[\leadsto \color{blue}{\sqrt{2} \cdot \frac{t}{\sqrt{\mathsf{fma}\left(\frac{x + 1}{x + -1}, \mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right), \ell \cdot \left(-\ell\right)\right)}}} \]
    3. Add Preprocessing
    4. Taylor expanded in l around inf 1.1%

      \[\leadsto \color{blue}{\frac{t \cdot \sqrt{2}}{\ell} \cdot \sqrt{\frac{1}{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}}} \]
    5. Step-by-step derivation
      1. *-commutative1.1%

        \[\leadsto \color{blue}{\sqrt{\frac{1}{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}} \cdot \frac{t \cdot \sqrt{2}}{\ell}} \]
      2. associate--l+3.3%

        \[\leadsto \sqrt{\frac{1}{\color{blue}{\frac{1}{x - 1} + \left(\frac{x}{x - 1} - 1\right)}}} \cdot \frac{t \cdot \sqrt{2}}{\ell} \]
      3. sub-neg3.3%

        \[\leadsto \sqrt{\frac{1}{\frac{1}{\color{blue}{x + \left(-1\right)}} + \left(\frac{x}{x - 1} - 1\right)}} \cdot \frac{t \cdot \sqrt{2}}{\ell} \]
      4. metadata-eval3.3%

        \[\leadsto \sqrt{\frac{1}{\frac{1}{x + \color{blue}{-1}} + \left(\frac{x}{x - 1} - 1\right)}} \cdot \frac{t \cdot \sqrt{2}}{\ell} \]
      5. +-commutative3.3%

        \[\leadsto \sqrt{\frac{1}{\frac{1}{\color{blue}{-1 + x}} + \left(\frac{x}{x - 1} - 1\right)}} \cdot \frac{t \cdot \sqrt{2}}{\ell} \]
      6. sub-neg3.3%

        \[\leadsto \sqrt{\frac{1}{\frac{1}{-1 + x} + \left(\frac{x}{\color{blue}{x + \left(-1\right)}} - 1\right)}} \cdot \frac{t \cdot \sqrt{2}}{\ell} \]
      7. metadata-eval3.3%

        \[\leadsto \sqrt{\frac{1}{\frac{1}{-1 + x} + \left(\frac{x}{x + \color{blue}{-1}} - 1\right)}} \cdot \frac{t \cdot \sqrt{2}}{\ell} \]
      8. +-commutative3.3%

        \[\leadsto \sqrt{\frac{1}{\frac{1}{-1 + x} + \left(\frac{x}{\color{blue}{-1 + x}} - 1\right)}} \cdot \frac{t \cdot \sqrt{2}}{\ell} \]
      9. associate-/l*3.3%

        \[\leadsto \sqrt{\frac{1}{\frac{1}{-1 + x} + \left(\frac{x}{-1 + x} - 1\right)}} \cdot \color{blue}{\frac{t}{\frac{\ell}{\sqrt{2}}}} \]
    6. Simplified3.3%

      \[\leadsto \color{blue}{\sqrt{\frac{1}{\frac{1}{-1 + x} + \left(\frac{x}{-1 + x} - 1\right)}} \cdot \frac{t}{\frac{\ell}{\sqrt{2}}}} \]
    7. Taylor expanded in x around inf 3.3%

      \[\leadsto \sqrt{\frac{1}{\frac{1}{-1 + x} + \color{blue}{\frac{1}{x}}}} \cdot \frac{t}{\frac{\ell}{\sqrt{2}}} \]
    8. Step-by-step derivation
      1. associate-/r/3.3%

        \[\leadsto \sqrt{\frac{1}{\frac{1}{-1 + x} + \frac{1}{x}}} \cdot \color{blue}{\left(\frac{t}{\ell} \cdot \sqrt{2}\right)} \]
    9. Applied egg-rr3.3%

      \[\leadsto \sqrt{\frac{1}{\frac{1}{-1 + x} + \frac{1}{x}}} \cdot \color{blue}{\left(\frac{t}{\ell} \cdot \sqrt{2}\right)} \]
    10. Step-by-step derivation
      1. associate-/r/3.3%

        \[\leadsto \sqrt{\frac{1}{\frac{1}{-1 + x} + \frac{1}{x}}} \cdot \color{blue}{\frac{t}{\frac{\ell}{\sqrt{2}}}} \]
      2. add-cube-cbrt3.3%

        \[\leadsto \sqrt{\color{blue}{\left(\sqrt[3]{\frac{1}{\frac{1}{-1 + x} + \frac{1}{x}}} \cdot \sqrt[3]{\frac{1}{\frac{1}{-1 + x} + \frac{1}{x}}}\right) \cdot \sqrt[3]{\frac{1}{\frac{1}{-1 + x} + \frac{1}{x}}}}} \cdot \frac{t}{\frac{\ell}{\sqrt{2}}} \]
      3. pow33.3%

        \[\leadsto \sqrt{\color{blue}{{\left(\sqrt[3]{\frac{1}{\frac{1}{-1 + x} + \frac{1}{x}}}\right)}^{3}}} \cdot \frac{t}{\frac{\ell}{\sqrt{2}}} \]
      4. sqrt-pow13.3%

        \[\leadsto \color{blue}{{\left(\sqrt[3]{\frac{1}{\frac{1}{-1 + x} + \frac{1}{x}}}\right)}^{\left(\frac{3}{2}\right)}} \cdot \frac{t}{\frac{\ell}{\sqrt{2}}} \]
      5. cbrt-div3.3%

        \[\leadsto {\color{blue}{\left(\frac{\sqrt[3]{1}}{\sqrt[3]{\frac{1}{-1 + x} + \frac{1}{x}}}\right)}}^{\left(\frac{3}{2}\right)} \cdot \frac{t}{\frac{\ell}{\sqrt{2}}} \]
      6. metadata-eval3.3%

        \[\leadsto {\left(\frac{\color{blue}{1}}{\sqrt[3]{\frac{1}{-1 + x} + \frac{1}{x}}}\right)}^{\left(\frac{3}{2}\right)} \cdot \frac{t}{\frac{\ell}{\sqrt{2}}} \]
      7. +-commutative3.3%

        \[\leadsto {\left(\frac{1}{\sqrt[3]{\frac{1}{\color{blue}{x + -1}} + \frac{1}{x}}}\right)}^{\left(\frac{3}{2}\right)} \cdot \frac{t}{\frac{\ell}{\sqrt{2}}} \]
      8. +-commutative3.3%

        \[\leadsto {\left(\frac{1}{\sqrt[3]{\color{blue}{\frac{1}{x} + \frac{1}{x + -1}}}}\right)}^{\left(\frac{3}{2}\right)} \cdot \frac{t}{\frac{\ell}{\sqrt{2}}} \]
      9. sqrt-pow13.3%

        \[\leadsto \color{blue}{\sqrt{{\left(\frac{1}{\sqrt[3]{\frac{1}{x} + \frac{1}{x + -1}}}\right)}^{3}}} \cdot \frac{t}{\frac{\ell}{\sqrt{2}}} \]
    11. Applied egg-rr3.3%

      \[\leadsto \color{blue}{\frac{{\left(\frac{1}{x + -1} + \frac{1}{x}\right)}^{-0.5} \cdot t}{\frac{\ell}{\sqrt{2}}}} \]
    12. Step-by-step derivation
      1. associate-/r/3.3%

        \[\leadsto \color{blue}{\frac{{\left(\frac{1}{x + -1} + \frac{1}{x}\right)}^{-0.5} \cdot t}{\ell} \cdot \sqrt{2}} \]
      2. associate-*l/3.3%

        \[\leadsto \color{blue}{\frac{\left({\left(\frac{1}{x + -1} + \frac{1}{x}\right)}^{-0.5} \cdot t\right) \cdot \sqrt{2}}{\ell}} \]
      3. associate-*r/3.3%

        \[\leadsto \color{blue}{\left({\left(\frac{1}{x + -1} + \frac{1}{x}\right)}^{-0.5} \cdot t\right) \cdot \frac{\sqrt{2}}{\ell}} \]
      4. *-commutative3.3%

        \[\leadsto \color{blue}{\left(t \cdot {\left(\frac{1}{x + -1} + \frac{1}{x}\right)}^{-0.5}\right)} \cdot \frac{\sqrt{2}}{\ell} \]
      5. associate-*l*3.3%

        \[\leadsto \color{blue}{t \cdot \left({\left(\frac{1}{x + -1} + \frac{1}{x}\right)}^{-0.5} \cdot \frac{\sqrt{2}}{\ell}\right)} \]
      6. metadata-eval3.3%

        \[\leadsto t \cdot \left({\left(\frac{1}{x + \color{blue}{\left(-1\right)}} + \frac{1}{x}\right)}^{-0.5} \cdot \frac{\sqrt{2}}{\ell}\right) \]
      7. sub-neg3.3%

        \[\leadsto t \cdot \left({\left(\frac{1}{\color{blue}{x - 1}} + \frac{1}{x}\right)}^{-0.5} \cdot \frac{\sqrt{2}}{\ell}\right) \]
      8. +-commutative3.3%

        \[\leadsto t \cdot \left({\color{blue}{\left(\frac{1}{x} + \frac{1}{x - 1}\right)}}^{-0.5} \cdot \frac{\sqrt{2}}{\ell}\right) \]
      9. sub-neg3.3%

        \[\leadsto t \cdot \left({\left(\frac{1}{x} + \frac{1}{\color{blue}{x + \left(-1\right)}}\right)}^{-0.5} \cdot \frac{\sqrt{2}}{\ell}\right) \]
      10. metadata-eval3.3%

        \[\leadsto t \cdot \left({\left(\frac{1}{x} + \frac{1}{x + \color{blue}{-1}}\right)}^{-0.5} \cdot \frac{\sqrt{2}}{\ell}\right) \]
      11. +-commutative3.3%

        \[\leadsto t \cdot \left({\left(\frac{1}{x} + \frac{1}{\color{blue}{-1 + x}}\right)}^{-0.5} \cdot \frac{\sqrt{2}}{\ell}\right) \]
    13. Simplified3.3%

      \[\leadsto \color{blue}{t \cdot \left({\left(\frac{1}{x} + \frac{1}{-1 + x}\right)}^{-0.5} \cdot \frac{\sqrt{2}}{\ell}\right)} \]

    if 3.29999999999999987e-86 < t

    1. Initial program 32.7%

      \[\frac{\sqrt{2} \cdot t}{\sqrt{\frac{x + 1}{x - 1} \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}} \]
    2. Simplified32.7%

      \[\leadsto \color{blue}{\sqrt{2} \cdot \frac{t}{\sqrt{\mathsf{fma}\left(\frac{x + 1}{x + -1}, \mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right), \ell \cdot \left(-\ell\right)\right)}}} \]
    3. Add Preprocessing
    4. Taylor expanded in t around inf 90.0%

      \[\leadsto \sqrt{2} \cdot \frac{t}{\color{blue}{\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{1 + x}{x - 1}}}} \]
    5. Step-by-step derivation
      1. +-commutative90.0%

        \[\leadsto \sqrt{2} \cdot \frac{t}{\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{\color{blue}{x + 1}}{x - 1}}} \]
      2. sub-neg90.0%

        \[\leadsto \sqrt{2} \cdot \frac{t}{\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{x + 1}{\color{blue}{x + \left(-1\right)}}}} \]
      3. metadata-eval90.0%

        \[\leadsto \sqrt{2} \cdot \frac{t}{\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{x + 1}{x + \color{blue}{-1}}}} \]
      4. +-commutative90.0%

        \[\leadsto \sqrt{2} \cdot \frac{t}{\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{x + 1}{\color{blue}{-1 + x}}}} \]
    6. Simplified90.0%

      \[\leadsto \sqrt{2} \cdot \frac{t}{\color{blue}{\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{x + 1}{-1 + x}}}} \]
    7. Taylor expanded in t around 0 90.1%

      \[\leadsto \color{blue}{\sqrt{\frac{x - 1}{1 + x}}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification45.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 1.8 \cdot 10^{-166}:\\ \;\;\;\;\frac{t \cdot {\left(\frac{1}{x} + \frac{1}{x + -1}\right)}^{-0.5}}{\frac{\ell}{\sqrt{2}}}\\ \mathbf{elif}\;t \leq 1.5 \cdot 10^{-95}:\\ \;\;\;\;1 - \frac{1}{x}\\ \mathbf{elif}\;t \leq 3.3 \cdot 10^{-86}:\\ \;\;\;\;t \cdot \left({\left(\frac{1}{x} + \frac{1}{x + -1}\right)}^{-0.5} \cdot \frac{\sqrt{2}}{\ell}\right)\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{x + -1}{1 + x}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 78.8% accurate, 1.0× speedup?

\[\begin{array}{l} l_m = \left|\ell\right| \\ t_m = \left|t\right| \\ t_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \begin{array}{l} \mathbf{if}\;t\_m \leq 1.55 \cdot 10^{-166}:\\ \;\;\;\;\sqrt{x \cdot 0.5 - 0.5} \cdot \frac{t\_m}{\frac{l\_m}{\sqrt{2}}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{x + -1}{1 + x}}\\ \end{array} \end{array} \]
l_m = (fabs.f64 l)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s x l_m t_m)
 :precision binary64
 (*
  t_s
  (if (<= t_m 1.55e-166)
    (* (sqrt (- (* x 0.5) 0.5)) (/ t_m (/ l_m (sqrt 2.0))))
    (sqrt (/ (+ x -1.0) (+ 1.0 x))))))
l_m = fabs(l);
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double x, double l_m, double t_m) {
	double tmp;
	if (t_m <= 1.55e-166) {
		tmp = sqrt(((x * 0.5) - 0.5)) * (t_m / (l_m / sqrt(2.0)));
	} else {
		tmp = sqrt(((x + -1.0) / (1.0 + x)));
	}
	return t_s * tmp;
}
l_m = abs(l)
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, x, l_m, t_m)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: x
    real(8), intent (in) :: l_m
    real(8), intent (in) :: t_m
    real(8) :: tmp
    if (t_m <= 1.55d-166) then
        tmp = sqrt(((x * 0.5d0) - 0.5d0)) * (t_m / (l_m / sqrt(2.0d0)))
    else
        tmp = sqrt(((x + (-1.0d0)) / (1.0d0 + x)))
    end if
    code = t_s * tmp
end function
l_m = Math.abs(l);
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double l_m, double t_m) {
	double tmp;
	if (t_m <= 1.55e-166) {
		tmp = Math.sqrt(((x * 0.5) - 0.5)) * (t_m / (l_m / Math.sqrt(2.0)));
	} else {
		tmp = Math.sqrt(((x + -1.0) / (1.0 + x)));
	}
	return t_s * tmp;
}
l_m = math.fabs(l)
t_m = math.fabs(t)
t_s = math.copysign(1.0, t)
def code(t_s, x, l_m, t_m):
	tmp = 0
	if t_m <= 1.55e-166:
		tmp = math.sqrt(((x * 0.5) - 0.5)) * (t_m / (l_m / math.sqrt(2.0)))
	else:
		tmp = math.sqrt(((x + -1.0) / (1.0 + x)))
	return t_s * tmp
l_m = abs(l)
t_m = abs(t)
t_s = copysign(1.0, t)
function code(t_s, x, l_m, t_m)
	tmp = 0.0
	if (t_m <= 1.55e-166)
		tmp = Float64(sqrt(Float64(Float64(x * 0.5) - 0.5)) * Float64(t_m / Float64(l_m / sqrt(2.0))));
	else
		tmp = sqrt(Float64(Float64(x + -1.0) / Float64(1.0 + x)));
	end
	return Float64(t_s * tmp)
end
l_m = abs(l);
t_m = abs(t);
t_s = sign(t) * abs(1.0);
function tmp_2 = code(t_s, x, l_m, t_m)
	tmp = 0.0;
	if (t_m <= 1.55e-166)
		tmp = sqrt(((x * 0.5) - 0.5)) * (t_m / (l_m / sqrt(2.0)));
	else
		tmp = sqrt(((x + -1.0) / (1.0 + x)));
	end
	tmp_2 = t_s * tmp;
end
l_m = N[Abs[l], $MachinePrecision]
t_m = N[Abs[t], $MachinePrecision]
t_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, l$95$m_, t$95$m_] := N[(t$95$s * If[LessEqual[t$95$m, 1.55e-166], N[(N[Sqrt[N[(N[(x * 0.5), $MachinePrecision] - 0.5), $MachinePrecision]], $MachinePrecision] * N[(t$95$m / N[(l$95$m / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(1.0 + x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)

\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 1.55 \cdot 10^{-166}:\\
\;\;\;\;\sqrt{x \cdot 0.5 - 0.5} \cdot \frac{t\_m}{\frac{l\_m}{\sqrt{2}}}\\

\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{x + -1}{1 + x}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < 1.54999999999999992e-166

    1. Initial program 28.2%

      \[\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}} \]
    2. Simplified28.1%

      \[\leadsto \color{blue}{\sqrt{2} \cdot \frac{t}{\sqrt{\mathsf{fma}\left(\frac{x + 1}{x + -1}, \mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right), \ell \cdot \left(-\ell\right)\right)}}} \]
    3. Add Preprocessing
    4. Taylor expanded in l around inf 2.8%

      \[\leadsto \color{blue}{\frac{t \cdot \sqrt{2}}{\ell} \cdot \sqrt{\frac{1}{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}}} \]
    5. Step-by-step derivation
      1. *-commutative2.8%

        \[\leadsto \color{blue}{\sqrt{\frac{1}{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}} \cdot \frac{t \cdot \sqrt{2}}{\ell}} \]
      2. associate--l+10.8%

        \[\leadsto \sqrt{\frac{1}{\color{blue}{\frac{1}{x - 1} + \left(\frac{x}{x - 1} - 1\right)}}} \cdot \frac{t \cdot \sqrt{2}}{\ell} \]
      3. sub-neg10.8%

        \[\leadsto \sqrt{\frac{1}{\frac{1}{\color{blue}{x + \left(-1\right)}} + \left(\frac{x}{x - 1} - 1\right)}} \cdot \frac{t \cdot \sqrt{2}}{\ell} \]
      4. metadata-eval10.8%

        \[\leadsto \sqrt{\frac{1}{\frac{1}{x + \color{blue}{-1}} + \left(\frac{x}{x - 1} - 1\right)}} \cdot \frac{t \cdot \sqrt{2}}{\ell} \]
      5. +-commutative10.8%

        \[\leadsto \sqrt{\frac{1}{\frac{1}{\color{blue}{-1 + x}} + \left(\frac{x}{x - 1} - 1\right)}} \cdot \frac{t \cdot \sqrt{2}}{\ell} \]
      6. sub-neg10.8%

        \[\leadsto \sqrt{\frac{1}{\frac{1}{-1 + x} + \left(\frac{x}{\color{blue}{x + \left(-1\right)}} - 1\right)}} \cdot \frac{t \cdot \sqrt{2}}{\ell} \]
      7. metadata-eval10.8%

        \[\leadsto \sqrt{\frac{1}{\frac{1}{-1 + x} + \left(\frac{x}{x + \color{blue}{-1}} - 1\right)}} \cdot \frac{t \cdot \sqrt{2}}{\ell} \]
      8. +-commutative10.8%

        \[\leadsto \sqrt{\frac{1}{\frac{1}{-1 + x} + \left(\frac{x}{\color{blue}{-1 + x}} - 1\right)}} \cdot \frac{t \cdot \sqrt{2}}{\ell} \]
      9. associate-/l*10.8%

        \[\leadsto \sqrt{\frac{1}{\frac{1}{-1 + x} + \left(\frac{x}{-1 + x} - 1\right)}} \cdot \color{blue}{\frac{t}{\frac{\ell}{\sqrt{2}}}} \]
    6. Simplified10.8%

      \[\leadsto \color{blue}{\sqrt{\frac{1}{\frac{1}{-1 + x} + \left(\frac{x}{-1 + x} - 1\right)}} \cdot \frac{t}{\frac{\ell}{\sqrt{2}}}} \]
    7. Taylor expanded in x around 0 19.7%

      \[\leadsto \sqrt{\color{blue}{0.5 \cdot x - 0.5}} \cdot \frac{t}{\frac{\ell}{\sqrt{2}}} \]

    if 1.54999999999999992e-166 < t

    1. Initial program 33.2%

      \[\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}} \]
    2. Simplified33.2%

      \[\leadsto \color{blue}{\sqrt{2} \cdot \frac{t}{\sqrt{\mathsf{fma}\left(\frac{x + 1}{x + -1}, \mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right), \ell \cdot \left(-\ell\right)\right)}}} \]
    3. Add Preprocessing
    4. Taylor expanded in t around inf 85.9%

      \[\leadsto \sqrt{2} \cdot \frac{t}{\color{blue}{\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{1 + x}{x - 1}}}} \]
    5. Step-by-step derivation
      1. +-commutative85.9%

        \[\leadsto \sqrt{2} \cdot \frac{t}{\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{\color{blue}{x + 1}}{x - 1}}} \]
      2. sub-neg85.9%

        \[\leadsto \sqrt{2} \cdot \frac{t}{\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{x + 1}{\color{blue}{x + \left(-1\right)}}}} \]
      3. metadata-eval85.9%

        \[\leadsto \sqrt{2} \cdot \frac{t}{\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{x + 1}{x + \color{blue}{-1}}}} \]
      4. +-commutative85.9%

        \[\leadsto \sqrt{2} \cdot \frac{t}{\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{x + 1}{\color{blue}{-1 + x}}}} \]
    6. Simplified85.9%

      \[\leadsto \sqrt{2} \cdot \frac{t}{\color{blue}{\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{x + 1}{-1 + x}}}} \]
    7. Taylor expanded in t around 0 86.0%

      \[\leadsto \color{blue}{\sqrt{\frac{x - 1}{1 + x}}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification44.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 1.55 \cdot 10^{-166}:\\ \;\;\;\;\sqrt{x \cdot 0.5 - 0.5} \cdot \frac{t}{\frac{\ell}{\sqrt{2}}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{x + -1}{1 + x}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 78.6% accurate, 1.1× speedup?

\[\begin{array}{l} l_m = \left|\ell\right| \\ t_m = \left|t\right| \\ t_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \begin{array}{l} \mathbf{if}\;t\_m \leq 2.65 \cdot 10^{-166}:\\ \;\;\;\;\sqrt{x \cdot 0.5} \cdot \left(\sqrt{2} \cdot \frac{t\_m}{l\_m}\right)\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{x + -1}{1 + x}}\\ \end{array} \end{array} \]
l_m = (fabs.f64 l)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s x l_m t_m)
 :precision binary64
 (*
  t_s
  (if (<= t_m 2.65e-166)
    (* (sqrt (* x 0.5)) (* (sqrt 2.0) (/ t_m l_m)))
    (sqrt (/ (+ x -1.0) (+ 1.0 x))))))
l_m = fabs(l);
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double x, double l_m, double t_m) {
	double tmp;
	if (t_m <= 2.65e-166) {
		tmp = sqrt((x * 0.5)) * (sqrt(2.0) * (t_m / l_m));
	} else {
		tmp = sqrt(((x + -1.0) / (1.0 + x)));
	}
	return t_s * tmp;
}
l_m = abs(l)
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, x, l_m, t_m)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: x
    real(8), intent (in) :: l_m
    real(8), intent (in) :: t_m
    real(8) :: tmp
    if (t_m <= 2.65d-166) then
        tmp = sqrt((x * 0.5d0)) * (sqrt(2.0d0) * (t_m / l_m))
    else
        tmp = sqrt(((x + (-1.0d0)) / (1.0d0 + x)))
    end if
    code = t_s * tmp
end function
l_m = Math.abs(l);
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double l_m, double t_m) {
	double tmp;
	if (t_m <= 2.65e-166) {
		tmp = Math.sqrt((x * 0.5)) * (Math.sqrt(2.0) * (t_m / l_m));
	} else {
		tmp = Math.sqrt(((x + -1.0) / (1.0 + x)));
	}
	return t_s * tmp;
}
l_m = math.fabs(l)
t_m = math.fabs(t)
t_s = math.copysign(1.0, t)
def code(t_s, x, l_m, t_m):
	tmp = 0
	if t_m <= 2.65e-166:
		tmp = math.sqrt((x * 0.5)) * (math.sqrt(2.0) * (t_m / l_m))
	else:
		tmp = math.sqrt(((x + -1.0) / (1.0 + x)))
	return t_s * tmp
l_m = abs(l)
t_m = abs(t)
t_s = copysign(1.0, t)
function code(t_s, x, l_m, t_m)
	tmp = 0.0
	if (t_m <= 2.65e-166)
		tmp = Float64(sqrt(Float64(x * 0.5)) * Float64(sqrt(2.0) * Float64(t_m / l_m)));
	else
		tmp = sqrt(Float64(Float64(x + -1.0) / Float64(1.0 + x)));
	end
	return Float64(t_s * tmp)
end
l_m = abs(l);
t_m = abs(t);
t_s = sign(t) * abs(1.0);
function tmp_2 = code(t_s, x, l_m, t_m)
	tmp = 0.0;
	if (t_m <= 2.65e-166)
		tmp = sqrt((x * 0.5)) * (sqrt(2.0) * (t_m / l_m));
	else
		tmp = sqrt(((x + -1.0) / (1.0 + x)));
	end
	tmp_2 = t_s * tmp;
end
l_m = N[Abs[l], $MachinePrecision]
t_m = N[Abs[t], $MachinePrecision]
t_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, l$95$m_, t$95$m_] := N[(t$95$s * If[LessEqual[t$95$m, 2.65e-166], N[(N[Sqrt[N[(x * 0.5), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[2.0], $MachinePrecision] * N[(t$95$m / l$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(1.0 + x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)

\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 2.65 \cdot 10^{-166}:\\
\;\;\;\;\sqrt{x \cdot 0.5} \cdot \left(\sqrt{2} \cdot \frac{t\_m}{l\_m}\right)\\

\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{x + -1}{1 + x}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < 2.64999999999999998e-166

    1. Initial program 28.2%

      \[\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}} \]
    2. Simplified28.1%

      \[\leadsto \color{blue}{\sqrt{2} \cdot \frac{t}{\sqrt{\mathsf{fma}\left(\frac{x + 1}{x + -1}, \mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right), \ell \cdot \left(-\ell\right)\right)}}} \]
    3. Add Preprocessing
    4. Taylor expanded in l around inf 2.8%

      \[\leadsto \color{blue}{\frac{t \cdot \sqrt{2}}{\ell} \cdot \sqrt{\frac{1}{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}}} \]
    5. Step-by-step derivation
      1. *-commutative2.8%

        \[\leadsto \color{blue}{\sqrt{\frac{1}{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}} \cdot \frac{t \cdot \sqrt{2}}{\ell}} \]
      2. associate--l+10.8%

        \[\leadsto \sqrt{\frac{1}{\color{blue}{\frac{1}{x - 1} + \left(\frac{x}{x - 1} - 1\right)}}} \cdot \frac{t \cdot \sqrt{2}}{\ell} \]
      3. sub-neg10.8%

        \[\leadsto \sqrt{\frac{1}{\frac{1}{\color{blue}{x + \left(-1\right)}} + \left(\frac{x}{x - 1} - 1\right)}} \cdot \frac{t \cdot \sqrt{2}}{\ell} \]
      4. metadata-eval10.8%

        \[\leadsto \sqrt{\frac{1}{\frac{1}{x + \color{blue}{-1}} + \left(\frac{x}{x - 1} - 1\right)}} \cdot \frac{t \cdot \sqrt{2}}{\ell} \]
      5. +-commutative10.8%

        \[\leadsto \sqrt{\frac{1}{\frac{1}{\color{blue}{-1 + x}} + \left(\frac{x}{x - 1} - 1\right)}} \cdot \frac{t \cdot \sqrt{2}}{\ell} \]
      6. sub-neg10.8%

        \[\leadsto \sqrt{\frac{1}{\frac{1}{-1 + x} + \left(\frac{x}{\color{blue}{x + \left(-1\right)}} - 1\right)}} \cdot \frac{t \cdot \sqrt{2}}{\ell} \]
      7. metadata-eval10.8%

        \[\leadsto \sqrt{\frac{1}{\frac{1}{-1 + x} + \left(\frac{x}{x + \color{blue}{-1}} - 1\right)}} \cdot \frac{t \cdot \sqrt{2}}{\ell} \]
      8. +-commutative10.8%

        \[\leadsto \sqrt{\frac{1}{\frac{1}{-1 + x} + \left(\frac{x}{\color{blue}{-1 + x}} - 1\right)}} \cdot \frac{t \cdot \sqrt{2}}{\ell} \]
      9. associate-/l*10.8%

        \[\leadsto \sqrt{\frac{1}{\frac{1}{-1 + x} + \left(\frac{x}{-1 + x} - 1\right)}} \cdot \color{blue}{\frac{t}{\frac{\ell}{\sqrt{2}}}} \]
    6. Simplified10.8%

      \[\leadsto \color{blue}{\sqrt{\frac{1}{\frac{1}{-1 + x} + \left(\frac{x}{-1 + x} - 1\right)}} \cdot \frac{t}{\frac{\ell}{\sqrt{2}}}} \]
    7. Taylor expanded in x around inf 19.2%

      \[\leadsto \sqrt{\frac{1}{\frac{1}{-1 + x} + \color{blue}{\frac{1}{x}}}} \cdot \frac{t}{\frac{\ell}{\sqrt{2}}} \]
    8. Step-by-step derivation
      1. associate-/r/19.2%

        \[\leadsto \sqrt{\frac{1}{\frac{1}{-1 + x} + \frac{1}{x}}} \cdot \color{blue}{\left(\frac{t}{\ell} \cdot \sqrt{2}\right)} \]
    9. Applied egg-rr19.2%

      \[\leadsto \sqrt{\frac{1}{\frac{1}{-1 + x} + \frac{1}{x}}} \cdot \color{blue}{\left(\frac{t}{\ell} \cdot \sqrt{2}\right)} \]
    10. Taylor expanded in x around inf 19.2%

      \[\leadsto \sqrt{\color{blue}{0.5 \cdot x}} \cdot \left(\frac{t}{\ell} \cdot \sqrt{2}\right) \]
    11. Step-by-step derivation
      1. *-commutative19.2%

        \[\leadsto \sqrt{\color{blue}{x \cdot 0.5}} \cdot \left(\frac{t}{\ell} \cdot \sqrt{2}\right) \]
    12. Simplified19.2%

      \[\leadsto \sqrt{\color{blue}{x \cdot 0.5}} \cdot \left(\frac{t}{\ell} \cdot \sqrt{2}\right) \]

    if 2.64999999999999998e-166 < t

    1. Initial program 33.2%

      \[\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}} \]
    2. Simplified33.2%

      \[\leadsto \color{blue}{\sqrt{2} \cdot \frac{t}{\sqrt{\mathsf{fma}\left(\frac{x + 1}{x + -1}, \mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right), \ell \cdot \left(-\ell\right)\right)}}} \]
    3. Add Preprocessing
    4. Taylor expanded in t around inf 85.9%

      \[\leadsto \sqrt{2} \cdot \frac{t}{\color{blue}{\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{1 + x}{x - 1}}}} \]
    5. Step-by-step derivation
      1. +-commutative85.9%

        \[\leadsto \sqrt{2} \cdot \frac{t}{\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{\color{blue}{x + 1}}{x - 1}}} \]
      2. sub-neg85.9%

        \[\leadsto \sqrt{2} \cdot \frac{t}{\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{x + 1}{\color{blue}{x + \left(-1\right)}}}} \]
      3. metadata-eval85.9%

        \[\leadsto \sqrt{2} \cdot \frac{t}{\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{x + 1}{x + \color{blue}{-1}}}} \]
      4. +-commutative85.9%

        \[\leadsto \sqrt{2} \cdot \frac{t}{\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{x + 1}{\color{blue}{-1 + x}}}} \]
    6. Simplified85.9%

      \[\leadsto \sqrt{2} \cdot \frac{t}{\color{blue}{\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{x + 1}{-1 + x}}}} \]
    7. Taylor expanded in t around 0 86.0%

      \[\leadsto \color{blue}{\sqrt{\frac{x - 1}{1 + x}}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification44.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 2.65 \cdot 10^{-166}:\\ \;\;\;\;\sqrt{x \cdot 0.5} \cdot \left(\sqrt{2} \cdot \frac{t}{\ell}\right)\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{x + -1}{1 + x}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 78.6% accurate, 1.1× speedup?

\[\begin{array}{l} l_m = \left|\ell\right| \\ t_m = \left|t\right| \\ t_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \begin{array}{l} \mathbf{if}\;t\_m \leq 1.85 \cdot 10^{-165}:\\ \;\;\;\;\frac{t\_m}{\frac{l\_m}{\sqrt{2}}} \cdot \sqrt{x \cdot 0.5}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{x + -1}{1 + x}}\\ \end{array} \end{array} \]
l_m = (fabs.f64 l)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s x l_m t_m)
 :precision binary64
 (*
  t_s
  (if (<= t_m 1.85e-165)
    (* (/ t_m (/ l_m (sqrt 2.0))) (sqrt (* x 0.5)))
    (sqrt (/ (+ x -1.0) (+ 1.0 x))))))
l_m = fabs(l);
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double x, double l_m, double t_m) {
	double tmp;
	if (t_m <= 1.85e-165) {
		tmp = (t_m / (l_m / sqrt(2.0))) * sqrt((x * 0.5));
	} else {
		tmp = sqrt(((x + -1.0) / (1.0 + x)));
	}
	return t_s * tmp;
}
l_m = abs(l)
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, x, l_m, t_m)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: x
    real(8), intent (in) :: l_m
    real(8), intent (in) :: t_m
    real(8) :: tmp
    if (t_m <= 1.85d-165) then
        tmp = (t_m / (l_m / sqrt(2.0d0))) * sqrt((x * 0.5d0))
    else
        tmp = sqrt(((x + (-1.0d0)) / (1.0d0 + x)))
    end if
    code = t_s * tmp
end function
l_m = Math.abs(l);
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double l_m, double t_m) {
	double tmp;
	if (t_m <= 1.85e-165) {
		tmp = (t_m / (l_m / Math.sqrt(2.0))) * Math.sqrt((x * 0.5));
	} else {
		tmp = Math.sqrt(((x + -1.0) / (1.0 + x)));
	}
	return t_s * tmp;
}
l_m = math.fabs(l)
t_m = math.fabs(t)
t_s = math.copysign(1.0, t)
def code(t_s, x, l_m, t_m):
	tmp = 0
	if t_m <= 1.85e-165:
		tmp = (t_m / (l_m / math.sqrt(2.0))) * math.sqrt((x * 0.5))
	else:
		tmp = math.sqrt(((x + -1.0) / (1.0 + x)))
	return t_s * tmp
l_m = abs(l)
t_m = abs(t)
t_s = copysign(1.0, t)
function code(t_s, x, l_m, t_m)
	tmp = 0.0
	if (t_m <= 1.85e-165)
		tmp = Float64(Float64(t_m / Float64(l_m / sqrt(2.0))) * sqrt(Float64(x * 0.5)));
	else
		tmp = sqrt(Float64(Float64(x + -1.0) / Float64(1.0 + x)));
	end
	return Float64(t_s * tmp)
end
l_m = abs(l);
t_m = abs(t);
t_s = sign(t) * abs(1.0);
function tmp_2 = code(t_s, x, l_m, t_m)
	tmp = 0.0;
	if (t_m <= 1.85e-165)
		tmp = (t_m / (l_m / sqrt(2.0))) * sqrt((x * 0.5));
	else
		tmp = sqrt(((x + -1.0) / (1.0 + x)));
	end
	tmp_2 = t_s * tmp;
end
l_m = N[Abs[l], $MachinePrecision]
t_m = N[Abs[t], $MachinePrecision]
t_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, l$95$m_, t$95$m_] := N[(t$95$s * If[LessEqual[t$95$m, 1.85e-165], N[(N[(t$95$m / N[(l$95$m / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(x * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(1.0 + x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)

\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 1.85 \cdot 10^{-165}:\\
\;\;\;\;\frac{t\_m}{\frac{l\_m}{\sqrt{2}}} \cdot \sqrt{x \cdot 0.5}\\

\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{x + -1}{1 + x}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < 1.85000000000000001e-165

    1. Initial program 28.2%

      \[\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}} \]
    2. Simplified28.1%

      \[\leadsto \color{blue}{\sqrt{2} \cdot \frac{t}{\sqrt{\mathsf{fma}\left(\frac{x + 1}{x + -1}, \mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right), \ell \cdot \left(-\ell\right)\right)}}} \]
    3. Add Preprocessing
    4. Taylor expanded in l around inf 2.8%

      \[\leadsto \color{blue}{\frac{t \cdot \sqrt{2}}{\ell} \cdot \sqrt{\frac{1}{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}}} \]
    5. Step-by-step derivation
      1. *-commutative2.8%

        \[\leadsto \color{blue}{\sqrt{\frac{1}{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}} \cdot \frac{t \cdot \sqrt{2}}{\ell}} \]
      2. associate--l+10.8%

        \[\leadsto \sqrt{\frac{1}{\color{blue}{\frac{1}{x - 1} + \left(\frac{x}{x - 1} - 1\right)}}} \cdot \frac{t \cdot \sqrt{2}}{\ell} \]
      3. sub-neg10.8%

        \[\leadsto \sqrt{\frac{1}{\frac{1}{\color{blue}{x + \left(-1\right)}} + \left(\frac{x}{x - 1} - 1\right)}} \cdot \frac{t \cdot \sqrt{2}}{\ell} \]
      4. metadata-eval10.8%

        \[\leadsto \sqrt{\frac{1}{\frac{1}{x + \color{blue}{-1}} + \left(\frac{x}{x - 1} - 1\right)}} \cdot \frac{t \cdot \sqrt{2}}{\ell} \]
      5. +-commutative10.8%

        \[\leadsto \sqrt{\frac{1}{\frac{1}{\color{blue}{-1 + x}} + \left(\frac{x}{x - 1} - 1\right)}} \cdot \frac{t \cdot \sqrt{2}}{\ell} \]
      6. sub-neg10.8%

        \[\leadsto \sqrt{\frac{1}{\frac{1}{-1 + x} + \left(\frac{x}{\color{blue}{x + \left(-1\right)}} - 1\right)}} \cdot \frac{t \cdot \sqrt{2}}{\ell} \]
      7. metadata-eval10.8%

        \[\leadsto \sqrt{\frac{1}{\frac{1}{-1 + x} + \left(\frac{x}{x + \color{blue}{-1}} - 1\right)}} \cdot \frac{t \cdot \sqrt{2}}{\ell} \]
      8. +-commutative10.8%

        \[\leadsto \sqrt{\frac{1}{\frac{1}{-1 + x} + \left(\frac{x}{\color{blue}{-1 + x}} - 1\right)}} \cdot \frac{t \cdot \sqrt{2}}{\ell} \]
      9. associate-/l*10.8%

        \[\leadsto \sqrt{\frac{1}{\frac{1}{-1 + x} + \left(\frac{x}{-1 + x} - 1\right)}} \cdot \color{blue}{\frac{t}{\frac{\ell}{\sqrt{2}}}} \]
    6. Simplified10.8%

      \[\leadsto \color{blue}{\sqrt{\frac{1}{\frac{1}{-1 + x} + \left(\frac{x}{-1 + x} - 1\right)}} \cdot \frac{t}{\frac{\ell}{\sqrt{2}}}} \]
    7. Taylor expanded in x around inf 19.2%

      \[\leadsto \sqrt{\color{blue}{0.5 \cdot x}} \cdot \frac{t}{\frac{\ell}{\sqrt{2}}} \]
    8. Step-by-step derivation
      1. *-commutative19.2%

        \[\leadsto \sqrt{\color{blue}{x \cdot 0.5}} \cdot \frac{t}{\frac{\ell}{\sqrt{2}}} \]
    9. Simplified19.2%

      \[\leadsto \sqrt{\color{blue}{x \cdot 0.5}} \cdot \frac{t}{\frac{\ell}{\sqrt{2}}} \]

    if 1.85000000000000001e-165 < t

    1. Initial program 33.2%

      \[\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}} \]
    2. Simplified33.2%

      \[\leadsto \color{blue}{\sqrt{2} \cdot \frac{t}{\sqrt{\mathsf{fma}\left(\frac{x + 1}{x + -1}, \mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right), \ell \cdot \left(-\ell\right)\right)}}} \]
    3. Add Preprocessing
    4. Taylor expanded in t around inf 85.9%

      \[\leadsto \sqrt{2} \cdot \frac{t}{\color{blue}{\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{1 + x}{x - 1}}}} \]
    5. Step-by-step derivation
      1. +-commutative85.9%

        \[\leadsto \sqrt{2} \cdot \frac{t}{\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{\color{blue}{x + 1}}{x - 1}}} \]
      2. sub-neg85.9%

        \[\leadsto \sqrt{2} \cdot \frac{t}{\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{x + 1}{\color{blue}{x + \left(-1\right)}}}} \]
      3. metadata-eval85.9%

        \[\leadsto \sqrt{2} \cdot \frac{t}{\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{x + 1}{x + \color{blue}{-1}}}} \]
      4. +-commutative85.9%

        \[\leadsto \sqrt{2} \cdot \frac{t}{\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{x + 1}{\color{blue}{-1 + x}}}} \]
    6. Simplified85.9%

      \[\leadsto \sqrt{2} \cdot \frac{t}{\color{blue}{\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{x + 1}{-1 + x}}}} \]
    7. Taylor expanded in t around 0 86.0%

      \[\leadsto \color{blue}{\sqrt{\frac{x - 1}{1 + x}}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification44.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 1.85 \cdot 10^{-165}:\\ \;\;\;\;\frac{t}{\frac{\ell}{\sqrt{2}}} \cdot \sqrt{x \cdot 0.5}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{x + -1}{1 + x}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 76.7% accurate, 1.1× speedup?

\[\begin{array}{l} l_m = \left|\ell\right| \\ t_m = \left|t\right| \\ t_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \begin{array}{l} \mathbf{if}\;l\_m \leq 5.3 \cdot 10^{+262}:\\ \;\;\;\;\sqrt{\frac{x + -1}{1 + x}}\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt{2} \cdot \frac{t\_m}{l\_m}\right) \cdot \sqrt{x}\\ \end{array} \end{array} \]
l_m = (fabs.f64 l)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s x l_m t_m)
 :precision binary64
 (*
  t_s
  (if (<= l_m 5.3e+262)
    (sqrt (/ (+ x -1.0) (+ 1.0 x)))
    (* (* (sqrt 2.0) (/ t_m l_m)) (sqrt x)))))
l_m = fabs(l);
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double x, double l_m, double t_m) {
	double tmp;
	if (l_m <= 5.3e+262) {
		tmp = sqrt(((x + -1.0) / (1.0 + x)));
	} else {
		tmp = (sqrt(2.0) * (t_m / l_m)) * sqrt(x);
	}
	return t_s * tmp;
}
l_m = abs(l)
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, x, l_m, t_m)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: x
    real(8), intent (in) :: l_m
    real(8), intent (in) :: t_m
    real(8) :: tmp
    if (l_m <= 5.3d+262) then
        tmp = sqrt(((x + (-1.0d0)) / (1.0d0 + x)))
    else
        tmp = (sqrt(2.0d0) * (t_m / l_m)) * sqrt(x)
    end if
    code = t_s * tmp
end function
l_m = Math.abs(l);
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double l_m, double t_m) {
	double tmp;
	if (l_m <= 5.3e+262) {
		tmp = Math.sqrt(((x + -1.0) / (1.0 + x)));
	} else {
		tmp = (Math.sqrt(2.0) * (t_m / l_m)) * Math.sqrt(x);
	}
	return t_s * tmp;
}
l_m = math.fabs(l)
t_m = math.fabs(t)
t_s = math.copysign(1.0, t)
def code(t_s, x, l_m, t_m):
	tmp = 0
	if l_m <= 5.3e+262:
		tmp = math.sqrt(((x + -1.0) / (1.0 + x)))
	else:
		tmp = (math.sqrt(2.0) * (t_m / l_m)) * math.sqrt(x)
	return t_s * tmp
l_m = abs(l)
t_m = abs(t)
t_s = copysign(1.0, t)
function code(t_s, x, l_m, t_m)
	tmp = 0.0
	if (l_m <= 5.3e+262)
		tmp = sqrt(Float64(Float64(x + -1.0) / Float64(1.0 + x)));
	else
		tmp = Float64(Float64(sqrt(2.0) * Float64(t_m / l_m)) * sqrt(x));
	end
	return Float64(t_s * tmp)
end
l_m = abs(l);
t_m = abs(t);
t_s = sign(t) * abs(1.0);
function tmp_2 = code(t_s, x, l_m, t_m)
	tmp = 0.0;
	if (l_m <= 5.3e+262)
		tmp = sqrt(((x + -1.0) / (1.0 + x)));
	else
		tmp = (sqrt(2.0) * (t_m / l_m)) * sqrt(x);
	end
	tmp_2 = t_s * tmp;
end
l_m = N[Abs[l], $MachinePrecision]
t_m = N[Abs[t], $MachinePrecision]
t_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, l$95$m_, t$95$m_] := N[(t$95$s * If[LessEqual[l$95$m, 5.3e+262], N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(1.0 + x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] * N[(t$95$m / l$95$m), $MachinePrecision]), $MachinePrecision] * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)

\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;l\_m \leq 5.3 \cdot 10^{+262}:\\
\;\;\;\;\sqrt{\frac{x + -1}{1 + x}}\\

\mathbf{else}:\\
\;\;\;\;\left(\sqrt{2} \cdot \frac{t\_m}{l\_m}\right) \cdot \sqrt{x}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if l < 5.30000000000000002e262

    1. Initial program 31.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}} \]
    2. Simplified31.0%

      \[\leadsto \color{blue}{\sqrt{2} \cdot \frac{t}{\sqrt{\mathsf{fma}\left(\frac{x + 1}{x + -1}, \mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right), \ell \cdot \left(-\ell\right)\right)}}} \]
    3. Add Preprocessing
    4. Taylor expanded in t around inf 37.2%

      \[\leadsto \sqrt{2} \cdot \frac{t}{\color{blue}{\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{1 + x}{x - 1}}}} \]
    5. Step-by-step derivation
      1. +-commutative37.2%

        \[\leadsto \sqrt{2} \cdot \frac{t}{\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{\color{blue}{x + 1}}{x - 1}}} \]
      2. sub-neg37.2%

        \[\leadsto \sqrt{2} \cdot \frac{t}{\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{x + 1}{\color{blue}{x + \left(-1\right)}}}} \]
      3. metadata-eval37.2%

        \[\leadsto \sqrt{2} \cdot \frac{t}{\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{x + 1}{x + \color{blue}{-1}}}} \]
      4. +-commutative37.2%

        \[\leadsto \sqrt{2} \cdot \frac{t}{\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{x + 1}{\color{blue}{-1 + x}}}} \]
    6. Simplified37.2%

      \[\leadsto \sqrt{2} \cdot \frac{t}{\color{blue}{\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{x + 1}{-1 + x}}}} \]
    7. Taylor expanded in t around 0 37.3%

      \[\leadsto \color{blue}{\sqrt{\frac{x - 1}{1 + x}}} \]

    if 5.30000000000000002e262 < l

    1. Initial program 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}} \]
    2. Simplified0.0%

      \[\leadsto \color{blue}{\sqrt{2} \cdot \frac{t}{\sqrt{\mathsf{fma}\left(\frac{x + 1}{x + -1}, \mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right), \ell \cdot \left(-\ell\right)\right)}}} \]
    3. Add Preprocessing
    4. Taylor expanded in l around inf 13.7%

      \[\leadsto \color{blue}{\frac{t \cdot \sqrt{2}}{\ell} \cdot \sqrt{\frac{1}{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}}} \]
    5. Step-by-step derivation
      1. *-commutative13.7%

        \[\leadsto \color{blue}{\sqrt{\frac{1}{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}} \cdot \frac{t \cdot \sqrt{2}}{\ell}} \]
      2. associate--l+60.2%

        \[\leadsto \sqrt{\frac{1}{\color{blue}{\frac{1}{x - 1} + \left(\frac{x}{x - 1} - 1\right)}}} \cdot \frac{t \cdot \sqrt{2}}{\ell} \]
      3. sub-neg60.2%

        \[\leadsto \sqrt{\frac{1}{\frac{1}{\color{blue}{x + \left(-1\right)}} + \left(\frac{x}{x - 1} - 1\right)}} \cdot \frac{t \cdot \sqrt{2}}{\ell} \]
      4. metadata-eval60.2%

        \[\leadsto \sqrt{\frac{1}{\frac{1}{x + \color{blue}{-1}} + \left(\frac{x}{x - 1} - 1\right)}} \cdot \frac{t \cdot \sqrt{2}}{\ell} \]
      5. +-commutative60.2%

        \[\leadsto \sqrt{\frac{1}{\frac{1}{\color{blue}{-1 + x}} + \left(\frac{x}{x - 1} - 1\right)}} \cdot \frac{t \cdot \sqrt{2}}{\ell} \]
      6. sub-neg60.2%

        \[\leadsto \sqrt{\frac{1}{\frac{1}{-1 + x} + \left(\frac{x}{\color{blue}{x + \left(-1\right)}} - 1\right)}} \cdot \frac{t \cdot \sqrt{2}}{\ell} \]
      7. metadata-eval60.2%

        \[\leadsto \sqrt{\frac{1}{\frac{1}{-1 + x} + \left(\frac{x}{x + \color{blue}{-1}} - 1\right)}} \cdot \frac{t \cdot \sqrt{2}}{\ell} \]
      8. +-commutative60.2%

        \[\leadsto \sqrt{\frac{1}{\frac{1}{-1 + x} + \left(\frac{x}{\color{blue}{-1 + x}} - 1\right)}} \cdot \frac{t \cdot \sqrt{2}}{\ell} \]
      9. associate-/l*60.2%

        \[\leadsto \sqrt{\frac{1}{\frac{1}{-1 + x} + \left(\frac{x}{-1 + x} - 1\right)}} \cdot \color{blue}{\frac{t}{\frac{\ell}{\sqrt{2}}}} \]
    6. Simplified60.2%

      \[\leadsto \color{blue}{\sqrt{\frac{1}{\frac{1}{-1 + x} + \left(\frac{x}{-1 + x} - 1\right)}} \cdot \frac{t}{\frac{\ell}{\sqrt{2}}}} \]
    7. Taylor expanded in x around inf 90.1%

      \[\leadsto \sqrt{\frac{1}{\frac{1}{-1 + x} + \color{blue}{\frac{1}{x}}}} \cdot \frac{t}{\frac{\ell}{\sqrt{2}}} \]
    8. Step-by-step derivation
      1. associate-/r/89.9%

        \[\leadsto \sqrt{\frac{1}{\frac{1}{-1 + x} + \frac{1}{x}}} \cdot \color{blue}{\left(\frac{t}{\ell} \cdot \sqrt{2}\right)} \]
    9. Applied egg-rr89.9%

      \[\leadsto \sqrt{\frac{1}{\frac{1}{-1 + x} + \frac{1}{x}}} \cdot \color{blue}{\left(\frac{t}{\ell} \cdot \sqrt{2}\right)} \]
    10. Taylor expanded in x around 0 50.1%

      \[\leadsto \sqrt{\color{blue}{x}} \cdot \left(\frac{t}{\ell} \cdot \sqrt{2}\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification37.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq 5.3 \cdot 10^{+262}:\\ \;\;\;\;\sqrt{\frac{x + -1}{1 + x}}\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt{2} \cdot \frac{t}{\ell}\right) \cdot \sqrt{x}\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 76.4% accurate, 2.1× speedup?

\[\begin{array}{l} l_m = \left|\ell\right| \\ t_m = \left|t\right| \\ t_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \sqrt{\frac{x + -1}{1 + x}} \end{array} \]
l_m = (fabs.f64 l)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s x l_m t_m)
 :precision binary64
 (* t_s (sqrt (/ (+ x -1.0) (+ 1.0 x)))))
l_m = fabs(l);
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double x, double l_m, double t_m) {
	return t_s * sqrt(((x + -1.0) / (1.0 + x)));
}
l_m = abs(l)
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, x, l_m, t_m)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: x
    real(8), intent (in) :: l_m
    real(8), intent (in) :: t_m
    code = t_s * sqrt(((x + (-1.0d0)) / (1.0d0 + x)))
end function
l_m = Math.abs(l);
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double l_m, double t_m) {
	return t_s * Math.sqrt(((x + -1.0) / (1.0 + x)));
}
l_m = math.fabs(l)
t_m = math.fabs(t)
t_s = math.copysign(1.0, t)
def code(t_s, x, l_m, t_m):
	return t_s * math.sqrt(((x + -1.0) / (1.0 + x)))
l_m = abs(l)
t_m = abs(t)
t_s = copysign(1.0, t)
function code(t_s, x, l_m, t_m)
	return Float64(t_s * sqrt(Float64(Float64(x + -1.0) / Float64(1.0 + x))))
end
l_m = abs(l);
t_m = abs(t);
t_s = sign(t) * abs(1.0);
function tmp = code(t_s, x, l_m, t_m)
	tmp = t_s * sqrt(((x + -1.0) / (1.0 + x)));
end
l_m = N[Abs[l], $MachinePrecision]
t_m = N[Abs[t], $MachinePrecision]
t_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, l$95$m_, t$95$m_] := N[(t$95$s * N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(1.0 + x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)

\\
t\_s \cdot \sqrt{\frac{x + -1}{1 + x}}
\end{array}
Derivation
  1. Initial program 30.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}} \]
  2. Simplified30.0%

    \[\leadsto \color{blue}{\sqrt{2} \cdot \frac{t}{\sqrt{\mathsf{fma}\left(\frac{x + 1}{x + -1}, \mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right), \ell \cdot \left(-\ell\right)\right)}}} \]
  3. Add Preprocessing
  4. Taylor expanded in t around inf 36.2%

    \[\leadsto \sqrt{2} \cdot \frac{t}{\color{blue}{\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{1 + x}{x - 1}}}} \]
  5. Step-by-step derivation
    1. +-commutative36.2%

      \[\leadsto \sqrt{2} \cdot \frac{t}{\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{\color{blue}{x + 1}}{x - 1}}} \]
    2. sub-neg36.2%

      \[\leadsto \sqrt{2} \cdot \frac{t}{\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{x + 1}{\color{blue}{x + \left(-1\right)}}}} \]
    3. metadata-eval36.2%

      \[\leadsto \sqrt{2} \cdot \frac{t}{\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{x + 1}{x + \color{blue}{-1}}}} \]
    4. +-commutative36.2%

      \[\leadsto \sqrt{2} \cdot \frac{t}{\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{x + 1}{\color{blue}{-1 + x}}}} \]
  6. Simplified36.2%

    \[\leadsto \sqrt{2} \cdot \frac{t}{\color{blue}{\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{x + 1}{-1 + x}}}} \]
  7. Taylor expanded in t around 0 36.2%

    \[\leadsto \color{blue}{\sqrt{\frac{x - 1}{1 + x}}} \]
  8. Final simplification36.2%

    \[\leadsto \sqrt{\frac{x + -1}{1 + x}} \]
  9. Add Preprocessing

Alternative 11: 75.7% accurate, 45.0× speedup?

\[\begin{array}{l} l_m = \left|\ell\right| \\ t_m = \left|t\right| \\ t_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \left(1 - \frac{1}{x}\right) \end{array} \]
l_m = (fabs.f64 l)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s x l_m t_m) :precision binary64 (* t_s (- 1.0 (/ 1.0 x))))
l_m = fabs(l);
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double x, double l_m, double t_m) {
	return t_s * (1.0 - (1.0 / x));
}
l_m = abs(l)
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, x, l_m, t_m)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: x
    real(8), intent (in) :: l_m
    real(8), intent (in) :: t_m
    code = t_s * (1.0d0 - (1.0d0 / x))
end function
l_m = Math.abs(l);
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double l_m, double t_m) {
	return t_s * (1.0 - (1.0 / x));
}
l_m = math.fabs(l)
t_m = math.fabs(t)
t_s = math.copysign(1.0, t)
def code(t_s, x, l_m, t_m):
	return t_s * (1.0 - (1.0 / x))
l_m = abs(l)
t_m = abs(t)
t_s = copysign(1.0, t)
function code(t_s, x, l_m, t_m)
	return Float64(t_s * Float64(1.0 - Float64(1.0 / x)))
end
l_m = abs(l);
t_m = abs(t);
t_s = sign(t) * abs(1.0);
function tmp = code(t_s, x, l_m, t_m)
	tmp = t_s * (1.0 - (1.0 / x));
end
l_m = N[Abs[l], $MachinePrecision]
t_m = N[Abs[t], $MachinePrecision]
t_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, l$95$m_, t$95$m_] := N[(t$95$s * N[(1.0 - N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)

\\
t\_s \cdot \left(1 - \frac{1}{x}\right)
\end{array}
Derivation
  1. Initial program 30.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}} \]
  2. Simplified30.0%

    \[\leadsto \color{blue}{\sqrt{2} \cdot \frac{t}{\sqrt{\mathsf{fma}\left(\frac{x + 1}{x + -1}, \mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right), \ell \cdot \left(-\ell\right)\right)}}} \]
  3. Add Preprocessing
  4. Taylor expanded in t around inf 36.2%

    \[\leadsto \sqrt{2} \cdot \frac{t}{\color{blue}{\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{1 + x}{x - 1}}}} \]
  5. Step-by-step derivation
    1. +-commutative36.2%

      \[\leadsto \sqrt{2} \cdot \frac{t}{\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{\color{blue}{x + 1}}{x - 1}}} \]
    2. sub-neg36.2%

      \[\leadsto \sqrt{2} \cdot \frac{t}{\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{x + 1}{\color{blue}{x + \left(-1\right)}}}} \]
    3. metadata-eval36.2%

      \[\leadsto \sqrt{2} \cdot \frac{t}{\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{x + 1}{x + \color{blue}{-1}}}} \]
    4. +-commutative36.2%

      \[\leadsto \sqrt{2} \cdot \frac{t}{\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{x + 1}{\color{blue}{-1 + x}}}} \]
  6. Simplified36.2%

    \[\leadsto \sqrt{2} \cdot \frac{t}{\color{blue}{\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{x + 1}{-1 + x}}}} \]
  7. Taylor expanded in x around inf 36.0%

    \[\leadsto \color{blue}{1 - \frac{1}{x}} \]
  8. Final simplification36.0%

    \[\leadsto 1 - \frac{1}{x} \]
  9. Add Preprocessing

Alternative 12: 75.0% accurate, 225.0× speedup?

\[\begin{array}{l} l_m = \left|\ell\right| \\ t_m = \left|t\right| \\ t_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot 1 \end{array} \]
l_m = (fabs.f64 l)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s x l_m t_m) :precision binary64 (* t_s 1.0))
l_m = fabs(l);
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double x, double l_m, double t_m) {
	return t_s * 1.0;
}
l_m = abs(l)
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, x, l_m, t_m)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: x
    real(8), intent (in) :: l_m
    real(8), intent (in) :: t_m
    code = t_s * 1.0d0
end function
l_m = Math.abs(l);
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double l_m, double t_m) {
	return t_s * 1.0;
}
l_m = math.fabs(l)
t_m = math.fabs(t)
t_s = math.copysign(1.0, t)
def code(t_s, x, l_m, t_m):
	return t_s * 1.0
l_m = abs(l)
t_m = abs(t)
t_s = copysign(1.0, t)
function code(t_s, x, l_m, t_m)
	return Float64(t_s * 1.0)
end
l_m = abs(l);
t_m = abs(t);
t_s = sign(t) * abs(1.0);
function tmp = code(t_s, x, l_m, t_m)
	tmp = t_s * 1.0;
end
l_m = N[Abs[l], $MachinePrecision]
t_m = N[Abs[t], $MachinePrecision]
t_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, l$95$m_, t$95$m_] := N[(t$95$s * 1.0), $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)

\\
t\_s \cdot 1
\end{array}
Derivation
  1. Initial program 30.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}} \]
  2. Simplified30.0%

    \[\leadsto \color{blue}{\sqrt{2} \cdot \frac{t}{\sqrt{\mathsf{fma}\left(\frac{x + 1}{x + -1}, \mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right), \ell \cdot \left(-\ell\right)\right)}}} \]
  3. Add Preprocessing
  4. Taylor expanded in t around inf 36.2%

    \[\leadsto \sqrt{2} \cdot \frac{t}{\color{blue}{\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{1 + x}{x - 1}}}} \]
  5. Step-by-step derivation
    1. +-commutative36.2%

      \[\leadsto \sqrt{2} \cdot \frac{t}{\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{\color{blue}{x + 1}}{x - 1}}} \]
    2. sub-neg36.2%

      \[\leadsto \sqrt{2} \cdot \frac{t}{\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{x + 1}{\color{blue}{x + \left(-1\right)}}}} \]
    3. metadata-eval36.2%

      \[\leadsto \sqrt{2} \cdot \frac{t}{\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{x + 1}{x + \color{blue}{-1}}}} \]
    4. +-commutative36.2%

      \[\leadsto \sqrt{2} \cdot \frac{t}{\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{x + 1}{\color{blue}{-1 + x}}}} \]
  6. Simplified36.2%

    \[\leadsto \sqrt{2} \cdot \frac{t}{\color{blue}{\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{x + 1}{-1 + x}}}} \]
  7. Taylor expanded in x around inf 35.6%

    \[\leadsto \color{blue}{1} \]
  8. Final simplification35.6%

    \[\leadsto 1 \]
  9. Add Preprocessing

Reproduce

?
herbie shell --seed 2024030 
(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)))))