Toniolo and Linder, Equation (7)

?

Percentage Accurate: 33.0% → 79.4%
Time: 32.4s
Precision: binary64
Cost: 14792

?

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

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

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


\end{array}

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.

Herbie found 13 alternatives:

AlternativeAccuracySpeedup

Accuracy vs Speed

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.

Bogosity?

Bogosity

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation?

  1. Split input into 3 regimes
  2. if t < -1.2000000000000001e-196

    1. Initial program 32.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. Simplified32.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)}}} \]
      Step-by-step derivation

      [Start]32.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}} \]

      associate-*r/ [<=]32.9%

      \[ \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}}} \]

      fma-neg [=>]32.9%

      \[ \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)}}} \]

      sub-neg [=>]32.9%

      \[ \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)}} \]

      metadata-eval [=>]32.9%

      \[ \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)}} \]

      +-commutative [=>]32.9%

      \[ \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)}} \]

      fma-def [=>]32.9%

      \[ \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)}} \]

      distribute-rgt-neg-in [=>]32.9%

      \[ \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. Applied egg-rr73.7%

      \[\leadsto \color{blue}{\frac{t \cdot \sqrt{2}}{\mathsf{hypot}\left(\sqrt{\frac{x + 1}{x + -1}} \cdot \mathsf{hypot}\left(\ell, t \cdot \sqrt{2}\right), \ell\right)}} \]
      Step-by-step derivation

      [Start]32.9%

      \[ \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)}} \]

      associate-*r/ [=>]32.9%

      \[ \color{blue}{\frac{\sqrt{2} \cdot 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)}}} \]

      metadata-eval [<=]32.9%

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

      sub-neg [<=]32.9%

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

      fma-udef [=>]32.9%

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

      +-commutative [<=]32.9%

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

      distribute-rgt-neg-out [=>]32.9%

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

      fma-neg [<=]32.9%

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

      *-commutative [=>]32.9%

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

      fma-neg [=>]32.9%

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

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

      \[\leadsto \color{blue}{-\sqrt{\frac{x + -1}{1 + x}}} \]
      Step-by-step derivation

      [Start]83.0%

      \[ -1 \cdot \sqrt{\frac{x - 1}{1 + x}} \]

      mul-1-neg [=>]83.0%

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

      sub-neg [=>]83.0%

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

      metadata-eval [=>]83.0%

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

      +-commutative [=>]83.0%

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

      +-commutative [<=]83.0%

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

    if -1.2000000000000001e-196 < t < 1.9999999999999999e-112

    1. Initial program 7.2%

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

      \[\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} \]
      Step-by-step derivation

      [Start]7.2%

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

      associate-*l/ [<=]7.2%

      \[ \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. Taylor expanded in x around inf 71.4%

      \[\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 \]
    4. Simplified71.4%

      \[\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(\ell, \ell, 2 \cdot \left(t \cdot t\right)\right)}{x}\right)}}} \cdot t \]
      Step-by-step derivation

      [Start]71.4%

      \[ \frac{\sqrt{2}}{\sqrt{\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 \]

      associate--l+ [=>]71.4%

      \[ \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 \]

      unpow2 [=>]71.4%

      \[ \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 \]

      distribute-lft-out [=>]71.4%

      \[ \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 \]

      unpow2 [=>]71.4%

      \[ \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 \]

      unpow2 [=>]71.4%

      \[ \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 \]

      associate-*r/ [=>]71.4%

      \[ \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 \]

      mul-1-neg [=>]71.4%

      \[ \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 \]

      unpow2 [=>]71.4%

      \[ \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}{\ell \cdot \ell} + 2 \cdot {t}^{2}\right)}{x}\right)}} \cdot t \]

      fma-udef [<=]71.4%

      \[ \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(\ell, \ell, 2 \cdot {t}^{2}\right)}}{x}\right)}} \cdot t \]

      unpow2 [=>]71.4%

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

      \[\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 \]
    6. Simplified71.4%

      \[\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 \ell}{x}}\right)}} \cdot t \]
      Step-by-step derivation

      [Start]71.4%

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

      associate-*r/ [=>]71.4%

      \[ \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 \]

      mul-1-neg [=>]71.4%

      \[ \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 \]

      unpow2 [=>]71.4%

      \[ \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 \]

    if 1.9999999999999999e-112 < t

    1. Initial program 45.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. Simplified45.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)}}} \]
      Step-by-step derivation

      [Start]45.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}} \]

      associate-*r/ [<=]45.7%

      \[ \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}}} \]

      fma-neg [=>]45.7%

      \[ \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)}}} \]

      sub-neg [=>]45.7%

      \[ \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)}} \]

      metadata-eval [=>]45.7%

      \[ \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)}} \]

      +-commutative [=>]45.7%

      \[ \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)}} \]

      fma-def [=>]45.7%

      \[ \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)}} \]

      distribute-rgt-neg-in [=>]45.7%

      \[ \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. Applied egg-rr84.6%

      \[\leadsto \color{blue}{\frac{t \cdot \sqrt{2}}{\mathsf{hypot}\left(\sqrt{\frac{x + 1}{x + -1}} \cdot \mathsf{hypot}\left(\ell, t \cdot \sqrt{2}\right), \ell\right)}} \]
      Step-by-step derivation

      [Start]45.7%

      \[ \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)}} \]

      associate-*r/ [=>]45.8%

      \[ \color{blue}{\frac{\sqrt{2} \cdot 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)}}} \]

      metadata-eval [<=]45.8%

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

      sub-neg [<=]45.8%

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

      fma-udef [=>]45.8%

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

      +-commutative [<=]45.8%

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

      distribute-rgt-neg-out [=>]45.8%

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

      fma-neg [<=]45.8%

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

      *-commutative [=>]45.8%

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

      fma-neg [=>]45.8%

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

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

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

