Toniolo and Linder, Equation (7)

?

Percentage Accurate: 32.9% → 82.0%
Time: 43.2s
Precision: binary64
Cost: 21448

?

\[\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} \mathbf{if}\;t \leq -3.8 \cdot 10^{-28}:\\ \;\;\;\;-\sqrt{\frac{x + -1}{x + 1}}\\ \mathbf{elif}\;t \leq 1.05 \cdot 10^{+54}:\\ \;\;\;\;t \cdot \frac{\sqrt{2}}{\sqrt{\frac{\ell \cdot \ell}{x} + \left(2 \cdot \left(t \cdot t + \frac{t \cdot t}{x}\right) + \frac{\mathsf{fma}\left(t \cdot 2, t, \ell \cdot \ell\right)}{x}\right)}}\\ \mathbf{else}:\\ \;\;\;\;1 + \frac{-1}{x}\\ \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
 (if (<= t -3.8e-28)
   (- (sqrt (/ (+ x -1.0) (+ x 1.0))))
   (if (<= t 1.05e+54)
     (*
      t
      (/
       (sqrt 2.0)
       (sqrt
        (+
         (/ (* l l) x)
         (+
          (* 2.0 (+ (* t t) (/ (* t t) x)))
          (/ (fma (* t 2.0) t (* l l)) x))))))
     (+ 1.0 (/ -1.0 x)))))
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 tmp;
	if (t <= -3.8e-28) {
		tmp = -sqrt(((x + -1.0) / (x + 1.0)));
	} else if (t <= 1.05e+54) {
		tmp = t * (sqrt(2.0) / sqrt((((l * l) / x) + ((2.0 * ((t * t) + ((t * t) / x))) + (fma((t * 2.0), t, (l * l)) / x)))));
	} else {
		tmp = 1.0 + (-1.0 / x);
	}
	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)
	tmp = 0.0
	if (t <= -3.8e-28)
		tmp = Float64(-sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0))));
	elseif (t <= 1.05e+54)
		tmp = Float64(t * Float64(sqrt(2.0) / sqrt(Float64(Float64(Float64(l * l) / x) + Float64(Float64(2.0 * Float64(Float64(t * t) + Float64(Float64(t * t) / x))) + Float64(fma(Float64(t * 2.0), t, Float64(l * l)) / x))))));
	else
		tmp = Float64(1.0 + Float64(-1.0 / x));
	end
	return 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_] := If[LessEqual[t, -3.8e-28], (-N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), If[LessEqual[t, 1.05e+54], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[Sqrt[N[(N[(N[(l * l), $MachinePrecision] / x), $MachinePrecision] + N[(N[(2.0 * N[(N[(t * t), $MachinePrecision] + N[(N[(t * t), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(t * 2.0), $MachinePrecision] * t + N[(l * l), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(-1.0 / x), $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}}
\begin{array}{l}
\mathbf{if}\;t \leq -3.8 \cdot 10^{-28}:\\
\;\;\;\;-\sqrt{\frac{x + -1}{x + 1}}\\

\mathbf{elif}\;t \leq 1.05 \cdot 10^{+54}:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{\sqrt{\frac{\ell \cdot \ell}{x} + \left(2 \cdot \left(t \cdot t + \frac{t \cdot t}{x}\right) + \frac{\mathsf{fma}\left(t \cdot 2, t, \ell \cdot \ell\right)}{x}\right)}}\\

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


\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 14 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

Derivation?

  1. Split input into 3 regimes
  2. if t < -3.80000000000000009e-28

    1. Initial program 33.1%

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

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

      associate-*r/ [<=]33.0%

      \[ \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 [=>]33.0%

      \[ \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 [=>]33.0%

      \[ \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 [=>]33.0%

      \[ \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 [=>]33.0%

      \[ \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 [=>]33.0%

      \[ \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 [=>]33.0%

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

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

      [Start]33.0%

      \[ \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/ [=>]33.1%

      \[ \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 [<=]33.1%

      \[ \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 [<=]33.1%

      \[ \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 [=>]33.1%

      \[ \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 [<=]33.1%

      \[ \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 [=>]33.1%

      \[ \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 [<=]33.1%

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

      clear-num [=>]33.0%

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

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

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

      [Start]90.8%

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

      mul-1-neg [=>]90.8%

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

      sub-neg [=>]90.8%

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

      metadata-eval [=>]90.8%

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

      +-commutative [=>]90.8%

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

    if -3.80000000000000009e-28 < t < 1.04999999999999993e54

    1. Initial program 35.5%

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

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

      [Start]35.5%

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

      associate-*l/ [<=]35.6%

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

      [Start]76.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+ [=>]76.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 [=>]76.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 [=>]76.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 [=>]76.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 [=>]76.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/ [=>]76.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 [=>]76.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 \]

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

      unpow2 [=>]76.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(2 \cdot \color{blue}{\left(t \cdot t\right)} + {\ell}^{2}\right)}{x}\right)}} \cdot t \]

      associate-*l* [<=]76.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}{\left(2 \cdot t\right) \cdot t} + {\ell}^{2}\right)}{x}\right)}} \cdot t \]

      unpow2 [=>]76.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(\left(2 \cdot t\right) \cdot t + \color{blue}{\ell \cdot \ell}\right)}{x}\right)}} \cdot t \]

      fma-udef [<=]76.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(2 \cdot t, t, \ell \cdot \ell\right)}}{x}\right)}} \cdot t \]

    if 1.04999999999999993e54 < t

    1. Initial program 26.1%

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

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

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

      associate-*r/ [<=]26.1%

      \[ \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 [=>]26.1%

      \[ \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 [=>]26.1%

      \[ \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 [=>]26.1%

      \[ \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 [=>]26.1%

      \[ \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 [=>]26.1%

      \[ \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 [=>]26.1%

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

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

      [Start]26.1%

      \[ \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/ [=>]26.1%

      \[ \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 [<=]26.1%

      \[ \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 [<=]26.1%

      \[ \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 [=>]26.1%

      \[ \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 [<=]26.1%

      \[ \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 [=>]26.1%

      \[ \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 [<=]26.1%

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

      clear-num [=>]26.1%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -3.8 \cdot 10^{-28}:\\ \;\;\;\;-\sqrt{\frac{x + -1}{x + 1}}\\ \mathbf{elif}\;t \leq 1.05 \cdot 10^{+54}:\\ \;\;\;\;t \cdot \frac{\sqrt{2}}{\sqrt{\frac{\ell \cdot \ell}{x} + \left(2 \cdot \left(t \cdot t + \frac{t \cdot t}{x}\right) + \frac{\mathsf{fma}\left(t \cdot 2, t, \ell \cdot \ell\right)}{x}\right)}}\\ \mathbf{else}:\\ \;\;\;\;1 + \frac{-1}{x}\\ \end{array} \]

Alternatives

Alternative 1
Accuracy82.0%
Cost21448
\[\begin{array}{l} \mathbf{if}\;t \leq -3.8 \cdot 10^{-28}:\\ \;\;\;\;-\sqrt{\frac{x + -1}{x + 1}}\\ \mathbf{elif}\;t \leq 1.05 \cdot 10^{+54}:\\ \;\;\;\;t \cdot \frac{\sqrt{2}}{\sqrt{\frac{\ell \cdot \ell}{x} + \left(2 \cdot \left(t \cdot t + \frac{t \cdot t}{x}\right) + \frac{\mathsf{fma}\left(t \cdot 2, t, \ell \cdot \ell\right)}{x}\right)}}\\ \mathbf{else}:\\ \;\;\;\;1 + \frac{-1}{x}\\ \end{array} \]
Alternative 2
Accuracy78.6%
Cost13896
\[\begin{array}{l} t_1 := \sqrt{\frac{x + -1}{x + 1}}\\ \mathbf{if}\;t \leq -9 \cdot 10^{-224}:\\ \;\;\;\;-t_1\\ \mathbf{elif}\;t \leq 2.5 \cdot 10^{-155}:\\ \;\;\;\;\sqrt{2} \cdot \frac{t}{\sqrt{\frac{\ell \cdot \ell + \ell \cdot \ell}{x}}}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 3
Accuracy77.5%
Cost13640
\[\begin{array}{l} t_1 := \sqrt{\frac{x + -1}{x + 1}}\\ \mathbf{if}\;t \leq -8.2 \cdot 10^{-227}:\\ \;\;\;\;-t_1\\ \mathbf{elif}\;t \leq 1.16 \cdot 10^{-158}:\\ \;\;\;\;\frac{\sqrt{2}}{\sqrt{\frac{2}{x}} \cdot \frac{\ell}{t}}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 4
Accuracy76.6%
Cost7880
\[\begin{array}{l} t_1 := \sqrt{\frac{x + -1}{x + 1}}\\ \mathbf{if}\;t \leq -5.3 \cdot 10^{-224}:\\ \;\;\;\;-t_1\\ \mathbf{elif}\;t \leq 3.6 \cdot 10^{-240}:\\ \;\;\;\;t \cdot \sqrt{\frac{2}{\ell \cdot \ell + \frac{x + 1}{\frac{x + -1}{\ell \cdot \ell}}}}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 5
Accuracy76.8%
Cost7496
\[\begin{array}{l} t_1 := \sqrt{\frac{x + -1}{x + 1}}\\ \mathbf{if}\;t \leq -2.3 \cdot 10^{-236}:\\ \;\;\;\;-t_1\\ \mathbf{elif}\;t \leq 1.9 \cdot 10^{-245}:\\ \;\;\;\;t \cdot \sqrt{\frac{2}{2 \cdot \left(\ell \cdot \ell + t \cdot t\right)}}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 6
Accuracy76.5%
Cost7112
\[\begin{array}{l} \mathbf{if}\;t \leq -4.2 \cdot 10^{-233}:\\ \;\;\;\;-1 + \frac{1}{x}\\ \mathbf{elif}\;t \leq 3 \cdot 10^{-244}:\\ \;\;\;\;\frac{\sqrt{2}}{\frac{\ell}{t}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\ \end{array} \]
Alternative 7
Accuracy76.7%
Cost7112
\[\begin{array}{l} t_1 := \sqrt{\frac{x + -1}{x + 1}}\\ \mathbf{if}\;t \leq -3.45 \cdot 10^{-239}:\\ \;\;\;\;-t_1\\ \mathbf{elif}\;t \leq 9.2 \cdot 10^{-238}:\\ \;\;\;\;\frac{\sqrt{2}}{\frac{\ell}{t}}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 8
Accuracy76.3%
Cost6984
\[\begin{array}{l} \mathbf{if}\;t \leq -6.6 \cdot 10^{-245}:\\ \;\;\;\;-1 + \frac{1}{x}\\ \mathbf{elif}\;t \leq 1.35 \cdot 10^{-245}:\\ \;\;\;\;t \cdot \frac{\sqrt{2}}{\ell}\\ \mathbf{else}:\\ \;\;\;\;1 + \left(\frac{0.5}{x \cdot x} + \frac{-1}{x}\right)\\ \end{array} \]
Alternative 9
Accuracy76.2%
Cost6984
\[\begin{array}{l} \mathbf{if}\;t \leq -5.8 \cdot 10^{-226}:\\ \;\;\;\;-1 + \frac{1}{x}\\ \mathbf{elif}\;t \leq 1.9 \cdot 10^{-244}:\\ \;\;\;\;\frac{\sqrt{2}}{\frac{\ell}{t}}\\ \mathbf{else}:\\ \;\;\;\;1 + \left(\frac{0.5}{x \cdot x} + \frac{-1}{x}\right)\\ \end{array} \]
Alternative 10
Accuracy76.0%
Cost836
\[\begin{array}{l} \mathbf{if}\;t \leq -1 \cdot 10^{-310}:\\ \;\;\;\;-1 + \frac{1}{x}\\ \mathbf{else}:\\ \;\;\;\;1 + \left(\frac{0.5}{x \cdot x} + \frac{-1}{x}\right)\\ \end{array} \]
Alternative 11
Accuracy75.6%
Cost452
\[\begin{array}{l} \mathbf{if}\;t \leq -1 \cdot 10^{-310}:\\ \;\;\;\;-1 + \frac{1}{x}\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]
Alternative 12
Accuracy75.9%
Cost452
\[\begin{array}{l} \mathbf{if}\;t \leq -1 \cdot 10^{-310}:\\ \;\;\;\;-1 + \frac{1}{x}\\ \mathbf{else}:\\ \;\;\;\;1 + \frac{-1}{x}\\ \end{array} \]
Alternative 13
Accuracy75.3%
Cost196
\[\begin{array}{l} \mathbf{if}\;t \leq -1 \cdot 10^{-310}:\\ \;\;\;\;-1\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]
Alternative 14
Accuracy37.8%
Cost64
\[-1 \]

Reproduce?

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