Toniolo and Linder, Equation (7)

Percentage Accurate: 33.6% → 81.8%
Time: 15.8s
Alternatives: 13
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 13 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.6% 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.8% accurate, 0.3× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -6.3999999999999999e66

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

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

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

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

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

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

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

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

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

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

    if -6.3999999999999999e66 < t < -1.1199999999999999e-148

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

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

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

    if -1.1199999999999999e-148 < t < 2.89999999999999997e-140

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

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

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

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

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

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

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

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

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

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

    if 2.89999999999999997e-140 < t

    1. Initial program 38.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{\left(-1 + \frac{1}{x}\right)} \]
    11. Simplified87.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -6.4 \cdot 10^{+66}:\\ \;\;\;\;\frac{t}{t \cdot \left(-\sqrt{\frac{x + 1}{x + -1}}\right)}\\ \mathbf{elif}\;t \leq -1.12 \cdot 10^{-148}:\\ \;\;\;\;\frac{t}{\frac{\sqrt{\left(2 \cdot \frac{{t}^{2}}{x} + \left(2 \cdot {t}^{2} + \frac{{\ell}^{2}}{x}\right)\right) + \frac{2 \cdot {t}^{2} + {\ell}^{2}}{x}}}{\sqrt{2}}}\\ \mathbf{elif}\;t \leq 2.9 \cdot 10^{-140}:\\ \;\;\;\;\frac{t}{\ell \cdot \sqrt{\frac{1}{x}}}\\ \mathbf{else}:\\ \;\;\;\;1 + \frac{-1}{x}\\ \end{array} \]

Alternative 2: 79.6% accurate, 2.0× speedup?

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

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

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


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

    1. Initial program 41.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. Simplified41.5%

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

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

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

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

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

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

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

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

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

    if -4.0000000000000001e-146 < t < 2.89999999999999997e-140

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

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

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

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

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

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

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

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

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

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

    if 2.89999999999999997e-140 < t

    1. Initial program 38.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{\left(-1 + \frac{1}{x}\right)} \]
    11. Simplified87.6%

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

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

Alternative 3: 79.3% accurate, 2.0× speedup?

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

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

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


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

    1. Initial program 41.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. Simplified41.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.44999999999999994e-143 < t < 3.9999999999999999e-140

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

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

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

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

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

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

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

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

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

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

    if 3.9999999999999999e-140 < t

    1. Initial program 38.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{\left(-1 + \frac{1}{x}\right)} \]
    11. Simplified87.6%

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

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

Alternative 4: 79.4% accurate, 2.0× speedup?

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

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

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


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

    1. Initial program 41.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. Simplified41.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.6000000000000001e-141 < t < 2.89999999999999997e-140

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

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

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

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

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

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

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

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

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

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

    if 2.89999999999999997e-140 < t

    1. Initial program 38.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{\left(-1 + \frac{1}{x}\right)} \]
    11. Simplified87.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.6 \cdot 10^{-141}:\\ \;\;\;\;-\sqrt{\frac{x + -1}{x + 1}}\\ \mathbf{elif}\;t \leq 2.9 \cdot 10^{-140}:\\ \;\;\;\;\frac{t}{\ell \cdot \sqrt{\frac{1}{x}}}\\ \mathbf{else}:\\ \;\;\;\;1 + \frac{-1}{x}\\ \end{array} \]

Alternative 5: 78.3% accurate, 2.1× speedup?

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{x} - \left(1 + \frac{0.5}{\color{blue}{x \cdot x}}\right) \]
    10. Applied egg-rr83.9%

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

    if -3.90000000000000018e-205 < t < 3.69999999999999977e-140

    1. Initial program 5.4%

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

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

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

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

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

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

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

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

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

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

    if 3.69999999999999977e-140 < t

    1. Initial program 38.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{\left(-1 + \frac{1}{x}\right)} \]
    11. Simplified87.6%

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

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

