Average Error: 42.7 → 10.2
Time: 31.3s
Precision: 64
\[\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 \le -8781316784794473.0:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\left(2 \cdot \left(\frac{t}{\left(x \cdot x\right) \cdot \left(2 \cdot \sqrt{2}\right)} - \frac{\frac{t}{\sqrt{2}}}{x \cdot x}\right) - \frac{t}{\sqrt{2}} \cdot \frac{2}{x}\right) - \sqrt{2} \cdot t}\\ \mathbf{elif}\;t \le -3.1340173156713147 \cdot 10^{-226}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\sqrt{\frac{t \cdot t}{x} \cdot 4 + \left(\sqrt{\frac{\ell}{\frac{x}{\ell}} + t \cdot t} \cdot \sqrt{\frac{\ell}{\frac{x}{\ell}} + t \cdot t}\right) \cdot 2}}\\ \mathbf{elif}\;t \le -9.131577791002971 \cdot 10^{-250}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\left(2 \cdot \left(\frac{t}{\left(x \cdot x\right) \cdot \left(2 \cdot \sqrt{2}\right)} - \frac{\frac{t}{\sqrt{2}}}{x \cdot x}\right) - \frac{t}{\sqrt{2}} \cdot \frac{2}{x}\right) - \sqrt{2} \cdot t}\\ \mathbf{elif}\;t \le 1.9521121079445436 \cdot 10^{+65}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\sqrt{\frac{t \cdot t}{x} \cdot 4 + \left(\sqrt{\frac{\ell}{\frac{x}{\ell}} + t \cdot t} \cdot \sqrt{\frac{\ell}{\frac{x}{\ell}} + t \cdot t}\right) \cdot 2}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\sqrt{2} \cdot t + \frac{\frac{2 \cdot t}{\sqrt{2}}}{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 \le -8781316784794473.0:\\
\;\;\;\;\frac{\sqrt{2} \cdot t}{\left(2 \cdot \left(\frac{t}{\left(x \cdot x\right) \cdot \left(2 \cdot \sqrt{2}\right)} - \frac{\frac{t}{\sqrt{2}}}{x \cdot x}\right) - \frac{t}{\sqrt{2}} \cdot \frac{2}{x}\right) - \sqrt{2} \cdot t}\\

\mathbf{elif}\;t \le -3.1340173156713147 \cdot 10^{-226}:\\
\;\;\;\;\frac{\sqrt{2} \cdot t}{\sqrt{\frac{t \cdot t}{x} \cdot 4 + \left(\sqrt{\frac{\ell}{\frac{x}{\ell}} + t \cdot t} \cdot \sqrt{\frac{\ell}{\frac{x}{\ell}} + t \cdot t}\right) \cdot 2}}\\

\mathbf{elif}\;t \le -9.131577791002971 \cdot 10^{-250}:\\
\;\;\;\;\frac{\sqrt{2} \cdot t}{\left(2 \cdot \left(\frac{t}{\left(x \cdot x\right) \cdot \left(2 \cdot \sqrt{2}\right)} - \frac{\frac{t}{\sqrt{2}}}{x \cdot x}\right) - \frac{t}{\sqrt{2}} \cdot \frac{2}{x}\right) - \sqrt{2} \cdot t}\\

\mathbf{elif}\;t \le 1.9521121079445436 \cdot 10^{+65}:\\
\;\;\;\;\frac{\sqrt{2} \cdot t}{\sqrt{\frac{t \cdot t}{x} \cdot 4 + \left(\sqrt{\frac{\ell}{\frac{x}{\ell}} + t \cdot t} \cdot \sqrt{\frac{\ell}{\frac{x}{\ell}} + t \cdot t}\right) \cdot 2}}\\

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

\end{array}
double f(double x, double l, double t) {
        double r1330734 = 2.0;
        double r1330735 = sqrt(r1330734);
        double r1330736 = t;
        double r1330737 = r1330735 * r1330736;
        double r1330738 = x;
        double r1330739 = 1.0;
        double r1330740 = r1330738 + r1330739;
        double r1330741 = r1330738 - r1330739;
        double r1330742 = r1330740 / r1330741;
        double r1330743 = l;
        double r1330744 = r1330743 * r1330743;
        double r1330745 = r1330736 * r1330736;
        double r1330746 = r1330734 * r1330745;
        double r1330747 = r1330744 + r1330746;
        double r1330748 = r1330742 * r1330747;
        double r1330749 = r1330748 - r1330744;
        double r1330750 = sqrt(r1330749);
        double r1330751 = r1330737 / r1330750;
        return r1330751;
}

double f(double x, double l, double t) {
        double r1330752 = t;
        double r1330753 = -8781316784794473.0;
        bool r1330754 = r1330752 <= r1330753;
        double r1330755 = 2.0;
        double r1330756 = sqrt(r1330755);
        double r1330757 = r1330756 * r1330752;
        double r1330758 = x;
        double r1330759 = r1330758 * r1330758;
        double r1330760 = r1330755 * r1330756;
        double r1330761 = r1330759 * r1330760;
        double r1330762 = r1330752 / r1330761;
        double r1330763 = r1330752 / r1330756;
        double r1330764 = r1330763 / r1330759;
        double r1330765 = r1330762 - r1330764;
        double r1330766 = r1330755 * r1330765;
        double r1330767 = r1330755 / r1330758;
        double r1330768 = r1330763 * r1330767;
        double r1330769 = r1330766 - r1330768;
        double r1330770 = r1330769 - r1330757;
        double r1330771 = r1330757 / r1330770;
        double r1330772 = -3.1340173156713147e-226;
        bool r1330773 = r1330752 <= r1330772;
        double r1330774 = r1330752 * r1330752;
        double r1330775 = r1330774 / r1330758;
        double r1330776 = 4.0;
        double r1330777 = r1330775 * r1330776;
        double r1330778 = l;
        double r1330779 = r1330758 / r1330778;
        double r1330780 = r1330778 / r1330779;
        double r1330781 = r1330780 + r1330774;
        double r1330782 = sqrt(r1330781);
        double r1330783 = r1330782 * r1330782;
        double r1330784 = r1330783 * r1330755;
        double r1330785 = r1330777 + r1330784;
        double r1330786 = sqrt(r1330785);
        double r1330787 = r1330757 / r1330786;
        double r1330788 = -9.131577791002971e-250;
        bool r1330789 = r1330752 <= r1330788;
        double r1330790 = 1.9521121079445436e+65;
        bool r1330791 = r1330752 <= r1330790;
        double r1330792 = r1330755 * r1330752;
        double r1330793 = r1330792 / r1330756;
        double r1330794 = r1330793 / r1330758;
        double r1330795 = r1330757 + r1330794;
        double r1330796 = r1330757 / r1330795;
        double r1330797 = r1330791 ? r1330787 : r1330796;
        double r1330798 = r1330789 ? r1330771 : r1330797;
        double r1330799 = r1330773 ? r1330787 : r1330798;
        double r1330800 = r1330754 ? r1330771 : r1330799;
        return r1330800;
}

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 3 regimes
  2. if t < -8781316784794473.0 or -3.1340173156713147e-226 < t < -9.131577791002971e-250

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

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

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

    if -8781316784794473.0 < t < -3.1340173156713147e-226 or -9.131577791002971e-250 < t < 1.9521121079445436e+65

    1. Initial program 40.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 19.1

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

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

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

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

    if 1.9521121079445436e+65 < t

    1. Initial program 45.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 44.4

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

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

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

      \[\leadsto \frac{\sqrt{2} \cdot t}{\color{blue}{t \cdot \sqrt{2} + 2 \cdot \frac{t}{\sqrt{2} \cdot x}}}\]
    7. Simplified4.2

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \le -8781316784794473.0:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\left(2 \cdot \left(\frac{t}{\left(x \cdot x\right) \cdot \left(2 \cdot \sqrt{2}\right)} - \frac{\frac{t}{\sqrt{2}}}{x \cdot x}\right) - \frac{t}{\sqrt{2}} \cdot \frac{2}{x}\right) - \sqrt{2} \cdot t}\\ \mathbf{elif}\;t \le -3.1340173156713147 \cdot 10^{-226}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\sqrt{\frac{t \cdot t}{x} \cdot 4 + \left(\sqrt{\frac{\ell}{\frac{x}{\ell}} + t \cdot t} \cdot \sqrt{\frac{\ell}{\frac{x}{\ell}} + t \cdot t}\right) \cdot 2}}\\ \mathbf{elif}\;t \le -9.131577791002971 \cdot 10^{-250}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\left(2 \cdot \left(\frac{t}{\left(x \cdot x\right) \cdot \left(2 \cdot \sqrt{2}\right)} - \frac{\frac{t}{\sqrt{2}}}{x \cdot x}\right) - \frac{t}{\sqrt{2}} \cdot \frac{2}{x}\right) - \sqrt{2} \cdot t}\\ \mathbf{elif}\;t \le 1.9521121079445436 \cdot 10^{+65}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\sqrt{\frac{t \cdot t}{x} \cdot 4 + \left(\sqrt{\frac{\ell}{\frac{x}{\ell}} + t \cdot t} \cdot \sqrt{\frac{\ell}{\frac{x}{\ell}} + t \cdot t}\right) \cdot 2}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\sqrt{2} \cdot t + \frac{\frac{2 \cdot t}{\sqrt{2}}}{x}}\\ \end{array}\]

Reproduce

herbie shell --seed 2019162 
(FPCore (x l t)
  :name "Toniolo and Linder, Equation (7)"
  (/ (* (sqrt 2) t) (sqrt (- (* (/ (+ x 1) (- x 1)) (+ (* l l) (* 2 (* t t)))) (* l l)))))