Toniolo and Linder, Equation (7)

Percentage Accurate: 33.5% → 87.3%
Time: 32.8s
Alternatives: 10
Speedup: 225.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 10 alternatives:

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

Initial Program: 33.5% accurate, 1.0× speedup?

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

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

Alternative 1: 87.3% accurate, 1.0× speedup?

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

\mathbf{elif}\;t \leq -8.3 \cdot 10^{-203}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;t \leq 96000000:\\
\;\;\;\;t_1\\

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


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

    1. Initial program 2.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.69999999999999991e150 < t < -8.29999999999999985e-203 or 6.89999999999999995e-164 < t < 9.6e7

    1. Initial program 50.3%

      \[\frac{\sqrt{2} \cdot t}{\sqrt{\frac{x + 1}{x - 1} \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}} \]
    2. Step-by-step derivation
      1. fma-neg50.3%

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

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

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

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

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

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

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

      \[\leadsto \frac{\sqrt{2} \cdot t}{\sqrt{\color{blue}{2 \cdot \frac{2 \cdot {t}^{2} + {\ell}^{2}}{x} + 2 \cdot {t}^{2}}}} \]
    5. Step-by-step derivation
      1. distribute-lft-out77.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -8.29999999999999985e-203 < t < 6.89999999999999995e-164

    1. Initial program 7.2%

      \[\frac{\sqrt{2} \cdot t}{\sqrt{\frac{x + 1}{x - 1} \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}} \]
    2. Step-by-step derivation
      1. fma-neg7.3%

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

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

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

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

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

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

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

      \[\leadsto \frac{\sqrt{2} \cdot t}{\sqrt{\color{blue}{2 \cdot \frac{2 \cdot {t}^{2} + {\ell}^{2}}{x} + 2 \cdot {t}^{2}}}} \]
    5. Step-by-step derivation
      1. distribute-lft-out52.8%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{t \cdot \sqrt{x}}{\ell}} \]
    9. Applied egg-rr41.8%

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

    if 9.6e7 < t

    1. Initial program 40.6%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.7 \cdot 10^{+150}:\\ \;\;\;\;-\sqrt{\frac{x + -1}{x + 1}}\\ \mathbf{elif}\;t \leq -8.3 \cdot 10^{-203}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{2 \cdot \left(\ell \cdot \frac{\ell}{x} + t \cdot t\right)}}\\ \mathbf{elif}\;t \leq 6.9 \cdot 10^{-164}:\\ \;\;\;\;\frac{t \cdot \sqrt{x}}{\ell}\\ \mathbf{elif}\;t \leq 96000000:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{2 \cdot \left(\ell \cdot \frac{\ell}{x} + t \cdot t\right)}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\ \end{array} \]

Alternative 2: 78.1% accurate, 2.0× speedup?

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

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

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


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

    1. Initial program 37.4%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{x} + \color{blue}{\sqrt{-1} \cdot \sqrt{-1}} \]
      2. rem-square-sqrt86.2%

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

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

    if -1.80000000000000002e-139 < t < 8.49999999999999996e-64

    1. Initial program 11.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. Step-by-step derivation
      1. fma-neg11.8%

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

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

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

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

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

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

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

      \[\leadsto \frac{\sqrt{2} \cdot t}{\sqrt{\color{blue}{2 \cdot \frac{2 \cdot {t}^{2} + {\ell}^{2}}{x} + 2 \cdot {t}^{2}}}} \]
    5. Step-by-step derivation
      1. distribute-lft-out54.8%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{t \cdot \sqrt{x}}{\ell}} \]
    9. Applied egg-rr39.1%

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

    if 8.49999999999999996e-64 < t

    1. Initial program 44.2%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.8 \cdot 10^{-139}:\\ \;\;\;\;-1 + \frac{1}{x}\\ \mathbf{elif}\;t \leq 8.5 \cdot 10^{-64}:\\ \;\;\;\;\frac{t \cdot \sqrt{x}}{\ell}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\ \end{array} \]

Alternative 3: 78.3% accurate, 2.0× speedup?

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

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

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


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

    1. Initial program 37.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.10000000000000008e-139 < t < 8.49999999999999996e-64

    1. Initial program 11.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. Step-by-step derivation
      1. fma-neg11.8%

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

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

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

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

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

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

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

      \[\leadsto \frac{\sqrt{2} \cdot t}{\sqrt{\color{blue}{2 \cdot \frac{2 \cdot {t}^{2} + {\ell}^{2}}{x} + 2 \cdot {t}^{2}}}} \]
    5. Step-by-step derivation
      1. distribute-lft-out54.8%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{t \cdot \sqrt{x}}{\ell}} \]
    9. Applied egg-rr39.1%

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

    if 8.49999999999999996e-64 < t

    1. Initial program 44.2%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -2.1 \cdot 10^{-139}:\\ \;\;\;\;-\sqrt{\frac{x + -1}{x + 1}}\\ \mathbf{elif}\;t \leq 8.5 \cdot 10^{-64}:\\ \;\;\;\;\frac{t \cdot \sqrt{x}}{\ell}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\ \end{array} \]

