Toniolo and Linder, Equation (7)

Percentage Accurate: 33.7% → 81.0%
Time: 5.9s
Alternatives: 7
Speedup: 3.3×

Specification

?
\[\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}} \]
(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)));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, l, t)
use fmin_fmax_functions
    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]
\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}}

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 7 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.7% accurate, 1.0× speedup?

\[\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}} \]
(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)));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, l, t)
use fmin_fmax_functions
    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]
\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}}

Alternative 1: 81.0% accurate, 0.6× speedup?

\[\begin{array}{l} t_1 := \sqrt{\frac{1}{x}}\\ \mathsf{copysign}\left(1, t\right) \cdot \begin{array}{l} \mathbf{if}\;\left|\ell\right| \leq 1.65 \cdot 10^{+191}:\\ \;\;\;\;\sqrt{\frac{-1}{\frac{-1 - x}{x - 1}}}\\ \mathbf{else}:\\ \;\;\;\;\left(-\left|t\right|\right) \cdot \frac{-1 \cdot \left(x \cdot \left(t\_1 - 0.5 \cdot \frac{1}{{x}^{2} \cdot t\_1}\right)\right)}{\left|\ell\right|}\\ \end{array} \end{array} \]
(FPCore (x l t)
 :precision binary64
 (let* ((t_1 (sqrt (/ 1.0 x))))
   (*
    (copysign 1.0 t)
    (if (<= (fabs l) 1.65e+191)
      (sqrt (/ -1.0 (/ (- -1.0 x) (- x 1.0))))
      (*
       (- (fabs t))
       (/
        (* -1.0 (* x (- t_1 (* 0.5 (/ 1.0 (* (pow x 2.0) t_1))))))
        (fabs l)))))))
double code(double x, double l, double t) {
	double t_1 = sqrt((1.0 / x));
	double tmp;
	if (fabs(l) <= 1.65e+191) {
		tmp = sqrt((-1.0 / ((-1.0 - x) / (x - 1.0))));
	} else {
		tmp = -fabs(t) * ((-1.0 * (x * (t_1 - (0.5 * (1.0 / (pow(x, 2.0) * t_1)))))) / fabs(l));
	}
	return copysign(1.0, t) * tmp;
}
public static double code(double x, double l, double t) {
	double t_1 = Math.sqrt((1.0 / x));
	double tmp;
	if (Math.abs(l) <= 1.65e+191) {
		tmp = Math.sqrt((-1.0 / ((-1.0 - x) / (x - 1.0))));
	} else {
		tmp = -Math.abs(t) * ((-1.0 * (x * (t_1 - (0.5 * (1.0 / (Math.pow(x, 2.0) * t_1)))))) / Math.abs(l));
	}
	return Math.copySign(1.0, t) * tmp;
}
def code(x, l, t):
	t_1 = math.sqrt((1.0 / x))
	tmp = 0
	if math.fabs(l) <= 1.65e+191:
		tmp = math.sqrt((-1.0 / ((-1.0 - x) / (x - 1.0))))
	else:
		tmp = -math.fabs(t) * ((-1.0 * (x * (t_1 - (0.5 * (1.0 / (math.pow(x, 2.0) * t_1)))))) / math.fabs(l))
	return math.copysign(1.0, t) * tmp
function code(x, l, t)
	t_1 = sqrt(Float64(1.0 / x))
	tmp = 0.0
	if (abs(l) <= 1.65e+191)
		tmp = sqrt(Float64(-1.0 / Float64(Float64(-1.0 - x) / Float64(x - 1.0))));
	else
		tmp = Float64(Float64(-abs(t)) * Float64(Float64(-1.0 * Float64(x * Float64(t_1 - Float64(0.5 * Float64(1.0 / Float64((x ^ 2.0) * t_1)))))) / abs(l)));
	end
	return Float64(copysign(1.0, t) * tmp)
end
function tmp_2 = code(x, l, t)
	t_1 = sqrt((1.0 / x));
	tmp = 0.0;
	if (abs(l) <= 1.65e+191)
		tmp = sqrt((-1.0 / ((-1.0 - x) / (x - 1.0))));
	else
		tmp = -abs(t) * ((-1.0 * (x * (t_1 - (0.5 * (1.0 / ((x ^ 2.0) * t_1)))))) / abs(l));
	end
	tmp_2 = (sign(t) * abs(1.0)) * tmp;
