Average Error: 42.2 → 9.1
Time: 28.4s
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 -6.925769096924062 \cdot 10^{+57}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\left(\frac{\frac{2 \cdot t}{x \cdot x}}{2 \cdot \sqrt{2}} - \mathsf{fma}\left(t, \left(\sqrt{2}\right), \left(\frac{t}{\sqrt{2}} \cdot \frac{2}{x}\right)\right)\right) - \frac{2 \cdot \frac{t}{\sqrt{2}}}{x \cdot x}}\\ \mathbf{elif}\;t \le -2.2098329558361532 \cdot 10^{-133}:\\ \;\;\;\;\frac{\left(\sqrt{\sqrt{2}} \cdot t\right) \cdot \sqrt{\sqrt{2}}}{\sqrt{\mathsf{fma}\left(2, \left(t \cdot t\right), \left(\mathsf{fma}\left(\left(\frac{t \cdot t}{x}\right), 4, \left(\frac{2}{\frac{\frac{x}{\ell}}{\ell}}\right)\right)\right)\right)}}\\ \mathbf{elif}\;t \le -4.0265524264281273 \cdot 10^{-224}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\left(\frac{\frac{2 \cdot t}{x \cdot x}}{2 \cdot \sqrt{2}} - \mathsf{fma}\left(t, \left(\sqrt{2}\right), \left(\frac{t}{\sqrt{2}} \cdot \frac{2}{x}\right)\right)\right) - \frac{2 \cdot \frac{t}{\sqrt{2}}}{x \cdot x}}\\ \mathbf{elif}\;t \le 4.047479004404109 \cdot 10^{+116}:\\ \;\;\;\;\frac{\left(\sqrt{\sqrt{2}} \cdot t\right) \cdot \sqrt{\sqrt{2}}}{\sqrt{\mathsf{fma}\left(2, \left(t \cdot t\right), \left(\mathsf{fma}\left(\left(\frac{t \cdot t}{x}\right), 4, \left(\frac{2}{\frac{\frac{x}{\ell}}{\ell}}\right)\right)\right)\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(t, \left(\sqrt{2}\right), \left(\frac{t}{\sqrt{2}} \cdot \frac{2}{x}\right)\right) + \left(\frac{2 \cdot \frac{t}{\sqrt{2}}}{x \cdot x} - \frac{\frac{2 \cdot t}{x \cdot x}}{2 \cdot \sqrt{2}}\right)}\\ \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 -6.925769096924062 \cdot 10^{+57}:\\
\;\;\;\;\frac{\sqrt{2} \cdot t}{\left(\frac{\frac{2 \cdot t}{x \cdot x}}{2 \cdot \sqrt{2}} - \mathsf{fma}\left(t, \left(\sqrt{2}\right), \left(\frac{t}{\sqrt{2}} \cdot \frac{2}{x}\right)\right)\right) - \frac{2 \cdot \frac{t}{\sqrt{2}}}{x \cdot x}}\\

\mathbf{elif}\;t \le -2.2098329558361532 \cdot 10^{-133}:\\
\;\;\;\;\frac{\left(\sqrt{\sqrt{2}} \cdot t\right) \cdot \sqrt{\sqrt{2}}}{\sqrt{\mathsf{fma}\left(2, \left(t \cdot t\right), \left(\mathsf{fma}\left(\left(\frac{t \cdot t}{x}\right), 4, \left(\frac{2}{\frac{\frac{x}{\ell}}{\ell}}\right)\right)\right)\right)}}\\

\mathbf{elif}\;t \le -4.0265524264281273 \cdot 10^{-224}:\\
\;\;\;\;\frac{\sqrt{2} \cdot t}{\left(\frac{\frac{2 \cdot t}{x \cdot x}}{2 \cdot \sqrt{2}} - \mathsf{fma}\left(t, \left(\sqrt{2}\right), \left(\frac{t}{\sqrt{2}} \cdot \frac{2}{x}\right)\right)\right) - \frac{2 \cdot \frac{t}{\sqrt{2}}}{x \cdot x}}\\

\mathbf{elif}\;t \le 4.047479004404109 \cdot 10^{+116}:\\
\;\;\;\;\frac{\left(\sqrt{\sqrt{2}} \cdot t\right) \cdot \sqrt{\sqrt{2}}}{\sqrt{\mathsf{fma}\left(2, \left(t \cdot t\right), \left(\mathsf{fma}\left(\left(\frac{t \cdot t}{x}\right), 4, \left(\frac{2}{\frac{\frac{x}{\ell}}{\ell}}\right)\right)\right)\right)}}\\

\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(t, \left(\sqrt{2}\right), \left(\frac{t}{\sqrt{2}} \cdot \frac{2}{x}\right)\right) + \left(\frac{2 \cdot \frac{t}{\sqrt{2}}}{x \cdot x} - \frac{\frac{2 \cdot t}{x \cdot x}}{2 \cdot \sqrt{2}}\right)}\\

\end{array}
double f(double x, double l, double t) {
        double r667137 = 2.0;
        double r667138 = sqrt(r667137);
        double r667139 = t;
        double r667140 = r667138 * r667139;
        double r667141 = x;
        double r667142 = 1.0;
        double r667143 = r667141 + r667142;
        double r667144 = r667141 - r667142;
        double r667145 = r667143 / r667144;
        double r667146 = l;
        double r667147 = r667146 * r667146;
        double r667148 = r667139 * r667139;
        double r667149 = r667137 * r667148;
        double r667150 = r667147 + r667149;
        double r667151 = r667145 * r667150;
        double r667152 = r667151 - r667147;
        double r667153 = sqrt(r667152);
        double r667154 = r667140 / r667153;
        return r667154;
}

double f(double x, double l, double t) {
        double r667155 = t;
        double r667156 = -6.925769096924062e+57;
        bool r667157 = r667155 <= r667156;
        double r667158 = 2.0;
        double r667159 = sqrt(r667158);
        double r667160 = r667159 * r667155;
        double r667161 = r667158 * r667155;
        double r667162 = x;
        double r667163 = r667162 * r667162;
        double r667164 = r667161 / r667163;
        double r667165 = r667158 * r667159;
        double r667166 = r667164 / r667165;
        double r667167 = r667155 / r667159;
        double r667168 = r667158 / r667162;
        double r667169 = r667167 * r667168;
        double r667170 = fma(r667155, r667159, r667169);
        double r667171 = r667166 - r667170;
        double r667172 = r667158 * r667167;
        double r667173 = r667172 / r667163;
        double r667174 = r667171 - r667173;
        double r667175 = r667160 / r667174;
        double r667176 = -2.2098329558361532e-133;
        bool r667177 = r667155 <= r667176;
        double r667178 = sqrt(r667159);
        double r667179 = r667178 * r667155;
        double r667180 = r667179 * r667178;
        double r667181 = r667155 * r667155;
        double r667182 = r667181 / r667162;
        double r667183 = 4.0;
        double r667184 = l;
        double r667185 = r667162 / r667184;
        double r667186 = r667185 / r667184;
        double r667187 = r667158 / r667186;
        double r667188 = fma(r667182, r667183, r667187);
        double r667189 = fma(r667158, r667181, r667188);
        double r667190 = sqrt(r667189);
        double r667191 = r667180 / r667190;
        double r667192 = -4.0265524264281273e-224;
        bool r667193 = r667155 <= r667192;
        double r667194 = 4.047479004404109e+116;
        bool r667195 = r667155 <= r667194;
        double r667196 = r667173 - r667166;
        double r667197 = r667170 + r667196;
        double r667198 = r667160 / r667197;
        double r667199 = r667195 ? r667191 : r667198;
        double r667200 = r667193 ? r667175 : r667199;
        double r667201 = r667177 ? r667191 : r667200;
        double r667202 = r667157 ? r667175 : r667201;
        return r667202;
}

Error

Bits error versus x

Bits error versus l

Bits error versus t

Derivation

  1. Split input into 3 regimes
  2. if t < -6.925769096924062e+57 or -2.2098329558361532e-133 < t < -4.0265524264281273e-224

    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 8.9

      \[\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. Simplified8.9

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

    if -6.925769096924062e+57 < t < -2.2098329558361532e-133 or -4.0265524264281273e-224 < t < 4.047479004404109e+116

    1. Initial program 35.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 15.6

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

      \[\leadsto \frac{\sqrt{2} \cdot t}{\sqrt{\color{blue}{\mathsf{fma}\left(2, \left(t \cdot t\right), \left(\mathsf{fma}\left(\left(\frac{t \cdot t}{x}\right), 4, \left(\frac{2}{\frac{x}{\ell \cdot \ell}}\right)\right)\right)\right)}}}\]
    4. Using strategy rm
    5. Applied associate-/r*11.6

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

      \[\leadsto \frac{\sqrt{\color{blue}{\sqrt{2} \cdot \sqrt{2}}} \cdot t}{\sqrt{\mathsf{fma}\left(2, \left(t \cdot t\right), \left(\mathsf{fma}\left(\left(\frac{t \cdot t}{x}\right), 4, \left(\frac{2}{\frac{\frac{x}{\ell}}{\ell}}\right)\right)\right)\right)}}\]
    8. Applied sqrt-prod11.8

      \[\leadsto \frac{\color{blue}{\left(\sqrt{\sqrt{2}} \cdot \sqrt{\sqrt{2}}\right)} \cdot t}{\sqrt{\mathsf{fma}\left(2, \left(t \cdot t\right), \left(\mathsf{fma}\left(\left(\frac{t \cdot t}{x}\right), 4, \left(\frac{2}{\frac{\frac{x}{\ell}}{\ell}}\right)\right)\right)\right)}}\]
    9. Applied associate-*l*11.7

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

    if 4.047479004404109e+116 < t

    1. Initial program 53.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 2.5

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

      \[\leadsto \frac{\sqrt{2} \cdot t}{\color{blue}{\mathsf{fma}\left(t, \left(\sqrt{2}\right), \left(\frac{2}{x} \cdot \frac{t}{\sqrt{2}}\right)\right) + \left(\frac{\frac{t}{\sqrt{2}} \cdot 2}{x \cdot x} - \frac{\frac{2 \cdot t}{x \cdot x}}{\sqrt{2} \cdot 2}\right)}}\]
  3. Recombined 3 regimes into one program.
  4. Final simplification9.1

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \le -6.925769096924062 \cdot 10^{+57}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\left(\frac{\frac{2 \cdot t}{x \cdot x}}{2 \cdot \sqrt{2}} - \mathsf{fma}\left(t, \left(\sqrt{2}\right), \left(\frac{t}{\sqrt{2}} \cdot \frac{2}{x}\right)\right)\right) - \frac{2 \cdot \frac{t}{\sqrt{2}}}{x \cdot x}}\\ \mathbf{elif}\;t \le -2.2098329558361532 \cdot 10^{-133}:\\ \;\;\;\;\frac{\left(\sqrt{\sqrt{2}} \cdot t\right) \cdot \sqrt{\sqrt{2}}}{\sqrt{\mathsf{fma}\left(2, \left(t \cdot t\right), \left(\mathsf{fma}\left(\left(\frac{t \cdot t}{x}\right), 4, \left(\frac{2}{\frac{\frac{x}{\ell}}{\ell}}\right)\right)\right)\right)}}\\ \mathbf{elif}\;t \le -4.0265524264281273 \cdot 10^{-224}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\left(\frac{\frac{2 \cdot t}{x \cdot x}}{2 \cdot \sqrt{2}} - \mathsf{fma}\left(t, \left(\sqrt{2}\right), \left(\frac{t}{\sqrt{2}} \cdot \frac{2}{x}\right)\right)\right) - \frac{2 \cdot \frac{t}{\sqrt{2}}}{x \cdot x}}\\ \mathbf{elif}\;t \le 4.047479004404109 \cdot 10^{+116}:\\ \;\;\;\;\frac{\left(\sqrt{\sqrt{2}} \cdot t\right) \cdot \sqrt{\sqrt{2}}}{\sqrt{\mathsf{fma}\left(2, \left(t \cdot t\right), \left(\mathsf{fma}\left(\left(\frac{t \cdot t}{x}\right), 4, \left(\frac{2}{\frac{\frac{x}{\ell}}{\ell}}\right)\right)\right)\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(t, \left(\sqrt{2}\right), \left(\frac{t}{\sqrt{2}} \cdot \frac{2}{x}\right)\right) + \left(\frac{2 \cdot \frac{t}{\sqrt{2}}}{x \cdot x} - \frac{\frac{2 \cdot t}{x \cdot x}}{2 \cdot \sqrt{2}}\right)}\\ \end{array}\]

Reproduce

herbie shell --seed 2019133 +o rules:numerics
(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)))))