Toniolo and Linder, Equation (7)

Percentage Accurate: 34.3% → 81.3%
Time: 23.5s
Alternatives: 10
Speedup: 225.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 10 alternatives:

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

Initial Program: 34.3% 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.3% accurate, 0.5× speedup?

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

\mathbf{elif}\;t \leq 5.8 \cdot 10^{-291}:\\
\;\;\;\;\frac{t_1}{\ell \cdot \sqrt{\frac{2}{x} + \frac{\frac{2}{x}}{x}}}\\

\mathbf{elif}\;t \leq 6.3 \cdot 10^{-90}:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{\mathsf{fma}\left(0.5, \frac{\ell \cdot \ell + \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t + t \cdot t\right)\right)}{\sqrt{2} \cdot \left(t \cdot x\right)}, t_1\right)}\\

\mathbf{else}:\\
\;\;\;\;t_2\\


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

    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. Step-by-step derivation
      1. associate-*l/38.9%

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

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

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

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

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

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

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

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

    if -1.2e-192 < t < 5.80000000000000003e-291

    1. Initial program 8.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. Step-by-step derivation
      1. associate-*r/8.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{2} \cdot \frac{t}{\ell \cdot \sqrt{\color{blue}{\frac{2 \cdot 1}{{x}^{2}}} + 2 \cdot \frac{1}{x}}} \]
      2. metadata-eval56.1%

        \[\leadsto \sqrt{2} \cdot \frac{t}{\ell \cdot \sqrt{\frac{\color{blue}{2}}{{x}^{2}} + 2 \cdot \frac{1}{x}}} \]
      3. unpow256.1%

        \[\leadsto \sqrt{2} \cdot \frac{t}{\ell \cdot \sqrt{\frac{2}{\color{blue}{x \cdot x}} + 2 \cdot \frac{1}{x}}} \]
      4. associate-*r/56.1%

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

        \[\leadsto \sqrt{2} \cdot \frac{t}{\ell \cdot \sqrt{\frac{2}{x \cdot x} + \frac{\color{blue}{2}}{x}}} \]
    9. Simplified56.1%

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

        \[\leadsto \color{blue}{\frac{\sqrt{2} \cdot t}{\ell \cdot \sqrt{\frac{2}{x \cdot x} + \frac{2}{x}}}} \]
      2. associate-/r*56.0%

        \[\leadsto \frac{\sqrt{2} \cdot t}{\ell \cdot \sqrt{\color{blue}{\frac{\frac{2}{x}}{x}} + \frac{2}{x}}} \]
    11. Applied egg-rr56.0%

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

    if 5.80000000000000003e-291 < t < 6.29999999999999977e-90

    1. Initial program 23.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. Step-by-step derivation
      1. associate-*l/23.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt{2}}{\mathsf{fma}\left(0.5, \frac{\ell \cdot \ell + \left(2 \cdot \left(t \cdot t - \left(-t \cdot t\right)\right) - \left(-\color{blue}{\ell \cdot \ell}\right)\right)}{\sqrt{2} \cdot \left(t \cdot x\right)}, \sqrt{2} \cdot t\right)} \cdot t \]
      9. distribute-rgt-neg-in83.1%

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

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

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

    if 6.29999999999999977e-90 < t

    1. Initial program 44.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. Step-by-step derivation
      1. associate-*l/44.7%

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

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

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

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

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

Alternative 2: 80.0% accurate, 1.0× speedup?

