Toniolo and Linder, Equation (7)

Percentage Accurate: 33.2% → 85.4%
Time: 23.9s
Alternatives: 12
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 12 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.2% 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: 85.4% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -1.8 \cdot 10^{+127}:\\ \;\;\;\;-\sqrt{\frac{x + -1}{x + 1}}\\ \mathbf{elif}\;t \leq 1.15 \cdot 10^{+37}:\\ \;\;\;\;t \cdot \frac{\sqrt{2}}{\sqrt{2 \cdot \left(t \cdot \left(t + \frac{t}{x}\right)\right) + \frac{\ell}{x} \cdot \left(\ell + \ell\right)}}\\ \mathbf{else}:\\ \;\;\;\;1 + \frac{-1}{x}\\ \end{array} \end{array} \]
(FPCore (x l t)
 :precision binary64
 (if (<= t -1.8e+127)
   (- (sqrt (/ (+ x -1.0) (+ x 1.0))))
   (if (<= t 1.15e+37)
     (*
      t
      (/
       (sqrt 2.0)
       (sqrt (+ (* 2.0 (* t (+ t (/ t x)))) (* (/ l x) (+ l l))))))
     (+ 1.0 (/ -1.0 x)))))
double code(double x, double l, double t) {
	double tmp;
	if (t <= -1.8e+127) {
		tmp = -sqrt(((x + -1.0) / (x + 1.0)));
	} else if (t <= 1.15e+37) {
		tmp = t * (sqrt(2.0) / sqrt(((2.0 * (t * (t + (t / x)))) + ((l / x) * (l + l)))));
	} else {
		tmp = 1.0 + (-1.0 / x);
	}
	return tmp;
}
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+127)) then
        tmp = -sqrt(((x + (-1.0d0)) / (x + 1.0d0)))
    else if (t <= 1.15d+37) then
        tmp = t * (sqrt(2.0d0) / sqrt(((2.0d0 * (t * (t + (t / x)))) + ((l / x) * (l + l)))))
    else
        tmp = 1.0d0 + ((-1.0d0) / x)
    end if
    code = tmp
end function
public static double code(double x, double l, double t) {
	double tmp;
	if (t <= -1.8e+127) {
		tmp = -Math.sqrt(((x + -1.0) / (x + 1.0)));
	} else if (t <= 1.15e+37) {
		tmp = t * (Math.sqrt(2.0) / Math.sqrt(((2.0 * (t * (t + (t / x)))) + ((l / x) * (l + l)))));
	} else {
		tmp = 1.0 + (-1.0 / x);
	}
	return tmp;
}
def code(x, l, t):
	tmp = 0
	if t <= -1.8e+127:
		tmp = -math.sqrt(((x + -1.0) / (x + 1.0)))
	elif t <= 1.15e+37:
		tmp = t * (math.sqrt(2.0) / math.sqrt(((2.0 * (t * (t + (t / x)))) + ((l / x) * (l + l)))))
	else:
		tmp = 1.0 + (-1.0 / x)
	return tmp
function code(x, l, t)
	tmp = 0.0
	if (t <= -1.8e+127)
		tmp = Float64(-sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0))));
	elseif (t <= 1.15e+37)
		tmp = Float64(t * Float64(sqrt(2.0) / sqrt(Float64(Float64(2.0 * Float64(t * Float64(t + Float64(t / x)))) + Float64(Float64(l / x) * Float64(l + l))))));
	else
		tmp = Float64(1.0 + Float64(-1.0 / x));
	end
	return tmp
end
function tmp_2 = code(x, l, t)
	tmp = 0.0;
	if (t <= -1.8e+127)
		tmp = -sqrt(((x + -1.0) / (x + 1.0)));
	elseif (t <= 1.15e+37)
		tmp = t * (sqrt(2.0) / sqrt(((2.0 * (t * (t + (t / x)))) + ((l / x) * (l + l)))));
	else
		tmp = 1.0 + (-1.0 / x);
	end
	tmp_2 = tmp;
