Average Error: 43.3 → 11.8
Time: 16.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 -7.870811036512242 \cdot 10^{-49}:\\ \;\;\;\;\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.5955154161613975 \cdot 10^{-185}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{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 + \sqrt[3]{\frac{\ell \cdot \ell}{x \cdot x}} \cdot \left(\sqrt[3]{\frac{\ell \cdot \ell}{x \cdot x}} \cdot \sqrt[3]{\frac{\ell \cdot \ell}{x \cdot x}}\right)\right) + 4 \cdot \left(\frac{t \cdot t}{{x}^{3}} + \frac{t \cdot t}{x \cdot x}\right)\right)\right)\right)}}\\ \mathbf{elif}\;t \leq -5.984746586445027 \cdot 10^{-259}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{-t \cdot \sqrt{2 \cdot \frac{1}{-1 + x} + 2 \cdot \frac{x}{-1 + x}}}\\ \mathbf{elif}\;t \leq 1.297267949586402 \cdot 10^{-168}:\\ \;\;\;\;\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 1.4508059836798438 \cdot 10^{+63}:\\ \;\;\;\;\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 -7.870811036512242 \cdot 10^{-49}:\\
\;\;\;\;\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.5955154161613975 \cdot 10^{-185}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{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 + \sqrt[3]{\frac{\ell \cdot \ell}{x \cdot x}} \cdot \left(\sqrt[3]{\frac{\ell \cdot \ell}{x \cdot x}} \cdot \sqrt[3]{\frac{\ell \cdot \ell}{x \cdot x}}\right)\right) + 4 \cdot \left(\frac{t \cdot t}{{x}^{3}} + \frac{t \cdot t}{x \cdot x}\right)\right)\right)\right)}}\\

\mathbf{elif}\;t \leq -5.984746586445027 \cdot 10^{-259}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{-t \cdot \sqrt{2 \cdot \frac{1}{-1 + x} + 2 \cdot \frac{x}{-1 + x}}}\\

\mathbf{elif}\;t \leq 1.297267949586402 \cdot 10^{-168}:\\
\;\;\;\;\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 1.4508059836798438 \cdot 10^{+63}:\\
\;\;\;\;\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 -7.870811036512242e-49)
   (/
    (* t (sqrt 2.0))
    (- (* t (sqrt (+ (* 2.0 (/ 1.0 (+ -1.0 x))) (* 2.0 (/ x (+ -1.0 x))))))))
   (if (<= t -2.5955154161613975e-185)
     (/
      (* t (sqrt 2.0))
      (sqrt
       (+
        (* 2.0 (/ (* l l) x))
        (+
         (* 4.0 (/ (* t t) x))
         (+
          (* 2.0 (/ (* l l) (pow x 3.0)))
          (+
           (*
            2.0
            (+
             (* t t)
             (*
              (cbrt (/ (* l l) (* x x)))
              (* (cbrt (/ (* l l) (* x x))) (cbrt (/ (* l l) (* x x)))))))
           (* 4.0 (+ (/ (* t t) (pow x 3.0)) (/ (* t t) (* x x))))))))))
     (if (<= t -5.984746586445027e-259)
       (/
        (* t (sqrt 2.0))
        (-
         (* t (sqrt (+ (* 2.0 (/ 1.0 (+ -1.0 x))) (* 2.0 (/ x (+ -1.0 x))))))))
       (if (<= t 1.297267949586402e-168)
         (/
          (* t (sqrt 2.0))
          (+
           (* t (sqrt 2.0))
           (+
            (* 2.0 (/ t (* (sqrt 2.0) x)))
            (/ (* l l) (* t (* (sqrt 2.0) x))))))
         (if (<= t 1.4508059836798438e+63)
           (/
            (* 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 <= -7.870811036512242e-49) {
		tmp = (t * sqrt(2.0)) / -(t * sqrt((2.0 * (1.0 / (-1.0 + x))) + (2.0 * (x / (-1.0 + x)))));
	} else if (t <= -2.5955154161613975e-185) {
		tmp = (t * sqrt(2.0)) / sqrt((2.0 * ((l * l) / x)) + ((4.0 * ((t * t) / x)) + ((2.0 * ((l * l) / pow(x, 3.0))) + ((2.0 * ((t * t) + (cbrt((l * l) / (x * x)) * (cbrt((l * l) / (x * x)) * cbrt((l * l) / (x * x)))))) + (4.0 * (((t * t) / pow(x, 3.0)) + ((t * t) / (x * x))))))));
	} else if (t <= -5.984746586445027e-259) {
		tmp = (t * sqrt(2.0)) / -(t * sqrt((2.0 * (1.0 / (-1.0 + x))) + (2.0 * (x / (-1.0 + x)))));
	} else if (t <= 1.297267949586402e-168) {
		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 <= 1.4508059836798438e+63) {
		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 5 regimes
  2. if t < -7.8708110365122422e-49 or -2.59551541616139748e-185 < t < -5.98474658644502708e-259

    1. Initial program 43.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 10.7

      \[\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 -7.8708110365122422e-49 < t < -2.59551541616139748e-185

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

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

      \[\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. Using strategy rm
    5. Applied add-cube-cbrt_binary6417.1

      \[\leadsto \frac{\sqrt{2} \cdot t}{\sqrt{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 + \color{blue}{\left(\sqrt[3]{\frac{\ell \cdot \ell}{x \cdot x}} \cdot \sqrt[3]{\frac{\ell \cdot \ell}{x \cdot x}}\right) \cdot \sqrt[3]{\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)}}\]

    if -5.98474658644502708e-259 < t < 1.29726794958640211e-168

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

      \[\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. Simplified30.2

      \[\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.29726794958640211e-168 < t < 1.45080598367984385e63

    1. Initial program 29.0

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

      \[\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 1.45080598367984385e63 < t

    1. Initial program 46.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.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. Recombined 5 regimes into one program.
  4. Final simplification11.8

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -7.870811036512242 \cdot 10^{-49}:\\ \;\;\;\;\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.5955154161613975 \cdot 10^{-185}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{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 + \sqrt[3]{\frac{\ell \cdot \ell}{x \cdot x}} \cdot \left(\sqrt[3]{\frac{\ell \cdot \ell}{x \cdot x}} \cdot \sqrt[3]{\frac{\ell \cdot \ell}{x \cdot x}}\right)\right) + 4 \cdot \left(\frac{t \cdot t}{{x}^{3}} + \frac{t \cdot t}{x \cdot x}\right)\right)\right)\right)}}\\ \mathbf{elif}\;t \leq -5.984746586445027 \cdot 10^{-259}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{-t \cdot \sqrt{2 \cdot \frac{1}{-1 + x} + 2 \cdot \frac{x}{-1 + x}}}\\ \mathbf{elif}\;t \leq 1.297267949586402 \cdot 10^{-168}:\\ \;\;\;\;\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 1.4508059836798438 \cdot 10^{+63}:\\ \;\;\;\;\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}\]

Alternatives

Reproduce

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