?

Average Accuracy: 33.3% → 83.4%
Time: 29.3s
Precision: binary64
Cost: 27908

?

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

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

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


\end{array}

Error?

Derivation?

  1. Split input into 3 regimes
  2. if t < -8.99999999999999978e-307

    1. Initial program 33.4%

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

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

      [Start]33.4

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

      associate-*l/ [<=]33.4

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

      +-commutative [=>]33.4

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

      fma-def [=>]33.4

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

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

      \[\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) - \left(-\frac{\mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right)}{x}\right)\right)}}} \cdot t \]
      Proof

      [Start]52.0

      \[ \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+ [=>]52.0

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

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

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

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

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

      mul-1-neg [=>]52.0

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

      +-commutative [=>]52.0

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

      unpow2 [=>]52.0

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

      fma-udef [<=]52.0

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

      unpow2 [=>]52.0

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

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

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

      [Start]73.1

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

      *-commutative [=>]73.1

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

      *-commutative [=>]73.1

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

      distribute-lft-out [=>]73.1

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

      +-commutative [<=]73.1

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

      mul-1-neg [=>]73.1

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

    if -8.99999999999999978e-307 < t < 1.07999999999999997e52

    1. Initial program 36.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. Simplified36.5%

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

      [Start]36.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/ [<=]36.5

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

      +-commutative [=>]36.5

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

      fma-def [=>]36.5

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

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

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

      [Start]71.7

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

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

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

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

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

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

      mul-1-neg [=>]71.7

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

      +-commutative [=>]71.7

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

      unpow2 [=>]71.7

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

      fma-udef [<=]71.7

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

      unpow2 [=>]71.7

      \[ \frac{\sqrt{2}}{\sqrt{\frac{\ell \cdot \ell}{x} + \left(2 \cdot \left(\frac{t \cdot t}{x} + t \cdot t\right) - \left(-\frac{\mathsf{fma}\left(2, \color{blue}{t \cdot t}, \ell \cdot \ell\right)}{x}\right)\right)}} \cdot t \]
    5. Taylor expanded in t around 0 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) - \left(-\color{blue}{\frac{{\ell}^{2}}{x}}\right)\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) - \left(-\color{blue}{\ell \cdot \frac{\ell}{x}}\right)\right)}} \cdot t \]
      Proof

      [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) - \left(-\frac{{\ell}^{2}}{x}\right)\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) - \left(-\frac{\color{blue}{\ell \cdot \ell}}{x}\right)\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) - \left(-\color{blue}{\ell \cdot \frac{\ell}{x}}\right)\right)}} \cdot t \]
    7. Applied egg-rr38.1%

      \[\leadsto \frac{\sqrt{2}}{\color{blue}{e^{\mathsf{log1p}\left(\sqrt{\mathsf{fma}\left(\ell, \frac{\ell}{x}, \mathsf{fma}\left(\ell, \frac{\ell}{x}, 2 \cdot \mathsf{fma}\left(t, t, \frac{t}{x} \cdot t\right)\right)\right)}\right)} - 1}} \cdot t \]
    8. Simplified78.1%

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

      [Start]38.1

      \[ \frac{\sqrt{2}}{e^{\mathsf{log1p}\left(\sqrt{\mathsf{fma}\left(\ell, \frac{\ell}{x}, \mathsf{fma}\left(\ell, \frac{\ell}{x}, 2 \cdot \mathsf{fma}\left(t, t, \frac{t}{x} \cdot t\right)\right)\right)}\right)} - 1} \cdot t \]

      expm1-def [=>]76.6

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

      expm1-log1p [=>]78.1

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

      fma-udef [=>]78.1

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

      distribute-rgt-out [=>]78.1

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

      +-commutative [=>]78.1

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

    if 1.07999999999999997e52 < t

    1. Initial program 29.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. Simplified29.9%

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

      [Start]29.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/ [<=]29.8

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

      associate-*l/ [=>]11.4

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

      associate-*r/ [<=]29.8

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

      *-lft-identity [<=]29.8

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

      associate-*r* [<=]29.8

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

      *-commutative [<=]29.8

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

      associate-*r* [=>]29.8

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

      *-commutative [<=]29.8

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

      fma-neg [=>]29.9

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

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

      \[\leadsto \sqrt{2} \cdot \frac{t}{\sqrt{\color{blue}{2 \cdot \frac{x + 1}{\frac{\frac{x - 1}{t}}{t}}}}} \]
      Proof

      [Start]12.8

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

      associate-/l* [=>]34.7

      \[ \sqrt{2} \cdot \frac{t}{\sqrt{2 \cdot \color{blue}{\frac{1 + x}{\frac{x - 1}{{t}^{2}}}}}} \]

      +-commutative [=>]34.7

      \[ \sqrt{2} \cdot \frac{t}{\sqrt{2 \cdot \frac{\color{blue}{x + 1}}{\frac{x - 1}{{t}^{2}}}}} \]

      unpow2 [=>]34.7

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

      associate-/r* [=>]34.7

      \[ \sqrt{2} \cdot \frac{t}{\sqrt{2 \cdot \frac{x + 1}{\color{blue}{\frac{\frac{x - 1}{t}}{t}}}}} \]
    5. Taylor expanded in t around 0 94.0%

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

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

