Average Error: 43.1 → 10.2
Time: 28.9s
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} \mathbf{if}\;t \leq -1.493328393148849 \cdot 10^{+117}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{-t \cdot \sqrt{\frac{2}{x - 1} + 2 \cdot \frac{x}{x - 1}}}\\ \mathbf{elif}\;t \leq -1.0501925897887986 \cdot 10^{-125}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{2 \cdot \left(\frac{\ell}{\frac{x}{\ell}} + t \cdot t\right) + 4 \cdot \frac{t \cdot t}{x}}}\\ \mathbf{elif}\;t \leq -8.423808617895155 \cdot 10^{-250}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{-t \cdot \sqrt{2 + \frac{4}{x}}}\\ \mathbf{elif}\;t \leq 124.71595513294787:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{2 \cdot \left(\frac{\ell}{\frac{x}{\ell}} + t \cdot t\right) + 4 \cdot \frac{t \cdot t}{x}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{t \cdot \sqrt{\frac{2}{x - 1} + 2 \cdot \frac{x}{x - 1}}}\\ \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}
\mathbf{if}\;t \leq -1.493328393148849 \cdot 10^{+117}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{-t \cdot \sqrt{\frac{2}{x - 1} + 2 \cdot \frac{x}{x - 1}}}\\

\mathbf{elif}\;t \leq -1.0501925897887986 \cdot 10^{-125}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{2 \cdot \left(\frac{\ell}{\frac{x}{\ell}} + t \cdot t\right) + 4 \cdot \frac{t \cdot t}{x}}}\\

\mathbf{elif}\;t \leq -8.423808617895155 \cdot 10^{-250}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{-t \cdot \sqrt{2 + \frac{4}{x}}}\\

\mathbf{elif}\;t \leq 124.71595513294787:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{2 \cdot \left(\frac{\ell}{\frac{x}{\ell}} + t \cdot t\right) + 4 \cdot \frac{t \cdot t}{x}}}\\

\mathbf{else}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{t \cdot \sqrt{\frac{2}{x - 1} + 2 \cdot \frac{x}{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
 (if (<= t -1.493328393148849e+117)
   (/
    (* t (sqrt 2.0))
    (- (* t (sqrt (+ (/ 2.0 (- x 1.0)) (* 2.0 (/ x (- x 1.0))))))))
   (if (<= t -1.0501925897887986e-125)
     (/
      (* t (sqrt 2.0))
      (sqrt (+ (* 2.0 (+ (/ l (/ x l)) (* t t))) (* 4.0 (/ (* t t) x)))))
     (if (<= t -8.423808617895155e-250)
       (/ (* t (sqrt 2.0)) (- (* t (sqrt (+ 2.0 (/ 4.0 x))))))
       (if (<= t 124.71595513294787)
         (/
          (* t (sqrt 2.0))
          (sqrt (+ (* 2.0 (+ (/ l (/ x l)) (* t t))) (* 4.0 (/ (* t t) x)))))
         (/
          (* t (sqrt 2.0))
          (* t (sqrt (+ (/ 2.0 (- x 1.0)) (* 2.0 (/ x (- 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 tmp;
	if (t <= -1.493328393148849e+117) {
		tmp = (t * sqrt(2.0)) / -(t * sqrt((2.0 / (x - 1.0)) + (2.0 * (x / (x - 1.0)))));
	} else if (t <= -1.0501925897887986e-125) {
		tmp = (t * sqrt(2.0)) / sqrt((2.0 * ((l / (x / l)) + (t * t))) + (4.0 * ((t * t) / x)));
	} else if (t <= -8.423808617895155e-250) {
		tmp = (t * sqrt(2.0)) / -(t * sqrt(2.0 + (4.0 / x)));
	} else if (t <= 124.71595513294787) {
		tmp = (t * sqrt(2.0)) / sqrt((2.0 * ((l / (x / l)) + (t * t))) + (4.0 * ((t * t) / x)));
	} else {
		tmp = (t * sqrt(2.0)) / (t * sqrt((2.0 / (x - 1.0)) + (2.0 * (x / (x - 1.0)))));
	}
	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 4 regimes
  2. if t < -1.49332839314884911e117

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

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

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

    if -1.49332839314884911e117 < t < -1.05019258978879857e-125 or -8.42380861789515478e-250 < t < 124.71595513294787

    1. Initial program 37.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 16.6

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

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

      \[\leadsto \frac{\sqrt{2} \cdot t}{\sqrt{2 \cdot \frac{\ell \cdot \ell}{\color{blue}{\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \sqrt[3]{x}}} + \left(2 \cdot \left(t \cdot t\right) + 4 \cdot \frac{t \cdot t}{x}\right)}}\]
    6. Applied times-frac_binary64_8413.2

      \[\leadsto \frac{\sqrt{2} \cdot t}{\sqrt{2 \cdot \color{blue}{\left(\frac{\ell}{\sqrt[3]{x} \cdot \sqrt[3]{x}} \cdot \frac{\ell}{\sqrt[3]{x}}\right)} + \left(2 \cdot \left(t \cdot t\right) + 4 \cdot \frac{t \cdot t}{x}\right)}}\]
    7. Using strategy rm
    8. Applied associate-+r+_binary64_1013.2

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

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

    if -1.05019258978879857e-125 < t < -8.42380861789515478e-250

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

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

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

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

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

    if 124.71595513294787 < t

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.493328393148849 \cdot 10^{+117}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{-t \cdot \sqrt{\frac{2}{x - 1} + 2 \cdot \frac{x}{x - 1}}}\\ \mathbf{elif}\;t \leq -1.0501925897887986 \cdot 10^{-125}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{2 \cdot \left(\frac{\ell}{\frac{x}{\ell}} + t \cdot t\right) + 4 \cdot \frac{t \cdot t}{x}}}\\ \mathbf{elif}\;t \leq -8.423808617895155 \cdot 10^{-250}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{-t \cdot \sqrt{2 + \frac{4}{x}}}\\ \mathbf{elif}\;t \leq 124.71595513294787:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{2 \cdot \left(\frac{\ell}{\frac{x}{\ell}} + t \cdot t\right) + 4 \cdot \frac{t \cdot t}{x}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{t \cdot \sqrt{\frac{2}{x - 1} + 2 \cdot \frac{x}{x - 1}}}\\ \end{array}\]

Reproduce

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