Average Error: 43.2 → 11.1
Time: 36.3s
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 -123.10441277465658:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{-t \cdot \sqrt{2 \cdot \frac{1}{-1 + x} + 2 \cdot \frac{x}{-1 + x}}}\\ \mathbf{elif}\;t \leq -2.97191195562455 \cdot 10^{-160}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{2 \cdot \frac{{\ell}^{2}}{x} + \left(4 \cdot \frac{{t}^{2}}{x} + 2 \cdot {t}^{2}\right)}}\\ \mathbf{elif}\;t \leq -2.6783763174270457 \cdot 10^{-220}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{-\left(t \cdot \sqrt{4 \cdot \frac{1}{{x}^{2}} + \left(2 + 4 \cdot \frac{1}{x}\right)} + \left(\sqrt{\frac{1}{4 \cdot \frac{1}{{x}^{2}} + \left(2 + 4 \cdot \frac{1}{x}\right)}} \cdot \frac{{\ell}^{2}}{t \cdot x} + \sqrt{\frac{1}{4 \cdot \frac{1}{{x}^{2}} + \left(2 + 4 \cdot \frac{1}{x}\right)}} \cdot \frac{{\ell}^{2}}{t \cdot {x}^{2}}\right)\right)}\\ \mathbf{elif}\;t \leq 3.2882651861996704 \cdot 10^{-288}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{\ell \cdot \sqrt{2 \cdot \frac{1}{{x}^{2}} + 2 \cdot \frac{1}{x}}}\\ \mathbf{elif}\;t \leq 1.5653638338130407 \cdot 10^{-222}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{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)}\\ \mathbf{elif}\;t \leq 77477067.12571414:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{2 \cdot \frac{{\ell}^{2}}{x} + \left(4 \cdot \frac{{t}^{2}}{x} + \left(4 \cdot \frac{{t}^{2}}{{x}^{2}} + \left(2 \cdot {t}^{2} + 2 \cdot \frac{{\ell}^{2}}{{x}^{2}}\right)\right)\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{t \cdot \sqrt{2 \cdot \frac{1}{-1 + x} + 2 \cdot \frac{x}{-1 + x}}}\\ \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 -123.10441277465658:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{-t \cdot \sqrt{2 \cdot \frac{1}{-1 + x} + 2 \cdot \frac{x}{-1 + x}}}\\

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

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

\mathbf{elif}\;t \leq 3.2882651861996704 \cdot 10^{-288}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{\ell \cdot \sqrt{2 \cdot \frac{1}{{x}^{2}} + 2 \cdot \frac{1}{x}}}\\

\mathbf{elif}\;t \leq 1.5653638338130407 \cdot 10^{-222}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{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)}\\

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

\mathbf{else}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{t \cdot \sqrt{2 \cdot \frac{1}{-1 + x} + 2 \cdot \frac{x}{-1 + x}}}\\

\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 -123.10441277465658)
   (/
    (* t (sqrt 2.0))
    (- (* t (sqrt (+ (* 2.0 (/ 1.0 (+ -1.0 x))) (* 2.0 (/ x (+ -1.0 x))))))))
   (if (<= t -2.97191195562455e-160)
     (/
      (* t (sqrt 2.0))
      (sqrt
       (+
        (* 2.0 (/ (pow l 2.0) x))
        (+ (* 4.0 (/ (pow t 2.0) x)) (* 2.0 (pow t 2.0))))))
     (if (<= t -2.6783763174270457e-220)
       (/
        (* t (sqrt 2.0))
        (-
         (+
          (*
           t
           (sqrt (+ (* 4.0 (/ 1.0 (pow x 2.0))) (+ 2.0 (* 4.0 (/ 1.0 x))))))
          (+
           (*
            (sqrt
             (/ 1.0 (+ (* 4.0 (/ 1.0 (pow x 2.0))) (+ 2.0 (* 4.0 (/ 1.0 x))))))
            (/ (pow l 2.0) (* t x)))
           (*
            (sqrt
             (/ 1.0 (+ (* 4.0 (/ 1.0 (pow x 2.0))) (+ 2.0 (* 4.0 (/ 1.0 x))))))
            (/ (pow l 2.0) (* t (pow x 2.0))))))))
       (if (<= t 3.2882651861996704e-288)
         (/
          (* t (sqrt 2.0))
          (* l (sqrt (+ (* 2.0 (/ 1.0 (pow x 2.0))) (* 2.0 (/ 1.0 x))))))
         (if (<= t 1.5653638338130407e-222)
           (/
            (* t (sqrt 2.0))
            (+
             (* t (sqrt 2.0))
             (+
              (* 2.0 (/ t (* (sqrt 2.0) x)))
              (/ (pow l 2.0) (* t (* (sqrt 2.0) x))))))
           (if (<= t 77477067.12571414)
             (/
              (* t (sqrt 2.0))
              (sqrt
               (+
                (* 2.0 (/ (pow l 2.0) x))
                (+
                 (* 4.0 (/ (pow t 2.0) x))
                 (+
                  (* 4.0 (/ (pow t 2.0) (pow x 2.0)))
                  (+
                   (* 2.0 (pow t 2.0))
                   (* 2.0 (/ (pow l 2.0) (pow x 2.0)))))))))
             (/
              (* t (sqrt 2.0))
              (*
               t
               (sqrt
                (+
                 (* 2.0 (/ 1.0 (+ -1.0 x)))
                 (* 2.0 (/ x (+ -1.0 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 <= -123.10441277465658) {
		tmp = (t * sqrt(2.0)) / -(t * sqrt((2.0 * (1.0 / (-1.0 + x))) + (2.0 * (x / (-1.0 + x)))));
	} else if (t <= -2.97191195562455e-160) {
		tmp = (t * sqrt(2.0)) / sqrt((2.0 * (pow(l, 2.0) / x)) + ((4.0 * (pow(t, 2.0) / x)) + (2.0 * pow(t, 2.0))));
	} else if (t <= -2.6783763174270457e-220) {
		tmp = (t * sqrt(2.0)) / -((t * sqrt((4.0 * (1.0 / pow(x, 2.0))) + (2.0 + (4.0 * (1.0 / x))))) + ((sqrt(1.0 / ((4.0 * (1.0 / pow(x, 2.0))) + (2.0 + (4.0 * (1.0 / x))))) * (pow(l, 2.0) / (t * x))) + (sqrt(1.0 / ((4.0 * (1.0 / pow(x, 2.0))) + (2.0 + (4.0 * (1.0 / x))))) * (pow(l, 2.0) / (t * pow(x, 2.0))))));
	} else if (t <= 3.2882651861996704e-288) {
		tmp = (t * sqrt(2.0)) / (l * sqrt((2.0 * (1.0 / pow(x, 2.0))) + (2.0 * (1.0 / x))));
	} else if (t <= 1.5653638338130407e-222) {
		tmp = (t * sqrt(2.0)) / ((t * sqrt(2.0)) + ((2.0 * (t / (sqrt(2.0) * x))) + (pow(l, 2.0) / (t * (sqrt(2.0) * x)))));
	} else if (t <= 77477067.12571414) {
		tmp = (t * sqrt(2.0)) / sqrt((2.0 * (pow(l, 2.0) / x)) + ((4.0 * (pow(t, 2.0) / x)) + ((4.0 * (pow(t, 2.0) / pow(x, 2.0))) + ((2.0 * pow(t, 2.0)) + (2.0 * (pow(l, 2.0) / pow(x, 2.0)))))));
	} else {
		tmp = (t * sqrt(2.0)) / (t * sqrt((2.0 * (1.0 / (-1.0 + x))) + (2.0 * (x / (-1.0 + 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 7 regimes
  2. if t < -123.104412774656581

    1. Initial program 42.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 5.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)}}\]

    if -123.104412774656581 < t < -2.97191195562455016e-160

    1. Initial program 31.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 9.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)}}}\]

    if -2.97191195562455016e-160 < t < -2.67837631742704567e-220

    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 39.6

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

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

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

    if -2.67837631742704567e-220 < t < 3.28826518619967038e-288

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

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

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

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

    if 3.28826518619967038e-288 < t < 1.56536383381304075e-222

    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 26.9

      \[\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)}}\]

    if 1.56536383381304075e-222 < t < 77477067.1257141382

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

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

    if 77477067.1257141382 < t

    1. Initial program 41.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 4.7

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -123.10441277465658:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{-t \cdot \sqrt{2 \cdot \frac{1}{-1 + x} + 2 \cdot \frac{x}{-1 + x}}}\\ \mathbf{elif}\;t \leq -2.97191195562455 \cdot 10^{-160}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{2 \cdot \frac{{\ell}^{2}}{x} + \left(4 \cdot \frac{{t}^{2}}{x} + 2 \cdot {t}^{2}\right)}}\\ \mathbf{elif}\;t \leq -2.6783763174270457 \cdot 10^{-220}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{-\left(t \cdot \sqrt{4 \cdot \frac{1}{{x}^{2}} + \left(2 + 4 \cdot \frac{1}{x}\right)} + \left(\sqrt{\frac{1}{4 \cdot \frac{1}{{x}^{2}} + \left(2 + 4 \cdot \frac{1}{x}\right)}} \cdot \frac{{\ell}^{2}}{t \cdot x} + \sqrt{\frac{1}{4 \cdot \frac{1}{{x}^{2}} + \left(2 + 4 \cdot \frac{1}{x}\right)}} \cdot \frac{{\ell}^{2}}{t \cdot {x}^{2}}\right)\right)}\\ \mathbf{elif}\;t \leq 3.2882651861996704 \cdot 10^{-288}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{\ell \cdot \sqrt{2 \cdot \frac{1}{{x}^{2}} + 2 \cdot \frac{1}{x}}}\\ \mathbf{elif}\;t \leq 1.5653638338130407 \cdot 10^{-222}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{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)}\\ \mathbf{elif}\;t \leq 77477067.12571414:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{2 \cdot \frac{{\ell}^{2}}{x} + \left(4 \cdot \frac{{t}^{2}}{x} + \left(4 \cdot \frac{{t}^{2}}{{x}^{2}} + \left(2 \cdot {t}^{2} + 2 \cdot \frac{{\ell}^{2}}{{x}^{2}}\right)\right)\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{t \cdot \sqrt{2 \cdot \frac{1}{-1 + x} + 2 \cdot \frac{x}{-1 + x}}}\\ \end{array}\]

Reproduce

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