Alternatives

Alternative 1
Accuracy82.5%
Cost27208
\[\begin{array}{l} t_1 := 2 + \left(\frac{2}{x} + \frac{2}{x}\right)\\ \mathbf{if}\;t \leq -3.7 \cdot 10^{-308}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{\frac{1}{t_1}} \cdot \left(-0.5 \cdot \frac{2 \cdot \frac{\ell}{\frac{x}{\ell}}}{t}\right) - t \cdot \sqrt{t_1}}\\ \mathbf{elif}\;t \leq 1.05 \cdot 10^{+55}:\\ \;\;\;\;t \cdot \frac{\sqrt{2}}{\sqrt{\mathsf{fma}\left(\ell, \frac{\ell}{x}, \mathsf{fma}\left(\ell, \frac{\ell}{x}, 2 \cdot \left(t \cdot \left(t + \frac{t}{x}\right)\right)\right)\right)}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\ \end{array} \]
Alternative 2
Accuracy82.5%
Cost21828
\[\begin{array}{l} t_1 := 2 + \left(\frac{2}{x} + \frac{2}{x}\right)\\ t_2 := \ell \cdot \frac{\ell}{x}\\ \mathbf{if}\;t \leq -1.65 \cdot 10^{-308}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{\frac{1}{t_1}} \cdot \left(-0.5 \cdot \frac{2 \cdot \frac{\ell}{\frac{x}{\ell}}}{t}\right) - t \cdot \sqrt{t_1}}\\ \mathbf{elif}\;t \leq 1.65 \cdot 10^{+55}:\\ \;\;\;\;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}:\\ \;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\ \end{array} \]
Alternative 3
Accuracy81.9%
Cost14792
\[\begin{array}{l} t_1 := \sqrt{\frac{x + -1}{x + 1}}\\ t_2 := \ell \cdot \frac{\ell}{x}\\ \mathbf{if}\;t \leq -3.3 \cdot 10^{-305}:\\ \;\;\;\;-t_1\\ \mathbf{elif}\;t \leq 2.1 \cdot 10^{+52}:\\ \;\;\;\;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 4
Accuracy80.2%
Cost14408
\[\begin{array}{l} t_1 := \sqrt{\frac{x + -1}{x + 1}}\\ \mathbf{if}\;t \leq -7.5 \cdot 10^{-305}:\\ \;\;\;\;-t_1\\ \mathbf{elif}\;t \leq 5 \cdot 10^{+46}:\\ \;\;\;\;t \cdot \frac{\sqrt{2}}{\sqrt{\frac{\ell \cdot \ell}{x} + \left(\ell \cdot \frac{\ell}{x} + 2 \cdot \left(t \cdot t\right)\right)}}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 5
Accuracy77.7%
Cost13768
\[\begin{array}{l} t_1 := \sqrt{\frac{x + -1}{x + 1}}\\ \mathbf{if}\;t \leq -4.8 \cdot 10^{-305}:\\ \;\;\;\;-t_1\\ \mathbf{elif}\;t \leq 5.1 \cdot 10^{-114}:\\ \;\;\;\;\sqrt{2} \cdot \frac{t}{\sqrt{2 \cdot \frac{\ell}{\frac{x}{\ell}}}}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 6
Accuracy77.0%
Cost7240
\[\begin{array}{l} t_1 := \sqrt{\frac{x + -1}{x + 1}}\\ \mathbf{if}\;t \leq -7.5 \cdot 10^{-305}:\\ \;\;\;\;-t_1\\ \mathbf{elif}\;t \leq 5.1 \cdot 10^{-114}:\\ \;\;\;\;t \cdot \sqrt{x \cdot \frac{1}{\ell \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 7
Accuracy77.3%
Cost7044
\[\begin{array}{l} t_1 := \sqrt{\frac{x + -1}{x + 1}}\\ \mathbf{if}\;t \leq -5 \cdot 10^{-310}:\\ \;\;\;\;-t_1\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 8
Accuracy76.7%
Cost6980
\[\begin{array}{l} \mathbf{if}\;t \leq -5 \cdot 10^{-310}:\\ \;\;\;\;-1\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\ \end{array} \]
Alternative 9
Accuracy76.5%
Cost836
\[\begin{array}{l} \mathbf{if}\;t \leq -5 \cdot 10^{-310}:\\ \;\;\;\;-1\\ \mathbf{else}:\\ \;\;\;\;1 + \left(\frac{0.5}{x \cdot x} + \frac{-1}{x}\right)\\ \end{array} \]
Alternative 10
Accuracy76.4%
Cost452
\[\begin{array}{l} \mathbf{if}\;t \leq -5 \cdot 10^{-310}:\\ \;\;\;\;-1\\ \mathbf{else}:\\ \;\;\;\;1 + \frac{-1}{x}\\ \end{array} \]
Alternative 11
Accuracy76.1%
Cost196
\[\begin{array}{l} \mathbf{if}\;t \leq -5 \cdot 10^{-310}:\\ \;\;\;\;-1\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]
Alternative 12
Accuracy38.8%
Cost64
\[-1 \]

Error

Reproduce?

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