Average Error: 42.7 → 10.2
Time: 11.0s
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.448494623502798 \cdot 10^{+107}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{\frac{\frac{t}{x}}{\sqrt{2} \cdot x} - \left(t \cdot \sqrt{2} + 2 \cdot \frac{t}{\sqrt{2} \cdot x}\right)}\\ \mathbf{elif}\;t \leq -7.376286544804047 \cdot 10^{-197}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{4 \cdot \frac{t \cdot t}{x} + 2 \cdot \left(t \cdot t + \frac{\ell}{\frac{x}{\ell}}\right)}}\\ \mathbf{elif}\;t \leq -9.537665178779285 \cdot 10^{-263}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{\frac{\frac{t}{x}}{\sqrt{2} \cdot x} - \left(t \cdot \sqrt{2} + 2 \cdot \frac{t}{\sqrt{2} \cdot x}\right)}\\ \mathbf{elif}\;t \leq 5.289804017494565 \cdot 10^{-269}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{4 \cdot \frac{t \cdot t}{x} + 2 \cdot \left(t \cdot t + \frac{\ell}{\frac{x}{\ell}}\right)}}\\ \mathbf{elif}\;t \leq 2.9878933277788783 \cdot 10^{-167}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{\left(t \cdot \sqrt{2} + 2 \cdot \frac{t}{\sqrt{2} \cdot x}\right) - \frac{\frac{t}{x}}{\sqrt{2} \cdot x}}\\ \mathbf{elif}\;t \leq 3.552303323015909 \cdot 10^{+105}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{4 \cdot \frac{t \cdot t}{x} + 2 \cdot \left(t \cdot t + \frac{\ell}{\frac{x}{\ell}}\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{\frac{2}{\sqrt{2}} \cdot \left(\frac{t}{x} + \frac{t}{x \cdot x}\right) + \left(t \cdot \sqrt{2} - \frac{t}{\sqrt{2} \cdot \left(x \cdot x\right)}\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}
\mathbf{if}\;t \leq -4.448494623502798 \cdot 10^{+107}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{\frac{\frac{t}{x}}{\sqrt{2} \cdot x} - \left(t \cdot \sqrt{2} + 2 \cdot \frac{t}{\sqrt{2} \cdot x}\right)}\\

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

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

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

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

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

\mathbf{else}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{\frac{2}{\sqrt{2}} \cdot \left(\frac{t}{x} + \frac{t}{x \cdot x}\right) + \left(t \cdot \sqrt{2} - \frac{t}{\sqrt{2} \cdot \left(x \cdot x\right)}\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
 (if (<= t -4.448494623502798e+107)
   (/
    (* t (sqrt 2.0))
    (-
     (/ (/ t x) (* (sqrt 2.0) x))
     (+ (* t (sqrt 2.0)) (* 2.0 (/ t (* (sqrt 2.0) x))))))
   (if (<= t -7.376286544804047e-197)
     (/
      (* t (sqrt 2.0))
      (sqrt (+ (* 4.0 (/ (* t t) x)) (* 2.0 (+ (* t t) (/ l (/ x l)))))))
     (if (<= t -9.537665178779285e-263)
       (/
        (* t (sqrt 2.0))
        (-
         (/ (/ t x) (* (sqrt 2.0) x))
         (+ (* t (sqrt 2.0)) (* 2.0 (/ t (* (sqrt 2.0) x))))))
       (if (<= t 5.289804017494565e-269)
         (/
          (* t (sqrt 2.0))
          (sqrt (+ (* 4.0 (/ (* t t) x)) (* 2.0 (+ (* t t) (/ l (/ x l)))))))
         (if (<= t 2.9878933277788783e-167)
           (/
            (* t (sqrt 2.0))
            (-
             (+ (* t (sqrt 2.0)) (* 2.0 (/ t (* (sqrt 2.0) x))))
             (/ (/ t x) (* (sqrt 2.0) x))))
           (if (<= t 3.552303323015909e+105)
             (/
              (* t (sqrt 2.0))
              (sqrt
               (+ (* 4.0 (/ (* t t) x)) (* 2.0 (+ (* t t) (/ l (/ x l)))))))
             (/
              (* t (sqrt 2.0))
              (+
               (* (/ 2.0 (sqrt 2.0)) (+ (/ t x) (/ t (* x x))))
               (- (* t (sqrt 2.0)) (/ t (* (sqrt 2.0) (* x 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 tmp;
	if (t <= -4.448494623502798e+107) {
		tmp = (t * sqrt(2.0)) / (((t / x) / (sqrt(2.0) * x)) - ((t * sqrt(2.0)) + (2.0 * (t / (sqrt(2.0) * x)))));
	} else if (t <= -7.376286544804047e-197) {
		tmp = (t * sqrt(2.0)) / sqrt((4.0 * ((t * t) / x)) + (2.0 * ((t * t) + (l / (x / l)))));
	} else if (t <= -9.537665178779285e-263) {
		tmp = (t * sqrt(2.0)) / (((t / x) / (sqrt(2.0) * x)) - ((t * sqrt(2.0)) + (2.0 * (t / (sqrt(2.0) * x)))));
	} else if (t <= 5.289804017494565e-269) {
		tmp = (t * sqrt(2.0)) / sqrt((4.0 * ((t * t) / x)) + (2.0 * ((t * t) + (l / (x / l)))));
	} else if (t <= 2.9878933277788783e-167) {
		tmp = (t * sqrt(2.0)) / (((t * sqrt(2.0)) + (2.0 * (t / (sqrt(2.0) * x)))) - ((t / x) / (sqrt(2.0) * x)));
	} else if (t <= 3.552303323015909e+105) {
		tmp = (t * sqrt(2.0)) / sqrt((4.0 * ((t * t) / x)) + (2.0 * ((t * t) + (l / (x / l)))));
	} else {
		tmp = (t * sqrt(2.0)) / (((2.0 / sqrt(2.0)) * ((t / x) + (t / (x * x)))) + ((t * sqrt(2.0)) - (t / (sqrt(2.0) * (x * 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 4 regimes
  2. if t < -4.4484946235027983e107 or -7.3762865448040474e-197 < t < -9.5376651787792847e-263

    1. Initial program 54.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 48.9

      \[\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. Simplified48.9

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

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

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

    if -4.4484946235027983e107 < t < -7.3762865448040474e-197 or -9.5376651787792847e-263 < t < 5.28980401749456519e-269 or 2.98789332777887829e-167 < t < 3.5523033230159089e105

    1. Initial program 31.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 14.1

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

      \[\leadsto \frac{\sqrt{2} \cdot t}{\sqrt{\color{blue}{4 \cdot \frac{t \cdot t}{x} + 2 \cdot \left(t \cdot t + \frac{\ell \cdot \ell}{x}\right)}}}\]
    4. Using strategy rm
    5. Applied associate-/l*_binary64_249.7

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

    if 5.28980401749456519e-269 < t < 2.98789332777887829e-167

    1. Initial program 62.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 33.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. Simplified33.3

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

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

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

    if 3.5523033230159089e105 < t

    1. Initial program 51.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 3.1

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -4.448494623502798 \cdot 10^{+107}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{\frac{\frac{t}{x}}{\sqrt{2} \cdot x} - \left(t \cdot \sqrt{2} + 2 \cdot \frac{t}{\sqrt{2} \cdot x}\right)}\\ \mathbf{elif}\;t \leq -7.376286544804047 \cdot 10^{-197}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{4 \cdot \frac{t \cdot t}{x} + 2 \cdot \left(t \cdot t + \frac{\ell}{\frac{x}{\ell}}\right)}}\\ \mathbf{elif}\;t \leq -9.537665178779285 \cdot 10^{-263}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{\frac{\frac{t}{x}}{\sqrt{2} \cdot x} - \left(t \cdot \sqrt{2} + 2 \cdot \frac{t}{\sqrt{2} \cdot x}\right)}\\ \mathbf{elif}\;t \leq 5.289804017494565 \cdot 10^{-269}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{4 \cdot \frac{t \cdot t}{x} + 2 \cdot \left(t \cdot t + \frac{\ell}{\frac{x}{\ell}}\right)}}\\ \mathbf{elif}\;t \leq 2.9878933277788783 \cdot 10^{-167}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{\left(t \cdot \sqrt{2} + 2 \cdot \frac{t}{\sqrt{2} \cdot x}\right) - \frac{\frac{t}{x}}{\sqrt{2} \cdot x}}\\ \mathbf{elif}\;t \leq 3.552303323015909 \cdot 10^{+105}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{4 \cdot \frac{t \cdot t}{x} + 2 \cdot \left(t \cdot t + \frac{\ell}{\frac{x}{\ell}}\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{\frac{2}{\sqrt{2}} \cdot \left(\frac{t}{x} + \frac{t}{x \cdot x}\right) + \left(t \cdot \sqrt{2} - \frac{t}{\sqrt{2} \cdot \left(x \cdot x\right)}\right)}\\ \end{array}\]

Reproduce

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