\[\begin{array}{l} l = |l|\\ \\ \begin{array}{l} t_1 := \sqrt{\frac{x + -1}{x + 1}}\\ \mathbf{if}\;t \leq -7 \cdot 10^{-194}:\\ \;\;\;\;-t_1\\ \mathbf{elif}\;t \leq 3.15 \cdot 10^{-276}:\\ \;\;\;\;\sqrt{2} \cdot \frac{t}{\ell \cdot \sqrt{\frac{2}{x} + \frac{2}{x \cdot 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 -7e-194)
     (- t_1)
     (if (<= t 3.15e-276)
       (* (sqrt 2.0) (/ t (* l (sqrt (+ (/ 2.0 x) (/ 2.0 (* x 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 <= -7e-194) {
		tmp = -t_1;
	} else if (t <= 3.15e-276) {
		tmp = sqrt(2.0) * (t / (l * sqrt(((2.0 / x) + (2.0 / (x * 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 <= (-7d-194)) then
        tmp = -t_1
    else if (t <= 3.15d-276) then
        tmp = sqrt(2.0d0) * (t / (l * sqrt(((2.0d0 / x) + (2.0d0 / (x * 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 <= -7e-194) {
		tmp = -t_1;
	} else if (t <= 3.15e-276) {
		tmp = Math.sqrt(2.0) * (t / (l * Math.sqrt(((2.0 / x) + (2.0 / (x * 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 <= -7e-194:
		tmp = -t_1
	elif t <= 3.15e-276:
		tmp = math.sqrt(2.0) * (t / (l * math.sqrt(((2.0 / x) + (2.0 / (x * 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 <= -7e-194)
		tmp = Float64(-t_1);
	elseif (t <= 3.15e-276)
		tmp = Float64(sqrt(2.0) * Float64(t / Float64(l * sqrt(Float64(Float64(2.0 / x) + Float64(2.0 / Float64(x * 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 <= -7e-194)
		tmp = -t_1;
	elseif (t <= 3.15e-276)
		tmp = sqrt(2.0) * (t / (l * sqrt(((2.0 / x) + (2.0 / (x * 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, -7e-194], (-t$95$1), If[LessEqual[t, 3.15e-276], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t / N[(l * N[Sqrt[N[(N[(2.0 / x), $MachinePrecision] + N[(2.0 / N[(x * x), $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 -7 \cdot 10^{-194}:\\
\;\;\;\;-t_1\\

\mathbf{elif}\;t \leq 3.15 \cdot 10^{-276}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t}{\ell \cdot \sqrt{\frac{2}{x} + \frac{2}{x \cdot x}}}\\

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


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

    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. Step-by-step derivation
      1. associate-*l/38.9%

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

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

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

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

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

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

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

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

    if -7.0000000000000006e-194 < t < 3.1499999999999999e-276

    1. Initial program 8.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. Step-by-step derivation
      1. associate-*r/8.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{2} \cdot \frac{t}{\ell \cdot \sqrt{\color{blue}{\frac{2 \cdot 1}{{x}^{2}}} + 2 \cdot \frac{1}{x}}} \]
      2. metadata-eval56.1%

        \[\leadsto \sqrt{2} \cdot \frac{t}{\ell \cdot \sqrt{\frac{\color{blue}{2}}{{x}^{2}} + 2 \cdot \frac{1}{x}}} \]
      3. unpow256.1%

        \[\leadsto \sqrt{2} \cdot \frac{t}{\ell \cdot \sqrt{\frac{2}{\color{blue}{x \cdot x}} + 2 \cdot \frac{1}{x}}} \]
      4. associate-*r/56.1%

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

        \[\leadsto \sqrt{2} \cdot \frac{t}{\ell \cdot \sqrt{\frac{2}{x \cdot x} + \frac{\color{blue}{2}}{x}}} \]
    9. Simplified56.1%

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

    if 3.1499999999999999e-276 < t

    1. Initial program 40.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. Step-by-step derivation
      1. associate-*l/40.2%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -7 \cdot 10^{-194}:\\ \;\;\;\;-\sqrt{\frac{x + -1}{x + 1}}\\ \mathbf{elif}\;t \leq 3.15 \cdot 10^{-276}:\\ \;\;\;\;\sqrt{2} \cdot \frac{t}{\ell \cdot \sqrt{\frac{2}{x} + \frac{2}{x \cdot x}}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\ \end{array} \]

Alternative 3: 79.9% accurate, 1.0× speedup?

\[\begin{array}{l} l = |l|\\ \\ \begin{array}{l} t_1 := \sqrt{\frac{x + -1}{x + 1}}\\ \mathbf{if}\;t \leq -1.4 \cdot 10^{-192}:\\ \;\;\;\;-t_1\\ \mathbf{elif}\;t \leq 3.7 \cdot 10^{-280}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{\ell \cdot \sqrt{\frac{2}{x} + \frac{\frac{2}{x}}{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.4e-192)
     (- t_1)
     (if (<= t 3.7e-280)
       (/ (* t (sqrt 2.0)) (* l (sqrt (+ (/ 2.0 x) (/ (/ 2.0 x) 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.4e-192) {
		tmp = -t_1;
	} else if (t <= 3.7e-280) {
		tmp = (t * sqrt(2.0)) / (l * sqrt(((2.0 / x) + ((2.0 / x) / 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.4d-192)) then
        tmp = -t_1
    else if (t <= 3.7d-280) then
        tmp = (t * sqrt(2.0d0)) / (l * sqrt(((2.0d0 / x) + ((2.0d0 / x) / 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.4e-192) {
		tmp = -t_1;
	} else if (t <= 3.7e-280) {
		tmp = (t * Math.sqrt(2.0)) / (l * Math.sqrt(((2.0 / x) + ((2.0 / x) / 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.4e-192:
		tmp = -t_1
	elif t <= 3.7e-280:
		tmp = (t * math.sqrt(2.0)) / (l * math.sqrt(((2.0 / x) + ((2.0 / x) / 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.4e-192)
		tmp = Float64(-t_1);
	elseif (t <= 3.7e-280)
		tmp = Float64(Float64(t * sqrt(2.0)) / Float64(l * sqrt(Float64(Float64(2.0 / x) + Float64(Float64(2.0 / x) / 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.4e-192)
		tmp = -t_1;
	elseif (t <= 3.7e-280)
		tmp = (t * sqrt(2.0)) / (l * sqrt(((2.0 / x) + ((2.0 / x) / 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.4e-192], (-t$95$1), If[LessEqual[t, 3.7e-280], N[(N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] / N[(l * N[Sqrt[N[(N[(2.0 / x), $MachinePrecision] + N[(N[(2.0 / x), $MachinePrecision] / x), $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 -1.4 \cdot 10^{-192}:\\
\;\;\;\;-t_1\\

\mathbf{elif}\;t \leq 3.7 \cdot 10^{-280}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{\ell \cdot \sqrt{\frac{2}{x} + \frac{\frac{2}{x}}{x}}}\\

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


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

    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. Step-by-step derivation
      1. associate-*l/38.9%

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

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

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

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

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

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

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

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

    if -1.40000000000000002e-192 < t < 3.6999999999999998e-280

    1. Initial program 8.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. Step-by-step derivation
      1. associate-*r/8.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{2} \cdot \frac{t}{\ell \cdot \sqrt{\color{blue}{\frac{2 \cdot 1}{{x}^{2}}} + 2 \cdot \frac{1}{x}}} \]
      2. metadata-eval56.1%

        \[\leadsto \sqrt{2} \cdot \frac{t}{\ell \cdot \sqrt{\frac{\color{blue}{2}}{{x}^{2}} + 2 \cdot \frac{1}{x}}} \]
      3. unpow256.1%

        \[\leadsto \sqrt{2} \cdot \frac{t}{\ell \cdot \sqrt{\frac{2}{\color{blue}{x \cdot x}} + 2 \cdot \frac{1}{x}}} \]
      4. associate-*r/56.1%

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

        \[\leadsto \sqrt{2} \cdot \frac{t}{\ell \cdot \sqrt{\frac{2}{x \cdot x} + \frac{\color{blue}{2}}{x}}} \]
    9. Simplified56.1%

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

        \[\leadsto \color{blue}{\frac{\sqrt{2} \cdot t}{\ell \cdot \sqrt{\frac{2}{x \cdot x} + \frac{2}{x}}}} \]
      2. associate-/r*56.0%

        \[\leadsto \frac{\sqrt{2} \cdot t}{\ell \cdot \sqrt{\color{blue}{\frac{\frac{2}{x}}{x}} + \frac{2}{x}}} \]
    11. Applied egg-rr56.0%

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

    if 3.6999999999999998e-280 < t

    1. Initial program 40.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. Step-by-step derivation
      1. associate-*l/40.2%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.4 \cdot 10^{-192}:\\ \;\;\;\;-\sqrt{\frac{x + -1}{x + 1}}\\ \mathbf{elif}\;t \leq 3.7 \cdot 10^{-280}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{\ell \cdot \sqrt{\frac{2}{x} + \frac{\frac{2}{x}}{x}}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\ \end{array} \]

Alternative 4: 79.7% accurate, 1.1× speedup?

\[\begin{array}{l} l = |l|\\ \\ \begin{array}{l} t_1 := \sqrt{\frac{x + -1}{x + 1}}\\ \mathbf{if}\;t \leq -1.66 \cdot 10^{-192}:\\ \;\;\;\;-t_1\\ \mathbf{elif}\;t \leq 3.8 \cdot 10^{-284}:\\ \;\;\;\;\sqrt{2} \cdot \frac{t}{\ell \cdot \sqrt{\frac{2}{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.66e-192)
     (- t_1)
     (if (<= t 3.8e-284) (* (sqrt 2.0) (/ t (* l (sqrt (/ 2.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.66e-192) {
		tmp = -t_1;
	} else if (t <= 3.8e-284) {
		tmp = sqrt(2.0) * (t / (l * sqrt((2.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.66d-192)) then
        tmp = -t_1
    else if (t <= 3.8d-284) then
        tmp = sqrt(2.0d0) * (t / (l * sqrt((2.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.66e-192) {
		tmp = -t_1;
	} else if (t <= 3.8e-284) {
		tmp = Math.sqrt(2.0) * (t / (l * Math.sqrt((2.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.66e-192:
		tmp = -t_1
	elif t <= 3.8e-284:
		tmp = math.sqrt(2.0) * (t / (l * math.sqrt((2.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.66e-192)
		tmp = Float64(-t_1);
	elseif (t <= 3.8e-284)
		tmp = Float64(sqrt(2.0) * Float64(t / Float64(l * sqrt(Float64(2.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.66e-192)
		tmp = -t_1;
	elseif (t <= 3.8e-284)
		tmp = sqrt(2.0) * (t / (l * sqrt((2.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.66e-192], (-t$95$1), If[LessEqual[t, 3.8e-284], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t / N[(l * N[Sqrt[N[(2.0 / x), $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 -1.66 \cdot 10^{-192}:\\
\;\;\;\;-t_1\\

\mathbf{elif}\;t \leq 3.8 \cdot 10^{-284}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t}{\ell \cdot \sqrt{\frac{2}{x}}}\\

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


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

    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. Step-by-step derivation
      1. associate-*l/38.9%

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

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

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

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

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

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

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

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

    if -1.6600000000000001e-192 < t < 3.7999999999999999e-284

    1. Initial program 8.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. Step-by-step derivation
      1. associate-*r/8.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.7999999999999999e-284 < t

    1. Initial program 40.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. Step-by-step derivation
      1. associate-*l/40.2%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.66 \cdot 10^{-192}:\\ \;\;\;\;-\sqrt{\frac{x + -1}{x + 1}}\\ \mathbf{elif}\;t \leq 3.8 \cdot 10^{-284}:\\ \;\;\;\;\sqrt{2} \cdot \frac{t}{\ell \cdot \sqrt{\frac{2}{x}}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\ \end{array} \]

Alternative 5: 77.1% accurate, 2.0× speedup?

\[\begin{array}{l} l = |l|\\ \\ \begin{array}{l} t_1 := \sqrt{\frac{x + -1}{x + 1}}\\ \mathbf{if}\;t \leq -5 \cdot 10^{-310}:\\ \;\;\;\;-t_1\\ \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 -5e-310) (- t_1) 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 <= -5e-310) {
		tmp = -t_1;
	} 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 <= (-5d-310)) then
        tmp = -t_1
    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 <= -5e-310) {
		tmp = -t_1;
	} 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 <= -5e-310:
		tmp = -t_1
	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 <= -5e-310)
		tmp = Float64(-t_1);
	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 <= -5e-310)
		tmp = -t_1;
	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, -5e-310], (-t$95$1), t$95$1]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \sqrt{\frac{x + -1}{x + 1}}\\
\mathbf{if}\;t \leq -5 \cdot 10^{-310}:\\
\;\;\;\;-t_1\\

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


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

    1. Initial program 34.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. Step-by-step derivation
      1. associate-*l/34.2%

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

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

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

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

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

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

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

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

    if -4.999999999999985e-310 < t

    1. Initial program 39.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. Step-by-step derivation
      1. associate-*l/39.4%

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

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

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

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

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

Alternative 6: 76.9% accurate, 2.1× speedup?

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

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


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

    1. Initial program 34.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. Step-by-step derivation
      1. associate-*l/34.2%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{1}{x} - \left(1 + 0.5 \cdot \frac{1}{{x}^{2}}\right)} \]
    8. Step-by-step derivation
      1. associate-*r/78.0%

        \[\leadsto \frac{1}{x} - \left(1 + \color{blue}{\frac{0.5 \cdot 1}{{x}^{2}}}\right) \]
      2. metadata-eval78.0%

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

        \[\leadsto \frac{1}{x} - \left(1 + \frac{0.5}{\color{blue}{x \cdot x}}\right) \]
    9. Simplified78.0%

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

    if -4.999999999999985e-310 < t

    1. Initial program 39.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. Step-by-step derivation
      1. associate-*l/39.4%

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

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

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

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

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

Alternative 7: 76.7% accurate, 17.2× speedup?

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

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


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

    1. Initial program 34.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. Step-by-step derivation
      1. associate-*l/34.2%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{1}{x} - \left(1 + 0.5 \cdot \frac{1}{{x}^{2}}\right)} \]
    8. Step-by-step derivation
      1. associate-*r/78.0%

        \[\leadsto \frac{1}{x} - \left(1 + \color{blue}{\frac{0.5 \cdot 1}{{x}^{2}}}\right) \]
      2. metadata-eval78.0%

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

        \[\leadsto \frac{1}{x} - \left(1 + \frac{0.5}{\color{blue}{x \cdot x}}\right) \]
    9. Simplified78.0%

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

    if -4.999999999999985e-310 < t

    1. Initial program 39.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. Step-by-step derivation
      1. associate-*l/39.4%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\left(\frac{1}{x} + \color{blue}{-1}\right) \]
    10. Simplified83.1%

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

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

Alternative 8: 76.6% accurate, 31.9× speedup?

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

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


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

    1. Initial program 34.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. Step-by-step derivation
      1. associate-*l/34.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.999999999999985e-310 < t

    1. Initial program 39.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. Step-by-step derivation
      1. associate-*l/39.4%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\left(\frac{1}{x} + \color{blue}{-1}\right) \]
    10. Simplified83.1%

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

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

Alternative 9: 38.8% accurate, 45.0× speedup?

\[\begin{array}{l} l = |l|\\ \\ -1 + \frac{1}{x} \end{array} \]
NOTE: l should be positive before calling this function
(FPCore (x l t) :precision binary64 (+ -1.0 (/ 1.0 x)))
l = abs(l);
double code(double x, double l, double t) {
	return -1.0 + (1.0 / x);
}
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) + (1.0d0 / x)
end function
l = Math.abs(l);
public static double code(double x, double l, double t) {
	return -1.0 + (1.0 / x);
}
l = abs(l)
def code(x, l, t):
	return -1.0 + (1.0 / x)
l = abs(l)
function code(x, l, t)
	return Float64(-1.0 + Float64(1.0 / x))
end
l = abs(l)
function tmp = code(x, l, t)
	tmp = -1.0 + (1.0 / x);
end
NOTE: l should be positive before calling this function
code[x_, l_, t_] := N[(-1.0 + N[(1.0 / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
l = |l|\\
\\
-1 + \frac{1}{x}
\end{array}
Derivation
  1. Initial program 36.8%

    \[\frac{\sqrt{2} \cdot t}{\sqrt{\frac{x + 1}{x - 1} \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}} \]
  2. Step-by-step derivation
    1. associate-*l/36.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 38.5% 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 36.8%

    \[\frac{\sqrt{2} \cdot t}{\sqrt{\frac{x + 1}{x - 1} \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}} \]
  2. Step-by-step derivation
    1. associate-*l/36.8%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{\frac{-1}{t}} \cdot t \]
  8. Taylor expanded in t around 0 39.8%

    \[\leadsto \color{blue}{-1} \]
  9. Final simplification39.8%

    \[\leadsto -1 \]

Reproduce

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