end
code[x_, l_, t_] := If[LessEqual[t, -1.8e+127], (-N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), If[LessEqual[t, 1.15e+37], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[Sqrt[N[(N[(2.0 * N[(t * N[(t + N[(t / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(l / x), $MachinePrecision] * N[(l + l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.8 \cdot 10^{+127}:\\
\;\;\;\;-\sqrt{\frac{x + -1}{x + 1}}\\

\mathbf{elif}\;t \leq 1.15 \cdot 10^{+37}:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{\sqrt{2 \cdot \left(t \cdot \left(t + \frac{t}{x}\right)\right) + \frac{\ell}{x} \cdot \left(\ell + \ell\right)}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -1.79999999999999989e127

    1. Initial program 14.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.79999999999999989e127 < t < 1.15000000000000001e37

    1. Initial program 34.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/34.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. Simplified34.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 61.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt{2}}{\color{blue}{e^{\mathsf{log1p}\left(\sqrt{\frac{\ell \cdot \ell}{x} + \left(2 \cdot \left(\frac{t \cdot t}{x} + t \cdot t\right) - \frac{\ell \cdot \left(-\ell\right)}{x}\right)}\right)} - 1}} \cdot t \]
    11. Applied egg-rr45.9%

      \[\leadsto \frac{\sqrt{2}}{\color{blue}{e^{\mathsf{log1p}\left(\sqrt{\frac{\ell}{\frac{x}{\ell}} + \left(2 \cdot \mathsf{fma}\left(t, t, \frac{t}{\frac{x}{t}}\right) - \frac{\ell}{\frac{x}{-\ell}}\right)}\right)} - 1}} \cdot t \]
    12. Step-by-step derivation
      1. expm1-def73.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.15000000000000001e37 < t

    1. Initial program 38.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-*r/38.8%

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

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

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

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

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

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

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

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

      \[\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.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.8 \cdot 10^{+127}:\\ \;\;\;\;-\sqrt{\frac{x + -1}{x + 1}}\\ \mathbf{elif}\;t \leq 1.15 \cdot 10^{+37}:\\ \;\;\;\;t \cdot \frac{\sqrt{2}}{\sqrt{2 \cdot \left(t \cdot \left(t + \frac{t}{x}\right)\right) + \frac{\ell}{x} \cdot \left(\ell + \ell\right)}}\\ \mathbf{else}:\\ \;\;\;\;1 + \frac{-1}{x}\\ \end{array} \]

Alternative 2: 77.1% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \sqrt{\frac{x + -1}{x + 1}}\\ \mathbf{if}\;t \leq -1.35 \cdot 10^{-276}:\\ \;\;\;\;-t_1\\ \mathbf{elif}\;t \leq 7.2 \cdot 10^{-149}:\\ \;\;\;\;\sqrt{2} \cdot \left(t \cdot \sqrt{\frac{x}{\ell \cdot \left(\ell + \ell\right)}}\right)\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x l t)
 :precision binary64
 (let* ((t_1 (sqrt (/ (+ x -1.0) (+ x 1.0)))))
   (if (<= t -1.35e-276)
     (- t_1)
     (if (<= t 7.2e-149)
       (* (sqrt 2.0) (* t (sqrt (/ x (* l (+ l l))))))
       t_1))))
double code(double x, double l, double t) {
	double t_1 = sqrt(((x + -1.0) / (x + 1.0)));
	double tmp;
	if (t <= -1.35e-276) {
		tmp = -t_1;
	} else if (t <= 7.2e-149) {
		tmp = sqrt(2.0) * (t * sqrt((x / (l * (l + l)))));
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, l, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: l
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: tmp
    t_1 = sqrt(((x + (-1.0d0)) / (x + 1.0d0)))
    if (t <= (-1.35d-276)) then
        tmp = -t_1
    else if (t <= 7.2d-149) then
        tmp = sqrt(2.0d0) * (t * sqrt((x / (l * (l + l)))))
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double l, double t) {
	double t_1 = Math.sqrt(((x + -1.0) / (x + 1.0)));
	double tmp;
	if (t <= -1.35e-276) {
		tmp = -t_1;
	} else if (t <= 7.2e-149) {
		tmp = Math.sqrt(2.0) * (t * Math.sqrt((x / (l * (l + l)))));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, l, t):
	t_1 = math.sqrt(((x + -1.0) / (x + 1.0)))
	tmp = 0
	if t <= -1.35e-276:
		tmp = -t_1
	elif t <= 7.2e-149:
		tmp = math.sqrt(2.0) * (t * math.sqrt((x / (l * (l + l)))))
	else:
		tmp = t_1
	return tmp
function code(x, l, t)
	t_1 = sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0)))
	tmp = 0.0
	if (t <= -1.35e-276)
		tmp = Float64(-t_1);
	elseif (t <= 7.2e-149)
		tmp = Float64(sqrt(2.0) * Float64(t * sqrt(Float64(x / Float64(l * Float64(l + l))))));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, l, t)
	t_1 = sqrt(((x + -1.0) / (x + 1.0)));
	tmp = 0.0;
	if (t <= -1.35e-276)
		tmp = -t_1;
	elseif (t <= 7.2e-149)
		tmp = sqrt(2.0) * (t * sqrt((x / (l * (l + l)))));
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, l_, t_] := Block[{t$95$1 = N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, -1.35e-276], (-t$95$1), If[LessEqual[t, 7.2e-149], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t * N[Sqrt[N[(x / N[(l * N[(l + l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \sqrt{\frac{x + -1}{x + 1}}\\
\mathbf{if}\;t \leq -1.35 \cdot 10^{-276}:\\
\;\;\;\;-t_1\\

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

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


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

    1. Initial program 29.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-*r/29.1%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\sqrt{2} \cdot \frac{t}{\sqrt{\mathsf{fma}\left(\frac{x + 1}{x + -1}, \mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right), \ell \cdot \left(-\ell\right)\right)}}} \]
    4. Applied egg-rr65.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 t around -inf 76.2%

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

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

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

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

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

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

    if -1.34999999999999993e-276 < t < 7.2000000000000004e-149

    1. Initial program 6.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*6.8%

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

        \[\leadsto \frac{\sqrt{2}}{\frac{\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)}}}{t}} \]
      3. remove-double-neg6.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt{2}}{\frac{\sqrt{\frac{\color{blue}{\ell \cdot \ell} - -1 \cdot {\ell}^{2}}{x}}}{t}} \]
      2. neg-mul-154.3%

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

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

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

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

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

        \[\leadsto \color{blue}{\sqrt{2} \cdot \left(t \cdot \sqrt{\frac{x}{{\ell}^{2} - -1 \cdot {\ell}^{2}}}\right)} \]
      2. cancel-sign-sub-inv54.2%

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

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

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

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

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

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

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

    if 7.2000000000000004e-149 < t

    1. Initial program 42.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-*r/42.1%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.35 \cdot 10^{-276}:\\ \;\;\;\;-\sqrt{\frac{x + -1}{x + 1}}\\ \mathbf{elif}\;t \leq 7.2 \cdot 10^{-149}:\\ \;\;\;\;\sqrt{2} \cdot \left(t \cdot \sqrt{\frac{x}{\ell \cdot \left(\ell + \ell\right)}}\right)\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\ \end{array} \]

Alternative 3: 77.3% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \sqrt{\frac{x + -1}{x + 1}}\\ \mathbf{if}\;t \leq -7.5 \cdot 10^{-277}:\\ \;\;\;\;-t_1\\ \mathbf{elif}\;t \leq 2.4 \cdot 10^{-130}:\\ \;\;\;\;\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{\frac{x}{\ell}}{\ell + \ell}}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x l t)
 :precision binary64
 (let* ((t_1 (sqrt (/ (+ x -1.0) (+ x 1.0)))))
   (if (<= t -7.5e-277)
     (- t_1)
     (if (<= t 2.4e-130)
       (* (* t (sqrt 2.0)) (sqrt (/ (/ x l) (+ l l))))
       t_1))))
double code(double x, double l, double t) {
	double t_1 = sqrt(((x + -1.0) / (x + 1.0)));
	double tmp;
	if (t <= -7.5e-277) {
		tmp = -t_1;
	} else if (t <= 2.4e-130) {
		tmp = (t * sqrt(2.0)) * sqrt(((x / l) / (l + l)));
	} else {
		tmp = t_1;
	}
	return tmp;
}
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 <= (-7.5d-277)) then
        tmp = -t_1
    else if (t <= 2.4d-130) then
        tmp = (t * sqrt(2.0d0)) * sqrt(((x / l) / (l + l)))
    else
        tmp = t_1
    end if
    code = tmp
end function
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 <= -7.5e-277) {
		tmp = -t_1;
	} else if (t <= 2.4e-130) {
		tmp = (t * Math.sqrt(2.0)) * Math.sqrt(((x / l) / (l + l)));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, l, t):
	t_1 = math.sqrt(((x + -1.0) / (x + 1.0)))
	tmp = 0
	if t <= -7.5e-277:
		tmp = -t_1
	elif t <= 2.4e-130:
		tmp = (t * math.sqrt(2.0)) * math.sqrt(((x / l) / (l + l)))
	else:
		tmp = t_1
	return tmp
function code(x, l, t)
	t_1 = sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0)))
	tmp = 0.0
	if (t <= -7.5e-277)
		tmp = Float64(-t_1);
	elseif (t <= 2.4e-130)
		tmp = Float64(Float64(t * sqrt(2.0)) * sqrt(Float64(Float64(x / l) / Float64(l + l))));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, l, t)
	t_1 = sqrt(((x + -1.0) / (x + 1.0)));
	tmp = 0.0;
	if (t <= -7.5e-277)
		tmp = -t_1;
	elseif (t <= 2.4e-130)
		tmp = (t * sqrt(2.0)) * sqrt(((x / l) / (l + l)));
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
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, -7.5e-277], (-t$95$1), If[LessEqual[t, 2.4e-130], N[(N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[(x / l), $MachinePrecision] / N[(l + l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \sqrt{\frac{x + -1}{x + 1}}\\
\mathbf{if}\;t \leq -7.5 \cdot 10^{-277}:\\
\;\;\;\;-t_1\\

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

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


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

    1. Initial program 29.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-*r/29.1%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\sqrt{2} \cdot \frac{t}{\sqrt{\mathsf{fma}\left(\frac{x + 1}{x + -1}, \mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right), \ell \cdot \left(-\ell\right)\right)}}} \]
    4. Applied egg-rr65.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 t around -inf 76.2%

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

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

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

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

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

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

    if -7.49999999999999971e-277 < t < 2.39999999999999997e-130

    1. Initial program 9.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*9.3%

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

        \[\leadsto \frac{\sqrt{2}}{\frac{\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)}}}{t}} \]
      3. remove-double-neg9.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt{2}}{\frac{\sqrt{\frac{\color{blue}{\ell \cdot \ell} - -1 \cdot {\ell}^{2}}{x}}}{t}} \]
      2. neg-mul-152.5%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\sqrt{2} \cdot t\right) \cdot \sqrt{\frac{x}{{\ell}^{2} - \left(-\color{blue}{\ell \cdot \ell}\right)}} \]
      3. distribute-rgt-neg-out52.5%

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

        \[\leadsto \left(\sqrt{2} \cdot t\right) \cdot \sqrt{\frac{x}{\color{blue}{\ell \cdot \ell} - \ell \cdot \left(-\ell\right)}} \]
      5. distribute-lft-out--52.5%

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

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

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

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

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

    if 2.39999999999999997e-130 < t

    1. Initial program 42.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-*r/42.3%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\sqrt{2} \cdot \frac{t}{\sqrt{\mathsf{fma}\left(\frac{x + 1}{x + -1}, \mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right), \ell \cdot \left(-\ell\right)\right)}}} \]
    4. Applied egg-rr69.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 83.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -7.5 \cdot 10^{-277}:\\ \;\;\;\;-\sqrt{\frac{x + -1}{x + 1}}\\ \mathbf{elif}\;t \leq 2.4 \cdot 10^{-130}:\\ \;\;\;\;\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{\frac{x}{\ell}}{\ell + \ell}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\ \end{array} \]

