Average Error: 43.0 → 9.8
Time: 10.1s
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 := t \cdot \sqrt{\frac{2}{x - 1} + 2 \cdot \frac{x}{x - 1}}\\ \mathbf{if}\;t \leq -2.4402300862622605 \cdot 10^{+79}:\\ \;\;\;\;\frac{t_1}{-t_2}\\ \mathbf{else}:\\ \;\;\;\;\begin{array}{l} t_3 := t \cdot t + \frac{\ell \cdot \ell}{x}\\ t_4 := \frac{t \cdot t}{x}\\ \mathbf{if}\;t \leq -1.0772899486568456 \cdot 10^{-149}:\\ \;\;\;\;\frac{t_1}{\sqrt{4 \cdot t_4 + 2 \cdot t_3}}\\ \mathbf{elif}\;t \leq 4.367261950907306 \cdot 10^{-309}:\\ \;\;\;\;\begin{array}{l} t_5 := 2 + \left(\frac{4}{x} + \frac{4}{x \cdot x}\right)\\ \frac{t_1}{-\left(\sqrt{\frac{1}{t_5}} \cdot \left(\frac{\ell \cdot \ell}{t \cdot x} + \frac{\ell \cdot \ell}{x \cdot \left(t \cdot x\right)}\right) + t \cdot \sqrt{t_5}\right)} \end{array}\\ \mathbf{elif}\;t \leq 6.110738326698442 \cdot 10^{-182}:\\ \;\;\;\;\frac{t_1}{t_1 + \left(2 \cdot \frac{t}{\sqrt{2} \cdot x} + \frac{\ell \cdot \ell}{t_1 \cdot x}\right)}\\ \mathbf{elif}\;t \leq 4.47805730708622 \cdot 10^{+52}:\\ \;\;\;\;\frac{t_1}{\sqrt{4 \cdot \left(t_4 + \frac{t \cdot t}{x \cdot x}\right) + 2 \cdot \left(t_3 + \frac{\ell \cdot \ell}{x \cdot x}\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{t_1}{t_2}\\ \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 := t \cdot \sqrt{\frac{2}{x - 1} + 2 \cdot \frac{x}{x - 1}}\\
\mathbf{if}\;t \leq -2.4402300862622605 \cdot 10^{+79}:\\
\;\;\;\;\frac{t_1}{-t_2}\\

\mathbf{else}:\\
\;\;\;\;\begin{array}{l}
t_3 := t \cdot t + \frac{\ell \cdot \ell}{x}\\
t_4 := \frac{t \cdot t}{x}\\
\mathbf{if}\;t \leq -1.0772899486568456 \cdot 10^{-149}:\\
\;\;\;\;\frac{t_1}{\sqrt{4 \cdot t_4 + 2 \cdot t_3}}\\

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

\mathbf{elif}\;t \leq 6.110738326698442 \cdot 10^{-182}:\\
\;\;\;\;\frac{t_1}{t_1 + \left(2 \cdot \frac{t}{\sqrt{2} \cdot x} + \frac{\ell \cdot \ell}{t_1 \cdot x}\right)}\\

\mathbf{elif}\;t \leq 4.47805730708622 \cdot 10^{+52}:\\
\;\;\;\;\frac{t_1}{\sqrt{4 \cdot \left(t_4 + \frac{t \cdot t}{x \cdot x}\right) + 2 \cdot \left(t_3 + \frac{\ell \cdot \ell}{x \cdot x}\right)}}\\

\mathbf{else}:\\
\;\;\;\;\frac{t_1}{t_2}\\


\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 (* t (sqrt (+ (/ 2.0 (- x 1.0)) (* 2.0 (/ x (- x 1.0))))))))
   (if (<= t -2.4402300862622605e+79)
     (/ t_1 (- t_2))
     (let* ((t_3 (+ (* t t) (/ (* l l) x))) (t_4 (/ (* t t) x)))
       (if (<= t -1.0772899486568456e-149)
         (/ t_1 (sqrt (+ (* 4.0 t_4) (* 2.0 t_3))))
         (if (<= t 4.367261950907306e-309)
           (let* ((t_5 (+ 2.0 (+ (/ 4.0 x) (/ 4.0 (* x x))))))
             (/
              t_1
              (-
               (+
                (*
                 (sqrt (/ 1.0 t_5))
                 (+ (/ (* l l) (* t x)) (/ (* l l) (* x (* t x)))))
                (* t (sqrt t_5))))))
           (if (<= t 6.110738326698442e-182)
             (/
              t_1
              (+ t_1 (+ (* 2.0 (/ t (* (sqrt 2.0) x))) (/ (* l l) (* t_1 x)))))
             (if (<= t 4.47805730708622e+52)
               (/
                t_1
                (sqrt
                 (+
                  (* 4.0 (+ t_4 (/ (* t t) (* x x))))
                  (* 2.0 (+ t_3 (/ (* l l) (* x x)))))))
               (/ t_1 t_2)))))))))
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 = t * sqrt((2.0 / (x - 1.0)) + (2.0 * (x / (x - 1.0))));
	double tmp;
	if (t <= -2.4402300862622605e+79) {
		tmp = t_1 / -t_2;
	} else {
		double t_3 = (t * t) + ((l * l) / x);
		double t_4 = (t * t) / x;
		double tmp_1;
		if (t <= -1.0772899486568456e-149) {
			tmp_1 = t_1 / sqrt((4.0 * t_4) + (2.0 * t_3));
		} else if (t <= 4.367261950907306e-309) {
			double t_5 = 2.0 + ((4.0 / x) + (4.0 / (x * x)));
			tmp_1 = t_1 / -((sqrt(1.0 / t_5) * (((l * l) / (t * x)) + ((l * l) / (x * (t * x))))) + (t * sqrt(t_5)));
		} else if (t <= 6.110738326698442e-182) {
			tmp_1 = t_1 / (t_1 + ((2.0 * (t / (sqrt(2.0) * x))) + ((l * l) / (t_1 * x))));
		} else if (t <= 4.47805730708622e+52) {
			tmp_1 = t_1 / sqrt((4.0 * (t_4 + ((t * t) / (x * x)))) + (2.0 * (t_3 + ((l * l) / (x * x)))));
		} else {
			tmp_1 = t_1 / t_2;
		}
		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 6 regimes
  2. if t < -2.44023008626226047e79

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

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

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

    if -2.44023008626226047e79 < t < -1.07728994865684565e-149

    1. Initial program 27.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.6

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

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

    if -1.07728994865684565e-149 < t < 4.367261950907306e-309

    1. Initial program 61.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 38.3

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

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

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

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

    if 4.367261950907306e-309 < t < 6.1107383266984423e-182

    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 36.6

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

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

      \[\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)}} \]
    5. Simplified25.1

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

    if 6.1107383266984423e-182 < t < 4.47805730708621976e52

    1. Initial program 30.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 11.4

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

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

    if 4.47805730708621976e52 < t

    1. Initial program 44.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 3.9

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -2.4402300862622605 \cdot 10^{+79}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{-t \cdot \sqrt{\frac{2}{x - 1} + 2 \cdot \frac{x}{x - 1}}}\\ \mathbf{elif}\;t \leq -1.0772899486568456 \cdot 10^{-149}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{4 \cdot \frac{t \cdot t}{x} + 2 \cdot \left(t \cdot t + \frac{\ell \cdot \ell}{x}\right)}}\\ \mathbf{elif}\;t \leq 4.367261950907306 \cdot 10^{-309}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{-\left(\sqrt{\frac{1}{2 + \left(\frac{4}{x} + \frac{4}{x \cdot x}\right)}} \cdot \left(\frac{\ell \cdot \ell}{t \cdot x} + \frac{\ell \cdot \ell}{x \cdot \left(t \cdot x\right)}\right) + t \cdot \sqrt{2 + \left(\frac{4}{x} + \frac{4}{x \cdot x}\right)}\right)}\\ \mathbf{elif}\;t \leq 6.110738326698442 \cdot 10^{-182}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{t \cdot \sqrt{2} + \left(2 \cdot \frac{t}{\sqrt{2} \cdot x} + \frac{\ell \cdot \ell}{\left(t \cdot \sqrt{2}\right) \cdot x}\right)}\\ \mathbf{elif}\;t \leq 4.47805730708622 \cdot 10^{+52}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{4 \cdot \left(\frac{t \cdot t}{x} + \frac{t \cdot t}{x \cdot x}\right) + 2 \cdot \left(\left(t \cdot t + \frac{\ell \cdot \ell}{x}\right) + \frac{\ell \cdot \ell}{x \cdot 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 2021204 
(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)))))