Toniolo and Linder, Equation (7)

Percentage Accurate: 33.4% → 82.9%
Time: 26.8s
Alternatives: 10
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 10 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: 33.4% 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: 82.9% accurate, 0.4× speedup?

\[\begin{array}{l} t_m = \left|t\right| \\ t_s = \mathsf{copysign}\left(1, t\right) \\ \begin{array}{l} t_2 := 2 \cdot {\ell}^{2}\\ t_s \cdot \begin{array}{l} \mathbf{if}\;t_m \leq 5.8 \cdot 10^{-218}:\\ \;\;\;\;\sqrt{2} \cdot \frac{t_m}{0.5 \cdot \frac{2 \cdot \left({t_m}^{2} + {t_m}^{2}\right) + t_2}{t_m \cdot \left(\sqrt{2} \cdot x\right)} + t_m \cdot \sqrt{2}}\\ \mathbf{elif}\;t_m \leq 5.6 \cdot 10^{-10}:\\ \;\;\;\;\sqrt{2} \cdot \frac{t_m}{\sqrt{\mathsf{fma}\left(2, \frac{{t_m}^{2}}{\frac{-1 + x}{x + 1}}, \frac{t_2}{x}\right)}}\\ \mathbf{else}:\\ \;\;\;\;{\left(\frac{x + 1}{-1 + x}\right)}^{-0.5}\\ \end{array} \end{array} \end{array} \]
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s x l t_m)
 :precision binary64
 (let* ((t_2 (* 2.0 (pow l 2.0))))
   (*
    t_s
    (if (<= t_m 5.8e-218)
      (*
       (sqrt 2.0)
       (/
        t_m
        (+
         (*
          0.5
          (/
           (+ (* 2.0 (+ (pow t_m 2.0) (pow t_m 2.0))) t_2)
           (* t_m (* (sqrt 2.0) x))))
         (* t_m (sqrt 2.0)))))
      (if (<= t_m 5.6e-10)
        (*
         (sqrt 2.0)
         (/
          t_m
          (sqrt
           (fma 2.0 (/ (pow t_m 2.0) (/ (+ -1.0 x) (+ x 1.0))) (/ t_2 x)))))
        (pow (/ (+ x 1.0) (+ -1.0 x)) -0.5))))))
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double x, double l, double t_m) {
	double t_2 = 2.0 * pow(l, 2.0);
	double tmp;
	if (t_m <= 5.8e-218) {
		tmp = sqrt(2.0) * (t_m / ((0.5 * (((2.0 * (pow(t_m, 2.0) + pow(t_m, 2.0))) + t_2) / (t_m * (sqrt(2.0) * x)))) + (t_m * sqrt(2.0))));
	} else if (t_m <= 5.6e-10) {
		tmp = sqrt(2.0) * (t_m / sqrt(fma(2.0, (pow(t_m, 2.0) / ((-1.0 + x) / (x + 1.0))), (t_2 / x))));
	} else {
		tmp = pow(((x + 1.0) / (-1.0 + x)), -0.5);
	}
	return t_s * tmp;
}
t_m = abs(t)
t_s = copysign(1.0, t)
function code(t_s, x, l, t_m)
	t_2 = Float64(2.0 * (l ^ 2.0))
	tmp = 0.0
	if (t_m <= 5.8e-218)
		tmp = Float64(sqrt(2.0) * Float64(t_m / Float64(Float64(0.5 * Float64(Float64(Float64(2.0 * Float64((t_m ^ 2.0) + (t_m ^ 2.0))) + t_2) / Float64(t_m * Float64(sqrt(2.0) * x)))) + Float64(t_m * sqrt(2.0)))));
	elseif (t_m <= 5.6e-10)
		tmp = Float64(sqrt(2.0) * Float64(t_m / sqrt(fma(2.0, Float64((t_m ^ 2.0) / Float64(Float64(-1.0 + x) / Float64(x + 1.0))), Float64(t_2 / x)))));
	else
		tmp = Float64(Float64(x + 1.0) / Float64(-1.0 + x)) ^ -0.5;
	end
	return Float64(t_s * tmp)
end
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_, t$95$m_] := Block[{t$95$2 = N[(2.0 * N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]}, N[(t$95$s * If[LessEqual[t$95$m, 5.8e-218], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t$95$m / N[(N[(0.5 * N[(N[(N[(2.0 * N[(N[Power[t$95$m, 2.0], $MachinePrecision] + N[Power[t$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$2), $MachinePrecision] / N[(t$95$m * N[(N[Sqrt[2.0], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$m * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 5.6e-10], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t$95$m / N[Sqrt[N[(2.0 * N[(N[Power[t$95$m, 2.0], $MachinePrecision] / N[(N[(-1.0 + x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$2 / x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Power[N[(N[(x + 1.0), $MachinePrecision] / N[(-1.0 + x), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)

\\
\begin{array}{l}
t_2 := 2 \cdot {\ell}^{2}\\
t_s \cdot \begin{array}{l}
\mathbf{if}\;t_m \leq 5.8 \cdot 10^{-218}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t_m}{0.5 \cdot \frac{2 \cdot \left({t_m}^{2} + {t_m}^{2}\right) + t_2}{t_m \cdot \left(\sqrt{2} \cdot x\right)} + t_m \cdot \sqrt{2}}\\

\mathbf{elif}\;t_m \leq 5.6 \cdot 10^{-10}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t_m}{\sqrt{\mathsf{fma}\left(2, \frac{{t_m}^{2}}{\frac{-1 + x}{x + 1}}, \frac{t_2}{x}\right)}}\\

\mathbf{else}:\\
\;\;\;\;{\left(\frac{x + 1}{-1 + x}\right)}^{-0.5}\\


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

    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.6%

      \[\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. Taylor expanded in l around 0 28.2%

      \[\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)}}} \]
    4. Step-by-step derivation
      1. fma-def28.2%

        \[\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*40.7%

        \[\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. +-commutative40.7%

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

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

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

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

        \[\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-neg51.3%

        \[\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-eval51.3%

        \[\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. +-commutative51.3%

        \[\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-neg51.3%

        \[\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-eval51.3%

        \[\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. +-commutative51.3%

        \[\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)}} \]
    5. Simplified51.3%

      \[\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)}}} \]
    6. Taylor expanded in x around inf 14.1%

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

    if 5.8000000000000004e-218 < t < 5.60000000000000031e-10

    1. Initial program 35.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. Simplified35.5%

      \[\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. Taylor expanded in l around 0 47.6%

      \[\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)}}} \]
    4. Step-by-step derivation
      1. fma-def47.6%

        \[\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*47.6%

        \[\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. +-commutative47.6%

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

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

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

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

        \[\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-neg60.3%

        \[\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-eval60.3%

        \[\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. +-commutative60.3%

        \[\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-neg60.3%

        \[\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-eval60.3%

        \[\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. +-commutative60.3%

        \[\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)}} \]
    5. Simplified60.3%

      \[\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)}}} \]
    6. Taylor expanded in x around inf 85.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)}} \]
    7. Step-by-step derivation
      1. associate-*r/85.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)}} \]
    8. Simplified85.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 5.60000000000000031e-10 < t

    1. Initial program 41.8%

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

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

      \[\leadsto \frac{\sqrt{2}}{\color{blue}{\sqrt{2} \cdot \sqrt{\frac{1 + x}{x - 1}}}} \]
    4. Step-by-step derivation
      1. +-commutative98.9%

        \[\leadsto \frac{\sqrt{2}}{\sqrt{2} \cdot \sqrt{\frac{\color{blue}{x + 1}}{x - 1}}} \]
      2. sub-neg98.9%

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

        \[\leadsto \frac{\sqrt{2}}{\sqrt{2} \cdot \sqrt{\frac{x + 1}{x + \color{blue}{-1}}}} \]
      4. +-commutative98.9%

        \[\leadsto \frac{\sqrt{2}}{\sqrt{2} \cdot \sqrt{\frac{x + 1}{\color{blue}{-1 + x}}}} \]
    5. Simplified98.9%

      \[\leadsto \frac{\sqrt{2}}{\color{blue}{\sqrt{2} \cdot \sqrt{\frac{x + 1}{-1 + x}}}} \]
    6. Step-by-step derivation
      1. *-un-lft-identity98.9%

        \[\leadsto \frac{\color{blue}{1 \cdot \sqrt{2}}}{\sqrt{2} \cdot \sqrt{\frac{x + 1}{-1 + x}}} \]
      2. times-frac98.9%

        \[\leadsto \color{blue}{\frac{1}{\sqrt{2}} \cdot \frac{\sqrt{2}}{\sqrt{\frac{x + 1}{-1 + x}}}} \]
      3. +-commutative98.9%

        \[\leadsto \frac{1}{\sqrt{2}} \cdot \frac{\sqrt{2}}{\sqrt{\frac{x + 1}{\color{blue}{x + -1}}}} \]
    7. Applied egg-rr98.9%

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

        \[\leadsto \color{blue}{\frac{\frac{1}{\sqrt{2}} \cdot \sqrt{2}}{\sqrt{\frac{x + 1}{x + -1}}}} \]
      2. lft-mult-inverse98.9%

        \[\leadsto \frac{\color{blue}{1}}{\sqrt{\frac{x + 1}{x + -1}}} \]
      3. +-commutative98.9%

        \[\leadsto \frac{1}{\sqrt{\frac{x + 1}{\color{blue}{-1 + x}}}} \]
    9. Simplified98.9%

      \[\leadsto \color{blue}{\frac{1}{\sqrt{\frac{x + 1}{-1 + x}}}} \]
    10. Step-by-step derivation
      1. expm1-log1p-u98.9%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{1}{\sqrt{\frac{x + 1}{-1 + x}}}\right)\right)} \]
      2. expm1-udef98.9%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{1}{\sqrt{\frac{x + 1}{-1 + x}}}\right)} - 1} \]
      3. inv-pow98.9%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{{\left(\sqrt{\frac{x + 1}{-1 + x}}\right)}^{-1}}\right)} - 1 \]
      4. sqrt-pow298.9%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{{\left(\frac{x + 1}{-1 + x}\right)}^{\left(\frac{-1}{2}\right)}}\right)} - 1 \]
      5. +-commutative98.9%

        \[\leadsto e^{\mathsf{log1p}\left({\left(\frac{\color{blue}{1 + x}}{-1 + x}\right)}^{\left(\frac{-1}{2}\right)}\right)} - 1 \]
      6. +-commutative98.9%

        \[\leadsto e^{\mathsf{log1p}\left({\left(\frac{1 + x}{\color{blue}{x + -1}}\right)}^{\left(\frac{-1}{2}\right)}\right)} - 1 \]
      7. metadata-eval98.9%

        \[\leadsto e^{\mathsf{log1p}\left({\left(\frac{1 + x}{x + -1}\right)}^{\color{blue}{-0.5}}\right)} - 1 \]
    11. Applied egg-rr98.9%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left({\left(\frac{1 + x}{x + -1}\right)}^{-0.5}\right)} - 1} \]
    12. Step-by-step derivation
      1. expm1-def98.9%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left({\left(\frac{1 + x}{x + -1}\right)}^{-0.5}\right)\right)} \]
      2. expm1-log1p98.9%

        \[\leadsto \color{blue}{{\left(\frac{1 + x}{x + -1}\right)}^{-0.5}} \]
      3. +-commutative98.9%

        \[\leadsto {\left(\frac{\color{blue}{x + 1}}{x + -1}\right)}^{-0.5} \]
      4. +-commutative98.9%

        \[\leadsto {\left(\frac{x + 1}{\color{blue}{-1 + x}}\right)}^{-0.5} \]
    13. Simplified98.9%

      \[\leadsto \color{blue}{{\left(\frac{x + 1}{-1 + x}\right)}^{-0.5}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification53.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 5.8 \cdot 10^{-218}:\\ \;\;\;\;\sqrt{2} \cdot \frac{t}{0.5 \cdot \frac{2 \cdot \left({t}^{2} + {t}^{2}\right) + 2 \cdot {\ell}^{2}}{t \cdot \left(\sqrt{2} \cdot x\right)} + t \cdot \sqrt{2}}\\ \mathbf{elif}\;t \leq 5.6 \cdot 10^{-10}:\\ \;\;\;\;\sqrt{2} \cdot \frac{t}{\sqrt{\mathsf{fma}\left(2, \frac{{t}^{2}}{\frac{-1 + x}{x + 1}}, \frac{2 \cdot {\ell}^{2}}{x}\right)}}\\ \mathbf{else}:\\ \;\;\;\;{\left(\frac{x + 1}{-1 + x}\right)}^{-0.5}\\ \end{array} \]

Alternative 2: 74.6% accurate, 0.4× speedup?

\[\begin{array}{l} t_m = \left|t\right| \\ t_s = \mathsf{copysign}\left(1, t\right) \\ \begin{array}{l} t_2 := t_m \cdot \sqrt{2}\\ t_3 := \frac{x + 1}{-1 + x}\\ t_s \cdot \begin{array}{l} \mathbf{if}\;\ell \cdot \ell \leq 2 \cdot 10^{+148}:\\ \;\;\;\;{t_3}^{-0.5}\\ \mathbf{elif}\;\ell \cdot \ell \leq 5 \cdot 10^{+307}:\\ \;\;\;\;\sqrt{2} \cdot \frac{t_m}{\sqrt{\frac{2 \cdot {\ell}^{2}}{x}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{t_2}{\mathsf{hypot}\left(\mathsf{hypot}\left(\ell, t_2\right) \cdot \sqrt{t_3}, \ell\right)}\\ \end{array} \end{array} \end{array} \]
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s x l t_m)
 :precision binary64
 (let* ((t_2 (* t_m (sqrt 2.0))) (t_3 (/ (+ x 1.0) (+ -1.0 x))))
   (*
    t_s
    (if (<= (* l l) 2e+148)
      (pow t_3 -0.5)
      (if (<= (* l l) 5e+307)
        (* (sqrt 2.0) (/ t_m (sqrt (/ (* 2.0 (pow l 2.0)) x))))
        (/ t_2 (hypot (* (hypot l t_2) (sqrt t_3)) l)))))))
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double x, double l, double t_m) {
	double t_2 = t_m * sqrt(2.0);
	double t_3 = (x + 1.0) / (-1.0 + x);
	double tmp;
	if ((l * l) <= 2e+148) {
		tmp = pow(t_3, -0.5);
	} else if ((l * l) <= 5e+307) {
		tmp = sqrt(2.0) * (t_m / sqrt(((2.0 * pow(l, 2.0)) / x)));
	} else {
		tmp = t_2 / hypot((hypot(l, t_2) * sqrt(t_3)), l);
	}
	return t_s * tmp;
}
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double l, double t_m) {
	double t_2 = t_m * Math.sqrt(2.0);
	double t_3 = (x + 1.0) / (-1.0 + x);
	double tmp;
	if ((l * l) <= 2e+148) {
		tmp = Math.pow(t_3, -0.5);
	} else if ((l * l) <= 5e+307) {
		tmp = Math.sqrt(2.0) * (t_m / Math.sqrt(((2.0 * Math.pow(l, 2.0)) / x)));
	} else {
		tmp = t_2 / Math.hypot((Math.hypot(l, t_2) * Math.sqrt(t_3)), l);
	}
	return t_s * tmp;
}
t_m = math.fabs(t)
t_s = math.copysign(1.0, t)
def code(t_s, x, l, t_m):
	t_2 = t_m * math.sqrt(2.0)
	t_3 = (x + 1.0) / (-1.0 + x)
	tmp = 0
	if (l * l) <= 2e+148:
		tmp = math.pow(t_3, -0.5)
	elif (l * l) <= 5e+307:
		tmp = math.sqrt(2.0) * (t_m / math.sqrt(((2.0 * math.pow(l, 2.0)) / x)))
	else:
		tmp = t_2 / math.hypot((math.hypot(l, t_2) * math.sqrt(t_3)), l)
	return t_s * tmp