Alternative 4: 77.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \sqrt{\frac{x + -1}{x + 1}}\\ \mathbf{if}\;t \leq -1.12 \cdot 10^{-218}:\\ \;\;\;\;-t_1\\ \mathbf{elif}\;t \leq 1.2 \cdot 10^{-129}:\\ \;\;\;\;t \cdot \frac{\sqrt{2}}{\sqrt{\frac{\ell}{\frac{x}{\ell + \ell}}}}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x l t)
 :precision binary64
 (let* ((t_1 (sqrt (/ (+ x -1.0) (+ x 1.0)))))
   (if (<= t -1.12e-218)
     (- t_1)
     (if (<= t 1.2e-129)
       (* t (/ (sqrt 2.0) (sqrt (/ l (/ x (+ l l))))))
       t_1))))
double code(double x, double l, double t) {
	double t_1 = sqrt(((x + -1.0) / (x + 1.0)));
	double tmp;
	if (t <= -1.12e-218) {
		tmp = -t_1;
	} else if (t <= 1.2e-129) {
		tmp = t * (sqrt(2.0) / sqrt((l / (x / (l + l)))));
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, l, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: l
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: tmp
    t_1 = sqrt(((x + (-1.0d0)) / (x + 1.0d0)))
    if (t <= (-1.12d-218)) then
        tmp = -t_1
    else if (t <= 1.2d-129) then
        tmp = t * (sqrt(2.0d0) / sqrt((l / (x / (l + l)))))
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double l, double t) {
	double t_1 = Math.sqrt(((x + -1.0) / (x + 1.0)));
	double tmp;
	if (t <= -1.12e-218) {
		tmp = -t_1;
	} else if (t <= 1.2e-129) {
		tmp = t * (Math.sqrt(2.0) / Math.sqrt((l / (x / (l + l)))));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, l, t):
	t_1 = math.sqrt(((x + -1.0) / (x + 1.0)))
	tmp = 0
	if t <= -1.12e-218:
		tmp = -t_1
	elif t <= 1.2e-129:
		tmp = t * (math.sqrt(2.0) / math.sqrt((l / (x / (l + l)))))
	else:
		tmp = t_1
	return tmp
function code(x, l, t)
	t_1 = sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0)))
	tmp = 0.0
	if (t <= -1.12e-218)
		tmp = Float64(-t_1);
	elseif (t <= 1.2e-129)
		tmp = Float64(t * Float64(sqrt(2.0) / sqrt(Float64(l / Float64(x / Float64(l + l))))));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, l, t)
	t_1 = sqrt(((x + -1.0) / (x + 1.0)));
	tmp = 0.0;
	if (t <= -1.12e-218)
		tmp = -t_1;
	elseif (t <= 1.2e-129)
		tmp = t * (sqrt(2.0) / sqrt((l / (x / (l + l)))));
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, l_, t_] := Block[{t$95$1 = N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, -1.12e-218], (-t$95$1), If[LessEqual[t, 1.2e-129], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[Sqrt[N[(l / N[(x / N[(l + l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \sqrt{\frac{x + -1}{x + 1}}\\
\mathbf{if}\;t \leq -1.12 \cdot 10^{-218}:\\
\;\;\;\;-t_1\\

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

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


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

    1. Initial program 31.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.11999999999999996e-218 < t < 1.19999999999999994e-129

    1. Initial program 7.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/7.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} \]
    3. Simplified7.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.19999999999999994e-129 < t

    1. Initial program 42.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-*r/42.3%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\sqrt{2} \cdot \frac{t}{\sqrt{\mathsf{fma}\left(\frac{x + 1}{x + -1}, \mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right), \ell \cdot \left(-\ell\right)\right)}}} \]
    4. Applied egg-rr69.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 83.0%

      \[\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 -1.12 \cdot 10^{-218}:\\ \;\;\;\;-\sqrt{\frac{x + -1}{x + 1}}\\ \mathbf{elif}\;t \leq 1.2 \cdot 10^{-129}:\\ \;\;\;\;t \cdot \frac{\sqrt{2}}{\sqrt{\frac{\ell}{\frac{x}{\ell + \ell}}}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\ \end{array} \]

Alternative 5: 75.6% accurate, 2.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.2 \cdot 10^{-277}:\\
\;\;\;\;-1 + \frac{1}{x}\\

\mathbf{elif}\;t \leq 4 \cdot 10^{-150}:\\
\;\;\;\;\sqrt{x} \cdot \left(-\frac{t}{\ell}\right)\\

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


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

    1. Initial program 29.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-*r/29.1%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\sqrt{2} \cdot \frac{t}{\sqrt{\mathsf{fma}\left(\frac{x + 1}{x + -1}, \mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right), \ell \cdot \left(-\ell\right)\right)}}} \]
    4. Applied egg-rr65.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 1.8%

      \[\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} + \frac{1}{x}} \]
    7. Step-by-step derivation
      1. unpow20.0%

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

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

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

    if -3.1999999999999998e-277 < t < 4.00000000000000003e-150

    1. Initial program 6.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*6.8%

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

        \[\leadsto \frac{\sqrt{2}}{\frac{\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)}}}{t}} \]
      3. remove-double-neg6.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt{2}}{\frac{\sqrt{\frac{\color{blue}{\ell \cdot \ell} - -1 \cdot {\ell}^{2}}{x}}}{t}} \]
      2. neg-mul-154.3%

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

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

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

      \[\leadsto \frac{\sqrt{2}}{\frac{\sqrt{\color{blue}{\frac{\ell \cdot \ell - \ell \cdot \left(-\ell\right)}{x}}}}{t}} \]
    10. Taylor expanded in l around -inf 51.4%

      \[\leadsto \color{blue}{-1 \cdot \left(\frac{t}{\ell} \cdot \sqrt{x}\right)} \]
    11. Step-by-step derivation
      1. mul-1-neg51.4%

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

        \[\leadsto -\color{blue}{\sqrt{x} \cdot \frac{t}{\ell}} \]
      3. distribute-rgt-neg-in51.4%

        \[\leadsto \color{blue}{\sqrt{x} \cdot \left(-\frac{t}{\ell}\right)} \]
    12. Simplified51.4%

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

    if 4.00000000000000003e-150 < t

    1. Initial program 42.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-*r/42.1%

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

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

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

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

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

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

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

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

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

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