end
code[x_, l_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]}, N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[N[Abs[l], $MachinePrecision], 1.65e+191], N[Sqrt[N[(-1.0 / N[(N[(-1.0 - x), $MachinePrecision] / N[(x - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[((-N[Abs[t], $MachinePrecision]) * N[(N[(-1.0 * N[(x * N[(t$95$1 - N[(0.5 * N[(1.0 / N[(N[Power[x, 2.0], $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Abs[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
t_1 := \sqrt{\frac{1}{x}}\\
\mathsf{copysign}\left(1, t\right) \cdot \begin{array}{l}
\mathbf{if}\;\left|\ell\right| \leq 1.65 \cdot 10^{+191}:\\
\;\;\;\;\sqrt{\frac{-1}{\frac{-1 - x}{x - 1}}}\\

\mathbf{else}:\\
\;\;\;\;\left(-\left|t\right|\right) \cdot \frac{-1 \cdot \left(x \cdot \left(t\_1 - 0.5 \cdot \frac{1}{{x}^{2} \cdot t\_1}\right)\right)}{\left|\ell\right|}\\


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

    1. Initial program 33.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. Taylor expanded in t around inf

      \[\leadsto \color{blue}{\frac{\sqrt{2}}{\sqrt{2 \cdot \frac{1 + x}{x - 1}}}} \]
    3. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \frac{\sqrt{2}}{\color{blue}{\sqrt{2 \cdot \frac{1 + x}{x - 1}}}} \]
      2. lower-sqrt.f64N/A

        \[\leadsto \frac{\sqrt{2}}{\sqrt{\color{blue}{2 \cdot \frac{1 + x}{x - 1}}}} \]
      3. lower-sqrt.f64N/A

        \[\leadsto \frac{\sqrt{2}}{\sqrt{2 \cdot \frac{1 + x}{x - 1}}} \]
      4. lower-*.f64N/A

        \[\leadsto \frac{\sqrt{2}}{\sqrt{2 \cdot \frac{1 + x}{x - 1}}} \]
      5. lower-/.f64N/A

        \[\leadsto \frac{\sqrt{2}}{\sqrt{2 \cdot \frac{1 + x}{x - 1}}} \]
      6. lower-+.f64N/A

        \[\leadsto \frac{\sqrt{2}}{\sqrt{2 \cdot \frac{1 + x}{x - 1}}} \]
      7. lower--.f6438.8

        \[\leadsto \frac{\sqrt{2}}{\sqrt{2 \cdot \frac{1 + x}{x - 1}}} \]
    4. Applied rewrites38.8%

      \[\leadsto \color{blue}{\frac{\sqrt{2}}{\sqrt{2 \cdot \frac{1 + x}{x - 1}}}} \]
    5. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \frac{\sqrt{2}}{\color{blue}{\sqrt{2 \cdot \frac{1 + x}{x - 1}}}} \]
      2. lift-sqrt.f64N/A

        \[\leadsto \frac{\sqrt{2}}{\sqrt{\color{blue}{2 \cdot \frac{1 + x}{x - 1}}}} \]
      3. lift-sqrt.f64N/A

        \[\leadsto \frac{\sqrt{2}}{\sqrt{2 \cdot \frac{1 + x}{x - 1}}} \]
      4. sqrt-undivN/A

        \[\leadsto \sqrt{\frac{2}{2 \cdot \frac{1 + x}{x - 1}}} \]
      5. lower-sqrt.f64N/A

        \[\leadsto \sqrt{\frac{2}{2 \cdot \frac{1 + x}{x - 1}}} \]
      6. lift-*.f64N/A

        \[\leadsto \sqrt{\frac{2}{2 \cdot \frac{1 + x}{x - 1}}} \]
      7. associate-/r*N/A

        \[\leadsto \sqrt{\frac{\frac{2}{2}}{\frac{1 + x}{x - 1}}} \]
      8. metadata-evalN/A

        \[\leadsto \sqrt{\frac{1}{\frac{1 + x}{x - 1}}} \]
      9. metadata-evalN/A

        \[\leadsto \sqrt{\frac{\mathsf{neg}\left(-1\right)}{\frac{1 + x}{x - 1}}} \]
      10. lift-+.f64N/A

        \[\leadsto \sqrt{\frac{\mathsf{neg}\left(-1\right)}{\frac{1 + x}{x - 1}}} \]
      11. +-commutativeN/A

        \[\leadsto \sqrt{\frac{\mathsf{neg}\left(-1\right)}{\frac{x + 1}{x - 1}}} \]
      12. lower-/.f64N/A

        \[\leadsto \sqrt{\frac{\mathsf{neg}\left(-1\right)}{\frac{x + 1}{x - 1}}} \]
      13. frac-2negN/A

        \[\leadsto \sqrt{\frac{\mathsf{neg}\left(-1\right)}{\frac{\mathsf{neg}\left(\left(x + 1\right)\right)}{\mathsf{neg}\left(\left(x - 1\right)\right)}}} \]
      14. lift--.f64N/A

        \[\leadsto \sqrt{\frac{\mathsf{neg}\left(-1\right)}{\frac{\mathsf{neg}\left(\left(x + 1\right)\right)}{\mathsf{neg}\left(\left(x - 1\right)\right)}}} \]
      15. sub-negate-revN/A

        \[\leadsto \sqrt{\frac{\mathsf{neg}\left(-1\right)}{\frac{\mathsf{neg}\left(\left(x + 1\right)\right)}{1 - x}}} \]
      16. lift--.f64N/A

        \[\leadsto \sqrt{\frac{\mathsf{neg}\left(-1\right)}{\frac{\mathsf{neg}\left(\left(x + 1\right)\right)}{1 - x}}} \]
      17. distribute-frac-negN/A

        \[\leadsto \sqrt{\frac{\mathsf{neg}\left(-1\right)}{\mathsf{neg}\left(\frac{x + 1}{1 - x}\right)}} \]
      18. frac-2neg-revN/A

        \[\leadsto \sqrt{\frac{-1}{\frac{x + 1}{1 - x}}} \]
      19. lower-/.f64N/A

        \[\leadsto \sqrt{\frac{-1}{\frac{x + 1}{1 - x}}} \]
    6. Applied rewrites38.9%

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

    if 1.6499999999999999e191 < l

    1. Initial program 33.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. Taylor expanded in l around -inf

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

        \[\leadsto -1 \cdot \color{blue}{\frac{t \cdot \sqrt{2}}{\ell \cdot \sqrt{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}}} \]
      2. lower-/.f64N/A

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

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

        \[\leadsto -1 \cdot \frac{t \cdot \sqrt{2}}{\ell \cdot \sqrt{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}} \]
      5. lower-*.f64N/A

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

        \[\leadsto -1 \cdot \frac{t \cdot \sqrt{2}}{\ell \cdot \sqrt{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}} \]
      7. lower--.f64N/A

        \[\leadsto -1 \cdot \frac{t \cdot \sqrt{2}}{\ell \cdot \sqrt{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}} \]
      8. lower-+.f64N/A

        \[\leadsto -1 \cdot \frac{t \cdot \sqrt{2}}{\ell \cdot \sqrt{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}} \]
      9. lower-/.f64N/A

        \[\leadsto -1 \cdot \frac{t \cdot \sqrt{2}}{\ell \cdot \sqrt{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}} \]
      10. lower--.f64N/A

        \[\leadsto -1 \cdot \frac{t \cdot \sqrt{2}}{\ell \cdot \sqrt{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}} \]
      11. lower-/.f64N/A

        \[\leadsto -1 \cdot \frac{t \cdot \sqrt{2}}{\ell \cdot \sqrt{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}} \]
      12. lower--.f642.6

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

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

        \[\leadsto -1 \cdot \color{blue}{\frac{t \cdot \sqrt{2}}{\ell \cdot \sqrt{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}}} \]
      2. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(\frac{t \cdot \sqrt{2}}{\ell \cdot \sqrt{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}}\right) \]
      3. lift-/.f64N/A

        \[\leadsto \mathsf{neg}\left(\frac{t \cdot \sqrt{2}}{\ell \cdot \sqrt{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}}\right) \]
      4. lift-*.f64N/A

        \[\leadsto \mathsf{neg}\left(\frac{t \cdot \sqrt{2}}{\ell \cdot \sqrt{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}}\right) \]
      5. associate-/l*N/A

        \[\leadsto \mathsf{neg}\left(t \cdot \frac{\sqrt{2}}{\ell \cdot \sqrt{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}}\right) \]
      6. distribute-lft-neg-inN/A

        \[\leadsto \left(\mathsf{neg}\left(t\right)\right) \cdot \color{blue}{\frac{\sqrt{2}}{\ell \cdot \sqrt{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}}} \]
      7. lower-*.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(t\right)\right) \cdot \color{blue}{\frac{\sqrt{2}}{\ell \cdot \sqrt{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}}} \]
      8. lower-neg.f64N/A

        \[\leadsto \left(-t\right) \cdot \frac{\color{blue}{\sqrt{2}}}{\ell \cdot \sqrt{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}} \]
      9. lift-*.f64N/A

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

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

        \[\leadsto \left(-t\right) \cdot \frac{\frac{\sqrt{2}}{\sqrt{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}}}{\color{blue}{\ell}} \]
      12. lower-/.f64N/A

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

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

      \[\leadsto \left(-t\right) \cdot \frac{-1 \cdot \left(x \cdot \left(\sqrt{\frac{1}{x}} - \frac{1}{2} \cdot \frac{1}{{x}^{2} \cdot \sqrt{\frac{1}{x}}}\right)\right)}{\ell} \]
    8. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \left(-t\right) \cdot \frac{-1 \cdot \left(x \cdot \left(\sqrt{\frac{1}{x}} - \frac{1}{2} \cdot \frac{1}{{x}^{2} \cdot \sqrt{\frac{1}{x}}}\right)\right)}{\ell} \]
      2. lower-*.f64N/A

        \[\leadsto \left(-t\right) \cdot \frac{-1 \cdot \left(x \cdot \left(\sqrt{\frac{1}{x}} - \frac{1}{2} \cdot \frac{1}{{x}^{2} \cdot \sqrt{\frac{1}{x}}}\right)\right)}{\ell} \]
      3. lower--.f64N/A

        \[\leadsto \left(-t\right) \cdot \frac{-1 \cdot \left(x \cdot \left(\sqrt{\frac{1}{x}} - \frac{1}{2} \cdot \frac{1}{{x}^{2} \cdot \sqrt{\frac{1}{x}}}\right)\right)}{\ell} \]
      4. lower-sqrt.f64N/A

        \[\leadsto \left(-t\right) \cdot \frac{-1 \cdot \left(x \cdot \left(\sqrt{\frac{1}{x}} - \frac{1}{2} \cdot \frac{1}{{x}^{2} \cdot \sqrt{\frac{1}{x}}}\right)\right)}{\ell} \]
      5. lower-/.f64N/A

        \[\leadsto \left(-t\right) \cdot \frac{-1 \cdot \left(x \cdot \left(\sqrt{\frac{1}{x}} - \frac{1}{2} \cdot \frac{1}{{x}^{2} \cdot \sqrt{\frac{1}{x}}}\right)\right)}{\ell} \]
      6. lower-*.f64N/A

        \[\leadsto \left(-t\right) \cdot \frac{-1 \cdot \left(x \cdot \left(\sqrt{\frac{1}{x}} - \frac{1}{2} \cdot \frac{1}{{x}^{2} \cdot \sqrt{\frac{1}{x}}}\right)\right)}{\ell} \]
      7. lower-/.f64N/A

        \[\leadsto \left(-t\right) \cdot \frac{-1 \cdot \left(x \cdot \left(\sqrt{\frac{1}{x}} - \frac{1}{2} \cdot \frac{1}{{x}^{2} \cdot \sqrt{\frac{1}{x}}}\right)\right)}{\ell} \]
      8. lower-*.f64N/A

        \[\leadsto \left(-t\right) \cdot \frac{-1 \cdot \left(x \cdot \left(\sqrt{\frac{1}{x}} - \frac{1}{2} \cdot \frac{1}{{x}^{2} \cdot \sqrt{\frac{1}{x}}}\right)\right)}{\ell} \]
      9. lower-pow.f64N/A

        \[\leadsto \left(-t\right) \cdot \frac{-1 \cdot \left(x \cdot \left(\sqrt{\frac{1}{x}} - \frac{1}{2} \cdot \frac{1}{{x}^{2} \cdot \sqrt{\frac{1}{x}}}\right)\right)}{\ell} \]
      10. lower-sqrt.f64N/A

        \[\leadsto \left(-t\right) \cdot \frac{-1 \cdot \left(x \cdot \left(\sqrt{\frac{1}{x}} - \frac{1}{2} \cdot \frac{1}{{x}^{2} \cdot \sqrt{\frac{1}{x}}}\right)\right)}{\ell} \]
      11. lower-/.f6415.3

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

      \[\leadsto \left(-t\right) \cdot \frac{-1 \cdot \left(x \cdot \left(\sqrt{\frac{1}{x}} - 0.5 \cdot \frac{1}{{x}^{2} \cdot \sqrt{\frac{1}{x}}}\right)\right)}{\ell} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 2: 80.9% accurate, 1.4× speedup?

\[\mathsf{copysign}\left(1, t\right) \cdot \begin{array}{l} \mathbf{if}\;\left|\ell\right| \leq 1.65 \cdot 10^{+191}:\\ \;\;\;\;\sqrt{\frac{-1}{\frac{-1 - x}{x - 1}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left|t\right| \cdot \left(x \cdot \sqrt{\frac{1}{x}}\right)}{\left|\ell\right|}\\ \end{array} \]
(FPCore (x l t)
 :precision binary64
 (*
  (copysign 1.0 t)
  (if (<= (fabs l) 1.65e+191)
    (sqrt (/ -1.0 (/ (- -1.0 x) (- x 1.0))))
    (/ (* (fabs t) (* x (sqrt (/ 1.0 x)))) (fabs l)))))
double code(double x, double l, double t) {
	double tmp;
	if (fabs(l) <= 1.65e+191) {
		tmp = sqrt((-1.0 / ((-1.0 - x) / (x - 1.0))));
	} else {
		tmp = (fabs(t) * (x * sqrt((1.0 / x)))) / fabs(l);
	}
	return copysign(1.0, t) * tmp;
}
public static double code(double x, double l, double t) {
	double tmp;
	if (Math.abs(l) <= 1.65e+191) {
		tmp = Math.sqrt((-1.0 / ((-1.0 - x) / (x - 1.0))));
	} else {
		tmp = (Math.abs(t) * (x * Math.sqrt((1.0 / x)))) / Math.abs(l);
	}
	return Math.copySign(1.0, t) * tmp;
}
def code(x, l, t):
	tmp = 0
	if math.fabs(l) <= 1.65e+191:
		tmp = math.sqrt((-1.0 / ((-1.0 - x) / (x - 1.0))))
	else:
		tmp = (math.fabs(t) * (x * math.sqrt((1.0 / x)))) / math.fabs(l)
	return math.copysign(1.0, t) * tmp
function code(x, l, t)
	tmp = 0.0
	if (abs(l) <= 1.65e+191)
		tmp = sqrt(Float64(-1.0 / Float64(Float64(-1.0 - x) / Float64(x - 1.0))));
	else
		tmp = Float64(Float64(abs(t) * Float64(x * sqrt(Float64(1.0 / x)))) / abs(l));
	end
	return Float64(copysign(1.0, t) * tmp)
end
function tmp_2 = code(x, l, t)
	tmp = 0.0;
	if (abs(l) <= 1.65e+191)
		tmp = sqrt((-1.0 / ((-1.0 - x) / (x - 1.0))));
	else
		tmp = (abs(t) * (x * sqrt((1.0 / x)))) / abs(l);
	end
	tmp_2 = (sign(t) * abs(1.0)) * tmp;
end
code[x_, l_, t_] := N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[N[Abs[l], $MachinePrecision], 1.65e+191], N[Sqrt[N[(-1.0 / N[(N[(-1.0 - x), $MachinePrecision] / N[(x - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[(N[Abs[t], $MachinePrecision] * N[(x * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Abs[l], $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\mathsf{copysign}\left(1, t\right) \cdot \begin{array}{l}
\mathbf{if}\;\left|\ell\right| \leq 1.65 \cdot 10^{+191}:\\
\;\;\;\;\sqrt{\frac{-1}{\frac{-1 - x}{x - 1}}}\\

\mathbf{else}:\\
\;\;\;\;\frac{\left|t\right| \cdot \left(x \cdot \sqrt{\frac{1}{x}}\right)}{\left|\ell\right|}\\


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

    1. Initial program 33.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. Taylor expanded in t around inf

      \[\leadsto \color{blue}{\frac{\sqrt{2}}{\sqrt{2 \cdot \frac{1 + x}{x - 1}}}} \]
    3. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \frac{\sqrt{2}}{\color{blue}{\sqrt{2 \cdot \frac{1 + x}{x - 1}}}} \]
      2. lower-sqrt.f64N/A

        \[\leadsto \frac{\sqrt{2}}{\sqrt{\color{blue}{2 \cdot \frac{1 + x}{x - 1}}}} \]
      3. lower-sqrt.f64N/A

        \[\leadsto \frac{\sqrt{2}}{\sqrt{2 \cdot \frac{1 + x}{x - 1}}} \]
      4. lower-*.f64N/A

        \[\leadsto \frac{\sqrt{2}}{\sqrt{2 \cdot \frac{1 + x}{x - 1}}} \]
      5. lower-/.f64N/A

        \[\leadsto \frac{\sqrt{2}}{\sqrt{2 \cdot \frac{1 + x}{x - 1}}} \]
      6. lower-+.f64N/A

        \[\leadsto \frac{\sqrt{2}}{\sqrt{2 \cdot \frac{1 + x}{x - 1}}} \]
      7. lower--.f6438.8

        \[\leadsto \frac{\sqrt{2}}{\sqrt{2 \cdot \frac{1 + x}{x - 1}}} \]
    4. Applied rewrites38.8%

      \[\leadsto \color{blue}{\frac{\sqrt{2}}{\sqrt{2 \cdot \frac{1 + x}{x - 1}}}} \]
    5. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \frac{\sqrt{2}}{\color{blue}{\sqrt{2 \cdot \frac{1 + x}{x - 1}}}} \]
      2. lift-sqrt.f64N/A

        \[\leadsto \frac{\sqrt{2}}{\sqrt{\color{blue}{2 \cdot \frac{1 + x}{x - 1}}}} \]
      3. lift-sqrt.f64N/A

        \[\leadsto \frac{\sqrt{2}}{\sqrt{2 \cdot \frac{1 + x}{x - 1}}} \]
      4. sqrt-undivN/A

        \[\leadsto \sqrt{\frac{2}{2 \cdot \frac{1 + x}{x - 1}}} \]
      5. lower-sqrt.f64N/A

        \[\leadsto \sqrt{\frac{2}{2 \cdot \frac{1 + x}{x - 1}}} \]
      6. lift-*.f64N/A

        \[\leadsto \sqrt{\frac{2}{2 \cdot \frac{1 + x}{x - 1}}} \]
      7. associate-/r*N/A

        \[\leadsto \sqrt{\frac{\frac{2}{2}}{\frac{1 + x}{x - 1}}} \]
      8. metadata-evalN/A

        \[\leadsto \sqrt{\frac{1}{\frac{1 + x}{x - 1}}} \]
      9. metadata-evalN/A

        \[\leadsto \sqrt{\frac{\mathsf{neg}\left(-1\right)}{\frac{1 + x}{x - 1}}} \]
      10. lift-+.f64N/A

        \[\leadsto \sqrt{\frac{\mathsf{neg}\left(-1\right)}{\frac{1 + x}{x - 1}}} \]
      11. +-commutativeN/A

        \[\leadsto \sqrt{\frac{\mathsf{neg}\left(-1\right)}{\frac{x + 1}{x - 1}}} \]
      12. lower-/.f64N/A

        \[\leadsto \sqrt{\frac{\mathsf{neg}\left(-1\right)}{\frac{x + 1}{x - 1}}} \]
      13. frac-2negN/A

        \[\leadsto \sqrt{\frac{\mathsf{neg}\left(-1\right)}{\frac{\mathsf{neg}\left(\left(x + 1\right)\right)}{\mathsf{neg}\left(\left(x - 1\right)\right)}}} \]
      14. lift--.f64N/A

        \[\leadsto \sqrt{\frac{\mathsf{neg}\left(-1\right)}{\frac{\mathsf{neg}\left(\left(x + 1\right)\right)}{\mathsf{neg}\left(\left(x - 1\right)\right)}}} \]
      15. sub-negate-revN/A

        \[\leadsto \sqrt{\frac{\mathsf{neg}\left(-1\right)}{\frac{\mathsf{neg}\left(\left(x + 1\right)\right)}{1 - x}}} \]
      16. lift--.f64N/A

        \[\leadsto \sqrt{\frac{\mathsf{neg}\left(-1\right)}{\frac{\mathsf{neg}\left(\left(x + 1\right)\right)}{1 - x}}} \]
      17. distribute-frac-negN/A

        \[\leadsto \sqrt{\frac{\mathsf{neg}\left(-1\right)}{\mathsf{neg}\left(\frac{x + 1}{1 - x}\right)}} \]
      18. frac-2neg-revN/A

        \[\leadsto \sqrt{\frac{-1}{\frac{x + 1}{1 - x}}} \]
      19. lower-/.f64N/A

        \[\leadsto \sqrt{\frac{-1}{\frac{x + 1}{1 - x}}} \]
    6. Applied rewrites38.9%

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

    if 1.6499999999999999e191 < l

    1. Initial program 33.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. Taylor expanded in l around -inf

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

        \[\leadsto -1 \cdot \color{blue}{\frac{t \cdot \sqrt{2}}{\ell \cdot \sqrt{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}}} \]
      2. lower-/.f64N/A

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

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

        \[\leadsto -1 \cdot \frac{t \cdot \sqrt{2}}{\ell \cdot \sqrt{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}} \]
      5. lower-*.f64N/A

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

        \[\leadsto -1 \cdot \frac{t \cdot \sqrt{2}}{\ell \cdot \sqrt{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}} \]
      7. lower--.f64N/A

        \[\leadsto -1 \cdot \frac{t \cdot \sqrt{2}}{\ell \cdot \sqrt{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}} \]
      8. lower-+.f64N/A

        \[\leadsto -1 \cdot \frac{t \cdot \sqrt{2}}{\ell \cdot \sqrt{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}} \]
      9. lower-/.f64N/A

        \[\leadsto -1 \cdot \frac{t \cdot \sqrt{2}}{\ell \cdot \sqrt{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}} \]
      10. lower--.f64N/A

        \[\leadsto -1 \cdot \frac{t \cdot \sqrt{2}}{\ell \cdot \sqrt{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}} \]
      11. lower-/.f64N/A

        \[\leadsto -1 \cdot \frac{t \cdot \sqrt{2}}{\ell \cdot \sqrt{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}} \]
      12. lower--.f642.6

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

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

        \[\leadsto -1 \cdot \color{blue}{\frac{t \cdot \sqrt{2}}{\ell \cdot \sqrt{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}}} \]
      2. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(\frac{t \cdot \sqrt{2}}{\ell \cdot \sqrt{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}}\right) \]
      3. lift-/.f64N/A

        \[\leadsto \mathsf{neg}\left(\frac{t \cdot \sqrt{2}}{\ell \cdot \sqrt{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}}\right) \]
      4. lift-*.f64N/A

        \[\leadsto \mathsf{neg}\left(\frac{t \cdot \sqrt{2}}{\ell \cdot \sqrt{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}}\right) \]
      5. associate-/l*N/A

        \[\leadsto \mathsf{neg}\left(t \cdot \frac{\sqrt{2}}{\ell \cdot \sqrt{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}}\right) \]
      6. distribute-lft-neg-inN/A

        \[\leadsto \left(\mathsf{neg}\left(t\right)\right) \cdot \color{blue}{\frac{\sqrt{2}}{\ell \cdot \sqrt{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}}} \]
      7. lower-*.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(t\right)\right) \cdot \color{blue}{\frac{\sqrt{2}}{\ell \cdot \sqrt{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}}} \]
      8. lower-neg.f64N/A

        \[\leadsto \left(-t\right) \cdot \frac{\color{blue}{\sqrt{2}}}{\ell \cdot \sqrt{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}} \]
      9. lift-*.f64N/A

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

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

        \[\leadsto \left(-t\right) \cdot \frac{\frac{\sqrt{2}}{\sqrt{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}}}{\color{blue}{\ell}} \]
      12. lower-/.f64N/A

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

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

      \[\leadsto \frac{t \cdot \left(x \cdot \sqrt{\frac{1}{x}}\right)}{\color{blue}{\ell}} \]
    8. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \frac{t \cdot \left(x \cdot \sqrt{\frac{1}{x}}\right)}{\ell} \]
      2. lower-*.f64N/A

        \[\leadsto \frac{t \cdot \left(x \cdot \sqrt{\frac{1}{x}}\right)}{\ell} \]
      3. lower-*.f64N/A

        \[\leadsto \frac{t \cdot \left(x \cdot \sqrt{\frac{1}{x}}\right)}{\ell} \]
      4. lower-sqrt.f64N/A

        \[\leadsto \frac{t \cdot \left(x \cdot \sqrt{\frac{1}{x}}\right)}{\ell} \]
      5. lower-/.f6415.2

        \[\leadsto \frac{t \cdot \left(x \cdot \sqrt{\frac{1}{x}}\right)}{\ell} \]
    9. Applied rewrites15.2%

      \[\leadsto \frac{t \cdot \left(x \cdot \sqrt{\frac{1}{x}}\right)}{\color{blue}{\ell}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 3: 80.9% accurate, 1.6× speedup?

\[\mathsf{copysign}\left(1, t\right) \cdot \begin{array}{l} \mathbf{if}\;\left|\ell\right| \leq 1.65 \cdot 10^{+191}:\\ \;\;\;\;\sqrt{\frac{-1}{\frac{-1 - x}{x - 1}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left|t\right| \cdot \sqrt{x}}{\left|\ell\right|}\\ \end{array} \]
(FPCore (x l t)
 :precision binary64
 (*
  (copysign 1.0 t)
  (if (<= (fabs l) 1.65e+191)
    (sqrt (/ -1.0 (/ (- -1.0 x) (- x 1.0))))
    (/ (* (fabs t) (sqrt x)) (fabs l)))))
double code(double x, double l, double t) {
	double tmp;
	if (fabs(l) <= 1.65e+191) {
		tmp = sqrt((-1.0 / ((-1.0 - x) / (x - 1.0))));
	} else {
		tmp = (fabs(t) * sqrt(x)) / fabs(l);
	}
	return copysign(1.0, t) * tmp;
}
public static double code(double x, double l, double t) {
	double tmp;
	if (Math.abs(l) <= 1.65e+191) {
		tmp = Math.sqrt((-1.0 / ((-1.0 - x) / (x - 1.0))));
	} else {
		tmp = (Math.abs(t) * Math.sqrt(x)) / Math.abs(l);
	}
	return Math.copySign(1.0, t) * tmp;
}
def code(x, l, t):
	tmp = 0
	if math.fabs(l) <= 1.65e+191:
		tmp = math.sqrt((-1.0 / ((-1.0 - x) / (x - 1.0))))
	else:
		tmp = (math.fabs(t) * math.sqrt(x)) / math.fabs(l)
	return math.copysign(1.0, t) * tmp
function code(x, l, t)
	tmp = 0.0
	if (abs(l) <= 1.65e+191)
		tmp = sqrt(Float64(-1.0 / Float64(Float64(-1.0 - x) / Float64(x - 1.0))));
	else
		tmp = Float64(Float64(abs(t) * sqrt(x)) / abs(l));
	end
	return Float64(copysign(1.0, t) * tmp)
end
function tmp_2 = code(x, l, t)
	tmp = 0.0;
	if (abs(l) <= 1.65e+191)
		tmp = sqrt((-1.0 / ((-1.0 - x) / (x - 1.0))));
	else
		tmp = (abs(t) * sqrt(x)) / abs(l);
	end
	tmp_2 = (sign(t) * abs(1.0)) * tmp;
end
code[x_, l_, t_] := N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[N[Abs[l], $MachinePrecision], 1.65e+191], N[Sqrt[N[(-1.0 / N[(N[(-1.0 - x), $MachinePrecision] / N[(x - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[(N[Abs[t], $MachinePrecision] * N[Sqrt[x], $MachinePrecision]), $MachinePrecision] / N[Abs[l], $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\mathsf{copysign}\left(1, t\right) \cdot \begin{array}{l}
\mathbf{if}\;\left|\ell\right| \leq 1.65 \cdot 10^{+191}:\\
\;\;\;\;\sqrt{\frac{-1}{\frac{-1 - x}{x - 1}}}\\

\mathbf{else}:\\
\;\;\;\;\frac{\left|t\right| \cdot \sqrt{x}}{\left|\ell\right|}\\


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

    1. Initial program 33.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. Taylor expanded in t around inf

      \[\leadsto \color{blue}{\frac{\sqrt{2}}{\sqrt{2 \cdot \frac{1 + x}{x - 1}}}} \]
    3. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \frac{\sqrt{2}}{\color{blue}{\sqrt{2 \cdot \frac{1 + x}{x - 1}}}} \]
      2. lower-sqrt.f64N/A

        \[\leadsto \frac{\sqrt{2}}{\sqrt{\color{blue}{2 \cdot \frac{1 + x}{x - 1}}}} \]
      3. lower-sqrt.f64N/A

        \[\leadsto \frac{\sqrt{2}}{\sqrt{2 \cdot \frac{1 + x}{x - 1}}} \]
      4. lower-*.f64N/A

        \[\leadsto \frac{\sqrt{2}}{\sqrt{2 \cdot \frac{1 + x}{x - 1}}} \]
      5. lower-/.f64N/A

        \[\leadsto \frac{\sqrt{2}}{\sqrt{2 \cdot \frac{1 + x}{x - 1}}} \]
      6. lower-+.f64N/A

        \[\leadsto \frac{\sqrt{2}}{\sqrt{2 \cdot \frac{1 + x}{x - 1}}} \]
      7. lower--.f6438.8

        \[\leadsto \frac{\sqrt{2}}{\sqrt{2 \cdot \frac{1 + x}{x - 1}}} \]
    4. Applied rewrites38.8%

      \[\leadsto \color{blue}{\frac{\sqrt{2}}{\sqrt{2 \cdot \frac{1 + x}{x - 1}}}} \]
    5. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \frac{\sqrt{2}}{\color{blue}{\sqrt{2 \cdot \frac{1 + x}{x - 1}}}} \]
      2. lift-sqrt.f64N/A

        \[\leadsto \frac{\sqrt{2}}{\sqrt{\color{blue}{2 \cdot \frac{1 + x}{x - 1}}}} \]
      3. lift-sqrt.f64N/A

        \[\leadsto \frac{\sqrt{2}}{\sqrt{2 \cdot \frac{1 + x}{x - 1}}} \]
      4. sqrt-undivN/A

        \[\leadsto \sqrt{\frac{2}{2 \cdot \frac{1 + x}{x - 1}}} \]
      5. lower-sqrt.f64N/A

        \[\leadsto \sqrt{\frac{2}{2 \cdot \frac{1 + x}{x - 1}}} \]
      6. lift-*.f64N/A

        \[\leadsto \sqrt{\frac{2}{2 \cdot \frac{1 + x}{x - 1}}} \]
      7. associate-/r*N/A

        \[\leadsto \sqrt{\frac{\frac{2}{2}}{\frac{1 + x}{x - 1}}} \]
      8. metadata-evalN/A

        \[\leadsto \sqrt{\frac{1}{\frac{1 + x}{x - 1}}} \]
      9. metadata-evalN/A

        \[\leadsto \sqrt{\frac{\mathsf{neg}\left(-1\right)}{\frac{1 + x}{x - 1}}} \]
      10. lift-+.f64N/A

        \[\leadsto \sqrt{\frac{\mathsf{neg}\left(-1\right)}{\frac{1 + x}{x - 1}}} \]
      11. +-commutativeN/A

        \[\leadsto \sqrt{\frac{\mathsf{neg}\left(-1\right)}{\frac{x + 1}{x - 1}}} \]
      12. lower-/.f64N/A

        \[\leadsto \sqrt{\frac{\mathsf{neg}\left(-1\right)}{\frac{x + 1}{x - 1}}} \]
      13. frac-2negN/A

        \[\leadsto \sqrt{\frac{\mathsf{neg}\left(-1\right)}{\frac{\mathsf{neg}\left(\left(x + 1\right)\right)}{\mathsf{neg}\left(\left(x - 1\right)\right)}}} \]
      14. lift--.f64N/A

        \[\leadsto \sqrt{\frac{\mathsf{neg}\left(-1\right)}{\frac{\mathsf{neg}\left(\left(x + 1\right)\right)}{\mathsf{neg}\left(\left(x - 1\right)\right)}}} \]
      15. sub-negate-revN/A

        \[\leadsto \sqrt{\frac{\mathsf{neg}\left(-1\right)}{\frac{\mathsf{neg}\left(\left(x + 1\right)\right)}{1 - x}}} \]
      16. lift--.f64N/A

        \[\leadsto \sqrt{\frac{\mathsf{neg}\left(-1\right)}{\frac{\mathsf{neg}\left(\left(x + 1\right)\right)}{1 - x}}} \]
      17. distribute-frac-negN/A

        \[\leadsto \sqrt{\frac{\mathsf{neg}\left(-1\right)}{\mathsf{neg}\left(\frac{x + 1}{1 - x}\right)}} \]
      18. frac-2neg-revN/A

        \[\leadsto \sqrt{\frac{-1}{\frac{x + 1}{1 - x}}} \]
      19. lower-/.f64N/A

        \[\leadsto \sqrt{\frac{-1}{\frac{x + 1}{1 - x}}} \]
    6. Applied rewrites38.9%

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

    if 1.6499999999999999e191 < l

    1. Initial program 33.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. Taylor expanded in l around -inf

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

        \[\leadsto -1 \cdot \color{blue}{\frac{t \cdot \sqrt{2}}{\ell \cdot \sqrt{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}}} \]
      2. lower-/.f64N/A

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

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

        \[\leadsto -1 \cdot \frac{t \cdot \sqrt{2}}{\ell \cdot \sqrt{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}} \]
      5. lower-*.f64N/A

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

        \[\leadsto -1 \cdot \frac{t \cdot \sqrt{2}}{\ell \cdot \sqrt{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}} \]
      7. lower--.f64N/A

        \[\leadsto -1 \cdot \frac{t \cdot \sqrt{2}}{\ell \cdot \sqrt{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}} \]
      8. lower-+.f64N/A

        \[\leadsto -1 \cdot \frac{t \cdot \sqrt{2}}{\ell \cdot \sqrt{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}} \]
      9. lower-/.f64N/A

        \[\leadsto -1 \cdot \frac{t \cdot \sqrt{2}}{\ell \cdot \sqrt{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}} \]
      10. lower--.f64N/A

        \[\leadsto -1 \cdot \frac{t \cdot \sqrt{2}}{\ell \cdot \sqrt{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}} \]
      11. lower-/.f64N/A

        \[\leadsto -1 \cdot \frac{t \cdot \sqrt{2}}{\ell \cdot \sqrt{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}} \]
      12. lower--.f642.6

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

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

        \[\leadsto -1 \cdot \color{blue}{\frac{t \cdot \sqrt{2}}{\ell \cdot \sqrt{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}}} \]
      2. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(\frac{t \cdot \sqrt{2}}{\ell \cdot \sqrt{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}}\right) \]
      3. lift-/.f64N/A

        \[\leadsto \mathsf{neg}\left(\frac{t \cdot \sqrt{2}}{\ell \cdot \sqrt{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}}\right) \]
      4. lift-*.f64N/A

        \[\leadsto \mathsf{neg}\left(\frac{t \cdot \sqrt{2}}{\ell \cdot \sqrt{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}}\right) \]
      5. associate-/l*N/A

        \[\leadsto \mathsf{neg}\left(t \cdot \frac{\sqrt{2}}{\ell \cdot \sqrt{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}}\right) \]
      6. distribute-lft-neg-inN/A

        \[\leadsto \left(\mathsf{neg}\left(t\right)\right) \cdot \color{blue}{\frac{\sqrt{2}}{\ell \cdot \sqrt{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}}} \]
      7. lower-*.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(t\right)\right) \cdot \color{blue}{\frac{\sqrt{2}}{\ell \cdot \sqrt{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}}} \]
      8. lower-neg.f64N/A

        \[\leadsto \left(-t\right) \cdot \frac{\color{blue}{\sqrt{2}}}{\ell \cdot \sqrt{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}} \]
      9. lift-*.f64N/A

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

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

        \[\leadsto \left(-t\right) \cdot \frac{\frac{\sqrt{2}}{\sqrt{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}}}{\color{blue}{\ell}} \]
      12. lower-/.f64N/A

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

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

      \[\leadsto \frac{t \cdot \left(x \cdot \sqrt{\frac{1}{x}}\right)}{\color{blue}{\ell}} \]
    8. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \frac{t \cdot \left(x \cdot \sqrt{\frac{1}{x}}\right)}{\ell} \]
      2. lower-*.f64N/A

        \[\leadsto \frac{t \cdot \left(x \cdot \sqrt{\frac{1}{x}}\right)}{\ell} \]
      3. lower-*.f64N/A

        \[\leadsto \frac{t \cdot \left(x \cdot \sqrt{\frac{1}{x}}\right)}{\ell} \]
      4. lower-sqrt.f64N/A

        \[\leadsto \frac{t \cdot \left(x \cdot \sqrt{\frac{1}{x}}\right)}{\ell} \]
      5. lower-/.f6415.2

        \[\leadsto \frac{t \cdot \left(x \cdot \sqrt{\frac{1}{x}}\right)}{\ell} \]
    9. Applied rewrites15.2%

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

      \[\leadsto \frac{t \cdot \sqrt{x}}{\ell} \]
    11. Step-by-step derivation
      1. lower-sqrt.f6415.2

        \[\leadsto \frac{t \cdot \sqrt{x}}{\ell} \]
    12. Applied rewrites15.2%

      \[\leadsto \frac{t \cdot \sqrt{x}}{\ell} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 4: 80.9% accurate, 1.8× speedup?

\[\mathsf{copysign}\left(1, t\right) \cdot \begin{array}{l} \mathbf{if}\;\left|\ell\right| \leq 1.65 \cdot 10^{+191}:\\ \;\;\;\;\sqrt{\frac{x - 1}{x - -1}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left|t\right| \cdot \sqrt{x}}{\left|\ell\right|}\\ \end{array} \]
(FPCore (x l t)
 :precision binary64
 (*
  (copysign 1.0 t)
  (if (<= (fabs l) 1.65e+191)
    (sqrt (/ (- x 1.0) (- x -1.0)))
    (/ (* (fabs t) (sqrt x)) (fabs l)))))
double code(double x, double l, double t) {
	double tmp;
	if (fabs(l) <= 1.65e+191) {
		tmp = sqrt(((x - 1.0) / (x - -1.0)));
	} else {
		tmp = (fabs(t) * sqrt(x)) / fabs(l);
	}
	return copysign(1.0, t) * tmp;
}
public static double code(double x, double l, double t) {
	double tmp;
	if (Math.abs(l) <= 1.65e+191) {
		tmp = Math.sqrt(((x - 1.0) / (x - -1.0)));
	} else {
		tmp = (Math.abs(t) * Math.sqrt(x)) / Math.abs(l);
	}
	return Math.copySign(1.0, t) * tmp;
}
def code(x, l, t):
	tmp = 0
	if math.fabs(l) <= 1.65e+191:
		tmp = math.sqrt(((x - 1.0) / (x - -1.0)))
	else:
		tmp = (math.fabs(t) * math.sqrt(x)) / math.fabs(l)
	return math.copysign(1.0, t) * tmp
function code(x, l, t)
	tmp = 0.0
	if (abs(l) <= 1.65e+191)
		tmp = sqrt(Float64(Float64(x - 1.0) / Float64(x - -1.0)));
	else
		tmp = Float64(Float64(abs(t) * sqrt(x)) / abs(l));
	end
	return Float64(copysign(1.0, t) * tmp)
end
function tmp_2 = code(x, l, t)
	tmp = 0.0;
	if (abs(l) <= 1.65e+191)
		tmp = sqrt(((x - 1.0) / (x - -1.0)));
	else
		tmp = (abs(t) * sqrt(x)) / abs(l);
	end
	tmp_2 = (sign(t) * abs(1.0)) * tmp;
end
code[x_, l_, t_] := N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[N[Abs[l], $MachinePrecision], 1.65e+191], N[Sqrt[N[(N[(x - 1.0), $MachinePrecision] / N[(x - -1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[(N[Abs[t], $MachinePrecision] * N[Sqrt[x], $MachinePrecision]), $MachinePrecision] / N[Abs[l], $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\mathsf{copysign}\left(1, t\right) \cdot \begin{array}{l}
\mathbf{if}\;\left|\ell\right| \leq 1.65 \cdot 10^{+191}:\\
\;\;\;\;\sqrt{\frac{x - 1}{x - -1}}\\

\mathbf{else}:\\
\;\;\;\;\frac{\left|t\right| \cdot \sqrt{x}}{\left|\ell\right|}\\


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

    1. Initial program 33.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. Taylor expanded in t around inf

      \[\leadsto \color{blue}{\frac{\sqrt{2}}{\sqrt{2 \cdot \frac{1 + x}{x - 1}}}} \]
    3. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \frac{\sqrt{2}}{\color{blue}{\sqrt{2 \cdot \frac{1 + x}{x - 1}}}} \]
      2. lower-sqrt.f64N/A

        \[\leadsto \frac{\sqrt{2}}{\sqrt{\color{blue}{2 \cdot \frac{1 + x}{x - 1}}}} \]
      3. lower-sqrt.f64N/A

        \[\leadsto \frac{\sqrt{2}}{\sqrt{2 \cdot \frac{1 + x}{x - 1}}} \]
      4. lower-*.f64N/A

        \[\leadsto \frac{\sqrt{2}}{\sqrt{2 \cdot \frac{1 + x}{x - 1}}} \]
      5. lower-/.f64N/A

        \[\leadsto \frac{\sqrt{2}}{\sqrt{2 \cdot \frac{1 + x}{x - 1}}} \]
      6. lower-+.f64N/A

        \[\leadsto \frac{\sqrt{2}}{\sqrt{2 \cdot \frac{1 + x}{x - 1}}} \]
      7. lower--.f6438.8

        \[\leadsto \frac{\sqrt{2}}{\sqrt{2 \cdot \frac{1 + x}{x - 1}}} \]
    4. Applied rewrites38.8%

      \[\leadsto \color{blue}{\frac{\sqrt{2}}{\sqrt{2 \cdot \frac{1 + x}{x - 1}}}} \]
    5. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \frac{\sqrt{2}}{\color{blue}{\sqrt{2 \cdot \frac{1 + x}{x - 1}}}} \]
      2. lift-sqrt.f64N/A

        \[\leadsto \frac{\sqrt{2}}{\sqrt{\color{blue}{2 \cdot \frac{1 + x}{x - 1}}}} \]
      3. lift-sqrt.f64N/A

        \[\leadsto \frac{\sqrt{2}}{\sqrt{2 \cdot \frac{1 + x}{x - 1}}} \]
      4. sqrt-undivN/A

        \[\leadsto \sqrt{\frac{2}{2 \cdot \frac{1 + x}{x - 1}}} \]
      5. lower-sqrt.f64N/A

        \[\leadsto \sqrt{\frac{2}{2 \cdot \frac{1 + x}{x - 1}}} \]
      6. lift-*.f64N/A

        \[\leadsto \sqrt{\frac{2}{2 \cdot \frac{1 + x}{x - 1}}} \]
      7. associate-/r*N/A

        \[\leadsto \sqrt{\frac{\frac{2}{2}}{\frac{1 + x}{x - 1}}} \]
      8. metadata-evalN/A

        \[\leadsto \sqrt{\frac{1}{\frac{1 + x}{x - 1}}} \]
      9. metadata-evalN/A

        \[\leadsto \sqrt{\frac{\mathsf{neg}\left(-1\right)}{\frac{1 + x}{x - 1}}} \]
      10. lift-+.f64N/A

        \[\leadsto \sqrt{\frac{\mathsf{neg}\left(-1\right)}{\frac{1 + x}{x - 1}}} \]
      11. +-commutativeN/A

        \[\leadsto \sqrt{\frac{\mathsf{neg}\left(-1\right)}{\frac{x + 1}{x - 1}}} \]
      12. lower-/.f64N/A

        \[\leadsto \sqrt{\frac{\mathsf{neg}\left(-1\right)}{\frac{x + 1}{x - 1}}} \]
      13. frac-2negN/A

        \[\leadsto \sqrt{\frac{\mathsf{neg}\left(-1\right)}{\frac{\mathsf{neg}\left(\left(x + 1\right)\right)}{\mathsf{neg}\left(\left(x - 1\right)\right)}}} \]
      14. lift--.f64N/A

        \[\leadsto \sqrt{\frac{\mathsf{neg}\left(-1\right)}{\frac{\mathsf{neg}\left(\left(x + 1\right)\right)}{\mathsf{neg}\left(\left(x - 1\right)\right)}}} \]
      15. sub-negate-revN/A

        \[\leadsto \sqrt{\frac{\mathsf{neg}\left(-1\right)}{\frac{\mathsf{neg}\left(\left(x + 1\right)\right)}{1 - x}}} \]
      16. lift--.f64N/A

        \[\leadsto \sqrt{\frac{\mathsf{neg}\left(-1\right)}{\frac{\mathsf{neg}\left(\left(x + 1\right)\right)}{1 - x}}} \]
      17. distribute-frac-negN/A

        \[\leadsto \sqrt{\frac{\mathsf{neg}\left(-1\right)}{\mathsf{neg}\left(\frac{x + 1}{1 - x}\right)}} \]
      18. frac-2neg-revN/A

        \[\leadsto \sqrt{\frac{-1}{\frac{x + 1}{1 - x}}} \]
      19. lower-/.f64N/A

        \[\leadsto \sqrt{\frac{-1}{\frac{x + 1}{1 - x}}} \]
    6. Applied rewrites38.9%

      \[\leadsto \color{blue}{\sqrt{\frac{-1}{\frac{-1 - x}{x - 1}}}} \]
    7. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \sqrt{\frac{-1}{\frac{-1 - x}{x - 1}}} \]
      2. lift--.f64N/A

        \[\leadsto \sqrt{\frac{-1}{\frac{-1 - x}{x - 1}}} \]
      3. lift-/.f64N/A

        \[\leadsto \sqrt{\frac{-1}{\frac{-1 - x}{x - 1}}} \]
      4. associate-/r/N/A

        \[\leadsto \sqrt{\frac{-1}{-1 - x} \cdot \left(x - 1\right)} \]
      5. associate-*l/N/A

        \[\leadsto \sqrt{\frac{-1 \cdot \left(x - 1\right)}{-1 - x}} \]
      6. frac-2negN/A

        \[\leadsto \sqrt{\frac{\mathsf{neg}\left(-1 \cdot \left(x - 1\right)\right)}{\mathsf{neg}\left(\left(-1 - x\right)\right)}} \]
      7. distribute-lft-neg-outN/A

        \[\leadsto \sqrt{\frac{\left(\mathsf{neg}\left(-1\right)\right) \cdot \left(x - 1\right)}{\mathsf{neg}\left(\left(-1 - x\right)\right)}} \]
      8. metadata-evalN/A

        \[\leadsto \sqrt{\frac{1 \cdot \left(x - 1\right)}{\mathsf{neg}\left(\left(-1 - x\right)\right)}} \]
      9. *-lft-identityN/A

        \[\leadsto \sqrt{\frac{x - 1}{\mathsf{neg}\left(\left(-1 - x\right)\right)}} \]
      10. lift--.f64N/A

        \[\leadsto \sqrt{\frac{x - 1}{\mathsf{neg}\left(\left(-1 - x\right)\right)}} \]
      11. sub-negate-revN/A

        \[\leadsto \sqrt{\frac{x - 1}{x - -1}} \]
      12. metadata-evalN/A

        \[\leadsto \sqrt{\frac{x - 1}{x - \left(\mathsf{neg}\left(1\right)\right)}} \]
      13. add-flipN/A

        \[\leadsto \sqrt{\frac{x - 1}{x + 1}} \]
      14. +-commutativeN/A

        \[\leadsto \sqrt{\frac{x - 1}{1 + x}} \]
      15. lower-/.f64N/A

        \[\leadsto \sqrt{\frac{x - 1}{1 + x}} \]
      16. lift--.f64N/A

        \[\leadsto \sqrt{\frac{x - 1}{1 + x}} \]
      17. +-commutativeN/A

        \[\leadsto \sqrt{\frac{x - 1}{x + 1}} \]
      18. add-flipN/A

        \[\leadsto \sqrt{\frac{x - 1}{x - \left(\mathsf{neg}\left(1\right)\right)}} \]
      19. metadata-evalN/A

        \[\leadsto \sqrt{\frac{x - 1}{x - -1}} \]
      20. lower--.f6438.9

        \[\leadsto \sqrt{\frac{x - 1}{x - -1}} \]
    8. Applied rewrites38.9%

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

    if 1.6499999999999999e191 < l

    1. Initial program 33.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. Taylor expanded in l around -inf

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

        \[\leadsto -1 \cdot \color{blue}{\frac{t \cdot \sqrt{2}}{\ell \cdot \sqrt{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}}} \]
      2. lower-/.f64N/A

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

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

        \[\leadsto -1 \cdot \frac{t \cdot \sqrt{2}}{\ell \cdot \sqrt{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}} \]
      5. lower-*.f64N/A

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

        \[\leadsto -1 \cdot \frac{t \cdot \sqrt{2}}{\ell \cdot \sqrt{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}} \]
      7. lower--.f64N/A

        \[\leadsto -1 \cdot \frac{t \cdot \sqrt{2}}{\ell \cdot \sqrt{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}} \]
      8. lower-+.f64N/A

        \[\leadsto -1 \cdot \frac{t \cdot \sqrt{2}}{\ell \cdot \sqrt{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}} \]
      9. lower-/.f64N/A

        \[\leadsto -1 \cdot \frac{t \cdot \sqrt{2}}{\ell \cdot \sqrt{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}} \]
      10. lower--.f64N/A

        \[\leadsto -1 \cdot \frac{t \cdot \sqrt{2}}{\ell \cdot \sqrt{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}} \]
      11. lower-/.f64N/A

        \[\leadsto -1 \cdot \frac{t \cdot \sqrt{2}}{\ell \cdot \sqrt{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}} \]
      12. lower--.f642.6

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

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

        \[\leadsto -1 \cdot \color{blue}{\frac{t \cdot \sqrt{2}}{\ell \cdot \sqrt{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}}} \]
      2. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(\frac{t \cdot \sqrt{2}}{\ell \cdot \sqrt{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}}\right) \]
      3. lift-/.f64N/A

        \[\leadsto \mathsf{neg}\left(\frac{t \cdot \sqrt{2}}{\ell \cdot \sqrt{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}}\right) \]
      4. lift-*.f64N/A

        \[\leadsto \mathsf{neg}\left(\frac{t \cdot \sqrt{2}}{\ell \cdot \sqrt{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}}\right) \]
      5. associate-/l*N/A

        \[\leadsto \mathsf{neg}\left(t \cdot \frac{\sqrt{2}}{\ell \cdot \sqrt{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}}\right) \]
      6. distribute-lft-neg-inN/A

        \[\leadsto \left(\mathsf{neg}\left(t\right)\right) \cdot \color{blue}{\frac{\sqrt{2}}{\ell \cdot \sqrt{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}}} \]
      7. lower-*.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(t\right)\right) \cdot \color{blue}{\frac{\sqrt{2}}{\ell \cdot \sqrt{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}}} \]
      8. lower-neg.f64N/A

        \[\leadsto \left(-t\right) \cdot \frac{\color{blue}{\sqrt{2}}}{\ell \cdot \sqrt{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}} \]
      9. lift-*.f64N/A

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

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

        \[\leadsto \left(-t\right) \cdot \frac{\frac{\sqrt{2}}{\sqrt{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}}}{\color{blue}{\ell}} \]
      12. lower-/.f64N/A

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

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

      \[\leadsto \frac{t \cdot \left(x \cdot \sqrt{\frac{1}{x}}\right)}{\color{blue}{\ell}} \]
    8. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \frac{t \cdot \left(x \cdot \sqrt{\frac{1}{x}}\right)}{\ell} \]
      2. lower-*.f64N/A

        \[\leadsto \frac{t \cdot \left(x \cdot \sqrt{\frac{1}{x}}\right)}{\ell} \]
      3. lower-*.f64N/A

        \[\leadsto \frac{t \cdot \left(x \cdot \sqrt{\frac{1}{x}}\right)}{\ell} \]
      4. lower-sqrt.f64N/A

        \[\leadsto \frac{t \cdot \left(x \cdot \sqrt{\frac{1}{x}}\right)}{\ell} \]
      5. lower-/.f6415.2

        \[\leadsto \frac{t \cdot \left(x \cdot \sqrt{\frac{1}{x}}\right)}{\ell} \]
    9. Applied rewrites15.2%

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

      \[\leadsto \frac{t \cdot \sqrt{x}}{\ell} \]
    11. Step-by-step derivation
      1. lower-sqrt.f6415.2

        \[\leadsto \frac{t \cdot \sqrt{x}}{\ell} \]
    12. Applied rewrites15.2%

      \[\leadsto \frac{t \cdot \sqrt{x}}{\ell} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 5: 80.4% accurate, 1.8× speedup?

\[\mathsf{copysign}\left(1, t\right) \cdot \begin{array}{l} \mathbf{if}\;\left|\ell\right| \leq 1.65 \cdot 10^{+191}:\\ \;\;\;\;1 - \frac{1}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left|t\right| \cdot \sqrt{x}}{\left|\ell\right|}\\ \end{array} \]
(FPCore (x l t)
 :precision binary64
 (*
  (copysign 1.0 t)
  (if (<= (fabs l) 1.65e+191)
    (- 1.0 (/ 1.0 x))
    (/ (* (fabs t) (sqrt x)) (fabs l)))))
double code(double x, double l, double t) {
	double tmp;
	if (fabs(l) <= 1.65e+191) {
		tmp = 1.0 - (1.0 / x);
	} else {
		tmp = (fabs(t) * sqrt(x)) / fabs(l);
	}
	return copysign(1.0, t) * tmp;
}
public static double code(double x, double l, double t) {
	double tmp;
	if (Math.abs(l) <= 1.65e+191) {
		tmp = 1.0 - (1.0 / x);
	} else {
		tmp = (Math.abs(t) * Math.sqrt(x)) / Math.abs(l);
	}
	return Math.copySign(1.0, t) * tmp;
}
def code(x, l, t):
	tmp = 0
	if math.fabs(l) <= 1.65e+191:
		tmp = 1.0 - (1.0 / x)
	else:
		tmp = (math.fabs(t) * math.sqrt(x)) / math.fabs(l)
	return math.copysign(1.0, t) * tmp
function code(x, l, t)
	tmp = 0.0
	if (abs(l) <= 1.65e+191)
		tmp = Float64(1.0 - Float64(1.0 / x));
	else
		tmp = Float64(Float64(abs(t) * sqrt(x)) / abs(l));
	end
	return Float64(copysign(1.0, t) * tmp)
end
function tmp_2 = code(x, l, t)
	tmp = 0.0;
	if (abs(l) <= 1.65e+191)
		tmp = 1.0 - (1.0 / x);
	else
		tmp = (abs(t) * sqrt(x)) / abs(l);
	end
	tmp_2 = (sign(t) * abs(1.0)) * tmp;
end
code[x_, l_, t_] := N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[N[Abs[l], $MachinePrecision], 1.65e+191], N[(1.0 - N[(1.0 / x), $MachinePrecision]), $MachinePrecision], N[(N[(N[Abs[t], $MachinePrecision] * N[Sqrt[x], $MachinePrecision]), $MachinePrecision] / N[Abs[l], $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\mathsf{copysign}\left(1, t\right) \cdot \begin{array}{l}
\mathbf{if}\;\left|\ell\right| \leq 1.65 \cdot 10^{+191}:\\
\;\;\;\;1 - \frac{1}{x}\\

\mathbf{else}:\\
\;\;\;\;\frac{\left|t\right| \cdot \sqrt{x}}{\left|\ell\right|}\\


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

    1. Initial program 33.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. Taylor expanded in t around inf

      \[\leadsto \color{blue}{\frac{\sqrt{2}}{\sqrt{2 \cdot \frac{1 + x}{x - 1}}}} \]
    3. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \frac{\sqrt{2}}{\color{blue}{\sqrt{2 \cdot \frac{1 + x}{x - 1}}}} \]
      2. lower-sqrt.f64N/A

        \[\leadsto \frac{\sqrt{2}}{\sqrt{\color{blue}{2 \cdot \frac{1 + x}{x - 1}}}} \]
      3. lower-sqrt.f64N/A

        \[\leadsto \frac{\sqrt{2}}{\sqrt{2 \cdot \frac{1 + x}{x - 1}}} \]
      4. lower-*.f64N/A

        \[\leadsto \frac{\sqrt{2}}{\sqrt{2 \cdot \frac{1 + x}{x - 1}}} \]
      5. lower-/.f64N/A

        \[\leadsto \frac{\sqrt{2}}{\sqrt{2 \cdot \frac{1 + x}{x - 1}}} \]
      6. lower-+.f64N/A

        \[\leadsto \frac{\sqrt{2}}{\sqrt{2 \cdot \frac{1 + x}{x - 1}}} \]
      7. lower--.f6438.8

        \[\leadsto \frac{\sqrt{2}}{\sqrt{2 \cdot \frac{1 + x}{x - 1}}} \]
    4. Applied rewrites38.8%

      \[\leadsto \color{blue}{\frac{\sqrt{2}}{\sqrt{2 \cdot \frac{1 + x}{x - 1}}}} \]
    5. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \frac{\sqrt{2}}{\color{blue}{\sqrt{2 \cdot \frac{1 + x}{x - 1}}}} \]
      2. lift-sqrt.f64N/A

        \[\leadsto \frac{\sqrt{2}}{\sqrt{\color{blue}{2 \cdot \frac{1 + x}{x - 1}}}} \]
      3. lift-sqrt.f64N/A

        \[\leadsto \frac{\sqrt{2}}{\sqrt{2 \cdot \frac{1 + x}{x - 1}}} \]
      4. sqrt-undivN/A

        \[\leadsto \sqrt{\frac{2}{2 \cdot \frac{1 + x}{x - 1}}} \]
      5. lower-sqrt.f64N/A

        \[\leadsto \sqrt{\frac{2}{2 \cdot \frac{1 + x}{x - 1}}} \]
      6. lift-*.f64N/A

        \[\leadsto \sqrt{\frac{2}{2 \cdot \frac{1 + x}{x - 1}}} \]
      7. associate-/r*N/A

        \[\leadsto \sqrt{\frac{\frac{2}{2}}{\frac{1 + x}{x - 1}}} \]
      8. metadata-evalN/A

        \[\leadsto \sqrt{\frac{1}{\frac{1 + x}{x - 1}}} \]
      9. metadata-evalN/A

        \[\leadsto \sqrt{\frac{\mathsf{neg}\left(-1\right)}{\frac{1 + x}{x - 1}}} \]
      10. lift-+.f64N/A

        \[\leadsto \sqrt{\frac{\mathsf{neg}\left(-1\right)}{\frac{1 + x}{x - 1}}} \]
      11. +-commutativeN/A

        \[\leadsto \sqrt{\frac{\mathsf{neg}\left(-1\right)}{\frac{x + 1}{x - 1}}} \]
      12. lower-/.f64N/A

        \[\leadsto \sqrt{\frac{\mathsf{neg}\left(-1\right)}{\frac{x + 1}{x - 1}}} \]
      13. frac-2negN/A

        \[\leadsto \sqrt{\frac{\mathsf{neg}\left(-1\right)}{\frac{\mathsf{neg}\left(\left(x + 1\right)\right)}{\mathsf{neg}\left(\left(x - 1\right)\right)}}} \]
      14. lift--.f64N/A

        \[\leadsto \sqrt{\frac{\mathsf{neg}\left(-1\right)}{\frac{\mathsf{neg}\left(\left(x + 1\right)\right)}{\mathsf{neg}\left(\left(x - 1\right)\right)}}} \]
      15. sub-negate-revN/A

        \[\leadsto \sqrt{\frac{\mathsf{neg}\left(-1\right)}{\frac{\mathsf{neg}\left(\left(x + 1\right)\right)}{1 - x}}} \]
      16. lift--.f64N/A

        \[\leadsto \sqrt{\frac{\mathsf{neg}\left(-1\right)}{\frac{\mathsf{neg}\left(\left(x + 1\right)\right)}{1 - x}}} \]
      17. distribute-frac-negN/A

        \[\leadsto \sqrt{\frac{\mathsf{neg}\left(-1\right)}{\mathsf{neg}\left(\frac{x + 1}{1 - x}\right)}} \]
      18. frac-2neg-revN/A

        \[\leadsto \sqrt{\frac{-1}{\frac{x + 1}{1 - x}}} \]
      19. lower-/.f64N/A

        \[\leadsto \sqrt{\frac{-1}{\frac{x + 1}{1 - x}}} \]
    6. Applied rewrites38.9%

      \[\leadsto \color{blue}{\sqrt{\frac{-1}{\frac{-1 - x}{x - 1}}}} \]
    7. Taylor expanded in x around inf

      \[\leadsto 1 - \color{blue}{\frac{1}{x}} \]
    8. Step-by-step derivation
      1. lower--.f64N/A

        \[\leadsto 1 - \frac{1}{\color{blue}{x}} \]
      2. lower-/.f6438.5

        \[\leadsto 1 - \frac{1}{x} \]
    9. Applied rewrites38.5%

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

    if 1.6499999999999999e191 < l

    1. Initial program 33.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. Taylor expanded in l around -inf

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

        \[\leadsto -1 \cdot \color{blue}{\frac{t \cdot \sqrt{2}}{\ell \cdot \sqrt{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}}} \]
      2. lower-/.f64N/A

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

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

        \[\leadsto -1 \cdot \frac{t \cdot \sqrt{2}}{\ell \cdot \sqrt{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}} \]
      5. lower-*.f64N/A

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

        \[\leadsto -1 \cdot \frac{t \cdot \sqrt{2}}{\ell \cdot \sqrt{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}} \]
      7. lower--.f64N/A

        \[\leadsto -1 \cdot \frac{t \cdot \sqrt{2}}{\ell \cdot \sqrt{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}} \]
      8. lower-+.f64N/A

        \[\leadsto -1 \cdot \frac{t \cdot \sqrt{2}}{\ell \cdot \sqrt{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}} \]
      9. lower-/.f64N/A

        \[\leadsto -1 \cdot \frac{t \cdot \sqrt{2}}{\ell \cdot \sqrt{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}} \]
      10. lower--.f64N/A

        \[\leadsto -1 \cdot \frac{t \cdot \sqrt{2}}{\ell \cdot \sqrt{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}} \]
      11. lower-/.f64N/A

        \[\leadsto -1 \cdot \frac{t \cdot \sqrt{2}}{\ell \cdot \sqrt{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}} \]
      12. lower--.f642.6

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

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

        \[\leadsto -1 \cdot \color{blue}{\frac{t \cdot \sqrt{2}}{\ell \cdot \sqrt{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}}} \]
      2. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(\frac{t \cdot \sqrt{2}}{\ell \cdot \sqrt{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}}\right) \]
      3. lift-/.f64N/A

        \[\leadsto \mathsf{neg}\left(\frac{t \cdot \sqrt{2}}{\ell \cdot \sqrt{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}}\right) \]
      4. lift-*.f64N/A

        \[\leadsto \mathsf{neg}\left(\frac{t \cdot \sqrt{2}}{\ell \cdot \sqrt{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}}\right) \]
      5. associate-/l*N/A

        \[\leadsto \mathsf{neg}\left(t \cdot \frac{\sqrt{2}}{\ell \cdot \sqrt{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}}\right) \]
      6. distribute-lft-neg-inN/A

        \[\leadsto \left(\mathsf{neg}\left(t\right)\right) \cdot \color{blue}{\frac{\sqrt{2}}{\ell \cdot \sqrt{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}}} \]
      7. lower-*.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(t\right)\right) \cdot \color{blue}{\frac{\sqrt{2}}{\ell \cdot \sqrt{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}}} \]
      8. lower-neg.f64N/A

        \[\leadsto \left(-t\right) \cdot \frac{\color{blue}{\sqrt{2}}}{\ell \cdot \sqrt{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}} \]
      9. lift-*.f64N/A

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

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

        \[\leadsto \left(-t\right) \cdot \frac{\frac{\sqrt{2}}{\sqrt{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}}}{\color{blue}{\ell}} \]
      12. lower-/.f64N/A

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

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

      \[\leadsto \frac{t \cdot \left(x \cdot \sqrt{\frac{1}{x}}\right)}{\color{blue}{\ell}} \]
    8. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \frac{t \cdot \left(x \cdot \sqrt{\frac{1}{x}}\right)}{\ell} \]
      2. lower-*.f64N/A

        \[\leadsto \frac{t \cdot \left(x \cdot \sqrt{\frac{1}{x}}\right)}{\ell} \]
      3. lower-*.f64N/A

        \[\leadsto \frac{t \cdot \left(x \cdot \sqrt{\frac{1}{x}}\right)}{\ell} \]
      4. lower-sqrt.f64N/A

        \[\leadsto \frac{t \cdot \left(x \cdot \sqrt{\frac{1}{x}}\right)}{\ell} \]
      5. lower-/.f6415.2

        \[\leadsto \frac{t \cdot \left(x \cdot \sqrt{\frac{1}{x}}\right)}{\ell} \]
    9. Applied rewrites15.2%

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

      \[\leadsto \frac{t \cdot \sqrt{x}}{\ell} \]
    11. Step-by-step derivation
      1. lower-sqrt.f6415.2

        \[\leadsto \frac{t \cdot \sqrt{x}}{\ell} \]
    12. Applied rewrites15.2%

      \[\leadsto \frac{t \cdot \sqrt{x}}{\ell} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 6: 76.4% accurate, 3.1× speedup?

\[\mathsf{copysign}\left(1, t\right) \cdot \left(1 - \frac{1}{x}\right) \]
(FPCore (x l t) :precision binary64 (* (copysign 1.0 t) (- 1.0 (/ 1.0 x))))
double code(double x, double l, double t) {
	return copysign(1.0, t) * (1.0 - (1.0 / x));
}
public static double code(double x, double l, double t) {
	return Math.copySign(1.0, t) * (1.0 - (1.0 / x));
}
def code(x, l, t):
	return math.copysign(1.0, t) * (1.0 - (1.0 / x))
function code(x, l, t)
	return Float64(copysign(1.0, t) * Float64(1.0 - Float64(1.0 / x)))
end
function tmp = code(x, l, t)
	tmp = (sign(t) * abs(1.0)) * (1.0 - (1.0 / x));
end
code[x_, l_, t_] := N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * N[(1.0 - N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\mathsf{copysign}\left(1, t\right) \cdot \left(1 - \frac{1}{x}\right)
Derivation
  1. Initial program 33.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. Taylor expanded in t around inf

    \[\leadsto \color{blue}{\frac{\sqrt{2}}{\sqrt{2 \cdot \frac{1 + x}{x - 1}}}} \]
  3. Step-by-step derivation
    1. lower-/.f64N/A

      \[\leadsto \frac{\sqrt{2}}{\color{blue}{\sqrt{2 \cdot \frac{1 + x}{x - 1}}}} \]
    2. lower-sqrt.f64N/A

      \[\leadsto \frac{\sqrt{2}}{\sqrt{\color{blue}{2 \cdot \frac{1 + x}{x - 1}}}} \]
    3. lower-sqrt.f64N/A

      \[\leadsto \frac{\sqrt{2}}{\sqrt{2 \cdot \frac{1 + x}{x - 1}}} \]
    4. lower-*.f64N/A

      \[\leadsto \frac{\sqrt{2}}{\sqrt{2 \cdot \frac{1 + x}{x - 1}}} \]
    5. lower-/.f64N/A

      \[\leadsto \frac{\sqrt{2}}{\sqrt{2 \cdot \frac{1 + x}{x - 1}}} \]
    6. lower-+.f64N/A

      \[\leadsto \frac{\sqrt{2}}{\sqrt{2 \cdot \frac{1 + x}{x - 1}}} \]
    7. lower--.f6438.8

      \[\leadsto \frac{\sqrt{2}}{\sqrt{2 \cdot \frac{1 + x}{x - 1}}} \]
  4. Applied rewrites38.8%

    \[\leadsto \color{blue}{\frac{\sqrt{2}}{\sqrt{2 \cdot \frac{1 + x}{x - 1}}}} \]
  5. Step-by-step derivation
    1. lift-/.f64N/A

      \[\leadsto \frac{\sqrt{2}}{\color{blue}{\sqrt{2 \cdot \frac{1 + x}{x - 1}}}} \]
    2. lift-sqrt.f64N/A

      \[\leadsto \frac{\sqrt{2}}{\sqrt{\color{blue}{2 \cdot \frac{1 + x}{x - 1}}}} \]
    3. lift-sqrt.f64N/A

      \[\leadsto \frac{\sqrt{2}}{\sqrt{2 \cdot \frac{1 + x}{x - 1}}} \]
    4. sqrt-undivN/A

      \[\leadsto \sqrt{\frac{2}{2 \cdot \frac{1 + x}{x - 1}}} \]
    5. lower-sqrt.f64N/A

      \[\leadsto \sqrt{\frac{2}{2 \cdot \frac{1 + x}{x - 1}}} \]
    6. lift-*.f64N/A

      \[\leadsto \sqrt{\frac{2}{2 \cdot \frac{1 + x}{x - 1}}} \]
    7. associate-/r*N/A

      \[\leadsto \sqrt{\frac{\frac{2}{2}}{\frac{1 + x}{x - 1}}} \]
    8. metadata-evalN/A

      \[\leadsto \sqrt{\frac{1}{\frac{1 + x}{x - 1}}} \]
    9. metadata-evalN/A

      \[\leadsto \sqrt{\frac{\mathsf{neg}\left(-1\right)}{\frac{1 + x}{x - 1}}} \]
    10. lift-+.f64N/A

      \[\leadsto \sqrt{\frac{\mathsf{neg}\left(-1\right)}{\frac{1 + x}{x - 1}}} \]
    11. +-commutativeN/A

      \[\leadsto \sqrt{\frac{\mathsf{neg}\left(-1\right)}{\frac{x + 1}{x - 1}}} \]
    12. lower-/.f64N/A

      \[\leadsto \sqrt{\frac{\mathsf{neg}\left(-1\right)}{\frac{x + 1}{x - 1}}} \]
    13. frac-2negN/A

      \[\leadsto \sqrt{\frac{\mathsf{neg}\left(-1\right)}{\frac{\mathsf{neg}\left(\left(x + 1\right)\right)}{\mathsf{neg}\left(\left(x - 1\right)\right)}}} \]
    14. lift--.f64N/A

      \[\leadsto \sqrt{\frac{\mathsf{neg}\left(-1\right)}{\frac{\mathsf{neg}\left(\left(x + 1\right)\right)}{\mathsf{neg}\left(\left(x - 1\right)\right)}}} \]
    15. sub-negate-revN/A

      \[\leadsto \sqrt{\frac{\mathsf{neg}\left(-1\right)}{\frac{\mathsf{neg}\left(\left(x + 1\right)\right)}{1 - x}}} \]
    16. lift--.f64N/A

      \[\leadsto \sqrt{\frac{\mathsf{neg}\left(-1\right)}{\frac{\mathsf{neg}\left(\left(x + 1\right)\right)}{1 - x}}} \]
    17. distribute-frac-negN/A

      \[\leadsto \sqrt{\frac{\mathsf{neg}\left(-1\right)}{\mathsf{neg}\left(\frac{x + 1}{1 - x}\right)}} \]
    18. frac-2neg-revN/A

      \[\leadsto \sqrt{\frac{-1}{\frac{x + 1}{1 - x}}} \]
    19. lower-/.f64N/A

      \[\leadsto \sqrt{\frac{-1}{\frac{x + 1}{1 - x}}} \]
  6. Applied rewrites38.9%

    \[\leadsto \color{blue}{\sqrt{\frac{-1}{\frac{-1 - x}{x - 1}}}} \]
  7. Taylor expanded in x around inf

    \[\leadsto 1 - \color{blue}{\frac{1}{x}} \]
  8. Step-by-step derivation
    1. lower--.f64N/A

      \[\leadsto 1 - \frac{1}{\color{blue}{x}} \]
    2. lower-/.f6438.5

      \[\leadsto 1 - \frac{1}{x} \]
  9. Applied rewrites38.5%

    \[\leadsto 1 - \color{blue}{\frac{1}{x}} \]
  10. Add Preprocessing

Alternative 7: 75.6% accurate, 3.3× speedup?

\[\mathsf{copysign}\left(1, t\right) \cdot \frac{1.4142135623730951}{\sqrt{2}} \]
(FPCore (x l t)
 :precision binary64
 (* (copysign 1.0 t) (/ 1.4142135623730951 (sqrt 2.0))))
double code(double x, double l, double t) {
	return copysign(1.0, t) * (1.4142135623730951 / sqrt(2.0));
}
public static double code(double x, double l, double t) {
	return Math.copySign(1.0, t) * (1.4142135623730951 / Math.sqrt(2.0));
}
def code(x, l, t):
	return math.copysign(1.0, t) * (1.4142135623730951 / math.sqrt(2.0))
function code(x, l, t)
	return Float64(copysign(1.0, t) * Float64(1.4142135623730951 / sqrt(2.0)))
end
function tmp = code(x, l, t)
	tmp = (sign(t) * abs(1.0)) * (1.4142135623730951 / sqrt(2.0));
end
code[x_, l_, t_] := N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * N[(1.4142135623730951 / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\mathsf{copysign}\left(1, t\right) \cdot \frac{1.4142135623730951}{\sqrt{2}}
Derivation
  1. Initial program 33.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. Taylor expanded in t around inf

    \[\leadsto \color{blue}{\frac{\sqrt{2}}{\sqrt{2 \cdot \frac{1 + x}{x - 1}}}} \]
  3. Step-by-step derivation
    1. lower-/.f64N/A

      \[\leadsto \frac{\sqrt{2}}{\color{blue}{\sqrt{2 \cdot \frac{1 + x}{x - 1}}}} \]
    2. lower-sqrt.f64N/A

      \[\leadsto \frac{\sqrt{2}}{\sqrt{\color{blue}{2 \cdot \frac{1 + x}{x - 1}}}} \]
    3. lower-sqrt.f64N/A

      \[\leadsto \frac{\sqrt{2}}{\sqrt{2 \cdot \frac{1 + x}{x - 1}}} \]
    4. lower-*.f64N/A

      \[\leadsto \frac{\sqrt{2}}{\sqrt{2 \cdot \frac{1 + x}{x - 1}}} \]
    5. lower-/.f64N/A

      \[\leadsto \frac{\sqrt{2}}{\sqrt{2 \cdot \frac{1 + x}{x - 1}}} \]
    6. lower-+.f64N/A

      \[\leadsto \frac{\sqrt{2}}{\sqrt{2 \cdot \frac{1 + x}{x - 1}}} \]
    7. lower--.f6438.8

      \[\leadsto \frac{\sqrt{2}}{\sqrt{2 \cdot \frac{1 + x}{x - 1}}} \]
  4. Applied rewrites38.8%

    \[\leadsto \color{blue}{\frac{\sqrt{2}}{\sqrt{2 \cdot \frac{1 + x}{x - 1}}}} \]
  5. Taylor expanded in x around inf

    \[\leadsto \frac{\sqrt{2}}{\sqrt{2}} \]
  6. Step-by-step derivation
    1. Applied rewrites38.1%

      \[\leadsto \frac{\sqrt{2}}{\sqrt{2}} \]
    2. Evaluated real constant38.1%

      \[\leadsto \frac{\frac{6369051672525773}{4503599627370496}}{\sqrt{\color{blue}{2}}} \]
    3. Add Preprocessing

    Reproduce

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