t_m = abs(t)
t_s = copysign(1.0, t)
function code(t_s, x, l, t_m)
	t_2 = Float64(t_m * sqrt(2.0))
	t_3 = Float64(Float64(x + 1.0) / Float64(-1.0 + x))
	tmp = 0.0
	if (Float64(l * l) <= 2e+148)
		tmp = t_3 ^ -0.5;
	elseif (Float64(l * l) <= 5e+307)
		tmp = Float64(sqrt(2.0) * Float64(t_m / sqrt(Float64(Float64(2.0 * (l ^ 2.0)) / x))));
	else
		tmp = Float64(t_2 / hypot(Float64(hypot(l, t_2) * sqrt(t_3)), l));
	end
	return Float64(t_s * tmp)
end
t_m = abs(t);
t_s = sign(t) * abs(1.0);
function tmp_2 = code(t_s, x, l, t_m)
	t_2 = t_m * sqrt(2.0);
	t_3 = (x + 1.0) / (-1.0 + x);
	tmp = 0.0;
	if ((l * l) <= 2e+148)
		tmp = t_3 ^ -0.5;
	elseif ((l * l) <= 5e+307)
		tmp = sqrt(2.0) * (t_m / sqrt(((2.0 * (l ^ 2.0)) / x)));
	else
		tmp = t_2 / hypot((hypot(l, t_2) * sqrt(t_3)), l);
	end
	tmp_2 = t_s * tmp;