Alternative 6: 76.0% accurate, 2.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \sqrt{\frac{x + -1}{x + 1}}\\ \mathbf{if}\;t \leq -1.35 \cdot 10^{-276}:\\ \;\;\;\;-t_1\\ \mathbf{elif}\;t \leq 4 \cdot 10^{-150}:\\ \;\;\;\;\sqrt{x} \cdot \left(-\frac{t}{\ell}\right)\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x l t)
 :precision binary64
 (let* ((t_1 (sqrt (/ (+ x -1.0) (+ x 1.0)))))
   (if (<= t -1.35e-276)
     (- t_1)
     (if (<= t 4e-150) (* (sqrt x) (- (/ t l))) t_1))))
double code(double x, double l, double t) {
	double t_1 = sqrt(((x + -1.0) / (x + 1.0)));
	double tmp;
	if (t <= -1.35e-276) {
		tmp = -t_1;
	} else if (t <= 4e-150) {
		tmp = sqrt(x) * -(t / l);
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, l, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: l
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: tmp
    t_1 = sqrt(((x + (-1.0d0)) / (x + 1.0d0)))
    if (t <= (-1.35d-276)) then
        tmp = -t_1
    else if (t <= 4d-150) then
        tmp = sqrt(x) * -(t / l)
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double l, double t) {
	double t_1 = Math.sqrt(((x + -1.0) / (x + 1.0)));
	double tmp;
	if (t <= -1.35e-276) {
		tmp = -t_1;
	} else if (t <= 4e-150) {
		tmp = Math.sqrt(x) * -(t / l);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, l, t):
	t_1 = math.sqrt(((x + -1.0) / (x + 1.0)))
	tmp = 0
	if t <= -1.35e-276:
		tmp = -t_1
	elif t <= 4e-150:
		tmp = math.sqrt(x) * -(t / l)
	else:
		tmp = t_1
	return tmp
function code(x, l, t)
	t_1 = sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0)))
	tmp = 0.0
	if (t <= -1.35e-276)
		tmp = Float64(-t_1);
	elseif (t <= 4e-150)
		tmp = Float64(sqrt(x) * Float64(-Float64(t / l)));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, l, t)
	t_1 = sqrt(((x + -1.0) / (x + 1.0)));
	tmp = 0.0;
	if (t <= -1.35e-276)
		tmp = -t_1;
	elseif (t <= 4e-150)
		tmp = sqrt(x) * -(t / l);
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, l_, t_] := Block[{t$95$1 = N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, -1.35e-276], (-t$95$1), If[LessEqual[t, 4e-150], N[(N[Sqrt[x], $MachinePrecision] * (-N[(t / l), $MachinePrecision])), $MachinePrecision], t$95$1]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \sqrt{\frac{x + -1}{x + 1}}\\
\mathbf{if}\;t \leq -1.35 \cdot 10^{-276}:\\
\;\;\;\;-t_1\\

\mathbf{elif}\;t \leq 4 \cdot 10^{-150}:\\
\;\;\;\;\sqrt{x} \cdot \left(-\frac{t}{\ell}\right)\\

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


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

    1. Initial program 29.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-*r/29.1%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\sqrt{2} \cdot \frac{t}{\sqrt{\mathsf{fma}\left(\frac{x + 1}{x + -1}, \mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right), \ell \cdot \left(-\ell\right)\right)}}} \]
    4. Applied egg-rr65.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 t around -inf 76.2%

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

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

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

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

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

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

    if -1.34999999999999993e-276 < t < 4.00000000000000003e-150

    1. Initial program 6.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*6.8%

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

        \[\leadsto \frac{\sqrt{2}}{\frac{\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)}}}{t}} \]
      3. remove-double-neg6.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt{2}}{\frac{\sqrt{\frac{\color{blue}{\ell \cdot \ell} - -1 \cdot {\ell}^{2}}{x}}}{t}} \]
      2. neg-mul-154.3%

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

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

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

      \[\leadsto \frac{\sqrt{2}}{\frac{\sqrt{\color{blue}{\frac{\ell \cdot \ell - \ell \cdot \left(-\ell\right)}{x}}}}{t}} \]
    10. Taylor expanded in l around -inf 51.4%

      \[\leadsto \color{blue}{-1 \cdot \left(\frac{t}{\ell} \cdot \sqrt{x}\right)} \]
    11. Step-by-step derivation
      1. mul-1-neg51.4%

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

        \[\leadsto -\color{blue}{\sqrt{x} \cdot \frac{t}{\ell}} \]
      3. distribute-rgt-neg-in51.4%

        \[\leadsto \color{blue}{\sqrt{x} \cdot \left(-\frac{t}{\ell}\right)} \]
    12. Simplified51.4%

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

    if 4.00000000000000003e-150 < t

    1. Initial program 42.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-*r/42.1%

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

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

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

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

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

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

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

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

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

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

