Average Error: 42.5 → 14.4
Time: 10.8s
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 := t \cdot \sqrt{2}\\ \mathbf{if}\;t \leq -2.1880656708238855 \cdot 10^{-308}:\\ \;\;\;\;\begin{array}{l} t_2 := 2 + \left(\frac{4}{x} + \frac{4}{x \cdot x}\right)\\ \frac{-t_1}{\sqrt{\frac{1}{t_2}} \cdot \left(\frac{\ell}{x} \cdot \left(\frac{\ell}{t} + \frac{\ell}{t \cdot x}\right)\right) + t \cdot \sqrt{t_2}} \end{array}\\ \mathbf{else}:\\ \;\;\;\;\frac{t_1}{t_1 + \left(2 \cdot \frac{t}{\sqrt{2} \cdot x} + \frac{\ell \cdot \ell}{t_1 \cdot x}\right)}\\ \end{array} \]
\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 := t \cdot \sqrt{2}\\
\mathbf{if}\;t \leq -2.1880656708238855 \cdot 10^{-308}:\\
\;\;\;\;\begin{array}{l}
t_2 := 2 + \left(\frac{4}{x} + \frac{4}{x \cdot x}\right)\\
\frac{-t_1}{\sqrt{\frac{1}{t_2}} \cdot \left(\frac{\ell}{x} \cdot \left(\frac{\ell}{t} + \frac{\ell}{t \cdot x}\right)\right) + t \cdot \sqrt{t_2}}
\end{array}\\

\mathbf{else}:\\
\;\;\;\;\frac{t_1}{t_1 + \left(2 \cdot \frac{t}{\sqrt{2} \cdot x} + \frac{\ell \cdot \ell}{t_1 \cdot x}\right)}\\


\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 (* t (sqrt 2.0))))
   (if (<= t -2.1880656708238855e-308)
     (let* ((t_2 (+ 2.0 (+ (/ 4.0 x) (/ 4.0 (* x x))))))
       (/
        (- t_1)
        (+
         (* (sqrt (/ 1.0 t_2)) (* (/ l x) (+ (/ l t) (/ l (* t x)))))
         (* t (sqrt t_2)))))
     (/
      t_1
      (+ t_1 (+ (* 2.0 (/ t (* (sqrt 2.0) x))) (/ (* l l) (* t_1 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 t_1 = t * sqrt(2.0);
	double tmp;
	if (t <= -2.1880656708238855e-308) {
		double t_2_1 = 2.0 + ((4.0 / x) + (4.0 / (x * x)));
		tmp = -t_1 / ((sqrt(1.0 / t_2_1) * ((l / x) * ((l / t) + (l / (t * x))))) + (t * sqrt(t_2_1)));
	} else {
		tmp = t_1 / (t_1 + ((2.0 * (t / (sqrt(2.0) * x))) + ((l * l) / (t_1 * x))));
	}
	return tmp;
}

Error

Bits error versus x

Bits error versus l

Bits error versus t

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Split input into 2 regimes
  2. if t < -2.1880656708238855e-308

    1. Initial program 43.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. Taylor expanded around inf 33.1

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

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

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

      \[\leadsto \frac{\sqrt{2} \cdot t}{\color{blue}{-\left(\sqrt{\frac{1}{2 + \left(\frac{4}{x} + \frac{4}{x \cdot x}\right)}} \cdot \left(\frac{\ell \cdot \ell}{x \cdot t} + \frac{\ell \cdot \ell}{x \cdot \left(x \cdot t\right)}\right) + t \cdot \sqrt{2 + \left(\frac{4}{x} + \frac{4}{x \cdot x}\right)}\right)}} \]
    6. Using strategy rm
    7. Applied frac-2neg_binary6417.2

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

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

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

    if -2.1880656708238855e-308 < t

    1. Initial program 41.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. Taylor expanded around inf 30.7

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

      \[\leadsto \frac{\sqrt{2} \cdot t}{\sqrt{\color{blue}{2 \cdot \left(\left(t \cdot t + \frac{\ell \cdot \ell}{x}\right) + \frac{\ell \cdot \ell}{x \cdot x}\right) + 4 \cdot \left(\frac{t \cdot t}{x \cdot x} + \frac{t \cdot t}{x}\right)}}} \]
    4. Taylor expanded around inf 16.4

      \[\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)}} \]
    5. Simplified16.4

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

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

Reproduce

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