Alternative 6: 79.4% accurate, 2.1× speedup?

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

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

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


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

    1. Initial program 41.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. Simplified41.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -9.2000000000000003e-146 < t < 3.00000000000000018e-140

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

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

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

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

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

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

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

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

      \[\leadsto \frac{t}{\frac{\color{blue}{\sqrt{2 \cdot \frac{{\ell}^{2}}{x}}}}{\sqrt{2}}} \]
    7. Step-by-step derivation
      1. clear-num51.2%

        \[\leadsto \color{blue}{\frac{1}{\frac{\frac{\sqrt{2 \cdot \frac{{\ell}^{2}}{x}}}{\sqrt{2}}}{t}}} \]
      2. associate-/r/52.3%

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

        \[\leadsto \color{blue}{\frac{\sqrt{2}}{\sqrt{2 \cdot \frac{{\ell}^{2}}{x}}}} \cdot t \]
      4. sqrt-undiv52.4%

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

        \[\leadsto \sqrt{\frac{2}{\color{blue}{\frac{2 \cdot {\ell}^{2}}{x}}}} \cdot t \]
    8. Applied egg-rr52.4%

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

      \[\leadsto \color{blue}{\left(\frac{1}{\ell} \cdot \sqrt{x}\right)} \cdot t \]
    10. Step-by-step derivation
      1. associate-*l/51.0%

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

        \[\leadsto \frac{\color{blue}{\sqrt{x}}}{\ell} \cdot t \]
    11. Simplified51.0%

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

    if 3.00000000000000018e-140 < t

    1. Initial program 38.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{\left(-1 + \frac{1}{x}\right)} \]
    11. Simplified87.6%

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

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

Alternative 7: 79.3% accurate, 2.1× speedup?

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

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

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


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

    1. Initial program 41.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. Simplified41.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.65e-141 < t < 3.29999999999999987e-140

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

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

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

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

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

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

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

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

      \[\leadsto \frac{t}{\frac{\color{blue}{\sqrt{2 \cdot \frac{{\ell}^{2}}{x}}}}{\sqrt{2}}} \]
    7. Step-by-step derivation
      1. expm1-log1p-u51.8%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{t}{\frac{\sqrt{2 \cdot \frac{{\ell}^{2}}{x}}}{\sqrt{2}}}\right)\right)} \]
      2. expm1-udef24.7%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{t}{\frac{\sqrt{2 \cdot \frac{{\ell}^{2}}{x}}}{\sqrt{2}}}\right)} - 1} \]
      3. sqrt-undiv24.7%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{t}{\color{blue}{\sqrt{\frac{2 \cdot \frac{{\ell}^{2}}{x}}{2}}}}\right)} - 1 \]
      4. *-commutative24.7%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{t}{\sqrt{\frac{\color{blue}{\frac{{\ell}^{2}}{x} \cdot 2}}{2}}}\right)} - 1 \]
      5. associate-/l*24.7%

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

        \[\leadsto e^{\mathsf{log1p}\left(\frac{t}{\sqrt{\frac{\frac{{\ell}^{2}}{x}}{\color{blue}{1}}}}\right)} - 1 \]
    8. Applied egg-rr24.7%

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

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

        \[\leadsto \color{blue}{\frac{t}{\sqrt{\frac{\frac{{\ell}^{2}}{x}}{1}}}} \]
      3. /-rgt-identity52.5%

        \[\leadsto \frac{t}{\sqrt{\color{blue}{\frac{{\ell}^{2}}{x}}}} \]
    10. Simplified52.5%

      \[\leadsto \color{blue}{\frac{t}{\sqrt{\frac{{\ell}^{2}}{x}}}} \]
    11. Step-by-step derivation
      1. expm1-log1p-u52.1%

        \[\leadsto \frac{t}{\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{\frac{{\ell}^{2}}{x}}\right)\right)}} \]
      2. expm1-udef35.0%

        \[\leadsto \frac{t}{\color{blue}{e^{\mathsf{log1p}\left(\sqrt{\frac{{\ell}^{2}}{x}}\right)} - 1}} \]
      3. sqrt-div34.4%

        \[\leadsto \frac{t}{e^{\mathsf{log1p}\left(\color{blue}{\frac{\sqrt{{\ell}^{2}}}{\sqrt{x}}}\right)} - 1} \]
      4. unpow234.4%

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

        \[\leadsto \frac{t}{e^{\mathsf{log1p}\left(\frac{\color{blue}{\sqrt{\ell} \cdot \sqrt{\ell}}}{\sqrt{x}}\right)} - 1} \]
      6. add-sqr-sqrt24.8%

        \[\leadsto \frac{t}{e^{\mathsf{log1p}\left(\frac{\color{blue}{\ell}}{\sqrt{x}}\right)} - 1} \]
    12. Applied egg-rr24.8%

      \[\leadsto \frac{t}{\color{blue}{e^{\mathsf{log1p}\left(\frac{\ell}{\sqrt{x}}\right)} - 1}} \]
    13. Step-by-step derivation
      1. expm1-def40.8%

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

        \[\leadsto \frac{t}{\color{blue}{\frac{\ell}{\sqrt{x}}}} \]
    14. Simplified51.2%

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

    if 3.29999999999999987e-140 < t

    1. Initial program 38.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{\left(-1 + \frac{1}{x}\right)} \]
    11. Simplified87.6%

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

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.999999999999985e-310 < t

    1. Initial program 30.5%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \sqrt{\frac{x - 1}{1 + x}}} \]
    7. 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}} \]
      4. +-commutative1.7%

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

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

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

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

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

        \[\leadsto -\color{blue}{\left(-1 + \frac{1}{x}\right)} \]
    11. Simplified76.0%

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

    \[\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}:\\ \;\;\;\;1 + \frac{-1}{x}\\ \end{array} \]

