Average Error: 42.7 → 8.8
Time: 11.7s
Precision: binary64
\[\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 := 2 + \frac{4}{x}\\ t_2 := \frac{2}{x - 1} + 2 \cdot \frac{x}{x - 1}\\ t_3 := t \cdot \sqrt{2}\\ t_4 := \frac{t_3}{\sqrt{\mathsf{fma}\left(4, \frac{t \cdot t}{x}, 2 \cdot \mathsf{fma}\left(\frac{\ell}{x}, \ell, t \cdot t\right)\right)}}\\ \mathbf{if}\;t \leq -2.2811553775868558 \cdot 10^{+86}:\\ \;\;\;\;\frac{t_3}{-t \cdot \sqrt{t_2}}\\ \mathbf{elif}\;t \leq -1.2161892777935289 \cdot 10^{-133}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;t \leq -2.979893054166405 \cdot 10^{-202}:\\ \;\;\;\;\frac{t_3}{-\mathsf{fma}\left(t, \sqrt{t_1}, \frac{\ell \cdot \ell}{t \cdot x} \cdot \sqrt{\frac{1}{t_1}}\right)}\\ \mathbf{elif}\;t \leq -1.8036204212416754 \cdot 10^{-274}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;t \leq 2.9547856466284326 \cdot 10^{-160}:\\ \;\;\;\;\frac{t_3}{\mathsf{fma}\left(\sqrt{2}, t, \mathsf{fma}\left(2, \frac{t}{\sqrt{2} \cdot x}, \frac{\ell \cdot \ell}{\sqrt{2} \cdot \left(t \cdot x\right)}\right)\right)}\\ \mathbf{elif}\;t \leq 4.039007145470636 \cdot 10^{+143}:\\ \;\;\;\;t_4\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2} \cdot \sqrt{\frac{1}{t_2}}\\ \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 (/ 4.0 x)))
        (t_2 (+ (/ 2.0 (- x 1.0)) (* 2.0 (/ x (- x 1.0)))))
        (t_3 (* t (sqrt 2.0)))
        (t_4
         (/
          t_3
          (sqrt (fma 4.0 (/ (* t t) x) (* 2.0 (fma (/ l x) l (* t t))))))))
   (if (<= t -2.2811553775868558e+86)
     (/ t_3 (- (* t (sqrt t_2))))
     (if (<= t -1.2161892777935289e-133)
       t_4
       (if (<= t -2.979893054166405e-202)
         (/
          t_3
          (- (fma t (sqrt t_1) (* (/ (* l l) (* t x)) (sqrt (/ 1.0 t_1))))))
         (if (<= t -1.8036204212416754e-274)
           t_4
           (if (<= t 2.9547856466284326e-160)
             (/
              t_3
              (fma
               (sqrt 2.0)
               t
               (fma
                2.0
                (/ t (* (sqrt 2.0) x))
                (/ (* l l) (* (sqrt 2.0) (* t x))))))
             (if (<= t 4.039007145470636e+143)
               t_4
               (* (sqrt 2.0) (sqrt (/ 1.0 t_2)))))))))))
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 + (4.0 / x);
	double t_2 = (2.0 / (x - 1.0)) + (2.0 * (x / (x - 1.0)));
	double t_3 = t * sqrt(2.0);
	double t_4 = t_3 / sqrt(fma(4.0, ((t * t) / x), (2.0 * fma((l / x), l, (t * t)))));
	double tmp;
	if (t <= -2.2811553775868558e+86) {
		tmp = t_3 / -(t * sqrt(t_2));
	} else if (t <= -1.2161892777935289e-133) {
		tmp = t_4;
	} else if (t <= -2.979893054166405e-202) {
		tmp = t_3 / -fma(t, sqrt(t_1), (((l * l) / (t * x)) * sqrt((1.0 / t_1))));
	} else if (t <= -1.8036204212416754e-274) {
		tmp = t_4;
	} else if (t <= 2.9547856466284326e-160) {
		tmp = t_3 / fma(sqrt(2.0), t, fma(2.0, (t / (sqrt(2.0) * x)), ((l * l) / (sqrt(2.0) * (t * x)))));
	} else if (t <= 4.039007145470636e+143) {
		tmp = t_4;
	} else {
		tmp = sqrt(2.0) * sqrt((1.0 / t_2));
	}
	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(2.0 + Float64(4.0 / x))
	t_2 = Float64(Float64(2.0 / Float64(x - 1.0)) + Float64(2.0 * Float64(x / Float64(x - 1.0))))
	t_3 = Float64(t * sqrt(2.0))
	t_4 = Float64(t_3 / sqrt(fma(4.0, Float64(Float64(t * t) / x), Float64(2.0 * fma(Float64(l / x), l, Float64(t * t))))))
	tmp = 0.0
	if (t <= -2.2811553775868558e+86)
		tmp = Float64(t_3 / Float64(-Float64(t * sqrt(t_2))));
	elseif (t <= -1.2161892777935289e-133)
		tmp = t_4;
	elseif (t <= -2.979893054166405e-202)
		tmp = Float64(t_3 / Float64(-fma(t, sqrt(t_1), Float64(Float64(Float64(l * l) / Float64(t * x)) * sqrt(Float64(1.0 / t_1))))));
	elseif (t <= -1.8036204212416754e-274)
		tmp = t_4;
	elseif (t <= 2.9547856466284326e-160)
		tmp = Float64(t_3 / fma(sqrt(2.0), t, fma(2.0, Float64(t / Float64(sqrt(2.0) * x)), Float64(Float64(l * l) / Float64(sqrt(2.0) * Float64(t * x))))));
	elseif (t <= 4.039007145470636e+143)
		tmp = t_4;
	else
		tmp = Float64(sqrt(2.0) * sqrt(Float64(1.0 / t_2)));
	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[(2.0 + N[(4.0 / x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(2.0 / N[(x - 1.0), $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[(x / N[(x - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$3 / N[Sqrt[N[(4.0 * N[(N[(t * t), $MachinePrecision] / x), $MachinePrecision] + N[(2.0 * N[(N[(l / x), $MachinePrecision] * l + N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.2811553775868558e+86], N[(t$95$3 / (-N[(t * N[Sqrt[t$95$2], $MachinePrecision]), $MachinePrecision])), $MachinePrecision], If[LessEqual[t, -1.2161892777935289e-133], t$95$4, If[LessEqual[t, -2.979893054166405e-202], N[(t$95$3 / (-N[(t * N[Sqrt[t$95$1], $MachinePrecision] + N[(N[(N[(l * l), $MachinePrecision] / N[(t * x), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(1.0 / t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision])), $MachinePrecision], If[LessEqual[t, -1.8036204212416754e-274], t$95$4, If[LessEqual[t, 2.9547856466284326e-160], N[(t$95$3 / N[(N[Sqrt[2.0], $MachinePrecision] * t + N[(2.0 * N[(t / N[(N[Sqrt[2.0], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] + N[(N[(l * l), $MachinePrecision] / N[(N[Sqrt[2.0], $MachinePrecision] * N[(t * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.039007145470636e+143], t$95$4, N[(N[Sqrt[2.0], $MachinePrecision] * N[Sqrt[N[(1.0 / t$95$2), $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 := 2 + \frac{4}{x}\\
t_2 := \frac{2}{x - 1} + 2 \cdot \frac{x}{x - 1}\\
t_3 := t \cdot \sqrt{2}\\
t_4 := \frac{t_3}{\sqrt{\mathsf{fma}\left(4, \frac{t \cdot t}{x}, 2 \cdot \mathsf{fma}\left(\frac{\ell}{x}, \ell, t \cdot t\right)\right)}}\\
\mathbf{if}\;t \leq -2.2811553775868558 \cdot 10^{+86}:\\
\;\;\;\;\frac{t_3}{-t \cdot \sqrt{t_2}}\\

\mathbf{elif}\;t \leq -1.2161892777935289 \cdot 10^{-133}:\\
\;\;\;\;t_4\\

\mathbf{elif}\;t \leq -2.979893054166405 \cdot 10^{-202}:\\
\;\;\;\;\frac{t_3}{-\mathsf{fma}\left(t, \sqrt{t_1}, \frac{\ell \cdot \ell}{t \cdot x} \cdot \sqrt{\frac{1}{t_1}}\right)}\\

\mathbf{elif}\;t \leq -1.8036204212416754 \cdot 10^{-274}:\\
\;\;\;\;t_4\\

\mathbf{elif}\;t \leq 2.9547856466284326 \cdot 10^{-160}:\\
\;\;\;\;\frac{t_3}{\mathsf{fma}\left(\sqrt{2}, t, \mathsf{fma}\left(2, \frac{t}{\sqrt{2} \cdot x}, \frac{\ell \cdot \ell}{\sqrt{2} \cdot \left(t \cdot x\right)}\right)\right)}\\

\mathbf{elif}\;t \leq 4.039007145470636 \cdot 10^{+143}:\\
\;\;\;\;t_4\\

\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \sqrt{\frac{1}{t_2}}\\


\end{array}

Error

Bits error versus x

Bits error versus l

Bits error versus t

Derivation

  1. Split input into 5 regimes
  2. if t < -2.2811553775868558e86

    1. Initial program 49.0

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

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

      \[\leadsto \frac{\sqrt{2} \cdot t}{\color{blue}{-1 \cdot \left(\sqrt{2 \cdot \frac{1}{x - 1} + 2 \cdot \frac{x}{x - 1}} \cdot t\right)}} \]
    4. Simplified2.9

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

    if -2.2811553775868558e86 < t < -1.21618927779352889e-133 or -2.9798930541664051e-202 < t < -1.80362042124167537e-274 or 2.95478564662843265e-160 < t < 4.03900714547063611e143

    1. Initial program 28.6

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

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

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

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

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

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

    if -1.21618927779352889e-133 < t < -2.9798930541664051e-202

    1. Initial program 52.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. Simplified52.9

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

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

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

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

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

    if -1.80362042124167537e-274 < t < 2.95478564662843265e-160

    1. Initial program 62.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. Simplified62.4

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

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

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

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

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

    if 4.03900714547063611e143 < t

    1. Initial program 58.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. Simplified58.8

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

      \[\leadsto \color{blue}{\sqrt{\frac{1}{2 \cdot \frac{1}{x - 1} + 2 \cdot \frac{x}{x - 1}}} \cdot \sqrt{2}} \]
    4. Simplified2.6

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -2.2811553775868558 \cdot 10^{+86}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{-t \cdot \sqrt{\frac{2}{x - 1} + 2 \cdot \frac{x}{x - 1}}}\\ \mathbf{elif}\;t \leq -1.2161892777935289 \cdot 10^{-133}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{\mathsf{fma}\left(4, \frac{t \cdot t}{x}, 2 \cdot \mathsf{fma}\left(\frac{\ell}{x}, \ell, t \cdot t\right)\right)}}\\ \mathbf{elif}\;t \leq -2.979893054166405 \cdot 10^{-202}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{-\mathsf{fma}\left(t, \sqrt{2 + \frac{4}{x}}, \frac{\ell \cdot \ell}{t \cdot x} \cdot \sqrt{\frac{1}{2 + \frac{4}{x}}}\right)}\\ \mathbf{elif}\;t \leq -1.8036204212416754 \cdot 10^{-274}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{\mathsf{fma}\left(4, \frac{t \cdot t}{x}, 2 \cdot \mathsf{fma}\left(\frac{\ell}{x}, \ell, t \cdot t\right)\right)}}\\ \mathbf{elif}\;t \leq 2.9547856466284326 \cdot 10^{-160}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{\mathsf{fma}\left(\sqrt{2}, t, \mathsf{fma}\left(2, \frac{t}{\sqrt{2} \cdot x}, \frac{\ell \cdot \ell}{\sqrt{2} \cdot \left(t \cdot x\right)}\right)\right)}\\ \mathbf{elif}\;t \leq 4.039007145470636 \cdot 10^{+143}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{\mathsf{fma}\left(4, \frac{t \cdot t}{x}, 2 \cdot \mathsf{fma}\left(\frac{\ell}{x}, \ell, t \cdot t\right)\right)}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2} \cdot \sqrt{\frac{1}{\frac{2}{x - 1} + 2 \cdot \frac{x}{x - 1}}}\\ \end{array} \]

Reproduce

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