Average Error: 43.0 → 9.1
Time: 19.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} \mathbf{if}\;t \leq -3.094785260795066 \cdot 10^{+93}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{-t \cdot \sqrt{\frac{2}{x - 1} + 2 \cdot \frac{x}{x - 1}}}\\ \mathbf{elif}\;t \leq -7.8940362468376395 \cdot 10^{-177}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{2 \cdot \left(\ell \cdot \frac{\ell}{x}\right) + \left(t \cdot t\right) \cdot \left(2 + \frac{4}{x}\right)}}\\ \mathbf{elif}\;t \leq -4.552217556014532 \cdot 10^{-217}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{-t \cdot \sqrt{2 + 4 \cdot \frac{1}{x}}}\\ \mathbf{elif}\;t \leq 6.747218417347291 \cdot 10^{-224}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{2 \cdot \left(\sqrt{\frac{\ell \cdot \ell}{x}} \cdot \sqrt{\frac{\ell \cdot \ell}{x}}\right) + \left(2 \cdot \left(t \cdot t\right) + 4 \cdot \frac{t \cdot t}{x}\right)}}\\ \mathbf{elif}\;t \leq 1.0839695737903189 \cdot 10^{-126}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{t \cdot \sqrt{2} + \left(2 \cdot \frac{t}{\sqrt{2} \cdot x} + \frac{\ell \cdot \ell}{t \cdot \left(\sqrt{2} \cdot x\right)}\right)}\\ \mathbf{elif}\;t \leq 3.6158306802905055 \cdot 10^{+70}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{2 \cdot \left(\ell \cdot \frac{\ell}{x}\right) + 2 \cdot {t}^{2}}}\\ \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 -3.094785260795066 \cdot 10^{+93}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{-t \cdot \sqrt{\frac{2}{x - 1} + 2 \cdot \frac{x}{x - 1}}}\\

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

\mathbf{elif}\;t \leq -4.552217556014532 \cdot 10^{-217}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{-t \cdot \sqrt{2 + 4 \cdot \frac{1}{x}}}\\

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

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

\mathbf{elif}\;t \leq 3.6158306802905055 \cdot 10^{+70}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{2 \cdot \left(\ell \cdot \frac{\ell}{x}\right) + 2 \cdot {t}^{2}}}\\