end
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_, t$95$m_] := Block[{t$95$2 = N[(t$95$m * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x + 1.0), $MachinePrecision] / N[(-1.0 + x), $MachinePrecision]), $MachinePrecision]}, N[(t$95$s * If[LessEqual[N[(l * l), $MachinePrecision], 2e+148], N[Power[t$95$3, -0.5], $MachinePrecision], If[LessEqual[N[(l * l), $MachinePrecision], 5e+307], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t$95$m / N[Sqrt[N[(N[(2.0 * N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$2 / N[Sqrt[N[(N[Sqrt[l ^ 2 + t$95$2 ^ 2], $MachinePrecision] * N[Sqrt[t$95$3], $MachinePrecision]), $MachinePrecision] ^ 2 + l ^ 2], $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]]
\begin{array}{l}
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)

\\
\begin{array}{l}
t_2 := t_m \cdot \sqrt{2}\\
t_3 := \frac{x + 1}{-1 + x}\\
t_s \cdot \begin{array}{l}
\mathbf{if}\;\ell \cdot \ell \leq 2 \cdot 10^{+148}:\\
\;\;\;\;{t_3}^{-0.5}\\

\mathbf{elif}\;\ell \cdot \ell \leq 5 \cdot 10^{+307}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t_m}{\sqrt{\frac{2 \cdot {\ell}^{2}}{x}}}\\

\mathbf{else}:\\
\;\;\;\;\frac{t_2}{\mathsf{hypot}\left(\mathsf{hypot}\left(\ell, t_2\right) \cdot \sqrt{t_3}, \ell\right)}\\


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 l l) < 2.0000000000000001e148

    1. Initial program 49.9%

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

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

      \[\leadsto \frac{\sqrt{2}}{\color{blue}{\sqrt{2} \cdot \sqrt{\frac{1 + x}{x - 1}}}} \]
    4. Step-by-step derivation
      1. +-commutative49.6%

        \[\leadsto \frac{\sqrt{2}}{\sqrt{2} \cdot \sqrt{\frac{\color{blue}{x + 1}}{x - 1}}} \]
      2. sub-neg49.6%

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

        \[\leadsto \frac{\sqrt{2}}{\sqrt{2} \cdot \sqrt{\frac{x + 1}{x + \color{blue}{-1}}}} \]
      4. +-commutative49.6%

        \[\leadsto \frac{\sqrt{2}}{\sqrt{2} \cdot \sqrt{\frac{x + 1}{\color{blue}{-1 + x}}}} \]
    5. Simplified49.6%

      \[\leadsto \frac{\sqrt{2}}{\color{blue}{\sqrt{2} \cdot \sqrt{\frac{x + 1}{-1 + x}}}} \]
    6. Step-by-step derivation
      1. *-un-lft-identity49.6%

        \[\leadsto \frac{\color{blue}{1 \cdot \sqrt{2}}}{\sqrt{2} \cdot \sqrt{\frac{x + 1}{-1 + x}}} \]
      2. times-frac49.6%

        \[\leadsto \color{blue}{\frac{1}{\sqrt{2}} \cdot \frac{\sqrt{2}}{\sqrt{\frac{x + 1}{-1 + x}}}} \]
      3. +-commutative49.6%

        \[\leadsto \frac{1}{\sqrt{2}} \cdot \frac{\sqrt{2}}{\sqrt{\frac{x + 1}{\color{blue}{x + -1}}}} \]
    7. Applied egg-rr49.6%

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

        \[\leadsto \color{blue}{\frac{\frac{1}{\sqrt{2}} \cdot \sqrt{2}}{\sqrt{\frac{x + 1}{x + -1}}}} \]
      2. lft-mult-inverse49.6%

        \[\leadsto \frac{\color{blue}{1}}{\sqrt{\frac{x + 1}{x + -1}}} \]
      3. +-commutative49.6%

        \[\leadsto \frac{1}{\sqrt{\frac{x + 1}{\color{blue}{-1 + x}}}} \]
    9. Simplified49.6%

      \[\leadsto \color{blue}{\frac{1}{\sqrt{\frac{x + 1}{-1 + x}}}} \]
    10. Step-by-step derivation
      1. expm1-log1p-u49.6%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{1}{\sqrt{\frac{x + 1}{-1 + x}}}\right)\right)} \]
      2. expm1-udef49.6%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{1}{\sqrt{\frac{x + 1}{-1 + x}}}\right)} - 1} \]
      3. inv-pow49.6%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{{\left(\sqrt{\frac{x + 1}{-1 + x}}\right)}^{-1}}\right)} - 1 \]
      4. sqrt-pow249.6%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{{\left(\frac{x + 1}{-1 + x}\right)}^{\left(\frac{-1}{2}\right)}}\right)} - 1 \]
      5. +-commutative49.6%

        \[\leadsto e^{\mathsf{log1p}\left({\left(\frac{\color{blue}{1 + x}}{-1 + x}\right)}^{\left(\frac{-1}{2}\right)}\right)} - 1 \]
      6. +-commutative49.6%

        \[\leadsto e^{\mathsf{log1p}\left({\left(\frac{1 + x}{\color{blue}{x + -1}}\right)}^{\left(\frac{-1}{2}\right)}\right)} - 1 \]
      7. metadata-eval49.6%

        \[\leadsto e^{\mathsf{log1p}\left({\left(\frac{1 + x}{x + -1}\right)}^{\color{blue}{-0.5}}\right)} - 1 \]
    11. Applied egg-rr49.6%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left({\left(\frac{1 + x}{x + -1}\right)}^{-0.5}\right)} - 1} \]
    12. Step-by-step derivation
      1. expm1-def49.6%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left({\left(\frac{1 + x}{x + -1}\right)}^{-0.5}\right)\right)} \]
      2. expm1-log1p49.6%

        \[\leadsto \color{blue}{{\left(\frac{1 + x}{x + -1}\right)}^{-0.5}} \]
      3. +-commutative49.6%

        \[\leadsto {\left(\frac{\color{blue}{x + 1}}{x + -1}\right)}^{-0.5} \]
      4. +-commutative49.6%

        \[\leadsto {\left(\frac{x + 1}{\color{blue}{-1 + x}}\right)}^{-0.5} \]
    13. Simplified49.6%

      \[\leadsto \color{blue}{{\left(\frac{x + 1}{-1 + x}\right)}^{-0.5}} \]

    if 2.0000000000000001e148 < (*.f64 l l) < 5e307

    1. Initial program 12.9%

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

      \[\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. Taylor expanded in l around inf 2.6%

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

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

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

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

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

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

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

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

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

      \[\leadsto \sqrt{2} \cdot \frac{t}{\sqrt{\color{blue}{2 \cdot \frac{{\ell}^{2}}{x}}}} \]
    7. Step-by-step derivation
      1. associate-*r/85.5%

        \[\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)}} \]
    8. Simplified61.2%

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

    if 5e307 < (*.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}{\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. Applied egg-rr61.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \cdot \ell \leq 2 \cdot 10^{+148}:\\ \;\;\;\;{\left(\frac{x + 1}{-1 + x}\right)}^{-0.5}\\ \mathbf{elif}\;\ell \cdot \ell \leq 5 \cdot 10^{+307}:\\ \;\;\;\;\sqrt{2} \cdot \frac{t}{\sqrt{\frac{2 \cdot {\ell}^{2}}{x}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{\mathsf{hypot}\left(\mathsf{hypot}\left(\ell, t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{x + 1}{-1 + x}}, \ell\right)}\\ \end{array} \]

Alternative 3: 82.1% accurate, 0.4× speedup?

\[\begin{array}{l} t_m = \left|t\right| \\ t_s = \mathsf{copysign}\left(1, t\right) \\ t_s \cdot \begin{array}{l} \mathbf{if}\;t_m \leq 6.5 \cdot 10^{-10}:\\ \;\;\;\;\sqrt{2} \cdot \frac{t_m}{\sqrt{\mathsf{fma}\left(2, \frac{{t_m}^{2}}{\frac{-1 + x}{x + 1}}, \frac{2 \cdot {\ell}^{2}}{x}\right)}}\\ \mathbf{else}:\\ \;\;\;\;{\left(\frac{x + 1}{-1 + x}\right)}^{-0.5}\\ \end{array} \end{array} \]
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s x l t_m)
 :precision binary64
 (*
  t_s
  (if (<= t_m 6.5e-10)
    (*
     (sqrt 2.0)
     (/
      t_m
      (sqrt
       (fma
        2.0
        (/ (pow t_m 2.0) (/ (+ -1.0 x) (+ x 1.0)))
        (/ (* 2.0 (pow l 2.0)) x)))))
    (pow (/ (+ x 1.0) (+ -1.0 x)) -0.5))))
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double x, double l, double t_m) {
	double tmp;
	if (t_m <= 6.5e-10) {
		tmp = sqrt(2.0) * (t_m / sqrt(fma(2.0, (pow(t_m, 2.0) / ((-1.0 + x) / (x + 1.0))), ((2.0 * pow(l, 2.0)) / x))));
	} else {
		tmp = pow(((x + 1.0) / (-1.0 + x)), -0.5);
	}
	return t_s * tmp;
}
t_m = abs(t)
t_s = copysign(1.0, t)
function code(t_s, x, l, t_m)
	tmp = 0.0
	if (t_m <= 6.5e-10)
		tmp = Float64(sqrt(2.0) * Float64(t_m / sqrt(fma(2.0, Float64((t_m ^ 2.0) / Float64(Float64(-1.0 + x) / Float64(x + 1.0))), Float64(Float64(2.0 * (l ^ 2.0)) / x)))));
	else
		tmp = Float64(Float64(x + 1.0) / Float64(-1.0 + x)) ^ -0.5;
	end
	return Float64(t_s * tmp)
