Toniolo and Linder, Equation (7)

Percentage Accurate: 33.3% → 79.4%
Time: 25.6s
Alternatives: 10
Speedup: 225.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 10 alternatives:

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

Initial Program: 33.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: 79.4% accurate, 0.7× speedup?

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

\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;l\_m \cdot l\_m \leq 5 \cdot 10^{+274}:\\
\;\;\;\;1 + \left(\frac{0.5}{{x}^{2}} + \left(\frac{-1}{x} - \frac{0.5}{{x}^{3}}\right)\right)\\

\mathbf{else}:\\
\;\;\;\;t\_m \cdot \left(\frac{\sqrt{2}}{l\_m} \cdot \sqrt{\mathsf{fma}\left(x, 0.5, -0.5\right)}\right)\\


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.9999999999999998e274 < (*.f64 l l)

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \sqrt{2} \cdot \left(\sqrt{\color{blue}{0.5 \cdot x - 0.5}} \cdot \frac{t}{\ell}\right) \]
    8. Taylor expanded in t around 0 37.9%

      \[\leadsto \color{blue}{\frac{t \cdot \sqrt{2}}{\ell} \cdot \sqrt{0.5 \cdot x - 0.5}} \]
    9. Step-by-step derivation
      1. associate-/l*37.9%

        \[\leadsto \color{blue}{\left(t \cdot \frac{\sqrt{2}}{\ell}\right)} \cdot \sqrt{0.5 \cdot x - 0.5} \]
      2. *-commutative37.9%

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

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

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

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

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

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

Alternative 2: 79.3% accurate, 1.0× speedup?

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

\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;l\_m \cdot l\_m \leq 5 \cdot 10^{+274}:\\
\;\;\;\;1 + \left(\frac{0.5}{{x}^{2}} + \left(\frac{-1}{x} - \frac{0.5}{{x}^{3}}\right)\right)\\

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.9999999999999998e274 < (*.f64 l l)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 79.6% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 36.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. Simplified36.9%

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

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

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

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

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

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

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

        \[\leadsto \sqrt{2} \cdot \frac{t}{\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(t \cdot \sqrt{2}\right)\right)} \cdot \sqrt{\frac{x + 1}{-1 + x}}} \]
      2. add-cube-cbrt38.1%

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.6000000000000001e138 < l

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 79.3% accurate, 1.0× speedup?

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

\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;l\_m \leq 1.4 \cdot 10^{+138}:\\
\;\;\;\;1 + \left(\frac{0.5}{{x}^{2}} + \left(\frac{-1}{x} - \frac{0.5}{{x}^{3}}\right)\right)\\

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


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

    1. Initial program 36.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. Simplified36.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.4e138 < l

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 78.4% accurate, 1.1× speedup?

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

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

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


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

    1. Initial program 36.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. Simplified36.4%

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

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

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

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

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

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

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

        \[\leadsto \sqrt{2} \cdot \frac{t}{\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(t \cdot \sqrt{2}\right)\right)} \cdot \sqrt{\frac{x + 1}{-1 + x}}} \]
      2. add-cube-cbrt38.4%

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

        \[\leadsto \sqrt{2} \cdot \frac{t}{\color{blue}{{\left(\sqrt[3]{\mathsf{expm1}\left(\mathsf{log1p}\left(t \cdot \sqrt{2}\right)\right)}\right)}^{3}} \cdot \sqrt{\frac{x + 1}{-1 + x}}} \]
      4. expm1-log1p-u40.6%

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

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

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

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

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

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

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

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

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

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

    if 9.50000000000000032e181 < l

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 78.5% accurate, 1.1× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\frac{t\_m}{l\_m} \cdot \sqrt{2 \cdot \mathsf{fma}\left(x, 0.5, -0.5\right)}\\


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

    1. Initial program 36.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. Simplified36.4%

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

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

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

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

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

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

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

        \[\leadsto \sqrt{2} \cdot \frac{t}{\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(t \cdot \sqrt{2}\right)\right)} \cdot \sqrt{\frac{x + 1}{-1 + x}}} \]
      2. add-cube-cbrt38.4%

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

        \[\leadsto \sqrt{2} \cdot \frac{t}{\color{blue}{{\left(\sqrt[3]{\mathsf{expm1}\left(\mathsf{log1p}\left(t \cdot \sqrt{2}\right)\right)}\right)}^{3}} \cdot \sqrt{\frac{x + 1}{-1 + x}}} \]
      4. expm1-log1p-u40.6%

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

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

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

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

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

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

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

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

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

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

    if 1.45e183 < l

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{{\left(\sqrt{2 \cdot \mathsf{fma}\left(x, 0.5, -0.5\right)} \cdot \frac{t}{\ell}\right)}^{1}} \]
    10. Step-by-step derivation
      1. unpow163.9%

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

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

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

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

Alternative 7: 76.3% accurate, 2.1× speedup?

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

\\
t\_s \cdot {\left(\frac{1 + x}{x + -1}\right)}^{-0.5}
\end{array}
Derivation
  1. Initial program 33.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{\sqrt{2} \cdot t}{\sqrt{2} \cdot t}}{\sqrt{\frac{x + 1}{x + -1}}}} \]
    2. *-inverses39.0%

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

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

      \[\leadsto \color{blue}{1 \cdot \frac{1}{\sqrt{\frac{x + 1}{x + -1}}}} \]
    2. pow1/239.0%

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

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

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

      \[\leadsto 1 \cdot {\left(\frac{1 + x}{x + -1}\right)}^{\color{blue}{-0.5}} \]
  14. Applied egg-rr39.0%

    \[\leadsto \color{blue}{1 \cdot {\left(\frac{1 + x}{x + -1}\right)}^{-0.5}} \]
  15. Step-by-step derivation
    1. *-lft-identity39.0%

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

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

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

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

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

Alternative 8: 76.3% accurate, 2.1× speedup?

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

\\
t\_s \cdot \sqrt{\frac{x + -1}{1 + x}}
\end{array}
Derivation
  1. Initial program 33.0%

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

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

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

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

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

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

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

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

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

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

Alternative 9: 75.7% accurate, 45.0× speedup?

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

\\
t\_s \cdot \left(1 + \frac{-1}{x}\right)
\end{array}
Derivation
  1. Initial program 33.0%

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

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

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

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

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

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

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

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

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

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

Alternative 10: 75.0% accurate, 225.0× speedup?

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

\\
t\_s \cdot 1
\end{array}
Derivation
  1. Initial program 33.0%

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{1} \]
  8. Final simplification38.7%

    \[\leadsto 1 \]
  9. Add Preprocessing

Reproduce

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