Alternative 9: 76.8% accurate, 22.4× speedup?

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

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


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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{t}{\color{blue}{-1 \cdot t + -1 \cdot \frac{t}{x}}} \]
    7. Step-by-step derivation
      1. neg-mul-176.8%

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

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

        \[\leadsto \frac{t}{\color{blue}{-1 \cdot \frac{t}{x} - t}} \]
      4. associate-*r/76.8%

        \[\leadsto \frac{t}{\color{blue}{\frac{-1 \cdot t}{x}} - t} \]
      5. neg-mul-176.8%

        \[\leadsto \frac{t}{\frac{\color{blue}{-t}}{x} - t} \]
    8. Simplified76.8%

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

    if -4.999999999999985e-310 < t

    1. Initial program 30.5%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \sqrt{\frac{x - 1}{1 + x}}} \]
    7. 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}} \]
      4. +-commutative1.7%

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

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

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

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

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

        \[\leadsto -\color{blue}{\left(-1 + \frac{1}{x}\right)} \]
    11. Simplified76.0%

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

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

Alternative 10: 76.5% 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}:\\ \;\;\;\;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))
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;
	}
	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
    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;
	}
	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
	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 = 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;
	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], 1.0]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5 \cdot 10^{-310}:\\
\;\;\;\;-1 + \frac{1}{x}\\

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


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

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

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

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

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

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

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

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

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

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

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

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

    if -4.999999999999985e-310 < t

    1. Initial program 30.5%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \sqrt{\frac{x - 1}{1 + x}}} \]
    7. 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}} \]
      4. +-commutative1.7%

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

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

      \[\leadsto -\color{blue}{{\left(\sqrt{-1}\right)}^{2}} \]
    10. Step-by-step derivation
      1. unpow20.0%

        \[\leadsto -\color{blue}{\sqrt{-1} \cdot \sqrt{-1}} \]
      2. rem-square-sqrt75.1%

        \[\leadsto -\color{blue}{-1} \]
    11. Simplified75.1%

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

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

    if -4.999999999999985e-310 < t

    1. Initial program 30.5%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \sqrt{\frac{x - 1}{1 + x}}} \]
    7. 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}} \]
      4. +-commutative1.7%

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

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

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

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

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

        \[\leadsto -\color{blue}{\left(-1 + \frac{1}{x}\right)} \]
    11. Simplified76.0%

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

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

Alternative 12: 76.1% accurate, 73.5× speedup?

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

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


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

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

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

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

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

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

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

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

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

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

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

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

    if -4.999999999999985e-310 < t

    1. Initial program 30.5%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \sqrt{\frac{x - 1}{1 + x}}} \]
    7. 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}} \]
      4. +-commutative1.7%

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

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

      \[\leadsto -\color{blue}{{\left(\sqrt{-1}\right)}^{2}} \]
    10. Step-by-step derivation
      1. unpow20.0%

        \[\leadsto -\color{blue}{\sqrt{-1} \cdot \sqrt{-1}} \]
      2. rem-square-sqrt75.1%

        \[\leadsto -\color{blue}{-1} \]
    11. Simplified75.1%

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

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

Alternative 13: 38.7% 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 31.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. Simplified31.9%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto -1 \]

Reproduce

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