Average Error: 43.3 → 13.2
Time: 50.2s
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 -4.1082082235983134 \cdot 10^{+89}:\\ \;\;\;\;-\sqrt{2} \cdot \sqrt{\frac{0.5}{\frac{1}{x - 1} + \frac{x}{x - 1}}}\\ \mathbf{elif}\;t \leq -6.47427676666233 \cdot 10^{-176}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{2 \cdot \frac{\ell \cdot \ell}{x} + \left(2 \cdot \left(t \cdot t\right) + 4 \cdot \frac{t \cdot t}{x}\right)}}\\ \mathbf{elif}\;t \leq -3.8861469598340796 \cdot 10^{-294}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{-\left(\sqrt{\frac{1}{2 + \left(4 \cdot \frac{1}{{x}^{2}} + \left(4 \cdot \frac{1}{x} + 4 \cdot \frac{1}{{x}^{3}}\right)\right)}} \cdot \frac{{\ell}^{2}}{t \cdot {x}^{2}} + \left(\sqrt{\frac{1}{2 + \left(4 \cdot \frac{1}{{x}^{2}} + \left(4 \cdot \frac{1}{x} + 4 \cdot \frac{1}{{x}^{3}}\right)\right)}} \cdot \frac{{\ell}^{2}}{t \cdot x} + \left(\sqrt{\frac{1}{2 + \left(4 \cdot \frac{1}{{x}^{2}} + \left(4 \cdot \frac{1}{x} + 4 \cdot \frac{1}{{x}^{3}}\right)\right)}} \cdot \frac{{\ell}^{2}}{t \cdot {x}^{3}} + t \cdot \sqrt{4 \cdot \frac{1}{{x}^{2}} + \left(4 \cdot \frac{1}{x} + \left(2 + 4 \cdot \frac{1}{{x}^{3}}\right)\right)}\right)\right)\right)}\\ \mathbf{elif}\;t \leq 2.1017876038347165 \cdot 10^{-178}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{\ell \cdot \sqrt{2 \cdot \frac{1}{{x}^{2}} + \left(2 \cdot \frac{1}{x} + 2 \cdot \frac{1}{{x}^{3}}\right)}}\\ \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 -4.1082082235983134 \cdot 10^{+89}:\\
\;\;\;\;-\sqrt{2} \cdot \sqrt{\frac{0.5}{\frac{1}{x - 1} + \frac{x}{x - 1}}}\\

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

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

\mathbf{elif}\;t \leq 2.1017876038347165 \cdot 10^{-178}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{\ell \cdot \sqrt{2 \cdot \frac{1}{{x}^{2}} + \left(2 \cdot \frac{1}{x} + 2 \cdot \frac{1}{{x}^{3}}\right)}}\\

