Toniolo and Linder, Equation (7)

Percentage Accurate: 33.5% → 81.5%
Time: 23.6s
Alternatives: 12
Speedup: 225.0×

Specification

?
\[\begin{array}{l} \\ \frac{\sqrt{2} \cdot t}{\sqrt{\frac{x + 1}{x - 1} \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}} \end{array} \]
(FPCore (x l t)
 :precision binary64
 (/
  (* (sqrt 2.0) t)
  (sqrt (- (* (/ (+ x 1.0) (- x 1.0)) (+ (* l l) (* 2.0 (* t t)))) (* l l)))))
double code(double x, double l, double t) {
	return (sqrt(2.0) * t) / sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l)));
}
real(8) function code(x, l, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: l
    real(8), intent (in) :: t
    code = (sqrt(2.0d0) * t) / sqrt(((((x + 1.0d0) / (x - 1.0d0)) * ((l * l) + (2.0d0 * (t * t)))) - (l * l)))
end function
public static double code(double x, double l, double t) {
	return (Math.sqrt(2.0) * t) / Math.sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l)));
}
def code(x, l, t):
	return (math.sqrt(2.0) * t) / math.sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l)))
function code(x, l, t)
	return Float64(Float64(sqrt(2.0) * t) / sqrt(Float64(Float64(Float64(Float64(x + 1.0) / Float64(x - 1.0)) * Float64(Float64(l * l) + Float64(2.0 * Float64(t * t)))) - Float64(l * l))))
end
function tmp = code(x, l, t)
	tmp = (sqrt(2.0) * t) / sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l)));