Alternative 7: 75.4% accurate, 2.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -4.1 \cdot 10^{-277}:\\ \;\;\;\;-1 + \frac{1}{x}\\ \mathbf{elif}\;t \leq 5.5 \cdot 10^{-150}:\\ \;\;\;\;\sqrt{x} \cdot \left(-\frac{t}{\ell}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(1 + \frac{0.5}{x \cdot x}\right) + \frac{-1}{x}\\ \end{array} \end{array} \]
(FPCore (x l t)
 :precision binary64
 (if (<= t -4.1e-277)
   (+ -1.0 (/ 1.0 x))
   (if (<= t 5.5e-150)
     (* (sqrt x) (- (/ t l)))
     (+ (+ 1.0 (/ 0.5 (* x x))) (/ -1.0 x)))))
double code(double x, double l, double t) {
	double tmp;
	if (t <= -4.1e-277) {
		tmp = -1.0 + (1.0 / x);
	} else if (t <= 5.5e-150) {
		tmp = sqrt(x) * -(t / l);
	} else {
		tmp = (1.0 + (0.5 / (x * x))) + (-1.0 / x);
	}
	return tmp;
}
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 <= (-4.1d-277)) then
        tmp = (-1.0d0) + (1.0d0 / x)
    else if (t <= 5.5d-150) then
        tmp = sqrt(x) * -(t / l)
    else
        tmp = (1.0d0 + (0.5d0 / (x * x))) + ((-1.0d0) / x)
    end if
    code = tmp
