Toniolo and Linder, Equation (7)

Percentage Accurate: 33.8% → 80.9%
Time: 20.9s
Alternatives: 9
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 9 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.8% 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: 80.9% accurate, 0.3× speedup?

\[\begin{array}{l} l = |l|\\ \\ \begin{array}{l} t_1 := 2 \cdot {t}^{2}\\ \mathbf{if}\;t \leq -3.4 \cdot 10^{+87}:\\ \;\;\;\;\frac{1}{x} + -1\\ \mathbf{elif}\;t \leq -3 \cdot 10^{-163}:\\ \;\;\;\;\frac{t}{\frac{\sqrt{\left(2 \cdot \frac{{t}^{2}}{x} + \left(t_1 + \frac{{\ell}^{2}}{x}\right)\right) + \frac{t_1 + {\ell}^{2}}{x}}}{\sqrt{2}}}\\ \mathbf{elif}\;t \leq -6.6 \cdot 10^{-254}:\\ \;\;\;\;-1\\ \mathbf{elif}\;t \leq 4.1 \cdot 10^{-211}:\\ \;\;\;\;\frac{t}{\ell} \cdot \sqrt{x}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{x + -1}{1 + x}}\\ \end{array} \end{array} \]
NOTE: l should be positive before calling this function
(FPCore (x l t)
 :precision binary64
 (let* ((t_1 (* 2.0 (pow t 2.0))))
   (if (<= t -3.4e+87)
     (+ (/ 1.0 x) -1.0)
     (if (<= t -3e-163)
       (/
        t
        (/
         (sqrt
          (+
           (+ (* 2.0 (/ (pow t 2.0) x)) (+ t_1 (/ (pow l 2.0) x)))
           (/ (+ t_1 (pow l 2.0)) x)))
         (sqrt 2.0)))
       (if (<= t -6.6e-254)
         -1.0
         (if (<= t 4.1e-211)
           (* (/ t l) (sqrt x))
           (sqrt (/ (+ x -1.0) (+ 1.0 x)))))))))