Alternative 4: 77.9% accurate, 2.1× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;1 + \left(\frac{0.5}{x \cdot x} + \frac{-1}{x}\right)\\


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

    1. Initial program 37.4%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{x} + \color{blue}{\sqrt{-1} \cdot \sqrt{-1}} \]
      2. rem-square-sqrt86.2%

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

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

    if -9.80000000000000063e-139 < t < 4.2999999999999999e-63

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto t \cdot \frac{\sqrt{2}}{\sqrt{2 \cdot \frac{\color{blue}{\ell \cdot \ell}}{x}}} \]
    9. Simplified45.0%

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

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

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

        \[\leadsto t \cdot \frac{\color{blue}{\sqrt{x}}}{\ell} \]
    12. Simplified39.1%

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

    if 4.2999999999999999e-63 < t

    1. Initial program 44.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 78.0% accurate, 2.1× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;1 + \left(\frac{0.5}{x \cdot x} + \frac{-1}{x}\right)\\


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

    1. Initial program 37.4%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{x} + \color{blue}{\sqrt{-1} \cdot \sqrt{-1}} \]
      2. rem-square-sqrt86.2%

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

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

    if -1.4499999999999999e-139 < t < 1.2199999999999999e-63

    1. Initial program 11.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. Step-by-step derivation
      1. fma-neg11.8%

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

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

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

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

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

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

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

      \[\leadsto \frac{\sqrt{2} \cdot t}{\sqrt{\color{blue}{2 \cdot \frac{2 \cdot {t}^{2} + {\ell}^{2}}{x} + 2 \cdot {t}^{2}}}} \]
    5. Step-by-step derivation
      1. distribute-lft-out54.8%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{t \cdot \sqrt{x}}{\ell}} \]
    9. Applied egg-rr39.1%

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

    if 1.2199999999999999e-63 < t

    1. Initial program 44.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 75.9% accurate, 17.2× speedup?

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


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

    1. Initial program 30.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.999999999999985e-310 < t

    1. Initial program 35.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 75.4% 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 30.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.999999999999985e-310 < t

    1. Initial program 35.1%

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

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

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

      \[\leadsto \color{blue}{\sqrt{0.5} \cdot \sqrt{2}} \]
    5. Step-by-step derivation
      1. *-commutative73.2%

        \[\leadsto \color{blue}{\sqrt{2} \cdot \sqrt{0.5}} \]
    6. Simplified73.2%

      \[\leadsto \color{blue}{\sqrt{2} \cdot \sqrt{0.5}} \]
    7. Step-by-step derivation
      1. sqrt-unprod74.3%

        \[\leadsto \color{blue}{\sqrt{2 \cdot 0.5}} \]
      2. metadata-eval74.3%

        \[\leadsto \sqrt{\color{blue}{1}} \]
      3. metadata-eval74.3%

        \[\leadsto \color{blue}{1} \]
    8. Applied egg-rr74.3%

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

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

Alternative 8: 75.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 30.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.999999999999985e-310 < t

    1. Initial program 35.1%

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

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

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

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

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

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

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

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

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

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

    \[\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 9: 75.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 30.8%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{-1} \]
    8. Simplified74.1%

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

    if -4.999999999999985e-310 < t

    1. Initial program 35.1%

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

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

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

      \[\leadsto \color{blue}{\sqrt{0.5} \cdot \sqrt{2}} \]
    5. Step-by-step derivation
      1. *-commutative73.2%

        \[\leadsto \color{blue}{\sqrt{2} \cdot \sqrt{0.5}} \]
    6. Simplified73.2%

      \[\leadsto \color{blue}{\sqrt{2} \cdot \sqrt{0.5}} \]
    7. Step-by-step derivation
      1. sqrt-unprod74.3%

        \[\leadsto \color{blue}{\sqrt{2 \cdot 0.5}} \]
      2. metadata-eval74.3%

        \[\leadsto \sqrt{\color{blue}{1}} \]
      3. metadata-eval74.3%

        \[\leadsto \color{blue}{1} \]
    8. Applied egg-rr74.3%

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

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

Alternative 10: 38.6% accurate, 225.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1} \]
  8. Simplified36.8%

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

    \[\leadsto -1 \]

Reproduce

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