end function
public static double code(double x, double l, double t) {
	double tmp;
	if (t <= -4.1e-277) {
		tmp = -1.0 + (1.0 / x);
	} else if (t <= 5.5e-150) {
		tmp = Math.sqrt(x) * -(t / l);
	} else {
		tmp = (1.0 + (0.5 / (x * x))) + (-1.0 / x);
	}
	return tmp;
}
def code(x, l, t):
	tmp = 0
	if t <= -4.1e-277:
		tmp = -1.0 + (1.0 / x)
	elif t <= 5.5e-150:
		tmp = math.sqrt(x) * -(t / l)
	else:
		tmp = (1.0 + (0.5 / (x * x))) + (-1.0 / x)
	return tmp
function code(x, l, t)
	tmp = 0.0
	if (t <= -4.1e-277)
		tmp = Float64(-1.0 + Float64(1.0 / x));
	elseif (t <= 5.5e-150)
		tmp = Float64(sqrt(x) * Float64(-Float64(t / l)));
	else
		tmp = Float64(Float64(1.0 + Float64(0.5 / Float64(x * x))) + Float64(-1.0 / x));
	end
	return tmp
end
function tmp_2 = code(x, l, t)
	tmp = 0.0;
	if (t <= -4.1e-277)
		tmp = -1.0 + (1.0 / x);
	elseif (t <= 5.5e-150)
		tmp = sqrt(x) * -(t / l);
	else
		tmp = (1.0 + (0.5 / (x * x))) + (-1.0 / x);
	end
	tmp_2 = tmp;