end
code[x_, l_, t_] := N[(N[(N[Sqrt[2.0], $MachinePrecision] * t), $MachinePrecision] / N[Sqrt[N[(N[(N[(N[(x + 1.0), $MachinePrecision] / N[(x - 1.0), $MachinePrecision]), $MachinePrecision] * N[(N[(l * l), $MachinePrecision] + N[(2.0 * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(l * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{\sqrt{2} \cdot t}{\sqrt{\frac{x + 1}{x - 1} \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}}
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 12 alternatives:

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

Initial Program: 33.5% 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: 81.5% accurate, 0.2× speedup?

\[\begin{array}{l} l = |l|\\ \\ \begin{array}{l} t_1 := \sqrt{\frac{x + -1}{x + 1}}\\ t_2 := 2 \cdot {t}^{2}\\ t_3 := {\ell}^{2} + t_2\\ \mathbf{if}\;t \leq -5.5 \cdot 10^{-123}:\\ \;\;\;\;-t_1\\ \mathbf{elif}\;t \leq 2.6 \cdot 10^{-293}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{\ell \cdot \sqrt{\frac{1}{x + -1} + \left(\frac{1}{x} + {x}^{-2}\right)}}\\ \mathbf{elif}\;t \leq 3.3 \cdot 10^{-236}:\\ \;\;\;\;\frac{t}{\mathsf{fma}\left(0.5, \frac{\mathsf{fma}\left(2, {t}^{2}, \mathsf{fma}\left(\ell, \ell, {\ell}^{2}\right)\right)}{2 \cdot \left(t \cdot x\right)}, t\right)}\\ \mathbf{elif}\;t \leq 1.3 \cdot 10^{-139}:\\ \;\;\;\;\frac{t}{\frac{\left(\sqrt{2} \cdot \ell\right) \cdot \sqrt{\frac{1}{x}}}{\sqrt{2}}}\\ \mathbf{elif}\;t \leq 5.8 \cdot 10^{+46}:\\ \;\;\;\;\frac{t}{\frac{\sqrt{\left(\frac{t_3 + t_3}{{x}^{2}} + \left(2 \cdot \frac{{t}^{2}}{x} + \left(t_2 + \frac{{\ell}^{2}}{x}\right)\right)\right) + \frac{t_3}{x}}}{\sqrt{2}}}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
NOTE: l should be positive before calling this function
(FPCore (x l t)
 :precision binary64
 (let* ((t_1 (sqrt (/ (+ x -1.0) (+ x 1.0))))
        (t_2 (* 2.0 (pow t 2.0)))
        (t_3 (+ (pow l 2.0) t_2)))
   (if (<= t -5.5e-123)
     (- t_1)
     (if (<= t 2.6e-293)
       (/
        (* t (sqrt 2.0))
        (* l (sqrt (+ (/ 1.0 (+ x -1.0)) (+ (/ 1.0 x) (pow x -2.0))))))
       (if (<= t 3.3e-236)
         (/
          t
          (fma
           0.5
           (/ (fma 2.0 (pow t 2.0) (fma l l (pow l 2.0))) (* 2.0 (* t x)))
           t))
         (if (<= t 1.3e-139)
           (/ t (/ (* (* (sqrt 2.0) l) (sqrt (/ 1.0 x))) (sqrt 2.0)))
           (if (<= t 5.8e+46)
             (/
              t
              (/
               (sqrt
                (+
                 (+
                  (/ (+ t_3 t_3) (pow x 2.0))
                  (+ (* 2.0 (/ (pow t 2.0) x)) (+ t_2 (/ (pow l 2.0) x))))
                 (/ t_3 x)))
               (sqrt 2.0)))
             t_1)))))))
l = abs(l);
double code(double x, double l, double t) {
	double t_1 = sqrt(((x + -1.0) / (x + 1.0)));
	double t_2 = 2.0 * pow(t, 2.0);
	double t_3 = pow(l, 2.0) + t_2;
	double tmp;
	if (t <= -5.5e-123) {
		tmp = -t_1;
	} else if (t <= 2.6e-293) {
		tmp = (t * sqrt(2.0)) / (l * sqrt(((1.0 / (x + -1.0)) + ((1.0 / x) + pow(x, -2.0)))));
	} else if (t <= 3.3e-236) {
		tmp = t / fma(0.5, (fma(2.0, pow(t, 2.0), fma(l, l, pow(l, 2.0))) / (2.0 * (t * x))), t);
	} else if (t <= 1.3e-139) {
		tmp = t / (((sqrt(2.0) * l) * sqrt((1.0 / x))) / sqrt(2.0));
	} else if (t <= 5.8e+46) {
		tmp = t / (sqrt(((((t_3 + t_3) / pow(x, 2.0)) + ((2.0 * (pow(t, 2.0) / x)) + (t_2 + (pow(l, 2.0) / x)))) + (t_3 / x))) / sqrt(2.0));
	} else {
		tmp = t_1;
	}
	return tmp;
}
l = abs(l)
function code(x, l, t)
	t_1 = sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0)))
	t_2 = Float64(2.0 * (t ^ 2.0))
	t_3 = Float64((l ^ 2.0) + t_2)
	tmp = 0.0
	if (t <= -5.5e-123)
		tmp = Float64(-t_1);
	elseif (t <= 2.6e-293)
		tmp = Float64(Float64(t * sqrt(2.0)) / Float64(l * sqrt(Float64(Float64(1.0 / Float64(x + -1.0)) + Float64(Float64(1.0 / x) + (x ^ -2.0))))));
	elseif (t <= 3.3e-236)
		tmp = Float64(t / fma(0.5, Float64(fma(2.0, (t ^ 2.0), fma(l, l, (l ^ 2.0))) / Float64(2.0 * Float64(t * x))), t));
	elseif (t <= 1.3e-139)
		tmp = Float64(t / Float64(Float64(Float64(sqrt(2.0) * l) * sqrt(Float64(1.0 / x))) / sqrt(2.0)));
	elseif (t <= 5.8e+46)
		tmp = Float64(t / Float64(sqrt(Float64(Float64(Float64(Float64(t_3 + t_3) / (x ^ 2.0)) + Float64(Float64(2.0 * Float64((t ^ 2.0) / x)) + Float64(t_2 + Float64((l ^ 2.0) / x)))) + Float64(t_3 / x))) / sqrt(2.0)));
	else
		tmp = t_1;
	end
	return tmp
end
NOTE: l should be positive before calling this function
code[x_, l_, t_] := Block[{t$95$1 = N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[Power[t, 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[Power[l, 2.0], $MachinePrecision] + t$95$2), $MachinePrecision]}, If[LessEqual[t, -5.5e-123], (-t$95$1), If[LessEqual[t, 2.6e-293], N[(N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] / N[(l * N[Sqrt[N[(N[(1.0 / N[(x + -1.0), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / x), $MachinePrecision] + N[Power[x, -2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.3e-236], N[(t / N[(0.5 * N[(N[(2.0 * N[Power[t, 2.0], $MachinePrecision] + N[(l * l + N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(2.0 * N[(t * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.3e-139], N[(t / N[(N[(N[(N[Sqrt[2.0], $MachinePrecision] * l), $MachinePrecision] * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5.8e+46], N[(t / N[(N[Sqrt[N[(N[(N[(N[(t$95$3 + t$95$3), $MachinePrecision] / N[Power[x, 2.0], $MachinePrecision]), $MachinePrecision] + N[(N[(2.0 * N[(N[Power[t, 2.0], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + N[(t$95$2 + N[(N[Power[l, 2.0], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$3 / x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \sqrt{\frac{x + -1}{x + 1}}\\
t_2 := 2 \cdot {t}^{2}\\
t_3 := {\ell}^{2} + t_2\\
\mathbf{if}\;t \leq -5.5 \cdot 10^{-123}:\\
\;\;\;\;-t_1\\

\mathbf{elif}\;t \leq 2.6 \cdot 10^{-293}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{\ell \cdot \sqrt{\frac{1}{x + -1} + \left(\frac{1}{x} + {x}^{-2}\right)}}\\

\mathbf{elif}\;t \leq 3.3 \cdot 10^{-236}:\\
\;\;\;\;\frac{t}{\mathsf{fma}\left(0.5, \frac{\mathsf{fma}\left(2, {t}^{2}, \mathsf{fma}\left(\ell, \ell, {\ell}^{2}\right)\right)}{2 \cdot \left(t \cdot x\right)}, t\right)}\\

\mathbf{elif}\;t \leq 1.3 \cdot 10^{-139}:\\
\;\;\;\;\frac{t}{\frac{\left(\sqrt{2} \cdot \ell\right) \cdot \sqrt{\frac{1}{x}}}{\sqrt{2}}}\\

\mathbf{elif}\;t \leq 5.8 \cdot 10^{+46}:\\
\;\;\;\;\frac{t}{\frac{\sqrt{\left(\frac{t_3 + t_3}{{x}^{2}} + \left(2 \cdot \frac{{t}^{2}}{x} + \left(t_2 + \frac{{\ell}^{2}}{x}\right)\right)\right) + \frac{t_3}{x}}}{\sqrt{2}}}\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if t < -5.5e-123

    1. Initial program 37.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. Simplified37.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. Applied egg-rr80.0%

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

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

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

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

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

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

    if -5.5e-123 < t < 2.5999999999999998e-293

    1. Initial program 7.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. Simplified7.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 inf 2.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.5999999999999998e-293 < t < 3.3000000000000001e-236

    1. Initial program 2.3%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{t}{\mathsf{fma}\left(0.5, \frac{\mathsf{fma}\left(2, {t}^{2}, \mathsf{fma}\left(\ell, \ell, -\color{blue}{\left(-{\ell}^{2}\right)}\right)\right)}{t \cdot \left(x \cdot {\left(\sqrt{2}\right)}^{2}\right)}, t\right)} \]
      8. remove-double-neg76.8%

        \[\leadsto \frac{t}{\mathsf{fma}\left(0.5, \frac{\mathsf{fma}\left(2, {t}^{2}, \mathsf{fma}\left(\ell, \ell, \color{blue}{{\ell}^{2}}\right)\right)}{t \cdot \left(x \cdot {\left(\sqrt{2}\right)}^{2}\right)}, t\right)} \]
      9. *-commutative76.8%

        \[\leadsto \frac{t}{\mathsf{fma}\left(0.5, \frac{\mathsf{fma}\left(2, {t}^{2}, \mathsf{fma}\left(\ell, \ell, {\ell}^{2}\right)\right)}{\color{blue}{\left(x \cdot {\left(\sqrt{2}\right)}^{2}\right) \cdot t}}, t\right)} \]
      10. *-commutative76.8%

        \[\leadsto \frac{t}{\mathsf{fma}\left(0.5, \frac{\mathsf{fma}\left(2, {t}^{2}, \mathsf{fma}\left(\ell, \ell, {\ell}^{2}\right)\right)}{\color{blue}{\left({\left(\sqrt{2}\right)}^{2} \cdot x\right)} \cdot t}, t\right)} \]
      11. unpow276.8%

        \[\leadsto \frac{t}{\mathsf{fma}\left(0.5, \frac{\mathsf{fma}\left(2, {t}^{2}, \mathsf{fma}\left(\ell, \ell, {\ell}^{2}\right)\right)}{\left(\color{blue}{\left(\sqrt{2} \cdot \sqrt{2}\right)} \cdot x\right) \cdot t}, t\right)} \]
      12. rem-square-sqrt76.8%

        \[\leadsto \frac{t}{\mathsf{fma}\left(0.5, \frac{\mathsf{fma}\left(2, {t}^{2}, \mathsf{fma}\left(\ell, \ell, {\ell}^{2}\right)\right)}{\left(\color{blue}{2} \cdot x\right) \cdot t}, t\right)} \]
      13. associate-*l*76.8%

        \[\leadsto \frac{t}{\mathsf{fma}\left(0.5, \frac{\mathsf{fma}\left(2, {t}^{2}, \mathsf{fma}\left(\ell, \ell, {\ell}^{2}\right)\right)}{\color{blue}{2 \cdot \left(x \cdot t\right)}}, t\right)} \]
    7. Simplified76.8%

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

    if 3.3000000000000001e-236 < t < 1.2999999999999999e-139

    1. Initial program 3.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. Simplified3.0%

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

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

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

    if 1.2999999999999999e-139 < t < 5.8000000000000004e46

    1. Initial program 49.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. Simplified49.4%

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

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

    if 5.8000000000000004e46 < t

    1. Initial program 28.0%

      \[\frac{\sqrt{2} \cdot t}{\sqrt{\frac{x + 1}{x - 1} \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}} \]
    2. Simplified28.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-rr86.2%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -5.5 \cdot 10^{-123}:\\ \;\;\;\;-\sqrt{\frac{x + -1}{x + 1}}\\ \mathbf{elif}\;t \leq 2.6 \cdot 10^{-293}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{\ell \cdot \sqrt{\frac{1}{x + -1} + \left(\frac{1}{x} + {x}^{-2}\right)}}\\ \mathbf{elif}\;t \leq 3.3 \cdot 10^{-236}:\\ \;\;\;\;\frac{t}{\mathsf{fma}\left(0.5, \frac{\mathsf{fma}\left(2, {t}^{2}, \mathsf{fma}\left(\ell, \ell, {\ell}^{2}\right)\right)}{2 \cdot \left(t \cdot x\right)}, t\right)}\\ \mathbf{elif}\;t \leq 1.3 \cdot 10^{-139}:\\ \;\;\;\;\frac{t}{\frac{\left(\sqrt{2} \cdot \ell\right) \cdot \sqrt{\frac{1}{x}}}{\sqrt{2}}}\\ \mathbf{elif}\;t \leq 5.8 \cdot 10^{+46}:\\ \;\;\;\;\frac{t}{\frac{\sqrt{\left(\frac{\left({\ell}^{2} + 2 \cdot {t}^{2}\right) + \left({\ell}^{2} + 2 \cdot {t}^{2}\right)}{{x}^{2}} + \left(2 \cdot \frac{{t}^{2}}{x} + \left(2 \cdot {t}^{2} + \frac{{\ell}^{2}}{x}\right)\right)\right) + \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x}}}{\sqrt{2}}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\ \end{array} \]

Alternative 2: 81.5% accurate, 0.3× speedup?

\[\begin{array}{l} l = |l|\\ \\ \begin{array}{l} t_1 := \sqrt{\frac{x + -1}{x + 1}}\\ t_2 := 2 \cdot {t}^{2}\\ \mathbf{if}\;t \leq -8.2 \cdot 10^{-123}:\\ \;\;\;\;-t_1\\ \mathbf{elif}\;t \leq 3.9 \cdot 10^{-293}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{\ell \cdot \sqrt{\frac{1}{x + -1} + \left(\frac{1}{x} + {x}^{-2}\right)}}\\ \mathbf{elif}\;t \leq 1.25 \cdot 10^{-235}:\\ \;\;\;\;\frac{t}{\mathsf{fma}\left(0.5, \frac{\mathsf{fma}\left(2, {t}^{2}, \mathsf{fma}\left(\ell, \ell, {\ell}^{2}\right)\right)}{2 \cdot \left(t \cdot x\right)}, t\right)}\\ \mathbf{elif}\;t \leq 1.2 \cdot 10^{-139}:\\ \;\;\;\;\frac{t}{\frac{\left(\sqrt{2} \cdot \ell\right) \cdot \sqrt{\frac{1}{x}}}{\sqrt{2}}}\\ \mathbf{elif}\;t \leq 9 \cdot 10^{+44}:\\ \;\;\;\;\frac{t}{\frac{\sqrt{\left(2 \cdot \frac{{t}^{2}}{x} + \left(t_2 + \frac{{\ell}^{2}}{x}\right)\right) + \frac{{\ell}^{2} + t_2}{x}}}{\sqrt{2}}}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
NOTE: l should be positive before calling this function
(FPCore (x l t)
 :precision binary64
 (let* ((t_1 (sqrt (/ (+ x -1.0) (+ x 1.0)))) (t_2 (* 2.0 (pow t 2.0))))
   (if (<= t -8.2e-123)
     (- t_1)
     (if (<= t 3.9e-293)
       (/
        (* t (sqrt 2.0))
        (* l (sqrt (+ (/ 1.0 (+ x -1.0)) (+ (/ 1.0 x) (pow x -2.0))))))
       (if (<= t 1.25e-235)
         (/
          t
          (fma
           0.5
           (/ (fma 2.0 (pow t 2.0) (fma l l (pow l 2.0))) (* 2.0 (* t x)))
           t))
         (if (<= t 1.2e-139)
           (/ t (/ (* (* (sqrt 2.0) l) (sqrt (/ 1.0 x))) (sqrt 2.0)))
           (if (<= t 9e+44)
             (/
              t
              (/
               (sqrt
                (+
                 (+ (* 2.0 (/ (pow t 2.0) x)) (+ t_2 (/ (pow l 2.0) x)))
                 (/ (+ (pow l 2.0) t_2) x)))
               (sqrt 2.0)))
             t_1)))))))
l = abs(l);
double code(double x, double l, double t) {
	double t_1 = sqrt(((x + -1.0) / (x + 1.0)));
	double t_2 = 2.0 * pow(t, 2.0);
	double tmp;
	if (t <= -8.2e-123) {
		tmp = -t_1;
	} else if (t <= 3.9e-293) {
		tmp = (t * sqrt(2.0)) / (l * sqrt(((1.0 / (x + -1.0)) + ((1.0 / x) + pow(x, -2.0)))));
	} else if (t <= 1.25e-235) {
		tmp = t / fma(0.5, (fma(2.0, pow(t, 2.0), fma(l, l, pow(l, 2.0))) / (2.0 * (t * x))), t);
	} else if (t <= 1.2e-139) {
		tmp = t / (((sqrt(2.0) * l) * sqrt((1.0 / x))) / sqrt(2.0));
	} else if (t <= 9e+44) {
		tmp = t / (sqrt((((2.0 * (pow(t, 2.0) / x)) + (t_2 + (pow(l, 2.0) / x))) + ((pow(l, 2.0) + t_2) / x))) / sqrt(2.0));
	} else {
		tmp = t_1;
	}
	return tmp;
}
l = abs(l)
function code(x, l, t)
	t_1 = sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0)))
	t_2 = Float64(2.0 * (t ^ 2.0))
	tmp = 0.0
	if (t <= -8.2e-123)
		tmp = Float64(-t_1);
	elseif (t <= 3.9e-293)
		tmp = Float64(Float64(t * sqrt(2.0)) / Float64(l * sqrt(Float64(Float64(1.0 / Float64(x + -1.0)) + Float64(Float64(1.0 / x) + (x ^ -2.0))))));
	elseif (t <= 1.25e-235)
		tmp = Float64(t / fma(0.5, Float64(fma(2.0, (t ^ 2.0), fma(l, l, (l ^ 2.0))) / Float64(2.0 * Float64(t * x))), t));
	elseif (t <= 1.2e-139)
		tmp = Float64(t / Float64(Float64(Float64(sqrt(2.0) * l) * sqrt(Float64(1.0 / x))) / sqrt(2.0)));
	elseif (t <= 9e+44)
		tmp = Float64(t / Float64(sqrt(Float64(Float64(Float64(2.0 * Float64((t ^ 2.0) / x)) + Float64(t_2 + Float64((l ^ 2.0) / x))) + Float64(Float64((l ^ 2.0) + t_2) / x))) / sqrt(2.0)));
	else
		tmp = t_1;
	end
	return tmp
end
NOTE: l should be positive before calling this function
code[x_, l_, t_] := Block[{t$95$1 = N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[Power[t, 2.0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -8.2e-123], (-t$95$1), If[LessEqual[t, 3.9e-293], N[(N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] / N[(l * N[Sqrt[N[(N[(1.0 / N[(x + -1.0), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / x), $MachinePrecision] + N[Power[x, -2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.25e-235], N[(t / N[(0.5 * N[(N[(2.0 * N[Power[t, 2.0], $MachinePrecision] + N[(l * l + N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(2.0 * N[(t * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.2e-139], N[(t / N[(N[(N[(N[Sqrt[2.0], $MachinePrecision] * l), $MachinePrecision] * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 9e+44], N[(t / N[(N[Sqrt[N[(N[(N[(2.0 * N[(N[Power[t, 2.0], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + N[(t$95$2 + N[(N[Power[l, 2.0], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Power[l, 2.0], $MachinePrecision] + t$95$2), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \sqrt{\frac{x + -1}{x + 1}}\\
t_2 := 2 \cdot {t}^{2}\\
\mathbf{if}\;t \leq -8.2 \cdot 10^{-123}:\\
\;\;\;\;-t_1\\

\mathbf{elif}\;t \leq 3.9 \cdot 10^{-293}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{\ell \cdot \sqrt{\frac{1}{x + -1} + \left(\frac{1}{x} + {x}^{-2}\right)}}\\

\mathbf{elif}\;t \leq 1.25 \cdot 10^{-235}:\\
\;\;\;\;\frac{t}{\mathsf{fma}\left(0.5, \frac{\mathsf{fma}\left(2, {t}^{2}, \mathsf{fma}\left(\ell, \ell, {\ell}^{2}\right)\right)}{2 \cdot \left(t \cdot x\right)}, t\right)}\\

\mathbf{elif}\;t \leq 1.2 \cdot 10^{-139}:\\
\;\;\;\;\frac{t}{\frac{\left(\sqrt{2} \cdot \ell\right) \cdot \sqrt{\frac{1}{x}}}{\sqrt{2}}}\\

\mathbf{elif}\;t \leq 9 \cdot 10^{+44}:\\
\;\;\;\;\frac{t}{\frac{\sqrt{\left(2 \cdot \frac{{t}^{2}}{x} + \left(t_2 + \frac{{\ell}^{2}}{x}\right)\right) + \frac{{\ell}^{2} + t_2}{x}}}{\sqrt{2}}}\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if t < -8.2000000000000001e-123

    1. Initial program 37.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. Simplified37.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. Applied egg-rr80.0%

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

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

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

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

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

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

    if -8.2000000000000001e-123 < t < 3.9e-293

    1. Initial program 7.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. Simplified7.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 inf 2.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.9e-293 < t < 1.2499999999999999e-235

    1. Initial program 2.3%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{t}{\mathsf{fma}\left(0.5, \frac{\mathsf{fma}\left(2, {t}^{2}, \mathsf{fma}\left(\ell, \ell, -\color{blue}{\left(-{\ell}^{2}\right)}\right)\right)}{t \cdot \left(x \cdot {\left(\sqrt{2}\right)}^{2}\right)}, t\right)} \]
      8. remove-double-neg76.8%

        \[\leadsto \frac{t}{\mathsf{fma}\left(0.5, \frac{\mathsf{fma}\left(2, {t}^{2}, \mathsf{fma}\left(\ell, \ell, \color{blue}{{\ell}^{2}}\right)\right)}{t \cdot \left(x \cdot {\left(\sqrt{2}\right)}^{2}\right)}, t\right)} \]
      9. *-commutative76.8%

        \[\leadsto \frac{t}{\mathsf{fma}\left(0.5, \frac{\mathsf{fma}\left(2, {t}^{2}, \mathsf{fma}\left(\ell, \ell, {\ell}^{2}\right)\right)}{\color{blue}{\left(x \cdot {\left(\sqrt{2}\right)}^{2}\right) \cdot t}}, t\right)} \]
      10. *-commutative76.8%

        \[\leadsto \frac{t}{\mathsf{fma}\left(0.5, \frac{\mathsf{fma}\left(2, {t}^{2}, \mathsf{fma}\left(\ell, \ell, {\ell}^{2}\right)\right)}{\color{blue}{\left({\left(\sqrt{2}\right)}^{2} \cdot x\right)} \cdot t}, t\right)} \]
      11. unpow276.8%

        \[\leadsto \frac{t}{\mathsf{fma}\left(0.5, \frac{\mathsf{fma}\left(2, {t}^{2}, \mathsf{fma}\left(\ell, \ell, {\ell}^{2}\right)\right)}{\left(\color{blue}{\left(\sqrt{2} \cdot \sqrt{2}\right)} \cdot x\right) \cdot t}, t\right)} \]
      12. rem-square-sqrt76.8%

        \[\leadsto \frac{t}{\mathsf{fma}\left(0.5, \frac{\mathsf{fma}\left(2, {t}^{2}, \mathsf{fma}\left(\ell, \ell, {\ell}^{2}\right)\right)}{\left(\color{blue}{2} \cdot x\right) \cdot t}, t\right)} \]
      13. associate-*l*76.8%

        \[\leadsto \frac{t}{\mathsf{fma}\left(0.5, \frac{\mathsf{fma}\left(2, {t}^{2}, \mathsf{fma}\left(\ell, \ell, {\ell}^{2}\right)\right)}{\color{blue}{2 \cdot \left(x \cdot t\right)}}, t\right)} \]
    7. Simplified76.8%

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

    if 1.2499999999999999e-235 < t < 1.20000000000000007e-139

    1. Initial program 3.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. Simplified3.0%

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

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

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

    if 1.20000000000000007e-139 < t < 9e44

    1. Initial program 49.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. Simplified49.4%

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

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

    if 9e44 < t

    1. Initial program 28.0%

      \[\frac{\sqrt{2} \cdot t}{\sqrt{\frac{x + 1}{x - 1} \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}} \]
    2. Simplified28.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-rr86.2%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -8.2 \cdot 10^{-123}:\\ \;\;\;\;-\sqrt{\frac{x + -1}{x + 1}}\\ \mathbf{elif}\;t \leq 3.9 \cdot 10^{-293}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{\ell \cdot \sqrt{\frac{1}{x + -1} + \left(\frac{1}{x} + {x}^{-2}\right)}}\\ \mathbf{elif}\;t \leq 1.25 \cdot 10^{-235}:\\ \;\;\;\;\frac{t}{\mathsf{fma}\left(0.5, \frac{\mathsf{fma}\left(2, {t}^{2}, \mathsf{fma}\left(\ell, \ell, {\ell}^{2}\right)\right)}{2 \cdot \left(t \cdot x\right)}, t\right)}\\ \mathbf{elif}\;t \leq 1.2 \cdot 10^{-139}:\\ \;\;\;\;\frac{t}{\frac{\left(\sqrt{2} \cdot \ell\right) \cdot \sqrt{\frac{1}{x}}}{\sqrt{2}}}\\ \mathbf{elif}\;t \leq 9 \cdot 10^{+44}:\\ \;\;\;\;\frac{t}{\frac{\sqrt{\left(2 \cdot \frac{{t}^{2}}{x} + \left(2 \cdot {t}^{2} + \frac{{\ell}^{2}}{x}\right)\right) + \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x}}}{\sqrt{2}}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\ \end{array} \]

Alternative 3: 81.5% accurate, 0.4× speedup?

\[\begin{array}{l} l = |l|\\ \\ \begin{array}{l} t_1 := \sqrt{\frac{x + -1}{x + 1}}\\ t_2 := \frac{{\ell}^{2}}{x}\\ \mathbf{if}\;t \leq -3.6 \cdot 10^{-122}:\\ \;\;\;\;-t_1\\ \mathbf{elif}\;t \leq 3.6 \cdot 10^{-293}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{\ell \cdot \sqrt{\frac{1}{x + -1} + \left(\frac{1}{x} + {x}^{-2}\right)}}\\ \mathbf{elif}\;t \leq 1.4 \cdot 10^{-237}:\\ \;\;\;\;\frac{t}{\mathsf{fma}\left(0.5, \frac{\mathsf{fma}\left(2, {t}^{2}, \mathsf{fma}\left(\ell, \ell, {\ell}^{2}\right)\right)}{2 \cdot \left(t \cdot x\right)}, t\right)}\\ \mathbf{elif}\;t \leq 1.2 \cdot 10^{-139}:\\ \;\;\;\;\frac{t}{\frac{\left(\sqrt{2} \cdot \ell\right) \cdot \sqrt{\frac{1}{x}}}{\sqrt{2}}}\\ \mathbf{elif}\;t \leq 6.8 \cdot 10^{+44}:\\ \;\;\;\;\frac{t}{\frac{\sqrt{t_2 + \left(2 \cdot \frac{{t}^{2}}{x} + \left(2 \cdot {t}^{2} + t_2\right)\right)}}{\sqrt{2}}}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
NOTE: l should be positive before calling this function
(FPCore (x l t)
 :precision binary64
 (let* ((t_1 (sqrt (/ (+ x -1.0) (+ x 1.0)))) (t_2 (/ (pow l 2.0) x)))
   (if (<= t -3.6e-122)
     (- t_1)
     (if (<= t 3.6e-293)
       (/
        (* t (sqrt 2.0))
        (* l (sqrt (+ (/ 1.0 (+ x -1.0)) (+ (/ 1.0 x) (pow x -2.0))))))
       (if (<= t 1.4e-237)
         (/
          t
          (fma
           0.5
           (/ (fma 2.0 (pow t 2.0) (fma l l (pow l 2.0))) (* 2.0 (* t x)))
           t))
         (if (<= t 1.2e-139)
           (/ t (/ (* (* (sqrt 2.0) l) (sqrt (/ 1.0 x))) (sqrt 2.0)))
           (if (<= t 6.8e+44)
             (/
              t
              (/
               (sqrt
                (+
                 t_2
                 (+ (* 2.0 (/ (pow t 2.0) x)) (+ (* 2.0 (pow t 2.0)) t_2))))
               (sqrt 2.0)))
             t_1)))))))
l = abs(l);
double code(double x, double l, double t) {
	double t_1 = sqrt(((x + -1.0) / (x + 1.0)));
	double t_2 = pow(l, 2.0) / x;
	double tmp;
	if (t <= -3.6e-122) {
		tmp = -t_1;
	} else if (t <= 3.6e-293) {
		tmp = (t * sqrt(2.0)) / (l * sqrt(((1.0 / (x + -1.0)) + ((1.0 / x) + pow(x, -2.0)))));
	} else if (t <= 1.4e-237) {
		tmp = t / fma(0.5, (fma(2.0, pow(t, 2.0), fma(l, l, pow(l, 2.0))) / (2.0 * (t * x))), t);
	} else if (t <= 1.2e-139) {
		tmp = t / (((sqrt(2.0) * l) * sqrt((1.0 / x))) / sqrt(2.0));
	} else if (t <= 6.8e+44) {
		tmp = t / (sqrt((t_2 + ((2.0 * (pow(t, 2.0) / x)) + ((2.0 * pow(t, 2.0)) + t_2)))) / sqrt(2.0));
	} else {
		tmp = t_1;
	}
	return tmp;
}
l = abs(l)
function code(x, l, t)
	t_1 = sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0)))
	t_2 = Float64((l ^ 2.0) / x)
	tmp = 0.0
	if (t <= -3.6e-122)
		tmp = Float64(-t_1);
	elseif (t <= 3.6e-293)
		tmp = Float64(Float64(t * sqrt(2.0)) / Float64(l * sqrt(Float64(Float64(1.0 / Float64(x + -1.0)) + Float64(Float64(1.0 / x) + (x ^ -2.0))))));
	elseif (t <= 1.4e-237)
		tmp = Float64(t / fma(0.5, Float64(fma(2.0, (t ^ 2.0), fma(l, l, (l ^ 2.0))) / Float64(2.0 * Float64(t * x))), t));
	elseif (t <= 1.2e-139)
		tmp = Float64(t / Float64(Float64(Float64(sqrt(2.0) * l) * sqrt(Float64(1.0 / x))) / sqrt(2.0)));
	elseif (t <= 6.8e+44)
		tmp = Float64(t / Float64(sqrt(Float64(t_2 + Float64(Float64(2.0 * Float64((t ^ 2.0) / x)) + Float64(Float64(2.0 * (t ^ 2.0)) + t_2)))) / sqrt(2.0)));
	else
		tmp = t_1;
	end
	return tmp
end
NOTE: l should be positive before calling this function
code[x_, l_, t_] := Block[{t$95$1 = N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[Power[l, 2.0], $MachinePrecision] / x), $MachinePrecision]}, If[LessEqual[t, -3.6e-122], (-t$95$1), If[LessEqual[t, 3.6e-293], N[(N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] / N[(l * N[Sqrt[N[(N[(1.0 / N[(x + -1.0), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / x), $MachinePrecision] + N[Power[x, -2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.4e-237], N[(t / N[(0.5 * N[(N[(2.0 * N[Power[t, 2.0], $MachinePrecision] + N[(l * l + N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(2.0 * N[(t * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.2e-139], N[(t / N[(N[(N[(N[Sqrt[2.0], $MachinePrecision] * l), $MachinePrecision] * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 6.8e+44], N[(t / N[(N[Sqrt[N[(t$95$2 + N[(N[(2.0 * N[(N[Power[t, 2.0], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + N[(N[(2.0 * N[Power[t, 2.0], $MachinePrecision]), $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \sqrt{\frac{x + -1}{x + 1}}\\
t_2 := \frac{{\ell}^{2}}{x}\\
\mathbf{if}\;t \leq -3.6 \cdot 10^{-122}:\\
\;\;\;\;-t_1\\

\mathbf{elif}\;t \leq 3.6 \cdot 10^{-293}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{\ell \cdot \sqrt{\frac{1}{x + -1} + \left(\frac{1}{x} + {x}^{-2}\right)}}\\

\mathbf{elif}\;t \leq 1.4 \cdot 10^{-237}:\\
\;\;\;\;\frac{t}{\mathsf{fma}\left(0.5, \frac{\mathsf{fma}\left(2, {t}^{2}, \mathsf{fma}\left(\ell, \ell, {\ell}^{2}\right)\right)}{2 \cdot \left(t \cdot x\right)}, t\right)}\\

\mathbf{elif}\;t \leq 1.2 \cdot 10^{-139}:\\
\;\;\;\;\frac{t}{\frac{\left(\sqrt{2} \cdot \ell\right) \cdot \sqrt{\frac{1}{x}}}{\sqrt{2}}}\\

\mathbf{elif}\;t \leq 6.8 \cdot 10^{+44}:\\
\;\;\;\;\frac{t}{\frac{\sqrt{t_2 + \left(2 \cdot \frac{{t}^{2}}{x} + \left(2 \cdot {t}^{2} + t_2\right)\right)}}{\sqrt{2}}}\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if t < -3.59999999999999994e-122

    1. Initial program 37.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. Simplified37.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. Applied egg-rr80.0%

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

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

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

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

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

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

    if -3.59999999999999994e-122 < t < 3.59999999999999985e-293

    1. Initial program 7.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. Simplified7.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 inf 2.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.59999999999999985e-293 < t < 1.39999999999999999e-237

    1. Initial program 2.3%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{t}{\mathsf{fma}\left(0.5, \frac{\mathsf{fma}\left(2, {t}^{2}, \mathsf{fma}\left(\ell, \ell, -\color{blue}{\left(-{\ell}^{2}\right)}\right)\right)}{t \cdot \left(x \cdot {\left(\sqrt{2}\right)}^{2}\right)}, t\right)} \]
      8. remove-double-neg76.8%

        \[\leadsto \frac{t}{\mathsf{fma}\left(0.5, \frac{\mathsf{fma}\left(2, {t}^{2}, \mathsf{fma}\left(\ell, \ell, \color{blue}{{\ell}^{2}}\right)\right)}{t \cdot \left(x \cdot {\left(\sqrt{2}\right)}^{2}\right)}, t\right)} \]
      9. *-commutative76.8%

        \[\leadsto \frac{t}{\mathsf{fma}\left(0.5, \frac{\mathsf{fma}\left(2, {t}^{2}, \mathsf{fma}\left(\ell, \ell, {\ell}^{2}\right)\right)}{\color{blue}{\left(x \cdot {\left(\sqrt{2}\right)}^{2}\right) \cdot t}}, t\right)} \]
      10. *-commutative76.8%

        \[\leadsto \frac{t}{\mathsf{fma}\left(0.5, \frac{\mathsf{fma}\left(2, {t}^{2}, \mathsf{fma}\left(\ell, \ell, {\ell}^{2}\right)\right)}{\color{blue}{\left({\left(\sqrt{2}\right)}^{2} \cdot x\right)} \cdot t}, t\right)} \]
      11. unpow276.8%

        \[\leadsto \frac{t}{\mathsf{fma}\left(0.5, \frac{\mathsf{fma}\left(2, {t}^{2}, \mathsf{fma}\left(\ell, \ell, {\ell}^{2}\right)\right)}{\left(\color{blue}{\left(\sqrt{2} \cdot \sqrt{2}\right)} \cdot x\right) \cdot t}, t\right)} \]
      12. rem-square-sqrt76.8%

        \[\leadsto \frac{t}{\mathsf{fma}\left(0.5, \frac{\mathsf{fma}\left(2, {t}^{2}, \mathsf{fma}\left(\ell, \ell, {\ell}^{2}\right)\right)}{\left(\color{blue}{2} \cdot x\right) \cdot t}, t\right)} \]
      13. associate-*l*76.8%

        \[\leadsto \frac{t}{\mathsf{fma}\left(0.5, \frac{\mathsf{fma}\left(2, {t}^{2}, \mathsf{fma}\left(\ell, \ell, {\ell}^{2}\right)\right)}{\color{blue}{2 \cdot \left(x \cdot t\right)}}, t\right)} \]
    7. Simplified76.8%

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

    if 1.39999999999999999e-237 < t < 1.20000000000000007e-139

    1. Initial program 3.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. Simplified3.0%

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

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

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

    if 1.20000000000000007e-139 < t < 6.8e44

    1. Initial program 49.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. Simplified49.4%

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

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

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

    if 6.8e44 < t

    1. Initial program 28.0%

      \[\frac{\sqrt{2} \cdot t}{\sqrt{\frac{x + 1}{x - 1} \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}} \]
    2. Simplified28.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-rr86.2%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -3.6 \cdot 10^{-122}:\\ \;\;\;\;-\sqrt{\frac{x + -1}{x + 1}}\\ \mathbf{elif}\;t \leq 3.6 \cdot 10^{-293}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{\ell \cdot \sqrt{\frac{1}{x + -1} + \left(\frac{1}{x} + {x}^{-2}\right)}}\\ \mathbf{elif}\;t \leq 1.4 \cdot 10^{-237}:\\ \;\;\;\;\frac{t}{\mathsf{fma}\left(0.5, \frac{\mathsf{fma}\left(2, {t}^{2}, \mathsf{fma}\left(\ell, \ell, {\ell}^{2}\right)\right)}{2 \cdot \left(t \cdot x\right)}, t\right)}\\ \mathbf{elif}\;t \leq 1.2 \cdot 10^{-139}:\\ \;\;\;\;\frac{t}{\frac{\left(\sqrt{2} \cdot \ell\right) \cdot \sqrt{\frac{1}{x}}}{\sqrt{2}}}\\ \mathbf{elif}\;t \leq 6.8 \cdot 10^{+44}:\\ \;\;\;\;\frac{t}{\frac{\sqrt{\frac{{\ell}^{2}}{x} + \left(2 \cdot \frac{{t}^{2}}{x} + \left(2 \cdot {t}^{2} + \frac{{\ell}^{2}}{x}\right)\right)}}{\sqrt{2}}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\ \end{array} \]

Alternative 4: 77.1% accurate, 0.4× speedup?

\[\begin{array}{l} l = |l|\\ \\ \begin{array}{l} t_1 := \sqrt{\frac{x + -1}{x + 1}}\\ t_2 := \frac{1}{x + -1}\\ \mathbf{if}\;t \leq -5.4 \cdot 10^{-123}:\\ \;\;\;\;-t_1\\ \mathbf{elif}\;t \leq 1.5 \cdot 10^{-293}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{\ell \cdot \sqrt{t_2 + \left(\frac{1}{x} + {x}^{-2}\right)}}\\ \mathbf{elif}\;t \leq 7.5 \cdot 10^{-237}:\\ \;\;\;\;\frac{t}{\mathsf{fma}\left(0.5, \frac{\mathsf{fma}\left(2, {t}^{2}, \mathsf{fma}\left(\ell, \ell, {\ell}^{2}\right)\right)}{2 \cdot \left(t \cdot x\right)}, t\right)}\\ \mathbf{elif}\;t \leq 4.5 \cdot 10^{-28}:\\ \;\;\;\;\sqrt{2} \cdot \frac{t}{\ell \cdot \sqrt{t_2 + \left(\frac{1}{x} + \frac{1}{x} \cdot \frac{1}{x}\right)}}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
NOTE: l should be positive before calling this function
(FPCore (x l t)
 :precision binary64
 (let* ((t_1 (sqrt (/ (+ x -1.0) (+ x 1.0)))) (t_2 (/ 1.0 (+ x -1.0))))
   (if (<= t -5.4e-123)
     (- t_1)
     (if (<= t 1.5e-293)
       (/ (* t (sqrt 2.0)) (* l (sqrt (+ t_2 (+ (/ 1.0 x) (pow x -2.0))))))
       (if (<= t 7.5e-237)
         (/
          t
          (fma
           0.5
           (/ (fma 2.0 (pow t 2.0) (fma l l (pow l 2.0))) (* 2.0 (* t x)))
           t))
         (if (<= t 4.5e-28)
           (*
            (sqrt 2.0)
            (/ t (* l (sqrt (+ t_2 (+ (/ 1.0 x) (* (/ 1.0 x) (/ 1.0 x))))))))
           t_1))))))
l = abs(l);
double code(double x, double l, double t) {
	double t_1 = sqrt(((x + -1.0) / (x + 1.0)));
	double t_2 = 1.0 / (x + -1.0);
	double tmp;
	if (t <= -5.4e-123) {
		tmp = -t_1;
	} else if (t <= 1.5e-293) {
		tmp = (t * sqrt(2.0)) / (l * sqrt((t_2 + ((1.0 / x) + pow(x, -2.0)))));
	} else if (t <= 7.5e-237) {
		tmp = t / fma(0.5, (fma(2.0, pow(t, 2.0), fma(l, l, pow(l, 2.0))) / (2.0 * (t * x))), t);
	} else if (t <= 4.5e-28) {
		tmp = sqrt(2.0) * (t / (l * sqrt((t_2 + ((1.0 / x) + ((1.0 / x) * (1.0 / x)))))));
	} else {
		tmp = t_1;
	}
	return tmp;
}
l = abs(l)
function code(x, l, t)
	t_1 = sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0)))
	t_2 = Float64(1.0 / Float64(x + -1.0))
	tmp = 0.0
	if (t <= -5.4e-123)
		tmp = Float64(-t_1);
	elseif (t <= 1.5e-293)
		tmp = Float64(Float64(t * sqrt(2.0)) / Float64(l * sqrt(Float64(t_2 + Float64(Float64(1.0 / x) + (x ^ -2.0))))));
	elseif (t <= 7.5e-237)
		tmp = Float64(t / fma(0.5, Float64(fma(2.0, (t ^ 2.0), fma(l, l, (l ^ 2.0))) / Float64(2.0 * Float64(t * x))), t));
	elseif (t <= 4.5e-28)
		tmp = Float64(sqrt(2.0) * Float64(t / Float64(l * sqrt(Float64(t_2 + Float64(Float64(1.0 / x) + Float64(Float64(1.0 / x) * Float64(1.0 / x))))))));
	else
		tmp = t_1;
	end
	return tmp
end
NOTE: l should be positive before calling this function
code[x_, l_, t_] := Block[{t$95$1 = N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(1.0 / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -5.4e-123], (-t$95$1), If[LessEqual[t, 1.5e-293], N[(N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] / N[(l * N[Sqrt[N[(t$95$2 + N[(N[(1.0 / x), $MachinePrecision] + N[Power[x, -2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 7.5e-237], N[(t / N[(0.5 * N[(N[(2.0 * N[Power[t, 2.0], $MachinePrecision] + N[(l * l + N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(2.0 * N[(t * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.5e-28], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t / N[(l * N[Sqrt[N[(t$95$2 + N[(N[(1.0 / x), $MachinePrecision] + N[(N[(1.0 / x), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \sqrt{\frac{x + -1}{x + 1}}\\
t_2 := \frac{1}{x + -1}\\
\mathbf{if}\;t \leq -5.4 \cdot 10^{-123}:\\
\;\;\;\;-t_1\\

\mathbf{elif}\;t \leq 1.5 \cdot 10^{-293}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{\ell \cdot \sqrt{t_2 + \left(\frac{1}{x} + {x}^{-2}\right)}}\\

\mathbf{elif}\;t \leq 7.5 \cdot 10^{-237}:\\
\;\;\;\;\frac{t}{\mathsf{fma}\left(0.5, \frac{\mathsf{fma}\left(2, {t}^{2}, \mathsf{fma}\left(\ell, \ell, {\ell}^{2}\right)\right)}{2 \cdot \left(t \cdot x\right)}, t\right)}\\

\mathbf{elif}\;t \leq 4.5 \cdot 10^{-28}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t}{\ell \cdot \sqrt{t_2 + \left(\frac{1}{x} + \frac{1}{x} \cdot \frac{1}{x}\right)}}\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if t < -5.4000000000000002e-123

    1. Initial program 37.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. Simplified37.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. Applied egg-rr80.0%

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

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

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

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

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

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

    if -5.4000000000000002e-123 < t < 1.5000000000000001e-293

    1. Initial program 7.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. Simplified7.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 inf 2.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.5000000000000001e-293 < t < 7.50000000000000034e-237

    1. Initial program 2.3%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{t}{\mathsf{fma}\left(0.5, \frac{\mathsf{fma}\left(2, {t}^{2}, \mathsf{fma}\left(\ell, \ell, -\color{blue}{\left(-{\ell}^{2}\right)}\right)\right)}{t \cdot \left(x \cdot {\left(\sqrt{2}\right)}^{2}\right)}, t\right)} \]
      8. remove-double-neg76.8%

        \[\leadsto \frac{t}{\mathsf{fma}\left(0.5, \frac{\mathsf{fma}\left(2, {t}^{2}, \mathsf{fma}\left(\ell, \ell, \color{blue}{{\ell}^{2}}\right)\right)}{t \cdot \left(x \cdot {\left(\sqrt{2}\right)}^{2}\right)}, t\right)} \]
      9. *-commutative76.8%

        \[\leadsto \frac{t}{\mathsf{fma}\left(0.5, \frac{\mathsf{fma}\left(2, {t}^{2}, \mathsf{fma}\left(\ell, \ell, {\ell}^{2}\right)\right)}{\color{blue}{\left(x \cdot {\left(\sqrt{2}\right)}^{2}\right) \cdot t}}, t\right)} \]
      10. *-commutative76.8%

        \[\leadsto \frac{t}{\mathsf{fma}\left(0.5, \frac{\mathsf{fma}\left(2, {t}^{2}, \mathsf{fma}\left(\ell, \ell, {\ell}^{2}\right)\right)}{\color{blue}{\left({\left(\sqrt{2}\right)}^{2} \cdot x\right)} \cdot t}, t\right)} \]
      11. unpow276.8%

        \[\leadsto \frac{t}{\mathsf{fma}\left(0.5, \frac{\mathsf{fma}\left(2, {t}^{2}, \mathsf{fma}\left(\ell, \ell, {\ell}^{2}\right)\right)}{\left(\color{blue}{\left(\sqrt{2} \cdot \sqrt{2}\right)} \cdot x\right) \cdot t}, t\right)} \]
      12. rem-square-sqrt76.8%

        \[\leadsto \frac{t}{\mathsf{fma}\left(0.5, \frac{\mathsf{fma}\left(2, {t}^{2}, \mathsf{fma}\left(\ell, \ell, {\ell}^{2}\right)\right)}{\left(\color{blue}{2} \cdot x\right) \cdot t}, t\right)} \]
      13. associate-*l*76.8%

        \[\leadsto \frac{t}{\mathsf{fma}\left(0.5, \frac{\mathsf{fma}\left(2, {t}^{2}, \mathsf{fma}\left(\ell, \ell, {\ell}^{2}\right)\right)}{\color{blue}{2 \cdot \left(x \cdot t\right)}}, t\right)} \]
    7. Simplified76.8%

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

    if 7.50000000000000034e-237 < t < 4.4999999999999998e-28

    1. Initial program 18.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. Simplified18.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.4999999999999998e-28 < t

    1. Initial program 35.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. Simplified35.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. Applied egg-rr83.6%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -5.4 \cdot 10^{-123}:\\ \;\;\;\;-\sqrt{\frac{x + -1}{x + 1}}\\ \mathbf{elif}\;t \leq 1.5 \cdot 10^{-293}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{\ell \cdot \sqrt{\frac{1}{x + -1} + \left(\frac{1}{x} + {x}^{-2}\right)}}\\ \mathbf{elif}\;t \leq 7.5 \cdot 10^{-237}:\\ \;\;\;\;\frac{t}{\mathsf{fma}\left(0.5, \frac{\mathsf{fma}\left(2, {t}^{2}, \mathsf{fma}\left(\ell, \ell, {\ell}^{2}\right)\right)}{2 \cdot \left(t \cdot x\right)}, t\right)}\\ \mathbf{elif}\;t \leq 4.5 \cdot 10^{-28}:\\ \;\;\;\;\sqrt{2} \cdot \frac{t}{\ell \cdot \sqrt{\frac{1}{x + -1} + \left(\frac{1}{x} + \frac{1}{x} \cdot \frac{1}{x}\right)}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\ \end{array} \]

Alternative 5: 77.7% accurate, 1.0× speedup?

\[\begin{array}{l} l = |l|\\ \\ \begin{array}{l} t_1 := \sqrt{\frac{x + -1}{x + 1}}\\ \mathbf{if}\;t \leq -3.6 \cdot 10^{-122}:\\ \;\;\;\;-t_1\\ \mathbf{elif}\;t \leq 9 \cdot 10^{-28}:\\ \;\;\;\;\sqrt{2} \cdot \frac{t}{\ell \cdot \sqrt{\frac{1}{x + -1} + \left(\frac{1}{x} + \frac{1}{x} \cdot \frac{1}{x}\right)}}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
NOTE: l should be positive before calling this function
(FPCore (x l t)
 :precision binary64
 (let* ((t_1 (sqrt (/ (+ x -1.0) (+ x 1.0)))))
   (if (<= t -3.6e-122)
     (- t_1)
     (if (<= t 9e-28)
       (*
        (sqrt 2.0)
        (/
         t
         (*
          l
          (sqrt
           (+ (/ 1.0 (+ x -1.0)) (+ (/ 1.0 x) (* (/ 1.0 x) (/ 1.0 x))))))))
       t_1))))
l = abs(l);
double code(double x, double l, double t) {
	double t_1 = sqrt(((x + -1.0) / (x + 1.0)));
	double tmp;
	if (t <= -3.6e-122) {
		tmp = -t_1;
	} else if (t <= 9e-28) {
		tmp = sqrt(2.0) * (t / (l * sqrt(((1.0 / (x + -1.0)) + ((1.0 / x) + ((1.0 / x) * (1.0 / x)))))));
	} else {
		tmp = t_1;
	}
	return tmp;
}
NOTE: l should be positive before calling this function
real(8) function code(x, l, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: l
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: tmp
    t_1 = sqrt(((x + (-1.0d0)) / (x + 1.0d0)))
    if (t <= (-3.6d-122)) then
        tmp = -t_1
    else if (t <= 9d-28) then
        tmp = sqrt(2.0d0) * (t / (l * sqrt(((1.0d0 / (x + (-1.0d0))) + ((1.0d0 / x) + ((1.0d0 / x) * (1.0d0 / x)))))))
    else
        tmp = t_1
    end if
    code = tmp
end function
l = Math.abs(l);
public static double code(double x, double l, double t) {
	double t_1 = Math.sqrt(((x + -1.0) / (x + 1.0)));
	double tmp;
	if (t <= -3.6e-122) {
		tmp = -t_1;
	} else if (t <= 9e-28) {
		tmp = Math.sqrt(2.0) * (t / (l * Math.sqrt(((1.0 / (x + -1.0)) + ((1.0 / x) + ((1.0 / x) * (1.0 / x)))))));
	} else {
		tmp = t_1;
	}
	return tmp;
}
l = abs(l)
def code(x, l, t):
	t_1 = math.sqrt(((x + -1.0) / (x + 1.0)))
	tmp = 0
	if t <= -3.6e-122:
		tmp = -t_1
	elif t <= 9e-28:
		tmp = math.sqrt(2.0) * (t / (l * math.sqrt(((1.0 / (x + -1.0)) + ((1.0 / x) + ((1.0 / x) * (1.0 / x)))))))
	else:
		tmp = t_1
	return tmp
l = abs(l)
function code(x, l, t)
	t_1 = sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0)))
	tmp = 0.0
	if (t <= -3.6e-122)
		tmp = Float64(-t_1);
	elseif (t <= 9e-28)
		tmp = Float64(sqrt(2.0) * Float64(t / Float64(l * sqrt(Float64(Float64(1.0 / Float64(x + -1.0)) + Float64(Float64(1.0 / x) + Float64(Float64(1.0 / x) * Float64(1.0 / x))))))));
	else
		tmp = t_1;
	end
	return tmp
end
l = abs(l)
function tmp_2 = code(x, l, t)
	t_1 = sqrt(((x + -1.0) / (x + 1.0)));
	tmp = 0.0;
	if (t <= -3.6e-122)
		tmp = -t_1;
	elseif (t <= 9e-28)
		tmp = sqrt(2.0) * (t / (l * sqrt(((1.0 / (x + -1.0)) + ((1.0 / x) + ((1.0 / x) * (1.0 / x)))))));
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
NOTE: l should be positive before calling this function
code[x_, l_, t_] := Block[{t$95$1 = N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, -3.6e-122], (-t$95$1), If[LessEqual[t, 9e-28], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t / N[(l * N[Sqrt[N[(N[(1.0 / N[(x + -1.0), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / x), $MachinePrecision] + N[(N[(1.0 / x), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \sqrt{\frac{x + -1}{x + 1}}\\
\mathbf{if}\;t \leq -3.6 \cdot 10^{-122}:\\
\;\;\;\;-t_1\\

\mathbf{elif}\;t \leq 9 \cdot 10^{-28}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t}{\ell \cdot \sqrt{\frac{1}{x + -1} + \left(\frac{1}{x} + \frac{1}{x} \cdot \frac{1}{x}\right)}}\\

\mathbf{else}:\\
\;\;\;\;t_1\\


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

    1. Initial program 37.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. Simplified37.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. Applied egg-rr80.0%

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

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

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

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

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

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

    if -3.59999999999999994e-122 < t < 8.9999999999999996e-28

    1. Initial program 12.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. Simplified12.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 1.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 8.9999999999999996e-28 < t

    1. Initial program 35.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. Simplified35.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. Applied egg-rr83.6%

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

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

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

Alternative 6: 77.3% accurate, 2.0× speedup?

\[\begin{array}{l} l = |l|\\ \\ \begin{array}{l} \mathbf{if}\;t \leq -1.35 \cdot 10^{-122}:\\ \;\;\;\;\frac{t}{\left(-t\right) - \frac{t}{x}}\\ \mathbf{elif}\;t \leq 4.5 \cdot 10^{-28}:\\ \;\;\;\;\frac{t}{\ell \cdot \sqrt{\frac{1}{x}}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\ \end{array} \end{array} \]
NOTE: l should be positive before calling this function
(FPCore (x l t)
 :precision binary64
 (if (<= t -1.35e-122)
   (/ t (- (- t) (/ t x)))
   (if (<= t 4.5e-28)
     (/ t (* l (sqrt (/ 1.0 x))))
     (sqrt (/ (+ x -1.0) (+ x 1.0))))))
l = abs(l);
double code(double x, double l, double t) {
	double tmp;
	if (t <= -1.35e-122) {
		tmp = t / (-t - (t / x));
	} else if (t <= 4.5e-28) {
		tmp = t / (l * sqrt((1.0 / x)));
	} else {
		tmp = sqrt(((x + -1.0) / (x + 1.0)));
	}
	return tmp;
}
NOTE: l should be positive before calling this function
real(8) function code(x, l, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: l
    real(8), intent (in) :: t
    real(8) :: tmp
    if (t <= (-1.35d-122)) then
        tmp = t / (-t - (t / x))
    else if (t <= 4.5d-28) then
        tmp = t / (l * sqrt((1.0d0 / x)))
    else
        tmp = sqrt(((x + (-1.0d0)) / (x + 1.0d0)))
    end if
    code = tmp
end function
l = Math.abs(l);
public static double code(double x, double l, double t) {
	double tmp;
	if (t <= -1.35e-122) {
		tmp = t / (-t - (t / x));
	} else if (t <= 4.5e-28) {
		tmp = t / (l * Math.sqrt((1.0 / x)));
	} else {
		tmp = Math.sqrt(((x + -1.0) / (x + 1.0)));
	}
	return tmp;
}
l = abs(l)
def code(x, l, t):
	tmp = 0
	if t <= -1.35e-122:
		tmp = t / (-t - (t / x))
	elif t <= 4.5e-28:
		tmp = t / (l * math.sqrt((1.0 / x)))
	else:
		tmp = math.sqrt(((x + -1.0) / (x + 1.0)))
	return tmp
l = abs(l)
function code(x, l, t)
	tmp = 0.0
	if (t <= -1.35e-122)
		tmp = Float64(t / Float64(Float64(-t) - Float64(t / x)));
	elseif (t <= 4.5e-28)
		tmp = Float64(t / Float64(l * sqrt(Float64(1.0 / x))));
	else
		tmp = sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0)));
	end
	return tmp
end
l = abs(l)
function tmp_2 = code(x, l, t)
	tmp = 0.0;
	if (t <= -1.35e-122)
		tmp = t / (-t - (t / x));
	elseif (t <= 4.5e-28)
		tmp = t / (l * sqrt((1.0 / x)));
	else
		tmp = sqrt(((x + -1.0) / (x + 1.0)));
	end
	tmp_2 = tmp;
end
NOTE: l should be positive before calling this function
code[x_, l_, t_] := If[LessEqual[t, -1.35e-122], N[(t / N[((-t) - N[(t / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.5e-28], N[(t / N[(l * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.35 \cdot 10^{-122}:\\
\;\;\;\;\frac{t}{\left(-t\right) - \frac{t}{x}}\\

\mathbf{elif}\;t \leq 4.5 \cdot 10^{-28}:\\
\;\;\;\;\frac{t}{\ell \cdot \sqrt{\frac{1}{x}}}\\

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


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

    1. Initial program 37.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. Simplified37.9%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{t}{\color{blue}{\left(\sqrt{-1} \cdot \sqrt{-1}\right)} \cdot t - \frac{t}{x}} \]
      6. rem-square-sqrt91.6%

        \[\leadsto \frac{t}{\color{blue}{-1} \cdot t - \frac{t}{x}} \]
      7. mul-1-neg91.6%

        \[\leadsto \frac{t}{\color{blue}{\left(-t\right)} - \frac{t}{x}} \]
    8. Simplified91.6%

      \[\leadsto \frac{t}{\color{blue}{\left(-t\right) - \frac{t}{x}}} \]

    if -1.35000000000000005e-122 < t < 4.4999999999999998e-28

    1. Initial program 12.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. Simplified12.5%

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

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

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

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

    if 4.4999999999999998e-28 < t

    1. Initial program 35.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. Simplified35.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. Applied egg-rr83.6%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.35 \cdot 10^{-122}:\\ \;\;\;\;\frac{t}{\left(-t\right) - \frac{t}{x}}\\ \mathbf{elif}\;t \leq 4.5 \cdot 10^{-28}:\\ \;\;\;\;\frac{t}{\ell \cdot \sqrt{\frac{1}{x}}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\ \end{array} \]

Alternative 7: 77.6% accurate, 2.0× speedup?

\[\begin{array}{l} l = |l|\\ \\ \begin{array}{l} t_1 := \sqrt{\frac{x + -1}{x + 1}}\\ \mathbf{if}\;t \leq -1.35 \cdot 10^{-122}:\\ \;\;\;\;-t_1\\ \mathbf{elif}\;t \leq 4.5 \cdot 10^{-28}:\\ \;\;\;\;\frac{t}{\ell \cdot \sqrt{\frac{1}{x}}}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
NOTE: l should be positive before calling this function
(FPCore (x l t)
 :precision binary64
 (let* ((t_1 (sqrt (/ (+ x -1.0) (+ x 1.0)))))
   (if (<= t -1.35e-122)
     (- t_1)
     (if (<= t 4.5e-28) (/ t (* l (sqrt (/ 1.0 x)))) t_1))))
l = abs(l);
double code(double x, double l, double t) {
	double t_1 = sqrt(((x + -1.0) / (x + 1.0)));
	double tmp;
	if (t <= -1.35e-122) {
		tmp = -t_1;
	} else if (t <= 4.5e-28) {
		tmp = t / (l * sqrt((1.0 / x)));
	} else {
		tmp = t_1;
	}
	return tmp;
}
NOTE: l should be positive before calling this function
real(8) function code(x, l, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: l
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: tmp
    t_1 = sqrt(((x + (-1.0d0)) / (x + 1.0d0)))
    if (t <= (-1.35d-122)) then
        tmp = -t_1
    else if (t <= 4.5d-28) then
        tmp = t / (l * sqrt((1.0d0 / x)))
    else
        tmp = t_1
    end if
    code = tmp
end function
l = Math.abs(l);
public static double code(double x, double l, double t) {
	double t_1 = Math.sqrt(((x + -1.0) / (x + 1.0)));
	double tmp;
	if (t <= -1.35e-122) {
		tmp = -t_1;
	} else if (t <= 4.5e-28) {
		tmp = t / (l * Math.sqrt((1.0 / x)));
	} else {
		tmp = t_1;
	}
	return tmp;
}
l = abs(l)
def code(x, l, t):
	t_1 = math.sqrt(((x + -1.0) / (x + 1.0)))
	tmp = 0
	if t <= -1.35e-122:
		tmp = -t_1
	elif t <= 4.5e-28:
		tmp = t / (l * math.sqrt((1.0 / x)))
	else:
		tmp = t_1
	return tmp
l = abs(l)
function code(x, l, t)
	t_1 = sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0)))
	tmp = 0.0
	if (t <= -1.35e-122)
		tmp = Float64(-t_1);
	elseif (t <= 4.5e-28)
		tmp = Float64(t / Float64(l * sqrt(Float64(1.0 / x))));
	else
		tmp = t_1;
	end
	return tmp
end
l = abs(l)
function tmp_2 = code(x, l, t)
	t_1 = sqrt(((x + -1.0) / (x + 1.0)));
	tmp = 0.0;
	if (t <= -1.35e-122)
		tmp = -t_1;
	elseif (t <= 4.5e-28)
		tmp = t / (l * sqrt((1.0 / x)));
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
NOTE: l should be positive before calling this function
code[x_, l_, t_] := Block[{t$95$1 = N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, -1.35e-122], (-t$95$1), If[LessEqual[t, 4.5e-28], N[(t / N[(l * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \sqrt{\frac{x + -1}{x + 1}}\\
\mathbf{if}\;t \leq -1.35 \cdot 10^{-122}:\\
\;\;\;\;-t_1\\

\mathbf{elif}\;t \leq 4.5 \cdot 10^{-28}:\\
\;\;\;\;\frac{t}{\ell \cdot \sqrt{\frac{1}{x}}}\\

\mathbf{else}:\\
\;\;\;\;t_1\\


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

    1. Initial program 37.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. Simplified37.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. Applied egg-rr80.0%

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

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

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

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

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

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

    if -1.35000000000000005e-122 < t < 4.4999999999999998e-28

    1. Initial program 12.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. Simplified12.5%

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

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

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

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

    if 4.4999999999999998e-28 < t

    1. Initial program 35.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. Simplified35.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. Applied egg-rr83.6%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.35 \cdot 10^{-122}:\\ \;\;\;\;-\sqrt{\frac{x + -1}{x + 1}}\\ \mathbf{elif}\;t \leq 4.5 \cdot 10^{-28}:\\ \;\;\;\;\frac{t}{\ell \cdot \sqrt{\frac{1}{x}}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\ \end{array} \]

Alternative 8: 75.8% accurate, 2.1× speedup?

\[\begin{array}{l} l = |l|\\ \\ \begin{array}{l} \mathbf{if}\;t \leq -4 \cdot 10^{-310}:\\ \;\;\;\;\frac{t}{\left(-t\right) - \frac{t}{x}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\ \end{array} \end{array} \]
NOTE: l should be positive before calling this function
(FPCore (x l t)
 :precision binary64
 (if (<= t -4e-310) (/ t (- (- t) (/ t x))) (sqrt (/ (+ x -1.0) (+ x 1.0)))))
l = abs(l);
double code(double x, double l, double t) {
	double tmp;
	if (t <= -4e-310) {
		tmp = t / (-t - (t / x));
	} else {
		tmp = sqrt(((x + -1.0) / (x + 1.0)));
	}
	return tmp;
}
NOTE: l should be positive before calling this function
real(8) function code(x, l, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: l
    real(8), intent (in) :: t
    real(8) :: tmp
    if (t <= (-4d-310)) then
        tmp = t / (-t - (t / x))
    else
        tmp = sqrt(((x + (-1.0d0)) / (x + 1.0d0)))
    end if
    code = tmp
end function
l = Math.abs(l);
public static double code(double x, double l, double t) {
	double tmp;
	if (t <= -4e-310) {
		tmp = t / (-t - (t / x));
	} else {
		tmp = Math.sqrt(((x + -1.0) / (x + 1.0)));
	}
	return tmp;
}
l = abs(l)
def code(x, l, t):
	tmp = 0
	if t <= -4e-310:
		tmp = t / (-t - (t / x))
	else:
		tmp = math.sqrt(((x + -1.0) / (x + 1.0)))
	return tmp
l = abs(l)
function code(x, l, t)
	tmp = 0.0
	if (t <= -4e-310)
		tmp = Float64(t / Float64(Float64(-t) - Float64(t / x)));
	else
		tmp = sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0)));
	end
	return tmp
end
l = abs(l)
function tmp_2 = code(x, l, t)
	tmp = 0.0;
	if (t <= -4e-310)
		tmp = t / (-t - (t / x));
	else
		tmp = sqrt(((x + -1.0) / (x + 1.0)));
	end
	tmp_2 = tmp;
end
NOTE: l should be positive before calling this function
code[x_, l_, t_] := If[LessEqual[t, -4e-310], N[(t / N[((-t) - N[(t / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4 \cdot 10^{-310}:\\
\;\;\;\;\frac{t}{\left(-t\right) - \frac{t}{x}}\\

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


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

    1. Initial program 32.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. Simplified32.0%

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

      \[\leadsto \frac{t}{\color{blue}{t \cdot \sqrt{\frac{1 + x}{x - 1}}}} \]
    4. Step-by-step derivation
      1. +-commutative1.7%

        \[\leadsto \frac{t}{t \cdot \sqrt{\frac{\color{blue}{x + 1}}{x - 1}}} \]
      2. sub-neg1.7%

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

        \[\leadsto \frac{t}{t \cdot \sqrt{\frac{x + 1}{x + \color{blue}{-1}}}} \]
      4. +-commutative1.7%

        \[\leadsto \frac{t}{t \cdot \sqrt{\frac{x + 1}{\color{blue}{-1 + x}}}} \]
    5. Simplified1.7%

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

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

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

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

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

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

        \[\leadsto \frac{t}{\color{blue}{\left(\sqrt{-1} \cdot \sqrt{-1}\right)} \cdot t - \frac{t}{x}} \]
      6. rem-square-sqrt80.7%

        \[\leadsto \frac{t}{\color{blue}{-1} \cdot t - \frac{t}{x}} \]
      7. mul-1-neg80.7%

        \[\leadsto \frac{t}{\color{blue}{\left(-t\right)} - \frac{t}{x}} \]
    8. Simplified80.7%

      \[\leadsto \frac{t}{\color{blue}{\left(-t\right) - \frac{t}{x}}} \]

    if -3.999999999999988e-310 < t

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

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

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

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

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

Alternative 9: 75.5% accurate, 22.4× speedup?

\[\begin{array}{l} l = |l|\\ \\ \begin{array}{l} \mathbf{if}\;t \leq -4 \cdot 10^{-310}:\\ \;\;\;\;\frac{t}{\left(-t\right) - \frac{t}{x}}\\ \mathbf{else}:\\ \;\;\;\;1 + \frac{-1}{x}\\ \end{array} \end{array} \]
NOTE: l should be positive before calling this function
(FPCore (x l t)
 :precision binary64
 (if (<= t -4e-310) (/ t (- (- t) (/ t x))) (+ 1.0 (/ -1.0 x))))
l = abs(l);
double code(double x, double l, double t) {
	double tmp;
	if (t <= -4e-310) {
		tmp = t / (-t - (t / x));
	} else {
		tmp = 1.0 + (-1.0 / x);
	}
	return tmp;
}
NOTE: l should be positive before calling this function
real(8) function code(x, l, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: l
    real(8), intent (in) :: t
    real(8) :: tmp
    if (t <= (-4d-310)) then
        tmp = t / (-t - (t / x))
    else
        tmp = 1.0d0 + ((-1.0d0) / x)
    end if
    code = tmp
end function
l = Math.abs(l);
public static double code(double x, double l, double t) {
	double tmp;
	if (t <= -4e-310) {
		tmp = t / (-t - (t / x));
	} else {
		tmp = 1.0 + (-1.0 / x);
	}
	return tmp;
}
l = abs(l)
def code(x, l, t):
	tmp = 0
	if t <= -4e-310:
		tmp = t / (-t - (t / x))
	else:
		tmp = 1.0 + (-1.0 / x)
	return tmp
l = abs(l)
function code(x, l, t)
	tmp = 0.0
	if (t <= -4e-310)
		tmp = Float64(t / Float64(Float64(-t) - Float64(t / x)));
	else
		tmp = Float64(1.0 + Float64(-1.0 / x));
	end
	return tmp
end
l = abs(l)
function tmp_2 = code(x, l, t)
	tmp = 0.0;
	if (t <= -4e-310)
		tmp = t / (-t - (t / x));
	else
		tmp = 1.0 + (-1.0 / x);
	end
	tmp_2 = tmp;
end
NOTE: l should be positive before calling this function
code[x_, l_, t_] := If[LessEqual[t, -4e-310], N[(t / N[((-t) - N[(t / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4 \cdot 10^{-310}:\\
\;\;\;\;\frac{t}{\left(-t\right) - \frac{t}{x}}\\

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


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

    1. Initial program 32.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. Simplified32.0%

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

      \[\leadsto \frac{t}{\color{blue}{t \cdot \sqrt{\frac{1 + x}{x - 1}}}} \]
    4. Step-by-step derivation
      1. +-commutative1.7%

        \[\leadsto \frac{t}{t \cdot \sqrt{\frac{\color{blue}{x + 1}}{x - 1}}} \]
      2. sub-neg1.7%

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

        \[\leadsto \frac{t}{t \cdot \sqrt{\frac{x + 1}{x + \color{blue}{-1}}}} \]
      4. +-commutative1.7%

        \[\leadsto \frac{t}{t \cdot \sqrt{\frac{x + 1}{\color{blue}{-1 + x}}}} \]
    5. Simplified1.7%

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

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

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

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

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

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

        \[\leadsto \frac{t}{\color{blue}{\left(\sqrt{-1} \cdot \sqrt{-1}\right)} \cdot t - \frac{t}{x}} \]
      6. rem-square-sqrt80.7%

        \[\leadsto \frac{t}{\color{blue}{-1} \cdot t - \frac{t}{x}} \]
      7. mul-1-neg80.7%

        \[\leadsto \frac{t}{\color{blue}{\left(-t\right)} - \frac{t}{x}} \]
    8. Simplified80.7%

      \[\leadsto \frac{t}{\color{blue}{\left(-t\right) - \frac{t}{x}}} \]

    if -3.999999999999988e-310 < t

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -4 \cdot 10^{-310}:\\ \;\;\;\;\frac{t}{\left(-t\right) - \frac{t}{x}}\\ \mathbf{else}:\\ \;\;\;\;1 + \frac{-1}{x}\\ \end{array} \]

Alternative 10: 75.1% accurate, 31.9× speedup?

\[\begin{array}{l} l = |l|\\ \\ \begin{array}{l} \mathbf{if}\;t \leq -4 \cdot 10^{-310}:\\ \;\;\;\;\frac{t}{-t}\\ \mathbf{else}:\\ \;\;\;\;1 + \frac{-1}{x}\\ \end{array} \end{array} \]
NOTE: l should be positive before calling this function
(FPCore (x l t)
 :precision binary64
 (if (<= t -4e-310) (/ t (- t)) (+ 1.0 (/ -1.0 x))))
l = abs(l);
double code(double x, double l, double t) {
	double tmp;
	if (t <= -4e-310) {
		tmp = t / -t;
	} else {
		tmp = 1.0 + (-1.0 / x);
	}
	return tmp;
}
NOTE: l should be positive before calling this function
real(8) function code(x, l, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: l
    real(8), intent (in) :: t
    real(8) :: tmp
    if (t <= (-4d-310)) then
        tmp = t / -t
    else
        tmp = 1.0d0 + ((-1.0d0) / x)
    end if
    code = tmp
end function
l = Math.abs(l);
public static double code(double x, double l, double t) {
	double tmp;
	if (t <= -4e-310) {
		tmp = t / -t;
	} else {
		tmp = 1.0 + (-1.0 / x);
	}
	return tmp;
}
l = abs(l)
def code(x, l, t):
	tmp = 0
	if t <= -4e-310:
		tmp = t / -t
	else:
		tmp = 1.0 + (-1.0 / x)
	return tmp
l = abs(l)
function code(x, l, t)
	tmp = 0.0
	if (t <= -4e-310)
		tmp = Float64(t / Float64(-t));
	else
		tmp = Float64(1.0 + Float64(-1.0 / x));
	end
	return tmp
end
l = abs(l)
function tmp_2 = code(x, l, t)
	tmp = 0.0;
	if (t <= -4e-310)
		tmp = t / -t;
	else
		tmp = 1.0 + (-1.0 / x);
	end
	tmp_2 = tmp;
end
NOTE: l should be positive before calling this function
code[x_, l_, t_] := If[LessEqual[t, -4e-310], N[(t / (-t)), $MachinePrecision], N[(1.0 + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4 \cdot 10^{-310}:\\
\;\;\;\;\frac{t}{-t}\\

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


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

    1. Initial program 32.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. Simplified32.0%

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

      \[\leadsto \frac{t}{\color{blue}{t \cdot \sqrt{\frac{1 + x}{x - 1}}}} \]
    4. Step-by-step derivation
      1. +-commutative1.7%

        \[\leadsto \frac{t}{t \cdot \sqrt{\frac{\color{blue}{x + 1}}{x - 1}}} \]
      2. sub-neg1.7%

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

        \[\leadsto \frac{t}{t \cdot \sqrt{\frac{x + 1}{x + \color{blue}{-1}}}} \]
      4. +-commutative1.7%

        \[\leadsto \frac{t}{t \cdot \sqrt{\frac{x + 1}{\color{blue}{-1 + x}}}} \]
    5. Simplified1.7%

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

      \[\leadsto \frac{t}{\color{blue}{t \cdot {\left(\sqrt{-1}\right)}^{2}}} \]
    7. Step-by-step derivation
      1. *-commutative0.0%

        \[\leadsto \frac{t}{\color{blue}{{\left(\sqrt{-1}\right)}^{2} \cdot t}} \]
      2. unpow20.0%

        \[\leadsto \frac{t}{\color{blue}{\left(\sqrt{-1} \cdot \sqrt{-1}\right)} \cdot t} \]
      3. rem-square-sqrt79.6%

        \[\leadsto \frac{t}{\color{blue}{-1} \cdot t} \]
      4. mul-1-neg79.6%

        \[\leadsto \frac{t}{\color{blue}{-t}} \]
    8. Simplified79.6%

      \[\leadsto \frac{t}{\color{blue}{-t}} \]

    if -3.999999999999988e-310 < t

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -4 \cdot 10^{-310}:\\ \;\;\;\;\frac{t}{-t}\\ \mathbf{else}:\\ \;\;\;\;1 + \frac{-1}{x}\\ \end{array} \]

Alternative 11: 74.7% accurate, 37.1× speedup?

\[\begin{array}{l} l = |l|\\ \\ \begin{array}{l} \mathbf{if}\;t \leq -4 \cdot 10^{-310}:\\ \;\;\;\;\frac{t}{-t}\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \end{array} \]
NOTE: l should be positive before calling this function
(FPCore (x l t) :precision binary64 (if (<= t -4e-310) (/ t (- t)) 1.0))
l = abs(l);
double code(double x, double l, double t) {
	double tmp;
	if (t <= -4e-310) {
		tmp = t / -t;
	} else {
		tmp = 1.0;
	}
	return tmp;
}
NOTE: l should be positive before calling this function
real(8) function code(x, l, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: l
    real(8), intent (in) :: t
    real(8) :: tmp
    if (t <= (-4d-310)) then
        tmp = t / -t
    else
        tmp = 1.0d0
    end if
    code = tmp
end function
l = Math.abs(l);
public static double code(double x, double l, double t) {
	double tmp;
	if (t <= -4e-310) {
		tmp = t / -t;
	} else {
		tmp = 1.0;
	}
	return tmp;
}
l = abs(l)
def code(x, l, t):
	tmp = 0
	if t <= -4e-310:
		tmp = t / -t
	else:
		tmp = 1.0
	return tmp
l = abs(l)
function code(x, l, t)
	tmp = 0.0
	if (t <= -4e-310)
		tmp = Float64(t / Float64(-t));
	else
		tmp = 1.0;
	end
	return tmp
end
l = abs(l)
function tmp_2 = code(x, l, t)
	tmp = 0.0;
	if (t <= -4e-310)
		tmp = t / -t;
	else
		tmp = 1.0;
	end
	tmp_2 = tmp;
end
NOTE: l should be positive before calling this function
code[x_, l_, t_] := If[LessEqual[t, -4e-310], N[(t / (-t)), $MachinePrecision], 1.0]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4 \cdot 10^{-310}:\\
\;\;\;\;\frac{t}{-t}\\

\mathbf{else}:\\
\;\;\;\;1\\


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

    1. Initial program 32.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. Simplified32.0%

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

      \[\leadsto \frac{t}{\color{blue}{t \cdot \sqrt{\frac{1 + x}{x - 1}}}} \]
    4. Step-by-step derivation
      1. +-commutative1.7%

        \[\leadsto \frac{t}{t \cdot \sqrt{\frac{\color{blue}{x + 1}}{x - 1}}} \]
      2. sub-neg1.7%

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

        \[\leadsto \frac{t}{t \cdot \sqrt{\frac{x + 1}{x + \color{blue}{-1}}}} \]
      4. +-commutative1.7%

        \[\leadsto \frac{t}{t \cdot \sqrt{\frac{x + 1}{\color{blue}{-1 + x}}}} \]
    5. Simplified1.7%

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

      \[\leadsto \frac{t}{\color{blue}{t \cdot {\left(\sqrt{-1}\right)}^{2}}} \]
    7. Step-by-step derivation
      1. *-commutative0.0%

        \[\leadsto \frac{t}{\color{blue}{{\left(\sqrt{-1}\right)}^{2} \cdot t}} \]
      2. unpow20.0%

        \[\leadsto \frac{t}{\color{blue}{\left(\sqrt{-1} \cdot \sqrt{-1}\right)} \cdot t} \]
      3. rem-square-sqrt79.6%

        \[\leadsto \frac{t}{\color{blue}{-1} \cdot t} \]
      4. mul-1-neg79.6%

        \[\leadsto \frac{t}{\color{blue}{-t}} \]
    8. Simplified79.6%

      \[\leadsto \frac{t}{\color{blue}{-t}} \]

    if -3.999999999999988e-310 < t

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{1} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification74.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -4 \cdot 10^{-310}:\\ \;\;\;\;\frac{t}{-t}\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]

Alternative 12: 39.0% accurate, 225.0× speedup?

\[\begin{array}{l} l = |l|\\ \\ 1 \end{array} \]
NOTE: l should be positive before calling this function
(FPCore (x l t) :precision binary64 1.0)
l = abs(l);
double code(double x, double l, double t) {
	return 1.0;
}
NOTE: l should be positive before calling this function
real(8) function code(x, l, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: l
    real(8), intent (in) :: t
    code = 1.0d0
end function
l = Math.abs(l);
public static double code(double x, double l, double t) {
	return 1.0;
}
l = abs(l)
def code(x, l, t):
	return 1.0
l = abs(l)
function code(x, l, t)
	return 1.0
end
l = abs(l)
function tmp = code(x, l, t)
	tmp = 1.0;
end
NOTE: l should be positive before calling this function
code[x_, l_, t_] := 1.0
\begin{array}{l}
l = |l|\\
\\
1
\end{array}
Derivation
  1. Initial program 29.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. Simplified28.9%

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

    \[\leadsto \frac{t}{\color{blue}{t \cdot \sqrt{\frac{1 + x}{x - 1}}}} \]
  4. Step-by-step derivation
    1. +-commutative37.3%

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

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

      \[\leadsto \frac{t}{t \cdot \sqrt{\frac{x + 1}{x + \color{blue}{-1}}}} \]
    4. +-commutative37.3%

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

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

    \[\leadsto \color{blue}{1} \]
  7. Final simplification36.5%

    \[\leadsto 1 \]

Reproduce

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