end
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_, t$95$m_] := N[(t$95$s * If[LessEqual[t$95$m, 6.5e-10], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t$95$m / N[Sqrt[N[(2.0 * N[(N[Power[t$95$m, 2.0], $MachinePrecision] / N[(N[(-1.0 + x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(2.0 * N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Power[N[(N[(x + 1.0), $MachinePrecision] / N[(-1.0 + x), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)

\\
t_s \cdot \begin{array}{l}
\mathbf{if}\;t_m \leq 6.5 \cdot 10^{-10}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t_m}{\sqrt{\mathsf{fma}\left(2, \frac{{t_m}^{2}}{\frac{-1 + x}{x + 1}}, \frac{2 \cdot {\ell}^{2}}{x}\right)}}\\

\mathbf{else}:\\
\;\;\;\;{\left(\frac{x + 1}{-1 + x}\right)}^{-0.5}\\


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

    1. Initial program 33.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. Simplified33.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. Taylor expanded in l around 0 33.2%

      \[\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)}}} \]
    4. Step-by-step derivation
      1. fma-def33.2%

        \[\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*42.5%

        \[\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. +-commutative42.5%

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

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

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

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

        \[\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-neg53.6%

        \[\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-eval53.6%

        \[\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. +-commutative53.6%

        \[\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-neg53.6%

        \[\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-eval53.6%

        \[\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. +-commutative53.6%

        \[\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)}} \]
    5. Simplified53.6%

      \[\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)}}} \]
    6. Taylor expanded in x around inf 66.5%

      \[\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)}} \]
    7. Step-by-step derivation
      1. associate-*r/66.5%

        \[\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)}} \]
    8. Simplified66.5%

      \[\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 6.5000000000000003e-10 < t

    1. Initial program 41.8%

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

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

      \[\leadsto \frac{\sqrt{2}}{\color{blue}{\sqrt{2} \cdot \sqrt{\frac{1 + x}{x - 1}}}} \]
    4. Step-by-step derivation
      1. +-commutative98.9%

        \[\leadsto \frac{\sqrt{2}}{\sqrt{2} \cdot \sqrt{\frac{\color{blue}{x + 1}}{x - 1}}} \]
      2. sub-neg98.9%

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

        \[\leadsto \frac{\sqrt{2}}{\sqrt{2} \cdot \sqrt{\frac{x + 1}{x + \color{blue}{-1}}}} \]
      4. +-commutative98.9%

        \[\leadsto \frac{\sqrt{2}}{\sqrt{2} \cdot \sqrt{\frac{x + 1}{\color{blue}{-1 + x}}}} \]
    5. Simplified98.9%

      \[\leadsto \frac{\sqrt{2}}{\color{blue}{\sqrt{2} \cdot \sqrt{\frac{x + 1}{-1 + x}}}} \]
    6. Step-by-step derivation
      1. *-un-lft-identity98.9%

        \[\leadsto \frac{\color{blue}{1 \cdot \sqrt{2}}}{\sqrt{2} \cdot \sqrt{\frac{x + 1}{-1 + x}}} \]
      2. times-frac98.9%

        \[\leadsto \color{blue}{\frac{1}{\sqrt{2}} \cdot \frac{\sqrt{2}}{\sqrt{\frac{x + 1}{-1 + x}}}} \]
      3. +-commutative98.9%

        \[\leadsto \frac{1}{\sqrt{2}} \cdot \frac{\sqrt{2}}{\sqrt{\frac{x + 1}{\color{blue}{x + -1}}}} \]
    7. Applied egg-rr98.9%

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

        \[\leadsto \color{blue}{\frac{\frac{1}{\sqrt{2}} \cdot \sqrt{2}}{\sqrt{\frac{x + 1}{x + -1}}}} \]
      2. lft-mult-inverse98.9%

        \[\leadsto \frac{\color{blue}{1}}{\sqrt{\frac{x + 1}{x + -1}}} \]
      3. +-commutative98.9%

        \[\leadsto \frac{1}{\sqrt{\frac{x + 1}{\color{blue}{-1 + x}}}} \]
    9. Simplified98.9%

      \[\leadsto \color{blue}{\frac{1}{\sqrt{\frac{x + 1}{-1 + x}}}} \]
    10. Step-by-step derivation
      1. expm1-log1p-u98.9%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{1}{\sqrt{\frac{x + 1}{-1 + x}}}\right)\right)} \]
      2. expm1-udef98.9%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{1}{\sqrt{\frac{x + 1}{-1 + x}}}\right)} - 1} \]
      3. inv-pow98.9%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{{\left(\sqrt{\frac{x + 1}{-1 + x}}\right)}^{-1}}\right)} - 1 \]
      4. sqrt-pow298.9%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{{\left(\frac{x + 1}{-1 + x}\right)}^{\left(\frac{-1}{2}\right)}}\right)} - 1 \]
      5. +-commutative98.9%

        \[\leadsto e^{\mathsf{log1p}\left({\left(\frac{\color{blue}{1 + x}}{-1 + x}\right)}^{\left(\frac{-1}{2}\right)}\right)} - 1 \]
      6. +-commutative98.9%

        \[\leadsto e^{\mathsf{log1p}\left({\left(\frac{1 + x}{\color{blue}{x + -1}}\right)}^{\left(\frac{-1}{2}\right)}\right)} - 1 \]
      7. metadata-eval98.9%

        \[\leadsto e^{\mathsf{log1p}\left({\left(\frac{1 + x}{x + -1}\right)}^{\color{blue}{-0.5}}\right)} - 1 \]
    11. Applied egg-rr98.9%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left({\left(\frac{1 + x}{x + -1}\right)}^{-0.5}\right)} - 1} \]
    12. Step-by-step derivation
      1. expm1-def98.9%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left({\left(\frac{1 + x}{x + -1}\right)}^{-0.5}\right)\right)} \]
      2. expm1-log1p98.9%

        \[\leadsto \color{blue}{{\left(\frac{1 + x}{x + -1}\right)}^{-0.5}} \]
      3. +-commutative98.9%

        \[\leadsto {\left(\frac{\color{blue}{x + 1}}{x + -1}\right)}^{-0.5} \]
      4. +-commutative98.9%

        \[\leadsto {\left(\frac{x + 1}{\color{blue}{-1 + x}}\right)}^{-0.5} \]
    13. Simplified98.9%

      \[\leadsto \color{blue}{{\left(\frac{x + 1}{-1 + x}\right)}^{-0.5}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification76.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 6.5 \cdot 10^{-10}:\\ \;\;\;\;\sqrt{2} \cdot \frac{t}{\sqrt{\mathsf{fma}\left(2, \frac{{t}^{2}}{\frac{-1 + x}{x + 1}}, \frac{2 \cdot {\ell}^{2}}{x}\right)}}\\ \mathbf{else}:\\ \;\;\;\;{\left(\frac{x + 1}{-1 + x}\right)}^{-0.5}\\ \end{array} \]

Alternative 4: 77.8% accurate, 0.7× speedup?

\[\begin{array}{l} 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.3 \cdot 10^{-156}:\\ \;\;\;\;\sqrt{2} \cdot \frac{t_m}{\sqrt{\frac{2 \cdot {\ell}^{2}}{x}}}\\ \mathbf{else}:\\ \;\;\;\;{\left(\frac{x + 1}{-1 + x}\right)}^{-0.5}\\ \end{array} \end{array} \]
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s x l t_m)
 :precision binary64
 (*
  t_s
  (if (<= t_m 2.3e-156)
    (* (sqrt 2.0) (/ t_m (sqrt (/ (* 2.0 (pow l 2.0)) x))))
    (pow (/ (+ x 1.0) (+ -1.0 x)) -0.5))))
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double x, double l, double t_m) {
	double tmp;
	if (t_m <= 2.3e-156) {
		tmp = sqrt(2.0) * (t_m / sqrt(((2.0 * pow(l, 2.0)) / x)));
	} else {
		tmp = pow(((x + 1.0) / (-1.0 + x)), -0.5);
	}
	return t_s * tmp;
}
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, x, l, t_m)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: x
    real(8), intent (in) :: l
    real(8), intent (in) :: t_m
    real(8) :: tmp
    if (t_m <= 2.3d-156) then
        tmp = sqrt(2.0d0) * (t_m / sqrt(((2.0d0 * (l ** 2.0d0)) / x)))
    else
        tmp = ((x + 1.0d0) / ((-1.0d0) + x)) ** (-0.5d0)
    end if
    code = t_s * tmp
end function
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double l, double t_m) {
	double tmp;
	if (t_m <= 2.3e-156) {
		tmp = Math.sqrt(2.0) * (t_m / Math.sqrt(((2.0 * Math.pow(l, 2.0)) / x)));
	} else {
		tmp = Math.pow(((x + 1.0) / (-1.0 + x)), -0.5);
	}
	return t_s * tmp;
}
t_m = math.fabs(t)
t_s = math.copysign(1.0, t)
def code(t_s, x, l, t_m):
	tmp = 0
	if t_m <= 2.3e-156:
		tmp = math.sqrt(2.0) * (t_m / math.sqrt(((2.0 * math.pow(l, 2.0)) / x)))
	else:
		tmp = math.pow(((x + 1.0) / (-1.0 + x)), -0.5)
	return t_s * tmp
t_m = abs(t)
t_s = copysign(1.0, t)
function code(t_s, x, l, t_m)
	tmp = 0.0
	if (t_m <= 2.3e-156)
		tmp = Float64(sqrt(2.0) * Float64(t_m / sqrt(Float64(Float64(2.0 * (l ^ 2.0)) / x))));
	else
		tmp = Float64(Float64(x + 1.0) / Float64(-1.0 + x)) ^ -0.5;
	end
	return Float64(t_s * tmp)
end
t_m = abs(t);
t_s = sign(t) * abs(1.0);
function tmp_2 = code(t_s, x, l, t_m)
	tmp = 0.0;
	if (t_m <= 2.3e-156)
		tmp = sqrt(2.0) * (t_m / sqrt(((2.0 * (l ^ 2.0)) / x)));
	else
		tmp = ((x + 1.0) / (-1.0 + x)) ^ -0.5;
	end
	tmp_2 = t_s * tmp;