Alternatives

Alternative 1
Accuracy79.4%
Cost14792
\[\begin{array}{l} t_1 := \sqrt{\frac{x + -1}{x + 1}}\\ t_2 := \frac{\ell \cdot \ell}{x}\\ \mathbf{if}\;t \leq -1.2 \cdot 10^{-196}:\\ \;\;\;\;-t_1\\ \mathbf{elif}\;t \leq 2 \cdot 10^{-112}:\\ \;\;\;\;t \cdot \frac{\sqrt{2}}{\sqrt{t_2 + \left(t_2 + 2 \cdot \left(t \cdot t + \frac{t \cdot t}{x}\right)\right)}}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 2
Accuracy78.7%
Cost14024
\[\begin{array}{l} t_1 := \sqrt{\frac{x + -1}{x + 1}}\\ t_2 := \frac{\ell \cdot \ell}{x}\\ \mathbf{if}\;t \leq -9 \cdot 10^{-197}:\\ \;\;\;\;-t_1\\ \mathbf{elif}\;t \leq 1.8 \cdot 10^{-183}:\\ \;\;\;\;t \cdot \frac{\sqrt{2}}{\sqrt{t_2 + t_2}}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 3
Accuracy78.0%
Cost13768
\[\begin{array}{l} t_1 := \sqrt{\frac{x + -1}{x + 1}}\\ \mathbf{if}\;t \leq -7 \cdot 10^{-224}:\\ \;\;\;\;-t_1\\ \mathbf{elif}\;t \leq 3.8 \cdot 10^{-188}:\\ \;\;\;\;t \cdot \left(\frac{\sqrt{2}}{\ell} \cdot \sqrt{\frac{1}{\frac{2}{x}}}\right)\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 4
Accuracy77.7%
Cost7112
\[\begin{array}{l} \mathbf{if}\;t \leq -3.3 \cdot 10^{-211}:\\ \;\;\;\;-1 + \frac{1}{x}\\ \mathbf{elif}\;t \leq 1.4 \cdot 10^{-195}:\\ \;\;\;\;\frac{\sqrt{x}}{\ell} \cdot \left(-t\right)\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\ \end{array} \]
Alternative 5
Accuracy78.1%
Cost7112
\[\begin{array}{l} t_1 := \sqrt{\frac{x + -1}{x + 1}}\\ \mathbf{if}\;t \leq -3.4 \cdot 10^{-217}:\\ \;\;\;\;-t_1\\ \mathbf{elif}\;t \leq 5.8 \cdot 10^{-201}:\\ \;\;\;\;\frac{\sqrt{x}}{\ell} \cdot \left(-t\right)\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 6
Accuracy77.5%
Cost7048
\[\begin{array}{l} \mathbf{if}\;t \leq -9 \cdot 10^{-212}:\\ \;\;\;\;-1 + \frac{1}{x}\\ \mathbf{elif}\;t \leq 4 \cdot 10^{-197}:\\ \;\;\;\;\frac{\sqrt{x}}{\ell} \cdot \left(-t\right)\\ \mathbf{else}:\\ \;\;\;\;1 + \left(\frac{0.5}{x \cdot x} + \frac{-1}{x}\right)\\ \end{array} \]
Alternative 7
Accuracy75.7%
Cost6984
\[\begin{array}{l} \mathbf{if}\;t \leq -9.5 \cdot 10^{-256}:\\ \;\;\;\;-1 + \frac{1}{x}\\ \mathbf{elif}\;t \leq 5.2 \cdot 10^{-191}:\\ \;\;\;\;\frac{\sqrt{2}}{\frac{\ell}{t}}\\ \mathbf{else}:\\ \;\;\;\;1 + \left(\frac{0.5}{x \cdot x} + \frac{-1}{x}\right)\\ \end{array} \]
Alternative 8
Accuracy76.2%
Cost968
\[\begin{array}{l} \mathbf{if}\;t \leq -2.5 \cdot 10^{-265}:\\ \;\;\;\;-1 + \frac{1}{x}\\ \mathbf{elif}\;t \leq 1.9 \cdot 10^{-225}:\\ \;\;\;\;t \cdot \frac{2}{\frac{\ell}{t} \cdot \frac{\ell}{x}}\\ \mathbf{else}:\\ \;\;\;\;1 + \frac{-1}{x}\\ \end{array} \]
Alternative 9
Accuracy76.2%
Cost968
\[\begin{array}{l} \mathbf{if}\;t \leq -8.2 \cdot 10^{-250}:\\ \;\;\;\;-1 + \frac{1}{x}\\ \mathbf{elif}\;t \leq 1.9 \cdot 10^{-223}:\\ \;\;\;\;t \cdot \frac{2}{\frac{\ell}{t} \cdot \frac{\ell}{x}}\\ \mathbf{else}:\\ \;\;\;\;1 + \left(\frac{0.5}{x \cdot x} + \frac{-1}{x}\right)\\ \end{array} \]
Alternative 10
Accuracy75.8%
Cost452
\[\begin{array}{l} \mathbf{if}\;t \leq -5 \cdot 10^{-310}:\\ \;\;\;\;-1 + \frac{1}{x}\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]
Alternative 11
Accuracy76.2%
Cost452
\[\begin{array}{l} \mathbf{if}\;t \leq -5 \cdot 10^{-310}:\\ \;\;\;\;-1 + \frac{1}{x}\\ \mathbf{else}:\\ \;\;\;\;1 + \frac{-1}{x}\\ \end{array} \]
Alternative 12
Accuracy75.5%
Cost196
\[\begin{array}{l} \mathbf{if}\;t \leq -5 \cdot 10^{-310}:\\ \;\;\;\;-1\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]
Alternative 13
Accuracy38.0%
Cost64
\[-1 \]

Reproduce?

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