Average Error: 20.0 → 10.3
Time: 11.5s
Precision: 64
\[\frac{1}{\sqrt{x + y \cdot y}}\]
\[\begin{array}{l} \mathbf{if}\;y \le 5.5096198901485785 \cdot 10^{81}:\\ \;\;\;\;\frac{1}{\sqrt{x + y \cdot y}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{y}\\ \end{array}\]
\frac{1}{\sqrt{x + y \cdot y}}
\begin{array}{l}
\mathbf{if}\;y \le 5.5096198901485785 \cdot 10^{81}:\\
\;\;\;\;\frac{1}{\sqrt{x + y \cdot y}}\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{y}\\

\end{array}
double f(double x, double y) {
        double r21991 = 1.0;
        double r21992 = x;
        double r21993 = y;
        double r21994 = r21993 * r21993;
        double r21995 = r21992 + r21994;
        double r21996 = sqrt(r21995);
        double r21997 = r21991 / r21996;
        return r21997;
}

double f(double x, double y) {
        double r21998 = y;
        double r21999 = 5.5096198901485785e+81;
        bool r22000 = r21998 <= r21999;
        double r22001 = 1.0;
        double r22002 = x;
        double r22003 = r21998 * r21998;
        double r22004 = r22002 + r22003;
        double r22005 = sqrt(r22004);
        double r22006 = r22001 / r22005;
        double r22007 = r22001 / r21998;
        double r22008 = r22000 ? r22006 : r22007;
        return r22008;
}

Error

Bits error versus x

Bits error versus y

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Split input into 2 regimes
  2. if y < 5.5096198901485785e+81

    1. Initial program 13.3

      \[\frac{1}{\sqrt{x + y \cdot y}}\]

    if 5.5096198901485785e+81 < y

    1. Initial program 40.5

      \[\frac{1}{\sqrt{x + y \cdot y}}\]
    2. Taylor expanded around 0 1.5

      \[\leadsto \frac{1}{\color{blue}{y}}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification10.3

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \le 5.5096198901485785 \cdot 10^{81}:\\ \;\;\;\;\frac{1}{\sqrt{x + y \cdot y}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{y}\\ \end{array}\]

Reproduce

herbie shell --seed 1 
(FPCore (x y)
  :name "1/sqrt(x+y*y)"
  (/ 1.0 (sqrt (+ x (* y y)))))