end
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_, t$95$m_] := N[(t$95$s * If[LessEqual[t$95$m, 2.3e-156], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t$95$m / N[Sqrt[N[(N[(2.0 * N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Power[N[(N[(x + 1.0), $MachinePrecision] / N[(-1.0 + x), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
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.3 \cdot 10^{-156}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t_m}{\sqrt{\frac{2 \cdot {\ell}^{2}}{x}}}\\

\mathbf{else}:\\
\;\;\;\;{\left(\frac{x + 1}{-1 + x}\right)}^{-0.5}\\


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

    1. Initial program 30.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. Simplified30.5%

      \[\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. Taylor expanded in l around inf 2.3%

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

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

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

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

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

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

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

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

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

      \[\leadsto \sqrt{2} \cdot \frac{t}{\sqrt{\color{blue}{2 \cdot \frac{{\ell}^{2}}{x}}}} \]
    7. Step-by-step derivation
      1. associate-*r/60.2%

        \[\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)}} \]
    8. Simplified23.6%

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

    if 2.3e-156 < t

    1. Initial program 42.8%

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

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

      \[\leadsto \frac{\sqrt{2}}{\color{blue}{\sqrt{2} \cdot \sqrt{\frac{1 + x}{x - 1}}}} \]
    4. Step-by-step derivation
      1. +-commutative85.6%

        \[\leadsto \frac{\sqrt{2}}{\sqrt{2} \cdot \sqrt{\frac{\color{blue}{x + 1}}{x - 1}}} \]
      2. sub-neg85.6%

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

        \[\leadsto \frac{\sqrt{2}}{\sqrt{2} \cdot \sqrt{\frac{x + 1}{x + \color{blue}{-1}}}} \]
      4. +-commutative85.6%

        \[\leadsto \frac{\sqrt{2}}{\sqrt{2} \cdot \sqrt{\frac{x + 1}{\color{blue}{-1 + x}}}} \]
    5. Simplified85.6%

      \[\leadsto \frac{\sqrt{2}}{\color{blue}{\sqrt{2} \cdot \sqrt{\frac{x + 1}{-1 + x}}}} \]
    6. Step-by-step derivation
      1. *-un-lft-identity85.6%

        \[\leadsto \frac{\color{blue}{1 \cdot \sqrt{2}}}{\sqrt{2} \cdot \sqrt{\frac{x + 1}{-1 + x}}} \]
      2. times-frac85.7%

        \[\leadsto \color{blue}{\frac{1}{\sqrt{2}} \cdot \frac{\sqrt{2}}{\sqrt{\frac{x + 1}{-1 + x}}}} \]
      3. +-commutative85.7%

        \[\leadsto \frac{1}{\sqrt{2}} \cdot \frac{\sqrt{2}}{\sqrt{\frac{x + 1}{\color{blue}{x + -1}}}} \]
    7. Applied egg-rr85.7%

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

        \[\leadsto \color{blue}{\frac{\frac{1}{\sqrt{2}} \cdot \sqrt{2}}{\sqrt{\frac{x + 1}{x + -1}}}} \]
      2. lft-mult-inverse85.7%

        \[\leadsto \frac{\color{blue}{1}}{\sqrt{\frac{x + 1}{x + -1}}} \]
      3. +-commutative85.7%

        \[\leadsto \frac{1}{\sqrt{\frac{x + 1}{\color{blue}{-1 + x}}}} \]
    9. Simplified85.7%

      \[\leadsto \color{blue}{\frac{1}{\sqrt{\frac{x + 1}{-1 + x}}}} \]
    10. Step-by-step derivation
      1. expm1-log1p-u85.7%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{1}{\sqrt{\frac{x + 1}{-1 + x}}}\right)\right)} \]
      2. expm1-udef85.7%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{1}{\sqrt{\frac{x + 1}{-1 + x}}}\right)} - 1} \]
      3. inv-pow85.7%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{{\left(\sqrt{\frac{x + 1}{-1 + x}}\right)}^{-1}}\right)} - 1 \]
      4. sqrt-pow285.7%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{{\left(\frac{x + 1}{-1 + x}\right)}^{\left(\frac{-1}{2}\right)}}\right)} - 1 \]
      5. +-commutative85.7%

        \[\leadsto e^{\mathsf{log1p}\left({\left(\frac{\color{blue}{1 + x}}{-1 + x}\right)}^{\left(\frac{-1}{2}\right)}\right)} - 1 \]
      6. +-commutative85.7%

        \[\leadsto e^{\mathsf{log1p}\left({\left(\frac{1 + x}{\color{blue}{x + -1}}\right)}^{\left(\frac{-1}{2}\right)}\right)} - 1 \]
      7. metadata-eval85.7%

        \[\leadsto e^{\mathsf{log1p}\left({\left(\frac{1 + x}{x + -1}\right)}^{\color{blue}{-0.5}}\right)} - 1 \]
    11. Applied egg-rr85.7%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left({\left(\frac{1 + x}{x + -1}\right)}^{-0.5}\right)} - 1} \]
    12. Step-by-step derivation
      1. expm1-def85.7%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left({\left(\frac{1 + x}{x + -1}\right)}^{-0.5}\right)\right)} \]
      2. expm1-log1p85.7%

        \[\leadsto \color{blue}{{\left(\frac{1 + x}{x + -1}\right)}^{-0.5}} \]
      3. +-commutative85.7%

        \[\leadsto {\left(\frac{\color{blue}{x + 1}}{x + -1}\right)}^{-0.5} \]
      4. +-commutative85.7%

        \[\leadsto {\left(\frac{x + 1}{\color{blue}{-1 + x}}\right)}^{-0.5} \]
    13. Simplified85.7%

      \[\leadsto \color{blue}{{\left(\frac{x + 1}{-1 + x}\right)}^{-0.5}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification51.7%

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

Alternative 5: 77.6% accurate, 1.0× speedup?

\[\begin{array}{l} t_m = \left|t\right| \\ t_s = \mathsf{copysign}\left(1, t\right) \\ t_s \cdot \begin{array}{l} \mathbf{if}\;\ell \leq 5.8 \cdot 10^{+77}:\\ \;\;\;\;{\left(\frac{x + 1}{-1 + x}\right)}^{-0.5}\\ \mathbf{elif}\;\ell \leq 2.6 \cdot 10^{+99} \lor \neg \left(\ell \leq 2.1 \cdot 10^{+231}\right):\\ \;\;\;\;\frac{\sqrt{2}}{\frac{\ell}{t_m} \cdot \sqrt{\frac{2}{x}}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{-1 + x}{x + 1}}\\ \end{array} \end{array} \]
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s x l t_m)
 :precision binary64
 (*
  t_s
  (if (<= l 5.8e+77)
    (pow (/ (+ x 1.0) (+ -1.0 x)) -0.5)
    (if (or (<= l 2.6e+99) (not (<= l 2.1e+231)))
      (/ (sqrt 2.0) (* (/ l t_m) (sqrt (/ 2.0 x))))
      (sqrt (/ (+ -1.0 x) (+ x 1.0)))))))
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double x, double l, double t_m) {
	double tmp;
	if (l <= 5.8e+77) {
		tmp = pow(((x + 1.0) / (-1.0 + x)), -0.5);
	} else if ((l <= 2.6e+99) || !(l <= 2.1e+231)) {
		tmp = sqrt(2.0) / ((l / t_m) * sqrt((2.0 / x)));
	} else {
		tmp = sqrt(((-1.0 + x) / (x + 1.0)));
	}
	return t_s * tmp;
}
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, x, l, t_m)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: x
    real(8), intent (in) :: l
    real(8), intent (in) :: t_m
    real(8) :: tmp
    if (l <= 5.8d+77) then
        tmp = ((x + 1.0d0) / ((-1.0d0) + x)) ** (-0.5d0)
    else if ((l <= 2.6d+99) .or. (.not. (l <= 2.1d+231))) then
        tmp = sqrt(2.0d0) / ((l / t_m) * sqrt((2.0d0 / x)))
    else
        tmp = sqrt((((-1.0d0) + x) / (x + 1.0d0)))
    end if
    code = t_s * tmp
end function
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double l, double t_m) {
	double tmp;
	if (l <= 5.8e+77) {
		tmp = Math.pow(((x + 1.0) / (-1.0 + x)), -0.5);
	} else if ((l <= 2.6e+99) || !(l <= 2.1e+231)) {
		tmp = Math.sqrt(2.0) / ((l / t_m) * Math.sqrt((2.0 / x)));
	} else {
		tmp = Math.sqrt(((-1.0 + x) / (x + 1.0)));
	}
	return t_s * tmp;
}
t_m = math.fabs(t)
t_s = math.copysign(1.0, t)
def code(t_s, x, l, t_m):
	tmp = 0
	if l <= 5.8e+77:
		tmp = math.pow(((x + 1.0) / (-1.0 + x)), -0.5)
	elif (l <= 2.6e+99) or not (l <= 2.1e+231):
		tmp = math.sqrt(2.0) / ((l / t_m) * math.sqrt((2.0 / x)))
	else:
		tmp = math.sqrt(((-1.0 + x) / (x + 1.0)))
	return t_s * tmp
t_m = abs(t)
t_s = copysign(1.0, t)
function code(t_s, x, l, t_m)
	tmp = 0.0
	if (l <= 5.8e+77)
		tmp = Float64(Float64(x + 1.0) / Float64(-1.0 + x)) ^ -0.5;
	elseif ((l <= 2.6e+99) || !(l <= 2.1e+231))
		tmp = Float64(sqrt(2.0) / Float64(Float64(l / t_m) * sqrt(Float64(2.0 / x))));
	else
		tmp = sqrt(Float64(Float64(-1.0 + x) / Float64(x + 1.0)));
	end
	return Float64(t_s * tmp)
end
t_m = abs(t);
t_s = sign(t) * abs(1.0);
function tmp_2 = code(t_s, x, l, t_m)
	tmp = 0.0;
	if (l <= 5.8e+77)
		tmp = ((x + 1.0) / (-1.0 + x)) ^ -0.5;
	elseif ((l <= 2.6e+99) || ~((l <= 2.1e+231)))
		tmp = sqrt(2.0) / ((l / t_m) * sqrt((2.0 / x)));
	else
		tmp = sqrt(((-1.0 + x) / (x + 1.0)));
	end
	tmp_2 = t_s * tmp;