\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 -4.1082082235983134e+89)
   (- (* (sqrt 2.0) (sqrt (/ 0.5 (+ (/ 1.0 (- x 1.0)) (/ x (- x 1.0)))))))
   (if (<= t -6.47427676666233e-176)
     (/
      (* t (sqrt 2.0))
      (sqrt
       (+ (* 2.0 (/ (* l l) x)) (+ (* 2.0 (* t t)) (* 4.0 (/ (* t t) x))))))
     (if (<= t -3.8861469598340796e-294)
       (/
        (* t (sqrt 2.0))
        (-
         (+
          (*
           (sqrt
            (/
             1.0
             (+
              2.0
              (+
               (* 4.0 (/ 1.0 (pow x 2.0)))
               (+ (* 4.0 (/ 1.0 x)) (* 4.0 (/ 1.0 (pow x 3.0))))))))
           (/ (pow l 2.0) (* t (pow x 2.0))))
          (+
           (*
            (sqrt
             (/
              1.0
              (+
               2.0
               (+
                (* 4.0 (/ 1.0 (pow x 2.0)))
                (+ (* 4.0 (/ 1.0 x)) (* 4.0 (/ 1.0 (pow x 3.0))))))))
            (/ (pow l 2.0) (* t x)))
           (+
            (*
             (sqrt
              (/
               1.0
               (+
                2.0
                (+
                 (* 4.0 (/ 1.0 (pow x 2.0)))
                 (+ (* 4.0 (/ 1.0 x)) (* 4.0 (/ 1.0 (pow x 3.0))))))))
             (/ (pow l 2.0) (* t (pow x 3.0))))
            (*
             t
             (sqrt
              (+
               (* 4.0 (/ 1.0 (pow x 2.0)))
               (+
                (* 4.0 (/ 1.0 x))
                (+ 2.0 (* 4.0 (/ 1.0 (pow x 3.0)))))))))))))
       (if (<= t 2.1017876038347165e-178)
         (/
          (* t (sqrt 2.0))
          (*
           l
           (sqrt
            (+
             (* 2.0 (/ 1.0 (pow x 2.0)))
             (+ (* 2.0 (/ 1.0 x)) (* 2.0 (/ 1.0 (pow x 3.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 <= -4.1082082235983134e+89) {
		tmp = -(sqrt(2.0) * sqrt(0.5 / ((1.0 / (x - 1.0)) + (x / (x - 1.0)))));
	} else if (t <= -6.47427676666233e-176) {
		tmp = (t * sqrt(2.0)) / sqrt((2.0 * ((l * l) / x)) + ((2.0 * (t * t)) + (4.0 * ((t * t) / x))));
	} else if (t <= -3.8861469598340796e-294) {
		tmp = (t * sqrt(2.0)) / -((sqrt(1.0 / (2.0 + ((4.0 * (1.0 / pow(x, 2.0))) + ((4.0 * (1.0 / x)) + (4.0 * (1.0 / pow(x, 3.0))))))) * (pow(l, 2.0) / (t * pow(x, 2.0)))) + ((sqrt(1.0 / (2.0 + ((4.0 * (1.0 / pow(x, 2.0))) + ((4.0 * (1.0 / x)) + (4.0 * (1.0 / pow(x, 3.0))))))) * (pow(l, 2.0) / (t * x))) + ((sqrt(1.0 / (2.0 + ((4.0 * (1.0 / pow(x, 2.0))) + ((4.0 * (1.0 / x)) + (4.0 * (1.0 / pow(x, 3.0))))))) * (pow(l, 2.0) / (t * pow(x, 3.0)))) + (t * sqrt((4.0 * (1.0 / pow(x, 2.0))) + ((4.0 * (1.0 / x)) + (2.0 + (4.0 * (1.0 / pow(x, 3.0))))))))));
	} else if (t <= 2.1017876038347165e-178) {
		tmp = (t * sqrt(2.0)) / (l * sqrt((2.0 * (1.0 / pow(x, 2.0))) + ((2.0 * (1.0 / x)) + (2.0 * (1.0 / pow(x, 3.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 5 regimes
  2. if t < -4.10820822359831338e89

    1. Initial program 49.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.5

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

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

    if -4.10820822359831338e89 < t < -6.4742767666623301e-176

    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. Taylor expanded around inf 12.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. Simplified12.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)}}}\]

    if -6.4742767666623301e-176 < t < -3.8861469598340796e-294

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

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

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

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

    if -3.8861469598340796e-294 < t < 2.1017876038347165e-178

    1. Initial program 63.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 39.8

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

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

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

    if 2.1017876038347165e-178 < t

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -4.1082082235983134 \cdot 10^{+89}:\\ \;\;\;\;-\sqrt{2} \cdot \sqrt{\frac{0.5}{\frac{1}{x - 1} + \frac{x}{x - 1}}}\\ \mathbf{elif}\;t \leq -6.47427676666233 \cdot 10^{-176}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{2 \cdot \frac{\ell \cdot \ell}{x} + \left(2 \cdot \left(t \cdot t\right) + 4 \cdot \frac{t \cdot t}{x}\right)}}\\ \mathbf{elif}\;t \leq -3.8861469598340796 \cdot 10^{-294}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{-\left(\sqrt{\frac{1}{2 + \left(4 \cdot \frac{1}{{x}^{2}} + \left(4 \cdot \frac{1}{x} + 4 \cdot \frac{1}{{x}^{3}}\right)\right)}} \cdot \frac{{\ell}^{2}}{t \cdot {x}^{2}} + \left(\sqrt{\frac{1}{2 + \left(4 \cdot \frac{1}{{x}^{2}} + \left(4 \cdot \frac{1}{x} + 4 \cdot \frac{1}{{x}^{3}}\right)\right)}} \cdot \frac{{\ell}^{2}}{t \cdot x} + \left(\sqrt{\frac{1}{2 + \left(4 \cdot \frac{1}{{x}^{2}} + \left(4 \cdot \frac{1}{x} + 4 \cdot \frac{1}{{x}^{3}}\right)\right)}} \cdot \frac{{\ell}^{2}}{t \cdot {x}^{3}} + t \cdot \sqrt{4 \cdot \frac{1}{{x}^{2}} + \left(4 \cdot \frac{1}{x} + \left(2 + 4 \cdot \frac{1}{{x}^{3}}\right)\right)}\right)\right)\right)}\\ \mathbf{elif}\;t \leq 2.1017876038347165 \cdot 10^{-178}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{\ell \cdot \sqrt{2 \cdot \frac{1}{{x}^{2}} + \left(2 \cdot \frac{1}{x} + 2 \cdot \frac{1}{{x}^{3}}\right)}}\\ \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 2021022 
(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)))))