\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 -3.094785260795066e+93)
   (/
    (* t (sqrt 2.0))
    (- (* t (sqrt (+ (/ 2.0 (- x 1.0)) (* 2.0 (/ x (- x 1.0))))))))
   (if (<= t -7.8940362468376395e-177)
     (/
      (* t (sqrt 2.0))
      (sqrt (+ (* 2.0 (* l (/ l x))) (* (* t t) (+ 2.0 (/ 4.0 x))))))
     (if (<= t -4.552217556014532e-217)
       (/ (* t (sqrt 2.0)) (- (* t (sqrt (+ 2.0 (* 4.0 (/ 1.0 x)))))))
       (if (<= t 6.747218417347291e-224)
         (/
          (* t (sqrt 2.0))
          (sqrt
           (+
            (* 2.0 (* (sqrt (/ (* l l) x)) (sqrt (/ (* l l) x))))
            (+ (* 2.0 (* t t)) (* 4.0 (/ (* t t) x))))))
         (if (<= t 1.0839695737903189e-126)
           (/
            (* t (sqrt 2.0))
            (+
             (* t (sqrt 2.0))
             (+
              (* 2.0 (/ t (* (sqrt 2.0) x)))
              (/ (* l l) (* t (* (sqrt 2.0) x))))))
           (if (<= t 3.6158306802905055e+70)
             (/
              (* t (sqrt 2.0))
              (sqrt (+ (* 2.0 (* l (/ l x))) (* 2.0 (pow t 2.0)))))
             (/
              (* 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 <= -3.094785260795066e+93) {
		tmp = (t * sqrt(2.0)) / -(t * sqrt((2.0 / (x - 1.0)) + (2.0 * (x / (x - 1.0)))));
	} else if (t <= -7.8940362468376395e-177) {
		tmp = (t * sqrt(2.0)) / sqrt((2.0 * (l * (l / x))) + ((t * t) * (2.0 + (4.0 / x))));
	} else if (t <= -4.552217556014532e-217) {
		tmp = (t * sqrt(2.0)) / -(t * sqrt(2.0 + (4.0 * (1.0 / x))));
	} else if (t <= 6.747218417347291e-224) {
		tmp = (t * sqrt(2.0)) / sqrt((2.0 * (sqrt((l * l) / x) * sqrt((l * l) / x))) + ((2.0 * (t * t)) + (4.0 * ((t * t) / x))));
	} else if (t <= 1.0839695737903189e-126) {
		tmp = (t * sqrt(2.0)) / ((t * sqrt(2.0)) + ((2.0 * (t / (sqrt(2.0) * x))) + ((l * l) / (t * (sqrt(2.0) * x)))));
	} else if (t <= 3.6158306802905055e+70) {
		tmp = (t * sqrt(2.0)) / sqrt((2.0 * (l * (l / x))) + (2.0 * pow(t, 2.0)));
	} 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 7 regimes
  2. if t < -3.09478526079506587e93

    1. Initial program 50.3

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

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

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

    if -3.09478526079506587e93 < t < -7.89403624683763953e-177

    1. Initial program 28.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 11.7

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

      \[\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 *-un-lft-identity_binary64_7811.7

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

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

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

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

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

    if -7.89403624683763953e-177 < t < -4.55221755601453162e-217

    1. Initial program 63.3

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

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

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

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

    if -4.55221755601453162e-217 < t < 6.74721841734729116e-224

    1. Initial program 62.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 29.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. Simplified29.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-sqr-sqrt_binary64_10029.7

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

    if 6.74721841734729116e-224 < t < 1.08396957379031891e-126

    1. Initial program 53.2

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

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

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

    if 1.08396957379031891e-126 < t < 3.6158306802905055e70

    1. Initial program 25.7

      \[\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 9.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. Simplified9.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. Using strategy rm
    5. Applied *-un-lft-identity_binary64_789.5

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

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

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

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

    if 3.6158306802905055e70 < t

    1. Initial program 47.2

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -3.094785260795066 \cdot 10^{+93}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{-t \cdot \sqrt{\frac{2}{x - 1} + 2 \cdot \frac{x}{x - 1}}}\\ \mathbf{elif}\;t \leq -7.8940362468376395 \cdot 10^{-177}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{2 \cdot \left(\ell \cdot \frac{\ell}{x}\right) + \left(t \cdot t\right) \cdot \left(2 + \frac{4}{x}\right)}}\\ \mathbf{elif}\;t \leq -4.552217556014532 \cdot 10^{-217}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{-t \cdot \sqrt{2 + 4 \cdot \frac{1}{x}}}\\ \mathbf{elif}\;t \leq 6.747218417347291 \cdot 10^{-224}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{2 \cdot \left(\sqrt{\frac{\ell \cdot \ell}{x}} \cdot \sqrt{\frac{\ell \cdot \ell}{x}}\right) + \left(2 \cdot \left(t \cdot t\right) + 4 \cdot \frac{t \cdot t}{x}\right)}}\\ \mathbf{elif}\;t \leq 1.0839695737903189 \cdot 10^{-126}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{t \cdot \sqrt{2} + \left(2 \cdot \frac{t}{\sqrt{2} \cdot x} + \frac{\ell \cdot \ell}{t \cdot \left(\sqrt{2} \cdot x\right)}\right)}\\ \mathbf{elif}\;t \leq 3.6158306802905055 \cdot 10^{+70}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{2 \cdot \left(\ell \cdot \frac{\ell}{x}\right) + 2 \cdot {t}^{2}}}\\ \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 2021028 
(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)))))