end
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_, t$95$m_] := N[(t$95$s * If[LessEqual[l, 5.8e+77], N[Power[N[(N[(x + 1.0), $MachinePrecision] / N[(-1.0 + x), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision], If[Or[LessEqual[l, 2.6e+99], N[Not[LessEqual[l, 2.1e+231]], $MachinePrecision]], N[(N[Sqrt[2.0], $MachinePrecision] / N[(N[(l / t$95$m), $MachinePrecision] * N[Sqrt[N[(2.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(-1.0 + x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)

\\
t_s \cdot \begin{array}{l}
\mathbf{if}\;\ell \leq 5.8 \cdot 10^{+77}:\\
\;\;\;\;{\left(\frac{x + 1}{-1 + x}\right)}^{-0.5}\\

\mathbf{elif}\;\ell \leq 2.6 \cdot 10^{+99} \lor \neg \left(\ell \leq 2.1 \cdot 10^{+231}\right):\\
\;\;\;\;\frac{\sqrt{2}}{\frac{\ell}{t_m} \cdot \sqrt{\frac{2}{x}}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if l < 5.8000000000000003e77

    1. Initial program 43.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. Simplified43.7%

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

      \[\leadsto \frac{\sqrt{2}}{\color{blue}{\sqrt{2} \cdot \sqrt{\frac{1 + x}{x - 1}}}} \]
    4. Step-by-step derivation
      1. +-commutative47.6%

        \[\leadsto \frac{\sqrt{2}}{\sqrt{2} \cdot \sqrt{\frac{\color{blue}{x + 1}}{x - 1}}} \]
      2. sub-neg47.6%

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

        \[\leadsto \frac{\sqrt{2}}{\sqrt{2} \cdot \sqrt{\frac{x + 1}{x + \color{blue}{-1}}}} \]
      4. +-commutative47.6%

        \[\leadsto \frac{\sqrt{2}}{\sqrt{2} \cdot \sqrt{\frac{x + 1}{\color{blue}{-1 + x}}}} \]
    5. Simplified47.6%

      \[\leadsto \frac{\sqrt{2}}{\color{blue}{\sqrt{2} \cdot \sqrt{\frac{x + 1}{-1 + x}}}} \]
    6. Step-by-step derivation
      1. *-un-lft-identity47.6%

        \[\leadsto \frac{\color{blue}{1 \cdot \sqrt{2}}}{\sqrt{2} \cdot \sqrt{\frac{x + 1}{-1 + x}}} \]
      2. times-frac47.6%

        \[\leadsto \color{blue}{\frac{1}{\sqrt{2}} \cdot \frac{\sqrt{2}}{\sqrt{\frac{x + 1}{-1 + x}}}} \]
      3. +-commutative47.6%

        \[\leadsto \frac{1}{\sqrt{2}} \cdot \frac{\sqrt{2}}{\sqrt{\frac{x + 1}{\color{blue}{x + -1}}}} \]
    7. Applied egg-rr47.6%

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

        \[\leadsto \color{blue}{\frac{\frac{1}{\sqrt{2}} \cdot \sqrt{2}}{\sqrt{\frac{x + 1}{x + -1}}}} \]
      2. lft-mult-inverse47.6%

        \[\leadsto \frac{\color{blue}{1}}{\sqrt{\frac{x + 1}{x + -1}}} \]
      3. +-commutative47.6%

        \[\leadsto \frac{1}{\sqrt{\frac{x + 1}{\color{blue}{-1 + x}}}} \]
    9. Simplified47.6%

      \[\leadsto \color{blue}{\frac{1}{\sqrt{\frac{x + 1}{-1 + x}}}} \]
    10. Step-by-step derivation
      1. expm1-log1p-u47.6%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{1}{\sqrt{\frac{x + 1}{-1 + x}}}\right)\right)} \]
      2. expm1-udef47.6%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{1}{\sqrt{\frac{x + 1}{-1 + x}}}\right)} - 1} \]
      3. inv-pow47.6%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{{\left(\sqrt{\frac{x + 1}{-1 + x}}\right)}^{-1}}\right)} - 1 \]
      4. sqrt-pow247.6%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{{\left(\frac{x + 1}{-1 + x}\right)}^{\left(\frac{-1}{2}\right)}}\right)} - 1 \]
      5. +-commutative47.6%

        \[\leadsto e^{\mathsf{log1p}\left({\left(\frac{\color{blue}{1 + x}}{-1 + x}\right)}^{\left(\frac{-1}{2}\right)}\right)} - 1 \]
      6. +-commutative47.6%

        \[\leadsto e^{\mathsf{log1p}\left({\left(\frac{1 + x}{\color{blue}{x + -1}}\right)}^{\left(\frac{-1}{2}\right)}\right)} - 1 \]
      7. metadata-eval47.6%

        \[\leadsto e^{\mathsf{log1p}\left({\left(\frac{1 + x}{x + -1}\right)}^{\color{blue}{-0.5}}\right)} - 1 \]
    11. Applied egg-rr47.6%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left({\left(\frac{1 + x}{x + -1}\right)}^{-0.5}\right)} - 1} \]
    12. Step-by-step derivation
      1. expm1-def47.6%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left({\left(\frac{1 + x}{x + -1}\right)}^{-0.5}\right)\right)} \]
      2. expm1-log1p47.6%

        \[\leadsto \color{blue}{{\left(\frac{1 + x}{x + -1}\right)}^{-0.5}} \]
      3. +-commutative47.6%

        \[\leadsto {\left(\frac{\color{blue}{x + 1}}{x + -1}\right)}^{-0.5} \]
      4. +-commutative47.6%

        \[\leadsto {\left(\frac{x + 1}{\color{blue}{-1 + x}}\right)}^{-0.5} \]
    13. Simplified47.6%

      \[\leadsto \color{blue}{{\left(\frac{x + 1}{-1 + x}\right)}^{-0.5}} \]

    if 5.8000000000000003e77 < l < 2.6e99 or 2.09999999999999984e231 < l

    1. Initial program 5.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. Simplified5.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.6e99 < l < 2.09999999999999984e231

    1. Initial program 1.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. Simplified1.1%

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

      \[\leadsto \frac{\sqrt{2}}{\color{blue}{\sqrt{2} \cdot \sqrt{\frac{1 + x}{x - 1}}}} \]
    4. Step-by-step derivation
      1. +-commutative27.8%

        \[\leadsto \frac{\sqrt{2}}{\sqrt{2} \cdot \sqrt{\frac{\color{blue}{x + 1}}{x - 1}}} \]
      2. sub-neg27.8%

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

        \[\leadsto \frac{\sqrt{2}}{\sqrt{2} \cdot \sqrt{\frac{x + 1}{x + \color{blue}{-1}}}} \]
      4. +-commutative27.8%

        \[\leadsto \frac{\sqrt{2}}{\sqrt{2} \cdot \sqrt{\frac{x + 1}{\color{blue}{-1 + x}}}} \]
    5. Simplified27.8%

      \[\leadsto \frac{\sqrt{2}}{\color{blue}{\sqrt{2} \cdot \sqrt{\frac{x + 1}{-1 + x}}}} \]
    6. Step-by-step derivation
      1. associate-/r*27.8%

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

        \[\leadsto \frac{\color{blue}{\sqrt{\frac{2}{2}}}}{\sqrt{\frac{x + 1}{-1 + x}}} \]
      3. metadata-eval27.8%

        \[\leadsto \frac{\sqrt{\color{blue}{1}}}{\sqrt{\frac{x + 1}{-1 + x}}} \]
      4. metadata-eval27.8%

        \[\leadsto \frac{\color{blue}{1}}{\sqrt{\frac{x + 1}{-1 + x}}} \]
      5. metadata-eval27.8%

        \[\leadsto \frac{\color{blue}{\sqrt{1}}}{\sqrt{\frac{x + 1}{-1 + x}}} \]
      6. sqrt-div27.8%

        \[\leadsto \color{blue}{\sqrt{\frac{1}{\frac{x + 1}{-1 + x}}}} \]
      7. clear-num27.8%

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

        \[\leadsto \sqrt{\frac{\color{blue}{x + -1}}{x + 1}} \]
    7. Applied egg-rr27.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq 5.8 \cdot 10^{+77}:\\ \;\;\;\;{\left(\frac{x + 1}{-1 + x}\right)}^{-0.5}\\ \mathbf{elif}\;\ell \leq 2.6 \cdot 10^{+99} \lor \neg \left(\ell \leq 2.1 \cdot 10^{+231}\right):\\ \;\;\;\;\frac{\sqrt{2}}{\frac{\ell}{t} \cdot \sqrt{\frac{2}{x}}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{-1 + x}{x + 1}}\\ \end{array} \]

Alternative 6: 77.0% accurate, 1.9× speedup?

\[\begin{array}{l} t_m = \left|t\right| \\ t_s = \mathsf{copysign}\left(1, t\right) \\ t_s \cdot \begin{array}{l} \mathbf{if}\;\ell \leq 1.66 \cdot 10^{+233}:\\ \;\;\;\;{\left(\frac{x + 1}{-1 + x}\right)}^{-0.5}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{\frac{2}{\frac{1}{-1 + x} + \left(-1 + \frac{x}{-1 + x}\right)}}}{\frac{\ell}{t_m}}\\ \end{array} \end{array} \]
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s x l t_m)
 :precision binary64
 (*
  t_s
  (if (<= l 1.66e+233)
    (pow (/ (+ x 1.0) (+ -1.0 x)) -0.5)
    (/
     (sqrt (/ 2.0 (+ (/ 1.0 (+ -1.0 x)) (+ -1.0 (/ x (+ -1.0 x))))))
     (/ l t_m)))))
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double x, double l, double t_m) {
	double tmp;
	if (l <= 1.66e+233) {
		tmp = pow(((x + 1.0) / (-1.0 + x)), -0.5);
	} else {
		tmp = sqrt((2.0 / ((1.0 / (-1.0 + x)) + (-1.0 + (x / (-1.0 + x)))))) / (l / t_m);
	}
	return t_s * tmp;
}
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, x, l, t_m)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: x
    real(8), intent (in) :: l
    real(8), intent (in) :: t_m
    real(8) :: tmp
    if (l <= 1.66d+233) then
        tmp = ((x + 1.0d0) / ((-1.0d0) + x)) ** (-0.5d0)
    else
        tmp = sqrt((2.0d0 / ((1.0d0 / ((-1.0d0) + x)) + ((-1.0d0) + (x / ((-1.0d0) + x)))))) / (l / t_m)
    end if
    code = t_s * tmp
end function
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double l, double t_m) {
	double tmp;
	if (l <= 1.66e+233) {
		tmp = Math.pow(((x + 1.0) / (-1.0 + x)), -0.5);
	} else {
		tmp = Math.sqrt((2.0 / ((1.0 / (-1.0 + x)) + (-1.0 + (x / (-1.0 + x)))))) / (l / t_m);
	}
	return t_s * tmp;
}
t_m = math.fabs(t)
t_s = math.copysign(1.0, t)
def code(t_s, x, l, t_m):
	tmp = 0
	if l <= 1.66e+233:
		tmp = math.pow(((x + 1.0) / (-1.0 + x)), -0.5)
	else:
		tmp = math.sqrt((2.0 / ((1.0 / (-1.0 + x)) + (-1.0 + (x / (-1.0 + x)))))) / (l / t_m)
	return t_s * tmp
t_m = abs(t)
t_s = copysign(1.0, t)
function code(t_s, x, l, t_m)
	tmp = 0.0
	if (l <= 1.66e+233)
		tmp = Float64(Float64(x + 1.0) / Float64(-1.0 + x)) ^ -0.5;
	else
		tmp = Float64(sqrt(Float64(2.0 / Float64(Float64(1.0 / Float64(-1.0 + x)) + Float64(-1.0 + Float64(x / Float64(-1.0 + x)))))) / Float64(l / t_m));
	end
	return Float64(t_s * tmp)
end
t_m = abs(t);
t_s = sign(t) * abs(1.0);
function tmp_2 = code(t_s, x, l, t_m)
	tmp = 0.0;
	if (l <= 1.66e+233)
		tmp = ((x + 1.0) / (-1.0 + x)) ^ -0.5;
	else
		tmp = sqrt((2.0 / ((1.0 / (-1.0 + x)) + (-1.0 + (x / (-1.0 + x)))))) / (l / t_m);
	end
	tmp_2 = t_s * tmp;