l = abs(l);
double code(double x, double l, double t) {
	double t_1 = 2.0 * pow(t, 2.0);
	double tmp;
	if (t <= -3.4e+87) {
		tmp = (1.0 / x) + -1.0;
	} else if (t <= -3e-163) {
		tmp = t / (sqrt((((2.0 * (pow(t, 2.0) / x)) + (t_1 + (pow(l, 2.0) / x))) + ((t_1 + pow(l, 2.0)) / x))) / sqrt(2.0));
	} else if (t <= -6.6e-254) {
		tmp = -1.0;
	} else if (t <= 4.1e-211) {
		tmp = (t / l) * sqrt(x);
	} else {
		tmp = sqrt(((x + -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) :: t_1
    real(8) :: tmp
    t_1 = 2.0d0 * (t ** 2.0d0)
    if (t <= (-3.4d+87)) then
        tmp = (1.0d0 / x) + (-1.0d0)
    else if (t <= (-3d-163)) then
        tmp = t / (sqrt((((2.0d0 * ((t ** 2.0d0) / x)) + (t_1 + ((l ** 2.0d0) / x))) + ((t_1 + (l ** 2.0d0)) / x))) / sqrt(2.0d0))
    else if (t <= (-6.6d-254)) then
        tmp = -1.0d0
    else if (t <= 4.1d-211) then
        tmp = (t / l) * sqrt(x)
    else
        tmp = sqrt(((x + (-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 t_1 = 2.0 * Math.pow(t, 2.0);
	double tmp;
	if (t <= -3.4e+87) {
		tmp = (1.0 / x) + -1.0;
	} else if (t <= -3e-163) {
		tmp = t / (Math.sqrt((((2.0 * (Math.pow(t, 2.0) / x)) + (t_1 + (Math.pow(l, 2.0) / x))) + ((t_1 + Math.pow(l, 2.0)) / x))) / Math.sqrt(2.0));
	} else if (t <= -6.6e-254) {
		tmp = -1.0;
	} else if (t <= 4.1e-211) {
		tmp = (t / l) * Math.sqrt(x);
	} else {
		tmp = Math.sqrt(((x + -1.0) / (1.0 + x)));
	}
	return tmp;
}
l = abs(l)
def code(x, l, t):
	t_1 = 2.0 * math.pow(t, 2.0)
	tmp = 0
	if t <= -3.4e+87:
		tmp = (1.0 / x) + -1.0
	elif t <= -3e-163:
		tmp = t / (math.sqrt((((2.0 * (math.pow(t, 2.0) / x)) + (t_1 + (math.pow(l, 2.0) / x))) + ((t_1 + math.pow(l, 2.0)) / x))) / math.sqrt(2.0))
	elif t <= -6.6e-254:
		tmp = -1.0
	elif t <= 4.1e-211:
		tmp = (t / l) * math.sqrt(x)
	else:
		tmp = math.sqrt(((x + -1.0) / (1.0 + x)))
	return tmp
l = abs(l)
function code(x, l, t)
	t_1 = Float64(2.0 * (t ^ 2.0))
	tmp = 0.0
	if (t <= -3.4e+87)
		tmp = Float64(Float64(1.0 / x) + -1.0);
	elseif (t <= -3e-163)
		tmp = Float64(t / Float64(sqrt(Float64(Float64(Float64(2.0 * Float64((t ^ 2.0) / x)) + Float64(t_1 + Float64((l ^ 2.0) / x))) + Float64(Float64(t_1 + (l ^ 2.0)) / x))) / sqrt(2.0)));
	elseif (t <= -6.6e-254)
		tmp = -1.0;
	elseif (t <= 4.1e-211)
		tmp = Float64(Float64(t / l) * sqrt(x));
	else
		tmp = sqrt(Float64(Float64(x + -1.0) / Float64(1.0 + x)));
	end
	return tmp
end
l = abs(l)
function tmp_2 = code(x, l, t)
	t_1 = 2.0 * (t ^ 2.0);
	tmp = 0.0;
	if (t <= -3.4e+87)
		tmp = (1.0 / x) + -1.0;
	elseif (t <= -3e-163)
		tmp = t / (sqrt((((2.0 * ((t ^ 2.0) / x)) + (t_1 + ((l ^ 2.0) / x))) + ((t_1 + (l ^ 2.0)) / x))) / sqrt(2.0));
	elseif (t <= -6.6e-254)
		tmp = -1.0;
	elseif (t <= 4.1e-211)
		tmp = (t / l) * sqrt(x);
	else
		tmp = sqrt(((x + -1.0) / (1.0 + x)));
	end
	tmp_2 = tmp;
end
NOTE: l should be positive before calling this function
code[x_, l_, t_] := Block[{t$95$1 = N[(2.0 * N[Power[t, 2.0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -3.4e+87], N[(N[(1.0 / x), $MachinePrecision] + -1.0), $MachinePrecision], If[LessEqual[t, -3e-163], N[(t / N[(N[Sqrt[N[(N[(N[(2.0 * N[(N[Power[t, 2.0], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 + N[(N[Power[l, 2.0], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 + N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -6.6e-254], -1.0, If[LessEqual[t, 4.1e-211], N[(N[(t / l), $MachinePrecision] * N[Sqrt[x], $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(1.0 + x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := 2 \cdot {t}^{2}\\
\mathbf{if}\;t \leq -3.4 \cdot 10^{+87}:\\
\;\;\;\;\frac{1}{x} + -1\\

\mathbf{elif}\;t \leq -3 \cdot 10^{-163}:\\
\;\;\;\;\frac{t}{\frac{\sqrt{\left(2 \cdot \frac{{t}^{2}}{x} + \left(t_1 + \frac{{\ell}^{2}}{x}\right)\right) + \frac{t_1 + {\ell}^{2}}{x}}}{\sqrt{2}}}\\

\mathbf{elif}\;t \leq -6.6 \cdot 10^{-254}:\\
\;\;\;\;-1\\

\mathbf{elif}\;t \leq 4.1 \cdot 10^{-211}:\\
\;\;\;\;\frac{t}{\ell} \cdot \sqrt{x}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if t < -3.4000000000000002e87

    1. Initial program 33.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. Simplified33.2%

      \[\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 100.0%

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

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

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

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

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

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

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

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

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

    if -3.4000000000000002e87 < t < -3.0000000000000002e-163

    1. Initial program 47.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. Simplified47.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 81.6%

      \[\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 -3.0000000000000002e-163 < t < -6.60000000000000033e-254

    1. Initial program 2.6%

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

      \[\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 69.3%

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

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

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

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

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

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

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

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

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

    if -6.60000000000000033e-254 < t < 4.1000000000000002e-211

    1. Initial program 1.7%

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

      \[\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 61.0%

      \[\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 60.8%

      \[\leadsto \frac{t}{\frac{\color{blue}{\sqrt{\frac{{\ell}^{2}}{x} - -1 \cdot \frac{{\ell}^{2}}{x}}}}{\sqrt{2}}} \]
    5. Step-by-step derivation
      1. cancel-sign-sub-inv60.8%

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

        \[\leadsto \frac{t}{\frac{\sqrt{\frac{{\ell}^{2}}{x} + \color{blue}{1} \cdot \frac{{\ell}^{2}}{x}}}{\sqrt{2}}} \]
      3. distribute-rgt1-in60.8%

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

        \[\leadsto \frac{t}{\frac{\sqrt{\color{blue}{2} \cdot \frac{{\ell}^{2}}{x}}}{\sqrt{2}}} \]
    6. Simplified60.8%

      \[\leadsto \frac{t}{\frac{\color{blue}{\sqrt{2 \cdot \frac{{\ell}^{2}}{x}}}}{\sqrt{2}}} \]
    7. Taylor expanded in t around 0 50.2%

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

    if 4.1000000000000002e-211 < t

    1. Initial program 38.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. Simplified39.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 85.9%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -3.4 \cdot 10^{+87}:\\ \;\;\;\;\frac{1}{x} + -1\\ \mathbf{elif}\;t \leq -3 \cdot 10^{-163}:\\ \;\;\;\;\frac{t}{\frac{\sqrt{\left(2 \cdot \frac{{t}^{2}}{x} + \left(2 \cdot {t}^{2} + \frac{{\ell}^{2}}{x}\right)\right) + \frac{2 \cdot {t}^{2} + {\ell}^{2}}{x}}}{\sqrt{2}}}\\ \mathbf{elif}\;t \leq -6.6 \cdot 10^{-254}:\\ \;\;\;\;-1\\ \mathbf{elif}\;t \leq 4.1 \cdot 10^{-211}:\\ \;\;\;\;\frac{t}{\ell} \cdot \sqrt{x}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{x + -1}{1 + x}}\\ \end{array} \]

Alternative 2: 77.4% accurate, 1.0× speedup?

\[\begin{array}{l} l = |l|\\ \\ \begin{array}{l} \mathbf{if}\;t \leq -2.95 \cdot 10^{-92}:\\ \;\;\;\;\frac{1}{x} + -1\\ \mathbf{elif}\;t \leq -1.26 \cdot 10^{-163}:\\ \;\;\;\;\frac{t}{\sqrt{\frac{1}{x} + \frac{1}{x + -1}} \cdot \frac{\ell}{\sqrt{2}}}\\ \mathbf{elif}\;t \leq -2.25 \cdot 10^{-247}:\\ \;\;\;\;-1\\ \mathbf{elif}\;t \leq 6.6 \cdot 10^{-212}:\\ \;\;\;\;\frac{t}{\ell} \cdot \sqrt{x}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{x + -1}{1 + x}}\\ \end{array} \end{array} \]
NOTE: l should be positive before calling this function
(FPCore (x l t)
 :precision binary64
 (if (<= t -2.95e-92)
   (+ (/ 1.0 x) -1.0)
   (if (<= t -1.26e-163)
     (/ t (* (sqrt (+ (/ 1.0 x) (/ 1.0 (+ x -1.0)))) (/ l (sqrt 2.0))))
     (if (<= t -2.25e-247)
       -1.0
       (if (<= t 6.6e-212)
         (* (/ t l) (sqrt x))
         (sqrt (/ (+ x -1.0) (+ 1.0 x))))))))
l = abs(l);
double code(double x, double l, double t) {
	double tmp;
	if (t <= -2.95e-92) {
		tmp = (1.0 / x) + -1.0;
	} else if (t <= -1.26e-163) {
		tmp = t / (sqrt(((1.0 / x) + (1.0 / (x + -1.0)))) * (l / sqrt(2.0)));
	} else if (t <= -2.25e-247) {
		tmp = -1.0;
	} else if (t <= 6.6e-212) {
		tmp = (t / l) * sqrt(x);
	} else {
		tmp = sqrt(((x + -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 <= (-2.95d-92)) then
        tmp = (1.0d0 / x) + (-1.0d0)
    else if (t <= (-1.26d-163)) then
        tmp = t / (sqrt(((1.0d0 / x) + (1.0d0 / (x + (-1.0d0))))) * (l / sqrt(2.0d0)))
    else if (t <= (-2.25d-247)) then
        tmp = -1.0d0
    else if (t <= 6.6d-212) then
        tmp = (t / l) * sqrt(x)
    else
        tmp = sqrt(((x + (-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 <= -2.95e-92) {
		tmp = (1.0 / x) + -1.0;
	} else if (t <= -1.26e-163) {
		tmp = t / (Math.sqrt(((1.0 / x) + (1.0 / (x + -1.0)))) * (l / Math.sqrt(2.0)));
	} else if (t <= -2.25e-247) {
		tmp = -1.0;
	} else if (t <= 6.6e-212) {
		tmp = (t / l) * Math.sqrt(x);
	} else {
		tmp = Math.sqrt(((x + -1.0) / (1.0 + x)));
	}
	return tmp;
}
l = abs(l)
def code(x, l, t):
	tmp = 0
	if t <= -2.95e-92:
		tmp = (1.0 / x) + -1.0
	elif t <= -1.26e-163:
		tmp = t / (math.sqrt(((1.0 / x) + (1.0 / (x + -1.0)))) * (l / math.sqrt(2.0)))
	elif t <= -2.25e-247:
		tmp = -1.0
	elif t <= 6.6e-212:
		tmp = (t / l) * math.sqrt(x)
	else:
		tmp = math.sqrt(((x + -1.0) / (1.0 + x)))
	return tmp
l = abs(l)
function code(x, l, t)
	tmp = 0.0
	if (t <= -2.95e-92)
		tmp = Float64(Float64(1.0 / x) + -1.0);
	elseif (t <= -1.26e-163)
		tmp = Float64(t / Float64(sqrt(Float64(Float64(1.0 / x) + Float64(1.0 / Float64(x + -1.0)))) * Float64(l / sqrt(2.0))));
	elseif (t <= -2.25e-247)
		tmp = -1.0;
	elseif (t <= 6.6e-212)
		tmp = Float64(Float64(t / l) * sqrt(x));
	else
		tmp = sqrt(Float64(Float64(x + -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 <= -2.95e-92)
		tmp = (1.0 / x) + -1.0;
	elseif (t <= -1.26e-163)
		tmp = t / (sqrt(((1.0 / x) + (1.0 / (x + -1.0)))) * (l / sqrt(2.0)));
	elseif (t <= -2.25e-247)
		tmp = -1.0;
	elseif (t <= 6.6e-212)
		tmp = (t / l) * sqrt(x);
	else
		tmp = sqrt(((x + -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, -2.95e-92], N[(N[(1.0 / x), $MachinePrecision] + -1.0), $MachinePrecision], If[LessEqual[t, -1.26e-163], N[(t / N[(N[Sqrt[N[(N[(1.0 / x), $MachinePrecision] + N[(1.0 / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(l / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -2.25e-247], -1.0, If[LessEqual[t, 6.6e-212], N[(N[(t / l), $MachinePrecision] * N[Sqrt[x], $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(1.0 + x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.95 \cdot 10^{-92}:\\
\;\;\;\;\frac{1}{x} + -1\\

\mathbf{elif}\;t \leq -1.26 \cdot 10^{-163}:\\
\;\;\;\;\frac{t}{\sqrt{\frac{1}{x} + \frac{1}{x + -1}} \cdot \frac{\ell}{\sqrt{2}}}\\

\mathbf{elif}\;t \leq -2.25 \cdot 10^{-247}:\\
\;\;\;\;-1\\

\mathbf{elif}\;t \leq 6.6 \cdot 10^{-212}:\\
\;\;\;\;\frac{t}{\ell} \cdot \sqrt{x}\\

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


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

    1. Initial program 43.6%

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

      \[\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 91.2%

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

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

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

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

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

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

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

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

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

    if -2.95e-92 < t < -1.26000000000000002e-163

    1. Initial program 9.2%

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

      \[\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 l around inf 1.7%

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

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

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

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

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

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

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

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

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

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

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

    if -1.26000000000000002e-163 < t < -2.2500000000000001e-247

    1. Initial program 2.6%

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

      \[\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 69.3%

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

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

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

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

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

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

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

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

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

    if -2.2500000000000001e-247 < t < 6.6000000000000004e-212

    1. Initial program 1.7%

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

      \[\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 61.0%

      \[\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 60.8%

      \[\leadsto \frac{t}{\frac{\color{blue}{\sqrt{\frac{{\ell}^{2}}{x} - -1 \cdot \frac{{\ell}^{2}}{x}}}}{\sqrt{2}}} \]
    5. Step-by-step derivation
      1. cancel-sign-sub-inv60.8%

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

        \[\leadsto \frac{t}{\frac{\sqrt{\frac{{\ell}^{2}}{x} + \color{blue}{1} \cdot \frac{{\ell}^{2}}{x}}}{\sqrt{2}}} \]
      3. distribute-rgt1-in60.8%

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

        \[\leadsto \frac{t}{\frac{\sqrt{\color{blue}{2} \cdot \frac{{\ell}^{2}}{x}}}{\sqrt{2}}} \]
    6. Simplified60.8%

      \[\leadsto \frac{t}{\frac{\color{blue}{\sqrt{2 \cdot \frac{{\ell}^{2}}{x}}}}{\sqrt{2}}} \]
    7. Taylor expanded in t around 0 50.2%

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

    if 6.6000000000000004e-212 < t

    1. Initial program 38.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. Simplified39.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 85.9%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -2.95 \cdot 10^{-92}:\\ \;\;\;\;\frac{1}{x} + -1\\ \mathbf{elif}\;t \leq -1.26 \cdot 10^{-163}:\\ \;\;\;\;\frac{t}{\sqrt{\frac{1}{x} + \frac{1}{x + -1}} \cdot \frac{\ell}{\sqrt{2}}}\\ \mathbf{elif}\;t \leq -2.25 \cdot 10^{-247}:\\ \;\;\;\;-1\\ \mathbf{elif}\;t \leq 6.6 \cdot 10^{-212}:\\ \;\;\;\;\frac{t}{\ell} \cdot \sqrt{x}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{x + -1}{1 + x}}\\ \end{array} \]

Alternative 3: 76.8% accurate, 1.1× speedup?

\[\begin{array}{l} l = |l|\\ \\ \begin{array}{l} \mathbf{if}\;t \leq -1.6 \cdot 10^{-81}:\\ \;\;\;\;\frac{1}{x} + -1\\ \mathbf{elif}\;t \leq -3.2 \cdot 10^{-163}:\\ \;\;\;\;\sqrt{x \cdot 0.5} \cdot \frac{t}{\frac{\ell}{\sqrt{2}}}\\ \mathbf{elif}\;t \leq -4.4 \cdot 10^{-245}:\\ \;\;\;\;-1\\ \mathbf{elif}\;t \leq 7.2 \cdot 10^{-212}:\\ \;\;\;\;\frac{t}{\ell} \cdot \sqrt{x}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{x + -1}{1 + x}}\\ \end{array} \end{array} \]
NOTE: l should be positive before calling this function
(FPCore (x l t)
 :precision binary64
 (if (<= t -1.6e-81)
   (+ (/ 1.0 x) -1.0)
   (if (<= t -3.2e-163)
     (* (sqrt (* x 0.5)) (/ t (/ l (sqrt 2.0))))
     (if (<= t -4.4e-245)
       -1.0
       (if (<= t 7.2e-212)
         (* (/ t l) (sqrt x))
         (sqrt (/ (+ x -1.0) (+ 1.0 x))))))))
l = abs(l);
double code(double x, double l, double t) {
	double tmp;
	if (t <= -1.6e-81) {
		tmp = (1.0 / x) + -1.0;
	} else if (t <= -3.2e-163) {
		tmp = sqrt((x * 0.5)) * (t / (l / sqrt(2.0)));
	} else if (t <= -4.4e-245) {
		tmp = -1.0;
	} else if (t <= 7.2e-212) {
		tmp = (t / l) * sqrt(x);
	} else {
		tmp = sqrt(((x + -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 <= (-1.6d-81)) then
        tmp = (1.0d0 / x) + (-1.0d0)
    else if (t <= (-3.2d-163)) then
        tmp = sqrt((x * 0.5d0)) * (t / (l / sqrt(2.0d0)))
    else if (t <= (-4.4d-245)) then
        tmp = -1.0d0
    else if (t <= 7.2d-212) then
        tmp = (t / l) * sqrt(x)
    else
        tmp = sqrt(((x + (-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 <= -1.6e-81) {
		tmp = (1.0 / x) + -1.0;
	} else if (t <= -3.2e-163) {
		tmp = Math.sqrt((x * 0.5)) * (t / (l / Math.sqrt(2.0)));
	} else if (t <= -4.4e-245) {
		tmp = -1.0;
	} else if (t <= 7.2e-212) {
		tmp = (t / l) * Math.sqrt(x);
	} else {
		tmp = Math.sqrt(((x + -1.0) / (1.0 + x)));
	}
	return tmp;
}
l = abs(l)
def code(x, l, t):
	tmp = 0
	if t <= -1.6e-81:
		tmp = (1.0 / x) + -1.0
	elif t <= -3.2e-163:
		tmp = math.sqrt((x * 0.5)) * (t / (l / math.sqrt(2.0)))
	elif t <= -4.4e-245:
		tmp = -1.0
	elif t <= 7.2e-212:
		tmp = (t / l) * math.sqrt(x)
	else:
		tmp = math.sqrt(((x + -1.0) / (1.0 + x)))
	return tmp
l = abs(l)
function code(x, l, t)
	tmp = 0.0
	if (t <= -1.6e-81)
		tmp = Float64(Float64(1.0 / x) + -1.0);
	elseif (t <= -3.2e-163)
		tmp = Float64(sqrt(Float64(x * 0.5)) * Float64(t / Float64(l / sqrt(2.0))));
	elseif (t <= -4.4e-245)
		tmp = -1.0;
	elseif (t <= 7.2e-212)
		tmp = Float64(Float64(t / l) * sqrt(x));
	else
		tmp = sqrt(Float64(Float64(x + -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 <= -1.6e-81)
		tmp = (1.0 / x) + -1.0;
	elseif (t <= -3.2e-163)
		tmp = sqrt((x * 0.5)) * (t / (l / sqrt(2.0)));
	elseif (t <= -4.4e-245)
		tmp = -1.0;
	elseif (t <= 7.2e-212)
		tmp = (t / l) * sqrt(x);
	else
		tmp = sqrt(((x + -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, -1.6e-81], N[(N[(1.0 / x), $MachinePrecision] + -1.0), $MachinePrecision], If[LessEqual[t, -3.2e-163], N[(N[Sqrt[N[(x * 0.5), $MachinePrecision]], $MachinePrecision] * N[(t / N[(l / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -4.4e-245], -1.0, If[LessEqual[t, 7.2e-212], N[(N[(t / l), $MachinePrecision] * N[Sqrt[x], $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(1.0 + x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.6 \cdot 10^{-81}:\\
\;\;\;\;\frac{1}{x} + -1\\

\mathbf{elif}\;t \leq -3.2 \cdot 10^{-163}:\\
\;\;\;\;\sqrt{x \cdot 0.5} \cdot \frac{t}{\frac{\ell}{\sqrt{2}}}\\

\mathbf{elif}\;t \leq -4.4 \cdot 10^{-245}:\\
\;\;\;\;-1\\

\mathbf{elif}\;t \leq 7.2 \cdot 10^{-212}:\\
\;\;\;\;\frac{t}{\ell} \cdot \sqrt{x}\\

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


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

    1. Initial program 43.6%

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

      \[\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 91.2%

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

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

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

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

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

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

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

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

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

    if -1.6e-81 < t < -3.19999999999999988e-163

    1. Initial program 9.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.19999999999999988e-163 < t < -4.39999999999999986e-245

    1. Initial program 2.6%

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

      \[\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 69.3%

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

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

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

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

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

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

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

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

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

    if -4.39999999999999986e-245 < t < 7.2000000000000002e-212

    1. Initial program 1.7%

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

      \[\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 61.0%

      \[\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 60.8%

      \[\leadsto \frac{t}{\frac{\color{blue}{\sqrt{\frac{{\ell}^{2}}{x} - -1 \cdot \frac{{\ell}^{2}}{x}}}}{\sqrt{2}}} \]
    5. Step-by-step derivation
      1. cancel-sign-sub-inv60.8%

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

        \[\leadsto \frac{t}{\frac{\sqrt{\frac{{\ell}^{2}}{x} + \color{blue}{1} \cdot \frac{{\ell}^{2}}{x}}}{\sqrt{2}}} \]
      3. distribute-rgt1-in60.8%

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

        \[\leadsto \frac{t}{\frac{\sqrt{\color{blue}{2} \cdot \frac{{\ell}^{2}}{x}}}{\sqrt{2}}} \]
    6. Simplified60.8%

      \[\leadsto \frac{t}{\frac{\color{blue}{\sqrt{2 \cdot \frac{{\ell}^{2}}{x}}}}{\sqrt{2}}} \]
    7. Taylor expanded in t around 0 50.2%

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

    if 7.2000000000000002e-212 < t

    1. Initial program 38.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. Simplified39.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 85.9%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.6 \cdot 10^{-81}:\\ \;\;\;\;\frac{1}{x} + -1\\ \mathbf{elif}\;t \leq -3.2 \cdot 10^{-163}:\\ \;\;\;\;\sqrt{x \cdot 0.5} \cdot \frac{t}{\frac{\ell}{\sqrt{2}}}\\ \mathbf{elif}\;t \leq -4.4 \cdot 10^{-245}:\\ \;\;\;\;-1\\ \mathbf{elif}\;t \leq 7.2 \cdot 10^{-212}:\\ \;\;\;\;\frac{t}{\ell} \cdot \sqrt{x}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{x + -1}{1 + x}}\\ \end{array} \]

Alternative 4: 77.0% accurate, 2.0× speedup?

\[\begin{array}{l} l = |l|\\ \\ \begin{array}{l} t_1 := \frac{t}{\ell} \cdot \sqrt{x}\\ \mathbf{if}\;t \leq -4.3 \cdot 10^{-92}:\\ \;\;\;\;\frac{1}{x} + -1\\ \mathbf{elif}\;t \leq -1.65 \cdot 10^{-163}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq -2.7 \cdot 10^{-250}:\\ \;\;\;\;-1\\ \mathbf{elif}\;t \leq 5 \cdot 10^{-212}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{x + -1}{1 + x}}\\ \end{array} \end{array} \]
NOTE: l should be positive before calling this function
(FPCore (x l t)
 :precision binary64
 (let* ((t_1 (* (/ t l) (sqrt x))))
   (if (<= t -4.3e-92)
     (+ (/ 1.0 x) -1.0)
     (if (<= t -1.65e-163)
       t_1
       (if (<= t -2.7e-250)
         -1.0
         (if (<= t 5e-212) t_1 (sqrt (/ (+ x -1.0) (+ 1.0 x)))))))))
l = abs(l);
double code(double x, double l, double t) {
	double t_1 = (t / l) * sqrt(x);
	double tmp;
	if (t <= -4.3e-92) {
		tmp = (1.0 / x) + -1.0;
	} else if (t <= -1.65e-163) {
		tmp = t_1;
	} else if (t <= -2.7e-250) {
		tmp = -1.0;
	} else if (t <= 5e-212) {
		tmp = t_1;
	} else {
		tmp = sqrt(((x + -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) :: t_1
    real(8) :: tmp
    t_1 = (t / l) * sqrt(x)
    if (t <= (-4.3d-92)) then
        tmp = (1.0d0 / x) + (-1.0d0)
    else if (t <= (-1.65d-163)) then
        tmp = t_1
    else if (t <= (-2.7d-250)) then
        tmp = -1.0d0
    else if (t <= 5d-212) then
        tmp = t_1
    else
        tmp = sqrt(((x + (-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 t_1 = (t / l) * Math.sqrt(x);
	double tmp;
	if (t <= -4.3e-92) {
		tmp = (1.0 / x) + -1.0;
	} else if (t <= -1.65e-163) {
		tmp = t_1;
	} else if (t <= -2.7e-250) {
		tmp = -1.0;
	} else if (t <= 5e-212) {
		tmp = t_1;
	} else {
		tmp = Math.sqrt(((x + -1.0) / (1.0 + x)));
	}
	return tmp;
}
l = abs(l)
def code(x, l, t):
	t_1 = (t / l) * math.sqrt(x)
	tmp = 0
	if t <= -4.3e-92:
		tmp = (1.0 / x) + -1.0
	elif t <= -1.65e-163:
		tmp = t_1
	elif t <= -2.7e-250:
		tmp = -1.0
	elif t <= 5e-212:
		tmp = t_1
	else:
		tmp = math.sqrt(((x + -1.0) / (1.0 + x)))
	return tmp
l = abs(l)
function code(x, l, t)
	t_1 = Float64(Float64(t / l) * sqrt(x))
	tmp = 0.0
	if (t <= -4.3e-92)
		tmp = Float64(Float64(1.0 / x) + -1.0);
	elseif (t <= -1.65e-163)
		tmp = t_1;
	elseif (t <= -2.7e-250)
		tmp = -1.0;
	elseif (t <= 5e-212)
		tmp = t_1;
	else
		tmp = sqrt(Float64(Float64(x + -1.0) / Float64(1.0 + x)));
	end
	return tmp
end
l = abs(l)
function tmp_2 = code(x, l, t)
	t_1 = (t / l) * sqrt(x);
	tmp = 0.0;
	if (t <= -4.3e-92)
		tmp = (1.0 / x) + -1.0;
	elseif (t <= -1.65e-163)
		tmp = t_1;
	elseif (t <= -2.7e-250)
		tmp = -1.0;
	elseif (t <= 5e-212)
		tmp = t_1;
	else
		tmp = sqrt(((x + -1.0) / (1.0 + x)));
	end
	tmp_2 = tmp;
end
NOTE: l should be positive before calling this function
code[x_, l_, t_] := Block[{t$95$1 = N[(N[(t / l), $MachinePrecision] * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -4.3e-92], N[(N[(1.0 / x), $MachinePrecision] + -1.0), $MachinePrecision], If[LessEqual[t, -1.65e-163], t$95$1, If[LessEqual[t, -2.7e-250], -1.0, If[LessEqual[t, 5e-212], t$95$1, N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(1.0 + x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \frac{t}{\ell} \cdot \sqrt{x}\\
\mathbf{if}\;t \leq -4.3 \cdot 10^{-92}:\\
\;\;\;\;\frac{1}{x} + -1\\

\mathbf{elif}\;t \leq -1.65 \cdot 10^{-163}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;t \leq -2.7 \cdot 10^{-250}:\\
\;\;\;\;-1\\

\mathbf{elif}\;t \leq 5 \cdot 10^{-212}:\\
\;\;\;\;t_1\\

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


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

    1. Initial program 43.6%

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

      \[\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 91.2%

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

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

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

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

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

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

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

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

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

    if -4.30000000000000014e-92 < t < -1.65e-163 or -2.70000000000000002e-250 < t < 5.00000000000000043e-212

    1. Initial program 4.2%

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

      \[\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 66.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 t around 0 58.9%

      \[\leadsto \frac{t}{\frac{\color{blue}{\sqrt{\frac{{\ell}^{2}}{x} - -1 \cdot \frac{{\ell}^{2}}{x}}}}{\sqrt{2}}} \]
    5. Step-by-step derivation
      1. cancel-sign-sub-inv58.9%

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

        \[\leadsto \frac{t}{\frac{\sqrt{\frac{{\ell}^{2}}{x} + \color{blue}{1} \cdot \frac{{\ell}^{2}}{x}}}{\sqrt{2}}} \]
      3. distribute-rgt1-in58.9%

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

        \[\leadsto \frac{t}{\frac{\sqrt{\color{blue}{2} \cdot \frac{{\ell}^{2}}{x}}}{\sqrt{2}}} \]
    6. Simplified58.9%

      \[\leadsto \frac{t}{\frac{\color{blue}{\sqrt{2 \cdot \frac{{\ell}^{2}}{x}}}}{\sqrt{2}}} \]
    7. Taylor expanded in t around 0 47.8%

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

    if -1.65e-163 < t < -2.70000000000000002e-250

    1. Initial program 2.6%

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

      \[\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 69.3%

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

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

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

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

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

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

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

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

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

    if 5.00000000000000043e-212 < t

    1. Initial program 38.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. Simplified39.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 85.9%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -4.3 \cdot 10^{-92}:\\ \;\;\;\;\frac{1}{x} + -1\\ \mathbf{elif}\;t \leq -1.65 \cdot 10^{-163}:\\ \;\;\;\;\frac{t}{\ell} \cdot \sqrt{x}\\ \mathbf{elif}\;t \leq -2.7 \cdot 10^{-250}:\\ \;\;\;\;-1\\ \mathbf{elif}\;t \leq 5 \cdot 10^{-212}:\\ \;\;\;\;\frac{t}{\ell} \cdot \sqrt{x}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{x + -1}{1 + x}}\\ \end{array} \]

Alternative 5: 76.9% accurate, 2.0× speedup?

\[\begin{array}{l} l = |l|\\ \\ \begin{array}{l} t_1 := \frac{t}{\ell} \cdot \sqrt{x}\\ \mathbf{if}\;t \leq -1.38 \cdot 10^{-92}:\\ \;\;\;\;\frac{1}{x} + -1\\ \mathbf{elif}\;t \leq -1.06 \cdot 10^{-163}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq -8.8 \cdot 10^{-245}:\\ \;\;\;\;-1\\ \mathbf{elif}\;t \leq 3.2 \cdot 10^{-211}:\\ \;\;\;\;t_1\\ \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
 (let* ((t_1 (* (/ t l) (sqrt x))))
   (if (<= t -1.38e-92)
     (+ (/ 1.0 x) -1.0)
     (if (<= t -1.06e-163)
       t_1
       (if (<= t -8.8e-245)
         -1.0
         (if (<= t 3.2e-211) t_1 (+ 1.0 (/ -1.0 x))))))))
l = abs(l);
double code(double x, double l, double t) {
	double t_1 = (t / l) * sqrt(x);
	double tmp;
	if (t <= -1.38e-92) {
		tmp = (1.0 / x) + -1.0;
	} else if (t <= -1.06e-163) {
		tmp = t_1;
	} else if (t <= -8.8e-245) {
		tmp = -1.0;
	} else if (t <= 3.2e-211) {
		tmp = t_1;
	} 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) :: t_1
    real(8) :: tmp
    t_1 = (t / l) * sqrt(x)
    if (t <= (-1.38d-92)) then
        tmp = (1.0d0 / x) + (-1.0d0)
    else if (t <= (-1.06d-163)) then
        tmp = t_1
    else if (t <= (-8.8d-245)) then
        tmp = -1.0d0
    else if (t <= 3.2d-211) then
        tmp = t_1
    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 t_1 = (t / l) * Math.sqrt(x);
	double tmp;
	if (t <= -1.38e-92) {
		tmp = (1.0 / x) + -1.0;
	} else if (t <= -1.06e-163) {
		tmp = t_1;
	} else if (t <= -8.8e-245) {
		tmp = -1.0;
	} else if (t <= 3.2e-211) {
		tmp = t_1;
	} else {
		tmp = 1.0 + (-1.0 / x);
	}
	return tmp;
}
l = abs(l)
def code(x, l, t):
	t_1 = (t / l) * math.sqrt(x)
	tmp = 0
	if t <= -1.38e-92:
		tmp = (1.0 / x) + -1.0
	elif t <= -1.06e-163:
		tmp = t_1
	elif t <= -8.8e-245:
		tmp = -1.0
	elif t <= 3.2e-211:
		tmp = t_1
	else:
		tmp = 1.0 + (-1.0 / x)
	return tmp
l = abs(l)
function code(x, l, t)
	t_1 = Float64(Float64(t / l) * sqrt(x))
	tmp = 0.0
	if (t <= -1.38e-92)
		tmp = Float64(Float64(1.0 / x) + -1.0);
	elseif (t <= -1.06e-163)
		tmp = t_1;
	elseif (t <= -8.8e-245)
		tmp = -1.0;
	elseif (t <= 3.2e-211)
		tmp = t_1;
	else
		tmp = Float64(1.0 + Float64(-1.0 / x));
	end
	return tmp
end
l = abs(l)
function tmp_2 = code(x, l, t)
	t_1 = (t / l) * sqrt(x);
	tmp = 0.0;
	if (t <= -1.38e-92)
		tmp = (1.0 / x) + -1.0;
	elseif (t <= -1.06e-163)
		tmp = t_1;
	elseif (t <= -8.8e-245)
		tmp = -1.0;
	elseif (t <= 3.2e-211)
		tmp = t_1;
	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_] := Block[{t$95$1 = N[(N[(t / l), $MachinePrecision] * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.38e-92], N[(N[(1.0 / x), $MachinePrecision] + -1.0), $MachinePrecision], If[LessEqual[t, -1.06e-163], t$95$1, If[LessEqual[t, -8.8e-245], -1.0, If[LessEqual[t, 3.2e-211], t$95$1, N[(1.0 + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \frac{t}{\ell} \cdot \sqrt{x}\\
\mathbf{if}\;t \leq -1.38 \cdot 10^{-92}:\\
\;\;\;\;\frac{1}{x} + -1\\

\mathbf{elif}\;t \leq -1.06 \cdot 10^{-163}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;t \leq -8.8 \cdot 10^{-245}:\\
\;\;\;\;-1\\

\mathbf{elif}\;t \leq 3.2 \cdot 10^{-211}:\\
\;\;\;\;t_1\\

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


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

    1. Initial program 43.6%

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

      \[\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 91.2%

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

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

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

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

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

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

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

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

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

    if -1.38000000000000006e-92 < t < -1.06000000000000006e-163 or -8.79999999999999971e-245 < t < 3.19999999999999985e-211

    1. Initial program 4.2%

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

      \[\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 66.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 t around 0 58.9%

      \[\leadsto \frac{t}{\frac{\color{blue}{\sqrt{\frac{{\ell}^{2}}{x} - -1 \cdot \frac{{\ell}^{2}}{x}}}}{\sqrt{2}}} \]
    5. Step-by-step derivation
      1. cancel-sign-sub-inv58.9%

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

        \[\leadsto \frac{t}{\frac{\sqrt{\frac{{\ell}^{2}}{x} + \color{blue}{1} \cdot \frac{{\ell}^{2}}{x}}}{\sqrt{2}}} \]
      3. distribute-rgt1-in58.9%

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

        \[\leadsto \frac{t}{\frac{\sqrt{\color{blue}{2} \cdot \frac{{\ell}^{2}}{x}}}{\sqrt{2}}} \]
    6. Simplified58.9%

      \[\leadsto \frac{t}{\frac{\color{blue}{\sqrt{2 \cdot \frac{{\ell}^{2}}{x}}}}{\sqrt{2}}} \]
    7. Taylor expanded in t around 0 47.8%

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

    if -1.06000000000000006e-163 < t < -8.79999999999999971e-245

    1. Initial program 2.6%

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

      \[\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 69.3%

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

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

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

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

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

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

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

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

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

    if 3.19999999999999985e-211 < t

    1. Initial program 38.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. Simplified39.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 85.9%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.38 \cdot 10^{-92}:\\ \;\;\;\;\frac{1}{x} + -1\\ \mathbf{elif}\;t \leq -1.06 \cdot 10^{-163}:\\ \;\;\;\;\frac{t}{\ell} \cdot \sqrt{x}\\ \mathbf{elif}\;t \leq -8.8 \cdot 10^{-245}:\\ \;\;\;\;-1\\ \mathbf{elif}\;t \leq 3.2 \cdot 10^{-211}:\\ \;\;\;\;\frac{t}{\ell} \cdot \sqrt{x}\\ \mathbf{else}:\\ \;\;\;\;1 + \frac{-1}{x}\\ \end{array} \]

Alternative 6: 75.9% accurate, 31.9× speedup?

\[\begin{array}{l} l = |l|\\ \\ \begin{array}{l} \mathbf{if}\;t \leq -5 \cdot 10^{-310}:\\ \;\;\;\;-1\\ \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 -5e-310) -1.0 (+ 1.0 (/ -1.0 x))))
l = abs(l);
double code(double x, double l, double t) {
	double tmp;
	if (t <= -5e-310) {
		tmp = -1.0;
	} 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 <= (-5d-310)) then
        tmp = -1.0d0
    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 <= -5e-310) {
		tmp = -1.0;
	} else {
		tmp = 1.0 + (-1.0 / x);
	}
	return tmp;
}
l = abs(l)
def code(x, l, t):
	tmp = 0
	if t <= -5e-310:
		tmp = -1.0
	else:
		tmp = 1.0 + (-1.0 / x)
	return tmp
l = abs(l)
function code(x, l, t)
	tmp = 0.0
	if (t <= -5e-310)
		tmp = -1.0;
	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 <= -5e-310)
		tmp = -1.0;
	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, -5e-310], -1.0, N[(1.0 + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5 \cdot 10^{-310}:\\
\;\;\;\;-1\\

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


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

    1. Initial program 33.5%

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

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

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

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

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

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

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

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

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

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

    if -4.999999999999985e-310 < t

    1. Initial program 33.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. Simplified33.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 t around inf 77.3%

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

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

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

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

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

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

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

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

Alternative 7: 76.3% accurate, 31.9× speedup?

\[\begin{array}{l} l = |l|\\ \\ \begin{array}{l} \mathbf{if}\;t \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\frac{1}{x} + -1\\ \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 -5e-310) (+ (/ 1.0 x) -1.0) (+ 1.0 (/ -1.0 x))))
l = abs(l);
double code(double x, double l, double t) {
	double tmp;
	if (t <= -5e-310) {
		tmp = (1.0 / x) + -1.0;
	} 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 <= (-5d-310)) then
        tmp = (1.0d0 / x) + (-1.0d0)
    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 <= -5e-310) {
		tmp = (1.0 / x) + -1.0;
	} else {
		tmp = 1.0 + (-1.0 / x);
	}
	return tmp;
}
l = abs(l)
def code(x, l, t):
	tmp = 0
	if t <= -5e-310:
		tmp = (1.0 / x) + -1.0
	else:
		tmp = 1.0 + (-1.0 / x)
	return tmp
l = abs(l)
function code(x, l, t)
	tmp = 0.0
	if (t <= -5e-310)
		tmp = Float64(Float64(1.0 / x) + -1.0);
	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 <= -5e-310)
		tmp = (1.0 / x) + -1.0;
	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, -5e-310], N[(N[(1.0 / x), $MachinePrecision] + -1.0), $MachinePrecision], N[(1.0 + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\frac{1}{x} + -1\\

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


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

    1. Initial program 33.5%

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

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

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

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

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

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

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

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

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

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

    if -4.999999999999985e-310 < t

    1. Initial program 33.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. Simplified33.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 t around inf 77.3%

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

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

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

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

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

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

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

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

Alternative 8: 75.6% accurate, 73.5× speedup?

\[\begin{array}{l} l = |l|\\ \\ \begin{array}{l} \mathbf{if}\;t \leq -5 \cdot 10^{-310}:\\ \;\;\;\;-1\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \end{array} \]
NOTE: l should be positive before calling this function
(FPCore (x l t) :precision binary64 (if (<= t -5e-310) -1.0 1.0))
l = abs(l);
double code(double x, double l, double t) {
	double tmp;
	if (t <= -5e-310) {
		tmp = -1.0;
	} 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 <= (-5d-310)) then
        tmp = -1.0d0
    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 <= -5e-310) {
		tmp = -1.0;
	} else {
		tmp = 1.0;
	}
	return tmp;
}
l = abs(l)
def code(x, l, t):
	tmp = 0
	if t <= -5e-310:
		tmp = -1.0
	else:
		tmp = 1.0
	return tmp
l = abs(l)
function code(x, l, t)
	tmp = 0.0
	if (t <= -5e-310)
		tmp = -1.0;
	else
		tmp = 1.0;
	end
	return tmp
end
l = abs(l)
function tmp_2 = code(x, l, t)
	tmp = 0.0;
	if (t <= -5e-310)
		tmp = -1.0;
	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, -5e-310], -1.0, 1.0]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5 \cdot 10^{-310}:\\
\;\;\;\;-1\\

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


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

    1. Initial program 33.5%

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

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

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

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

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

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

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

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

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

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

    if -4.999999999999985e-310 < t

    1. Initial program 33.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. Simplified33.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 t around -inf 1.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto t \cdot \frac{1}{-1 \cdot \left(\color{blue}{-1} \cdot t\right)} \]
      4. associate-*r*75.1%

        \[\leadsto t \cdot \frac{1}{\color{blue}{\left(-1 \cdot -1\right) \cdot t}} \]
      5. metadata-eval75.1%

        \[\leadsto t \cdot \frac{1}{\color{blue}{1} \cdot t} \]
      6. *-lft-identity75.1%

        \[\leadsto t \cdot \frac{1}{\color{blue}{t}} \]
    10. Simplified75.1%

      \[\leadsto t \cdot \frac{1}{\color{blue}{t}} \]
    11. Taylor expanded in t around 0 75.3%

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

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

Alternative 9: 38.3% 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 33.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. Simplified33.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 t around -inf 41.4%

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{-1} \]
  7. Final simplification41.1%

    \[\leadsto -1 \]

Reproduce

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