Average Error: 43.6 → 8.2
Time: 18.6s
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} t_1 := t \cdot \sqrt{2}\\ t_2 := 2 + \frac{4}{x}\\ t_3 := -t \cdot \sqrt{t_2}\\ \mathbf{if}\;t \leq -3.102563437149407 \cdot 10^{+67}:\\ \;\;\;\;\frac{t_1}{t_3}\\ \mathbf{else}:\\ \;\;\;\;\begin{array}{l} t_4 := 4 \cdot \frac{t \cdot t}{x}\\ \mathbf{if}\;t \leq -1.2602368096531304 \cdot 10^{-161}:\\ \;\;\;\;\frac{t_1}{\sqrt{t_4 + 2 \cdot \left(t \cdot t + \ell \cdot \frac{\ell}{x}\right)}}\\ \mathbf{elif}\;t \leq -2.374125310995121 \cdot 10^{-282}:\\ \;\;\;\;\frac{t_1}{t_3 - \frac{\ell \cdot \ell}{t \cdot x} \cdot \sqrt{\frac{1}{t_2}}}\\ \mathbf{elif}\;t \leq 5.838507140043639 \cdot 10^{-275}:\\ \;\;\;\;\begin{array}{l} t_5 := \sqrt{\sqrt{t_4 + 2 \cdot \left(t \cdot t + \frac{\ell \cdot \ell}{x}\right)}}\\ \frac{t_1}{t_5 \cdot t_5} \end{array}\\ \mathbf{elif}\;t \leq 2.9134571555877657 \cdot 10^{-213}:\\ \;\;\;\;\begin{array}{l} t_6 := \sqrt{2} \cdot x\\ \frac{t_1}{t_1 + \left(2 \cdot \frac{t}{t_6} + \frac{\ell \cdot \ell}{t \cdot t_6}\right)} \end{array}\\ \mathbf{elif}\;t \leq 6.236030065229034 \cdot 10^{+130}:\\ \;\;\;\;\frac{t_1}{\sqrt{t_4 + 2 \cdot \left(t \cdot t + \frac{\ell}{\sqrt[3]{x} \cdot \sqrt[3]{x}} \cdot \frac{\ell}{\sqrt[3]{x}}\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{t_1}{t \cdot \sqrt{\frac{2}{x - 1} + 2 \cdot \frac{x}{x - 1}}}\\ \end{array}\\ \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}
t_1 := t \cdot \sqrt{2}\\
t_2 := 2 + \frac{4}{x}\\
t_3 := -t \cdot \sqrt{t_2}\\
\mathbf{if}\;t \leq -3.102563437149407 \cdot 10^{+67}:\\
\;\;\;\;\frac{t_1}{t_3}\\

\mathbf{else}:\\
\;\;\;\;\begin{array}{l}
t_4 := 4 \cdot \frac{t \cdot t}{x}\\
\mathbf{if}\;t \leq -1.2602368096531304 \cdot 10^{-161}:\\
\;\;\;\;\frac{t_1}{\sqrt{t_4 + 2 \cdot \left(t \cdot t + \ell \cdot \frac{\ell}{x}\right)}}\\

\mathbf{elif}\;t \leq -2.374125310995121 \cdot 10^{-282}:\\
\;\;\;\;\frac{t_1}{t_3 - \frac{\ell \cdot \ell}{t \cdot x} \cdot \sqrt{\frac{1}{t_2}}}\\

\mathbf{elif}\;t \leq 5.838507140043639 \cdot 10^{-275}:\\
\;\;\;\;\begin{array}{l}
t_5 := \sqrt{\sqrt{t_4 + 2 \cdot \left(t \cdot t + \frac{\ell \cdot \ell}{x}\right)}}\\
\frac{t_1}{t_5 \cdot t_5}
\end{array}\\

\mathbf{elif}\;t \leq 2.9134571555877657 \cdot 10^{-213}:\\
\;\;\;\;\begin{array}{l}
t_6 := \sqrt{2} \cdot x\\
\frac{t_1}{t_1 + \left(2 \cdot \frac{t}{t_6} + \frac{\ell \cdot \ell}{t \cdot t_6}\right)}
\end{array}\\

\mathbf{elif}\;t \leq 6.236030065229034 \cdot 10^{+130}:\\
\;\;\;\;\frac{t_1}{\sqrt{t_4 + 2 \cdot \left(t \cdot t + \frac{\ell}{\sqrt[3]{x} \cdot \sqrt[3]{x}} \cdot \frac{\ell}{\sqrt[3]{x}}\right)}}\\

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


\end{array}\\


\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
 (let* ((t_1 (* t (sqrt 2.0)))
        (t_2 (+ 2.0 (/ 4.0 x)))
        (t_3 (- (* t (sqrt t_2)))))
   (if (<= t -3.102563437149407e+67)
     (/ t_1 t_3)
     (let* ((t_4 (* 4.0 (/ (* t t) x))))
       (if (<= t -1.2602368096531304e-161)
         (/ t_1 (sqrt (+ t_4 (* 2.0 (+ (* t t) (* l (/ l x)))))))
         (if (<= t -2.374125310995121e-282)
           (/ t_1 (- t_3 (* (/ (* l l) (* t x)) (sqrt (/ 1.0 t_2)))))
           (if (<= t 5.838507140043639e-275)
             (let* ((t_5
                     (sqrt (sqrt (+ t_4 (* 2.0 (+ (* t t) (/ (* l l) x))))))))
               (/ t_1 (* t_5 t_5)))
             (if (<= t 2.9134571555877657e-213)
               (let* ((t_6 (* (sqrt 2.0) x)))
                 (/ t_1 (+ t_1 (+ (* 2.0 (/ t t_6)) (/ (* l l) (* t t_6))))))
               (if (<= t 6.236030065229034e+130)
                 (/
                  t_1
                  (sqrt
                   (+
                    t_4
                    (*
                     2.0
                     (+
                      (* t t)
                      (* (/ l (* (cbrt x) (cbrt x))) (/ l (cbrt x))))))))
                 (/
                  t_1
                  (*
                   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 t_1 = t * sqrt(2.0);
	double t_2 = 2.0 + (4.0 / x);
	double t_3 = -(t * sqrt(t_2));
	double tmp;
	if (t <= -3.102563437149407e+67) {
		tmp = t_1 / t_3;
	} else {
		double t_4 = 4.0 * ((t * t) / x);
		double tmp_1;
		if (t <= -1.2602368096531304e-161) {
			tmp_1 = t_1 / sqrt(t_4 + (2.0 * ((t * t) + (l * (l / x)))));
		} else if (t <= -2.374125310995121e-282) {
			tmp_1 = t_1 / (t_3 - (((l * l) / (t * x)) * sqrt(1.0 / t_2)));
		} else if (t <= 5.838507140043639e-275) {
			double t_5 = sqrt(sqrt(t_4 + (2.0 * ((t * t) + ((l * l) / x)))));
			tmp_1 = t_1 / (t_5 * t_5);
		} else if (t <= 2.9134571555877657e-213) {
			double t_6 = sqrt(2.0) * x;
			tmp_1 = t_1 / (t_1 + ((2.0 * (t / t_6)) + ((l * l) / (t * t_6))));
		} else if (t <= 6.236030065229034e+130) {
			tmp_1 = t_1 / sqrt(t_4 + (2.0 * ((t * t) + ((l / (cbrt(x) * cbrt(x))) * (l / cbrt(x))))));
		} else {
			tmp_1 = t_1 / (t * sqrt((2.0 / (x - 1.0)) + (2.0 * (x / (x - 1.0)))));
		}
		tmp = tmp_1;
	}
	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.10256343714940727e67

    1. Initial program 47.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 45.9

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

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

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

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

    if -3.10256343714940727e67 < t < -1.2602368096531304e-161

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

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

      \[\leadsto \frac{\sqrt{2} \cdot t}{\sqrt{\color{blue}{4 \cdot \frac{t \cdot t}{x} + 2 \cdot \left(\frac{\ell \cdot \ell}{x} + t \cdot t\right)}}} \]
    4. Using strategy rm
    5. Applied *-un-lft-identity_binary6410.4

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

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

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

    if -1.2602368096531304e-161 < t < -2.374125310995121e-282

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

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

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

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

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

    if -2.374125310995121e-282 < t < 5.83850714004363907e-275

    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 31.3

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

      \[\leadsto \frac{\sqrt{2} \cdot t}{\sqrt{\color{blue}{4 \cdot \frac{t \cdot t}{x} + 2 \cdot \left(\frac{\ell \cdot \ell}{x} + t \cdot t\right)}}} \]
    4. Using strategy rm
    5. Applied add-sqr-sqrt_binary6431.3

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

    if 5.83850714004363907e-275 < t < 2.91345715558776566e-213

    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 26.6

      \[\leadsto \frac{\sqrt{2} \cdot t}{\color{blue}{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)}} \]
    3. Simplified26.6

      \[\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 2.91345715558776566e-213 < t < 6.23603006522903403e130

    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 13.8

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

      \[\leadsto \frac{\sqrt{2} \cdot t}{\sqrt{\color{blue}{4 \cdot \frac{t \cdot t}{x} + 2 \cdot \left(\frac{\ell \cdot \ell}{x} + t \cdot t\right)}}} \]
    4. Using strategy rm
    5. Applied add-cube-cbrt_binary6413.9

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

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

    if 6.23603006522903403e130 < t

    1. Initial program 56.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 1.7

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -3.102563437149407 \cdot 10^{+67}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{-t \cdot \sqrt{2 + \frac{4}{x}}}\\ \mathbf{elif}\;t \leq -1.2602368096531304 \cdot 10^{-161}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{4 \cdot \frac{t \cdot t}{x} + 2 \cdot \left(t \cdot t + \ell \cdot \frac{\ell}{x}\right)}}\\ \mathbf{elif}\;t \leq -2.374125310995121 \cdot 10^{-282}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{\left(-t \cdot \sqrt{2 + \frac{4}{x}}\right) - \frac{\ell \cdot \ell}{t \cdot x} \cdot \sqrt{\frac{1}{2 + \frac{4}{x}}}}\\ \mathbf{elif}\;t \leq 5.838507140043639 \cdot 10^{-275}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{\sqrt{4 \cdot \frac{t \cdot t}{x} + 2 \cdot \left(t \cdot t + \frac{\ell \cdot \ell}{x}\right)}} \cdot \sqrt{\sqrt{4 \cdot \frac{t \cdot t}{x} + 2 \cdot \left(t \cdot t + \frac{\ell \cdot \ell}{x}\right)}}}\\ \mathbf{elif}\;t \leq 2.9134571555877657 \cdot 10^{-213}:\\ \;\;\;\;\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 6.236030065229034 \cdot 10^{+130}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{4 \cdot \frac{t \cdot t}{x} + 2 \cdot \left(t \cdot t + \frac{\ell}{\sqrt[3]{x} \cdot \sqrt[3]{x}} \cdot \frac{\ell}{\sqrt[3]{x}}\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 2021202 
(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)))))