end
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_, t$95$m_] := N[(t$95$s * If[LessEqual[l, 1.66e+233], N[Power[N[(N[(x + 1.0), $MachinePrecision] / N[(-1.0 + x), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision], N[(N[Sqrt[N[(2.0 / N[(N[(1.0 / N[(-1.0 + x), $MachinePrecision]), $MachinePrecision] + N[(-1.0 + N[(x / N[(-1.0 + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(l / t$95$m), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)

\\
t_s \cdot \begin{array}{l}
\mathbf{if}\;\ell \leq 1.66 \cdot 10^{+233}:\\
\;\;\;\;{\left(\frac{x + 1}{-1 + x}\right)}^{-0.5}\\

\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{\frac{2}{\frac{1}{-1 + x} + \left(-1 + \frac{x}{-1 + x}\right)}}}{\frac{\ell}{t_m}}\\


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

    1. Initial program 38.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. Simplified38.2%

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

      \[\leadsto \frac{\sqrt{2}}{\color{blue}{\sqrt{2} \cdot \sqrt{\frac{1 + x}{x - 1}}}} \]
    4. Step-by-step derivation
      1. +-commutative44.5%

        \[\leadsto \frac{\sqrt{2}}{\sqrt{2} \cdot \sqrt{\frac{\color{blue}{x + 1}}{x - 1}}} \]
      2. sub-neg44.5%

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

        \[\leadsto \frac{\sqrt{2}}{\sqrt{2} \cdot \sqrt{\frac{x + 1}{x + \color{blue}{-1}}}} \]
      4. +-commutative44.5%

        \[\leadsto \frac{\sqrt{2}}{\sqrt{2} \cdot \sqrt{\frac{x + 1}{\color{blue}{-1 + x}}}} \]
    5. Simplified44.5%

      \[\leadsto \frac{\sqrt{2}}{\color{blue}{\sqrt{2} \cdot \sqrt{\frac{x + 1}{-1 + x}}}} \]
    6. Step-by-step derivation
      1. *-un-lft-identity44.5%

        \[\leadsto \frac{\color{blue}{1 \cdot \sqrt{2}}}{\sqrt{2} \cdot \sqrt{\frac{x + 1}{-1 + x}}} \]
      2. times-frac44.5%

        \[\leadsto \color{blue}{\frac{1}{\sqrt{2}} \cdot \frac{\sqrt{2}}{\sqrt{\frac{x + 1}{-1 + x}}}} \]
      3. +-commutative44.5%

        \[\leadsto \frac{1}{\sqrt{2}} \cdot \frac{\sqrt{2}}{\sqrt{\frac{x + 1}{\color{blue}{x + -1}}}} \]
    7. Applied egg-rr44.5%

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

        \[\leadsto \color{blue}{\frac{\frac{1}{\sqrt{2}} \cdot \sqrt{2}}{\sqrt{\frac{x + 1}{x + -1}}}} \]
      2. lft-mult-inverse44.5%

        \[\leadsto \frac{\color{blue}{1}}{\sqrt{\frac{x + 1}{x + -1}}} \]
      3. +-commutative44.5%

        \[\leadsto \frac{1}{\sqrt{\frac{x + 1}{\color{blue}{-1 + x}}}} \]
    9. Simplified44.5%

      \[\leadsto \color{blue}{\frac{1}{\sqrt{\frac{x + 1}{-1 + x}}}} \]
    10. Step-by-step derivation
      1. expm1-log1p-u44.5%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{1}{\sqrt{\frac{x + 1}{-1 + x}}}\right)\right)} \]
      2. expm1-udef44.5%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{1}{\sqrt{\frac{x + 1}{-1 + x}}}\right)} - 1} \]
      3. inv-pow44.5%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{{\left(\sqrt{\frac{x + 1}{-1 + x}}\right)}^{-1}}\right)} - 1 \]
      4. sqrt-pow244.5%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{{\left(\frac{x + 1}{-1 + x}\right)}^{\left(\frac{-1}{2}\right)}}\right)} - 1 \]
      5. +-commutative44.5%

        \[\leadsto e^{\mathsf{log1p}\left({\left(\frac{\color{blue}{1 + x}}{-1 + x}\right)}^{\left(\frac{-1}{2}\right)}\right)} - 1 \]
      6. +-commutative44.5%

        \[\leadsto e^{\mathsf{log1p}\left({\left(\frac{1 + x}{\color{blue}{x + -1}}\right)}^{\left(\frac{-1}{2}\right)}\right)} - 1 \]
      7. metadata-eval44.5%

        \[\leadsto e^{\mathsf{log1p}\left({\left(\frac{1 + x}{x + -1}\right)}^{\color{blue}{-0.5}}\right)} - 1 \]
    11. Applied egg-rr44.5%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left({\left(\frac{1 + x}{x + -1}\right)}^{-0.5}\right)} - 1} \]
    12. Step-by-step derivation
      1. expm1-def44.5%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left({\left(\frac{1 + x}{x + -1}\right)}^{-0.5}\right)\right)} \]
      2. expm1-log1p44.5%

        \[\leadsto \color{blue}{{\left(\frac{1 + x}{x + -1}\right)}^{-0.5}} \]
      3. +-commutative44.5%

        \[\leadsto {\left(\frac{\color{blue}{x + 1}}{x + -1}\right)}^{-0.5} \]
      4. +-commutative44.5%

        \[\leadsto {\left(\frac{x + 1}{\color{blue}{-1 + x}}\right)}^{-0.5} \]
    13. Simplified44.5%

      \[\leadsto \color{blue}{{\left(\frac{x + 1}{-1 + x}\right)}^{-0.5}} \]

    if 1.66e233 < 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}}{\frac{\sqrt{\frac{x + 1}{x + -1} \cdot \mathsf{fma}\left(\ell, \ell, 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}}{t}}} \]
    3. Taylor expanded in l around inf 1.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{\sqrt{\frac{2}{\frac{1}{x + -1} + \left(-1 + \frac{x}{x + -1}\right)}}}{\frac{\ell}{t}}\right)} - 1} \]
    10. Step-by-step derivation
      1. expm1-def38.9%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{\sqrt{\frac{2}{\frac{1}{x + -1} + \left(-1 + \frac{x}{x + -1}\right)}}}{\frac{\ell}{t}}\right)\right)} \]
      2. expm1-log1p38.9%

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

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

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

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

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

Alternative 7: 76.8% accurate, 2.1× speedup?

\[\begin{array}{l} t_m = \left|t\right| \\ t_s = \mathsf{copysign}\left(1, t\right) \\ t_s \cdot {\left(\frac{x + 1}{-1 + x}\right)}^{-0.5} \end{array} \]
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s x l t_m)
 :precision binary64
 (* t_s (pow (/ (+ x 1.0) (+ -1.0 x)) -0.5)))
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double x, double l, double t_m) {
	return t_s * pow(((x + 1.0) / (-1.0 + x)), -0.5);
}
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, x, l, t_m)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: x
    real(8), intent (in) :: l
    real(8), intent (in) :: t_m
    code = t_s * (((x + 1.0d0) / ((-1.0d0) + x)) ** (-0.5d0))
end function
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double l, double t_m) {
	return t_s * Math.pow(((x + 1.0) / (-1.0 + x)), -0.5);
}
t_m = math.fabs(t)
t_s = math.copysign(1.0, t)
def code(t_s, x, l, t_m):
	return t_s * math.pow(((x + 1.0) / (-1.0 + x)), -0.5)
t_m = abs(t)
t_s = copysign(1.0, t)
function code(t_s, x, l, t_m)
	return Float64(t_s * (Float64(Float64(x + 1.0) / Float64(-1.0 + x)) ^ -0.5))
end
t_m = abs(t);
t_s = sign(t) * abs(1.0);
function tmp = code(t_s, x, l, t_m)
	tmp = t_s * (((x + 1.0) / (-1.0 + x)) ^ -0.5);
end
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_, t$95$m_] := N[(t$95$s * N[Power[N[(N[(x + 1.0), $MachinePrecision] / N[(-1.0 + x), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)

\\
t_s \cdot {\left(\frac{x + 1}{-1 + x}\right)}^{-0.5}
\end{array}
Derivation
  1. Initial program 36.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. Simplified36.1%

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

    \[\leadsto \frac{\sqrt{2}}{\color{blue}{\sqrt{2} \cdot \sqrt{\frac{1 + x}{x - 1}}}} \]
  4. Step-by-step derivation
    1. +-commutative43.0%

      \[\leadsto \frac{\sqrt{2}}{\sqrt{2} \cdot \sqrt{\frac{\color{blue}{x + 1}}{x - 1}}} \]
    2. sub-neg43.0%

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

      \[\leadsto \frac{\sqrt{2}}{\sqrt{2} \cdot \sqrt{\frac{x + 1}{x + \color{blue}{-1}}}} \]
    4. +-commutative43.0%

      \[\leadsto \frac{\sqrt{2}}{\sqrt{2} \cdot \sqrt{\frac{x + 1}{\color{blue}{-1 + x}}}} \]
  5. Simplified43.0%

    \[\leadsto \frac{\sqrt{2}}{\color{blue}{\sqrt{2} \cdot \sqrt{\frac{x + 1}{-1 + x}}}} \]
  6. Step-by-step derivation
    1. *-un-lft-identity43.0%

      \[\leadsto \frac{\color{blue}{1 \cdot \sqrt{2}}}{\sqrt{2} \cdot \sqrt{\frac{x + 1}{-1 + x}}} \]
    2. times-frac43.0%

      \[\leadsto \color{blue}{\frac{1}{\sqrt{2}} \cdot \frac{\sqrt{2}}{\sqrt{\frac{x + 1}{-1 + x}}}} \]
    3. +-commutative43.0%

      \[\leadsto \frac{1}{\sqrt{2}} \cdot \frac{\sqrt{2}}{\sqrt{\frac{x + 1}{\color{blue}{x + -1}}}} \]
  7. Applied egg-rr43.0%

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

      \[\leadsto \color{blue}{\frac{\frac{1}{\sqrt{2}} \cdot \sqrt{2}}{\sqrt{\frac{x + 1}{x + -1}}}} \]
    2. lft-mult-inverse43.0%

      \[\leadsto \frac{\color{blue}{1}}{\sqrt{\frac{x + 1}{x + -1}}} \]
    3. +-commutative43.0%

      \[\leadsto \frac{1}{\sqrt{\frac{x + 1}{\color{blue}{-1 + x}}}} \]
  9. Simplified43.0%

    \[\leadsto \color{blue}{\frac{1}{\sqrt{\frac{x + 1}{-1 + x}}}} \]
  10. Step-by-step derivation
    1. expm1-log1p-u43.0%

      \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{1}{\sqrt{\frac{x + 1}{-1 + x}}}\right)\right)} \]
    2. expm1-udef43.0%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{1}{\sqrt{\frac{x + 1}{-1 + x}}}\right)} - 1} \]
    3. inv-pow43.0%

      \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{{\left(\sqrt{\frac{x + 1}{-1 + x}}\right)}^{-1}}\right)} - 1 \]
    4. sqrt-pow243.0%

      \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{{\left(\frac{x + 1}{-1 + x}\right)}^{\left(\frac{-1}{2}\right)}}\right)} - 1 \]
    5. +-commutative43.0%

      \[\leadsto e^{\mathsf{log1p}\left({\left(\frac{\color{blue}{1 + x}}{-1 + x}\right)}^{\left(\frac{-1}{2}\right)}\right)} - 1 \]
    6. +-commutative43.0%

      \[\leadsto e^{\mathsf{log1p}\left({\left(\frac{1 + x}{\color{blue}{x + -1}}\right)}^{\left(\frac{-1}{2}\right)}\right)} - 1 \]
    7. metadata-eval43.0%

      \[\leadsto e^{\mathsf{log1p}\left({\left(\frac{1 + x}{x + -1}\right)}^{\color{blue}{-0.5}}\right)} - 1 \]
  11. Applied egg-rr43.0%

    \[\leadsto \color{blue}{e^{\mathsf{log1p}\left({\left(\frac{1 + x}{x + -1}\right)}^{-0.5}\right)} - 1} \]
  12. Step-by-step derivation
    1. expm1-def43.0%

      \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left({\left(\frac{1 + x}{x + -1}\right)}^{-0.5}\right)\right)} \]
    2. expm1-log1p43.0%

      \[\leadsto \color{blue}{{\left(\frac{1 + x}{x + -1}\right)}^{-0.5}} \]
    3. +-commutative43.0%

      \[\leadsto {\left(\frac{\color{blue}{x + 1}}{x + -1}\right)}^{-0.5} \]
    4. +-commutative43.0%

      \[\leadsto {\left(\frac{x + 1}{\color{blue}{-1 + x}}\right)}^{-0.5} \]
  13. Simplified43.0%

    \[\leadsto \color{blue}{{\left(\frac{x + 1}{-1 + x}\right)}^{-0.5}} \]
  14. Final simplification43.0%

    \[\leadsto {\left(\frac{x + 1}{-1 + x}\right)}^{-0.5} \]