end
code[x_, l_, t_] := If[LessEqual[t, -4.1e-277], N[(-1.0 + N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5.5e-150], N[(N[Sqrt[x], $MachinePrecision] * (-N[(t / l), $MachinePrecision])), $MachinePrecision], N[(N[(1.0 + N[(0.5 / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.1 \cdot 10^{-277}:\\
\;\;\;\;-1 + \frac{1}{x}\\

\mathbf{elif}\;t \leq 5.5 \cdot 10^{-150}:\\
\;\;\;\;\sqrt{x} \cdot \left(-\frac{t}{\ell}\right)\\

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


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

    1. Initial program 29.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-*r/29.1%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\sqrt{2} \cdot \frac{t}{\sqrt{\mathsf{fma}\left(\frac{x + 1}{x + -1}, \mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right), \ell \cdot \left(-\ell\right)\right)}}} \]
    4. Applied egg-rr65.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 1.8%

      \[\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} + \frac{1}{x}} \]
    7. Step-by-step derivation
      1. unpow20.0%

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

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

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

    if -4.09999999999999989e-277 < t < 5.4999999999999996e-150

    1. Initial program 6.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*6.8%

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

        \[\leadsto \frac{\sqrt{2}}{\frac{\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)}}}{t}} \]
      3. remove-double-neg6.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt{2}}{\frac{\sqrt{\frac{\color{blue}{\ell \cdot \ell} - -1 \cdot {\ell}^{2}}{x}}}{t}} \]
      2. neg-mul-154.3%

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

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

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

      \[\leadsto \frac{\sqrt{2}}{\frac{\sqrt{\color{blue}{\frac{\ell \cdot \ell - \ell \cdot \left(-\ell\right)}{x}}}}{t}} \]
    10. Taylor expanded in l around -inf 51.4%

      \[\leadsto \color{blue}{-1 \cdot \left(\frac{t}{\ell} \cdot \sqrt{x}\right)} \]
    11. Step-by-step derivation
      1. mul-1-neg51.4%

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

        \[\leadsto -\color{blue}{\sqrt{x} \cdot \frac{t}{\ell}} \]
      3. distribute-rgt-neg-in51.4%

        \[\leadsto \color{blue}{\sqrt{x} \cdot \left(-\frac{t}{\ell}\right)} \]
    12. Simplified51.4%

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

    if 5.4999999999999996e-150 < t

    1. Initial program 42.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-*r/42.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 75.5% accurate, 17.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -5 \cdot 10^{-310}:\\ \;\;\;\;-1 + \frac{1}{x}\\ \mathbf{else}:\\ \;\;\;\;\left(1 + \frac{0.5}{x \cdot x}\right) + \frac{-1}{x}\\ \end{array} \end{array} \]
(FPCore (x l t)
 :precision binary64
 (if (<= t -5e-310) (+ -1.0 (/ 1.0 x)) (+ (+ 1.0 (/ 0.5 (* x x))) (/ -1.0 x))))
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;
}
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
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;
}
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
function code(x, l, t)
	tmp = 0.0
	if (t <= -5e-310)
		tmp = Float64(-1.0 + Float64(1.0 / x));
	else
		tmp = Float64(Float64(1.0 + Float64(0.5 / Float64(x * x))) + Float64(-1.0 / x));
	end
	return tmp