Alternative 8: 76.8% accurate, 2.1× speedup?

\[\begin{array}{l} t_m = \left|t\right| \\ t_s = \mathsf{copysign}\left(1, t\right) \\ t_s \cdot \sqrt{\frac{-1 + x}{x + 1}} \end{array} \]
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s x l t_m)
 :precision binary64
 (* t_s (sqrt (/ (+ -1.0 x) (+ x 1.0)))))
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double x, double l, double t_m) {
	return t_s * sqrt(((-1.0 + x) / (x + 1.0)));
}
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, x, l, t_m)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: x
    real(8), intent (in) :: l
    real(8), intent (in) :: t_m
    code = t_s * sqrt((((-1.0d0) + x) / (x + 1.0d0)))
end function
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double l, double t_m) {
	return t_s * Math.sqrt(((-1.0 + x) / (x + 1.0)));
}
t_m = math.fabs(t)
t_s = math.copysign(1.0, t)
def code(t_s, x, l, t_m):
	return t_s * math.sqrt(((-1.0 + x) / (x + 1.0)))
t_m = abs(t)
t_s = copysign(1.0, t)
function code(t_s, x, l, t_m)
	return Float64(t_s * sqrt(Float64(Float64(-1.0 + x) / Float64(x + 1.0))))
end
t_m = abs(t);
t_s = sign(t) * abs(1.0);
function tmp = code(t_s, x, l, t_m)
	tmp = t_s * sqrt(((-1.0 + x) / (x + 1.0)));
end
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_, t$95$m_] := N[(t$95$s * N[Sqrt[N[(N[(-1.0 + x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)

\\
t_s \cdot \sqrt{\frac{-1 + x}{x + 1}}
\end{array}
Derivation
  1. Initial program 36.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. Simplified36.1%

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

    \[\leadsto \frac{\sqrt{2}}{\color{blue}{\sqrt{2} \cdot \sqrt{\frac{1 + x}{x - 1}}}} \]
  4. Step-by-step derivation
    1. +-commutative43.0%

      \[\leadsto \frac{\sqrt{2}}{\sqrt{2} \cdot \sqrt{\frac{\color{blue}{x + 1}}{x - 1}}} \]
    2. sub-neg43.0%

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

      \[\leadsto \frac{\sqrt{2}}{\sqrt{2} \cdot \sqrt{\frac{x + 1}{x + \color{blue}{-1}}}} \]
    4. +-commutative43.0%

      \[\leadsto \frac{\sqrt{2}}{\sqrt{2} \cdot \sqrt{\frac{x + 1}{\color{blue}{-1 + x}}}} \]
  5. Simplified43.0%

    \[\leadsto \frac{\sqrt{2}}{\color{blue}{\sqrt{2} \cdot \sqrt{\frac{x + 1}{-1 + x}}}} \]
  6. Step-by-step derivation
    1. associate-/r*43.0%

      \[\leadsto \color{blue}{\frac{\frac{\sqrt{2}}{\sqrt{2}}}{\sqrt{\frac{x + 1}{-1 + x}}}} \]
    2. sqrt-undiv43.0%

      \[\leadsto \frac{\color{blue}{\sqrt{\frac{2}{2}}}}{\sqrt{\frac{x + 1}{-1 + x}}} \]
    3. metadata-eval43.0%

      \[\leadsto \frac{\sqrt{\color{blue}{1}}}{\sqrt{\frac{x + 1}{-1 + x}}} \]
    4. metadata-eval43.0%

      \[\leadsto \frac{\color{blue}{1}}{\sqrt{\frac{x + 1}{-1 + x}}} \]
    5. metadata-eval43.0%

      \[\leadsto \frac{\color{blue}{\sqrt{1}}}{\sqrt{\frac{x + 1}{-1 + x}}} \]
    6. sqrt-div43.0%

      \[\leadsto \color{blue}{\sqrt{\frac{1}{\frac{x + 1}{-1 + x}}}} \]
    7. clear-num43.0%

      \[\leadsto \sqrt{\color{blue}{\frac{-1 + x}{x + 1}}} \]
    8. +-commutative43.0%

      \[\leadsto \sqrt{\frac{\color{blue}{x + -1}}{x + 1}} \]
  7. Applied egg-rr43.0%

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

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

Alternative 9: 76.1% accurate, 45.0× speedup?

\[\begin{array}{l} t_m = \left|t\right| \\ t_s = \mathsf{copysign}\left(1, t\right) \\ t_s \cdot \left(1 + \frac{-1}{x}\right) \end{array} \]
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s x l t_m) :precision binary64 (* t_s (+ 1.0 (/ -1.0 x))))
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double x, double l, double t_m) {
	return t_s * (1.0 + (-1.0 / x));
}
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, x, l, t_m)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: x
    real(8), intent (in) :: l
    real(8), intent (in) :: t_m
    code = t_s * (1.0d0 + ((-1.0d0) / x))
end function
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double l, double t_m) {
	return t_s * (1.0 + (-1.0 / x));
}
t_m = math.fabs(t)
t_s = math.copysign(1.0, t)
def code(t_s, x, l, t_m):
	return t_s * (1.0 + (-1.0 / x))
t_m = abs(t)
t_s = copysign(1.0, t)
function code(t_s, x, l, t_m)
	return Float64(t_s * Float64(1.0 + Float64(-1.0 / x)))
end
t_m = abs(t);
t_s = sign(t) * abs(1.0);
function tmp = code(t_s, x, l, t_m)
	tmp = t_s * (1.0 + (-1.0 / x));
end
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_, t$95$m_] := N[(t$95$s * N[(1.0 + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
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 36.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. Simplified36.1%

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

    \[\leadsto \frac{\sqrt{2}}{\color{blue}{\sqrt{2} \cdot \sqrt{\frac{1 + x}{x - 1}}}} \]
  4. Step-by-step derivation
    1. +-commutative43.0%

      \[\leadsto \frac{\sqrt{2}}{\sqrt{2} \cdot \sqrt{\frac{\color{blue}{x + 1}}{x - 1}}} \]
    2. sub-neg43.0%

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

      \[\leadsto \frac{\sqrt{2}}{\sqrt{2} \cdot \sqrt{\frac{x + 1}{x + \color{blue}{-1}}}} \]
    4. +-commutative43.0%

      \[\leadsto \frac{\sqrt{2}}{\sqrt{2} \cdot \sqrt{\frac{x + 1}{\color{blue}{-1 + x}}}} \]
  5. Simplified43.0%

    \[\leadsto \frac{\sqrt{2}}{\color{blue}{\sqrt{2} \cdot \sqrt{\frac{x + 1}{-1 + x}}}} \]
  6. Taylor expanded in x around inf 43.0%

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

    \[\leadsto 1 + \frac{-1}{x} \]

Alternative 10: 75.4% accurate, 225.0× speedup?

\[\begin{array}{l} t_m = \left|t\right| \\ t_s = \mathsf{copysign}\left(1, t\right) \\ t_s \cdot 1 \end{array} \]
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s x l t_m) :precision binary64 (* t_s 1.0))
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double x, double l, double t_m) {
	return t_s * 1.0;
}
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, x, l, t_m)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: x
    real(8), intent (in) :: l
    real(8), intent (in) :: t_m
    code = t_s * 1.0d0
end function
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double l, double t_m) {
	return t_s * 1.0;
}
t_m = math.fabs(t)
t_s = math.copysign(1.0, t)
def code(t_s, x, l, t_m):
	return t_s * 1.0
t_m = abs(t)
t_s = copysign(1.0, t)
function code(t_s, x, l, t_m)
	return Float64(t_s * 1.0)
end
t_m = abs(t);
t_s = sign(t) * abs(1.0);
function tmp = code(t_s, x, l, t_m)
	tmp = t_s * 1.0;
end
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_, t$95$m_] := N[(t$95$s * 1.0), $MachinePrecision]
\begin{array}{l}
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)

\\
t_s \cdot 1
\end{array}
Derivation
  1. Initial program 36.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. Simplified36.1%

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

    \[\leadsto \frac{\sqrt{2}}{\color{blue}{\sqrt{2} \cdot \sqrt{\frac{1 + x}{x - 1}}}} \]
  4. Step-by-step derivation
    1. +-commutative43.0%

      \[\leadsto \frac{\sqrt{2}}{\sqrt{2} \cdot \sqrt{\frac{\color{blue}{x + 1}}{x - 1}}} \]
    2. sub-neg43.0%

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

      \[\leadsto \frac{\sqrt{2}}{\sqrt{2} \cdot \sqrt{\frac{x + 1}{x + \color{blue}{-1}}}} \]
    4. +-commutative43.0%

      \[\leadsto \frac{\sqrt{2}}{\sqrt{2} \cdot \sqrt{\frac{x + 1}{\color{blue}{-1 + x}}}} \]
  5. Simplified43.0%

    \[\leadsto \frac{\sqrt{2}}{\color{blue}{\sqrt{2} \cdot \sqrt{\frac{x + 1}{-1 + x}}}} \]
  6. Taylor expanded in x around inf 42.9%

    \[\leadsto \color{blue}{1} \]
  7. Final simplification42.9%

    \[\leadsto 1 \]

Reproduce

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