end
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
code[x_, l_, t_] := If[LessEqual[t, -5e-310], N[(-1.0 + N[(1.0 / x), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(0.5 / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

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

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


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

    1. Initial program 28.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-*r/28.1%

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

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

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

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

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

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

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

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

      \[\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.8%

      \[\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} + \frac{1}{x}} \]
    7. Step-by-step derivation
      1. unpow20.0%

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

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

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

    if -4.999999999999985e-310 < t

    1. Initial program 35.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-*r/35.3%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\sqrt{2} \cdot \frac{t}{\sqrt{\mathsf{fma}\left(\frac{x + 1}{x + -1}, \mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right), \ell \cdot \left(-\ell\right)\right)}}} \]
    4. Applied egg-rr64.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 72.8%

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

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

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

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

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

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

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

Alternative 9: 75.1% accurate, 31.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -5 \cdot 10^{-310}:\\ \;\;\;\;-1 + \frac{1}{x}\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \end{array} \]
(FPCore (x l t) :precision binary64 (if (<= t -5e-310) (+ -1.0 (/ 1.0 x)) 1.0))
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;
}
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
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;
}
def code(x, l, t):
	tmp = 0
	if t <= -5e-310:
		tmp = -1.0 + (1.0 / x)
	else:
		tmp = 1.0
	return tmp
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
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
code[x_, l_, t_] := If[LessEqual[t, -5e-310], N[(-1.0 + N[(1.0 / x), $MachinePrecision]), $MachinePrecision], 1.0]
\begin{array}{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 28.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-*r/28.1%

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

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

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

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

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

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

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

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

      \[\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.8%

      \[\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} + \frac{1}{x}} \]
    7. Step-by-step derivation
      1. unpow20.0%

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

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

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

    if -4.999999999999985e-310 < t

    1. Initial program 35.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/35.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} \]
    3. Simplified35.3%

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

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

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

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

        \[\leadsto \color{blue}{1} \]
    6. Applied egg-rr71.9%

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

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

Alternative 10: 75.4% accurate, 31.9× speedup?

\[\begin{array}{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} \]
(FPCore (x l t)
 :precision binary64
 (if (<= t -5e-310) (+ -1.0 (/ 1.0 x)) (+ 1.0 (/ -1.0 x))))
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;
}
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
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;
}
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
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
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
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}

\\
\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 28.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-*r/28.1%

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

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

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

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

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

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

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

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

      \[\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.8%

      \[\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} + \frac{1}{x}} \]
    7. Step-by-step derivation
      1. unpow20.0%

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

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

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

    if -4.999999999999985e-310 < t

    1. Initial program 35.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-*r/35.3%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\sqrt{2} \cdot \frac{t}{\sqrt{\mathsf{fma}\left(\frac{x + 1}{x + -1}, \mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right), \ell \cdot \left(-\ell\right)\right)}}} \]
    4. Applied egg-rr64.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 72.8%

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

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

    \[\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 11: 74.8% accurate, 73.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -5 \cdot 10^{-310}:\\ \;\;\;\;-1\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \end{array} \]
(FPCore (x l t) :precision binary64 (if (<= t -5e-310) -1.0 1.0))
double code(double x, double l, double t) {
	double tmp;
	if (t <= -5e-310) {
		tmp = -1.0;
	} else {
		tmp = 1.0;
	}
	return tmp;
}
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
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;
}
def code(x, l, t):
	tmp = 0
	if t <= -5e-310:
		tmp = -1.0
	else:
		tmp = 1.0
	return tmp
function code(x, l, t)
	tmp = 0.0
	if (t <= -5e-310)
		tmp = -1.0;
	else
		tmp = 1.0;
	end
	return tmp
end
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
code[x_, l_, t_] := If[LessEqual[t, -5e-310], -1.0, 1.0]
\begin{array}{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 28.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-*r/28.1%

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

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

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

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

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

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

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

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

      \[\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.8%

      \[\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-sqrt72.2%

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

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

    if -4.999999999999985e-310 < t

    1. Initial program 35.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/35.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} \]
    3. Simplified35.3%

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

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

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

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

        \[\leadsto \color{blue}{1} \]
    6. Applied egg-rr71.9%

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

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

Alternative 12: 38.2% accurate, 225.0× speedup?

\[\begin{array}{l} \\ -1 \end{array} \]
(FPCore (x l t) :precision binary64 -1.0)
double code(double x, double l, double t) {
	return -1.0;
}
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
public static double code(double x, double l, double t) {
	return -1.0;
}
def code(x, l, t):
	return -1.0
function code(x, l, t)
	return -1.0
end
function tmp = code(x, l, t)
	tmp = -1.0;
end
code[x_, l_, t_] := -1.0
\begin{array}{l}

\\
-1
\end{array}
Derivation
  1. Initial program 31.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-*r/31.6%

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{\sqrt{2} \cdot \frac{t}{\sqrt{\mathsf{fma}\left(\frac{x + 1}{x + -1}, \mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right), \ell \cdot \left(-\ell\right)\right)}}} \]
  4. Applied egg-rr64.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 36.5%

    \[\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-sqrt37.8%

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

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

    \[\leadsto -1 \]

Reproduce

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